repo_name stringlengths 6 97 | path stringlengths 3 341 | text stringlengths 8 1.02M |
|---|---|---|
jazzyeagle/chatbot_website | chatbot/plugin.py | from datetime import datetime
from enum import Enum
class MessageType(Enum):
Server = 'Server'
Channel = 'Channel'
Private = 'Private'
class Message:
def __init__(self,
message_type = MessageType.Channel,
platform = '',
author = '',... |
jazzyeagle/chatbot_website | show/migrations/0012_alter_request_played_by.py | # Generated by Django 3.2.8 on 2021-10-16 20:02
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('users', '0003_user_saymyname'),
('show', '0011_auto_20211016_1952'),
]
operations = [
migrations.Al... |
jazzyeagle/chatbot_website | chatbot/chatbot.py | #!/usr/bin/env python
"""
chatbot.py: This is the main engine of the bot, which communicates with the various plugins.
"""
import asyncio
import importlib
import logging
import pkgutil
import chatbot.db as db
from .parser import Parser
"""
Main Bot Class
"""
class ChatBot:
def __init__(self):
print('In... |
jazzyeagle/chatbot_website | show/migrations/0008_alter_request_user.py | <reponame>jazzyeagle/chatbot_website
# Generated by Django 3.2.8 on 2021-10-16 16:30
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('users', '0003_user_saymyname'),
('show', '0007_request_request_type'),
]
... |
jazzyeagle/chatbot_website | chatbot/db.py | import django
django.setup()
from datetime import datetime
import logging
from random import randint
from chatbot.models import *
from result import Result, ResultFlag
from asgiref.sync import sync_to_async
dbTableTypes = {
'commands': Command,
'settings': ConnectionSetting,
'variables': Variable
}
... |
jazzyeagle/chatbot_website | users/migrations/0005_userpronoun.py | <reponame>jazzyeagle/chatbot_website
# Generated by Django 3.2.8 on 2021-10-24 21:00
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('users', '0004_user_email'),
]
operations = [
migrations.CreateModel(
... |
AlexNilsson/python-remove-duplicate-files | removedupes/core.py | <reponame>AlexNilsson/python-remove-duplicate-files
from .Files import Files
def removeDuplicates(directory):
Files(directory).removeDuplicates()
|
AlexNilsson/python-remove-duplicate-files | removedupes/__init__.py | from .core import removeDuplicates
|
AlexNilsson/python-remove-duplicate-files | removedupes/Files.py | import os, hashlib
class Files:
def __init__(self, directory):
self.directory = directory
self.paths = Files.get_path_to_files(directory)
@staticmethod
def get_path_to_files(directory):
files = []
for filename in os.listdir(directory):
path_to_file = os.path.join(directory, filename)
... |
AlexNilsson/python-remove-duplicate-files | setup.py | <reponame>AlexNilsson/python-remove-duplicate-files
"""A google image search scraper to automatically search and download images from the web
See
https://github.com/AlexNilsson/python-remove-duplicate-files
"""
# Developers:
# Install with:
# pip install -e .
# Distribute with:
# python setup.py bdist_wheel
# twine ... |
techbvdinesh/AIND2-RNN | my_answers.py | import numpy as np
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
import keras
# TODO: fill out the function below that transforms the input series
# and window-size into a set of input/output pairs for use with our RNN model
def window_transform_series(series,windo... |
ElsevierSoftwareX/SOFTX_2019_242 | Core/Behavior/ComposedBehavior/ComposedBehavior.py | <filename>Core/Behavior/ComposedBehavior/ComposedBehavior.py<gh_stars>1-10
from Core.Enumerations import *
class ComposedBehavior(object):
def __init__(self, controlRef, behaviorList):
self.controlRef = controlRef
self.behaviorList = behaviorList
self.isOver = False
def applyBehavior(s... |
ElsevierSoftwareX/SOFTX_2019_242 | Examples/ExamplesWithPresets/exampleExuberant.py | <gh_stars>1-10
import sys
sys.path.append('../..')
from Core.Agent import *
agent = Agent("YOLO")
controlRef = agent.getControlRef()
agent.interact(generalProfile = "EXUBERANT", socialProfile="EXUBERANT", creativityProfile="EXUBERANT") |
ElsevierSoftwareX/SOFTX_2019_242 | Core/Planning.py | import time
import numpy
from colour import Color
from Core.Enumerations import *
from MachineLearning.util import extract_features, predict
from Core.BehaviorImports import *
class Planning(object):
def __init__(self, control, generalProfile, socialProfile, creativityProfile):
self.generalProfile = gene... |
ElsevierSoftwareX/SOFTX_2019_242 | Examples/exampleBugsBunny.py | <filename>Examples/exampleBugsBunny.py<gh_stars>1-10
import sys
sys.path.append('..')
from Core.Agent import *
agent = Agent("YOLO")
controlRef = agent.getControlRef()
helloBehavior = ComposedBehavior(controlRef, [BlinkBehaviorEaseInOut(controlRef, Color(rgb=(0.0,1.0,0.0)), ColorBrightness.LOW, 2, 3.0, Color(rgb=(... |
ElsevierSoftwareX/SOFTX_2019_242 | Core/Behavior/SimpleBehavior/BlinkBehavior/BlinkBehaviorInstant.py | <reponame>ElsevierSoftwareX/SOFTX_2019_242<gh_stars>1-10
import time
from Core.Enumerations import *
from Core.Behavior.SimpleBehavior.BlinkBehavior.BlinkBehavior import BlinkBehavior
class BlinkBehaviorInstant(BlinkBehavior, object):
def __init__(self, controlRef, blinkColor, brightness, repetitions, duration, ... |
ElsevierSoftwareX/SOFTX_2019_242 | Core/Actuators/LEDActuator.py | import numpy
import RPi.GPIO as GPIO
from neopixel import *
from Core.Enumerations import *
# LED strip configuration:
LED_COUNT = 15 # Number of LED pixels.
LED_PIN = 12 # GPIO pin connected to the pixels (18 uses PWM!).
LED_FREQ_HZ = 800000 # LED signal frequency in hertz (usually 800khz)
L... |
ElsevierSoftwareX/SOFTX_2019_242 | Core/Behavior/SimpleBehavior/MoveBehavior/MoveBehaviorCircle.py | <filename>Core/Behavior/SimpleBehavior/MoveBehavior/MoveBehaviorCircle.py
import sys
import time
import numpy
from colour import Color
import pytweening as tween
from Core.Enumerations import *
from Core.Behavior.SimpleBehavior.MoveBehavior.MoveBehavior import MoveBehavior
class MoveBehaviorCircle(MoveBehavior, obj... |
ElsevierSoftwareX/SOFTX_2019_242 | Core/BehaviorImports.py | <filename>Core/BehaviorImports.py
from Core.Behavior.SimpleBehavior.SimpleBehavior import SimpleBehavior
from Core.Behavior.SimpleBehavior.BlinkBehavior.BlinkBehavior import BlinkBehavior
from Core.Behavior.SimpleBehavior.BlinkBehavior.BlinkBehaviorEaseIn import BlinkBehaviorEaseIn
from Core.Behavior.SimpleBehavior.B... |
ElsevierSoftwareX/SOFTX_2019_242 | Examples/ExamplesWithPresets/exampleAloof.py | import sys
sys.path.append('../..')
from Core.Agent import *
agent = Agent("YOLO")
controlRef = agent.getControlRef()
agent.interact(generalProfile = "ALOOF", socialProfile="ALOOF", creativityProfile="ALOOF")
|
ElsevierSoftwareX/SOFTX_2019_242 | Core/Behavior/SimpleBehavior/BlinkBehavior/BlinkBehaviorEaseOut.py | import time
from colour import Color
from Core.Enumerations import *
from Core.Behavior.SimpleBehavior.BlinkBehavior.BlinkBehavior import BlinkBehavior
from Core.Behavior.SimpleBehavior.BlinkBehavior.BlinkBehaviorEaseIn import BlinkBehaviorEaseIn
class BlinkBehaviorEaseOut(BlinkBehavior, object):
def __init... |
ElsevierSoftwareX/SOFTX_2019_242 | Core/MachineLearning/util.py | # /usr/bin/python
from scipy.stats import mode
from scipy.spatial import ConvexHull
import numpy as np
import math
import cv2
from constants import TRAINING_LOCATION, CACHED_LOCATION, SHAPE
def polyArea(x, y):
return 0.5 * np.abs(np.dot(x, np.roll(y, 1)) - np.dot(y, np.roll(x, 1)))
def perimeter(points):
p ... |
ElsevierSoftwareX/SOFTX_2019_242 | Examples/exampleMickey.py | import sys
sys.path.append('..')
from Core.Agent import *
mainColor = Color(rgb=(1.0,0.0,0.0))
agent = Agent("YOLO")
controlRef = agent.getControlRef()
helloBehavior = ComposedBehavior(controlRef, [BlinkBehaviorEaseIn(controlRef, mainColor, ColorBrightness.HIGH, 3, 2.0, Color(rgb=(0.0, 0.0, 0.0)))])
goodbyeBehavio... |
ElsevierSoftwareX/SOFTX_2019_242 | Core/Behavior/SimpleBehavior/MoveBehavior/MoveBehaviorLoops.py | import sys
import time
import numpy
from colour import Color
import pytweening as tween
from Core.Enumerations import *
from Core.Behavior.SimpleBehavior.MoveBehavior.MoveBehavior import MoveBehavior
class MoveBehaviorLoops(MoveBehavior, object):
def __init__(self, controlRef, movementSpeed, movementDirection, ... |
ElsevierSoftwareX/SOFTX_2019_242 | Core/Behavior/SimpleBehavior/SimpleBehavior.py | import sys
import threading
import time
from Core.Enumerations import *
class SimpleBehavior(object):
def __init__(self, controlRef, maxBehaviorRepetitions, duration):
self.isOver = False
self.duration = duration;
self.maxBehaviorRepetitions = maxBehaviorRepetitions
self.currentBeh... |
ElsevierSoftwareX/SOFTX_2019_242 | Core/Behavior/SimpleBehavior/BlinkBehavior/BlinkBehaviorEaseInOut.py | import time
from colour import Color
from Core.Enumerations import *
from Core.Behavior.SimpleBehavior import SimpleBehavior
from Core.Behavior.SimpleBehavior.BlinkBehavior.BlinkBehavior import BlinkBehavior
from Core.Behavior.SimpleBehavior.BlinkBehavior.BlinkBehaviorEaseIn import BlinkBehaviorEaseIn
from Core.Behavio... |
ElsevierSoftwareX/SOFTX_2019_242 | Core/Behavior/SimpleBehavior/MoveBehavior/MoveBehavior.py | <reponame>ElsevierSoftwareX/SOFTX_2019_242
import sys
import time
import numpy
from Core.Enumerations import *
from Core.Behavior.SimpleBehavior.SimpleBehavior import SimpleBehavior
class MoveBehavior(SimpleBehavior, object):
def __init__(self, controlRef, movementSpeed, movementDirection, maxBehaviorRepetition... |
ElsevierSoftwareX/SOFTX_2019_242 | Core/Behavior/SimpleBehavior/BlinkBehavior/BlinkBehaviorLinear.py | import time
from Core.Enumerations import *
from Core.Behavior.SimpleBehavior.BlinkBehavior.BlinkBehavior import BlinkBehavior
class BlinkBehaviorLinear(BlinkBehavior, object):
def __init__(self, controlRef, blinkColor, brightness, repetitions, duration, defaultColor):
super(BlinkBehaviorLinear, self).__init__(c... |
ElsevierSoftwareX/SOFTX_2019_242 | Core/Behavior/SimpleBehavior/MoveBehavior/MoveBehaviorCurved.py | import sys
import time
import numpy
from colour import Color
import pytweening as tween
from Core.Enumerations import *
from Core.Behavior.SimpleBehavior.MoveBehavior.MoveBehavior import MoveBehavior
class MoveBehaviorCurved(MoveBehavior, object):
def __init__(self, controlRef, movementSpeed, movementDirection,... |
ElsevierSoftwareX/SOFTX_2019_242 | Core/Behavior/ComposedBehavior/PuppeteerBehavior.py | <gh_stars>1-10
from colour import Color
from Core.Enumerations import *
from Core.Behavior.ComposedBehavior.ComposedBehavior import ComposedBehavior
from Core.Behavior.SimpleBehavior.BlinkBehavior.BlinkBehaviorInstant import BlinkBehaviorInstant
from Core.Behavior.SimpleBehavior.MoveBehavior.MoveBehaviorSpikes import M... |
ElsevierSoftwareX/SOFTX_2019_242 | Core/Behavior/ComposedBehavior/HelloBehavior.py | from colour import Color
from Core.Enumerations import *
from Core.Behavior.ComposedBehavior.ComposedBehavior import ComposedBehavior
from Core.Behavior.SimpleBehavior.BlinkBehavior.BlinkBehaviorEaseInOut import BlinkBehaviorEaseInOut
class HelloBehavior(ComposedBehavior):
def __init__(self, controlRef):
C... |
ElsevierSoftwareX/SOFTX_2019_242 | Core/Behavior/SimpleBehavior/BlinkBehavior/BlinkBehavior.py | <reponame>ElsevierSoftwareX/SOFTX_2019_242
import time
import numpy
from colour import Color
from Core.Enumerations import *
from Core.Behavior.SimpleBehavior.SimpleBehavior import SimpleBehavior
class BlinkBehavior(SimpleBehavior, object):
def __init__(self, controlRef, blinkColor, brightness, maxBehavio... |
ElsevierSoftwareX/SOFTX_2019_242 | Core/MachineLearning/constants.py | <reponame>ElsevierSoftwareX/SOFTX_2019_242
# Constants used in Core and libraries
import os
dir_path = os.path.dirname(os.path.realpath(__file__))
TRAINING_LOCATION = dir_path+'/Files/training_data.txt'
CACHED_LOCATION = dir_path+'/Files/cached_features.txt'
SHAPE = {'SPIKES':0, 'CURVED': 1, 'LOOPS': 2, 'STRAIGHT':3,... |
ElsevierSoftwareX/SOFTX_2019_242 | Core/Actuators/WheelActuator.py | import RPi.GPIO as GPIO
import numpy
from Core.Enumerations import *
# Pin functions
PIN_MOTOR1 = 19
PIN_MOTOR1_DIRECTION = 26
PIN_MOTOR2 = 17
PIN_MOTOR2_DIRECTION = 27
PIN_MOTOR3 = 20
PIN_MOTOR3_DIRECTION = 21
class WheelActuator:
def __init__(self):
# set up pins
if GPIO.getmode() is not GPIO.BC... |
ElsevierSoftwareX/SOFTX_2019_242 | Core/Enumerations.py | from enum import IntEnum
# Related to BODY
class SensorType(IntEnum):
OPTICAL = 1
TOUCH = 2
class OpticalState(IntEnum):
RECEIVING = 1
NOT_RECEIVING = 2
FINISHED = 3
class TouchState(IntEnum):
TOUCHING = 1
NOT_TOUCHING = 2
class ColorBrightness(IntEnum):
NONE = 0
LOW = 120
ME... |
ElsevierSoftwareX/SOFTX_2019_242 | Core/Agent.py | from colour import Color
from Core.Enumerations import *
from Planning import *
from Control import *
# auxiliary Agent API structs
class GeneralProfile (object):
def __init__(self, name, helloBehavior, goodbyeBehavior, pupeteerBehavior, idleBehavior, minimumTouchTimeInSeconds):
self.name = name
se... |
ElsevierSoftwareX/SOFTX_2019_242 | Core/Behavior/SimpleBehavior/BlinkBehavior/BlinkBehaviorEaseIn.py | import time
import numpy
from colour import Color
import pytweening as tween
from Core.Enumerations import *
from Core.Behavior.SimpleBehavior.BlinkBehavior.BlinkBehavior import BlinkBehavior
class BlinkBehaviorEaseIn(BlinkBehavior, object):
def __init__(self, controlRef, blinkColor, brightness, repetitions, durat... |
ElsevierSoftwareX/SOFTX_2019_242 | Core/Sensors/OpticalSensor.py | # inspired in tstenner's @ github
import collections
from Core.Enumerations import *
import evdev
import evdev.ecodes as ev
class OpticalSensor:
def __init__(self):
self.opticalSensor = None
self.sensorType = SensorType.OPTICAL
self.state = OpticalState.NOT_RECEIVING
self.optical... |
ElsevierSoftwareX/SOFTX_2019_242 | Examples/ExamplesWithPresets/exampleWithoutSocial.py | import sys
sys.path.append('../..')
from Core.Agent import *
agent = Agent("YOLO")
controlRef = agent.getControlRef()
agent.interact(creativityProfile="NEUTRAL")
|
ElsevierSoftwareX/SOFTX_2019_242 | Examples/exampleHelloWorld.py | import sys
sys.path.append('..')
from Core.Agent import *
agent = Agent("YOLO")
controlRef = agent.getControlRef()
helloBehavior = ComposedBehavior(controlRef, [BlinkBehaviorEaseInOut(controlRef, Color(rgb=(1.0, 1.0, 1.0)), ColorBrightness.LOW, 2, 2.0, Color(rgb=(1.0, 1.0, 1.0)))])
goodbyeBehavior = ComposedBehavio... |
ElsevierSoftwareX/SOFTX_2019_242 | Core/Control.py | <gh_stars>1-10
from asyncore import loop
import RPi.GPIO as GPIO
from colour import Color
from Core.Enumerations import *
from Core.Sensors.OpticalSensor import OpticalSensor
from Core.Sensors.TouchSensor import TouchSensor
from Core.Actuators.LEDActuator import LEDActuator
from Core.Actuators.WheelActuator import Whee... |
ElsevierSoftwareX/SOFTX_2019_242 | Examples/ExamplesWithPresets/exampleHarmonious.py | <reponame>ElsevierSoftwareX/SOFTX_2019_242<filename>Examples/ExamplesWithPresets/exampleHarmonious.py
import sys
sys.path.append('../..')
from Core.Agent import *
agent = Agent("YOLO")
controlRef = agent.getControlRef()
agent.interact(generalProfile = "HARMONIOUS", socialProfile="HARMONIOUS", creativityProfile="HAR... |
ElsevierSoftwareX/SOFTX_2019_242 | Core/Sensors/TouchSensor.py | <filename>Core/Sensors/TouchSensor.py
import RPi.GPIO as GPIO
from Core.Enumerations import *
PIN_TOUCH = 16
class TouchSensor:
def __init__(self):
self.sensorType = SensorType.TOUCH
self.state = TouchState.NOT_TOUCHING
# set up pins
if GPIO.getmode() is not GPIO.BCM:
... |
ElsevierSoftwareX/SOFTX_2019_242 | Core/Behavior/SimpleBehavior/MoveBehavior/MoveBehaviorForwardAndBack.py | <filename>Core/Behavior/SimpleBehavior/MoveBehavior/MoveBehaviorForwardAndBack.py
import sys
import time
import numpy
from colour import Color
import pytweening as tween
from Core.Enumerations import *
from Core.Behavior.SimpleBehavior.MoveBehavior.MoveBehavior import MoveBehavior
class MoveBehaviorForwardAndBack(M... |
ElsevierSoftwareX/SOFTX_2019_242 | Examples/exampleBarbie.py | import sys
sys.path.append('..')
from Core.Agent import *
mainColor = Color(rgb=(1.0,0.4,0.6))
agent = Agent("YOLO")
controlRef = agent.getControlRef()
helloBehavior = ComposedBehavior(controlRef, [BlinkBehaviorEaseIn(controlRef, mainColor, ColorBrightness.HIGH, 3, 2.0, Color(rgb=(0.0, 0.0, 0.0)))])
goodbyeBehavio... |
ElsevierSoftwareX/SOFTX_2019_242 | Examples/exampleGinie.py | <reponame>ElsevierSoftwareX/SOFTX_2019_242
import sys
sys.path.append('..')
from Core.Agent import *
mainColor = Color(rgb=(0.0,0.4,1.0))
agent = Agent("Genie")
controlRef = agent.getControlRef()
#behaviors
helloBehavior = ComposedBehavior(controlRef, [BlinkBehaviorEaseIn(controlRef, mainColor, ColorBrightness.MEDIU... |
ecoslacker/yaaco | aco_execs.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Sat Nov 3 01:28:26 2018
@author: eduardo
"""
import csv
import matplotlib.pyplot as plt
import numpy as np
from datetime import datetime
from yaaco import ACO
def aco_execs(data_dir, prob, res_dir, **kwargs):
""" Execute ACO for the Symmetric TSP
... |
ecoslacker/yaaco | yaaco.py | <reponame>ecoslacker/yaaco
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
yaaco.py
Yet Another Ant Colony Optimization Python Implementation
An attempt to code the Ant Colony Optimization (ACO) metaheuristic to solve
the Traveling Salesman Problem (TSP) in Python 2.7 language.
IMPORTANT: This code only includes ... |
6e726d/binaryninja-search | __init__.py | <filename>__init__.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2018 <NAME> <<EMAIL>>
#
# Permission to use, copy, modify, and/or distribute this software for
# any purpose with or without fee is hereby granted.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH RE... |
gita/bhagavad-gita-api | bhagavad_gita_api/SocialBot.py | <reponame>gita/bhagavad-gita-api
import os
import tweepy
from PIL import Image, ImageDraw, ImageFont
from textwrap3 import wrap
from bhagavad_gita_api.config import settings
from bhagavad_gita_api.models import gita as models
from bhagavad_gita_api.MyIGBot import MyIGBot
class SocialBot:
sanskrit_text: str
... |
saurbkumar/concrete_strength_prediction | predict.py | <filename>predict.py
import pandas
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn import linear_model
from sklearn.neural_network import MLPRegressor
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_squared_error
data = pandas.read_excel("data/Concrete_Data.xls")... |
busstoptaktik/trlib | python/RandomTests.py | #!/usr/bin/python
#######################################
##Skeleton of a test suite for trlib using python 'bindings'
## This script performs some randomized tests....
## simlk, may 2011
#######################################
import TrLib
try:
import numpy as np
except:
HAS_NUMPY=False
import random
else:
HAS_NUM... |
busstoptaktik/trlib | TR_BUILD/py_build.py | #!/usr/bin/python
#########################
## simple build instructions for TrLib (Mingw, gcc linux/mac and msvc windows).
## Run: py_build.py <trlib_dir> options......
## Assumes that we have subdisrs in trlib: TR_SRC, TR_INC, TR_SRC/API, TR_SRC/LORD
## simlk, sep. 2012
##############################
import sys,os,g... |
busstoptaktik/trlib | python/AutoTest.py | #!/usr/bin/python
###########################
## Complete python autotestsuite for TrLib
## Wrapper of several individual tests
## Needs a job-definition file auto_tests.txt for file transformations
## simlk, oct. 2011
############################
import TrLib
import TestFiles
import RandomTests
import ThreadTest
impo... |
busstoptaktik/trlib | TR_BUILD/core.py | import sys,os,subprocess,glob
import cc
IS_WINDOWS=sys.platform.startswith("win")
IS_MAC="darwin" in sys.platform
ALL_OBJ=[".o",".obj"] #object files to remove on clean
if IS_WINDOWS:
DLL=".dll"
EXE=".exe"
elif IS_MAC:
DLL=".dylib"
EXE=""
else:
DLL=".so"
EXE=""
def RunCMD(cmd):
new_cmd=[]
cmd_str=""
for item i... |
busstoptaktik/trlib | python/ServerMode.py | #!/usr/bin/python
###############################
## Thread safety test using RandomTests.py
## simlk, nov. 2011
###############################
import threading
import RandomTests
import random
import TrLib
import time
import os
import sys
import gc
import random
#This is the minimal test to pass!#
KEEP_ALIVE=8
NRUNS=... |
busstoptaktik/trlib | python/ThreadTest.py | #!/usr/bin/python
###############################
## Thread safety test using RandomTests.py
## simlk, oct. 2011
###############################
import threading
import RandomTests
import random
import TrLib
import time
import os
import sys
OUTPUT_DIR="THREAD_OUTPUT"
NTHREADS_2D=5
NTHREADS_3D=5
NITERATIONS=3
NPOINTS=10... |
busstoptaktik/trlib | python/TestFiles.py | <filename>python/TestFiles.py
#!/usr/bin/python
##########################################################
##Test suite for TrLib.
## Test definition file must follow the format:
## input_file output_file minilabel_out precision_out
## .....
## File paths are relative to the test definition file! (Makes portab... |
busstoptaktik/trlib | TR_BUILD/build_lib.py | #!/usr/bin/python
#########################
## simple library build instructions - used to build java bindings for trlib
## Run: build_lib.py <source> -I <include1> -I <include2> ... -link <x1> -link <x2> ... -D <define1> .... -o <lib_out> -build <build_dir>
## simlk, sep. 2012
##############################
imp... |
busstoptaktik/trlib | TR_BUILD/gcc_options.py | #MUST DEFINE:
#COMPILER
#LINKER
#INCLUDE_SWITCH
#DEFINE_SWITCH
#IMPLIB_SWITCH
#DEF_FILE_SWITCH
#LINK_OUTPUT_SWITCH
#IMPLIB_EXT
#OBJ_FILES
#COMPILE_LIBRARY_RELEASE
#COMPILE_LIBRARY_DEBUG
#COMPILE_EXE_RELEASE
#COMPILE_EXE_DEBUG
#LINK_LIBRARY_RELEASE
#LINK_LIBRARY_DEBUG
#LINK_EXE_RELEASE
#LINK_EXE_DEBUG
#LINK_LIBRARIES
#V... |
busstoptaktik/trlib | TR_BUILD/cc.py | import sys
IS_WINDOWS=sys.platform.startswith("win")
IS_MAC="darwin" in sys.platform
#TODO: add more options and or methods like optimized_high/low and more or less pedantic....
class ccompiler(object):
COMPILER=""
LINKER=""
IS_MSVC=False
COMPILE_LIBRARY_RELEASE=[]
COMPILE_LIBRARY_DEBUG=[]
COMPILE_EXE_RELEASE=[]
... |
busstoptaktik/trlib | python/TestProj.py | #!/usr/bin/python
#######################################
##Skeleton of a test suite for trlib using python 'bindings'
## This script performs some translations of proj4 definitions and EPSG codes to kms-minilabels
## simlk, oct. 2012
#######################################
import sys,os,time
import TrLib
TESTS={"+proj... |
busstoptaktik/trlib | TR_BUILD/msvc_options.py | <reponame>busstoptaktik/trlib<gh_stars>0
#MUST DEFINE:
#COMPILER
#LINKER
#INCLUDE_SWITCH
#DEFINE_SWITCH
#IMPLIB_SWITCH
#DEF_FILE_SWITCH
#LINK_OUTPUT_SWITCH
#IMPLIB_EXT
#OBJ_FILES
#COMPILE_LIBRARY_RELEASE
#COMPILE_LIBRARY_DEBUG
#COMPILE_EXE_RELEASE
#COMPILE_EXE_DEBUG
#LINK_LIBRARY_RELEASE
#LINK_LIBRARY_DEBUG
#LINK_EXE_R... |
bvitos/bandcamp_library_classifier | bandcamp_librarian/__init__.py | <filename>bandcamp_librarian/__init__.py
# -*- coding: utf-8 -*-
"""Top-level package for Bandcamp Dance Librarian."""
__author__ = """<NAME>"""
__email__ = '<EMAIL>'
__version__ = '0.2.0'
|
bvitos/bandcamp_library_classifier | bandcamp_librarian/flask/clusterer.py | <reponame>bvitos/bandcamp_library_classifier<filename>bandcamp_librarian/flask/clusterer.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Estimates clusters among tracks of Bandcamp labels,
based on features extracted with pyAudioAnalysis and Essentia
The classification model is based on the Electronic Music F... |
bvitos/bandcamp_library_classifier | bandcamp_librarian/scraper/scraper.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Bandcamp Scraper
Much of this code is borrowed from <NAME>' SoundScrape
Miserlou / SoundScrape - https://github.com/Miserlou/SoundScrape
"""
import demjson
import html
import os
import re
import requests
import sys
import logging
import time
import pandas as pd
impor... |
bvitos/bandcamp_library_classifier | bandcamp_librarian/dataset-model-predictor/build_model.py | <filename>bandcamp_librarian/dataset-model-predictor/build_model.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Builds classification model using the Beatport 2021 Jan dataset
Follows the methodology of Caparrini et al. (https://doi.org/10.1080/09298215.2020.1761399)
Uses 92 features extracted with pyAudioAnaly... |
bvitos/bandcamp_library_classifier | bandcamp_librarian/cli.py | <gh_stars>0
"""Console script for Bandcamp Dance Librarian."""
import pandas as pd
import os
import argparse
import sys
import subprocess
import psycopg2
import time
from sqlalchemy import create_engine
def import_tracks(postgres_pwd):
"""
Imports tracks and labels tables to Postgres database
"""
... |
bvitos/bandcamp_library_classifier | bandcamp_librarian/config/csvexport.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Exports the tracks table into a .cvs file
"""
from sqlalchemy import create_engine
import pandas as pd
import psycopg2
print("Please note that you need a running instance of the Postgres docker container for the CSV export")
pguser = input("User name:")
pgpassword = ... |
bvitos/bandcamp_library_classifier | bandcamp_librarian/dataset-model-predictor/predict_tracks_csv.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Predicts musical subgenres of electronic dance music tracks in CSV file received through command-line argument
Follows the methodology of Caparrini et al. (https://doi.org/10.1080/09298215.2020.1761399)
Uses 92 features extracted with pyAudioAnalysis and Essentia
Thes... |
bvitos/bandcamp_library_classifier | bandcamp_librarian/flask/application.py | <filename>bandcamp_librarian/flask/application.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Flask application for the Bandcamp label classificator / admin interface
"""
from flask import Flask, render_template, request, send_from_directory, jsonify, abort
import logging
import pandas as pd
from clusterer imp... |
bvitos/bandcamp_library_classifier | setup.py | <reponame>bvitos/bandcamp_library_classifier
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirem... |
bvitos/bandcamp_library_classifier | bandcamp_librarian/config/csvimport.py | <filename>bandcamp_librarian/config/csvimport.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Import the tracks table from a CSV file
"""
from sqlalchemy import create_engine
import pandas as pd
import psycopg2
import os
if os.path.exists('tracks.csv'):
print("Please note that you need a running instance of... |
bvitos/bandcamp_library_classifier | bandcamp_librarian/etl/etl.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
ETL script: Processes mp3 files from the scraping directory
(mp3 tag and album cover extraction, conversion to wav, feature extraction)
then stores results in Postgres
"""
from sqlalchemy import create_engine
import time
from mutagen.easyid3 import EasyID3
from extra... |
camall3n/seeding | tests/test_seeding.py | <reponame>camall3n/seeding<gh_stars>1-10
import pytest
from seeding import seeding
def test_seed_python():
import random
seeding.seed(0, random)
a = random.random()
seeding.seed(0, random)
b = random.random()
assert a == b
def test_seed_numpy():
import numpy as np
seeding.seed(0, ... |
camall3n/seeding | setup.py | from setuptools import setup, find_packages
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name="seeding",
version="0.1.0",
description="Lightweight python library for achieving deterministic random seeds",
long_description=long_description,
long_description_content_typ... |
camall3n/seeding | seeding/__init__.py | from .seeding import seed
|
camall3n/seeding | seeding/seeding.py | import logging
from types import ModuleType
def seed(seed, *args, **kwargs):
"""
Set random seed for the default RNGs in each of the subsequent positional args
Optional kwargs:
deterministic (bool): whether to ensure deterministic results on subsequent runs
default = True
Usage:
... |
Vishal7017/Ploty-And-Flask | FlaskPlotlyPandas/worldbank.py | <gh_stars>0
from worldbankapp import app
app.run(host='127.0.0.1', port=3001, debug=True) |
Vishal7017/Ploty-And-Flask | PandasFlask/worldbankapp/__init__.py | from flask import Flask
app = Flask(__name__)
from worldbankapp import routes |
Vishal7017/Ploty-And-Flask | PandasFlask/worldbank.py | from worldbankapp import app
app.run(host='127.0.0.1', port=3001, debug=True) |
Vishal7017/Ploty-And-Flask | PandasFlask/worldbankapp/routes.py | from worldbankapp import app
import json, plotly
from flask import render_template
from wrangling_scripts.wrangle_data import return_figures
@app.route('/')
@app.route('/index')
def index():
figures = return_figures()
ids = ['figure-{}'.format(i) for i, _ in enumerate(figures)]
figuresJSON = json.dump... |
alehuo/pyoidc-redis-session-backend | tests/test_serializer.py | from unittest import TestCase
import jsonpickle
from pyoidc_redis_session_backend import RSAKeyHandler
from Cryptodome.PublicKey.RSA import RsaKey
from Cryptodome.PublicKey import RSA
jsonpickle.register(RsaKey, RSAKeyHandler)
class TestSerializer(TestCase):
def test_encode_works_1(self):
key = RSA.genera... |
alehuo/pyoidc-redis-session-backend | pyoidc_redis_session_backend/__init__.py | <reponame>alehuo/pyoidc-redis-session-backend<filename>pyoidc_redis_session_backend/__init__.py
import redis
import jsonpickle
import base64
from jsonpickle.handlers import BaseHandler
from oic.utils.session_backend import AuthnEvent, SessionBackend
from typing import Any
from typing import Dict
from typing import List... |
alehuo/pyoidc-redis-session-backend | tests/test_redis.py | from unittest import TestCase
import fakeredis
from pyoidc_redis_session_backend import RedisSessionBackend
from Cryptodome.PublicKey import RSA
class TestRedis(TestCase):
def test_set(self):
r = fakeredis.FakeStrictRedis()
backend = RedisSessionBackend(r)
backend["Hello"] = "World"
... |
kimhayeon00/SeeO-K | src/preprocess_cloth.py | <reponame>kimhayeon00/SeeO-K
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Copyright (c) 2021 KOBOTEN <EMAIL>.
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:/... |
kimhayeon00/SeeO-K | src/voice_command_input.py | <reponame>kimhayeon00/SeeO-K
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Copyright (c) 2021 KOBOTEN <EMAIL>.
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:/... |
kimhayeon00/SeeO-K | src/test.py | <filename>src/test.py
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Copyright (c) 2021 KOBOTEN <EMAIL>.
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... |
kimhayeon00/SeeO-K | src/cloth_recognition_tf.py | Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Copyright (c) 2021 KOBOTEN <EMAIL>.
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... |
kimhayeon00/SeeO-K | src/insert_clothes.py | Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Copyright (c) 2021 KOBOTEN <EMAIL>.
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... |
kimhayeon00/SeeO-K | src/sound_interface_gtts.py | Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Copyright (c) 2021 KOBOTEN <EMAIL>.
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/LICE... |
kimhayeon00/SeeO-K | src/white.py | <filename>src/white.py
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Copyright (c) 2021 KOBOTEN <EMAIL>.
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.o... |
kimhayeon00/SeeO-K | src/index.py | <gh_stars>1-10
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Copyright (c) 2021 KOBOTEN <EMAIL>.
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.or... |
kimhayeon00/SeeO-K | src/color_data.py | Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Copyright (c) 2021 KOBOTEN <EMAIL>.
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... |
kimhayeon00/SeeO-K | src/weather.py | Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Copyright (c) 2021 KOBOTEN <EMAIL>.
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... |
urosisakovic/GANs | ganlib/__init__.py | <gh_stars>1-10
from conditional_gan import CGAN
from cycle_gan import CycleGAN
from dc_gan import DCGAN
from vanilla_gan import VanillaGAN |
urosisakovic/GANs | ganlib/conditional_gan.py | <reponame>urosisakovic/GANs
import matplotlib.pyplot as plt
import numpy as np
from tensorflow.keras.datasets import mnist
from tensorflow.keras.layers import (BatchNormalization, Dense, Dropout,
Embedding, Flatten, Input, LeakyReLU,
Reshape, mul... |
urosisakovic/GANs | ganlib/cycle_gan.py | <reponame>urosisakovic/GANs<filename>ganlib/cycle_gan.py
import datetime
import os
from glob import glob
import matplotlib.pyplot as plt
import numpy as np
import scipy
from tensorflow.keras.datasets import mnist
from tensorflow.keras.layers import (Activation, BatchNormalization,
... |
urosisakovic/GANs | ganlib/vanilla_gan.py | import numpy as np
from tensorflow.keras.datasets import mnist
from tensorflow.keras.layers import (BatchNormalization, Dense, Flatten, Input,
LeakyReLU, Reshape)
from tensorflow.keras.models import Model, Sequential
class VanillaGAN():
def __init__(self):
self.img_row... |
noelli/bacpypes | samples/COVServer.py | #!/usr/bin/env python
"""
This sample application is a server that supports COV notification services.
The console accepts commands that change the properties of an object that
triggers the notifications.
"""
import time
from threading import Thread
from bacpypes.debugging import bacpypes_debugging, ModuleLogger
fro... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.