index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
56,998 | meoke/pangtreevis | refs/heads/master | /dash_app/components/consensustree.py | from collections import deque
from typing import Dict, List, Tuple, Set, Any
import math
from ..layout.colors import colors
import plotly.graph_objs as go
import pandas as pd
from pangtreebuild.consensus.ConsensusTree import ConsensusNodeID
from pangtreebuild.output.PangenomeJSON import PangenomeJSON, ConsensusNode
i... | {"/dash_app/callbacks/visualisation.py": ["/dash_app/server.py", "/dash_app/layout/layout_ids.py", "/dash_app/layout/pages.py"], "/dash_app/layout/pages.py": ["/dash_app/layout/layout_ids.py"], "/run.py": ["/dash_app/app.py"], "/dash_app/callbacks/consensustree.py": ["/dash_app/layout/layout_ids.py", "/dash_app/server.... |
56,999 | meoke/pangtreevis | refs/heads/master | /dash_app/callbacks/consensustree.py | from dash.dependencies import Input, Output
from dash_app.components import consensustable
from dash_app.components import tools
from dash_app.layout.layout_ids import *
from dash_app.components import consensustree
from dash_app.server import app
@app.callback(
Output(id_full_consensustree_hidden, 'children'),
... | {"/dash_app/callbacks/visualisation.py": ["/dash_app/server.py", "/dash_app/layout/layout_ids.py", "/dash_app/layout/pages.py"], "/dash_app/layout/pages.py": ["/dash_app/layout/layout_ids.py"], "/run.py": ["/dash_app/app.py"], "/dash_app/callbacks/consensustree.py": ["/dash_app/layout/layout_ids.py", "/dash_app/server.... |
57,000 | meoke/pangtreevis | refs/heads/master | /dash_app/app.py | import dash_bootstrap_components as dbc
import dash_core_components as dcc
from dash.dependencies import Input, Output, State
import dash_html_components as html
from .server import app
from .layout import layout_ids, pages
app.title = 'PangtreeVis'
# app.css.config.serve_locally = True
# app.scripts.config.serve_loca... | {"/dash_app/callbacks/visualisation.py": ["/dash_app/server.py", "/dash_app/layout/layout_ids.py", "/dash_app/layout/pages.py"], "/dash_app/layout/pages.py": ["/dash_app/layout/layout_ids.py"], "/run.py": ["/dash_app/app.py"], "/dash_app/callbacks/consensustree.py": ["/dash_app/layout/layout_ids.py", "/dash_app/server.... |
57,001 | meoke/pangtreevis | refs/heads/master | /dash_app/components/tools.py | import os
import shutil
from datetime import datetime
import json
from pathlib import Path
from typing import Any, Optional
from base64 import b64decode
import pandas as pd
from pangtreebuild.output import PangenomeJSON
import uuid
from io import StringIO
def unjsonify_jsonpangenome(jsonified_pangenome: str) -> Pangen... | {"/dash_app/callbacks/visualisation.py": ["/dash_app/server.py", "/dash_app/layout/layout_ids.py", "/dash_app/layout/pages.py"], "/dash_app/layout/pages.py": ["/dash_app/layout/layout_ids.py"], "/run.py": ["/dash_app/app.py"], "/dash_app/callbacks/consensustree.py": ["/dash_app/layout/layout_ids.py", "/dash_app/server.... |
57,002 | meoke/pangtreevis | refs/heads/master | /dash_app/callbacks/consensustable.py | from dash.dependencies import Input, Output, State
from dash_app.components import consensustable, consensustree
from dash_app.components import tools
from dash_app.layout.layout_ids import *
from dash_app.server import app
@app.callback(
Output(id_full_consensustable_hidden, 'children'),
[Input(id_pangenom... | {"/dash_app/callbacks/visualisation.py": ["/dash_app/server.py", "/dash_app/layout/layout_ids.py", "/dash_app/layout/pages.py"], "/dash_app/layout/pages.py": ["/dash_app/layout/layout_ids.py"], "/run.py": ["/dash_app/app.py"], "/dash_app/callbacks/consensustree.py": ["/dash_app/layout/layout_ids.py", "/dash_app/server.... |
57,003 | meoke/pangtreevis | refs/heads/master | /dash_app/components/poagraph.py | import pickle
from ..components import tools
from flask import Flask, session
from ..layout.colors import colors
import colorsys
from typing import List, Dict, Tuple, Set, Optional, Any, Union
import math
import pandas as pd
from pangtreebuild.output.PangenomeJSON import PangenomeJSON, Sequence
import plotly.graph_ob... | {"/dash_app/callbacks/visualisation.py": ["/dash_app/server.py", "/dash_app/layout/layout_ids.py", "/dash_app/layout/pages.py"], "/dash_app/layout/pages.py": ["/dash_app/layout/layout_ids.py"], "/run.py": ["/dash_app/app.py"], "/dash_app/callbacks/consensustree.py": ["/dash_app/layout/layout_ids.py", "/dash_app/server.... |
57,004 | meoke/pangtreevis | refs/heads/master | /dash_app/callbacks/mafgraph.py | from dash_app.components import tools
from ..server import app
from dash.dependencies import Input, Output, State
from ..layout.layout_ids import *
from ..components import mafgraph
@app.callback(Output(id_mafgraph_graph, 'elements'),
[Input(id_pangenome_hidden, 'children')],
[State(id_mafg... | {"/dash_app/callbacks/visualisation.py": ["/dash_app/server.py", "/dash_app/layout/layout_ids.py", "/dash_app/layout/pages.py"], "/dash_app/layout/pages.py": ["/dash_app/layout/layout_ids.py"], "/run.py": ["/dash_app/app.py"], "/dash_app/callbacks/consensustree.py": ["/dash_app/layout/layout_ids.py", "/dash_app/server.... |
57,005 | meoke/pangtreevis | refs/heads/master | /dash_app/callbacks/pangtreebuild.py | import io
import os
from io import StringIO
from pathlib import Path
from typing import Dict, List
import dash_html_components as html
import flask
from dash.dependencies import Input, Output, State
from dash.exceptions import PreventUpdate
from pangtreebuild.consensus.input_types import Blosum, Hbmin, Stop, P
from pa... | {"/dash_app/callbacks/visualisation.py": ["/dash_app/server.py", "/dash_app/layout/layout_ids.py", "/dash_app/layout/pages.py"], "/dash_app/layout/pages.py": ["/dash_app/layout/layout_ids.py"], "/run.py": ["/dash_app/app.py"], "/dash_app/callbacks/consensustree.py": ["/dash_app/layout/layout_ids.py", "/dash_app/server.... |
57,006 | meoke/pangtreevis | refs/heads/master | /dash_app/callbacks/poagraph.py | from dash.dependencies import Input, Output, State
from dash.exceptions import PreventUpdate
from dash_app.components import poagraph
import dash
from ..components import tools, visualisation
from ..layout.layout_ids import *
from ..server import app
from ..app import draw_poagraph
@app.callback(Output(id_full_pangen... | {"/dash_app/callbacks/visualisation.py": ["/dash_app/server.py", "/dash_app/layout/layout_ids.py", "/dash_app/layout/pages.py"], "/dash_app/layout/pages.py": ["/dash_app/layout/layout_ids.py"], "/run.py": ["/dash_app/app.py"], "/dash_app/callbacks/consensustree.py": ["/dash_app/layout/layout_ids.py", "/dash_app/server.... |
57,007 | meoke/pangtreevis | refs/heads/master | /dash_app/server.py | from flask import Flask, session
from flask_session import Session
from dash import Dash
server = Flask('pangenome')
SESSION_TYPE = 'filesystem'
server.config.from_object(__name__)
server.secret_key = b'_5#y2L"F4Q8z\n\xec]/'
app = Dash(__name__, server=server)
| {"/dash_app/callbacks/visualisation.py": ["/dash_app/server.py", "/dash_app/layout/layout_ids.py", "/dash_app/layout/pages.py"], "/dash_app/layout/pages.py": ["/dash_app/layout/layout_ids.py"], "/run.py": ["/dash_app/app.py"], "/dash_app/callbacks/consensustree.py": ["/dash_app/layout/layout_ids.py", "/dash_app/server.... |
57,008 | swipswaps/freefall-1 | refs/heads/master | /freefall/utilities.py | """
utilities.py
A collection of utility functions to support simulations.
"""
import math
def find_vx_vy(*, speed, angle):
rads = math.radians(angle)
vx = speed * math.cos(rads)
vy = speed * math.sin(rads)
return vx, vy
# This function is from the article Generate Floating Point Range in Python
#... | {"/examples/frc_powercell_shooter.py": ["/freefall/falling_objects.py", "/freefall/simulators.py", "/freefall/utilities.py"], "/examples/frc_powercell_drop.py": ["/freefall/falling_objects.py", "/freefall/simulators.py"]} |
57,009 | swipswaps/freefall-1 | refs/heads/master | /examples/frc_powercell_shooter.py | from freefall.falling_objects import frc_power_cell
from freefall.simulators import simulate_earth_surface
from freefall.simulators import terminate_vy_less_zero
from freefall.utilities import find_vx_vy, float_range
import matplotlib.pyplot as plt
X_INITIAL = 0 # m
Y_INITIAL = 27 / 40 # m
SPEED = 5 # m/s
ANGLE = ... | {"/examples/frc_powercell_shooter.py": ["/freefall/falling_objects.py", "/freefall/simulators.py", "/freefall/utilities.py"], "/examples/frc_powercell_drop.py": ["/freefall/falling_objects.py", "/freefall/simulators.py"]} |
57,010 | swipswaps/freefall-1 | refs/heads/master | /freefall/simulators.py | """
simulators.py
A collection of simulators and termination functions.
"""
from collections import namedtuple
SimResult = namedtuple("SimResult", ["x", "y", "vx", "vy", "ax", "ay", "t"])
def terminate_vy_less_zero(x, y, vx, vy, ax, ay, t):
"""Returns True if the y velocity is less than zero, otherwise return... | {"/examples/frc_powercell_shooter.py": ["/freefall/falling_objects.py", "/freefall/simulators.py", "/freefall/utilities.py"], "/examples/frc_powercell_drop.py": ["/freefall/falling_objects.py", "/freefall/simulators.py"]} |
57,011 | swipswaps/freefall-1 | refs/heads/master | /setup.py | from setuptools import setup, find_packages
import re
version = re.search(
r'^__VERSION__\s*=\s*"(.*)"', open("freefall/__init__.py").read(), re.M
).group(1)
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name="freefall",
version=version,
packages=find_packages(),
url=... | {"/examples/frc_powercell_shooter.py": ["/freefall/falling_objects.py", "/freefall/simulators.py", "/freefall/utilities.py"], "/examples/frc_powercell_drop.py": ["/freefall/falling_objects.py", "/freefall/simulators.py"]} |
57,012 | swipswaps/freefall-1 | refs/heads/master | /freefall/__init__.py | """
A Python package module for simulating falling objects with simple aerodynamic drag.
Developed by FIRST Robotics Competition Team 6343 - Steel Ridge Robotics
Strong
Trustworthy
Empowering
Effective
Leadership
"""
__VERSION__ = "1.0.0b1"
| {"/examples/frc_powercell_shooter.py": ["/freefall/falling_objects.py", "/freefall/simulators.py", "/freefall/utilities.py"], "/examples/frc_powercell_drop.py": ["/freefall/falling_objects.py", "/freefall/simulators.py"]} |
57,013 | swipswaps/freefall-1 | refs/heads/master | /freefall/falling_objects.py | """
falling_objects.py
A collection of objects with defined mass and drag properties.
"""
from collections import namedtuple
FallingObject = namedtuple("FallingObject", ["mass", "drag"])
# A POWER CELL gamer piece from the 2020 FIRST Robotics Competition (Infinite Recharge)
frc_power_cell = FallingObject(mass=0.15,... | {"/examples/frc_powercell_shooter.py": ["/freefall/falling_objects.py", "/freefall/simulators.py", "/freefall/utilities.py"], "/examples/frc_powercell_drop.py": ["/freefall/falling_objects.py", "/freefall/simulators.py"]} |
57,014 | swipswaps/freefall-1 | refs/heads/master | /examples/frc_powercell_drop.py | from freefall.falling_objects import frc_power_cell
from freefall.simulators import simulate_earth_surface
import matplotlib.pyplot as plt
X_INITIAL = 0 # m
Y_INITIAL = 6.172 # m
VX_INITIAL = 0 # m/s
VY_INITIAL = 0 # m/s
results = simulate_earth_surface(
frc_power_cell, X_INITIAL, Y_INITIAL, VX_INITIAL, VY_... | {"/examples/frc_powercell_shooter.py": ["/freefall/falling_objects.py", "/freefall/simulators.py", "/freefall/utilities.py"], "/examples/frc_powercell_drop.py": ["/freefall/falling_objects.py", "/freefall/simulators.py"]} |
57,025 | breqdev/wchat | refs/heads/master | /weschat-server.py | import socket, select
server_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server_sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
server_sock.bind(("0.0.0.0", 8888))
server_sock.listen(16)
CONNECTIONS = [server_sock]
UNAMES = {}
class Room:
def __init__(self, name):
self.nam... | {"/weschat.py": ["/weschat_api.py"]} |
57,026 | breqdev/wchat | refs/heads/master | /weschat.py | from weschat_api import WesChat
import tkinter
import json
import os
window = tkinter.Tk()
window.title("WesChat")
files = os.listdir("themes")
print("Choose a theme")
for i, file in enumerate(files):
print(i, file)
num = int(input("Enter the theme number: "))
with open("themes/"+files[num]) as file:
theme ... | {"/weschat.py": ["/weschat_api.py"]} |
57,027 | breqdev/wchat | refs/heads/master | /weschat_api.py | import socket
from select import select
import time
class WesChat:
def __init__(self, host, handshake, port=8888, name=None):
self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.s.connect((host, port))
self.post(handshake)
if name == None:
name = so... | {"/weschat.py": ["/weschat_api.py"]} |
57,042 | romanishikov/VocaLights | refs/heads/main | /VocaLights.py | import VoiceCommands as VC # Module for retrieving voice input and giving output
import lifxlan as lx
import phue
import time
import sys
import re
from threading import Thread
LIFX_BRAND = "lifx"
PHUE_BRAND = "phue"
PARAMS = {
LIFX_BRAND: ["light_names", "mac_addresses", "ip_addresses", "default_colors", "defau... | {"/VocaLights.py": ["/VoiceCommands.py"]} |
57,043 | romanishikov/VocaLights | refs/heads/main | /VoiceCommands.py | import speech_recognition as sr # Module for getting microphone audio to text
import pyttsx3 # Module for computer speaking back to user
class CommandInputs:
def __init__(self, pause_threshold=0.5):
self.recognizer = sr.Recognizer()
self.pause_duration = pause_threshold # Time it gives to regis... | {"/VocaLights.py": ["/VoiceCommands.py"]} |
57,054 | ZhihaoZhu/Robot-Control-Motion-Planning | refs/heads/master | /forward_kinetics.py | import numpy as np
import argparse
from urdf_parser_py.urdf import URDF
URDF_PATH = "./locobot_description_v3.urdf"
'''
Helper Functions
'''
import numpy as np
import argparse
from urdf_parser_py.urdf import URDF
from math import *
F_path = "./locobot_description_v3.urdf"
def getWristPose(joint_angle_list,joint_n... | {"/SAT.py": ["/plot_cuboid.py"], "/Random_sample.py": ["/Robot_construct.py", "/check_collision.py"], "/PRM.py": ["/Random_sample.py", "/calculate_dist.py", "/local_planner.py"], "/robot_control.py": ["/SAT.py"], "/local_planner.py": ["/Robot_construct.py", "/check_collision.py"]} |
57,055 | ZhihaoZhu/Robot-Control-Motion-Planning | refs/heads/master | /Dijkstra.py | def dijsktra(samples, edges, edge_length, start):
visited = {start: 0}
path = {}
nodes = set(samples)
while nodes:
cur_node = None
for node in nodes:
if node in visited:
if cur_node is None:
cur_node = node
elif visited[nod... | {"/SAT.py": ["/plot_cuboid.py"], "/Random_sample.py": ["/Robot_construct.py", "/check_collision.py"], "/PRM.py": ["/Random_sample.py", "/calculate_dist.py", "/local_planner.py"], "/robot_control.py": ["/SAT.py"], "/local_planner.py": ["/Robot_construct.py", "/check_collision.py"]} |
57,056 | ZhihaoZhu/Robot-Control-Motion-Planning | refs/heads/master | /SAT.py | import numpy as np
import math
from plot_cuboid import *
import time
'''
Transform the roll pitch yaw to rotation matrix
'''
def RPY_to_Rotation(RPY_list):
roll, pitch, yaw = RPY_list[0], RPY_list[1], RPY_list[2]
yawMatrix = np.array([
[math.cos(yaw), -math.sin(yaw), 0],
[math.sin(yaw), mat... | {"/SAT.py": ["/plot_cuboid.py"], "/Random_sample.py": ["/Robot_construct.py", "/check_collision.py"], "/PRM.py": ["/Random_sample.py", "/calculate_dist.py", "/local_planner.py"], "/robot_control.py": ["/SAT.py"], "/local_planner.py": ["/Robot_construct.py", "/check_collision.py"]} |
57,057 | ZhihaoZhu/Robot-Control-Motion-Planning | refs/heads/master | /test.py | int A[MAX],N;
int partitions(int low,int high)
{
int p=low,r=high,x=A[r],i=p-1;
for(int j=p;j<=r-1;j++)
{
if (A[j]<=x)
{
i=i+1;
swap(A[i],A[j]);
}
}
swap(A[i+1],A[r]);
return i+1;
}
int selection_algorithm(int left,int right,int kth)
{
for(;;)... | {"/SAT.py": ["/plot_cuboid.py"], "/Random_sample.py": ["/Robot_construct.py", "/check_collision.py"], "/PRM.py": ["/Random_sample.py", "/calculate_dist.py", "/local_planner.py"], "/robot_control.py": ["/SAT.py"], "/local_planner.py": ["/Robot_construct.py", "/check_collision.py"]} |
57,058 | ZhihaoZhu/Robot-Control-Motion-Planning | refs/heads/master | /Random_sample.py | import numpy as np
from Robot_construct import *
from check_collision import *
def Random_sample():
sample_joint_config = (np.random.rand(5)-0.5) * np.pi
robot = Robot_construct(sample_joint_config)
if check_collision(robot):
Random_sample()
else:
return sample_joint_config
| {"/SAT.py": ["/plot_cuboid.py"], "/Random_sample.py": ["/Robot_construct.py", "/check_collision.py"], "/PRM.py": ["/Random_sample.py", "/calculate_dist.py", "/local_planner.py"], "/robot_control.py": ["/SAT.py"], "/local_planner.py": ["/Robot_construct.py", "/check_collision.py"]} |
57,059 | ZhihaoZhu/Robot-Control-Motion-Planning | refs/heads/master | /PRM.py | import numpy as np
from Random_sample import *
from calculate_dist import *
from local_planner import *
def PRM(n_samples, K):
deg_to_rad = np.pi / 180.
start = np.array([-80. * deg_to_rad,0,0,0,0])
end = np.array([0, 60*deg_to_rad, -75*deg_to_rad, -75*deg_to_rad, 0])
samples = [start,end]
edges = ... | {"/SAT.py": ["/plot_cuboid.py"], "/Random_sample.py": ["/Robot_construct.py", "/check_collision.py"], "/PRM.py": ["/Random_sample.py", "/calculate_dist.py", "/local_planner.py"], "/robot_control.py": ["/SAT.py"], "/local_planner.py": ["/Robot_construct.py", "/check_collision.py"]} |
57,060 | ZhihaoZhu/Robot-Control-Motion-Planning | refs/heads/master | /robot_control.py | # Import system libraries
import argparse
import os
import sys
# Modify the following lines if you have problems importing the V-REP utilities
cwd = os.getcwd()
sys.path.append(cwd)
sys.path.append(os.path.join(cwd, 'lib'))
sys.path.append(os.path.join(cwd, 'utilities'))
# Import application libraries
import numpy as... | {"/SAT.py": ["/plot_cuboid.py"], "/Random_sample.py": ["/Robot_construct.py", "/check_collision.py"], "/PRM.py": ["/Random_sample.py", "/calculate_dist.py", "/local_planner.py"], "/robot_control.py": ["/SAT.py"], "/local_planner.py": ["/Robot_construct.py", "/check_collision.py"]} |
57,061 | ZhihaoZhu/Robot-Control-Motion-Planning | refs/heads/master | /check_collision.py | import numpy as np
# from SAT import collosion_detect
# True if collides
# check if the bounding box collides or not
def check_collision(robot):
global obstacle_cuboid_spec
for i in range(len(robot)):
for j in range(len(obstacle_cuboid_spec)):
if collosion_detect(i,j):
retu... | {"/SAT.py": ["/plot_cuboid.py"], "/Random_sample.py": ["/Robot_construct.py", "/check_collision.py"], "/PRM.py": ["/Random_sample.py", "/calculate_dist.py", "/local_planner.py"], "/robot_control.py": ["/SAT.py"], "/local_planner.py": ["/Robot_construct.py", "/check_collision.py"]} |
57,062 | ZhihaoZhu/Robot-Control-Motion-Planning | refs/heads/master | /calculate_dist.py | import numpy as np
import scipy.spatial.distance as ssd
def calculate_dist(X, sample_list):
dist = np.zeros(sample_list.shape[0])
for i in range(sample_list.shape[0]):
dist[i] = ssd.euclidean(X, sample_list[i])
return dist | {"/SAT.py": ["/plot_cuboid.py"], "/Random_sample.py": ["/Robot_construct.py", "/check_collision.py"], "/PRM.py": ["/Random_sample.py", "/calculate_dist.py", "/local_planner.py"], "/robot_control.py": ["/SAT.py"], "/local_planner.py": ["/Robot_construct.py", "/check_collision.py"]} |
57,063 | ZhihaoZhu/Robot-Control-Motion-Planning | refs/heads/master | /local_planner.py | import numpy as np
from Robot_construct import *
from check_collision import *
def local_planner(X, Y):
delta = X-Y
n_samples = np.ceil(np.sum(abs(delta)) / 0.03).astype(int)
for i in range(n_samples):
sample = Y + (i/n_samples)*delta
robot = Robot_construct(sample)
if check_collisi... | {"/SAT.py": ["/plot_cuboid.py"], "/Random_sample.py": ["/Robot_construct.py", "/check_collision.py"], "/PRM.py": ["/Random_sample.py", "/calculate_dist.py", "/local_planner.py"], "/robot_control.py": ["/SAT.py"], "/local_planner.py": ["/Robot_construct.py", "/check_collision.py"]} |
57,064 | ZhihaoZhu/Robot-Control-Motion-Planning | refs/heads/master | /Robot_construct.py | import numpy as np
# just return all the bounding box of arms
def Robot_construct(sample_joint_config):
return
| {"/SAT.py": ["/plot_cuboid.py"], "/Random_sample.py": ["/Robot_construct.py", "/check_collision.py"], "/PRM.py": ["/Random_sample.py", "/calculate_dist.py", "/local_planner.py"], "/robot_control.py": ["/SAT.py"], "/local_planner.py": ["/Robot_construct.py", "/check_collision.py"]} |
57,065 | ZhihaoZhu/Robot-Control-Motion-Planning | refs/heads/master | /plot_cuboid.py | from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
def plot_linear_cube(PS1, PS2, color='red'):
fig = plt.figure()
ax = Axes3D(fig)
point_set = PS1
xx = point_set[:,0].reshape(-1).tolist()
yy = point_set[:,1].reshape(-1).tolist()
zz = point_set[:,... | {"/SAT.py": ["/plot_cuboid.py"], "/Random_sample.py": ["/Robot_construct.py", "/check_collision.py"], "/PRM.py": ["/Random_sample.py", "/calculate_dist.py", "/local_planner.py"], "/robot_control.py": ["/SAT.py"], "/local_planner.py": ["/Robot_construct.py", "/check_collision.py"]} |
57,072 | BryceLuna/Fraud_Detection | refs/heads/master | /Models_Eval.py | import pandas as pd
import numpy as np
import cPickle as pickle
from Load_Data import split_data, resample_data, standardize_variables
from sklearn.linear_model import LogisticRegression
from sklearn.ensemble import RandomForestClassifier
from sklearn.ensemble import GradientBoostingClassifier
from sklearn.metrics impo... | {"/Models_Eval.py": ["/Load_Data.py"], "/Search_Models_Params.py": ["/Load_Data.py"]} |
57,073 | BryceLuna/Fraud_Detection | refs/heads/master | /Search_Models_Params.py | import pandas as pd
import numpy as np
import cPickle as pickle
from Load_Data import split_data, resample_data, standardize_variables
from scipy.stats import randint as sp_randint
from sklearn.linear_model import LogisticRegression
from sklearn.ensemble import RandomForestClassifier
from sklearn.ensemble import Gradie... | {"/Models_Eval.py": ["/Load_Data.py"], "/Search_Models_Params.py": ["/Load_Data.py"]} |
57,074 | BryceLuna/Fraud_Detection | refs/heads/master | /NLP.py | import pandas as pd
import numpy as np
import cPickle as pickle
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.naive_bayes import MultinomialNB
from sklearn.cross_validation import train_test_split
def build_model(df):
X = df['description']
Y = df['acct_type']
X_train, X_test, y_... | {"/Models_Eval.py": ["/Load_Data.py"], "/Search_Models_Params.py": ["/Load_Data.py"]} |
57,075 | BryceLuna/Fraud_Detection | refs/heads/master | /Data_Cleaning.py | import pandas as pd
from bs4 import BeautifulSoup
from unidecode import unidecode
'''
Notes:
'''
#Data Cleaning
def clean_data(data_frame,columns_lst):
#clean all the varibles then change their datatypes then do dummies
#Dropping features that aren't obviously useful
df = data_frame.copy()
df.drop(col... | {"/Models_Eval.py": ["/Load_Data.py"], "/Search_Models_Params.py": ["/Load_Data.py"]} |
57,076 | BryceLuna/Fraud_Detection | refs/heads/master | /Load_Data.py | import pandas as pd
import numpy as np
import cPickle as pickle
from sklearn.metrics import confusion_matrix
from sklearn.metrics import classification_report
from sklearn.cross_validation import train_test_split
from imblearn.over_sampling import SMOTE
from sklearn.linear_model import LogisticRegression
from sklearn.e... | {"/Models_Eval.py": ["/Load_Data.py"], "/Search_Models_Params.py": ["/Load_Data.py"]} |
57,084 | iliar1987/PrisonersDilemmaFractals | refs/heads/master | /PD_fractals2.py | # -*- coding: utf-8 -*-
"""
Created on Tue Aug 04 23:22:07 2015
@author: Ilia
"""
from PD_fractals1 import *
fname_prefix = 'combined'
b=1.8
P = 0.01
T = b
S = 0
R = 1
#payoff_mat = np.array([[P,T],[S,R]])
SetPayoffMat(P,T,S,R)
N1 = 100
M1 = 100
f=3
N2 = N1*f
M2 = M1*f
N=[N1,N2]
M=[M1,M2]
indices1 = make_indic... | {"/PD_fractals2.py": ["/PD_fractals1.py"]} |
57,085 | iliar1987/PrisonersDilemmaFractals | refs/heads/master | /PD_fractals1.py | # -*- coding: utf-8 -*-
"""
Created on Mon Aug 03 16:11:00 2015
Based on 'Evolutionary games and spatial chaos by Martin et al.'
@author: Ilia
"""
import numpy as np
from matplotlib import pyplot as plt
def SetPayoffMat(P_,T_,S_,R_):
global payoff_mat
payoff_mat = np.array([[P_,T_],[S_,R_]])
def make_indi... | {"/PD_fractals2.py": ["/PD_fractals1.py"]} |
57,092 | rongtou/ErlSmart | refs/heads/master | /core/job.py | import subprocess
import json
import os
import logging
from urllib import request, parse
import ErlSmart.core.global_vars as gv
def add_index_job(file_path: str):
if file_path.endswith(".erl"):
pool = gv.pool()
pool.submit(do_index, file_path)
def del_index_job(file_path: str, is_dir: bool):
... | {"/core/monitor.py": ["/core/job.py", "/core/utils.py"], "/ErlSmart.py": ["/core/main.py", "/core/utils.py", "/core/smart_goto.py"], "/core/index.py": ["/core/utils.py"], "/core/main.py": ["/core/monitor.py", "/core/index.py", "/core/job.py", "/core/utils.py"]} |
57,093 | rongtou/ErlSmart | refs/heads/master | /core/smart_goto.py | import sublime
import os
import re
import ErlSmart.core.global_vars as gv
ERLANG_EXTENSIONS = ['.erl', '.hrl', '.xrl', '.yrl']
class SmartGoto(object):
def __init__(self, view):
self.view = view
self.window = view.window()
self.options = []
def run(self, kind, point):
(modul... | {"/core/monitor.py": ["/core/job.py", "/core/utils.py"], "/ErlSmart.py": ["/core/main.py", "/core/utils.py", "/core/smart_goto.py"], "/core/index.py": ["/core/utils.py"], "/core/main.py": ["/core/monitor.py", "/core/index.py", "/core/job.py", "/core/utils.py"]} |
57,094 | rongtou/ErlSmart | refs/heads/master | /core/monitor.py | import logging
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
from .job import add_index_job, del_index_job
from .utils import get_folders, adjust_path
class Monitor(object):
def __init__(self):
self.__observer = Observer()
self.__wawtches = {}
def ... | {"/core/monitor.py": ["/core/job.py", "/core/utils.py"], "/ErlSmart.py": ["/core/main.py", "/core/utils.py", "/core/smart_goto.py"], "/core/index.py": ["/core/utils.py"], "/core/main.py": ["/core/monitor.py", "/core/index.py", "/core/job.py", "/core/utils.py"]} |
57,095 | rongtou/ErlSmart | refs/heads/master | /ErlSmart.py | import os
import re
import sublime
import sublime_plugin
from .core.main import startup, shutdown, scan
from .core.utils import get_folders
from .core.smart_goto import SmartGoto
import ErlSmart.core.global_vars as gv
def plugin_loaded():
os.chdir(os.path.dirname(os.path.realpath(__file__)))
startup()
def p... | {"/core/monitor.py": ["/core/job.py", "/core/utils.py"], "/ErlSmart.py": ["/core/main.py", "/core/utils.py", "/core/smart_goto.py"], "/core/index.py": ["/core/utils.py"], "/core/main.py": ["/core/monitor.py", "/core/index.py", "/core/job.py", "/core/utils.py"]} |
57,096 | rongtou/ErlSmart | refs/heads/master | /core/index.py | import sqlite3
import ErlSmart.core.global_vars as gv
import queue
import hashlib
import logging
import os
import platform
import traceback
from threading import Thread
from .utils import path_in_cur_folders
index_file = "index/index.db"
CREATE_FOLDER_SQL = '''
create table if not exists file_path (
fid varchar(3... | {"/core/monitor.py": ["/core/job.py", "/core/utils.py"], "/ErlSmart.py": ["/core/main.py", "/core/utils.py", "/core/smart_goto.py"], "/core/index.py": ["/core/utils.py"], "/core/main.py": ["/core/monitor.py", "/core/index.py", "/core/job.py", "/core/utils.py"]} |
57,097 | rongtou/ErlSmart | refs/heads/master | /core/global_vars.py |
_global_dict = {}
def put(name, value):
global _global_dict
_global_dict[name] = value
def get(name, default=None):
try:
return _global_dict[name]
except KeyError:
return default
def index_reader():
return get('index_reader')
def set_index_reader(reader):
put('index_read... | {"/core/monitor.py": ["/core/job.py", "/core/utils.py"], "/ErlSmart.py": ["/core/main.py", "/core/utils.py", "/core/smart_goto.py"], "/core/index.py": ["/core/utils.py"], "/core/main.py": ["/core/monitor.py", "/core/index.py", "/core/job.py", "/core/utils.py"]} |
57,098 | rongtou/ErlSmart | refs/heads/master | /core/utils.py | import sublime
import platform
import ErlSmart.core.global_vars as gv
def get_folders():
all_folders = []
for window in sublime.windows():
all_folders = all_folders + window.folders()
return list(map(lambda path: adjust_path(path), all_folders))
def adjust_path(path: str):
if platform.system... | {"/core/monitor.py": ["/core/job.py", "/core/utils.py"], "/ErlSmart.py": ["/core/main.py", "/core/utils.py", "/core/smart_goto.py"], "/core/index.py": ["/core/utils.py"], "/core/main.py": ["/core/monitor.py", "/core/index.py", "/core/job.py", "/core/utils.py"]} |
57,099 | rongtou/ErlSmart | refs/heads/master | /core/main.py | import sublime
import logging
import os
import platform
import subprocess
import threading
import ErlSmart.core.global_vars as gv
from concurrent.futures import ThreadPoolExecutor
from .monitor import Monitor
from .index import init_index
from .job import add_index_job, del_index_job
from .utils import get_folders, adj... | {"/core/monitor.py": ["/core/job.py", "/core/utils.py"], "/ErlSmart.py": ["/core/main.py", "/core/utils.py", "/core/smart_goto.py"], "/core/index.py": ["/core/utils.py"], "/core/main.py": ["/core/monitor.py", "/core/index.py", "/core/job.py", "/core/utils.py"]} |
57,145 | michalburdzy/python_tutorial | refs/heads/master | /ankieta/models.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from django.utils.timezone import now
# Create your models here.
class Pytanie(models.Model):
text_pytania = models.CharField(max_length=200)
data_publikacji = models.DateTimeField(default=now, editable=False)
d... | {"/ankieta/views.py": ["/ankieta/models.py"]} |
57,146 | michalburdzy/python_tutorial | refs/heads/master | /ankieta/views.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import render
from django.http import HttpResponse
from .models import Pytanie
from django.template import loader
# Create your views here.
def index(request):
pytania_od_najnowszego = Pytanie.objects.order_by('data_publika... | {"/ankieta/views.py": ["/ankieta/models.py"]} |
57,151 | darkb1ade/RealizedVolPrediction_Kaggle | refs/heads/develop | /model/XGBoost.py | from model.BaseModel import BaseModel
# Visuallize
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
from sklearn import model_selection
# Modeling
from xgboost import XGBRegressor
from helper import utils
import optuna
class LGBM(BaseModel):
"""
This is lightGBM class. Insert list of... | {"/model/XGBoost.py": ["/model/BaseModel.py"], "/helper/dataset.py": ["/model/features.py"], "/model/LGBM.py": ["/model/BaseModel.py"]} |
57,152 | darkb1ade/RealizedVolPrediction_Kaggle | refs/heads/develop | /helper/dataset.py | from model.features import *
import pandas as pd
import yaml
import glob
import os
from IPython.display import display
#os.chdir('C:/Users/Darkblade/Documents/Kaggle/RealizedVolPrediction_Kaggle')
print('current path', os.getcwd())
class DataLoader():
def __init__(self, mode):
self.conf = yaml.load(open('... | {"/model/XGBoost.py": ["/model/BaseModel.py"], "/helper/dataset.py": ["/model/features.py"], "/model/LGBM.py": ["/model/BaseModel.py"]} |
57,153 | darkb1ade/RealizedVolPrediction_Kaggle | refs/heads/develop | /model/cali_proc.py | import lightgbm as lgb
import pandas as pd
import numpy as np
import xgboost as xgb
import pickle
from sklearn.model_selection import KFold
import optuna
from sklearn.metrics import mean_squared_error
import os
import matplotlib.pyplot as plt
import logging
def straight_throught_forecast(x_train, y_train, x_test, y_te... | {"/model/XGBoost.py": ["/model/BaseModel.py"], "/helper/dataset.py": ["/model/features.py"], "/model/LGBM.py": ["/model/BaseModel.py"]} |
57,154 | darkb1ade/RealizedVolPrediction_Kaggle | refs/heads/develop | /model/BaseModel.py |
"""
Use this class as a base class for any
"""
class BaseModel:
def __init__(self):
self.ntrial = 10
def train(self):
return NotImplementedError
def detect(self):
return NotImplementedError
def train_and_test(self):
return NotImplementedError
def optimize_param(s... | {"/model/XGBoost.py": ["/model/BaseModel.py"], "/helper/dataset.py": ["/model/features.py"], "/model/LGBM.py": ["/model/BaseModel.py"]} |
57,155 | darkb1ade/RealizedVolPrediction_Kaggle | refs/heads/develop | /model/LGBM.py | from model.BaseModel import BaseModel
# Visuallize
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
from sklearn import model_selection
# Modeling
import lightgbm as lgb
from helper import utils
import optuna
class LGBMModel(BaseModel):
"""
This is lightGBM class. Insert list of str ... | {"/model/XGBoost.py": ["/model/BaseModel.py"], "/helper/dataset.py": ["/model/features.py"], "/model/LGBM.py": ["/model/BaseModel.py"]} |
57,156 | darkb1ade/RealizedVolPrediction_Kaggle | refs/heads/develop | /main.py | from helper.dataset import DataLoader
from IPython.display import display
import pandas as pd
import numpy as np
from model.LGBM import LGBMModel
import lightgbm as lgb
# dl = DataLoader('train')
#
# # getting each stock (sample)
# d1, _ = dl.get_each_parquet(0)
#
# # get groundtruth/target
# gt = dl.get_gt()
# print(... | {"/model/XGBoost.py": ["/model/BaseModel.py"], "/helper/dataset.py": ["/model/features.py"], "/model/LGBM.py": ["/model/BaseModel.py"]} |
57,157 | darkb1ade/RealizedVolPrediction_Kaggle | refs/heads/develop | /helper/utils.py | import numpy as np
def rmspe(y_true, y_pred):
return (np.sqrt(np.mean(np.square((y_true - y_pred) / y_true)))) | {"/model/XGBoost.py": ["/model/BaseModel.py"], "/helper/dataset.py": ["/model/features.py"], "/model/LGBM.py": ["/model/BaseModel.py"]} |
57,158 | darkb1ade/RealizedVolPrediction_Kaggle | refs/heads/develop | /model/features.py | import pandas as pd
import numpy as np
def log_return(list_stock_prices):
return np.log(list_stock_prices).diff()
def realized_volatility(series_log_return):
return np.sqrt(np.sum(series_log_return**2))
def cal_WAP1(dfBook):
dfBook['WAP1'] = (dfBook.bid_price1*dfBook.ask_size1+dfBook.ask_price1*dfBook.... | {"/model/XGBoost.py": ["/model/BaseModel.py"], "/helper/dataset.py": ["/model/features.py"], "/model/LGBM.py": ["/model/BaseModel.py"]} |
57,159 | eliabonazza/DIA_Lab | refs/heads/master | /Matching/CD_UCB.py | import numpy as np
from scipy.optimize import linear_sum_assignment
from Matching.UCB_Matching import UCB_Matching
from Matching.CUSUM import CUSUM
class CD_UCB(UCB_Matching):
def __init__(self, n_arms, n_rows, n_cols, M=100, eps=0.05, h=20, alpha=0.01):
super().__init__(n_arms, n_rows, n_cols)
... | {"/Pricing/example.py": ["/Pricing/SWTS_Learner.py"]} |
57,160 | eliabonazza/DIA_Lab | refs/heads/master | /Matching/HungarianAlgorithm.py | """
suitable for dense graphs and it returns the minimal cost matching.
key idea:
if a number is added to all of the entries of any row or column
of a cost matrix, then an optimal assignment for the resulting cost
matrix is also an optimal assignment for the original cost matrix.
Thus we can compute the max... | {"/Pricing/example.py": ["/Pricing/SWTS_Learner.py"]} |
57,161 | eliabonazza/DIA_Lab | refs/heads/master | /Matching/UCB.py | import numpy as np
from Pricing.Learner import Learner
class UCB(Learner):
def __init__(self, n_arms):
super().__init__(n_arms)
self.empirical_means = np.zeros(n_arms)
self.confidence = np.array([np.inf] * n_arms)
def pull_arm(self):
upper_conf = self.empirical_means + self.c... | {"/Pricing/example.py": ["/Pricing/SWTS_Learner.py"]} |
57,162 | eliabonazza/DIA_Lab | refs/heads/master | /SocialInfluence/lin_ucb_example.py | import numpy as np
import matplotlib.pyplot as plt
from LinearMabEnvironment import LinearMabEnvironment
from LinearUCBLearner import LinearUCBLearner
if __name__ == '__main__':
n_arms = 10
T = 1000
n_experiments = 100
lin_ucb_reward_per_experiment = []
env = LinearMabEnvironment(n_arms=n_arms,... | {"/Pricing/example.py": ["/Pricing/SWTS_Learner.py"]} |
57,163 | eliabonazza/DIA_Lab | refs/heads/master | /Pricing/example.py | import matplotlib.pyplot as plt
import numpy as np
from Pricing.NonStationaryEnvironment import Non_Stationary_Environment
from Pricing.SWTS_Learner import SWTS_Learner
from Pricing.Environment import Environment
from Pricing.TS_Learner import TS_Learner
from Pricing.GreedyLearner import GreedyLearner
def stationar... | {"/Pricing/example.py": ["/Pricing/SWTS_Learner.py"]} |
57,164 | eliabonazza/DIA_Lab | refs/heads/master | /Advertising/example.py | import numpy as np
import matplotlib.pyplot as plt
from BiddingEnvironment import BiddingEnvironment
from GP_TS_Learner import GP_TS_Learner
from GTS_Learner import GTS_Learner
if __name__ == '__main__':
n_arms = 20
min_bid = 0.05
max_bid = 1.0
bids = np.linspace(min_bid, max_bid, n_arms)
sigm... | {"/Pricing/example.py": ["/Pricing/SWTS_Learner.py"]} |
57,165 | eliabonazza/DIA_Lab | refs/heads/master | /Advertising/GaussianProcess.py | import numpy as np
from matplotlib import pyplot as plt
from sklearn.gaussian_process import GaussianProcessRegressor
from sklearn.gaussian_process.kernels import RBF, ConstantKernel as C
"""
Given the bid returns the expected number of clicks --> to be estimated
"""
def n(x):
return (1.0 - np.exp(-5.0*x)) * 100
... | {"/Pricing/example.py": ["/Pricing/SWTS_Learner.py"]} |
57,166 | eliabonazza/DIA_Lab | refs/heads/master | /SocialInfluence/learning_probabilities.py | import numpy as np
from copy import copy
def simulate_episode(init_prob_matrix, n_steps_max):
prob_matrix = init_prob_matrix.copy()
n_nodes = prob_matrix.shape[0]
initial_active_nodes = np.random.binomial(1, 0.1, size=(n_nodes))
history = np.array([initial_active_nodes])
active_nodes = initial_acti... | {"/Pricing/example.py": ["/Pricing/SWTS_Learner.py"]} |
57,167 | eliabonazza/DIA_Lab | refs/heads/master | /Pricing/SWTS_Learner.py | import numpy as np
from Pricing.TS_Learner import TS_Learner
# sliding window
class SWTS_Learner(TS_Learner):
def __init__(self, n_arms, window_size):
super().__init__(n_arms)
self.window_size = window_size
def update(self, pulled_arm, reward):
self.t += 1
self.update_observat... | {"/Pricing/example.py": ["/Pricing/SWTS_Learner.py"]} |
57,168 | eliabonazza/DIA_Lab | refs/heads/master | /Advertising/GTS_Learner.py | from Pricing.Learner import Learner
import numpy as np
class GTS_Learner(Learner):
def __init__(self, n_arms):
super(GTS_Learner, self).__init__(n_arms)
self.means = np.zeros(n_arms)
self.sigma = np.ones(n_arms) * 1e3 # no prior information -> high probability to be pulled
def pull_a... | {"/Pricing/example.py": ["/Pricing/SWTS_Learner.py"]} |
57,169 | eliabonazza/DIA_Lab | refs/heads/master | /Advertising/BiddingEnvironment.py | import numpy as np
"""
maps the bid to the number of bids
"""
def fun(x):
return 100 * ( 1.0 - np.exp(-4*x + 3*x**3))
class BiddingEnvironment():
def __init__(self, bids, sigma):
self.bids = bids
self.means = fun(bids)
self.sigma = np.ones(len(bids)) * sigma
def round(self, pul... | {"/Pricing/example.py": ["/Pricing/SWTS_Learner.py"]} |
57,177 | SubZer0811/pacman | refs/heads/main | /ghost.py | #!/usr/bin/env python3
import pygame
import random
from maze_map import *
class ghost (maze_map):
def __init__(self,coord,surface,tid,color):
self.coord=coord
self.surface=surface
self.dir=-1
if(color == "red"):
self.ghost_colour = (255,0,0)
elif(color=="blue"):
self.ghost_colour=(34,234,233)
elif... | {"/main.py": ["/player.py", "/draw.py", "/ghost.py"]} |
57,178 | SubZer0811/pacman | refs/heads/main | /player.py | #!/usr/bin/env python3
from maze_map import *
import pygame
class player(maze_map):
SIZE = (10, 10)
color = (255,0,0)
lives = 3
player_colour = (255, 255, 0)
player_radius = 8
def __init__(self, player_coord, surface):
self.player_coord=player_coord
self.surface = surface
self.coin_score=0
def cleardr... | {"/main.py": ["/player.py", "/draw.py", "/ghost.py"]} |
57,179 | SubZer0811/pacman | refs/heads/main | /setup.py | import sys
from cx_Freeze import setup, Executable
# Dependencies are automatically detected, but it might need fine tuning.
additional_modules = []
build_exe_options = {"includes": additional_modules,
"packages": ["pygame", "random", "sys", "threading","math","time","multiprocessing"],
"excludes": ['tkin... | {"/main.py": ["/player.py", "/draw.py", "/ghost.py"]} |
57,180 | SubZer0811/pacman | refs/heads/main | /main.py | #!/usr/bin/env python3
import pygame
import sys
import random
import threading
import math
import time
import multiprocessing
from maze_map import *
from player import *
from draw import *
import config
from ghost import *
thread_status = [0, 0, 0, 0]
pygame.init()
pygame.display.set_caption('PACMAN')
pygame.font.in... | {"/main.py": ["/player.py", "/draw.py", "/ghost.py"]} |
57,181 | SubZer0811/pacman | refs/heads/main | /draw.py | #!/usr/bin/env python3
import pygame
import config
import os
ghost_radius = 10
pixel_size = 20
pixel_center = pixel_size/2
coin_colour = (255, 182, 193)
coin_radius = 4
def draw(coord, ghost_colour):
pygame.draw.circle(config.surface, ghost_colour, (coord[0]*pixel_size+(pixel_center), coord[1]*pixel_size+(pixel_cent... | {"/main.py": ["/player.py", "/draw.py", "/ghost.py"]} |
57,183 | tubial/Race | refs/heads/master | /race_test.py | import unittest
import race
import pygame
class MyTest(unittest.TestCase):
def testvalidkeypressplayerone(self):
player = race.Player("one")
player.last_button_pressed = pygame.K_a
self.assertEqual(player.validForwardKeypress(pygame.K_s), True)
self.assertEqual(player.val... | {"/race_test.py": ["/race.py"], "/player.py": ["/constants.py"], "/race.py": ["/constants.py", "/player.py"]} |
57,184 | tubial/Race | refs/heads/master | /player.py | # player.py
import pygame
import random
import constants
class Player(pygame.sprite.Sprite):
"""docstring for Player."""
def __init__(self, playernum):
super().__init__()
self.last_button_pressed = pygame.K_ESCAPE
self._playernum = playernum
self._position = 0
self.i... | {"/race_test.py": ["/race.py"], "/player.py": ["/constants.py"], "/race.py": ["/constants.py", "/player.py"]} |
57,185 | tubial/Race | refs/heads/master | /race.py | """race.py
"""
import random
import pygame
import constants
import player
class Game(object):
# docstring for Game
def __init__(self, end):
"""Game state
Arguments:
end - steps needed to win
"""
self._playerone = player.Player("one")
self._pl... | {"/race_test.py": ["/race.py"], "/player.py": ["/constants.py"], "/race.py": ["/constants.py", "/player.py"]} |
57,186 | tubial/Race | refs/heads/master | /constants.py | # Colours
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
GREEN = (0, 255, 0)
RED = (255, 0, 0)
# Screen Dimensions
WIDTH = 600
HEIGHT = 800 | {"/race_test.py": ["/race.py"], "/player.py": ["/constants.py"], "/race.py": ["/constants.py", "/player.py"]} |
57,189 | WesleyvanDooren/ma-communicative-robots | refs/heads/master | /representation/annotation.py | # Define Annotation Class
from __future__ import annotations
import enum
import uuid
from rdflib import URIRef, Namespace
from typing import Iterable, Tuple, Generic, TypeVar
from representation.container import Sequence, AtomicContainer, Ruler, Index
from representation.entity import Person, Emotion
from representat... | {"/representation/annotation.py": ["/representation/container.py", "/representation/entity.py", "/representation/scenario.py", "/representation/util.py"], "/representation/scenario.py": ["/representation/container.py", "/representation/entity.py", "/representation/util.py"], "/representation/container.py": ["/represent... |
57,190 | WesleyvanDooren/ma-communicative-robots | refs/heads/master | /representation/scenario.py | # Define Annotation Class
import enum
import os
import json
import uuid
from typing import Iterable, Union, Dict, Optional, Tuple, TypeVar
from representation.container import Container, TemporalContainer, Ruler, TemporalRuler, Sequence, ArrayContainer
from representation.entity import Person, Object
from representat... | {"/representation/annotation.py": ["/representation/container.py", "/representation/entity.py", "/representation/scenario.py", "/representation/util.py"], "/representation/scenario.py": ["/representation/container.py", "/representation/entity.py", "/representation/util.py"], "/representation/container.py": ["/represent... |
57,191 | WesleyvanDooren/ma-communicative-robots | refs/heads/master | /representation/util.py | import enum
import numpy as np
import uuid
from rdflib import URIRef
from typing import Union
Identifier = Union[URIRef, uuid.UUID, str, None]
def serializer(object):
if isinstance(object, enum.Enum):
return object.name
if isinstance(object, (URIRef, uuid.UUID)):
return str(object)
if i... | {"/representation/annotation.py": ["/representation/container.py", "/representation/entity.py", "/representation/scenario.py", "/representation/util.py"], "/representation/scenario.py": ["/representation/container.py", "/representation/entity.py", "/representation/util.py"], "/representation/container.py": ["/represent... |
57,192 | WesleyvanDooren/ma-communicative-robots | refs/heads/master | /integration/convert.py | import numpy as np
from PIL import Image
from leolani.datarepresentation.interaction import Context as LeolaniContext
from leolani.datarepresentation.language import Chat as LeolaniChat
from leolani.datarepresentation.language import Utterance as LeolaniUtterance
from leolani.datarepresentation.language import Utteranc... | {"/representation/annotation.py": ["/representation/container.py", "/representation/entity.py", "/representation/scenario.py", "/representation/util.py"], "/representation/scenario.py": ["/representation/container.py", "/representation/entity.py", "/representation/util.py"], "/representation/container.py": ["/represent... |
57,193 | WesleyvanDooren/ma-communicative-robots | refs/heads/master | /representation/container.py | # Define Annotation Class
from __future__ import annotations
import json
import numpy as np
import uuid
from typing import Union, TypeVar, Generic, Iterable, Tuple
from representation.util import serializer, Identifier
class Ruler:
"""Base type of Rulers that allow to identify a segment relative to a ruler in a... | {"/representation/annotation.py": ["/representation/container.py", "/representation/entity.py", "/representation/scenario.py", "/representation/util.py"], "/representation/scenario.py": ["/representation/container.py", "/representation/entity.py", "/representation/util.py"], "/representation/container.py": ["/represent... |
57,194 | WesleyvanDooren/ma-communicative-robots | refs/heads/master | /representation/entity.py | # Define Annotation Class
import enum
from datetime import date
import uuid
from representation.util import Identifier
class Emotion(enum.Enum):
NEUTRAL = 0
ANGER = 1
DISGUST = 2
FEAR = 3
HAPPINESS = 4
JOY = 5
SADNESS = 6
SURPRISE = 7
class Gender(enum.Enum):
UNDEFINED = 0
... | {"/representation/annotation.py": ["/representation/container.py", "/representation/entity.py", "/representation/scenario.py", "/representation/util.py"], "/representation/scenario.py": ["/representation/container.py", "/representation/entity.py", "/representation/util.py"], "/representation/container.py": ["/represent... |
57,205 | AlpsSnow/PhotoMap | refs/heads/master | /createGeojson.py | from getExifData import getExifData
def writeGeojson(file,latLons):
#按照拍摄时间排序
for i in range(0,len(latLons)):
for j in range(i,len(latLons)):
if latLons[i][1] > latLons[j][1]:
tmp = latLons[j]
latLons[j] = latLons[i]
latLons[i] = tmp
i... | {"/createGeojson.py": ["/getExifData.py"]} |
57,206 | AlpsSnow/PhotoMap | refs/heads/master | /getExifData.py | #!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
getExifData.py,批量取一个文件夹下照片的坐标,日期,照片名字
"""
import exifread
import os
import sys
#提取照片坐标和拍摄时间
def extractExif(fpath):
try:
with open(fpath,'rb') as rf:
exif=exifread.process_file(rf)
eDate=exif['EXIF DateTimeOriginal'].printable
... | {"/createGeojson.py": ["/getExifData.py"]} |
57,207 | AlpsSnow/PhotoMap | refs/heads/master | /resize.py | #!/usr/bin/env python
import os
from PIL import Image
size = 512, 512
def resize(photo_path):
for root, dirs, files in os.walk(photo_path):
print('根目录:{0},文件夹:{1},文件数:{2}'.format(root,dirs,len(files)))
for f in files:
outfile = f.replace(".jpg", ".thumbnail.jpg")
try:
... | {"/createGeojson.py": ["/getExifData.py"]} |
57,214 | Sorcy32/UNIrequester | refs/heads/master | /save_to_xlsx.py | from openpyxl import Workbook
from datetime import datetime
wb = Workbook()
ws = wb.create_sheet('Ouptut', 0)
filename = (str(datetime.strftime(datetime.now(), "%d.%m.%y %H.%M.%S")) + '.xlsx')
def add_header(items):
data = []
# data = items
for x in items:
data.append(str(x))
ws.append(data)
... | {"/sert.py": ["/config.py"], "/requester.py": ["/config.py", "/sert.py", "/save_to_xlsx.py"], "/gui.py": ["/config.py", "/requester.py"]} |
57,215 | Sorcy32/UNIrequester | refs/heads/master | /save_to_sql.py | import sqlite3
import os
conn = sqlite3.connect('my.db')
cursor = conn.cursor()
def create():
cursor.execute("""CREATE TABLE export """)
def add_line(items, link=''):
for i in items:
cursor.execute('''
ALTER TABLE export ADD COLUMN ? text''', i)
| {"/sert.py": ["/config.py"], "/requester.py": ["/config.py", "/sert.py", "/save_to_xlsx.py"], "/gui.py": ["/config.py", "/requester.py"]} |
57,216 | Sorcy32/UNIrequester | refs/heads/master | /sert.py | import contextlib
import OpenSSL.crypto
import os
import config
""" Использование:
with pfx_to_pem('foo.pem', 'bar') as cert:
requests.post(url, cert=cert, data=payload)
"""
@contextlib.contextmanager
def pfx_to_pem(pfx_path, pfx_password):
if os.path.isfile(config.get_setting('Paths', 'PEM_certificate')):
... | {"/sert.py": ["/config.py"], "/requester.py": ["/config.py", "/sert.py", "/save_to_xlsx.py"], "/gui.py": ["/config.py", "/requester.py"]} |
57,217 | Sorcy32/UNIrequester | refs/heads/master | /requester.py | import requests
import json
import config
import sert
from threading import Thread, current_thread
from queue import Queue
import save_to_xlsx as stx
login = config.get_setting('Account', 'login')
password = config.get_setting('Account', 'password')
link = config.get_setting("Network", "link")
access_key = config.get_... | {"/sert.py": ["/config.py"], "/requester.py": ["/config.py", "/sert.py", "/save_to_xlsx.py"], "/gui.py": ["/config.py", "/requester.py"]} |
57,218 | Sorcy32/UNIrequester | refs/heads/master | /config.py | """
Использование: сonfig.get_setting('секция','данные')
"""
import configparser
import os
path = "data\settings.ini"
def createConfig(path):
""" Создать конфиг файл """
config = configparser.ConfigParser()
config.add_section("Account")
config.set("Account", "Login", "Login")
config.set("Account"... | {"/sert.py": ["/config.py"], "/requester.py": ["/config.py", "/sert.py", "/save_to_xlsx.py"], "/gui.py": ["/config.py", "/requester.py"]} |
57,219 | Sorcy32/UNIrequester | refs/heads/master | /gui.py | from tkinter import *
from tkinter import filedialog as fd
from tkinter import messagebox as mb
import config
import requester
# TODO Сделать возможность сохранения userItems
# Получаем данные из настроек программы
link = config.get_setting('Network', 'link')
key = config.get_setting('Network', 'accesskey')
itemList... | {"/sert.py": ["/config.py"], "/requester.py": ["/config.py", "/sert.py", "/save_to_xlsx.py"], "/gui.py": ["/config.py", "/requester.py"]} |
57,248 | RushiChavan-dev/fastapi-aws-lear | refs/heads/main | /venv/Lib/site-packages/a2wsgi/asgi.py | import asyncio
import collections
import threading
from http import HTTPStatus
from itertools import chain
from typing import Any, Deque, Iterable
from .types import ASGIApp, Environ, Message, Scope, StartResponse
__all__ = ("ASGIMiddleware",)
class AsyncEvent:
def __init__(self, loop: asyncio.AbstractEventLoop... | {"/venv/Lib/site-packages/a2wsgi/__init__.py": ["/venv/Lib/site-packages/a2wsgi/asgi.py"]} |
57,249 | RushiChavan-dev/fastapi-aws-lear | refs/heads/main | /venv/Lib/site-packages/a2wsgi/__init__.py | from .asgi import ASGIMiddleware
from .wsgi import WSGIMiddleware
VERSION = (1, 4, 0)
__version__: str = ".".join(map(str, VERSION))
__all__ = ("WSGIMiddleware", "ASGIMiddleware")
| {"/venv/Lib/site-packages/a2wsgi/__init__.py": ["/venv/Lib/site-packages/a2wsgi/asgi.py"]} |
57,250 | RushiChavan-dev/fastapi-aws-lear | refs/heads/main | /api/main.py | from fastapi import FastAPI, status, HTTPException
from fastapi.params import Depends
from fastapi.security import OAuth2PasswordBearer
from sqlalchemy.orm import Session
from a2wsgi import ASGIMiddleware
from api import models
from api import schemas
from api import database
from api.database import SessionLocal, eng... | {"/venv/Lib/site-packages/a2wsgi/__init__.py": ["/venv/Lib/site-packages/a2wsgi/asgi.py"]} |
57,251 | RushiChavan-dev/fastapi-aws-lear | refs/heads/main | /api/schemas.py | from datetime import datetime
from sqlalchemy import Boolean, Column, String, Integer, DateTime, text, TIMESTAMP, func
from api.database import Base
# class User(Base):
# __tablename__ = "userslist"
#
# id = Column(Integer, primary_key=True, index=True)
# name = Column(String, index=True)
# surname ... | {"/venv/Lib/site-packages/a2wsgi/__init__.py": ["/venv/Lib/site-packages/a2wsgi/asgi.py"]} |
57,252 | RushiChavan-dev/fastapi-aws-lear | refs/heads/main | /api/models.py | from pydantic import BaseModel
# class UserDetails(BaseModel):
# user_name: str
# user_surname: str
class IDGenerate(BaseModel):
person_name: str
id_generate: str
mobile_number: str
class PeopleWithID(BaseModel):
person_name: str
id_generate: str
mobile_number: str
class CreatePo... | {"/venv/Lib/site-packages/a2wsgi/__init__.py": ["/venv/Lib/site-packages/a2wsgi/asgi.py"]} |
57,253 | tatsunoshirou/mysite | refs/heads/master | /polls/migrations/0004_auto_20190110_1501.py | # Generated by Django 2.1.4 on 2019-01-10 06:01
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('polls', '0003_post_title'),
]
operations = [
migrations.AlterField(
model_name='post',
name='message',
f... | {"/polls/views.py": ["/polls/models.py"]} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.