text stringlengths 2 999k |
|---|
# Copyright (c) 2018-2019, 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 of source code must retain the above copyright
# notice, this list of conditi... |
# Script to generate text files containing training and validation image paths for YoloV4
import os
import glob
import argparse
from tqdm import tqdm
def create_text_files(inputTrainingDirectory, inputValidationDirectory, outputDirectory):
"""
Function to generate text files containing training and validation... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Defines a Python module and the functions it contains.
"""
import os
import importlib
from types import ModuleType
from typing import Dict, Optional, List
from .command_param import CommandParam, DEFAULT_HELP_PARAM, DEFAULT_VERSION_PARAM
from .command_method import C... |
from django.core.management.base import BaseCommand
from reversion.models import Version
from six.moves import input
from waldur_core.quotas.models import Quota
class Command(BaseCommand):
help = "Delete quotas versions duplicates."
def handle(self, *args, **options):
self.stdout.write('Collecting d... |
import os
import unittest
import jina.proto.jina_pb2 as jina_pb2
from google.protobuf.json_format import MessageToJson
from jina.executors.indexers import BaseIndexer
from jina.executors.indexers.keyvalue.leveldb import LeveldbIndexer
from tests import JinaTestCase
cur_dir = os.path.dirname(os.path.abspath(__file__))... |
import json
from pathlib import Path
from typing import Dict, Any, Union
from final_filter.abc_filtering_module import FilteringModule
class ConceptNetHyponymModule(FilteringModule):
def __init__(self, filename: Union[str, Path]):
self.filename = filename
with open(filename) as f:
se... |
#!/usr/bin/env python
'''Converts sequence of images to compact PDF while removing speckles,
bleedthrough, etc.
'''
# for some reason pylint complains about members being undefined :(
# pylint: disable=E1101
from __future__ import print_function
import sys
import os
import re
import subprocess
import shlex
# For ... |
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as F
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
class CodeEncoder(nn.Module):
def __init__(self, vecs, drop=0, hidden_sz=50, num_layers=1, gpu=False):
super(CodeEncoder, self).__... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Message',
fields=[
('id', mode... |
from collections import defaultdict
from typing import Tuple, Union, Dict
import torch
import numpy as np
from ....data.subject import Subject
from ... import IntensityTransform, FourierTransform
from .. import RandomTransform
class RandomSpike(RandomTransform, IntensityTransform, FourierTransform):
r"""Add ran... |
# 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 ... |
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'stats.settings.development')
try:
from django.core.management import execute_from_command_line
e... |
import unittest
import sys
import os
# Hopefully I can import the planner package another way...
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import termplanner.planner as planner
class PlannerTestCase(unittest.TestCase):
def setUp(self):
"""Sets up a temporary plan... |
# -*- coding: utf-8 -*-
# Copyright © 2017 Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can
# be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
"""
@package turicreate.toolkits
Defines a basic interface for a model object.
"""
... |
# ------------------------------------------------------------------------------
# Libraries
# ------------------------------------------------------------------------------
import datetime
import json
import logging
import math
import os
from time import time
import torch
from utils.visualization import WriterTens... |
# 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 ... |
"""Class to add FSL installation to Dockerfile.
FSL wiki: https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/
FSL license: https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/Licence
"""
# Author: Jakub Kaczmarzyk <jakubk@mit.edu>
from __future__ import absolute_import, division, print_function
from distutils.version import LooseVersion
impo... |
# -*- coding: utf-8 -*-
"""
Estimate Relaxation from Band Powers
This example shows how to buffer, epoch, and transform EEG data from a single
electrode into values for each of the classic frequencies (e.g. alpha, beta, theta)
Furthermore, it shows how ratios of the band powers can be used to estimate
mental state for... |
import cv2
import numpy as np
from PIL import Image
class GrainBoundariesMap():
def __init__(self):
self.threshold = 100
self.edges_path = ''
self.contours_path = ''
self.thresholded_path = ''
def LoadImage(self, image):
self.image = image
self.cv2image = cv2.i... |
# -*- coding: utf-8 -*-
import importlib
import logging
import os
import click
from optimus.conf.loader import import_settings_module, load_settings
from optimus.exceptions import ServerConfigurationError
from optimus.setup_project import setup_project
from optimus.utils import display_settings
from optimus.interface... |
import _plotly_utils.basevalidators
class NamelengthsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="namelengthsrc", parent_name="cone.hoverlabel", **kwargs
):
super(NamelengthsrcValidator, self).__init__(
plotly_name=plotly_name,
... |
# cython: language_level=3
# Copyright (c) 2014-2018, Dr Alex Meakins, Raysect Project
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the ab... |
'''Entry point into the agents module set'''
from .base_agent import BaseAgent
from .docker_agent import DockerAgent
from .http_agent import HttpAgent
from .player_agent import PlayerAgent
from .player_agent_blocking import PlayerAgentBlocking
from .random_agent import RandomAgent
from .random_agent import RandomAgentN... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import boto3
from hermes_python.hermes import Hermes
from hermes_python.ffi.utils import MqttOptions
from hermes_python.ontology import *
import dynamo
piz = None;
intents = ["kaboe003:PatientIntent", "kaboe003:ZSTIntent", "kaboe003:MUIntent", "kaboe003:ZahnIntent"]
d... |
__author__ = 'Scott'
import pygame
from pytmx import *
from pytmx.util_pygame import load_pygame
class TileLayer(object):
def __init__(self, index, mapObj):
self.index = index
self.tiles = pygame.sprite.Group()
self.mapObj = mapObj
for x in range(self.mapObj.width):
fo... |
import sys
# if sys.version_info.minor <= 7:
import posix_ipc
import mmap
class SharedMemory:
"""A wrapper for posix_ipc.SharedMemory, posix_ipc.Semaphore and the correlating mapfile to simplify usage.
"""
def __init__(self, memory: posix_ipc.SharedMemory, semaphore: posix_ipc.Semaphore, mapfile: mmap.m... |
#!/usr/bin/env python
import os
import plistlib
import re
import string
import sys
from unicodedata import normalize
# Characters permitted in workflow filenames
OK_CHARS = set(string.ascii_letters + string.digits + '-.')
def safename(name):
"""Make name filesystem and web-safe."""
if isinstance(name, str)... |
import json
import requests
class question():
def __init__(self, text = None, answer = None, guess = None):
self.text = text
self.answer = answer
self.guess = guess
def ask(self):
"""ask for the answer"""
print(self.text)
self.guess = str(input("Your ans... |
# Copyright 2021 The Flax 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 wri... |
from skorecard.bucketers import DecisionTreeBucketer, OptimalBucketer
from sklearn.pipeline import make_pipeline
def test_full_pipeline(df):
"""Tests some complete pipelines."""
X = df.drop(columns=["default"])
y = df["default"]
num_cols = ["LIMIT_BAL", "BILL_AMT1"]
cat_cols = ["EDUCATION", "MARR... |
import io
import re
import spectra
from PIL import Image
from ..help import add_help_item
from userbot.utils import parse_arguments
from userbot.events import register
@register(outgoing=True, pattern=r"^\.color\s+(.*)")
async def color_props(e):
params = e.pattern_match.group(1) or ""
args, color = parse_a... |
from typing import Dict, List, Optional
import os
from glob import glob
from yaml.parser import ParserError, ScannerError
from bs4 import BeautifulSoup
from app_settings.app_settings import AppSettings
from general_tools import file_utils
from general_tools.file_utils import write_file
from resource_container.Resourc... |
"""
Copyright (c) Facebook, Inc. and its affiliates.
"""
# fmt: off
'''
Every template contains an ordered list of TemplateObjects.
TemplateObject is defined in template_objects.py
Copy templates are written for a BlockObject and may have a Location,
and represent the intent for the action: Copy.
This action builds a... |
#!/usr/bin/env python
# coding: utf-8
# In[2]:
# general libraries
import os
import sys
import math
import statistics
import collections
import missingno as msno
from pylab import MaxNLocator
from collections import defaultdict
import seaborn as sns
import ast
from pathlib import Path
# pandas libraries
import panda... |
"""Copies Hail tokens from Kubernetes to the Google Secret Manager."""
import base64
import json
import kubernetes.client
import kubernetes.config
import yaml
from google.cloud import secretmanager
# dataset -> list of git repos
with open('repository-map.json', encoding='utf-8') as allowed_repo_file:
ALLOWED_REP... |
# coding=utf-8
# Copyright 2022 The HuggingFace Inc. team. 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 r... |
#!/usr/bin/env python
# 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
#
# Unle... |
# -*- coding: utf-8 -*-
"""Python client to retrieve data provided by DWD via their WFS API."""
from .weatherwarnings import DwdWeatherWarningsAPI # noqa: F401
|
""" Tools to deserialize energy systems from datapackages.
**WARNING**
This is work in progress and still pretty volatile, so use it at your own risk.
The datapackage format and conventions we use are still a bit in flux. This is
also why we don't have documentation or tests yet. Once things are stabilized a
bit more... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020-2021 Alibaba Group Holding Limited.
#
# 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/L... |
# -*- coding: utf-8 -*-
from app import app as application
if __name__ == '__main__':
application.run(host="0.0.0.0", debug=True)
|
import numpy as np
import pandas as pd
import pytest
import woodwork as ww
from evalml.automl import get_default_primary_search_objective
from evalml.data_checks import (
AutoMLDataChecks,
DataCheck,
DataCheckError,
DataCheckMessageCode,
DataChecks,
DataCheckWarning,
DefaultDataChecks,
... |
#!/usr/bin/env python3
import socket, base64, os
def myrand(n=512):
return base64.b32encode(os.urandom(n))
def recvline(s):
buf = b''
while True:
c = s.recv(1)
buf += c
if c == b'' or c == b'\n':
#print('recvline', s.fileno(), buf)
return buf
s1 = socket.sock... |
# coding=utf-8
# Copyright 2020 The Nested-Transformer 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 appli... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-01-21 07:33
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('images... |
# coding=utf-8
# Copyright 2018 The TF-Agents 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... |
#!/usr/bin/env python3
import utils, open_color, arcade
utils.check_version((3,7))
# Open the window. Set the window title and dimensions (width and height)
arcade.open_window(800, 600, "Smiley Face Example")
arcade.set_background_color(open_color.white)
# Start the render process. This must be done before any drawi... |
'''
Copyright 2021 Lok Yan
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, publish, distribute, sublicense... |
# coding: utf-8
"""
Pure Storage FlashBlade REST 1.7 Python SDK
Pure Storage FlashBlade REST 1.7 Python SDK, developed by [Pure Storage, Inc](http://www.purestorage.com/). Documentations can be found at [purity-fb.readthedocs.io](http://purity-fb.readthedocs.io/).
OpenAPI spec version: 1.7
Contact: i... |
from pathlib import Path
import numpy as np
try:
import pandas as pd
except ImportError:
from dacman.core.utils import dispatch_import_error
dispatch_import_error(module_name='pandas', plugin_name='Excel')
try:
import xlrd
except ImportError:
from dacman.core.utils import dispatch_import_error
... |
from collections.abc import Mapping
import inspect
import types
import numpy as np
import sympy
from sympy.codegen import cfunctions as sympy_cfunctions
from numpy.random import randn, rand
from sympy import Function as sympy_Function
from sympy import S
import brian2.units.unitsafefunctions as unitsafe
from brian2.c... |
#from bottom_up import maximumScore
from memo_recursion import maximumScore
if __name__ == "__main__":
print("TestCase-1")
nums = [1,2,3]
multipliers = [3,2,1]
ans = maximumScore(nums, multipliers)
expected = 14
#print(f"{'Correct' if ans == expected else 'Incorrect'}")
print(f"{'Correct' ... |
import wx
def sample_users():
from os.path import dirname, abspath, join as pathjoin
with open(pathjoin(dirname(abspath(__file__)), 'sample_users.json')) as f:
users_json = f.read()
import simplejson
return simplejson.loads(users_json)
def main():
from tests.testapp import testapp
wi... |
import json
# User Validation
with open('users.json') as f:
users = json.load(f)
usrs=[]
for item in users:
usrs.append(item['username'])
user = input("Enter Username: ")
while user not in usrs:
print("Invalid username. Please enter proper username")
user = input("Enter Username: ")
for item in user... |
class ExchangeDoesNotExist(KeyError):
pass
class ConsumerDoesNotExist(KeyError):
pass
|
#!/usr/bin/env python3
#
# Copyright 2017-2020 GridGain Systems.
#
# 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... |
from __future__ import absolute_import
import argparse
import collections
import gc
import json
import os
from datetime import datetime
import torch
from catalyst.dl import SupervisedRunner, OptimizerCallback, SchedulerCallback
from catalyst.dl.callbacks import CriterionAggregatorCallback, AccuracyCallback
from catal... |
__all__ = ['controllers', 'forms']
|
# -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-07-23 17:19
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('portfolio_main', '0005_auto_20180711_2119'),
]
operations = [
migrations.A... |
"""
本案例用来测试selenium 浏览器爬虫框架
参考文献: https://zhuanlan.zhihu.com/p/27115580
"""
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
def selenium_test():
driver = webdriver.Chrome('./chromedriver')
driver.get("https://www.baidu.com")
driver.implicitly_wait(3)
text = driver.find_... |
# Copyright 2020 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file acc... |
"""
AddRemProductOption request.
Adds or removes product options from ranges.
"""
from ..apirequest import APIRequest
class AddRemProductOption(APIRequest):
"""AddRemProductOption request."""
uri = "Handlers/Range/addRemProductOption.ashx"
ADD = "add"
REMOVE = "rem"
def __new__(self, *, range_... |
"""Performs face alignment and stores face thumbnails in the output directory."""
# MIT License
#
# Copyright (c) 2016 David Sandberg
#
# 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 witho... |
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
ext_modules=[ Extension('fast_graph_builder',
['fast_graph_builder.pyx'],
libraries=['m'],
extra_compile_args=['-ffast-math'])]
setup(
name = 'fast_graph_builde... |
import logging
import torch
from torchvision import transforms, datasets
from torch.utils.data import DataLoader, RandomSampler, DistributedSampler, SequentialSampler
import numpy as np
logger = logging.getLogger(__name__)
def mixup_data(x, y, alpha=1.0, use_cuda=True):
'''Returns mixed inputs, pairs of target... |
import numpy as np
from scipy.stats.mstats import mquantiles
import pytest
from numpy.testing import assert_allclose
from sklearn.datasets import load_diabetes
from sklearn.datasets import load_iris
from sklearn.datasets import make_classification, make_regression
from sklearn.ensemble import GradientBoostin... |
#!/usr/bin/env python3
"""
Advent of Code 2017: Day #
"""
import os
from shared.readdayinput import readdayinput
test = [
[17, 16, 15, 14, 13],
[18, 5, 4, 3, 12],
[19, 6, 1, 2, 11],
[20, 7, 8, 9, 10],
[21, 22, 23, 24, 25]
]
def first_half(dayinput):
"""
first h... |
# --------------------------------------------------------
# Faster R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick and Sean Bell
# --------------------------------------------------------
import caffe
import yaml
import numpy as np
import nump... |
# 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... |
"""fxdr v0.0.0 does nothing"""
|
ORDER_STATUS = (
(1, "Otwarte"),
(2, "W przygotowaniu"),
(3, "W dostawie"),
(4, "Zrealizowane"),
(5, "Anulowane"),
)
ORDER_STATUS = sorted(ORDER_STATUS)
DELIVERY_TYPE = (
(1, "Odbiór osobisty"),
(2, "Dostawa"),
)
DELIVERY_TYPE = sorted(DELIVERY_TYPE)
PAY_METHOD = (
(1, "gotówka"),
... |
"""
Django settings for profiles_project project.
Generated by 'django-admin startproject' using Django 2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
impor... |
import argparse
import random
import re
import numpy as np
import pandas as pd
import torch
def add_common_arg(parser):
def torch_device(arg):
if re.match('^(cuda(:[0-9]+)?|cpu)$', arg) is None:
raise argparse.ArgumentTypeError(
'Wrong device format: {}'.format(arg)
... |
"""
Mask R-CNN
Common utility functions and classes.
Copyright (c) 2017 Matterport, Inc.
Licensed under the MIT License (see LICENSE for details)
Written by Waleed Abdulla
"""
import sys
import os
import logging
import math
import random
import numpy as np
import tensorflow as tf
import scipy
import skimage.color
imp... |
import io
import random
import ase
from ase.io import extxyz
from rdkit import Chem
from rdkit.Chem.AllChem import (
EmbedMultipleConfs, GetBestRMS,
MMFFGetMoleculeForceField, MMFFGetMoleculeProperties,
UFFGetMoleculeForceField,
)
from .conformer import get_atoms, pre_optimize
from .xyz2mol import xyz2mo... |
# 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, overload
from ... import _utilities
fro... |
#!/usr/bin/python3
"""
(C) Copyright 2018-2021 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
"""
import time
from apricot import TestWithServers
from general_utils import get_random_bytes, DaosTestError
from test_utils_container import TestContainerData
class FullPoolContainerCreate(TestWithServ... |
"""
@author: Maziar Raissi
"""
import sys
sys.path.insert(0, "../../Utilities/")
import tensorflow as tf
import numpy as np
import time
import scipy.io
np.random.seed(1234)
tf.set_random_seed(1234)
class PhysicsInformedNN:
# Initialize the class
def __init__(self, x0, u0, x1, layers, dt, lb, ub, q):
... |
# Copyright 2018 Jian Wu
# License: Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
from collections import defaultdict
from typing import Optional, NoReturn, Tuple
from kaldi_python_io import Reader as BaseReader
class MetricReporter(object):
"""
Metric reporter (WER, SiSNR, SDR ...)
"""
de... |
# -*- coding: utf-8 -*-
"""
'console' test set : tests regarding only the pygconsole.console submodule
Test 9 : Write a long text on the console in characters parametered randomly (bold / underline / italic), but with the default colours (foreground in bright white, background in black).
ESCAPE Key to exit.
"""
#... |
from django.urls import path
from django.urls import path
from . import views
app_name = 'posts'
urlpatterns = [
path('', views.index, name='index'),
path('create/', views.posts_create, name='posts_create'),
] |
import os
import numpy as np
import datetime as dt
import json
import pandas as pd
from keras.layers import Dense, Activation, Dropout, LSTM
from keras.models import Sequential, load_model
from keras.callbacks import EarlyStopping, ModelCheckpoint
class Model:
def __init__(self, config_file):
... |
import argparse
import json
import os
import sys
from pytopojson import quantize
__version__ = "1.1.2"
def read(input_):
if isinstance(input_, str):
with open(input_, "r") as src:
return json.load(src)
else:
return json.load(sys.stdin)
def quantize_topology(topology, quantizat... |
# 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.
# -----------------------------------------------------... |
# Copyright 2015 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... |
"""
==============
SGD: Penalties
==============
Contours of where the penalty is equal to 1
for the three penalties L1, L2 and elastic-net.
All of the above are supported by :class:`~sklearn.linear_model.SGDClassifier`
and :class:`~sklearn.linear_model.SGDRegressor`.
"""
print(__doc__)
import numpy as np
import ma... |
# exported from PySB model 'model'
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU', 'C3pro'])
Monomer('BaxM', ['BidM', 'BaxA'])
Monomer('Apop', ['C... |
# Copyright (c) 2012 NTT DOCOMO, INC.
# Copyright 2011 OpenStack Foundation
# Copyright 2011 Ilya Alekseyev
#
# 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:... |
from aiogram import Bot, Dispatcher, types
from aiogram.dispatcher import FSMContext
from aiogram.dispatcher.filters import Text
from aiogram.dispatcher.filters.state import State, StatesGroup
from aiogram.contrib.fsm_storage.memory import MemoryStorage
from aiogram.utils import executor
import random
import os
bot = ... |
"""
This file is for models creation, which consults options
and creates each encoder and decoder accordingly.
"""
import torch
import torch.nn as nn
import onmt
import onmt.io
import onmt.Models
import onmt.modules
from onmt.Models import NMTModel, MeanEncoder, RNNEncoder, \
StdRNNDecoder, Inp... |
from iotapp import entities
from .base import Device
class Button(Device):
def __init__(self, name):
super().__init__(name=name)
def get_entities(self):
entity = dict()
config = dict(
state_topic='zigbee/{}'.format(self.name),
state_value_click = 'single',
... |
import tensorflow as tf
from onnx_tf.handlers.backend_handler import BackendHandler
from onnx_tf.handlers.handler import onnx_op
from onnx_tf.handlers.handler import tf_func
from .math_mixin import ArithmeticMixin
@onnx_op("Div")
@tf_func(tf.math.truediv)
class Div(ArithmeticMixin, BackendHandler):
@classmethod
... |
# 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... |
import json
from _lark.base_client import BaseClient
from _lark.card.card import CardMessage
from _lark.card.modules import DivModule
from _lark.card.objects import LarkMdObj
from _lark.lark_response import LarkResponse
from typing import List
class LarkClient(BaseClient):
def user_batch_get(self,
... |
import uuid
from flask import Flask, render_template, request, jsonify
import os
from lotify.client import Client
app = Flask(__name__)
CLIENT_ID = os.getenv("LINE_CLIENT_ID")
SECRET = os.getenv("LINE_CLIENT_SECRET")
URI = os.getenv("LINE_REDIRECT_URI")
lotify = Client(client_id=CLIENT_ID, client_secret=SECRET, redi... |
from sacred import Ingredient
from keras.layers import Input, Dense
from keras.models import Model
generator_ingredient = Ingredient('generator')
discriminator_ingredient = Ingredient('discriminator', ingredients=[generator_ingredient])
@generator_ingredient.config
def generator_config():
latent_size = 100
... |
# Copyright (c) 2009-2022 The Regents of the University of Michigan.
# Part of HOOMD-blue, released under the BSD 3-Clause License.
import numpy as np
import pytest
import hoomd
from hoomd.logging import LoggerCategories
from hoomd.conftest import operation_pickling_check, logging_check
from hoomd import md
def _as... |
# 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... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__license__= """
GoLismero 2.0 - The web knife - Copyright (C) 2011-2014
Golismero project site: https://github.com/golismero
Golismero project mail: contact@golismero-project.com
This program is free software; you can redistribute it and/or
modify it under the terms of ... |
# -*- coding:utf-8 -*-
from __future__ import unicode_literals
from copy import copy
from statik.errors import *
from statik.common import YamlLoadable
from statik.utils import underscore_var_names
from statik.markdown_config import MarkdownConfig
from statik.external_database import ExternalDatabase
from statik.tem... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.