repo_name stringlengths 6 97 | path stringlengths 3 341 | text stringlengths 8 1.02M |
|---|---|---|
intel-spark/automl | pyzoo/zoo/automl/pipeline/time_sequence.py | <filename>pyzoo/zoo/automl/pipeline/time_sequence.py
#
# Copyright 2018 Analytics Zoo 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... |
intel-spark/automl | pyzoo/test/zoo/automl/pipeline/test_time_sequence.py | #
# Copyright 2018 Analytics Zoo 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... |
intel-spark/automl | pyzoo/zoo/automl/search/RayTuneSearchEngine.py | #
# Copyright 2018 Analytics Zoo 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... |
intel-spark/automl | pyzoo/zoo/automl/common/metrics.py | #
# Copyright 2018 Analytics Zoo 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... |
intel-spark/automl | pyzoo/test/zoo/automl/feature/test_time_sequence.py | #
# Copyright 2018 Analytics Zoo 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... |
intel-spark/automl | pyzoo/zoo/automl/pipeline/abstract.py | #
# Copyright 2018 Analytics Zoo 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... |
intel-spark/automl | pyzoo/zoo/automl/feature/time_sequence.py | <reponame>intel-spark/automl<filename>pyzoo/zoo/automl/feature/time_sequence.py
#
# Copyright 2018 Analytics Zoo 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.ap... |
zavalnav/synergyspace | src/synergyspace/views.py | from django.views import generic
from accounts.models import *
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
class HomePage(generic.TemplateView):
template_name = "browse.html"
class AboutPage(generic.TemplateView):
template_name = "about.html"
class ReviewBooking(generic.Template... |
zavalnav/synergyspace | src/accounts/models.py | from django.db import models
# Commenting out all the "primary keys" for now, because Django automatically
# REMAINING TODO:
# -Add __str__ methods for any models that are missing them
class User(models.Model):
MALE = 'm'
FEMALE = 'f'
GENDER_CHOICES = ((MALE, 'Male'), (FEMALE, 'Female'))
#user_i... |
zavalnav/synergyspace | src/accounts/admin.py | <filename>src/accounts/admin.py
from django.contrib import admin
# Register your models here.
from accounts.models import *
admin.site.register(User)
admin.site.register(Space)
admin.site.register(InterestedSpace)
admin.site.register(Amenity)
admin.site.register(Arrangement)
admin.site.register(SpaceNetwork)
admin.si... |
tilenklinc/Vislice | model.py | # Konstante za rezultate ugibanj:
STEVILO_DOVOLJENIH_NAPAK = 10
PRAVILNA_CRKA = "+"
PONOVLJENA_CRKA = "o"
NAPACNA_CRKA = "-"
# Konstante za zmago in poraz
ZMAGA = "W"
PORAZ = "X"
# Odpremo datoteko in ločimo besede
bazen_besed = []
with open("Git\\Vislice\\besede.txt", encoding="utf-8") as datoteka_bazena:
for be... |
tilenklinc/Vislice | vislice.py | <filename>vislice.py
import bottle
import model
vislice = model.Vislice()
@bottle.get("/")
def index():
return bottle.template("Dokumenti\\2019_20\\UVP\\Git\\Visliceindex.tpl")
bottle.run(reloader=True, debug=True) |
integre-grenoble/OPPAI | oppai.py | <filename>oppai.py
#!/usr/bin/env python3
import configparser
import csv
import email.message
import getpass
import os
import pickle
import smtplib
import sys
import unicodedata
from datetime import date, datetime
from pathlib import Path
os.system('') # enable ANSI escape code on Windows *facepalm*
# sorry for the... |
PeteRager/lennoxs30api | tests/test_setpoints.py | <reponame>PeteRager/lennoxs30api<gh_stars>1-10
from unittest import mock
from lennoxs30api.s30api_async import lennox_zone, s30api_async, lennox_system
from lennoxs30api.lennox_home import lennox_home
import json
import os
import unittest
import asyncio
from unittest.mock import patch
def loadfile(name) -> json:
... |
PeteRager/lennoxs30api | lennoxs30api/s30exception.py | <reponame>PeteRager/lennoxs30api
EC_AUTHENTICATE = 1
EC_LOGIN = 2
EC_NEGOTIATE = 3
EC_SUBSCRIBE = 4
EC_RETRIEVE = 5
EC_REQUEST_DATA_HELPER = 6
EC_BAD_PARAMETERS = 7
EC_SETMODE_HELPER = 8
EC_PUBLISH_MESSAGE = 9
EC_PROCESS_MESSAGE = 10
EC_COMMS_ERROR = 11
EC_NO_SCHEDULE = 12
EC_HTTP_ERR = 13
EC_LOGOUT = 14
EC_CONFIG_TIME... |
PeteRager/lennoxs30api | lennoxs30api/__init__.py | __version__ = "0.1.4"
from .lennox_home import *
from .lennox_period import *
from .lennox_schedule import *
from .s30exception import *
from .s30api_async import *
|
PeteRager/lennoxs30api | tests/test_receive_errors.py | from aiohttp.client_exceptions import SSLContext
from aiohttp.client_reqrep import ConnectionKey
from lennoxs30api.s30api_async import (
LENNOX_HVAC_EMERGENCY_HEAT,
lennox_zone,
s30api_async,
lennox_system,
)
import json
import os
import asyncio
import pytest
import aiohttp
import logging
from unittes... |
PeteRager/lennoxs30api | tests/test_message_logger.py | from lennoxs30api.message_logger import REDACTED, MessageLogger
import logging
import json
import os
import timeit
def loadfile(name) -> json:
script_dir = os.path.dirname(__file__) + "/messages/"
file_path = os.path.join(script_dir, name)
with open(file_path) as f:
data = json.load(f)
return... |
laukaho/MediaPipeUnityPlugin | mediapipe_api/csharp_proto_src.bzl | <reponame>laukaho/MediaPipeUnityPlugin<filename>mediapipe_api/csharp_proto_src.bzl
# Copyright (c) 2021 homuler
#
# Use of this source code is governed by an MIT-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/MIT.
"""Proto compiler
Macro for generating C# source files co... |
laukaho/MediaPipeUnityPlugin | mediapipe_api/java/com/google/mediapipe/mediapipe_aar.bzl | <filename>mediapipe_api/java/com/google/mediapipe/mediapipe_aar.bzl
# Copyright (c) 2019 <NAME>
# Copyright (c) 2021 homuler
#
# Use of this source code is governed by an MIT-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/MIT.
# Based on https://github.com/aj-michael/aar... |
laukaho/MediaPipeUnityPlugin | third_party/android_configure.bzl | <reponame>laukaho/MediaPipeUnityPlugin<gh_stars>10-100
# Copyright 2019 gRPC 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
#
# Un... |
AnkurManna/Py_FS | build/lib/Py_FS/wrapper/nature_inspired/_utilities.py | import numpy as np
from sklearn.neighbors import KNeighborsClassifier as KNN
class Solution():
#structure of the solution
def __init__(self):
self.num_features = None
self.num_agents = None
self.max_iter = None
self.obj_function = None
self.execution_time = None
... |
AnkurManna/Py_FS | Py_FS/filter/Relief.py | """
Programmer: <NAME>
Date of Development: 28/10/2020
"""
from ReliefF import ReliefF
import numpy as np
from Py_FS.filter._utilities import normalize, Result
# _utilities import normalize, Result
from sklearn import datasets
def Relief(data, target):
# function that assigns scores to features according to Rel... |
enverbisevac/ff-python-server-sdk | featureflags/config.py | """Configuration is a base class that has default values that you can change
during the instance of the client class"""
from typing import Callable
BASE_URL = "https://config.feature-flags.uat.harness.io/api/1.0"
MINUTE = 60
PULL_INTERVAL = 1 * MINUTE
class Config(object):
def __init__(self, base_url: str = BA... |
enverbisevac/ff-python-server-sdk | featureflags/__init__.py | <gh_stars>0
"""Top-level package for Feature Flag Server SDK."""
__author__ = """<NAME>"""
__email__ = "<EMAIL>"
__version__ = "0.1.0"
|
enverbisevac/ff-python-server-sdk | featureflags/rest/models/__init__.py | <filename>featureflags/rest/models/__init__.py
""" Contains all the data models used in inputs/outputs """
from .authentication_request import AuthenticationRequest
from .authentication_response import AuthenticationResponse
from .clause import Clause
from .distribution import Distribution
from .error import Error
fro... |
enverbisevac/ff-python-server-sdk | featureflags/rest/models/serving_rule.py | <filename>featureflags/rest/models/serving_rule.py
from typing import Any, Dict, List, Type, TypeVar
import attr
from ..models.clause import Clause
from ..models.serve import Serve
T = TypeVar("T", bound="ServingRule")
@attr.s(auto_attribs=True)
class ServingRule:
""" """
rule_id: str
priority: int
... |
enverbisevac/ff-python-server-sdk | featureflags/client.py | """Client for interacting with Harness FF server"""
import asyncio
from typing import Callable, Optional
from jwt import decode
from .config import Config, default_config
from .rest.client import Client, AuthenticatedClient
from .rest.api.default.authenticate import asyncio as authenticate, \
AuthenticationReque... |
enverbisevac/ff-python-server-sdk | tests/test_client.py | from featureflags.client import CfClient
from featureflags.config import Config, with_base_url, with_stream_enabled
def test_client_baseurl_conf():
client = CfClient("some key",
with_base_url("localhost"),
with_stream_enabled(True))
got = client.config.base_url
... |
enverbisevac/ff-python-server-sdk | featureflags/rest/models/feature_state.py | <filename>featureflags/rest/models/feature_state.py<gh_stars>0
from enum import Enum
class FeatureState(str, Enum):
ON = "on"
OFF = "off"
def __str__(self) -> str:
return str(self.value)
|
enverbisevac/ff-python-server-sdk | featureflags/example.py | <filename>featureflags/example.py
import time
from featureflags.client import CfClient
def main():
client = CfClient("43353147-8daa-4583-ad3d-26eca1c4765e")
while True:
print(client.get_environment_id())
time.sleep(10)
if __name__ == "__main__":
main()
|
enverbisevac/ff-python-server-sdk | featureflags/rest/models/clause.py | from typing import Any, Dict, List, Type, TypeVar, cast
import attr
T = TypeVar("T", bound="Clause")
@attr.s(auto_attribs=True)
class Clause:
""" """
id: str
attribute: str
op: str
values: List[str]
negate: bool
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
... |
enverbisevac/ff-python-server-sdk | featureflags/rest/models/authentication_response.py | from typing import Any, Dict, List, Type, TypeVar
import attr
T = TypeVar("T", bound="AuthenticationResponse")
@attr.s(auto_attribs=True)
class AuthenticationResponse:
""" """
auth_token: str
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, ... |
enverbisevac/ff-python-server-sdk | featureflags/rest/__init__.py | <gh_stars>0
""" A client library for accessing Harness feature flag service client apis """
from .client import AuthenticatedClient, Client
|
enverbisevac/ff-python-server-sdk | featureflags/rest/models/evaluation.py | <filename>featureflags/rest/models/evaluation.py<gh_stars>0
from typing import Any, Dict, List, Type, TypeVar, Union, cast
import attr
from ..models.evaluation_value import EvaluationValue
from ..types import Unset
T = TypeVar("T", bound="Evaluation")
@attr.s(auto_attribs=True)
class Evaluation:
""" """
... |
enverbisevac/ff-python-server-sdk | featureflags/rest/models/feature_config.py | <filename>featureflags/rest/models/feature_config.py<gh_stars>0
from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from ..models.feature_config_kind import FeatureConfigKind
from ..models.feature_state import FeatureState
from ..models.prerequisite import Prerequisite
from ..models.serve import Serv... |
enverbisevac/ff-python-server-sdk | featureflags/rest/models/weighted_variation.py | from typing import Any, Dict, List, Type, TypeVar
import attr
T = TypeVar("T", bound="WeightedVariation")
@attr.s(auto_attribs=True)
class WeightedVariation:
""" """
variation: str
weight: int
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[... |
enverbisevac/ff-python-server-sdk | featureflags/rest/models/serve.py | <filename>featureflags/rest/models/serve.py
from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from ..models.distribution import Distribution
from ..types import UNSET, Unset
T = TypeVar("T", bound="Serve")
@attr.s(auto_attribs=True)
class Serve:
""" """
distribution: Union[Distribution... |
orangain/pika-twisted-example | consumer.py | # coding: utf-8
import time
import logging
import pika
QUEUE_NAME = 'next_queue'
RETRY_COUNT = 5
RETRY_SLEEP = 4
logger = logging.getLogger(__name__)
def main():
logging.basicConfig(level=logging.INFO)
parameters = pika.ConnectionParameters()
for i in range(RETRY_COUNT):
try:
connec... |
orangain/pika-twisted-example | worker.py | <gh_stars>10-100
# coding: utf-8
import logging
import pika
from pika.adapters import TwistedProtocolConnection
from twisted.internet import reactor, task, defer, protocol
PREV_QUEUE_NAME = 'prev_queue'
NEXT_QUEUE_NAME = 'next_queue'
AMQP_DEFAULT_PORT = 5672
logger = logging.getLogger(__name__)
class TwistedMessage... |
orangain/pika-twisted-example | send.py | # coding: utf-8
import sys
import pika
def main(message):
parameters = pika.ConnectionParameters()
connection = pika.BlockingConnection(parameters)
channel = connection.channel()
channel.queue_declare(queue='prev_queue')
channel.basic_publish(exchange='',
routing_key='prev_queue',
... |
illusional/python-cwlgen | cwlgen/requirements.py | <filename>cwlgen/requirements.py
import six
from cwlgen.commandlinebinding import CommandLineBinding
from .common import parse_type, get_type_dict
from .utils import Serializable
class Requirement(Serializable):
ignore_fields_on_parse = ["class"]
'''
Requirement that must be met in order to execute the... |
illusional/python-cwlgen | cwlgen/workflow.py | <reponame>illusional/python-cwlgen<filename>cwlgen/workflow.py
# Import ------------------------------
# General libraries
import logging
# External libraries
import ruamel.yaml
import six
# Internal libraries
from .requirements import Requirement
from .utils import literal, literal_presenter, Serializable
from .... |
illusional/python-cwlgen | test/test_unit_requirements.py | <reponame>illusional/python-cwlgen<gh_stars>1-10
import unittest
import cwlgen
class TestAddRequirements(unittest.TestCase):
def test_inlinejs(self):
w = cwlgen.Workflow()
req = cwlgen.InlineJavascriptRequirement(["expression"])
w.requirements.append(req)
d = w.get_dict()
... |
HaoJiector/XihuLunJian-AI | utils/utils.py | # utils.py
import pandas as pd
from sklearn.preprocessing import OneHotEncoder
import numpy as np
import os
def extract_tls_info(s):
tls_key_list = ['C', 'ST', 'L', 'O', 'OU', 'CN', 'emailAddress', 'unknown', 'serialNumber']
s = s.split(',')
s = [x.split('/') for x in s]
s = sum(s, [])
res = {}
... |
HaoJiector/XihuLunJian-AI | main_addition.py | import sys
sys.path.append('../train_code')
import numpy as np
import pandas as pd
from utils.utils import *
from train_config import args
from sklearn.neighbors import NearestNeighbors
import joblib
def addtion_func(addtion_path):
test_path = '../../data/test_1.csv'
res_path = "../../finalA/S3_finalA.csv"
... |
HaoJiector/XihuLunJian-AI | train.py | <gh_stars>1-10
import numpy as np
from models import get_models, save_model
from sklearn.model_selection import cross_val_score
from sklearn.model_selection import GridSearchCV
from sklearn import metrics
import joblib
import pandas as pd
import random
def train_start():
from train_config import args
from dat... |
HaoJiector/XihuLunJian-AI | main_predict.py | <filename>main_predict.py
# -*- coding: utf-8 -*-
# from dataSet.dataPrepare import ProcessData
from models import get_models
import pandas as pd
from sklearn.preprocessing import OneHotEncoder
import numpy as np
import os
from utils.utils import *
import joblib
from train_config import args
def test_func(test_path... |
HaoJiector/XihuLunJian-AI | main_addition_.py | # -*- coding: utf-8 -*-
import sys
sys.path.append('../train_code')
import numpy as np
import pandas as pd
from utils.utils import *
from train_config import args
from sklearn.neighbors import NearestNeighbors
import joblib
from sklearn.cluster import AgglomerativeClustering
from sklearn.metrics import silhouette_score... |
HaoJiector/XihuLunJian-AI | models/__init__.py | import os
import joblib
from sklearn.ensemble import RandomForestClassifier
from sklearn.ensemble import AdaBoostClassifier
from sklearn.ensemble import BaggingClassifier
from sklearn.ensemble import ExtraTreesClassifier
from sklearn.ensemble import GradientBoostingClassifier
from sklearn.linear_model import Logistic... |
HaoJiector/XihuLunJian-AI | main_train.py | # -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
from train import train_start
def train_func(train_path):
train_start()
pass
if __name__ == '__main__':
train_path = '../data/train.csv' # 该路径仅供参考
train_func(train_path)
|
HaoJiector/XihuLunJian-AI | dataSet/dataPrepare.py | <reponame>HaoJiector/XihuLunJian-AI
from utils.utils import *
from sklearn.utils import shuffle
from sklearn.preprocessing import StandardScaler
from sklearn.decomposition import PCA
import numpy as np
import os
import joblib
from train_config import args
print(__name__)
path = "../../data/"
train = None
test = No... |
HaoJiector/XihuLunJian-AI | train_config.py |
args = dict(
models = [
{
"name": 'RandomForestClassifier',
'params': {
'n_estimators': [60],
'max_depth': [12],
'min_samples_split': [6],
'min_samples_leaf': [2],
# 'max_features': [12],
... |
xuexuan/yahoo_finance_parse | monthly-high-yield-stock.py | import json
from datetime import date
def filter(month):
res_dict = {}
with open("symbol.json") as json_res:
symbole_stock = json.load(json_res)
for key in symbole_stock:
print(key)
if len(symbole_stock[key]) != 0 and month in symbole_stock[key]["Ex-Dividend Date"]:
... |
xuexuan/yahoo_finance_parse | statics-parser.py | from bs4 import BeautifulSoup as bf
from lxml import html
import requests
import json
from pymongo import MongoClient
def history_dividend_parser(ticker):
print("start "+ticker)
url = "https://finance.yahoo.com/quote/%s.HK/history?period1=946857600&period2=1587772800&interval=1d&filter=history&frequency=1d"%... |
Sharma-poo/example_pkg | add.py | """
This module contains addition , subtraction, multiplication , action
"""
def addition(a,b):
result = a+b
return result
print(result)
|
sabderra/predictive-maintenance-lstm | data_generator.py | import numpy as np
import pandas as pd
from random import shuffle
def split_data(df, randomize=True, train_pct=0.8):
"""Given a pandas DataFrame of time series data that is organized with a unique 'id' column,
split the data into a training and a validation set.
Args:
df (DataFrame) - Data to spl... |
sabderra/predictive-maintenance-lstm | util.py | import os
import sys
import datetime
import errno
import glob
import numpy as np
from keras import backend as K
def set_log_dir(model_dir, name, per_epoch=False, val_loss=False, create_dir=True):
# Directory for training logs
now = datetime.datetime.now()
now_str = "{:%Y%m%dT%H%M}".format(now)
log_di... |
sabderra/predictive-maintenance-lstm | data_util.py | import os
import pandas as pd
def path_to_id_base(path):
fn = os.path.splitext(os.path.basename(path))[0]
return fn_id_map[fn]
# Filename is mapped to a separate range to ensure unique engine ids
fn_id_map = {
"train_FD001": 1000,
"train_FD002": 2000,
"train_FD003": 3000,
"train_FD004": 4000... |
AlparslanErol/Recommendation-Algorithm | recommendation/den.py | <reponame>AlparslanErol/Recommendation-Algorithm
"""
This module descibes how to load a custom dataset from a single file.
As a custom dataset we will actually use the movielens-100k dataset, but act as
if it were not built-in.
"""
from __future__ import (absolute_import, division, print_function,
... |
shanwf/GraphScope | python/graphscope/deploy/tests/test_demo_script.py | <gh_stars>1-10
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020 Alibaba Group Holding Limited. 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
#
# ht... |
shanwf/GraphScope | python/graphscope/framework/graph.py | <filename>python/graphscope/framework/graph.py<gh_stars>1-10
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020 Alibaba Group Holding Limited. 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 ... |
shanwf/GraphScope | python/graphscope/framework/dag_utils.py | <reponame>shanwf/GraphScope<gh_stars>1-10
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020 Alibaba Group Holding Limited. 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 o... |
pulpiction/APMA-DRP-Project | codes/splitnn.py | <gh_stars>1-10
import tensorflow as tf
import numpy as np
# Control Model (Single Entity)
def control(x_train, y_train, x_test, y_test):
model = tf.keras.Sequential([tf.keras.layers.Conv2D(32, (3,3), (1,1), padding='valid', activation='relu'),
tf.keras.layers.Conv2D(64, (3,3), (1,1)... |
pulpiction/APMA-DRP-Project | codes/fedavg.py | <reponame>pulpiction/APMA-DRP-Project
import tensorflow as tf
import numpy as np
import random
def build_dict(y_train, y_test):
train_dict, test_dict = {}, {}
for label in range(10):
train_dict[label] = np.argwhere(label==y_train).reshape(-1)
test_dict[label] = np.argwhere(label==y_test).reshape(-... |
pulpiction/APMA-DRP-Project | codes/vanilla.py | import tensorflow as tf
import numpy as np
class Model(tf.keras.Model):
"""
Simple 2-Layer Dense Neural Network for MNIST.
Generalized model for client use.
This model will be used for control as well: server-side execution
- Layer 1 : Dense Layer with model.dense_siz... |
pulpiction/APMA-DRP-Project | codes/main.py | <reponame>pulpiction/APMA-DRP-Project
import tensorflow as tf
import numpy as np
import vanilla
import fedavg
import splitnn
def main():
mode = 'FEDAVG'
(x_train, y_train), (x_test, y_test) = tf.keras.datasets.mnist.load_data()
if mode == 'FEDAVG':
# Load Data and Normalize
x_tr... |
notnullxyz/pylotwallet | app.py | # -*- encoding: utf-8 -*-
from builtins import range
from datetime import datetime
# for debugging... must remove
from pprint import pprint
from esipy import EsiApp
from esipy import EsiClient
from esipy import EsiSecurity
from esipy.exceptions import APIException
from flask import Flask
from flask import redirect
f... |
xGhostBoyx/Kurisu | addons/friendcode.py | <filename>addons/friendcode.py
import discord
import hashlib
import sqlite3
import struct
from discord.ext import commands
from sys import argv
class FriendCode:
"""
Stores and obtains friend codes using an SQLite 3 database.
"""
def __init__(self, bot):
self.bot = bot
print('Loading fc... |
xGhostBoyx/Kurisu | addons/loop.py | import asyncio
import copy
import discord
import sys
import time
import datetime
import traceback
from discord.ext import commands
from sys import argv
class Loop:
"""
Loop events.
"""
def __init__(self, bot):
self.bot = bot
bot.loop.create_task(self.start_update_loop())
print('... |
xGhostBoyx/Kurisu | addons/assistance.py | <reponame>xGhostBoyx/Kurisu<filename>addons/assistance.py<gh_stars>0
import discord
from discord.ext import commands
from sys import argv
class Assistance:
"""
Commands that will mostly be used in #help-and-questions.
"""
def __init__(self, bot):
self.bot = bot
print('Addon "{}" loaded'... |
xGhostBoyx/Kurisu | addons/lockdown.py | #Importing libraries
import discord
from discord.ext import commands
from sys import argv
class Lockdown:
"""
Channel lockdown commands.
"""
def __init__(self, bot):
self.bot = bot
print('Addon "{}" loaded'.format(self.__class__.__name__))
@commands.has_permissions(manage_messages=... |
filipemurias/ari-demo | deamon.py | #!/usr/bin/python
import ari
# Change your Asterisk access details here
url = 'http://localhost:8088'
username = 'ari-demo'
password = '<PASSWORD>'
client = ari.connect(url, username, password)
# Callback for StasisStart event
def on_start_cb(channel, event):
c = channel.get('channel')
print "%s has enter... |
jasonmlkang/AIT-Core | setup.py | <filename>setup.py
# Advanced Multi-Mission Operations System (AMMOS) Instrument Toolkit (AIT)
# Bespoke Link to Instruments and Small Satellites (BLISS)
#
# Copyright 2017, by the California Institute of Technology. ALL RIGHTS
# RESERVED. United States Government Sponsorship acknowledged. Any
# commercial use must be ... |
Project-MTee/translation-worker | nmt_worker/schemas.py | <reponame>Project-MTee/translation-worker
import json
from enum import Enum
from typing import Optional, Union
from pydantic import BaseModel
from pydantic.dataclasses import dataclass
from pydantic.json import pydantic_encoder
class InputType(Enum):
PLAIN = 'plain'
HTML = 'web'
XML = 'document'
ASR ... |
Project-MTee/translation-worker | nmt_worker/config.py | <gh_stars>0
import yaml
from yaml.loader import SafeLoader
from typing import List
from pydantic import BaseSettings, BaseModel
class MQConfig(BaseSettings):
"""
Imports MQ configuration from environment variables
"""
host: str = 'localhost'
port: int = 5672
username: str = 'guest'
passwo... |
Project-MTee/translation-worker | nmt_worker/__init__.py | <filename>nmt_worker/__init__.py<gh_stars>1-10
from .config import *
from .translator import Translator
from .mq_consumer import MQConsumer
|
Project-MTee/translation-worker | nmt_worker/tokenization.py | <reponame>Project-MTee/translation-worker<filename>nmt_worker/tokenization.py<gh_stars>1-10
from typing import List
from nltk import sent_tokenize
def sentence_tokenize(text: str) -> (List, List):
"""
Split text into sentences and save info about delimiters between them to restore linebreaks,
whitespaces,... |
Project-MTee/translation-worker | nmt_worker/mq_consumer.py | import json
import logging
import hashlib
from sys import getsizeof
from time import time, sleep
from pydantic import ValidationError
import pika
import pika.exceptions
from pika import credentials, BlockingConnection, ConnectionParameters
from nmt_worker.schemas import Response, Request, InputType
from nmt_worker.t... |
Project-MTee/translation-worker | nmt_worker/translator.py | <gh_stars>0
import itertools
import logging
import os
from typing import List
import warnings
from .config import ModelConfig
from .schemas import Response, Request
from .tag_utils import preprocess_tags, postprocess_tags
from .normalization import normalize
from .tokenization import sentence_tokenize
logger = loggin... |
Project-MTee/translation-worker | nmt_worker/normalization.py | <filename>nmt_worker/normalization.py
"""
Adapted from the Moses punctuation normalization script
"""
import re
# define and compile all the patterns
REGEXES = (
# whitespace character normalization
(re.compile(r' '), ' '),
(re.compile(r'\r'), r''),
# parenthesis
(re.compile(r' *\( *'), r' ('),
... |
sigonasr2/miyu-bot | miyu_bot/commands/cogs/utility.py | import logging
import textwrap
from discord.ext import commands
from miyu_bot.bot.bot import D4DJBot
from miyu_bot.commands.common.fuzzy_matching import romanize, FuzzyMatcher
class Utility(commands.Cog):
bot: D4DJBot
def __init__(self, bot):
self.bot = bot
self.logger = logging.getLogger(_... |
sigonasr2/miyu-bot | miyu_bot/bot/aliases/event.py | event_aliases = {
'halloween 2020': 1,
'candy': 2,
'swimsuits 2020': 3,
'maids': 5,
'christmas 2020': 6,
'countdown': 7,
'monster hunter pt1': 9,
'mh1': 9,
'monster hunter pt2': 10,
'mh2': 10,
}
|
sigonasr2/miyu-bot | miyu_bot/commands/common/timezone.py | import pytz
from pytz import UnknownTimeZoneError
from miyu_bot.commands.common.argument_parsing import ArgumentError
def get_timezone(arguments, default='Asia/Tokyo'):
timezone_name, _ = arguments.single(['timezone', 'tz'], default=default, allowed_operators=['='])
try:
return pytz.timezone(timezone... |
sigonasr2/miyu-bot | miyu_bot/commands/cogs/music.py | import asyncio
import contextlib
import enum
import logging
import wave
from inspect import cleandoc
from typing import Tuple
import discord
from d4dj_utils.master.chart_master import ChartDifficulty, ChartMaster
from d4dj_utils.master.common_enums import ChartSectionType
from d4dj_utils.master.music_master import Mus... |
sigonasr2/miyu-bot | export_assets.py | <gh_stars>0
import shutil
from d4dj_utils.master.asset_manager import AssetManager
from miyu_bot.commands.common.asset_paths import *
def main():
target_dir = Path('./export')
target_dir.mkdir(parents=True, exist_ok=True)
asset_manager = AssetManager('assets')
(target_dir / music_dir).mkdir(exist_... |
sigonasr2/miyu-bot | miyu_bot/commands/common/fuzzy_matching.py | import logging
import math
import re
import timeit
import datetime
from dataclasses import dataclass, field
from typing import Dict, Tuple, List, Optional, Iterable
import pykakasi
class FuzzyFilteredMap:
def __init__(self, filter_function=None, matcher=None, additive_only_filter=True):
self.filter = fil... |
sigonasr2/miyu-bot | miyu_bot/commands/common/asset_paths.py | <filename>miyu_bot/commands/common/asset_paths.py
from pathlib import Path
from d4dj_utils.master.card_master import CardMaster
from d4dj_utils.master.chart_master import ChartMaster
from d4dj_utils.master.event_master import EventMaster
from d4dj_utils.master.music_master import MusicMaster
from miyu_bot.bot.master_... |
sigonasr2/miyu-bot | miyu_bot/bot/master_asset_manager.py | import hashlib
from typing import Callable, Any, Optional, Union
from d4dj_utils.master.asset_manager import AssetManager
from d4dj_utils.master.event_master import EventMaster, EventState
from d4dj_utils.master.master_asset import MasterDict, MasterAsset
from discord.ext import commands
from miyu_bot.bot.aliases.eve... |
sigonasr2/miyu-bot | miyu_bot/commands/common/formatting.py | def format_info(info_entries: dict):
return '\n'.join(f'{k}: {v}' for k, v in info_entries.items() if v) |
sigonasr2/miyu-bot | main.py | import json
import logging
import discord
from d4dj_utils.master.asset_manager import AssetManager
from miyu_bot.bot.bot import D4DJBot
from miyu_bot.bot.master_asset_manager import MasterFilterManager
logging.basicConfig(level=logging.INFO)
with open('config.json') as f:
bot_token = json.load(f)['token']
asse... |
sigonasr2/miyu-bot | miyu_bot/commands/common/reaction_message.py | import asyncio
from typing import List, Callable, Awaitable, Union
import discord
from discord import Message, Embed, Emoji
from discord.ext.commands import Context
AnyEmoji = Union[str, Emoji]
async def run_tabbed_message(ctx: Context, emojis: List[AnyEmoji], embeds: List[Embed], files=None, starting_index=0,
... |
sigonasr2/miyu-bot | miyu_bot/commands/common/argument_parsing.py | <gh_stars>0
import re
from collections import namedtuple
from typing import Dict, List, Optional, Container, Any, Union, Callable, Set, Iterable
# https://stackoverflow.com/questions/249791/regex-for-quoted-string-with-escaping-quotes
# https://stackoverflow.com/questions/21105360/regex-find-comma-not-inside-quotes
#... |
sigonasr2/miyu-bot | miyu_bot/bot/bot.py | from d4dj_utils.master.asset_manager import AssetManager
from discord.ext import commands
from miyu_bot.bot.master_asset_manager import MasterFilterManager
from miyu_bot.bot.name_aliases import NameAliases
class D4DJBot(commands.Bot):
assets: AssetManager
asset_filters: MasterFilterManager
aliases: NameA... |
sigonasr2/miyu-bot | miyu_bot/commands/cogs/event.py | import asyncio
import datetime
import datetime as dt
import logging
import math
import aiohttp
import dateutil.parser
import discord
import pytz
from d4dj_utils.master.event_master import EventMaster, EventState
from discord.ext import commands
from pytz import UnknownTimeZoneError
from miyu_bot.bot.bot import D4DJBo... |
sigonasr2/miyu-bot | update_assets.py | <filename>update_assets.py<gh_stars>0
import asyncio
import logging
import logging.config
from d4dj_utils.master.asset_manager import AssetManager
from d4dj_utils.extended.manager.revision_manager import RevisionManager
async def main():
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__na... |
sigonasr2/miyu-bot | miyu_bot/commands/cogs/card.py | import asyncio
import enum
import logging
import re
import discord
from d4dj_utils.master.card_master import CardMaster
from d4dj_utils.master.event_specific_bonus_master import EventSpecificBonusMaster
from d4dj_utils.master.skill_master import SkillMaster
from discord.ext import commands
from miyu_bot.bot.bot impor... |
xavierholt/binaryninja-api | suite/api_test.py | import unittest
import platform
import os
from binaryninja.binaryview import BinaryView, BinaryViewType
from binaryninja.settings import Settings, SettingsScope
from binaryninja.metadata import Metadata
from binaryninja.demangle import demangle_gnu3, get_qualified_name
from binaryninja.architecture import Architecture... |
xavierholt/binaryninja-api | python/examples/export_svg.py | <reponame>xavierholt/binaryninja-api
# from binaryninja import *
import os
import webbrowser
import time
import sys
from pathlib import Path
from urllib.request import pathname2url
from binaryninja.interaction import get_save_filename_input, show_message_box, TextLineField, ChoiceField, SaveFileNameField, get_form_inp... |
xavierholt/binaryninja-api | suite/generator.py | <filename>suite/generator.py<gh_stars>0
#!/usr/bin/env python2
import pickle
import sys
import os
import zipfile
from optparse import OptionParser
import testcommon
import time
if sys.version_info.major == 3:
# The differences between the behavior of str() on Python 2 and Python 3 make it very difficult to make
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.