repo_name stringlengths 6 97 | path stringlengths 3 341 | text stringlengths 8 1.02M |
|---|---|---|
irasus-technologies/EnergyBoost | data_processing/ghi_model_fig.py | <gh_stars>0
# coding: utf-8
# In[1]:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn import linear_model, ensemble, svm, tree, neural_network
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import MinMaxScaler, StandardScaler
from sklearn.metrics import me... |
choco9966/Hair-Segmentation | utils.py | <filename>utils.py
# ====================================================
# CFG
# ====================================================
class CFG:
debug=False
img_size=512
max_len=275
print_freq=1000
num_workers=0
encoder_type='timm-efficientnet-b2'
decoder_type='Unet'
size=512 # [512, ... |
choco9966/Hair-Segmentation | inference.py | # ====================================================
# Directory settings
# ====================================================
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '0, 1' # specify GPUs locally
import argparse
def get_args():
parser = argparse.ArgumentParser(description='Hair Segmentation')
pars... |
choco9966/Hair-Segmentation | train_celeb.py | <reponame>choco9966/Hair-Segmentation
#!/usr/bin/env python
# coding: utf-8
# # About this notebook
# - Starter using PyTorch
# # Directory settings
# ====================================================
# Directory settings
# ====================================================
import os
os.environ['CUDA_VISIBLE_DE... |
choco9966/Hair-Segmentation | train_korean.py | import argparse
# ====================================================
# Directory settings
# ====================================================
import os
from utils import CFG
os.environ['CUDA_VISIBLE_DEVICES'] = '0, 1' # specify GPUs locally
OUTPUT_DIR = './submission'
if not os.path.exists(OUTPUT_DIR):
os.mak... |
shauryashaurya/intro-to-q-learning-using-gym | q-learn01.py | import gym
import numpy as np
# Q-Learning settings
LEARNING_RATE = 0.1
DISCOUNT = 0.95
EPISODES = 25000
env = gym.make("MountainCar-v0")
# env.reset() # no longer needed, we'll use the get_discrete_state method to get the right bucket
# while this env provides a min/max -
# IRL we may need to run observations for... |
jeffkub/led-wall-clock | dimmer.py | import ephem
import logging
class Dimmer(object):
def __init__(self, scheduler):
self._observer = ephem.Observer()
self._observer.pressure = 0
self._observer.horizon = '-6'
self._observer.lat = '38.262469'
self._observer.lon = '-85.648625'
self.brightness = 100
... |
jeffkub/led-wall-clock | display.py | <gh_stars>10-100
import threading
import time
from rgbmatrix import graphics
from rgbmatrix import RGBMatrix
class Display(threading.Thread):
def __init__(self, weather, dimmer):
threading.Thread.__init__(self)
self.setDaemon(True)
self._weather = weather
self._dimmer = dimmer
... |
draguar/ProjetSimBio | TwisTranscripT/start_simulation.py | import sys
import argparse
import textwrap
import configparser
import TSC as SIM
def _main():
parser = argparse.ArgumentParser(
formatter_class=argparse.RawDescriptionHelpFormatter,
epilog=textwrap.dedent('''\
Examples:
python3 start_simulation.py example/params.ini
... |
draguar/ProjetSimBio | ourCode.py | <filename>ourCode.py
# -*- coding: utf-8 -*-
"""
Simulation of a genome evolving inside an environment without mutations on
coding sequences.
"""
import numpy as np
import os
import re
import matplotlib.pyplot as plt
import pandas as pd
#=======================================================================
# ... |
nwiizo/ofsc-tester | ofsc/handler.py | <filename>ofsc/handler.py<gh_stars>1-10
def handle(req):
msg = req
if len(req) == 0:
return "pass a value to the function"
return str.format("Anisha said: {}", msg)
|
sthysel/knobs | src/environment.py | <reponame>sthysel/knobs<gh_stars>1-10
# forked, adapted and merged from
# https://github.com/theskumar/python-dotenv
# https://github.com/mattseymour/python-env
import codecs
import os
import re
import sys
import warnings
from collections import OrderedDict
__escape_decoder = codecs.getdecoder('unicode_escape')
__pos... |
sthysel/knobs | src/knobs.py | <filename>src/knobs.py
import os
import sys
import json
from json import JSONDecodeError
import click
import tabulate
from environment import find_dotenv, load_dotenv
load_dotenv(find_dotenv(usecwd=True))
BOOLEAN_TRUE_STRINGS = ('true', 'on', 'ok', 'y', 'yes', '1')
class Knob:
"""
A knob can be tuned to ... |
sthysel/knobs | tests/test_environment.py | <filename>tests/test_environment.py<gh_stars>1-10
# -*- encoding: utf-8 -*-
import os
import warnings
import pytest
from environment import find_dotenv, load_dotenv
try:
from tempfile import TemporaryDirectory
except ImportError:
from backports.tempfile import TemporaryDirectory
def dotenv_file(tmpdir):
... |
sthysel/knobs | tests/knob_test.py | import os
from knobs import Knob
def test_repr():
pirate_count = Knob('JOLLY_ROGER_PIRATES', 124, description='Yar')
assert repr(pirate_count) == "Knob('JOLLY_ROGER_PIRATES', 124, unit='', description='Yar', validator=None)"
def test_serialize():
knob = Knob('WUNDER', 'BAR', description='Foo Bar')
... |
sthysel/knobs | setup.py | <filename>setup.py
import io
from glob import glob
from os.path import basename, dirname, join, splitext
from setuptools import find_packages, setup
with open('README.rst', encoding='utf-8') as f:
readme = f.read()
setup(
name='knobs',
license='GPLv2',
version='2.1.1',
description='Environment va... |
thinkAmi-sandbox/google-api-python-client-sample | gmail_sender.py | <filename>gmail_sender.py
import httplib2
import os
import apiclient
import oauth2client
import argparse
flags = argparse.ArgumentParser(
parents=[oauth2client.tools.argparser]
).parse_args()
import base64
from email.mime.text import MIMEText
from email.utils import formatdate
import traceback
# I... |
thinkAmi-sandbox/google-api-python-client-sample | google_drive_api/google_drive_ocr_uploader.py | import argparse
import os
import pathlib
import httplib2
from apiclient import discovery
from googleapiclient.http import MediaFileUpload
from oauth2client import client
from oauth2client import tools
from oauth2client.file import Storage
UPLOAD_FILE_NAME = '2017h29a_fe_am_qs.pdf'
# pdfをGoogle DocsにすることでOCRしてくれる
# ... |
palosopko/audiolibrix-python | audiolibrix/__init__.py | <filename>audiolibrix/__init__.py<gh_stars>0
from .error import ( # noqa: F401
APIConnectionError,
APIError,
AudiolibrixError,
InvalidAuthorizationError,
InvalidRequestError,
NotFoundError,
)
from .http_client import Requestor # noqa: F401
from .resource import Book, Catalogue, Order # noqa: ... |
palosopko/audiolibrix-python | tests/test_auth.py | <reponame>palosopko/audiolibrix-python<filename>tests/test_auth.py<gh_stars>0
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import pytest
import audiolibrix
from audiolibrix import APIError
from audiolibrix.http_client import Auth
class TestAuth(object):
def test_inva... |
palosopko/audiolibrix-python | audiolibrix/http_client.py | import audiolibrix
import hmac
import requests
from hashlib import sha256
class Auth:
def __init__(self):
if (
not isinstance(audiolibrix.api_credentials, tuple)
or len(audiolibrix.api_credentials) != 2
):
raise audiolibrix.error.APIError(
"Inva... |
palosopko/audiolibrix-python | audiolibrix/version.py | <reponame>palosopko/audiolibrix-python
VERSION = "0.3.4"
|
palosopko/audiolibrix-python | audiolibrix/resource.py | import audiolibrix
from decimal import Decimal
from datetime import datetime
from .error import APIError, InvalidRequestError
class Book:
def __init__(self, data={}):
if data.get("forSale", False):
self.status = "active"
else:
self.status = "inactive"
self.id = i... |
palosopko/audiolibrix-python | audiolibrix/error.py | <filename>audiolibrix/error.py
class AudiolibrixError(Exception):
def __init__(self, message=None, http_body=None, http_status=None):
super(AudiolibrixError, self).__init__(message)
self.http_body = http_body
self.http_status = http_status
class InvalidAuthorizationError(AudiolibrixError)... |
dem4ply/chibi_filter_elasticsearch | chibi_filter_elasticsearch/lookup.py | <reponame>dem4ply/chibi_filter_elasticsearch
#from .base import Lookup as Lookup_baseJKUe
from chibi_filter.lookup import Lookup as Lookup_base
from elasticsearch_dsl import Q
class Lookup( Lookup_base ):
def needed_transform_to_nested( self, q ):
if self.nested_path is not None:
q = Q( 'neste... |
dem4ply/chibi_filter_elasticsearch | chibi_filter_elasticsearch/descriptor.py | from chibi_filter import descriptor
from chibi_filter_elasticsearch.lookup import (
Number as Number_lookup,
String as String_lookup,
Datetime as Datetime_lookup,
Boolean as Boolean_lookup,
)
class Numeric( descriptor.Numeric ):
def get_lookup_class( self, key, lookup, value, nested_path=None ):
... |
dem4ply/chibi_filter_elasticsearch | tests/lookup.py | from unittest import TestCase
from chibi_filter_elasticsearch.lookup import Number, String, Datetime, Boolean
class Test_number( TestCase ):
def test_init( self ):
lookup = Number( 'some_field', 'eq', 'nothign' )
return lookup
def test_build_eq( self ):
lookup = self.test_init()
... |
dem4ply/chibi_filter_elasticsearch | tests/base.py | from unittest import TestCase
from chibi_filter import Chibi_filter
from chibi_filter_elasticsearch import descriptor
from chibi_filter import Q
from chibi_filter.exceptions import Filter_not_exits
from elasticsearch_dsl import Document, field
class Filter_numeric( Chibi_filter ):
numeric_1 = descriptor.Numeric(... |
dem4ply/chibi_filter_elasticsearch | tests/descriptor.py | from unittest import TestCase
from chibi_filter import Q
from chibi_filter_elasticsearch.descriptor import Numeric, String, Datetime, Boolean
class Test_numeric_leaf( TestCase ):
def test_convert_q_eq( self ):
field = Numeric()
q = Q( field_numeric__eq=1 )
convert_q = field.convert_q( q )
... |
r-matsuzaka/cloud-function-example | src/cloud_functions/main.py | <reponame>r-matsuzaka/cloud-function-example
import numpy
import tensorflow
from google.cloud import storage
from tensorflow.keras.layers import Dense, Flatten, Conv2D
from tensorflow.keras import Model
from PIL import Image
# We keep model as global variable so we don't have to reload it in case of warm in... |
r-matsuzaka/cloud-function-example | src/upload.py | from google.cloud import storage as gcs
from google.oauth2 import service_account
key_path = "key/gcs-access.json"
gcs_path = "tensorflow/test.png"
local_path = "data/test.png"
def upload(project_id: str, bucket_name: str) -> None:
credential = service_account.Credentials.from_service_account_file(key_p... |
r-matsuzaka/cloud-function-example | src/delete_image.py | from google.cloud import storage as gcs
from google.oauth2 import service_account
key_path = "key/gcs-access.json"
gcs_path = "tensorflow/test.png"
credential = service_account.Credentials.from_service_account_file(key_path)
def delete_image(project_id: str, bucket_name: str) -> None:
client = gcs.Cli... |
r-matsuzaka/cloud-function-example | src/prepare_image.py | <gh_stars>0
import random
from PIL import Image
from tensorflow.keras.datasets import fashion_mnist
(train_images, train_labels), (test_images, test_labels) = fashion_mnist.load_data()
image_num = random.randint(0, 9999)
example_image = test_images[image_num]
im = Image.fromarray(example_image)
im.save("... |
r-matsuzaka/cloud-function-example | src/request.py | import requests as rq
def requests(trigger: str) -> None:
response = rq.get(trigger)
print(response.status_code)
print(response.text)
|
r-matsuzaka/cloud-function-example | src/cloud_functions/requirements.py | tensorflow
google - cloud - storage
Pillow
|
r-matsuzaka/cloud-function-example | main.py | from src import delete_image
from src import prepare_image
from src import upload
from src import request
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--project_id")
parser.add_argument("--bucket_name")
parser.add_argument("--trigger")
args = parser.parse_args()
delete_i... |
brl0/extractionator | server/__main__.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" This is the entry point for if your module is
executed like this: ``python -m pagefunc``. """
import sys
try:
from .cli import main
except:
from cli import *
if __name__ == '__main__':
sys.exit(main()) # pragma: no cover
|
brl0/extractionator | tests/test_cli.py | import pytest
from click.testing import CliRunner
from pagefunc import *
from cli import main
@pytest.fixture
def runner():
return CliRunner()
def test_cli(runner):
result = runner.invoke(main)
assert result.exit_code == 0
assert not result.exception
assert result.output.strip() == 'Hello, world.... |
brl0/extractionator | server/constants.py | <reponame>brl0/extractionator
import os
CONSTANTS = {
'HOSTNAME': 'localhost',
'PORT': os.environ.get('PORT', 3001),
'HTTP_STATUS': {
'404_NOT_FOUND': 404,
'201_CREATED': 201,
'500_INTERNAL_SERVER_ERROR': 500
},
'ENDPOINT': {
'LIST': '/api/list',
'MASTER_DETA... |
brl0/extractionator | server/views/list_views.py | <gh_stars>0
from flask import Blueprint
from flask import (jsonify, make_response, request)
from constants import CONSTANTS
from sample_data import sample_data
application = Blueprint('list', __name__, template_folder='templates')
# List Endpoints
@application.route(CONSTANTS['ENDPOINT']['LIST'])
def get_list():
... |
brl0/extractionator | server/configurations.py | <reponame>brl0/extractionator<gh_stars>0
class BaseCongig(object):
'''
Base config class
'''
DEBUG = True
TESTING = False
class ProductionConfig(BaseCongig):
"""
Production specific config
"""
DEBUG = False
class DevelopmentConfig(BaseCongig):
"""
Development environment specific configuration
"""
DEBUG = ... |
brl0/extractionator | check.py | import requests
from pprint import pprint
query = {b"url=https://github.com/shirosaidev/stocksight"}
r = requests.post('http://localhost:3001//spacy_info', data=query)
pprint(r.content)
|
brl0/extractionator | server/http_client.py | <filename>server/http_client.py
import requests
import json
from pprint import pprint
from constants import CONSTANTS
from query import make_query
q = make_query("https://google.com", "url,title")
resp = requests.post(f"http://localhost:3000/graphql", params={'query': q})
pprint(resp.content)
obj = json.loads(resp.te... |
brl0/extractionator | server/cli.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Console script for pagefunc.
If the module has a command line interface then this
file should be the entry point for that interface.
"""
from collections import OrderedDict
from pathlib import Path
from pprint import pprint
import sys
import click
from pagefunc impo... |
brl0/extractionator | server/data_table.py | <filename>server/data_table.py
import pandas as pd
def data_table(data, table_id='Table', idx_col=None):
df = pd.DataFrame(data)
if idx_col is not None:
df.set_index(idx_col)
html = df.to_html(table_id=table_id, index=False)
scripts = f"""
<link rel="stylesheet" type="text/css" href="https://c... |
brl0/extractionator | server/server.py | <reponame>brl0/extractionator
"""
Python HTTP server for GraphQL.
"""
import json
from os.path import exists, join
import sys
from flask import (
Flask, jsonify, make_response, request,
send_from_directory)
from flask_cors import CORS
from flask_graphql import GraphQLView
from bripy.bllb.bllb_logging import... |
brl0/extractionator | server/views/page_views.py | <filename>server/views/page_views.py
import json
from flask import (Blueprint, jsonify, render_template, url_for)
from textblob import TextBlob
from pagefunc import *
from schema import extract
application = Blueprint('pagefunc', __name__, template_folder='templates')
@application.route('/extract_page/<path:url>'... |
brl0/extractionator | server/schema.py | """
GraphQL schema for extracting results from a website.
"""
from collections import defaultdict
from html import escape
from urllib.parse import urljoin
from boltons import urlutils
from bs4 import BeautifulSoup
from extraction import DictExtractor as Extractor
from extraction.techniques import Technique
import gra... |
brl0/extractionator | server/__init__.py | <filename>server/__init__.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Top-level package for pagefunc."""
__author__ = '<NAME>'
__email__ = '<EMAIL>'
__license__ = 'MIT'
__version__ = '0.1.0'
|
brl0/extractionator | server/query.py | import pprint
import schema
import sys
ALL_PARTS = "url,title,feed,image,description,text,qs"
def make_query(url, parts=ALL_PARTS):
q = """{website(url:"URL"){PARTS}}"""
q = q.replace("URL", url)
q = q.replace("PARTS", parts)
return q
def query_url(url, parts=ALL_PARTS):
q = make_query(url, part... |
brl0/extractionator | server/pagefunc.py | <gh_stars>0
#!/usr/bin/env python3
"""Main module."""
import json
import sys
from urllib.parse import urljoin
from bs4 import BeautifulSoup
from flask import render_template
import pandas as pd
import requests
from bripy.bllb.bllb_parsers import HTML_Parser
from bripy.bllb.bllb_logging import DBG, logger
def pageh... |
RamnathKumar181/Temporal-Dynamics-and-Spatial-Content-in-IoT-Malware-Detection | tl.py | import numpy as np
import pandas as pd
benign = np.load('NPY/benign_data_no_preprocessing_128.npy', encoding = 'latin1') # MODEL 1
malware = np.load('NPY/malware_data_no_preprocessing_128.npy', encoding = 'latin1')
from sklearn.model_selection import train_test_split
A_benign,B_benign = train_test_split(benign,test_... |
RamnathKumar181/Temporal-Dynamics-and-Spatial-Content-in-IoT-Malware-Detection | load_data.py | <gh_stars>1-10
import numpy as np
import pandas as pd
import sys
import os
path = "DATA"
path_files = os.listdir(path)
data=[]
for file in path_files:
file_path=path + "/" + file
print(file_path)
if os.path.lexists(file_path) and not os.path.isdir(file_path):
training_data_1 = np.load(file_path,... |
RamnathKumar181/Temporal-Dynamics-and-Spatial-Content-in-IoT-Malware-Detection | create_noise_test.py | <reponame>RamnathKumar181/Temporal-Dynamics-and-Spatial-Content-in-IoT-Malware-Detection<filename>create_noise_test.py
import cv2
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import os
from random import shuffle
import random
from scipy import ndimage
# training_path = 'Malware Images'
traini... |
RamnathKumar181/Temporal-Dynamics-and-Spatial-Content-in-IoT-Malware-Detection | ml.py | <gh_stars>1-10
import numpy as np
import pandas as pd
# Importing the Keras libraries and packages
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
from keras.layers import Dropout
from sklearn.metrics import cohen_kappa_score
from keras.callbacks import ReduceLROnPlat... |
RamnathKumar181/Temporal-Dynamics-and-Spatial-Content-in-IoT-Malware-Detection | make_csv.py | import os
import csv
import sys
import numpy as np
path = "IoT_Malware"
path_files = os.listdir(path)
maxlen=489017
for file in path_files:
file_path=path + "/" + file
print(file_path)
data=[]
if os.path.lexists(file_path) and not os.path.isdir(file_path):
with open(file_path, "rb") as f:
... |
RamnathKumar181/Temporal-Dynamics-and-Spatial-Content-in-IoT-Malware-Detection | cnn.py | import numpy as np
import pandas as pd
benign = np.load('benign_data_preprocessing_64.npy', encoding = 'latin1') # MODEL 1
malware = np.load('malware_data_preprocessing_64.npy', encoding = 'latin1')
from sklearn.model_selection import train_test_split
A_benign,B_benign = train_test_split(benign,test_size=0.2,random_... |
servercalap/ValidDex | dex/validation.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import json
import io
import platform
import xml.etree.ElementTree as ET
from collections import defaultdict
import random
import string
dv = defaultdict(lambda: 0)
xml_List = []
ce = []
result = {}
empty_dict = dict.fromkeys(['id', "name"])
def runValid(dirname... |
servercalap/ValidDex | dex/jsontopascalxml.py | <gh_stars>1-10
import os
import platform
import requests
import string
import random
def writeDir(path):
print('selected', path)
if platform.system() == 'Windows':
pathDir = os.path.normpath(os.path.expanduser('~/Desktop/'))
else:
pathDir = os.path.join(os.path.expanduser('~/Desktop/'))
... |
servercalap/ValidDex | dex/findXmlName.py | import os
import xml.etree.ElementTree as ET
gg = []
def findAll(dirname, findName):
items = os.listdir(dirname)
for item in items:
if item[-3:] != 'xml':
continue
find_one(os.path.join(dirname, item), findName)
def find_one(filename, findName):
root = ET.parse(filename).... |
servercalap/ValidDex | dex/dex.py | <reponame>servercalap/ValidDex
# -*- coding: utf-8 -*-
import sys
from PyQt5.QtCore import QByteArray
from PyQt5.QtWidgets import QApplication, QWidget, QLabel, \
QPushButton, QPlainTextEdit, QFileDialog, QLineEdit, QVBoxLayout, QFileSystemModel, QTreeView, QMessageBox, \
QTextEdit,QFormLayout
from PyQt5.QtGu... |
servercalap/ValidDex | dex/stats.py | <reponame>servercalap/ValidDex
import os
import xml.etree.ElementTree as ET
from collections import defaultdict
from collections import Counter
import json
import platform
import csv
aa = defaultdict(lambda: 0)
gg = []
global _path
pa = ""
def find_One(filename):
root = ET.parse(filename).getroot()
for obj... |
shaojunda/ckb-address-demo | ckb_addr_test.py | <reponame>shaojunda/ckb-address-demo<filename>ckb_addr_test.py
#!/usr/bin/python3
# CKB Address test code
# <EMAIL>
import segwit_addr as sa
FORMAT_TYPE_SHORT = 0x01
FORMAT_TYPE_FULL_DATA = 0x02
FORMAT_TYPE_FULL_TYPE = 0x04
CODE_INDEX_SECP256K1 = 0x00
def generateShortAddress(pk, network = "mainnet"):
""... |
andyfryman/rcr-ml | app/server.py | import joblib
from sklearn.linear_model import LogisticRegression
from sklearn.feature_extraction.text import TfidfVectorizer
from pymystem3 import Mystem
import re
from flask import Flask, request, jsonify, Response
from flasgger import Schema, Swagger, SwaggerView, fields
from flask_restful import Api, Resource, abo... |
wunderkennd/starthinker | starthinker/task/census/run.py | ###########################################################################
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/l... |
wunderkennd/starthinker | starthinker_ui/recipe/models.py | <reponame>wunderkennd/starthinker
###########################################################################
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at... |
wunderkennd/starthinker | starthinker/task/url/run.py | ###########################################################################
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/l... |
wunderkennd/starthinker | starthinker/task/dbm/run.py | ###########################################################################
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/l... |
wunderkennd/starthinker | starthinker/util/ga/__init__.py | ###########################################################################
#
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/l... |
wunderkennd/starthinker | starthinker/task/dv_editor/patch.py | ###########################################################################
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/l... |
wunderkennd/starthinker | starthinker/task/vision_api/run.py | ###########################################################################
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/l... |
wunderkennd/starthinker | starthinker/task/dv_editor/creative.py | <gh_stars>0
###########################################################################
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.... |
wunderkennd/starthinker | starthinker/task/dv_editor/run.py | <reponame>wunderkennd/starthinker
###########################################################################
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at... |
wunderkennd/starthinker | starthinker/task/ga/run.py | <reponame>wunderkennd/starthinker<filename>starthinker/task/ga/run.py
###########################################################################
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You... |
wunderkennd/starthinker | starthinker/util/dbm/targeting.py | ###########################################################################
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/l... |
wunderkennd/starthinker | starthinker_ui/ui/framework.py | <filename>starthinker_ui/ui/framework.py
###########################################################################
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Lic... |
wunderkennd/starthinker | starthinker/task/dv_targeter/run.py | ###########################################################################
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/l... |
wunderkennd/starthinker | starthinker/task/google_api/run.py | <gh_stars>0
###########################################################################
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.... |
wunderkennd/starthinker | starthinker/task/itp_audit/queries.py | ###########################################################################
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/l... |
wunderkennd/starthinker | starthinker/task/conversion_upload/run.py | <reponame>wunderkennd/starthinker
###########################################################################
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at... |
Gibby/ad-alexadoorwindowannounce | apps/alexa_door_window_announce.py | <filename>apps/alexa_door_window_announce.py
import appdaemon.plugins.hass.hassapi as hass
from datetime import datetime, time, timedelta
#
# Alexa Door Window Announce App
#
# Args:
#alexa_door_window_announce:
# module: alexa_door_window_announce
# class: AlexaDoorWindowAnnounce
# alexas:
# - media_player.kitc... |
d1024choi/traj-pred-irl | Crowd/crowd_test_visualization.py | <reponame>d1024choi/traj-pred-irl<gh_stars>10-100
'''
VALIDATION CODE SHARED BY EACH ALGORITHMS
MADE BY <NAME> (<EMAIL>)
DATE : 2019-12-06
'''
from crowd_model import Model
from crowd_utils import DataLoader
from crowd_functions import *
from crowd_occupancy import *
import pickle
import os
import argparse
def m... |
d1024choi/traj-pred-irl | SDD/sdd_utils.py | '''
SDD TRACKING DATA LOADER
MADE BY <NAME> (<EMAIL>)
DATE : 2019-12-06
'''
import pickle
import os
from sdd_functions import *
from sdd_functions import _min, _max
class DataLoader:
def __init__(self, args):
self.dataset_path = args.dataset_path
self.batch_size = args.batch_size
sel... |
d1024choi/traj-pred-irl | Crowd/crowd_model.py | from crowd_functions import *
class Model():
def __init__(self, args, infer=False):
# # ------------------------------------------------------------------
# # Parameter setting
print('>> network configuration starts ...')
if infer:
args.batch_size = 1
# defin... |
d1024choi/traj-pred-irl | Crowd/crowd_utils.py | '''
CROWD DATA LOADER BASED ON KITTI DATA LOADER
MADE BY <NAME> (<EMAIL>)
DATE : 2019-12-06
dataset number | leave dataset name
------------------------------------
0 | eth
1 | hotel
2 | univ
3 | zara1
4 | zara2
'''... |
d1024choi/traj-pred-irl | Crowd/crowd_train.py | <reponame>d1024choi/traj-pred-irl<gh_stars>10-100
'''
CROWD TRAJECTORY PREDICTION TRAINING
MADE BY <NAME> (<EMAIL>)
DATE : 2019-12-06
'''
import argparse
import time
from crowd_model import Model
from crowd_utils import DataLoader
from crowd_functions import *
from crowd_occupancy import *
def print_training_inf... |
d1024choi/traj-pred-irl | Crowd/crowd_test.py | '''
VALIDATION CODE SHARED BY EACH ALGORITHMS
MADE BY <NAME> (<EMAIL>)
DATE : 2019-12-06
'''
from crowd_model import Model
from crowd_utils import DataLoader
from crowd_functions import *
from crowd_occupancy import *
import pickle
import os
import argparse
#import matplotlib.pyplot as plt
def main():
parser... |
d1024choi/traj-pred-irl | Crowd/crowd_occupancy.py | '''
GENERATING OCCUPANCY GRID MAP
MADE BY <NAME> (<EMAIL>)
DATE : 2019-12-06
'''
import numpy as np
import math
#import matplotlib.pyplot as plt
def rectangular_occupancy_map(xo_batch, MNP, num_peds_batch, obs_len, social_range, grid_size):
'''
:param xo_batch: <MNP x obs_length x 2>, ....
:param num... |
d1024choi/traj-pred-irl | SDD/sdd_functions.py | '''
FUNCTIONS SHARED BY EACH ALGORITHMS
MADE BY <NAME> (<EMAIL>)
DATE : 2019-12-06
'''
import numpy as np
import math
import random
import tensorflow as tf
import sys
#import matplotlib.pyplot as plt
import cv2
import copy
def _max(a,b):
if (a>b):
return a
else:
return b
def _min(a,b):
... |
d1024choi/traj-pred-irl | Crowd/crowd_functions.py | '''
FUNCTIONS SHARED BY EACH ALGORITHMS
MADE BY <NAME> (<EMAIL>)
DATE : 2019-12-06
'''
import numpy as np
import math
import tensorflow as tf
import sys
import random
import pickle
import os
import copy
#import matplotlib.pyplot as plt
#import cv2
def _max(a,b):
if (a>b):
return a
else:
r... |
d1024choi/traj-pred-irl | SDD/sdd_test.py | '''
VALIDATION CODE SHARED BY EACH ALGORITHMS
MADE BY <NAME> (<EMAIL>)
DATE : 2019-12-06
'''
from sdd_model import Model
from sdd_utils import DataLoader
from sdd_functions import *
import pickle
import os
import argparse
#import matplotlib.pyplot as plt
def main():
parser = argparse.ArgumentParser()
par... |
d1024choi/traj-pred-irl | SDD/sdd_test_visualization.py | <reponame>d1024choi/traj-pred-irl<filename>SDD/sdd_test_visualization.py<gh_stars>10-100
'''
VALIDATION CODE SHARED BY EACH ALGORITHMS
MADE BY <NAME> (<EMAIL>)
DATE : 2019-12-06
'''
from sdd_model import Model
from sdd_utils import DataLoader
from sdd_functions import *
import pickle
import os
import argparse
impo... |
d1024choi/traj-pred-irl | SDD/sdd_train.py | <reponame>d1024choi/traj-pred-irl
'''
SDD TRAJECTORY PREDICTION TRAINING
MADE BY <NAME> (<EMAIL>)
DATE : 2019-12-06
'''
import argparse
import os
import pickle
import time
from sdd_model import Model
from sdd_utils import DataLoader
from sdd_functions import *
def print_training_info(args):
print('---------... |
d1024choi/traj-pred-irl | SDD/sdd_model.py | <reponame>d1024choi/traj-pred-irl<gh_stars>10-100
from sdd_functions import *
class Model():
def __init__(self, args, infer=False):
# # ------------------------------------------------------------------
# # Parameter setting
print('>> network configuration starts ...')
# define ... |
Swivel-Finance/swivel-py | swivel/tests/conftest.py | <filename>swivel/tests/conftest.py
import os
import pytest
import logging
from web3 import Web3, EthereumTesterProvider
from eth_tester import PyEVMBackend, EthereumTester
from swivel.vendors import W3
from swivel.contracts.bin import MARKET_PLACE, SWIVEL
from swivel.helpers import transact
from swivel.contracts import... |
Swivel-Finance/swivel-py | swivel/contracts/market_place.py | <reponame>Swivel-Finance/swivel-py
from swivel.abstracts import MarketPlace as base
from .abi import MARKET_PLACE
class MarketPlace(base):
def __init__(self, v):
"""
Parameters:
v (W3) Instance of a vendor W3 class (no other vendors are supported as of now)
"""
self.vend... |
Swivel-Finance/swivel-py | swivel/tests/w3_test.py | import pytest
def test_account(vendor):
assert len(vendor.account) == 42
# the fixture does not pass an account, so it should be accounts[0]
assert vendor.account == vendor.instance.eth.accounts[0]
def test_estimate_gas(vendor, swivel):
args = swivel.split_underlying('0x5592EC0cfb4dbc12D3aB100b2571534... |
Swivel-Finance/swivel-py | swivel/tests/swivel_test.py | import pytest
from swivel.helpers import call
@pytest.fixture(scope='module')
def key(vendor):
return vendor.instance.toBytes(hexstr='0xfb28b03032bbb105e1199e496b23a6435a077375cbea9c6c4998b971a672873c')
@pytest.fixture(scope='module')
def orders(key):
# we can use the same order 2x here for the purpose of thi... |
Swivel-Finance/swivel-py | swivel/abstracts/__init__.py | <filename>swivel/abstracts/__init__.py
from swivel.abstracts.deployed import Deployed
from swivel.abstracts.vault_tracker import VaultTracker
from swivel.abstracts.market_place import MarketPlace
from swivel.abstracts.swivel import Swivel
|
Swivel-Finance/swivel-py | swivel/mocks/__init__.py | from swivel.abstracts import Deployed
from .abi import CERC20
class CErc20(Deployed):
def __init__(self, v):
self.vendor = v
self.abi = CERC20
def exchange_rate_current_returns(self, n, opts=None):
return self.contract.functions.exchangeRateCurrentReturns(n), self.tx_opts(opts)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.