index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
37,790,934 | metaphysicser/DP-Star | refs/heads/main | /utils/__init__.py | #!/usr/bin/env python
# -*-coding:utf-8-*-
# Author: nomalocaris <nomalocaris.top>
""""""
from __future__ import (absolute_import, unicode_literals)
from ._progressbar import ProgressBar
from _vector_cal import to_vec_add, to_vec_sub, to_vec_times, to_vec_dot
from ._plot import plot_scatter, plot_traj
from ._vector_cal... | {"/dpstar/synthetic_trajectory_generation.py": ["/utils/__init__.py"], "/dpstar/__init__.py": ["/dpstar/adaptive_grid_construction.py", "/dpstar/trip_distribution_extraction.py", "/dpstar/mobility_model_construction.py", "/dpstar/route_length_estimation.py", "/dpstar/synthetic_trajectory_generation.py"], "/dpstar/route... |
37,790,935 | metaphysicser/DP-Star | refs/heads/main | /utils/get_plot.py | import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif']=['SimHei'] # 用来正常显示中文标签
import matplotlib.font_manager as fm # 字体管理器
def run_data():
data = {
"Query AvRE": [6.85e-04,8.22e-03,8.15e-02,8.54],
"Freq Patten AvRE": [0.13,1.08,1.24,1.31],
"Trip Error": [2.27e-03,4.17e-... | {"/dpstar/synthetic_trajectory_generation.py": ["/utils/__init__.py"], "/dpstar/__init__.py": ["/dpstar/adaptive_grid_construction.py", "/dpstar/trip_distribution_extraction.py", "/dpstar/mobility_model_construction.py", "/dpstar/route_length_estimation.py", "/dpstar/synthetic_trajectory_generation.py"], "/dpstar/route... |
37,790,936 | metaphysicser/DP-Star | refs/heads/main | /dpstar/mobility_model_construction.py | """
-------------------------------------
# -*- coding: utf-8 -*-
# @Time : 2021/4/16 12:03:46
# @Author : Giyn
# @Email : giyn.jy@gmail.com
# @File : mobility_model_construction.py
# @Software: PyCharm
-------------------------------------
"""
import numpy as np
from utils import ProgressBar
def markov_mo... | {"/dpstar/synthetic_trajectory_generation.py": ["/utils/__init__.py"], "/dpstar/__init__.py": ["/dpstar/adaptive_grid_construction.py", "/dpstar/trip_distribution_extraction.py", "/dpstar/mobility_model_construction.py", "/dpstar/route_length_estimation.py", "/dpstar/synthetic_trajectory_generation.py"], "/dpstar/route... |
37,790,937 | metaphysicser/DP-Star | refs/heads/main | /utils/_vector_cal.py | #!/usr/bin/env python
# -*-coding:utf-8-*-
# Author: nomalocaris <nomalocaris.top>
""""""
from __future__ import (absolute_import, unicode_literals)
def to_vec_sub(p1, p2):
""""""
return [p1[0] - p2[0], p1[1] - p2[1]]
def to_vec_add(p1, p2):
""""""
return [p1[0] + p2[0], p1[1] + p2[1]]
def to_vec_... | {"/dpstar/synthetic_trajectory_generation.py": ["/utils/__init__.py"], "/dpstar/__init__.py": ["/dpstar/adaptive_grid_construction.py", "/dpstar/trip_distribution_extraction.py", "/dpstar/mobility_model_construction.py", "/dpstar/route_length_estimation.py", "/dpstar/synthetic_trajectory_generation.py"], "/dpstar/route... |
37,790,938 | metaphysicser/DP-Star | refs/heads/main | /metrics/__init__.py | #!/usr/bin/env python
# -*-coding:utf-8-*-
# Author: nomalocaris <nomalocaris.top>
""""""
from __future__ import (absolute_import, unicode_literals)
from .DiameterE import SD_len, D_len, cal_diameter_e
| {"/dpstar/synthetic_trajectory_generation.py": ["/utils/__init__.py"], "/dpstar/__init__.py": ["/dpstar/adaptive_grid_construction.py", "/dpstar/trip_distribution_extraction.py", "/dpstar/mobility_model_construction.py", "/dpstar/route_length_estimation.py", "/dpstar/synthetic_trajectory_generation.py"], "/dpstar/route... |
37,790,939 | metaphysicser/DP-Star | refs/heads/main | /config.py | #!/usr/bin/env python
# -*-coding:utf-8-*-
# Author: nomalocaris <nomalocaris.top>
"""
the config of parm for DP-Star
"""
from __future__ import (absolute_import, unicode_literals)
# trajectory geo range
gps_range = {'lat': (0, 1320), 'lon': (0, 1760)}
# the number of the top grid
n_top_grid = 7
# a significant parm... | {"/dpstar/synthetic_trajectory_generation.py": ["/utils/__init__.py"], "/dpstar/__init__.py": ["/dpstar/adaptive_grid_construction.py", "/dpstar/trip_distribution_extraction.py", "/dpstar/mobility_model_construction.py", "/dpstar/route_length_estimation.py", "/dpstar/synthetic_trajectory_generation.py"], "/dpstar/route... |
37,790,940 | metaphysicser/DP-Star | refs/heads/main | /main.py | #!/usr/bin/env python
# -*-coding:utf-8-*-
# Author: nomalocaris <nomalocaris.top>
""""""
from __future__ import (absolute_import, unicode_literals)
from dpstar import generate_adaptive_grid, read_mdl_data
from dpstar import generate_sd_grid_mapping_traj
from dpstar import trip_distribution_main
from dpstar import mobi... | {"/dpstar/synthetic_trajectory_generation.py": ["/utils/__init__.py"], "/dpstar/__init__.py": ["/dpstar/adaptive_grid_construction.py", "/dpstar/trip_distribution_extraction.py", "/dpstar/mobility_model_construction.py", "/dpstar/route_length_estimation.py", "/dpstar/synthetic_trajectory_generation.py"], "/dpstar/route... |
37,790,941 | metaphysicser/DP-Star | refs/heads/main | /utils/_plot.py | #!/usr/bin/env python
# -*-coding:utf-8-*-
# Author: nomalocaris <nomalocaris.top>
"""
the functions for plot.
"""
from __future__ import (absolute_import, unicode_literals)
import numpy as np
import matplotlib.pyplot as plt
from utils import ProgressBar
def plot_scatter(points, fig_size=(6, 6), color='mediumpurp... | {"/dpstar/synthetic_trajectory_generation.py": ["/utils/__init__.py"], "/dpstar/__init__.py": ["/dpstar/adaptive_grid_construction.py", "/dpstar/trip_distribution_extraction.py", "/dpstar/mobility_model_construction.py", "/dpstar/route_length_estimation.py", "/dpstar/synthetic_trajectory_generation.py"], "/dpstar/route... |
37,790,942 | metaphysicser/DP-Star | refs/heads/main | /metrics/trip_test.py | # -*- encoding:utf-8 -*-
import os
from math import log
import numpy as np
def KLD(p, q): # 计算KL散度
p = p + np.spacing(1)
q = q + np.spacing(1)
# print(p/q)
return sum([_p * log(_p / _q) for (_p, _q) in zip(p, q)])
def JSD_core(p, q): # 计算JS散度(Jensen–Shannon divergence)
M = [0.5 * (_p + _q) ... | {"/dpstar/synthetic_trajectory_generation.py": ["/utils/__init__.py"], "/dpstar/__init__.py": ["/dpstar/adaptive_grid_construction.py", "/dpstar/trip_distribution_extraction.py", "/dpstar/mobility_model_construction.py", "/dpstar/route_length_estimation.py", "/dpstar/synthetic_trajectory_generation.py"], "/dpstar/route... |
37,790,943 | metaphysicser/DP-Star | refs/heads/main | /metrics/FP_KT.py | import numpy as np
import os
pattern = ['Frequent_Pattern_init.txt', 'Frequent_Pattern_sd.txt']
path_list = ['../../data/Geolife Trajectories 1.3/Trajectories7000/', '../../data/Geolife Trajectories '
'1.3/sd/sd_final_MDL1100_ep0.1/',
... | {"/dpstar/synthetic_trajectory_generation.py": ["/utils/__init__.py"], "/dpstar/__init__.py": ["/dpstar/adaptive_grid_construction.py", "/dpstar/trip_distribution_extraction.py", "/dpstar/mobility_model_construction.py", "/dpstar/route_length_estimation.py", "/dpstar/synthetic_trajectory_generation.py"], "/dpstar/route... |
37,790,944 | metaphysicser/DP-Star | refs/heads/main | /metrics/diameter_error.py | """
-------------------------------------
# -*- coding: utf-8 -*-
# @Author :
nomalocaris
Giyn
HZT
# @File : diameter_error.py
# @Software: PyCharm
-------------------------------------
"""
import os
from math import log
import numpy as np
from utils import ProgressBar
def... | {"/dpstar/synthetic_trajectory_generation.py": ["/utils/__init__.py"], "/dpstar/__init__.py": ["/dpstar/adaptive_grid_construction.py", "/dpstar/trip_distribution_extraction.py", "/dpstar/mobility_model_construction.py", "/dpstar/route_length_estimation.py", "/dpstar/synthetic_trajectory_generation.py"], "/dpstar/route... |
37,790,945 | metaphysicser/DP-Star | refs/heads/main | /dpstar/trip_distribution_extraction.py | """
-------------------------------------
# -*- coding: utf-8 -*-
# @Time : 2021/4/16 11:57:44
# @Author : Giyn
# @Email : giyn.jy@gmail.com
# @File : trip_distribution_extraction.py
# @Software: PyCharm
-------------------------------------
"""
import numpy as np
from utils import ProgressBar
def trip_dis... | {"/dpstar/synthetic_trajectory_generation.py": ["/utils/__init__.py"], "/dpstar/__init__.py": ["/dpstar/adaptive_grid_construction.py", "/dpstar/trip_distribution_extraction.py", "/dpstar/mobility_model_construction.py", "/dpstar/route_length_estimation.py", "/dpstar/synthetic_trajectory_generation.py"], "/dpstar/route... |
37,841,615 | marcosguilhermef/oddsing-python | refs/heads/master | /scrapingOdds.py | from warnings import catch_warnings, simplefilter
import connect
from bs4 import BeautifulSoup
import re
import json
import datetime
import database
from difflib import SequenceMatcher
class RaparOddsSa():
def __init__(self,link):
self.link = link
self.Request()
self.StartSoup()
s... | {"/scrapingOdds.py": ["/connect.py", "/database.py", "/OddParametrizacao.py"], "/scrapingLinks.py": ["/connect.py"], "/images.py": ["/database.py"], "/main.py": ["/scrapingLinks.py", "/datasets.py", "/lerArquivoDeLinks.py", "/connect.py", "/scrapingOdds.py", "/SalvarEmTexto.py", "/database.py"]} |
37,841,616 | marcosguilhermef/oddsing-python | refs/heads/master | /main.py | from pymongo import database
import datasets
from scrapingLinks import RaparLinksOddsSa as scrap
from scrapingLinks import RaparLinksOddsKbets as scrapK
from datasets import Link
from lerArquivoDeLinks import ArquivoSA as lerSa
from lerArquivoDeLinks import ArquivoKBETS as lerK
from connect import ConectSA
from scrapi... | {"/scrapingOdds.py": ["/connect.py", "/database.py", "/OddParametrizacao.py"], "/scrapingLinks.py": ["/connect.py"], "/images.py": ["/database.py"], "/main.py": ["/scrapingLinks.py", "/datasets.py", "/lerArquivoDeLinks.py", "/connect.py", "/scrapingOdds.py", "/SalvarEmTexto.py", "/database.py"]} |
37,841,617 | marcosguilhermef/oddsing-python | refs/heads/master | /scrapingLinks.py | from os import link, stat
from warnings import catch_warnings
import connect
from bs4 import BeautifulSoup
import re
class RaparLinksOddsSa():
def __init__(self,link):
self.link = link
self.body = self.getLinksMaisOdds()
def getLinksMaisOdds(self):
return connect.ConectSA(self.link... | {"/scrapingOdds.py": ["/connect.py", "/database.py", "/OddParametrizacao.py"], "/scrapingLinks.py": ["/connect.py"], "/images.py": ["/database.py"], "/main.py": ["/scrapingLinks.py", "/datasets.py", "/lerArquivoDeLinks.py", "/connect.py", "/scrapingOdds.py", "/SalvarEmTexto.py", "/database.py"]} |
37,841,618 | marcosguilhermef/oddsing-python | refs/heads/master | /connect.py | import requests
#essa class faz a primeira requisição ao site
class ConectSA():
def __init__(self,SALink):
self.link = SALink
self.response = self.setResponse()
def setResponse(self):
r = requests.get(self.link)
return r
def getBody(self):
return self.response.t... | {"/scrapingOdds.py": ["/connect.py", "/database.py", "/OddParametrizacao.py"], "/scrapingLinks.py": ["/connect.py"], "/images.py": ["/database.py"], "/main.py": ["/scrapingLinks.py", "/datasets.py", "/lerArquivoDeLinks.py", "/connect.py", "/scrapingOdds.py", "/SalvarEmTexto.py", "/database.py"]} |
37,841,619 | marcosguilhermef/oddsing-python | refs/heads/master | /database.py | import sqlite3
import pymongo
from pymongo import aggregation
import json
class Database():
mongo = pymongo.MongoClient("mongodb://localhost:27017/")
databaseM = mongo["oddsing"]
collection = databaseM['odds']
listaDeJogos = None
def setCollection(self):
self.collection = self.databaseM['odd... | {"/scrapingOdds.py": ["/connect.py", "/database.py", "/OddParametrizacao.py"], "/scrapingLinks.py": ["/connect.py"], "/images.py": ["/database.py"], "/main.py": ["/scrapingLinks.py", "/datasets.py", "/lerArquivoDeLinks.py", "/connect.py", "/scrapingOdds.py", "/SalvarEmTexto.py", "/database.py"]} |
37,855,304 | krootca/App-Flask | refs/heads/main | /database.py | #!/bin/python3
import sqlite3 #sqlite3 como base de datos
import random, re, time
#random para generar numeros aleatorios
#re para usar regex, expresiones regulares
#time para proporcionar al algoritmo información del sistema, fecha, hora
#regex o expresiones regulares
nick_re = re.compile(r"^[a-zA-Zàáâäãåąčćęèéêëėįì... | {"/init.py": ["/database.py"]} |
37,855,305 | krootca/App-Flask | refs/heads/main | /init.py | from flask import Flask, flash, render_template, request, redirect, url_for, abort, session, escape, make_response, send_from_directory #el modulo de Flask
from flask_socketio import SocketIO, send, emit #Usaremos socket.io
import random,time,os #El modulo random, para obtener numeros aleatorios, time
# para obtener ... | {"/init.py": ["/database.py"]} |
37,961,707 | dofun12/gdrive-autobackup | refs/heads/master | /model/gdrive_config_model.py | class GDriveConfigModel:
SCOPES = []
CREDENTIAL_PATH: str
TOKEN_PICK_PATH: str
MAX_BACKUPS: int
def __init__(self, config):
protocol = config['GDRIVE']['SCOPE_PROTOCOL']
host = config['GDRIVE']['SCOPE_HOST']
paths = config['GDRIVE']['SCOPE_PATHS']
for path in paths.s... | {"/gdrive/backup.py": ["/gdrive/gdrive_api.py", "/model/gdrive_config_model.py", "/model/mysql_config_model.py", "/general/local_files.py", "/model/general_config_model.py"], "/main.py": ["/gdrive/backup.py", "/gdrive/gdrive_api.py", "/model/gdrive_config_model.py", "/model/mysql_config_model.py", "/model/general_confi... |
37,961,708 | dofun12/gdrive-autobackup | refs/heads/master | /main.py | # This is a sample Python script.
import configparser
import sys
import time
from datetime import datetime
import threading
import pycron
from gdrive.backup import Backup
from gdrive.gdrive_api import GDriveApi
from model.gdrive_config_model import GDriveConfigModel
from model.general_config_model import GeneralConfig... | {"/gdrive/backup.py": ["/gdrive/gdrive_api.py", "/model/gdrive_config_model.py", "/model/mysql_config_model.py", "/general/local_files.py", "/model/general_config_model.py"], "/main.py": ["/gdrive/backup.py", "/gdrive/gdrive_api.py", "/model/gdrive_config_model.py", "/model/mysql_config_model.py", "/model/general_confi... |
37,961,709 | dofun12/gdrive-autobackup | refs/heads/master | /general/local_files.py | import tarfile
import os
import time
from model.file_model import FileModel
from model.general_config_model import GeneralConfigModel
from model.mysql_config_model import MysqlConfigModel
class LocalFiles:
MYSQL_CONFIG: MysqlConfigModel
GENERAL_CONFIG: GeneralConfigModel
def __init__(self, mysql_config:... | {"/gdrive/backup.py": ["/gdrive/gdrive_api.py", "/model/gdrive_config_model.py", "/model/mysql_config_model.py", "/general/local_files.py", "/model/general_config_model.py"], "/main.py": ["/gdrive/backup.py", "/gdrive/gdrive_api.py", "/model/gdrive_config_model.py", "/model/mysql_config_model.py", "/model/general_confi... |
37,961,710 | dofun12/gdrive-autobackup | refs/heads/master | /model/general_config_model.py | class GeneralConfigModel:
MAX_SQL_DUMPS: int
MAX_COMPRESSED_DUMPS: int
KEEP_LOCAL_BACKUPS: bool
CRON: str
def __init__(self, config):
self.CRON = config['GENERAL']['CRON']
self.MAX_SQL_DUMPS = int(config['GENERAL']['MAX_SQL_DUMPS'])
self.MAX_COMPRESSED_DUMPS = int(config['G... | {"/gdrive/backup.py": ["/gdrive/gdrive_api.py", "/model/gdrive_config_model.py", "/model/mysql_config_model.py", "/general/local_files.py", "/model/general_config_model.py"], "/main.py": ["/gdrive/backup.py", "/gdrive/gdrive_api.py", "/model/gdrive_config_model.py", "/model/mysql_config_model.py", "/model/general_confi... |
37,961,711 | dofun12/gdrive-autobackup | refs/heads/master | /model/file_model.py | class FileModel:
name: str
full_path: str
def __init__(self, full_path, name):
self.name = name
self.full_path = full_path
| {"/gdrive/backup.py": ["/gdrive/gdrive_api.py", "/model/gdrive_config_model.py", "/model/mysql_config_model.py", "/general/local_files.py", "/model/general_config_model.py"], "/main.py": ["/gdrive/backup.py", "/gdrive/gdrive_api.py", "/model/gdrive_config_model.py", "/model/mysql_config_model.py", "/model/general_confi... |
37,961,712 | dofun12/gdrive-autobackup | refs/heads/master | /gdrive/gdrive_api.py | from __future__ import print_function
import datetime
import pickle
import os.path
import os
import time
from googleapiclient.discovery import build, Resource
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
# If modifying these scopes, delete the file token.pi... | {"/gdrive/backup.py": ["/gdrive/gdrive_api.py", "/model/gdrive_config_model.py", "/model/mysql_config_model.py", "/general/local_files.py", "/model/general_config_model.py"], "/main.py": ["/gdrive/backup.py", "/gdrive/gdrive_api.py", "/model/gdrive_config_model.py", "/model/mysql_config_model.py", "/model/general_confi... |
37,961,713 | dofun12/gdrive-autobackup | refs/heads/master | /model/mysql_config_model.py | class MysqlConfigModel:
TARGET_DIR = str
HOST: str
PORT: int
DB_USER: str
DB_PASS: str
DATABASE: str
def __init__(self, config):
self.TARGET_DIR = config['MYSQL']['TARGET_DIR']
self.HOST = config['MYSQL']['HOST']
self.PORT = int(config['MYSQL']['PORT'])
self.... | {"/gdrive/backup.py": ["/gdrive/gdrive_api.py", "/model/gdrive_config_model.py", "/model/mysql_config_model.py", "/general/local_files.py", "/model/general_config_model.py"], "/main.py": ["/gdrive/backup.py", "/gdrive/gdrive_api.py", "/model/gdrive_config_model.py", "/model/mysql_config_model.py", "/model/general_confi... |
37,961,714 | dofun12/gdrive-autobackup | refs/heads/master | /gdrive/backup.py | import os
from gdrive.gdrive_api import GDriveApi
from general.local_files import LocalFiles
from model.gdrive_config_model import GDriveConfigModel
from model.general_config_model import GeneralConfigModel
from model.mysql_config_model import MysqlConfigModel
class Backup:
MYSQL_CONFIG: MysqlConfigModel
GDRI... | {"/gdrive/backup.py": ["/gdrive/gdrive_api.py", "/model/gdrive_config_model.py", "/model/mysql_config_model.py", "/general/local_files.py", "/model/general_config_model.py"], "/main.py": ["/gdrive/backup.py", "/gdrive/gdrive_api.py", "/model/gdrive_config_model.py", "/model/mysql_config_model.py", "/model/general_confi... |
37,961,715 | dofun12/gdrive-autobackup | refs/heads/master | /utils/dateutils.py | import datetime
#'2021-04-12T03:51:47.092Z'
def str_to_date_object(date_string):
return datetime.datetime.strptime(date_string, '%Y-%m-%dT%H:%M:%S.%f%z') | {"/gdrive/backup.py": ["/gdrive/gdrive_api.py", "/model/gdrive_config_model.py", "/model/mysql_config_model.py", "/general/local_files.py", "/model/general_config_model.py"], "/main.py": ["/gdrive/backup.py", "/gdrive/gdrive_api.py", "/model/gdrive_config_model.py", "/model/mysql_config_model.py", "/model/general_confi... |
37,961,716 | dofun12/gdrive-autobackup | refs/heads/master | /gdrive/test.py | from gdrive import gdrive_api
if __name__=="__main__":
service = gdrive_api.init_api()
gdrive_api.list_files(service) | {"/gdrive/backup.py": ["/gdrive/gdrive_api.py", "/model/gdrive_config_model.py", "/model/mysql_config_model.py", "/general/local_files.py", "/model/general_config_model.py"], "/main.py": ["/gdrive/backup.py", "/gdrive/gdrive_api.py", "/model/gdrive_config_model.py", "/model/mysql_config_model.py", "/model/general_confi... |
37,985,857 | jaderigby/quick-git | refs/heads/master | /New.py | import messages as msg
import subprocess, helpers
# settings = helpers.get_settings()
def execute():
msg.new_branch_info()
nameSelect = helpers.user_input("Please select a name for your feature branch: ")
helpers.run_command('git checkout master')
helpers.run_command('git pull')
helpers.run_comman... | {"/Branch.py": ["/messages.py", "/helpers.py"], "/helpers.py": ["/settings.py"], "/Remove.py": ["/messages.py", "/helpers.py"], "/New.py": ["/messages.py", "/helpers.py"], "/Feature.py": ["/messages.py", "/helpers.py"], "/Diff.py": ["/messages.py", "/helpers.py"], "/actions.py": ["/messages.py", "/helpers.py", "/sizzle... |
37,985,858 | jaderigby/quick-git | refs/heads/master | /Feature.py | import messages as msg
import subprocess, helpers
# settings = helpers.get_settings()
def execute():
nameSelect = helpers.user_input("Please select a name for your feature branch: ")
currentBranch = helpers.run_command_output('git branch --show-current', False).replace('\n','')
helpers.run_command('git ch... | {"/Branch.py": ["/messages.py", "/helpers.py"], "/helpers.py": ["/settings.py"], "/Remove.py": ["/messages.py", "/helpers.py"], "/New.py": ["/messages.py", "/helpers.py"], "/Feature.py": ["/messages.py", "/helpers.py"], "/Diff.py": ["/messages.py", "/helpers.py"], "/actions.py": ["/messages.py", "/helpers.py", "/sizzle... |
37,985,859 | jaderigby/quick-git | refs/heads/master | /Diff.py | import messages as msg
import helpers
settings = helpers.get_settings()
def execute():
if settings:
if 'differ' in settings:
while True:
listing = helpers.run_command_output('git diff --name-only')
listingList = listing.splitlines()
selection = h... | {"/Branch.py": ["/messages.py", "/helpers.py"], "/helpers.py": ["/settings.py"], "/Remove.py": ["/messages.py", "/helpers.py"], "/New.py": ["/messages.py", "/helpers.py"], "/Feature.py": ["/messages.py", "/helpers.py"], "/Diff.py": ["/messages.py", "/helpers.py"], "/actions.py": ["/messages.py", "/helpers.py", "/sizzle... |
37,985,860 | jaderigby/quick-git | refs/heads/master | /settings.py | import os
toolDirectory = os.path.dirname(__file__)
settings = {
"profile_url" : toolDirectory + "/profiles/",
"profile" : "profile.py"
}
| {"/Branch.py": ["/messages.py", "/helpers.py"], "/helpers.py": ["/settings.py"], "/Remove.py": ["/messages.py", "/helpers.py"], "/New.py": ["/messages.py", "/helpers.py"], "/Feature.py": ["/messages.py", "/helpers.py"], "/Diff.py": ["/messages.py", "/helpers.py"], "/actions.py": ["/messages.py", "/helpers.py", "/sizzle... |
37,985,861 | jaderigby/quick-git | refs/heads/master | /actions.py | import messages as msg
import sys, helpers, sizzle
import commitAll
import Feature
import Remove
import Branch
import Diff
import Restore
import RestoreBack
import DoStatus
import Back
import New
# new imports start here
# settings = helpers.get_settings()
try:
action = str(sys.argv[1])
except:
action = None
args ... | {"/Branch.py": ["/messages.py", "/helpers.py"], "/helpers.py": ["/settings.py"], "/Remove.py": ["/messages.py", "/helpers.py"], "/New.py": ["/messages.py", "/helpers.py"], "/Feature.py": ["/messages.py", "/helpers.py"], "/Diff.py": ["/messages.py", "/helpers.py"], "/actions.py": ["/messages.py", "/helpers.py", "/sizzle... |
37,985,862 | jaderigby/quick-git | refs/heads/master | /DoStatus.py | import messages as msg
import helpers
settings = helpers.get_settings()
def execute():
while True:
fileList = helpers.run_command_output('git diff --name-only', False).splitlines()
untrackedListing = helpers.run_command_output('git ls-files --others --exclude-standard', False).splitlines()
... | {"/Branch.py": ["/messages.py", "/helpers.py"], "/helpers.py": ["/settings.py"], "/Remove.py": ["/messages.py", "/helpers.py"], "/New.py": ["/messages.py", "/helpers.py"], "/Feature.py": ["/messages.py", "/helpers.py"], "/Diff.py": ["/messages.py", "/helpers.py"], "/actions.py": ["/messages.py", "/helpers.py", "/sizzle... |
37,985,863 | jaderigby/quick-git | refs/heads/master | /messages.py | import helpers, json
actionList = json.loads(helpers.read_file('{}/{}'.format(helpers.path('util'), 'action-list.json')))
def statusMessage():
if len(actionList['actions']) > 0:
print("")
for item in actionList['actions']:
print('''[ {} {} ]\t\t{}'''.format(actionList['alias'], item['name'], item['description... | {"/Branch.py": ["/messages.py", "/helpers.py"], "/helpers.py": ["/settings.py"], "/Remove.py": ["/messages.py", "/helpers.py"], "/New.py": ["/messages.py", "/helpers.py"], "/Feature.py": ["/messages.py", "/helpers.py"], "/Diff.py": ["/messages.py", "/helpers.py"], "/actions.py": ["/messages.py", "/helpers.py", "/sizzle... |
37,985,864 | jaderigby/quick-git | refs/heads/master | /RestoreBack.py | import messages as msg
import helpers
# settings = helpers.get_settings()
def execute():
branch = helpers.run_command_output('git branch --show-current', False)
branch = branch.replace('\n', '')
branchOrigin = 'origin/{}'.format(branch)
filepath = helpers.user_input('File name/path to restore from las... | {"/Branch.py": ["/messages.py", "/helpers.py"], "/helpers.py": ["/settings.py"], "/Remove.py": ["/messages.py", "/helpers.py"], "/New.py": ["/messages.py", "/helpers.py"], "/Feature.py": ["/messages.py", "/helpers.py"], "/Diff.py": ["/messages.py", "/helpers.py"], "/actions.py": ["/messages.py", "/helpers.py", "/sizzle... |
37,985,865 | jaderigby/quick-git | refs/heads/master | /helpers.py | import json
from settings import settings
profilePath = settings['profile_url'] + settings['profile']
def load_profile():
import os
return json.loads(read_file(profilePath)) if os.path.exists(profilePath) else json.loads("{}")
def get_settings():
profile = load_profile()
return profile['settings'] if 'settings' ... | {"/Branch.py": ["/messages.py", "/helpers.py"], "/helpers.py": ["/settings.py"], "/Remove.py": ["/messages.py", "/helpers.py"], "/New.py": ["/messages.py", "/helpers.py"], "/Feature.py": ["/messages.py", "/helpers.py"], "/Diff.py": ["/messages.py", "/helpers.py"], "/actions.py": ["/messages.py", "/helpers.py", "/sizzle... |
37,985,866 | jaderigby/quick-git | refs/heads/master | /Branch.py | import messages as msg
import subprocess, helpers, os, re
# settings = helpers.get_settings()
def execute(ARGS):
argDict = helpers.arguments(ARGS)
out = subprocess.check_output(["git", "branch"]).decode('utf-8')
outList = out.split()
if '*' in outList: outList.remove('*')
if argDict:
if '... | {"/Branch.py": ["/messages.py", "/helpers.py"], "/helpers.py": ["/settings.py"], "/Remove.py": ["/messages.py", "/helpers.py"], "/New.py": ["/messages.py", "/helpers.py"], "/Feature.py": ["/messages.py", "/helpers.py"], "/Diff.py": ["/messages.py", "/helpers.py"], "/actions.py": ["/messages.py", "/helpers.py", "/sizzle... |
37,985,867 | jaderigby/quick-git | refs/heads/master | /commitAll.py | import messages as msg
import helpers
# settings = helpers.get_settings()
def execute():
helpers.run_command('git add -A')
helpers.run_command('git status', False)
commitMessage = helpers.user_input("Commit Message: ")
helpers.run_command('git commit -m "{}"'.format(commitMessage))
helpers.run_com... | {"/Branch.py": ["/messages.py", "/helpers.py"], "/helpers.py": ["/settings.py"], "/Remove.py": ["/messages.py", "/helpers.py"], "/New.py": ["/messages.py", "/helpers.py"], "/Feature.py": ["/messages.py", "/helpers.py"], "/Diff.py": ["/messages.py", "/helpers.py"], "/actions.py": ["/messages.py", "/helpers.py", "/sizzle... |
37,985,868 | jaderigby/quick-git | refs/heads/master | /Back.py | import messages as msg
import helpers
# settings = helpers.get_settings()
def execute():
helpers.run_command('git checkout -')
msg.done()
| {"/Branch.py": ["/messages.py", "/helpers.py"], "/helpers.py": ["/settings.py"], "/Remove.py": ["/messages.py", "/helpers.py"], "/New.py": ["/messages.py", "/helpers.py"], "/Feature.py": ["/messages.py", "/helpers.py"], "/Diff.py": ["/messages.py", "/helpers.py"], "/actions.py": ["/messages.py", "/helpers.py", "/sizzle... |
37,985,869 | jaderigby/quick-git | refs/heads/master | /Restore.py | import messages as msg
import helpers
settings = helpers.get_settings()
def execute(ARGS):
argDict = helpers.arguments(ARGS)
if argDict:
if 'path' in argDict:
filepath = argDict['path']
helpers.run_command('git restore --source origin/master -- {FILE}'.format(FILE= filepath))
... | {"/Branch.py": ["/messages.py", "/helpers.py"], "/helpers.py": ["/settings.py"], "/Remove.py": ["/messages.py", "/helpers.py"], "/New.py": ["/messages.py", "/helpers.py"], "/Feature.py": ["/messages.py", "/helpers.py"], "/Diff.py": ["/messages.py", "/helpers.py"], "/actions.py": ["/messages.py", "/helpers.py", "/sizzle... |
37,985,870 | jaderigby/quick-git | refs/heads/master | /sizzle.py | import messages as msg
import os, re, json
def do_action(ARGS):
import helpers
argDict = helpers.arguments(ARGS)
name = helpers.path('util').split('/')[-1]
fullPath = helpers.path('util')
titleString = "Action"
if argDict:
if 'args' in argDict:
if argDict['args'] == 'true':
titleString = "Action With A... | {"/Branch.py": ["/messages.py", "/helpers.py"], "/helpers.py": ["/settings.py"], "/Remove.py": ["/messages.py", "/helpers.py"], "/New.py": ["/messages.py", "/helpers.py"], "/Feature.py": ["/messages.py", "/helpers.py"], "/Diff.py": ["/messages.py", "/helpers.py"], "/actions.py": ["/messages.py", "/helpers.py", "/sizzle... |
37,985,871 | jaderigby/quick-git | refs/heads/master | /Remove.py | import messages as msg
import subprocess, helpers, re
# settings = helpers.get_settings()
def execute(ARGS):
argDict = helpers.arguments(ARGS)
# get list of local branches; filter out '*' and 'master'
localBranchList = helpers.run_command_output('git branch', False).split()
if '*' in localBranchList:... | {"/Branch.py": ["/messages.py", "/helpers.py"], "/helpers.py": ["/settings.py"], "/Remove.py": ["/messages.py", "/helpers.py"], "/New.py": ["/messages.py", "/helpers.py"], "/Feature.py": ["/messages.py", "/helpers.py"], "/Diff.py": ["/messages.py", "/helpers.py"], "/actions.py": ["/messages.py", "/helpers.py", "/sizzle... |
38,257,423 | nahidhasan007/restapi | refs/heads/main | /blood_group/urls.py | from django.urls import path
from . import views
#from blood_group.views import AddDonerView
app_name = 'blood_group'
urlpatterns = [
path('',views.index,name='index'),
path('<int:location_id>/home',views.home,name='home'),
path('search/',views.search,name='search'),
path('add_location/',views.add_location... | {"/todo/urls.py": ["/todo/views.py"], "/Article/api/urls.py": ["/Article/api/views.py"], "/api/serializers.py": ["/blood_group/models.py"], "/blood_group/views.py": ["/blood_group/models.py"], "/api/urls.py": ["/api/views.py"], "/api/views.py": ["/blood_group/models.py", "/api/serializers.py"], "/blood_group/admin.py":... |
38,257,424 | nahidhasan007/restapi | refs/heads/main | /api/serializers.py | from rest_framework import serializers
from blood_group.models import Location, Doner
class LocationSerializer(serializers.ModelSerializer):
class Meta:
model = Location
fields = ('__all__')
class DonerSerializer(serializers.ModelSerializer):
class Meta:
model = Doner
fields =... | {"/todo/urls.py": ["/todo/views.py"], "/Article/api/urls.py": ["/Article/api/views.py"], "/api/serializers.py": ["/blood_group/models.py"], "/blood_group/views.py": ["/blood_group/models.py"], "/api/urls.py": ["/api/views.py"], "/api/views.py": ["/blood_group/models.py", "/api/serializers.py"], "/blood_group/admin.py":... |
38,257,425 | nahidhasan007/restapi | refs/heads/main | /blood_group/views.py | from django.shortcuts import render, get_object_or_404
from django.http import HttpResponse
from django.urls import reverse_lazy
from . models import Location, Doner
from django.views.generic import CreateView
# Create your views here.
def index(request):
areas = Location.objects.all()
return render(request,'blood_g... | {"/todo/urls.py": ["/todo/views.py"], "/Article/api/urls.py": ["/Article/api/views.py"], "/api/serializers.py": ["/blood_group/models.py"], "/blood_group/views.py": ["/blood_group/models.py"], "/api/urls.py": ["/api/views.py"], "/api/views.py": ["/blood_group/models.py", "/api/serializers.py"], "/blood_group/admin.py":... |
38,257,426 | nahidhasan007/restapi | refs/heads/main | /api/urls.py | from django.contrib import admin
from django.urls import path
from .views import BloodAPIView
from .views import BloodCategoryAPIView
from .views import BloodDetailView
from .views import BloodNewView
urlpatterns = [
path('',BloodCategoryAPIView.as_view()),
path('blood/', BloodAPIView.as_view()),
path('b... | {"/todo/urls.py": ["/todo/views.py"], "/Article/api/urls.py": ["/Article/api/views.py"], "/api/serializers.py": ["/blood_group/models.py"], "/blood_group/views.py": ["/blood_group/models.py"], "/api/urls.py": ["/api/views.py"], "/api/views.py": ["/blood_group/models.py", "/api/serializers.py"], "/blood_group/admin.py":... |
38,257,427 | nahidhasan007/restapi | refs/heads/main | /api/views.py | from rest_framework import generics,permissions
from blood_group.models import Location, Doner
# Create your views here.
from .serializers import LocationSerializer
from .serializers import DonerSerializer
class BloodAPIView(generics.ListAPIView):
permission_classes = (permissions.IsAuthenticated,)
queryset ... | {"/todo/urls.py": ["/todo/views.py"], "/Article/api/urls.py": ["/Article/api/views.py"], "/api/serializers.py": ["/blood_group/models.py"], "/blood_group/views.py": ["/blood_group/models.py"], "/api/urls.py": ["/api/views.py"], "/api/views.py": ["/blood_group/models.py", "/api/serializers.py"], "/blood_group/admin.py":... |
38,257,428 | nahidhasan007/restapi | refs/heads/main | /blood_group/models.py | import datetime
from django.db import models
from django.utils import timezone
from django.urls import reverse, reverse_lazy
# Create your models here.
class Location(models.Model):
location_name = models.CharField(max_length=200)
def __str__(self):
return self.location_name
class Doner(models.Model):
location ... | {"/todo/urls.py": ["/todo/views.py"], "/Article/api/urls.py": ["/Article/api/views.py"], "/api/serializers.py": ["/blood_group/models.py"], "/blood_group/views.py": ["/blood_group/models.py"], "/api/urls.py": ["/api/views.py"], "/api/views.py": ["/blood_group/models.py", "/api/serializers.py"], "/blood_group/admin.py":... |
38,257,429 | nahidhasan007/restapi | refs/heads/main | /blood_group/admin.py | from django.contrib import admin
from .models import Location, Doner
# Register your models here.
admin.site.register(Location)
admin.site.register(Doner)
| {"/todo/urls.py": ["/todo/views.py"], "/Article/api/urls.py": ["/Article/api/views.py"], "/api/serializers.py": ["/blood_group/models.py"], "/blood_group/views.py": ["/blood_group/models.py"], "/api/urls.py": ["/api/views.py"], "/api/views.py": ["/blood_group/models.py", "/api/serializers.py"], "/blood_group/admin.py":... |
38,278,629 | ravi105362/projects | refs/heads/main | /project/upload_API/migrations/0001_initial.py | # Generated by Django 3.2.6 on 2021-08-24 10:23
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='BlockItems',
fields=[
('id', models.BigAuto... | {"/project/upload_API/views.py": ["/project/upload_API/models.py"], "/project/upload_API/admin.py": ["/project/upload_API/models.py"], "/project/upload_API/urls.py": ["/project/upload_API/views.py"]} |
38,278,630 | ravi105362/projects | refs/heads/main | /project/upload_API/models.py | from django.db import models
class BlockItem(models.Model):
current_block = models.PositiveIntegerField()
begin_row = models.PositiveIntegerField()
end_row = models.PositiveIntegerField()
begin_col = models.PositiveIntegerField()
end_col = models.PositiveIntegerField()
data_string = models.Cha... | {"/project/upload_API/views.py": ["/project/upload_API/models.py"], "/project/upload_API/admin.py": ["/project/upload_API/models.py"], "/project/upload_API/urls.py": ["/project/upload_API/views.py"]} |
38,278,631 | ravi105362/projects | refs/heads/main | /project/upload_API/views.py | from django.shortcuts import render
# Create your views here.
from django.views import View
from django.http import JsonResponse
from .models import BlockItem
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_exempt
import json
@method_decorator(csrf_exempt, name='disp... | {"/project/upload_API/views.py": ["/project/upload_API/models.py"], "/project/upload_API/admin.py": ["/project/upload_API/models.py"], "/project/upload_API/urls.py": ["/project/upload_API/views.py"]} |
38,278,632 | ravi105362/projects | refs/heads/main | /project/upload_API/migrations/0003_blockitem_data_string.py | # Generated by Django 3.2.6 on 2021-08-27 09:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('upload_API', '0002_auto_20210824_1100'),
]
operations = [
migrations.AddField(
model_name='blockitem',
name='data_st... | {"/project/upload_API/views.py": ["/project/upload_API/models.py"], "/project/upload_API/admin.py": ["/project/upload_API/models.py"], "/project/upload_API/urls.py": ["/project/upload_API/views.py"]} |
38,278,633 | ravi105362/projects | refs/heads/main | /project/upload_API/admin.py | from django.contrib import admin
from .models import BlockItem
admin.site.register(BlockItem) | {"/project/upload_API/views.py": ["/project/upload_API/models.py"], "/project/upload_API/admin.py": ["/project/upload_API/models.py"], "/project/upload_API/urls.py": ["/project/upload_API/views.py"]} |
38,278,634 | ravi105362/projects | refs/heads/main | /project/upload_API/urls.py | from django.urls import path
from .views import project
urlpatterns = [
path('receipts/', project.as_view()),
] | {"/project/upload_API/views.py": ["/project/upload_API/models.py"], "/project/upload_API/admin.py": ["/project/upload_API/models.py"], "/project/upload_API/urls.py": ["/project/upload_API/views.py"]} |
38,286,587 | pchech/tgbot | refs/heads/dev | /filters.py | import telebot
import io
from utils import validate_stop,prepare_stop
from PIL import Image, ImageDraw
import random
class Filter():
def __init__(self,bot):
self.bot=bot
def choose_filter(self,message):
markup = telebot.types.ReplyKeyboardMarkup(one_time_keyboard = True,resize_keyboard=True)
itembtn1 = tele... | {"/filters.py": ["/utils.py"], "/colorization.py": ["/utils.py"], "/mbotF.py": ["/mtg.py", "/utils.py", "/filters.py", "/colorization.py", "/clusterization.py"], "/clusterization.py": ["/utils.py"]} |
38,286,588 | pchech/tgbot | refs/heads/dev | /colorization.py | import telebot
import os
from utils import validate_stop,prepare_stop
import Algorithmia
class Colorizer:
def __init__(self,bot,api_key,collection_name):
self.bot=bot
self.client = Algorithmia.client(api_key)
self.collection_name = collection_name
def ask_for_image(self,message):
markup_cancel = prepare_sto... | {"/filters.py": ["/utils.py"], "/colorization.py": ["/utils.py"], "/mbotF.py": ["/mtg.py", "/utils.py", "/filters.py", "/colorization.py", "/clusterization.py"], "/clusterization.py": ["/utils.py"]} |
38,286,589 | pchech/tgbot | refs/heads/dev | /modules.py | from PIL import Image, ImageDraw #Подключим необходимые библиотеки.
import random
import Algorithmia
import posixpath
from skimage.io import imread
from skimage import img_as_float
from sklearn.cluster import KMeans
import io
import numpy as np
import scipy.misc
class Filter:
def black_white_filter(self,dir):
... | {"/filters.py": ["/utils.py"], "/colorization.py": ["/utils.py"], "/mbotF.py": ["/mtg.py", "/utils.py", "/filters.py", "/colorization.py", "/clusterization.py"], "/clusterization.py": ["/utils.py"]} |
38,286,590 | pchech/tgbot | refs/heads/dev | /utils.py | import telebot
def prepare_stop(message):
markup_cancel = telebot.types.ReplyKeyboardMarkup(one_time_keyboard=True,resize_keyboard=True)
cancel = telebot.types.KeyboardButton('Остановить')
markup_cancel.row(cancel)
return markup_cancel
def validate_stop(message,bot):
if message.text == 'Остановить':
markup =... | {"/filters.py": ["/utils.py"], "/colorization.py": ["/utils.py"], "/mbotF.py": ["/mtg.py", "/utils.py", "/filters.py", "/colorization.py", "/clusterization.py"], "/clusterization.py": ["/utils.py"]} |
38,286,591 | pchech/tgbot | refs/heads/dev | /mbotF.py | import telebot
from flask import Flask, request
import os
from mtg import MtgFinder
from utils import validate_stop
from filters import Filter
from colorization import Colorizer
from clusterization import Cluster
token = os.environ.get('TOKEN')
server = Flask(__name__)
#WEBHOOK_HOST = 'cryptic-citadel-53949.herokuapp.c... | {"/filters.py": ["/utils.py"], "/colorization.py": ["/utils.py"], "/mbotF.py": ["/mtg.py", "/utils.py", "/filters.py", "/colorization.py", "/clusterization.py"], "/clusterization.py": ["/utils.py"]} |
38,286,592 | pchech/tgbot | refs/heads/dev | /clusterization.py | import telebot
import io
import numpy as np
from utils import prepare_stop, validate_stop
from skimage.io import imread
from skimage import img_as_float
from sklearn.cluster import KMeans
import scipy.misc
class Cluster:
def __init__(self,bot):
self.bot=bot
def ask_for_image_clust(self,message):
markup_cance... | {"/filters.py": ["/utils.py"], "/colorization.py": ["/utils.py"], "/mbotF.py": ["/mtg.py", "/utils.py", "/filters.py", "/colorization.py", "/clusterization.py"], "/clusterization.py": ["/utils.py"]} |
38,286,593 | pchech/tgbot | refs/heads/dev | /mtg_price_collect.py | import json
import psycopg2
import requests
import os
from apscheduler.schedulers.blocking import BlockingScheduler
sched = BlockingScheduler()
@sched.scheduled_job('cron', day_of_week='mon-sun', hour=12, minute = 55)
def scheduled_job():
DATABASE_URL = os.environ['DATABASE_URL']
conn = psycopg2.connect(DATA... | {"/filters.py": ["/utils.py"], "/colorization.py": ["/utils.py"], "/mbotF.py": ["/mtg.py", "/utils.py", "/filters.py", "/colorization.py", "/clusterization.py"], "/clusterization.py": ["/utils.py"]} |
38,286,594 | pchech/tgbot | refs/heads/dev | /mtg.py | import requests
import json
import psycopg2
import telebot
import os
from bs4 import BeautifulSoup
class MtgFinder:
session = {}
rez = {}
c_types=['c','t','o','m','cmc','mana','is','r','e','in','f',
'color','type','oracle','edition','format','cmc','rarity']
map={'color':'c1.color',
'type':'c1.printed_type',
'o... | {"/filters.py": ["/utils.py"], "/colorization.py": ["/utils.py"], "/mbotF.py": ["/mtg.py", "/utils.py", "/filters.py", "/colorization.py", "/clusterization.py"], "/clusterization.py": ["/utils.py"]} |
38,345,465 | LekamCharity/insta-IG | refs/heads/master | /instaphotos/apps.py | from django.apps import AppConfig
class InstaphotosConfig(AppConfig):
name = 'instaphotos'
| {"/instaphotos/views.py": ["/instaphotos/models.py", "/instaphotos/forms.py"], "/instaphotos/forms.py": ["/instaphotos/models.py"]} |
38,353,251 | Kim368/Py | refs/heads/master | /factory.py | from abc import ABC, abstractmethod
class Creator(ABC):
@abstractmethod
def factory_method (self):
pass
def same_operation (self):
parser = self.factory_method()
result = parser.operation()
return result
##
class ParserCreatorPickle(Creator):
def __init__ (self, ob... | {"/test/clclclclc.py": ["/test/dfdf.py"], "/test/dfdf.py": ["/clean.py"], "/cleanUnitTest.py": ["/clean.py", "/diffTypesForTest.py"], "/console.py": ["/clean.py"], "/clean.py": ["/factory.py"]} |
38,353,252 | Kim368/Py | refs/heads/master | /cleanUnitTest.py | import unittest
from clean import *
from diffTypesForTest import *
class MyTestCase(unittest.TestCase):
def test_loads(self):
self.assertEqual('qwerty', loads(dumps('qwerty'), {}))
c = Collections()
self.assertEqual(c.list_list, loads(dumps(c.list_list), {}))
self.assertEqual(c.list... | {"/test/clclclclc.py": ["/test/dfdf.py"], "/test/dfdf.py": ["/clean.py"], "/cleanUnitTest.py": ["/clean.py", "/diffTypesForTest.py"], "/console.py": ["/clean.py"], "/clean.py": ["/factory.py"]} |
38,353,253 | Kim368/Py | refs/heads/master | /console.py | import argparse
import inspect
from abc import ABC, abstractmethod
parser = argparse.ArgumentParser(description='Convert one file to another')
parser.add_argument('fpath', type=str, help='File path')
parser.add_argument('type_of_new', type=str, help='Converted file type')
args = parser.parse_args()
print(args.fpath)
... | {"/test/clclclclc.py": ["/test/dfdf.py"], "/test/dfdf.py": ["/clean.py"], "/cleanUnitTest.py": ["/clean.py", "/diffTypesForTest.py"], "/console.py": ["/clean.py"], "/clean.py": ["/factory.py"]} |
38,353,254 | Kim368/Py | refs/heads/master | /diffTypesForTest.py | class my_class():
def __init__(self, s):
self.c = s
self.s = s+s
class my_class2():
se = 23
a = 1
b = "mfksdkfs"
d = 'hhh'
a = 1
b = "mfksdkfs"
d = 'hhh'
def aaa(self):
return 'AZAZZAZAZAZA'
def pr(self):
print('a = ', self.... | {"/test/clclclclc.py": ["/test/dfdf.py"], "/test/dfdf.py": ["/clean.py"], "/cleanUnitTest.py": ["/clean.py", "/diffTypesForTest.py"], "/console.py": ["/clean.py"], "/clean.py": ["/factory.py"]} |
38,353,255 | Kim368/Py | refs/heads/master | /clean.py | import inspect
def dump(obj, path, *args):
dumps_obj = dumps(obj)
if len(args) == 1:
import factory
dumps_obj = factory.create_serializer(args[0], dumps_obj)
if path.find('.') != -1:
path = str(path.split('.')[0]) + '.' + args[0]
# print('path ' + path)
f = ope... | {"/test/clclclclc.py": ["/test/dfdf.py"], "/test/dfdf.py": ["/clean.py"], "/cleanUnitTest.py": ["/clean.py", "/diffTypesForTest.py"], "/console.py": ["/clean.py"], "/clean.py": ["/factory.py"]} |
38,402,825 | PedroLormendez/jcclass | refs/heads/master | /jc_class/__init__.py | from .jc_class import jc_class | {"/jcclass/__init__.py": ["/jcclass/jcclass.py"], "/jcclass/jcclass.py": ["/jcclass/__init__.py"], "/jcclass/JC_classification.py": ["/jcclass/__init__.py"], "/jcclass/CTs_plots.py": ["/jcclass/__init__.py"]} |
38,417,404 | Drashkar/openpilot | refs/heads/xps_pro | /selfdrive/car/chrysler/chryslerlonghelper.py | from selfdrive.config import Conversions as CV
from common.numpy_fast import clip
from numpy import interp
SET_SPEED_MIN = 5 * CV.MPH_TO_MS
SET_SPEED_MAX = 120 * CV.MPH_TO_MS
LONG_PRESS_TIME = 50 # 500msec
SHORT_PRESS_STEP = 1
LONG_PRESS_STEP = 5
# Accel Hard limits
ACCEL_HYST_GAP = 0.0 # don't change accel command ... | {"/selfdrive/car/chrysler/carstate.py": ["/selfdrive/car/chrysler/chryslerlonghelper.py"], "/selfdrive/car/chrysler/carcontroller.py": ["/selfdrive/car/chrysler/chryslercan.py", "/selfdrive/car/chrysler/chryslerlonghelper.py"]} |
38,420,845 | yeboahd24/python202 | refs/heads/main | /Event Driven/asyncioQueue.py | #!usr/bin/env/python3
import asyncio
import random
import time
@asyncio.coroutine
def newsProducer(myQueue):
while True:
yield from myQueue.put(random.randint(1,5))
yield from asyncio.sleep(1)
@asyncio.coroutine
def newsConsumer(myQueue):
while True:
articleId = yield from myQu... | {"/apps/product/admin.py": ["/apps/product/models.py"], "/apps/product/models.py": ["/apps/vendor/models.py"], "/apps/vendor/admin.py": ["/apps/vendor/models.py"], "/apps/order/models.py": ["/apps/product/models.py", "/apps/vendor/models.py"], "/apps/vendor/views.py": ["/apps/vendor/models.py", "/apps/product/models.py... |
38,420,846 | yeboahd24/python202 | refs/heads/main | /Event Driven/cancelTask.py | #!usr/bin/env/python3
import asyncio
async def myCoroutine():
print("My Coroutine")
async def main():
current = asyncio.current_task()
print(current)
loop = asyncio.get_event_loop()
try:
task1 = loop.create_task(myCoroutine())
task2 = loop.create_task(myCoroutine())
task3 = loop.create_task(m... | {"/apps/product/admin.py": ["/apps/product/models.py"], "/apps/product/models.py": ["/apps/vendor/models.py"], "/apps/vendor/admin.py": ["/apps/vendor/models.py"], "/apps/order/models.py": ["/apps/product/models.py", "/apps/vendor/models.py"], "/apps/vendor/views.py": ["/apps/vendor/models.py", "/apps/product/models.py... |
38,420,847 | yeboahd24/python202 | refs/heads/main | /Design Pattern/document.py | #!usr/bin/env/python3
class Document:
def __init__(self):
self.characters = []
self.cursor = 0
self.filename = ''
def insert(self, character):
self.characters.insert(self.cursor, character)
self.cursor += 1
def delete(self):
del self.characters[self.cursor]
def save(self):
with o... | {"/apps/product/admin.py": ["/apps/product/models.py"], "/apps/product/models.py": ["/apps/vendor/models.py"], "/apps/vendor/admin.py": ["/apps/vendor/models.py"], "/apps/order/models.py": ["/apps/product/models.py", "/apps/vendor/models.py"], "/apps/vendor/views.py": ["/apps/vendor/models.py", "/apps/product/models.py... |
38,420,848 | yeboahd24/python202 | refs/heads/main | /Design Pattern/scrape_test.py | from concurrent.futures import ThreadPoolExecutor
import threading
import time
import requests
state = threading.Lock()
def get_google(base_url):
state.acquire()
return requests.get(base_url)
time.sleep(.2)
state.release()
def get_python(base_url):
state.acquire()
return requests.get(base_url)
t... | {"/apps/product/admin.py": ["/apps/product/models.py"], "/apps/product/models.py": ["/apps/vendor/models.py"], "/apps/vendor/admin.py": ["/apps/vendor/models.py"], "/apps/order/models.py": ["/apps/product/models.py", "/apps/vendor/models.py"], "/apps/vendor/views.py": ["/apps/vendor/models.py", "/apps/product/models.py... |
38,420,849 | yeboahd24/python202 | refs/heads/main | /python etc_2/callableObject.py | #!usr/bin/env/python3
from typing import Callable
IntExp = Callable[[int, int], int] # this means two integer values that returns an integer value
class Power1:
def __call__(self, x: int, n: int) -> int:
p = 1
for i in range(n):
p *= x
return p
pow1: IntExp = Power1()
# print(pow1(2, 0))
... | {"/apps/product/admin.py": ["/apps/product/models.py"], "/apps/product/models.py": ["/apps/vendor/models.py"], "/apps/vendor/admin.py": ["/apps/vendor/models.py"], "/apps/order/models.py": ["/apps/product/models.py", "/apps/vendor/models.py"], "/apps/vendor/views.py": ["/apps/vendor/models.py", "/apps/product/models.py... |
38,420,850 | yeboahd24/python202 | refs/heads/main | /python_etc_3/factorial_with_operator.py | #!usr/bin/env/python3
from functools import reduce
from operator import mul
def fact(n):
return reduce(mul, range(1, n+1))
print(fact(5))
#without functional programming
def fact_1(n):
if n < 2:
return n
return n * fact(n-1)
print(fact_1(5))
| {"/apps/product/admin.py": ["/apps/product/models.py"], "/apps/product/models.py": ["/apps/vendor/models.py"], "/apps/vendor/admin.py": ["/apps/vendor/models.py"], "/apps/order/models.py": ["/apps/product/models.py", "/apps/vendor/models.py"], "/apps/vendor/views.py": ["/apps/vendor/models.py", "/apps/product/models.py... |
38,420,851 | yeboahd24/python202 | refs/heads/main | /python_etc_5/advance_email_demo.py | #!usr/bin/env/python3
import smtplib, ssl
import os
from email.message import EmailMessage
import credentials
# EMAIL_ADDRESS = os.environ.get('EMAIL_USER')
# EMAIL_PASSWORD = os.environ.get('EMAIL_PASS')
# HOST = 'smtp.gmail.com'
# PORT = 587
# context=ssl.create_default_context()
# msg = EmailMessage(... | {"/apps/product/admin.py": ["/apps/product/models.py"], "/apps/product/models.py": ["/apps/vendor/models.py"], "/apps/vendor/admin.py": ["/apps/vendor/models.py"], "/apps/order/models.py": ["/apps/product/models.py", "/apps/vendor/models.py"], "/apps/vendor/views.py": ["/apps/vendor/models.py", "/apps/product/models.py... |
38,420,852 | yeboahd24/python202 | refs/heads/main | /Design Pattern/using_function_as_attr.py | #!usr/bin/env/python3
#Bad way
class A:
CALLBACK = lambda x: x * 2
# print(A.CALLBACK(3)) # works
call = A()
# print(call.CALLBACK(4)) # WRONG
# God Way
class FunctionHolder:
def __init__(self, f):
self._f = f
def __get__(self, x, y):
return self._f
class A:
CALLBACK = Function... | {"/apps/product/admin.py": ["/apps/product/models.py"], "/apps/product/models.py": ["/apps/vendor/models.py"], "/apps/vendor/admin.py": ["/apps/vendor/models.py"], "/apps/order/models.py": ["/apps/product/models.py", "/apps/vendor/models.py"], "/apps/vendor/views.py": ["/apps/vendor/models.py", "/apps/product/models.py... |
38,420,853 | yeboahd24/python202 | refs/heads/main | /python_etc_3/sorting_object.py | #!usr/bin/env/python3
#Sorting object of the same class
class User(object):
def __init__(self, user_id):
self.user_id = user_id
def __repr__(self):
return 'User({})'.format(self.user_id)
users = [User(23), User(3), User(99)]
print(users) #[User(23), User(3), User(99)]
print(sorted(users, ke... | {"/apps/product/admin.py": ["/apps/product/models.py"], "/apps/product/models.py": ["/apps/vendor/models.py"], "/apps/vendor/admin.py": ["/apps/vendor/models.py"], "/apps/order/models.py": ["/apps/product/models.py", "/apps/vendor/models.py"], "/apps/vendor/views.py": ["/apps/vendor/models.py", "/apps/product/models.py... |
38,420,854 | yeboahd24/python202 | refs/heads/main | /python etc_2/getattrMethod.py | #!usr/bin/env/python3
class RTD_Solver:
def __init__(
self, *,
rate: float = None,
time: float = None,
distance: float = None) -> None:
if rate:
self.rate = rate
if time:
self.time = time
if distance:
self.distance = distance
def __getattr__(self, name: str) -> float:
if... | {"/apps/product/admin.py": ["/apps/product/models.py"], "/apps/product/models.py": ["/apps/vendor/models.py"], "/apps/vendor/admin.py": ["/apps/vendor/models.py"], "/apps/order/models.py": ["/apps/product/models.py", "/apps/vendor/models.py"], "/apps/vendor/views.py": ["/apps/vendor/models.py", "/apps/product/models.py... |
38,420,855 | yeboahd24/python202 | refs/heads/main | /Event Driven/future.py | #!usr/bin/env/python3
import asyncio
async def myFuture(future):
await asyncio.sleep(1)
future.set_result("My Future Has Completed")
async def main():
future = asyncio.Future()
await asyncio.ensure_future(myFuture(future))
print(future.result())
loop = asyncio.get_event_loop()
try:
loop.r... | {"/apps/product/admin.py": ["/apps/product/models.py"], "/apps/product/models.py": ["/apps/vendor/models.py"], "/apps/vendor/admin.py": ["/apps/vendor/models.py"], "/apps/order/models.py": ["/apps/product/models.py", "/apps/vendor/models.py"], "/apps/vendor/views.py": ["/apps/vendor/models.py", "/apps/product/models.py... |
38,420,856 | yeboahd24/python202 | refs/heads/main | /Design Pattern/sub1/server.py | #!usr/bin/env/python3
#The decorator pattern allows us to "wrap" an object that provides core functionality
#with other objects that alter this functionality.
#There are two primary uses of the decorator pattern:
#• Enhancing the response of a component as it sends data to a second component
#• Supporting ... | {"/apps/product/admin.py": ["/apps/product/models.py"], "/apps/product/models.py": ["/apps/vendor/models.py"], "/apps/vendor/admin.py": ["/apps/vendor/models.py"], "/apps/order/models.py": ["/apps/product/models.py", "/apps/vendor/models.py"], "/apps/vendor/views.py": ["/apps/vendor/models.py", "/apps/product/models.py... |
38,420,857 | yeboahd24/python202 | refs/heads/main | /Event Driven/debugAsyncio.py | #!usr/bin/env/python3
import asyncio
import logging
import time
logging.basicConfig(level=logging.DEBUG)
async def myWorker():
logging.info("My Worker Coroutine Hit")
time.sleep(1)
async def main():
logging.debug("My Main Function Hit")
await asyncio.wait([myWorker()]) # without this the log... | {"/apps/product/admin.py": ["/apps/product/models.py"], "/apps/product/models.py": ["/apps/vendor/models.py"], "/apps/vendor/admin.py": ["/apps/vendor/models.py"], "/apps/order/models.py": ["/apps/product/models.py", "/apps/vendor/models.py"], "/apps/vendor/views.py": ["/apps/vendor/models.py", "/apps/product/models.py... |
38,420,858 | yeboahd24/python202 | refs/heads/main | /Concurrent/terminatingProcess.py | #!usr/bin/env/python3
import multiprocessing
import time
def daemonProcess():
current_process = multiprocessing.current_process()
print("Child Process PID: {}".format(current_process.pid))
time.sleep(20)
current_process = multiprocessing.current_process()
print("Main process PID: {}".format(curre... | {"/apps/product/admin.py": ["/apps/product/models.py"], "/apps/product/models.py": ["/apps/vendor/models.py"], "/apps/vendor/admin.py": ["/apps/vendor/models.py"], "/apps/order/models.py": ["/apps/product/models.py", "/apps/vendor/models.py"], "/apps/vendor/views.py": ["/apps/vendor/models.py", "/apps/product/models.py... |
38,420,859 | yeboahd24/python202 | refs/heads/main | /python etc_2/PartialFunc.py | #!usr/bin/env/python3
# A prtial function is a generalization of a mathematical function in a way that isn't forced to map
# every possible input value (domain) to its results.
from functools import partial
from itertools import count
power_of_2 = partial(pow, 2)
print(power_of_2(4))
infinite_powers... | {"/apps/product/admin.py": ["/apps/product/models.py"], "/apps/product/models.py": ["/apps/vendor/models.py"], "/apps/vendor/admin.py": ["/apps/vendor/models.py"], "/apps/order/models.py": ["/apps/product/models.py", "/apps/vendor/models.py"], "/apps/vendor/views.py": ["/apps/vendor/models.py", "/apps/product/models.py... |
38,420,860 | yeboahd24/python202 | refs/heads/main | /python_etc_4/test.py | #!usr/bin/env/python3
# with open('sample.txt') as f:
# fp = f.read()
# print(f.closed) # True, becuase the with close the file automatically
# print(f.read()) # try to read it again raises an error because the file is
# already closed
# data = list()
# for i in range(11):
# user = int(input('Int... | {"/apps/product/admin.py": ["/apps/product/models.py"], "/apps/product/models.py": ["/apps/vendor/models.py"], "/apps/vendor/admin.py": ["/apps/vendor/models.py"], "/apps/order/models.py": ["/apps/product/models.py", "/apps/vendor/models.py"], "/apps/vendor/views.py": ["/apps/vendor/models.py", "/apps/product/models.py... |
38,420,861 | yeboahd24/python202 | refs/heads/main | /python_etc_5/credentials.py | #!usr/bin/env/python3
import os
os.environ["EMAIL_USER"] = "yeboahd24@gmail.com"
os.environ["EMAIL_PASS"] = "maryyeboah70"
| {"/apps/product/admin.py": ["/apps/product/models.py"], "/apps/product/models.py": ["/apps/vendor/models.py"], "/apps/vendor/admin.py": ["/apps/vendor/models.py"], "/apps/order/models.py": ["/apps/product/models.py", "/apps/vendor/models.py"], "/apps/vendor/views.py": ["/apps/vendor/models.py", "/apps/product/models.py... |
38,420,862 | yeboahd24/python202 | refs/heads/main | /python_etc_4/coroutine.py | #!usr//bin/env/python3
def simple_coroutine(): #
print('-> coroutine started')
x = yield # to recive data from the client
print('-> coroutine received:', x)
my_coro = simple_coroutine()
print(my_coro) # coroutine/generator
print(next(my_coro)) # starting coroutine
print(my_coro.send(42)) # coroutine r... | {"/apps/product/admin.py": ["/apps/product/models.py"], "/apps/product/models.py": ["/apps/vendor/models.py"], "/apps/vendor/admin.py": ["/apps/vendor/models.py"], "/apps/order/models.py": ["/apps/product/models.py", "/apps/vendor/models.py"], "/apps/vendor/views.py": ["/apps/vendor/models.py", "/apps/product/models.py... |
38,420,863 | yeboahd24/python202 | refs/heads/main | /16-sqlite.py | # -*- coding: utf-8 -*-
"""
> sqlite3 phonebook.db
sqlite> create table contacts
(
id integer primary key autoincrement,
name string not null,
number string not null
);
"""
import sqlite3
from simpletk import *
def execSQL ( query, p... | {"/apps/product/admin.py": ["/apps/product/models.py"], "/apps/product/models.py": ["/apps/vendor/models.py"], "/apps/vendor/admin.py": ["/apps/vendor/models.py"], "/apps/order/models.py": ["/apps/product/models.py", "/apps/vendor/models.py"], "/apps/vendor/views.py": ["/apps/vendor/models.py", "/apps/product/models.py... |
38,420,864 | yeboahd24/python202 | refs/heads/main | /python etc_2/user_dict.py | #!usr/bin/env/python3
from collections import UserDict
class DistinctError(ValueError):
"""Raised when duplicate value is added to a distinctdict."""
class distinctdict(UserDict):
"""Dictionary that does not accept duplicate values."""
def __setitem__(self, key, value):
if value in self.values():
... | {"/apps/product/admin.py": ["/apps/product/models.py"], "/apps/product/models.py": ["/apps/vendor/models.py"], "/apps/vendor/admin.py": ["/apps/vendor/models.py"], "/apps/order/models.py": ["/apps/product/models.py", "/apps/vendor/models.py"], "/apps/vendor/views.py": ["/apps/vendor/models.py", "/apps/product/models.py... |
38,420,865 | yeboahd24/python202 | refs/heads/main | /python_etc_5/super_function.py | #!usr/bin/env/python3
#This kind of method leads to error
class Base:
def __init__(self):
print('Base.__init__')
class A(Base):
def __init__(self):
Base.__init__(self)
print('A.__init__')
class B(Base):
def __init__(self):
Base.__init__(self)
print('B.__init__')
class C(A,B):
def __ini... | {"/apps/product/admin.py": ["/apps/product/models.py"], "/apps/product/models.py": ["/apps/vendor/models.py"], "/apps/vendor/admin.py": ["/apps/vendor/models.py"], "/apps/order/models.py": ["/apps/product/models.py", "/apps/vendor/models.py"], "/apps/vendor/views.py": ["/apps/vendor/models.py", "/apps/product/models.py... |
38,420,866 | yeboahd24/python202 | refs/heads/main | /Concurrent/ThreadVsProcess.py | #!usr/bin/env/python3
# Threads Vs Process
import threading
from multiprocessing import Process
import time
import os
def MyThread():
time.sleep(2)
t0 = time.time()
threads = []
for i in range(10):
thread = threading.Thread(target=MyThread)
thread.start()
threads.append(thread)
t1 = time.t... | {"/apps/product/admin.py": ["/apps/product/models.py"], "/apps/product/models.py": ["/apps/vendor/models.py"], "/apps/vendor/admin.py": ["/apps/vendor/models.py"], "/apps/order/models.py": ["/apps/product/models.py", "/apps/vendor/models.py"], "/apps/vendor/views.py": ["/apps/vendor/models.py", "/apps/product/models.py... |
38,420,867 | yeboahd24/python202 | refs/heads/main | /python_etc_3/tombolist.py | #!usr/bin/env/python3
from abstract import Tombola
@Tombola.register # virtual class of Tombola
class TomboList(list):
def pick(self):
if self: #
position = randrange(len(self))
return self.pop(position) #
else:
raise LookupError('pop from empty TomboList')
load = list.extend
def lo... | {"/apps/product/admin.py": ["/apps/product/models.py"], "/apps/product/models.py": ["/apps/vendor/models.py"], "/apps/vendor/admin.py": ["/apps/vendor/models.py"], "/apps/order/models.py": ["/apps/product/models.py", "/apps/vendor/models.py"], "/apps/vendor/views.py": ["/apps/vendor/models.py", "/apps/product/models.py... |
38,420,868 | yeboahd24/python202 | refs/heads/main | /concurrent1/IObottleneck.py | #!usr/bin/env/python3
import requests
""" I/O bottlenecks, or I/O bottlenecks for short, are bottlenecks where your computer spends
more time waiting on various inputs and outputs than it does on processing the
information."""
import urllib.request
import time
# t0 = time.time()
# req = urllib.request.u... | {"/apps/product/admin.py": ["/apps/product/models.py"], "/apps/product/models.py": ["/apps/vendor/models.py"], "/apps/vendor/admin.py": ["/apps/vendor/models.py"], "/apps/order/models.py": ["/apps/product/models.py", "/apps/vendor/models.py"], "/apps/vendor/views.py": ["/apps/vendor/models.py", "/apps/product/models.py... |
38,420,869 | yeboahd24/python202 | refs/heads/main | /Design Pattern/sub1/coroutine.py | #!usr/bin/env/python3
def tally():
score = 0
while True:
increment = yield score # coroutine
score+=increment
# first = tally()
# print(next(first)) # 0
# first.send(1)
# print(next(first))
def generator2():
for i in range(10):
yield i
def generator3():
for j in r... | {"/apps/product/admin.py": ["/apps/product/models.py"], "/apps/product/models.py": ["/apps/vendor/models.py"], "/apps/vendor/admin.py": ["/apps/vendor/models.py"], "/apps/order/models.py": ["/apps/product/models.py", "/apps/vendor/models.py"], "/apps/vendor/views.py": ["/apps/vendor/models.py", "/apps/product/models.py... |
38,420,870 | yeboahd24/python202 | refs/heads/main | /python etc_2/namedTuple.py | #!usr/bin/env/python3
from typing import NamedTuple, List, Optional
class Monty(NamedTuple):
name: str
age: int
def get_name(self):
pass
class Python(Monty):
sch: str # this will not work because we can't add another attribute but we can overide methods
def get_name(self):
pass
p = Pyth... | {"/apps/product/admin.py": ["/apps/product/models.py"], "/apps/product/models.py": ["/apps/vendor/models.py"], "/apps/vendor/admin.py": ["/apps/vendor/models.py"], "/apps/order/models.py": ["/apps/product/models.py", "/apps/vendor/models.py"], "/apps/vendor/views.py": ["/apps/vendor/models.py", "/apps/product/models.py... |
38,420,871 | yeboahd24/python202 | refs/heads/main | /python etc_2/user_list.py | #!usr/bin/env/python3
from collections import UserList
class Folder(UserList):
def __init__(self, name):
self.name = name
def dir(self, nesting=0):
offset = " " * nesting
print('%s%s/' % (offset, self.name))
for element in self:
if hasattr(element, 'dir'):
element.dir(nesting + 1)
... | {"/apps/product/admin.py": ["/apps/product/models.py"], "/apps/product/models.py": ["/apps/vendor/models.py"], "/apps/vendor/admin.py": ["/apps/vendor/models.py"], "/apps/order/models.py": ["/apps/product/models.py", "/apps/vendor/models.py"], "/apps/vendor/views.py": ["/apps/vendor/models.py", "/apps/product/models.py... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.