text stringlengths 1 927k |
|---|
# Copyright (c) 2014 OpenStack 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.14.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re... |
#!/usr/bin/env python3
import errno
import os
import sys
import logging
import argparse
import re
from common import (
config as c,
pb,
Colors,
get_cmd_or_die,
get_rust_toolchain_libpath,
NonZeroReturn,
regex,
setup_logging,
die,
ensure_dir,
)
from enum import Enum
from rust_fi... |
import time
import logging
from aion.microservice import main_decorator, Options, WITH_KANBAN
# services.ymlに記載するサービス名
SERVICE_NAME = "dummy-test-kanban"
CONNECTION_KEY = "default"
# @main_decorator は aion-statuskan と接続・マイクロサービスが正常に立ち上がったことを通知する
@main_decorator(SERVICE_NAME, WITH_KANBAN)
def main(opt: Options):
c... |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
#from canvas.models import Comment, Category
class Migration(DataMigration):
def forwards(self, orm):
# This only mattered for live instances at the time.
"""
for cate... |
"""
Balanced strings are those that have an equal quantity of 'L' and 'R' characters.
Given a balanced string s, split it in the maximum amount of balanced strings.
Return the maximum amount of split balanced strings.
Input: s = "RLRRLLRLRL"
Output: 4
Explanation: s can be split into "RL", "RRLL", "RL", "RL",
each su... |
# coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... |
from __future__ import print_function
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from tqdm import tqdm
class Trainer():
def __init__(self, model, device, train_loader, test_loader, optimizer, loss_func, lr_scheduler):
self.is_last_epoch = False
# ... |
# -*- coding: utf-8 -*-
'''
A module to wrap (non-Windows) archive calls
.. versionadded:: 2014.1.0
'''
from __future__ import absolute_import
import contextlib # For < 2.7 compat
import copy
import errno
import glob
import logging
import os
import re
import shlex
import stat
import subprocess
import tarfile
import z... |
"""
Django settings for test_project project.
Generated by 'django-admin startproject' using Django 1.9.7.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import ... |
# -*- coding: utf-8 -*-
"""
:author: Grey Li (李辉)
:url: http://greyli.com
:copyright: © 2018 Grey Li
:license: MIT, see LICENSE for more details.
"""
import click
from flask import Flask
app = Flask(__name__)
# the minimal Flask application
# app.route()装饰器把根地址(/)和函数index()绑定起来,当用户访问该URL(/)时就触发此函数ind... |
# Auto-generated at 2018/05/21 12:12:17 using data aggregated from:
# https://dev.mysql.com/doc/refman/5.5/en/error-messages-server.html
# https://dev.mysql.com/doc/refman/5.6/en/error-messages-server.html
# https://dev.mysql.com/doc/refman/5.7/en/error-messages-server.html
# https://dev.mysql.com/doc/refman/8.... |
#!/bin/env/python3
#-*- encdoing: utf-8 -*-
"""
"""
from __future__ import print_function
from __future__ import division
import sys
import os
DEFAULT_NODES = 1
DEFAULT_CORES = 1
DEFAULT_WALLTIME = '1:00:00'
DEFAULT_MEMORY = '8GB'
DEFAULT_CPU = '1:00:00'
DEFAULT_WAIT_TIME = 1
# Maximum number of nodes
MAX_NODE... |
'''cgat_ruffus_profile.py - analyze ruffus logfile
==================================================
Purpose
-------
This script collects information about tasks that have completed or
are still running in a pipeline. It works by examining the logfile
:file:`pipeline.log` looking for the last active run. It will co... |
import numpy as np
#hitCircle calculates where the first stronghold generation ring starts, where the player would "hit" it, moving directly forward
#and calculates the position to the second ender eye throw
def hitCircle(pX,pZ,angle):
xHit = None
yHit = None
cos = np.cos(angle*np.pi/180)
#if the stron... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
# 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, software
# distributed under ... |
from setuptools import setup, find_packages
setup(
name='mord',
version="0.6",
description='Ordinal regression models',
long_description=open('README.rst').read(),
author='Fabian Pedregosa',
author_email='f@bianp.net',
url='https://pypi.python.org/pypi/mord',
packages=find_packages(excl... |
import time
import yaml
import numpy as np
from paddlehub.common.logger import logger
from slda_news.config import ModelType
def load_prototxt(config_file, config):
"""
Args:
config_file: model configuration file.
config: ModelConfig class
"""
logger.info("Loading SLDA config.")
... |
# Generated by Django 3.1.5 on 2021-02-21 19:18
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('books', '0004_auto_20210221_2043'),
]
operations = [
migrations.AlterField(
model_name='book',
name='image',
... |
import itertools
from enum import Flag, auto
from typing import List
class Modifier(Flag):
NONE = 0
CTRL = auto()
ALT = auto()
SHIFT = auto()
SUPER = auto()
__MODIFIER_LIST = list(Modifier)[1:]
ALL_PREFIXES: List[Modifier] = []
for bits in itertools.product([0, 1], repeat=len(__MODIFIER_LIST))... |
import numpy as np
from typing import Union, Tuple, Dict
class Agent(object):
def get_action(self, obs:np.ndarray, stochastic:bool=True)-> Tuple[Union[int, np.ndarray, Dict], float]:
raise NotImplementedError
def update(self, obs:np.ndarray, act:Union[int, np.ndarray, Dict], blogp:float, reward:float... |
# coding: utf-8
"""
Tickets
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v3
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from hubsp... |
# Copyright (c) 2012-2015 Netforce Co. Ltd.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publ... |
# -*- coding: utf-8 -*-
# flake8: noqa
from app.omnisearch.queries import Query |
import datetime
import os
import pandas as pd
from flask_caching import Cache
import seaborn as sns
from scipy.stats import pearsonr
import numpy as np
import math
from sklearn.cluster import DBSCAN
from sklearn.linear_model import LinearRegression
from sklearn.preprocessing import StandardScaler
cache = Cache()
FI... |
# Copyright (C) 2020-21 Dr. Ralf Schlatterbeck Open Source Consulting.
# Reichergasse 131, A-3411 Weidling.
# Web: http://www.runtux.com Email: office@runtux.com
# All rights reserved
# ****************************************************************************
# This program is free software; you can redistribute it ... |
# Generated by Django 4.0.1 on 2022-01-25 23:20
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('theblog', '0013_profile_github_url'),
]
operations = [
migrations.AlterField(
model_name='post',
name='category',
... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import tensorflow.contrib.slim as slim
class PoseDiscriminator(object):
def __init__(self, weight_decay):
self.vars = []
self.reuse = False
self.wd = weight... |
import argparse
import json
import os
import pickle
import sys
import sagemaker_containers
import pandas as pd
import torch
import torch.optim as optim
import torch.utils.data
from model import LSTMClassifier
def model_fn(model_dir):
"""Load the PyTorch model from the `model_dir` directory."""
print("Loading ... |
# -*- coding: utf-8 -*-
"""
Display status of Dropbox daemon.
Configuration parameters:
cache_timeout: refresh interval for this module (default 10)
format: display format for this module (default "Dropbox: {status}")
status_busy: text for placeholder {status} when Dropbox is busy (default None)
status... |
#Instructions
#1 - Revisit our bikeshare traffic
#2 - Update our DAG with
# a - @monthly schedule_interval
# b - max_active_runs of 1
# c - start_date of 2018/01/01
# d - end_date of 2018/02/01
# Use Airflow’s backfill capabilities to analyze our trip data on a monthly basis over 2 historical runs
import datetime... |
import sys
import requests
import time
from . import FeedSource, _request_headers
class OkExOtc(FeedSource):
def _fetch(self):
feed = {}
t = int(time.time())
for base in self.bases:
for quote in self.quotes:
if quote == base:
continue
... |
#!/usr/bin/env python3
import pytoml as toml
import click
import re
import os
import magic
import logging
import fnmatch
import chardet
import time
import jsonpickle
from veinmind import *
from stat import *
# logger
formatter = logging.Formatter('%(asctime)s %(levelname)-8s %(message)s')
handler = logging.StreamHandl... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2017-12-20 12:42
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('projects', '0057_merge_20171205_1236'),
('projects', '0055_project_campaign_edited'),
]
... |
from setuptools import setup, find_packages
from setuptools import Extension
import os
from io import open
from compile_externals import compile_all
import subprocess as sp
import versioneer
CONFIG_NAME = "gimmemotifs.cfg"
DESCRIPTION = "GimmeMotifs is a motif prediction pipeline."
with open("README.md", encoding="u... |
# -*- coding: utf-8 -*-
#############################################################################
# @package ad_hmi.framework
# @brief init methode of python package ad_hmi.framework.
#############################################################################
# @author WANG Vincent
# @copyright (c) All rights res... |
# -*- coding: utf-8 -*-
"""
HypeMan in python
"""
import configparser
import socketserver
#import time
import json
import threading
import discord
import os
config = configparser.ConfigParser()
config.read('hypeman.ini')
BOT_ID = config['HYPEMAN']['BOT_ID']
PORT = config.getint('HYPEMAN', 'PORT')
HOST = config['HYPE... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
r"""Provide the basketball environment.
"""
# TODO: finish to implement this environment
import pyrobolearn as prl
from pyrobolearn.worlds.samples.sports.basketball import BasketBallWorld
from pyrobolearn.envs.env import Env
__author__ = "Brian Delhaisse"
__copyright__ ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# PennyLane-Cirq documentation build configuration file, created by
# sphinx-quickstart on Tue Apr 17 11:43:51 2018.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in th... |
"""Thorchain Module for XChainPY Clients
.. moduleauthor:: Thorchain
"""
__version__ = '0.1.7' |
from django.db import models
from django.dispatch import receiver
from django.db.models.signals import post_save, pre_save
class BaseModel(models.Model):
created_date = models.DateTimeField(auto_now_add=True)
created_by = models.TextField(blank=True, null=True)
updated_date = models.DateTimeField(auto_now... |
forward = """
CREATE TABLE edmodo_groups (
group_id bigint(10) NOT NULL,
sandbox tinyint(1) NOT NULL DEFAULT '0',
created datetime NOT NULL,
PRIMARY KEY (group_id),
UNIQUE KEY group_id (group_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
"""
reverse = """
DROP TABLE edmodo_groups;
"""
step(forward, reverse) |
# stdlib
import sys
from typing import Any
from typing import Dict
from typing import Iterator
from typing import List
from typing import Optional
from typing import Tuple
from typing import Union
# third party
from google.protobuf.reflection import GeneratedProtocolMessageType
from nacl.signing import SigningKey
from... |
from numpy import float32
import tensorflow as tf
import constants as c
def _parse_example(example_proto):
features = {
"sequence": tf.io.FixedLenFeature((), tf.string, default_value=""),
"ss3": tf.io.VarLenFeature(tf.int64),
"ss8": tf.io.VarLenFeature(tf.int64)
}
parsed_features = ... |
# ___
# \./ DANGER: This project implements some code generation
# .--.O.--. techniques involving string concatenation.
# \/ \/ If you look at it, you might die.
#
r"""
Installation
************
.. code-block:: bash
pip install fastjsonschema
Support only for Python 3.3 and highe... |
from panda3d.core import *
from toontown.toonbase import ToontownGlobals
import Playground, random, time
from otp.nametag.NametagConstants import *
from toontown.launcher import DownloadForceAcknowledge
from direct.task.Task import Task
from toontown.hood import ZoneUtil
from toontown.election import SafezoneInvasionGl... |
from tests.integration.util import (
create_client,
CREDENTIALS,
SANDBOX_INSTITUTION,
)
access_token = None
def setup_module(module):
client = create_client()
response = client.Item.create(
CREDENTIALS, SANDBOX_INSTITUTION, ['identity'])
global access_token
access_token = response... |
""" Test constants """
CONSUMER = "consumer"
NOTIFIER = "notifier"
PRODUCER = "producer"
DEFAULT = "default"
MCD = "mcd"
DCP = "dcp"
SUCCESS = 0
DEFAULT_CONN_NAME = "default_dcp_connection"
""" Error Messages """
EINV_KEY = "ERROR: Received invalid key"
EINV_RESPONSE = "ERROR: received invalid stream response"
ENO_BUC... |
from __future__ import print_function
import yaml
import os
import re
import shutil
import subprocess
from copy import deepcopy
import CreateSectionTable
TEST_CASE_PATTERN = {
"initial condition": "UTINIT1",
"SDK": "ESP32_IDF",
"level": "Unit",
"execution time": 0,
"auto test": "Yes",
"categor... |
from zeit.content.cp.centerpage import CenterPage
import zeit.content.cp.testing
class TestAdminMenu(zeit.content.cp.testing.BrowserTestCase):
login_as = 'zmgr:mgrpw'
def test_smoke(self):
self.repository['centerpage'] = CenterPage()
b = self.browser
b.open('http://localhost/++skin+... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
"""
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environments in more advan... |
from rest_framework.exceptions import APIException
class NoResultsMatch(APIException):
"""
Define error when search is not valid
"""
status_code = 400
default_detail = 'results matching search not found' |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import unittest
from unittest import skipUnless
from django.conf import settings
from django.contrib.gis.geos import HAS_GEOS
from django.contrib.gis.geoip import HAS_GEOIP
from django.utils import six
if HAS_GEOIP:
from . import GeoIP, G... |
"""
Genome
======
TODO:
-----
. To be replaced by genome_sql
"""
import sys, os, csv
from . import config, utils
from .genelist import genelist
from .errors import AssertionError
from .location import location
from .progress import progressbar
from .format import sniffer, sniffer_tsv
from .data import *
class geno... |
from glob import glob
from tqdm import tqdm as tq
from scipy.io.wavfile import read, write
from resampy import resample
new_rate = 16000
path = "./data/DSD100_16kHz/Sources/*/*/*.wav"
for file in tq(glob(path)):
rate, array = read(file)
new_array = resample(array,rate, new_rate, axis=0)
write(file, new_rat... |
#!/usr/bin/env python
# ******************************************************************************
# Copyright 2017-2018 Intel Corporation
#
# 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
... |
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load(":dev_binding.bzl", "envoy_dev_binding")
load(":genrule_repository.bzl", "genrule_repository")
load("@envoy_api//bazel:envoy_http_archive.bzl", "envoy_http_archive")
load(":repository_locations.bzl", "REPOSITORY_LOCATIONS")
load("@com_google_goog... |
#!/usr/bin/env python
"""Tests for report plugins."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import itertools
import math
from absl import app
from future.builtins import range
from grr_response_core import config
from grr_response_core.lib impo... |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
"""
This module contains routines related to the module command for accessing and
parsing environment modules.
"""
import ... |
# Copyright (c) 2019 - The Procedural Generation for Gazebo authors
# For information on the respective copyright owner see the NOTICE file
#
# 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
#
#... |
# Copyright 2019 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.
from hashlib import sha256
from recipe_engine import recipe_test_api
class CloudBuildHelperTestApi(recipe_test_api.RecipeTestApi):
def build_success_out... |
from setuptools import setup
from ipinfo.version import SDK_VERSION
long_description = """
The official Python library for IPinfo.
IPinfo prides itself on being the most reliable, accurate, and in-depth source of IP address data available anywhere.
We process terabytes of data to produce our custom IP geolocation, c... |
# 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.
import io
import os
import pkgutil
import unittest
from unittest import TestCase
import pandas as pd
from kats.consts import TimeSeriesData
fro... |
import sklearn.mixture
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import ticker
import matplotlib.patheffects as mpatheffects
def get_gmm_and_pos_label(
array, n_components=2, n_steps=5000
):
gmm = sklearn.mixture.GaussianMixture(
n_components=n_components, covariance_type='sph... |
import seq_toolkit
def _merge_reduce_gene_regions(feature_df, gene, feature):
"""
Often, when isolating a feature from a GTF for a given gene (ex: exons), there are many overlapping
isoforms that can be collapsed to avoid redundancy in identifying sgRNAs. This function uses the more
general `GenomicFe... |
firstNqma = input()
secondName = input()
age = int(input())
town = input()
print('You are '+firstNqma+' '+ secondName+', a '+ str(age) +'-years old person from '+town+'.') |
import sys
FILENAME='uss.txt'
f=open(FILENAME, 'w')
for i in range(100):
head=""
if(i%10==0):
head="\nSEZIONE\n"
s=head + str(i)+". "+"As a "+ "I want to "+"\
so that I can \n "
f.write(s); |
#
# Author: Denis Tananaev
# File: conv.py
# Date: 9.02.2017
# Description: convolution functions for neural networks
#
#include libs
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
#import os
from six.moves import xrange
#import os
#import re
#import sys
#i... |
class BuildError(Exception):
def __init__(self, message="Build error."):
self.message = message
class TestError(Exception):
def __init__(self, message="Test error."):
self.message = message
class InstallError(Exception):
def __init__(self, message="Install error."):
self.message ... |
import argparse
import os
import numpy as np
import librosa
import scipy.io.wavfile as scwav
import scipy.signal as scisig
import pylab
import numpy.matlib as npmat
import utils.preprocess as preproc
from utils.helper import smooth, generate_interpolation
#from nn_models.model_embedding_wasserstein import VariationalC... |
#
# This file is part of pysmi software.
#
# Copyright (c) 2015-2016, Ilya Etingof <ilya@glas.net>
# License: http://pysmi.sf.net/license.html
#
import sys
import os
import time
try:
from pwd import getpwuid
except ImportError:
getpwuid = lambda x: ['<unknown>']
from pysmi import __name__ as packageName
from py... |
# -*- coding: utf-8 -*-
import argparse
import sys
from configparser import ConfigParser, NoSectionError, MissingSectionHeaderError
from esm_full_backup.esm_full_backup import Config, ESM, dehexify
def main():
config = Config()
try:
host = config.esmhost
except AttributeError:
... |
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
from spack import *
class Netgauge(AutotoolsPackage):
"""Netgauge is a high-precision network parameter m... |
#!/usr/bin/python
r"""
This script can be used for reverting certain edits.
The following command line parameters are supported:
-username Edits of which user need to be reverted.
Default is bot's username (site.username())
-rollback Rollback edits instead of reverting them.
... |
#-------------------------------------------------------------------------------
#
# Project: EOxServer <http://eoxserver.org>
# Authors: Stephan Krause <stephan.krause@eox.at>
# Stephan Meissl <stephan.meissl@eox.at>
# Fabian Schindler <fabian.schindler@eox.at>
#
#------------------------------------... |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
"""
This module implements loading meshes from glTF 2 assets stored in a
GLB container file or a glTF JSON file ... |
import numpy as np
import pandas as pd
import regex
from namedivider.divided_name import DividedName
from namedivider.kanji_statistics import KanjiStatistics
from pathlib import Path
from typing import Optional
CURRENT_DIR = Path(__file__).resolve().parent
class NameDivider:
def __init__(self, path_csv: str = f"{... |
#!/usr/bin/python2.7
'''
---------------------------
Licensing and Distribution
---------------------------
Program name: Pilgrim
Version : 1.0
License : MIT/x11
Copyright (c) 2019, David Ferro Costas (david.ferro@usc.es) and
Antonio Fernandez Ramos (qf.ramos@usc.es)
Permission is hereby granted, free of ch... |
from sys import maxsize
class Group:
def __init__(self, name=None, footer=None, header=None, id=None):
self.name = name
self.footer = footer
self.header = header
self.id = id
def __repr__(self):
return "%s:%s:%s:%s" % (self.id, self.name, self.footer, self.header)
... |
"""
Django settings for app project.
Generated by 'django-admin startproject' using Django 3.0.3.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
# Bui... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.22
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import r... |
# pylint: disable=invalid-name,too-many-locals,too-many-arguments
import typing
import string
import tensorflow as tf
from tensorflow import keras
import numpy as np
import cv2
from . import tools
DEFAULT_BUILD_PARAMS = {
'height': 31,
'width': 200,
'color': False,
'filters': (64, 128, 256, 256, 512,... |
"""Setup Module to setup Python serverextension for the sagemaker run notebook
extension. For non-dev installs, will also automatically
build (if package.json is present) and install (if the labextension exists,
eg the build succeeded) the corresponding labextension.
"""
import os
from pathlib import Path
from subproce... |
import numpy as np
from keras.models import load_model
import MeCab
import re
def calc_humor_score(text, model, word_index):
(words, reading) = morph(text)
if not is_dajare(reading):
return 0
return predict(words, model, word_index)
def morph(text):
words = [] # 単語の原形
reading = ""... |
# Auto generated by generator.py. Delete this line if you make modification.
from scrapy.spiders import Rule
from scrapy.linkextractors import LinkExtractor
XPATH = {
'name' : "//div[@class='overview']/h1[@class='product-name']",
'price' : "//div[@class='prices']/span[@class='product-price']",
'category' :... |
from .base_worker import WorkerJobsConnection
__all__ = (
"WorkerJobsConnection",
) |
"""
Автор: Моисеенко Павел, группа № 1, подгруппа № 2.
ИСР 4.2. Задание: создать программу по распределению списка со
случайными значениями на два списка по определенному критерию
(четность/нечетность, положительные/отрицательные числа).
"""
import random
first_array = []
positive_numbers = []
negat... |
#
# Copyright (c) 2021 Citrix Systems, 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 torch
from torch import Tensor
from kge import Config, Dataset
from kge.model.kge_model import KgeModel
import json
import os
import numpy as np
import time
class hmcn_model(KgeModel):
"""
Implements hierarchical Multi-Label classification Network as defined in Wehrmann et al. (2018)
Codes ... |
# Copyright 1999-2020 Alibaba Group Holding Ltd.
#
# 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... |
from __future__ import annotations
from stupidb import Window, dense_rank, order_by, over, rank, row_number, select, table
from stupidb.functions.ranking import Sentinel
from .conftest import assert_rowset_equal
def test_row_number(t_rows: list[dict]) -> None:
window = Window.range(partition_by=[lambda r: r.nam... |
import yaml
from collections import OrderedDict
from os import path as osp
def ordered_yaml():
"""Support OrderedDict for yaml.
Returns:
yaml Loader and Dumper.
"""
try:
from yaml import CDumper as Dumper
from yaml import CLoader as Loader
except ImportError:
from ... |
from .taiwan_travel import run_task |
"""Decorator for Uptime Robot"""
from __future__ import annotations
import asyncio
from typing import TYPE_CHECKING
import aiohttp
from pyuptimerobot import exceptions
from .const import API_BASE_URL, API_HEADERS, LOGGER
from .models import APIStatus, UptimeRobotApiResponse
if TYPE_CHECKING:
from .uptimerobot ... |
import logging
import yaml
import json
import sys
import os
logger = logging.getLogger('telemanom')
sys.path.append('../telemanom')
class Config:
"""Loads parameters from config.yaml into global object
"""
def __init__(self, path_to_config):
self.path_to_config = path_to_config
if os.... |
from .validator_error import ValidatorError
class BaseValidator:
def __init__(self, settings):
self._settings = settings
def validate_upload(self):
raise ValidatorError("Unsupported function call.")
def validate_download(self):
raise ValidatorError("Unsupported function call.")
def validate_firmware(sel... |
import os.path
import tempfile
from unittest import TestCase
from code.nn import NeuralNetwork
class NeuralNetworkTestCase(TestCase):
def setUp(self):
self.net = NeuralNetwork(vocab_sizes={
'forms': 42, 'lemmas': 42, 'morph': 104, 'pos_tags': 18})
def test_model_files_error(self):
with tempfile.Temp... |
"""
The function bhatta_dist() calculates the Bhattacharyya distance between two classes on a single feature.
The distance is positively correlated to the class separation of this feature. Four different methods are
provided for calculating the Bhattacharyya coefficient.
Created on 4/14/2018
Author: Eric Willi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.