index
int64
repo_name
string
branch_name
string
path
string
content
string
import_graph
string
58,105
klgentle/lc_python
refs/heads/master
/leet_code/easy_case/longestCommonPrefix_answ.py
class Solution: def longestCommonPrefix(self, strs: "List[str]") -> "str": if len(strs) == 0: return "" if len(strs) == 1: return strs[0] prefix, chars = "", zip(*strs) print("zip(*strs):", chars) print("enumerate(chars):", enumerate(chars)) f...
{"/tests/testCreateWeekReport.py": ["/automatic_office/CreateWeekReport.py"], "/tests/re_test.py": ["/database/Procedure.py"], "/tests/test_procedure.py": ["/database/Procedure.py"], "/tests/test_proc_log_modify.py": ["/database/ProcedureLogModify.py"], "/database/batch_replace.py": ["/database/ProcedureLogModify.py", ...
58,106
klgentle/lc_python
refs/heads/master
/leet_code/A_LeetCode_Grinding_Guide/Greedy/P0455_Assign_Cookies.py
""" 455. Assign Cookies Easy Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a greed factor g[i], which is the minimum size of a cookie that the child will be content with; and each cookie j has a size s[j]. If s[j] >= ...
{"/tests/testCreateWeekReport.py": ["/automatic_office/CreateWeekReport.py"], "/tests/re_test.py": ["/database/Procedure.py"], "/tests/test_procedure.py": ["/database/Procedure.py"], "/tests/test_proc_log_modify.py": ["/database/ProcedureLogModify.py"], "/database/batch_replace.py": ["/database/ProcedureLogModify.py", ...
58,107
klgentle/lc_python
refs/heads/master
/base_practice/RenameFileAndContent.py
import os import sys class RenameFileAndContent(object): def __init__(self, from_pattern, to_pattern, file_path): self.__from_pattern = from_pattern self.__to_pattern = to_pattern self.__file_path = file_path def getNewFilename(self, filename: str) -> str: return filename.repl...
{"/tests/testCreateWeekReport.py": ["/automatic_office/CreateWeekReport.py"], "/tests/re_test.py": ["/database/Procedure.py"], "/tests/test_procedure.py": ["/database/Procedure.py"], "/tests/test_proc_log_modify.py": ["/database/ProcedureLogModify.py"], "/database/batch_replace.py": ["/database/ProcedureLogModify.py", ...
58,108
klgentle/lc_python
refs/heads/master
/leet_code/labuladong/tree/P0098_Validate_Binary_Search_Tree.py
""" Given the root of a binary tree, determine if it is a valid binary search tree (BST). A valid BST is defined as follows: The left subtree of a node contains only nodes with keys less than the node's key. The right subtree of a node contains only nodes with keys greater than the node's key. Both the le...
{"/tests/testCreateWeekReport.py": ["/automatic_office/CreateWeekReport.py"], "/tests/re_test.py": ["/database/Procedure.py"], "/tests/test_procedure.py": ["/database/Procedure.py"], "/tests/test_proc_log_modify.py": ["/database/ProcedureLogModify.py"], "/database/batch_replace.py": ["/database/ProcedureLogModify.py", ...
58,109
klgentle/lc_python
refs/heads/master
/vs_code/copy_excel.py
import shutil, os import openpyxl class CopyExcel(object): def __init__(self): self.from_path = "/mnt/e/yx_walk/report_develop/report_dept" self.from_file = "ods_reports_out.xlsx" self.to_file = "ods_reports_out.xlsx" #self.sheet_name = sheet_name def readData(self): w...
{"/tests/testCreateWeekReport.py": ["/automatic_office/CreateWeekReport.py"], "/tests/re_test.py": ["/database/Procedure.py"], "/tests/test_procedure.py": ["/database/Procedure.py"], "/tests/test_proc_log_modify.py": ["/database/ProcedureLogModify.py"], "/database/batch_replace.py": ["/database/ProcedureLogModify.py", ...
58,110
klgentle/lc_python
refs/heads/master
/base_practice/year.py
modelYear = 1998 if ((modelYear >= 1995 and modelYear <= 1998) or (modelYear >=2004 and modelYear<=2006)): #System.out.println("RECALL") print(True) else: print(False) print((modelYear >= 1995 and modelYear <= 1998) or (modelYear >=2004 and modelYear<=2006))
{"/tests/testCreateWeekReport.py": ["/automatic_office/CreateWeekReport.py"], "/tests/re_test.py": ["/database/Procedure.py"], "/tests/test_procedure.py": ["/database/Procedure.py"], "/tests/test_proc_log_modify.py": ["/database/ProcedureLogModify.py"], "/database/batch_replace.py": ["/database/ProcedureLogModify.py", ...
58,111
klgentle/lc_python
refs/heads/master
/shell_test/send_table_mail/server3.py
import sqlite3 from flask import Flask, request def save_data(site_name): # 若不存在则创建 con = sqlite3.connect("ifrs9.db") # 游标对象 cur = con.cursor() # 新建表 cur.execute( "create table if not exists ifrs9_data \ (site_name text primary key not null, data text)" ) cur.execute( ...
{"/tests/testCreateWeekReport.py": ["/automatic_office/CreateWeekReport.py"], "/tests/re_test.py": ["/database/Procedure.py"], "/tests/test_procedure.py": ["/database/Procedure.py"], "/tests/test_proc_log_modify.py": ["/database/ProcedureLogModify.py"], "/database/batch_replace.py": ["/database/ProcedureLogModify.py", ...
58,112
klgentle/lc_python
refs/heads/master
/vs_code/spiralDraw.py
import pyautogui, time time.sleep(5) pyautogui.click() # click to put drawing program in focus distance = 200 while distance > 0: pyautogui.dragRel(distance, 0, duration=0.2) # move right distance = distance - 5 pyautogui.dragRel(0,distance,duration=0.2) # move down pyautogui.dragRel(-distance,0,durati...
{"/tests/testCreateWeekReport.py": ["/automatic_office/CreateWeekReport.py"], "/tests/re_test.py": ["/database/Procedure.py"], "/tests/test_procedure.py": ["/database/Procedure.py"], "/tests/test_proc_log_modify.py": ["/database/ProcedureLogModify.py"], "/database/batch_replace.py": ["/database/ProcedureLogModify.py", ...
58,113
klgentle/lc_python
refs/heads/master
/stock_pandas/lab_5_adv.py
import pandas as pd loan = pd.read_csv("loan.csv") keepgoing = "Y" while keepgoing == "Y": variable = input("Enter variable:") comparison = input("Enter comparison >,<,= : ") value = input("Enter value of cutoff:") # value format if value.isdigit(): value = int(value) if comparison == "...
{"/tests/testCreateWeekReport.py": ["/automatic_office/CreateWeekReport.py"], "/tests/re_test.py": ["/database/Procedure.py"], "/tests/test_procedure.py": ["/database/Procedure.py"], "/tests/test_proc_log_modify.py": ["/database/ProcedureLogModify.py"], "/database/batch_replace.py": ["/database/ProcedureLogModify.py", ...
58,114
klgentle/lc_python
refs/heads/master
/tests/__init__.py
import os import sys from os.path import dirname # 项目根目录 BASE_DIR = dirname(dirname(os.path.abspath(__file__))) # 添加系统环境变量 sys.path.append(BASE_DIR)
{"/tests/testCreateWeekReport.py": ["/automatic_office/CreateWeekReport.py"], "/tests/re_test.py": ["/database/Procedure.py"], "/tests/test_procedure.py": ["/database/Procedure.py"], "/tests/test_proc_log_modify.py": ["/database/ProcedureLogModify.py"], "/database/batch_replace.py": ["/database/ProcedureLogModify.py", ...
58,115
klgentle/lc_python
refs/heads/master
/encode/decrypt.py
from Crypto.Cipher import DES key = b'abcdefgh' # 密钥 8位或16位,必须为bytes def get_passwd(): des = DES.new(key, DES.MODE_ECB) # 创建一个DES实例 f = open("pactera_passwd_encrpt.txt","rb") # str 转二进制通过encode() encrypted_text = f.read() #encrypted_text = "" # rstrip(' ')返回从字符串末尾删除所有字符串的字符串(默认空白字符)的副本 s...
{"/tests/testCreateWeekReport.py": ["/automatic_office/CreateWeekReport.py"], "/tests/re_test.py": ["/database/Procedure.py"], "/tests/test_procedure.py": ["/database/Procedure.py"], "/tests/test_proc_log_modify.py": ["/database/ProcedureLogModify.py"], "/database/batch_replace.py": ["/database/ProcedureLogModify.py", ...
58,116
klgentle/lc_python
refs/heads/master
/leet_code/top_interview_questions/Medium_Case/P0036_Valid_Sudoku.py
class Solution: @staticmethod def isValidSudokuRow(grid) -> bool: for lst in grid: data = [i for i in lst if i != '.'] # check duplicate if len(data) != len(set(data)): return False return True def isValidSudoku(self, board: List[List[...
{"/tests/testCreateWeekReport.py": ["/automatic_office/CreateWeekReport.py"], "/tests/re_test.py": ["/database/Procedure.py"], "/tests/test_procedure.py": ["/database/Procedure.py"], "/tests/test_proc_log_modify.py": ["/database/ProcedureLogModify.py"], "/database/batch_replace.py": ["/database/ProcedureLogModify.py", ...
58,117
klgentle/lc_python
refs/heads/master
/leet_code/medium_case/p537_Complex_Number_Multiplication.py
class Solution: def complexNumberMultiply(self, a: str, b: str) -> str: # display complex as a list t, t[0] is the real, t[1] is imaginary """ (at[0] + at[1]*i) * (bt[0] + bt[1]*i) = at[0]*bt[0] + at[0]*bt[1]*i + at[1]*i*bt[0] - at[1]*bt[1] = at[0]*bt[0] - at[1]*bt[1] + (at[...
{"/tests/testCreateWeekReport.py": ["/automatic_office/CreateWeekReport.py"], "/tests/re_test.py": ["/database/Procedure.py"], "/tests/test_procedure.py": ["/database/Procedure.py"], "/tests/test_proc_log_modify.py": ["/database/ProcedureLogModify.py"], "/database/batch_replace.py": ["/database/ProcedureLogModify.py", ...
58,118
klgentle/lc_python
refs/heads/master
/wechat/VisitRecord.py
class VisitRecord: """旅游记录 """ def __init__(self, first_name, last_name, phone_number, date_visited): self.first_name = first_name self.last_name = last_name self.phone_number = phone_number self.date_visited = date_visited def __hash__(self): return hash((self.firs...
{"/tests/testCreateWeekReport.py": ["/automatic_office/CreateWeekReport.py"], "/tests/re_test.py": ["/database/Procedure.py"], "/tests/test_procedure.py": ["/database/Procedure.py"], "/tests/test_proc_log_modify.py": ["/database/ProcedureLogModify.py"], "/database/batch_replace.py": ["/database/ProcedureLogModify.py", ...
58,119
klgentle/lc_python
refs/heads/master
/app_spider/Red_Wars.py
#!/usr/bin/env python # encoding: utf-8 """ @version: v1.0 @author: xag @license: Apache Licence @contact: xinganguo@gmail.com @site: http://www.xingag.top @software: PyCharm @file: Red_Wars.py @time: 2/5/19 09:59 @description:抢红包 """ # -*- encoding=utf8 -*- __author__ = "xingag" from airtest.core.api ...
{"/tests/testCreateWeekReport.py": ["/automatic_office/CreateWeekReport.py"], "/tests/re_test.py": ["/database/Procedure.py"], "/tests/test_procedure.py": ["/database/Procedure.py"], "/tests/test_proc_log_modify.py": ["/database/ProcedureLogModify.py"], "/database/batch_replace.py": ["/database/ProcedureLogModify.py", ...
58,120
klgentle/lc_python
refs/heads/master
/Intermediate_Python/myclass__slots__.py
class MyClass(object): __slots__ = ['name', 'identifier'] def __init__(self, name, identifier): self.name = name self.identifier = identifier # self.set_up() ... if __name__ == "__main__": #a = MyClass("Cqy","<F7>7890-") #print(a.name) num = 1024*256 x = [MyClass(1,1) fo...
{"/tests/testCreateWeekReport.py": ["/automatic_office/CreateWeekReport.py"], "/tests/re_test.py": ["/database/Procedure.py"], "/tests/test_procedure.py": ["/database/Procedure.py"], "/tests/test_proc_log_modify.py": ["/database/ProcedureLogModify.py"], "/database/batch_replace.py": ["/database/ProcedureLogModify.py", ...
58,121
klgentle/lc_python
refs/heads/master
/leet_code/labuladong/tree/p0988_Smallest_String_Starting_From_Leaf.py
""" 988. Smallest String Starting From Leaf Medium Given the root of a binary tree, each node has a value from 0 to 25 representing the letters 'a' to 'z': a value of 0 represents 'a', a value of 1 represents 'b', and so on. Find the lexicographically smallest string that starts at a leaf of this tree and ends at the...
{"/tests/testCreateWeekReport.py": ["/automatic_office/CreateWeekReport.py"], "/tests/re_test.py": ["/database/Procedure.py"], "/tests/test_procedure.py": ["/database/Procedure.py"], "/tests/test_proc_log_modify.py": ["/database/ProcedureLogModify.py"], "/database/batch_replace.py": ["/database/ProcedureLogModify.py", ...
58,122
klgentle/lc_python
refs/heads/master
/leet_code/labuladong/sliding_window/p0438_Find_All_Anagrams_in_a_String.py
""" 438. Find All Anagrams in a String Medium Given a string s and a non-empty string p, find all the start indices of p's anagrams in s. Strings consists of lowercase English letters only and the length of both strings s and p will not be larger than 20,100. The order of output does not matter. Example 1: Input: ...
{"/tests/testCreateWeekReport.py": ["/automatic_office/CreateWeekReport.py"], "/tests/re_test.py": ["/database/Procedure.py"], "/tests/test_procedure.py": ["/database/Procedure.py"], "/tests/test_proc_log_modify.py": ["/database/ProcedureLogModify.py"], "/database/batch_replace.py": ["/database/ProcedureLogModify.py", ...
58,123
klgentle/lc_python
refs/heads/master
/leet_code/easy_case/removeDuplicates.py
class Solution: def removeAll(self, nums, a): times = nums.count(a) while times > 1: nums.remove(a) times -= 1 def removeDuplicates(self, nums): i = 0 while i < len(nums) - 1: a = nums[i] if nums[i] == nums[i + 1]: ...
{"/tests/testCreateWeekReport.py": ["/automatic_office/CreateWeekReport.py"], "/tests/re_test.py": ["/database/Procedure.py"], "/tests/test_procedure.py": ["/database/Procedure.py"], "/tests/test_proc_log_modify.py": ["/database/ProcedureLogModify.py"], "/database/batch_replace.py": ["/database/ProcedureLogModify.py", ...
58,124
klgentle/lc_python
refs/heads/master
/leet_code/easy_case/findContentChildren.py
import logging logging.basicConfig( level=logging.DEBUG, format=" %(asctime)s - %(levelname)s - %(message)s" ) class Solution: def findContentChildren(self, g, s) -> int: # : List[int] # sort the list, small cookie for small greed factor g.sort() s.sort() logging.debug("g: %s...
{"/tests/testCreateWeekReport.py": ["/automatic_office/CreateWeekReport.py"], "/tests/re_test.py": ["/database/Procedure.py"], "/tests/test_procedure.py": ["/database/Procedure.py"], "/tests/test_proc_log_modify.py": ["/database/ProcedureLogModify.py"], "/database/batch_replace.py": ["/database/ProcedureLogModify.py", ...
58,125
klgentle/lc_python
refs/heads/master
/stock_pandas/stock_analysis_and_view.py
""" 数据可视化:股票数据分析 """ import pandas as pd from pandas_datareader import data ''' 获取国内股票数据的方式是:“股票代码”+“对应股市”(港股为.hk,A股为.ss) 例如腾讯是港股是:0700.hk ''' #字典:6家公司的股票 gafataDict={'谷歌':'GOOG','亚马逊':'AMZN','Facebook':'FB', '苹果':'AAPL','阿里巴巴':'BABA','腾讯':'0700.hk'} ''' get_data_yahoo表示从雅虎数据源获取股票数据,官网使用操作文档: http://pa...
{"/tests/testCreateWeekReport.py": ["/automatic_office/CreateWeekReport.py"], "/tests/re_test.py": ["/database/Procedure.py"], "/tests/test_procedure.py": ["/database/Procedure.py"], "/tests/test_proc_log_modify.py": ["/database/ProcedureLogModify.py"], "/database/batch_replace.py": ["/database/ProcedureLogModify.py", ...
58,126
klgentle/lc_python
refs/heads/master
/cs61a/remove_eg.py
def remove_digit(n, digit): """n >= 0, 0 <= digit <= 9 ruturn a number that remove digit from n >>> remove_digit(180, 1) 80 >>> remove_digit(1111, 1) 0 >>> remove_digit(8883, 8) 3 """ if n == 0: return 0 if n % 10 == digit: return remove_digit(n // 10, digit)...
{"/tests/testCreateWeekReport.py": ["/automatic_office/CreateWeekReport.py"], "/tests/re_test.py": ["/database/Procedure.py"], "/tests/test_procedure.py": ["/database/Procedure.py"], "/tests/test_proc_log_modify.py": ["/database/ProcedureLogModify.py"], "/database/batch_replace.py": ["/database/ProcedureLogModify.py", ...
58,127
klgentle/lc_python
refs/heads/master
/base_practice/PrimeNumbers.py
n=int(input("Enter an integer:")) def is_prime(n): if n<2: return False elif n==2: return True else: i=2 while i<n: if((n%i)==0): return False else: i+=1 return True print(is_prime(n))
{"/tests/testCreateWeekReport.py": ["/automatic_office/CreateWeekReport.py"], "/tests/re_test.py": ["/database/Procedure.py"], "/tests/test_procedure.py": ["/database/Procedure.py"], "/tests/test_proc_log_modify.py": ["/database/ProcedureLogModify.py"], "/database/batch_replace.py": ["/database/ProcedureLogModify.py", ...
58,128
klgentle/lc_python
refs/heads/master
/frequency_model/clock.py
# todo a clock import time import os import sys def sleepClock(m: str): """input a number of minute, time up play a song""" file = r"D:\\music\\music_good\\澤野弘之-Aliez_end.mp3" m = float(m) if m < 0 or m > 60: print("请输入分钟数:0<m<60") time.sleep(m * 60) os.system(file) # use windows to p...
{"/tests/testCreateWeekReport.py": ["/automatic_office/CreateWeekReport.py"], "/tests/re_test.py": ["/database/Procedure.py"], "/tests/test_procedure.py": ["/database/Procedure.py"], "/tests/test_proc_log_modify.py": ["/database/ProcedureLogModify.py"], "/database/batch_replace.py": ["/database/ProcedureLogModify.py", ...
58,129
klgentle/lc_python
refs/heads/master
/leet_code/labuladong/sliding_window/p0003_Longest_Substring_Without_Repeating_Characters.py
""" 3. Longest Substring Without Repeating Characters Medium Given a string s, find the length of the longest substring without repeating characters. Example 1: Input: s = "abcabcbb" Output: 3 Explanation: The answer is "abc", with the length of 3. Example 2: Input: s = "bbbbb" Output: 1 Explanation: The answer is...
{"/tests/testCreateWeekReport.py": ["/automatic_office/CreateWeekReport.py"], "/tests/re_test.py": ["/database/Procedure.py"], "/tests/test_procedure.py": ["/database/Procedure.py"], "/tests/test_proc_log_modify.py": ["/database/ProcedureLogModify.py"], "/database/batch_replace.py": ["/database/ProcedureLogModify.py", ...
58,130
klgentle/lc_python
refs/heads/master
/leet_code/labuladong/dynamic_programming/p0072_Edit_Distance.py
""" 72. Edit Distance Hard Given two strings word1 and word2, return the minimum number of operations required to convert word1 to word2. You have the following three operations permitted on a word: Insert a character Delete a character Replace a character Example 1: Input: word1 = "horse", word2 = ...
{"/tests/testCreateWeekReport.py": ["/automatic_office/CreateWeekReport.py"], "/tests/re_test.py": ["/database/Procedure.py"], "/tests/test_procedure.py": ["/database/Procedure.py"], "/tests/test_proc_log_modify.py": ["/database/ProcedureLogModify.py"], "/database/batch_replace.py": ["/database/ProcedureLogModify.py", ...
58,131
klgentle/lc_python
refs/heads/master
/leet_code/easy_case/rob.py
#!/usr/bin/env python3 # coding:utf8 import pysnooper import pdb class Solution: """ # 198 You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses ...
{"/tests/testCreateWeekReport.py": ["/automatic_office/CreateWeekReport.py"], "/tests/re_test.py": ["/database/Procedure.py"], "/tests/test_procedure.py": ["/database/Procedure.py"], "/tests/test_proc_log_modify.py": ["/database/ProcedureLogModify.py"], "/database/batch_replace.py": ["/database/ProcedureLogModify.py", ...
58,132
klgentle/lc_python
refs/heads/master
/tests/re_simple_test.py
import re def test_re_search(test_str: str): if re.search( r"(\w*.)?M\s*=\s*(')?1(')?\s*AND\s+(\w*.)?S\s*=\s*(')?1(')?", test_str, flags=re.IGNORECASE, ): print("find") else: print("not find") if __name__ == "__main__": # test_re_search(" AND C.M = 1 ...
{"/tests/testCreateWeekReport.py": ["/automatic_office/CreateWeekReport.py"], "/tests/re_test.py": ["/database/Procedure.py"], "/tests/test_procedure.py": ["/database/Procedure.py"], "/tests/test_proc_log_modify.py": ["/database/ProcedureLogModify.py"], "/database/batch_replace.py": ["/database/ProcedureLogModify.py", ...
58,133
klgentle/lc_python
refs/heads/master
/leet_code/easy_case/siglenumber.py
import logging from pprint import pprint logging.basicConfig( level=logging.DEBUG, format=" %(asctime)s - %(levelname)s - %(message)s" ) class Solution: def isDul(self, i, nums): for j in range(i + 1, len(nums)): if nums[i] == nums[j]: return True return False ...
{"/tests/testCreateWeekReport.py": ["/automatic_office/CreateWeekReport.py"], "/tests/re_test.py": ["/database/Procedure.py"], "/tests/test_procedure.py": ["/database/Procedure.py"], "/tests/test_proc_log_modify.py": ["/database/ProcedureLogModify.py"], "/database/batch_replace.py": ["/database/ProcedureLogModify.py", ...
58,134
klgentle/lc_python
refs/heads/master
/leet_code/labuladong/tree/p0104_Maximum_Depth_of_Binary_Tree_2.py
""" 104. Maximum Depth of Binary Tree Easy Given the root of a binary tree, return its maximum depth. A binary tree's maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node. Example 1: Input: root = [3,9,20,null,null,15,7] Output: 3 Example 2: Input: root ...
{"/tests/testCreateWeekReport.py": ["/automatic_office/CreateWeekReport.py"], "/tests/re_test.py": ["/database/Procedure.py"], "/tests/test_procedure.py": ["/database/Procedure.py"], "/tests/test_proc_log_modify.py": ["/database/ProcedureLogModify.py"], "/database/batch_replace.py": ["/database/ProcedureLogModify.py", ...
58,135
klgentle/lc_python
refs/heads/master
/leet_code/medium_case/p0034_Find_First_and_Last_Position_of_Element_in_Sorted_Array.py
class Solution: def searchRange(self, nums: List[int], target: int) -> List[int]: if target not in nums: return [-1,-1] return [nums.index(target), self.searchEnding(nums, target)] def searchEnding(self, nums: List[int], target: int) -> int: ind = nums.index(target) ...
{"/tests/testCreateWeekReport.py": ["/automatic_office/CreateWeekReport.py"], "/tests/re_test.py": ["/database/Procedure.py"], "/tests/test_procedure.py": ["/database/Procedure.py"], "/tests/test_proc_log_modify.py": ["/database/ProcedureLogModify.py"], "/database/batch_replace.py": ["/database/ProcedureLogModify.py", ...
58,136
klgentle/lc_python
refs/heads/master
/svn_operate/CheckProcedure.py
import re import os import platform from config_default import configs class CheckProcedure(object): def __init__(self): # 不需要检查的程序清单 self.white_list = [ "p_rpt_cif089_1.sql", "P_RPT_CIF089KN.sql", "P_RPT_CIF089KP.sql", "p_rpt_cif330d.sql", ...
{"/tests/testCreateWeekReport.py": ["/automatic_office/CreateWeekReport.py"], "/tests/re_test.py": ["/database/Procedure.py"], "/tests/test_procedure.py": ["/database/Procedure.py"], "/tests/test_proc_log_modify.py": ["/database/ProcedureLogModify.py"], "/database/batch_replace.py": ["/database/ProcedureLogModify.py", ...
58,137
klgentle/lc_python
refs/heads/master
/leet_code/labuladong/divide_and_conquer/p0395_Longest_Substring_with_At_Least_K_Repeating_Characters.py
""" 395. Longest Substring with At Least K Repeating Characters Medium Given a string s and an integer k, return the length of the longest substring of s such that the frequency of each character in this substring is greater than or equal to k. Example 1: Input: s = "aaabb", k = 3 Output: 3 Explanation: The longe...
{"/tests/testCreateWeekReport.py": ["/automatic_office/CreateWeekReport.py"], "/tests/re_test.py": ["/database/Procedure.py"], "/tests/test_procedure.py": ["/database/Procedure.py"], "/tests/test_proc_log_modify.py": ["/database/ProcedureLogModify.py"], "/database/batch_replace.py": ["/database/ProcedureLogModify.py", ...
58,138
klgentle/lc_python
refs/heads/master
/database/replace_view_and_log.py
import os import sys import logging logging.basicConfig(level=logging.DEBUG, format="%(levelname)s: %(message)s") # 绝对路径的import sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../") # from database.FindViewOriginalTable import FindViewOriginalTable # from database.Procedure import Procedure from databa...
{"/tests/testCreateWeekReport.py": ["/automatic_office/CreateWeekReport.py"], "/tests/re_test.py": ["/database/Procedure.py"], "/tests/test_procedure.py": ["/database/Procedure.py"], "/tests/test_proc_log_modify.py": ["/database/ProcedureLogModify.py"], "/database/batch_replace.py": ["/database/ProcedureLogModify.py", ...
58,139
klgentle/lc_python
refs/heads/master
/leet_code/labuladong/backtracking/p0077_Combinations.py
""" 77. Combinations Medium Given two integers n and k, return all possible combinations of k numbers out of the range [1, n]. You may return the answer in any order. Example 1: Input: n = 4, k = 2 Output: [ [2,4], [3,4], [2,3], [1,2], [1,3], [1,4], ] Example 2: Input: n = 1, k = 1 Output: [[1]] ""...
{"/tests/testCreateWeekReport.py": ["/automatic_office/CreateWeekReport.py"], "/tests/re_test.py": ["/database/Procedure.py"], "/tests/test_procedure.py": ["/database/Procedure.py"], "/tests/test_proc_log_modify.py": ["/database/ProcedureLogModify.py"], "/database/batch_replace.py": ["/database/ProcedureLogModify.py", ...
58,152
mechbear14/mysterious-forest
refs/heads/master
/world.py
from core import ForestGraph from player import Player from blocks import Block, NormalBlock, PassBlock from pygame import Surface class Forest: def __init__(self, width: int, height: int, player_info: Player): self.width, self.height = width, height self.graph = ForestGraph(width, height) ...
{"/world.py": ["/core.py", "/player.py", "/blocks.py"], "/blocks.py": ["/player.py"], "/game.py": ["/world.py", "/player.py"], "/main.py": ["/world.py"]}
58,153
mechbear14/mysterious-forest
refs/heads/master
/core.py
import numpy from collections import namedtuple, deque class ForestGraph: def __init__(self, width: int, height: int): self.width = width self.height = height self.size = width * height self.graph = numpy.zeros([self.size, self.size], dtype=bool) for cell in range(self.size...
{"/world.py": ["/core.py", "/player.py", "/blocks.py"], "/blocks.py": ["/player.py"], "/game.py": ["/world.py", "/player.py"], "/main.py": ["/world.py"]}
58,154
mechbear14/mysterious-forest
refs/heads/master
/blocks.py
from player import Player import pygame from pygame.locals import * from pygame.sprite import Sprite from pygame import Vector2, Rect, Surface from random import randint class Block(Sprite): UNKNOWN = 0 REVEALED = 1 PASSED = 2 def __init__(self, x: int, y: int): Sprite.__init__(self) ...
{"/world.py": ["/core.py", "/player.py", "/blocks.py"], "/blocks.py": ["/player.py"], "/game.py": ["/world.py", "/player.py"], "/main.py": ["/world.py"]}
58,155
mechbear14/mysterious-forest
refs/heads/master
/game.py
import pygame from pygame.locals import * from pygame import Vector2 from world import Forest from player import Player pygame.init() screen = pygame.display.set_mode((640, 360)) player = Player(0, 0) world = Forest(6, 5, player) while True: for event in pygame.event.get(): if event.type == QUIT: ...
{"/world.py": ["/core.py", "/player.py", "/blocks.py"], "/blocks.py": ["/player.py"], "/game.py": ["/world.py", "/player.py"], "/main.py": ["/world.py"]}
58,156
mechbear14/mysterious-forest
refs/heads/master
/main.py
from world import Forest forest = Forest(6, 5) if __name__ == "__main__": forest.go_to(0, 1) forest.go_to(0, 2) forest.go_to(0, 3) forest.go_to(1, 1) forest.go_to(0, 0) forest.go_to(1, 0) forest.go_to(1, 1) forest.go_to(0, 2) forest.go_to(0, 3) forest.go_to(0, 4) forest.go_...
{"/world.py": ["/core.py", "/player.py", "/blocks.py"], "/blocks.py": ["/player.py"], "/game.py": ["/world.py", "/player.py"], "/main.py": ["/world.py"]}
58,157
mechbear14/mysterious-forest
refs/heads/master
/player.py
import pygame from pygame.sprite import Sprite from pygame import Vector2, Surface, Rect, Color class BasePlayer(Sprite): NORMAL = 0 def __init__(self, x: int, y: int): self.position = Vector2(x, y) self.size = Vector2(50, 50) self.canvas_position = Vector2(x * 50, y * 50) sel...
{"/world.py": ["/core.py", "/player.py", "/blocks.py"], "/blocks.py": ["/player.py"], "/game.py": ["/world.py", "/player.py"], "/main.py": ["/world.py"]}
58,161
tejaswinigsl/crud_t
refs/heads/master
/app/models.py
# Create your models here. from django.db import models class Employee1(models.Model): empid=models.IntegerField() name=models.CharField(max_length=100) phone =models.IntegerField() age=models.IntegerField() email=models.EmailField()
{"/app/views.py": ["/app/models.py", "/app/forms.py"], "/app/forms.py": ["/app/models.py"]}
58,162
tejaswinigsl/crud_t
refs/heads/master
/app/views.py
from django.shortcuts import render from django.contrib import messages # Create your views here. from django.shortcuts import render,redirect from app.models import Employee1 from app.forms import EmployeeForm1 # Create your views here. def show(request): employees=Employee1.objects.all() return render(req...
{"/app/views.py": ["/app/models.py", "/app/forms.py"], "/app/forms.py": ["/app/models.py"]}
58,163
tejaswinigsl/crud_t
refs/heads/master
/app/forms.py
from django import forms from app.models import Employee1 class EmployeeForm1(forms.ModelForm): class Meta: model=Employee1 fields='__all__'
{"/app/views.py": ["/app/models.py", "/app/forms.py"], "/app/forms.py": ["/app/models.py"]}
58,173
philipp-kurz/PoolFlow-Skarfify-Data_Engineering
refs/heads/main
/data_mappings.py
country_mapping = { 582: 'MEXICO Air Sea, and Not Reported (I-94, no land arrivals)', 236: 'AFGHANISTAN', 101: 'ALBANIA', 316: 'ALGERIA', 102: 'ANDORRA', 324: 'ANGOLA', 529: 'ANGUILLA', 518: 'ANTIGUA-BARBUDA', 687: 'ARGENTINA ', 151: 'ARMENIA', 532: 'ARUBA', 438: 'AUSTRALIA', 103:...
{"/etl.py": ["/data_mappings.py"]}
58,174
philipp-kurz/PoolFlow-Skarfify-Data_Engineering
refs/heads/main
/etl.py
import configparser import os from pyspark.sql import SparkSession from data_mappings import * import pyspark.sql.functions as F import pyspark.sql.types as T from itertools import chain import datetime def create_spark_session(): ''' Returns a Spark session for the ETL job. Returns: ...
{"/etl.py": ["/data_mappings.py"]}
58,180
lin54241930/monkey_tcloud
refs/heads/master
/auto_install.py
import os import time from multiprocessing import Pool import uiautomator2 as u2 import subprocess def conndevice(device): d = u2.connect(device) return d def getDevicesAll(): # 获取devices数量和名称 devices = [] try: for dName_ in os.popen("adb devices"): if "\t" in dName_: ...
{"/automonkey/device.py": ["/automonkey/adb.py", "/automonkey/exception.py"], "/automonkey/utils.py": ["/automonkey/config.py", "/automonkey/exception.py"], "/automonkey/runner.py": ["/automonkey/config.py", "/automonkey/case.py", "/automonkey/exception.py", "/automonkey/monkey_runner.py", "/automonkey/tcloud_update.py...
58,181
lin54241930/monkey_tcloud
refs/heads/master
/automonkey/device.py
import logging import traceback from .adb import AdbTool from .exception import DeviceNotConnectedException logger = logging.getLogger(__name__) """ # 设备操作 # 包括 连接设备, 断开设备 # 其他 """ class Device(object): def __init__(self): self.device_id = '' self.system_device = True self.adb_tool ...
{"/automonkey/device.py": ["/automonkey/adb.py", "/automonkey/exception.py"], "/automonkey/utils.py": ["/automonkey/config.py", "/automonkey/exception.py"], "/automonkey/runner.py": ["/automonkey/config.py", "/automonkey/case.py", "/automonkey/exception.py", "/automonkey/monkey_runner.py", "/automonkey/tcloud_update.py...
58,182
lin54241930/monkey_tcloud
refs/heads/master
/automonkey/utils.py
import logging import os import subprocess import sys import traceback from datetime import datetime import oss2 import prettytable import requests from automonkey.config import DefaultConfig from automonkey.exception import FileDownloadErrorException logger = logging.getLogger(__name__) """ # 工具类 """ class Util...
{"/automonkey/device.py": ["/automonkey/adb.py", "/automonkey/exception.py"], "/automonkey/utils.py": ["/automonkey/config.py", "/automonkey/exception.py"], "/automonkey/runner.py": ["/automonkey/config.py", "/automonkey/case.py", "/automonkey/exception.py", "/automonkey/monkey_runner.py", "/automonkey/tcloud_update.py...
58,183
lin54241930/monkey_tcloud
refs/heads/master
/automonkey/runner.py
import logging import os import traceback from multiprocessing import Queue, Lock import prettytable from automonkey.config import DefaultConfig from .case import Case from .exception import CaseTypeErrorException, FileDownloadErrorException from .monkey_runner import MonkeyRunner from .tcloud_update import TCloud fr...
{"/automonkey/device.py": ["/automonkey/adb.py", "/automonkey/exception.py"], "/automonkey/utils.py": ["/automonkey/config.py", "/automonkey/exception.py"], "/automonkey/runner.py": ["/automonkey/config.py", "/automonkey/case.py", "/automonkey/exception.py", "/automonkey/monkey_runner.py", "/automonkey/tcloud_update.py...
58,184
lin54241930/monkey_tcloud
refs/heads/master
/automonkey/performance_runner.py
#!/usr/bin/python # -*- coding: utf-8 -*- import json import logging import os import time import traceback from datetime import datetime from multiprocessing import Process from automonkey.config import DefaultConfig from .adb import AdbTool from .exception import DeviceNotConnectedException, InstallAppEx...
{"/automonkey/device.py": ["/automonkey/adb.py", "/automonkey/exception.py"], "/automonkey/utils.py": ["/automonkey/config.py", "/automonkey/exception.py"], "/automonkey/runner.py": ["/automonkey/config.py", "/automonkey/case.py", "/automonkey/exception.py", "/automonkey/monkey_runner.py", "/automonkey/tcloud_update.py...
58,185
lin54241930/monkey_tcloud
refs/heads/master
/automonkey/config.py
import oss2 """ # MonkeyConfig # 所有的配置信息, 是从 jenkins job 中读取过来的信息,在 loader 中进行 构建 """ class DefaultConfig(object): RUN_MODE_MIX = 1 RUN_MODE_DFS = 2 RUN_MODE_TROY = 3 RUN_MODE_OTHER = 4 MONKEY_MIX_MODE = ' --uiautomatormix ' MONKEY_DFS_MODE = ' --uiautomatordfs ' MONKEY_TROY_MODE = ' ...
{"/automonkey/device.py": ["/automonkey/adb.py", "/automonkey/exception.py"], "/automonkey/utils.py": ["/automonkey/config.py", "/automonkey/exception.py"], "/automonkey/runner.py": ["/automonkey/config.py", "/automonkey/case.py", "/automonkey/exception.py", "/automonkey/monkey_runner.py", "/automonkey/tcloud_update.py...
58,186
lin54241930/monkey_tcloud
refs/heads/master
/automonkey/recorder.py
""" # 解析结果,发布数据 """ class Recorder(object): def __init__(self): pass def result_analysis(self): pass
{"/automonkey/device.py": ["/automonkey/adb.py", "/automonkey/exception.py"], "/automonkey/utils.py": ["/automonkey/config.py", "/automonkey/exception.py"], "/automonkey/runner.py": ["/automonkey/config.py", "/automonkey/case.py", "/automonkey/exception.py", "/automonkey/monkey_runner.py", "/automonkey/tcloud_update.py...
58,187
lin54241930/monkey_tcloud
refs/heads/master
/automonkey/monkey_runner.py
import logging import os import time import traceback from datetime import datetime from multiprocessing import Process from automonkey.config import DefaultConfig from .adb import AdbTool from .exception import DeviceNotConnectedException, InstallAppException, CheckScreenLockedFailed from .logcat import LogCat from ....
{"/automonkey/device.py": ["/automonkey/adb.py", "/automonkey/exception.py"], "/automonkey/utils.py": ["/automonkey/config.py", "/automonkey/exception.py"], "/automonkey/runner.py": ["/automonkey/config.py", "/automonkey/case.py", "/automonkey/exception.py", "/automonkey/monkey_runner.py", "/automonkey/tcloud_update.py...
58,188
lin54241930/monkey_tcloud
refs/heads/master
/automonkey/tcloud_update.py
#!/usr/bin/python # -*- coding: utf-8 -*- import json import logging import traceback from datetime import datetime import requests from .config import DefaultConfig logger = logging.getLogger(__name__) class TCloud(object): def __init__(self, task_id, device_id, monkey_id, tcloud_url, process=0): sel...
{"/automonkey/device.py": ["/automonkey/adb.py", "/automonkey/exception.py"], "/automonkey/utils.py": ["/automonkey/config.py", "/automonkey/exception.py"], "/automonkey/runner.py": ["/automonkey/config.py", "/automonkey/case.py", "/automonkey/exception.py", "/automonkey/monkey_runner.py", "/automonkey/tcloud_update.py...
58,189
lin54241930/monkey_tcloud
refs/heads/master
/automonkey/__init__.py
import logging logging.basicConfig(level=logging.INFO, format='%(asctime)s <%(process)d> [%(filename)s (%(lineno)d)] %(levelname)s %(message)s')
{"/automonkey/device.py": ["/automonkey/adb.py", "/automonkey/exception.py"], "/automonkey/utils.py": ["/automonkey/config.py", "/automonkey/exception.py"], "/automonkey/runner.py": ["/automonkey/config.py", "/automonkey/case.py", "/automonkey/exception.py", "/automonkey/monkey_runner.py", "/automonkey/tcloud_update.py...
58,190
lin54241930/monkey_tcloud
refs/heads/master
/automonkey/main.py
#!/usr/bin/python # -*- coding: utf-8 -*- import argparse import logging import traceback from .program import ProgramMain logger = logging.getLogger(__name__) """ # main """ def main(): arg_program = argparse.ArgumentParser(prog='python -m automonkey', add_help=True) sub_all_arg_program = arg_program.a...
{"/automonkey/device.py": ["/automonkey/adb.py", "/automonkey/exception.py"], "/automonkey/utils.py": ["/automonkey/config.py", "/automonkey/exception.py"], "/automonkey/runner.py": ["/automonkey/config.py", "/automonkey/case.py", "/automonkey/exception.py", "/automonkey/monkey_runner.py", "/automonkey/tcloud_update.py...
58,191
lin54241930/monkey_tcloud
refs/heads/master
/automonkey/uiautomator_helper.py
# import logging # # logger = logging.getLogger(__name__) # # # class U2Helper(object): # def __init__(self, device_id): # self.device_id = device_id # self.server = None # # def connect(self): # import uiautomator2 as u2 # self.server = u2.connect(self.device_id) # # def try...
{"/automonkey/device.py": ["/automonkey/adb.py", "/automonkey/exception.py"], "/automonkey/utils.py": ["/automonkey/config.py", "/automonkey/exception.py"], "/automonkey/runner.py": ["/automonkey/config.py", "/automonkey/case.py", "/automonkey/exception.py", "/automonkey/monkey_runner.py", "/automonkey/tcloud_update.py...
58,192
lin54241930/monkey_tcloud
refs/heads/master
/automonkey/adb.py
import logging import os import platform import re import time import traceback import uiautomator2 as u2 import prettytable from .exception import LocalPackageNotFoundException # from .uiautomator_helper import U2Helper # no use here from .utils import Utils logger = logging.getLogger(__name__) class AdbTool(obje...
{"/automonkey/device.py": ["/automonkey/adb.py", "/automonkey/exception.py"], "/automonkey/utils.py": ["/automonkey/config.py", "/automonkey/exception.py"], "/automonkey/runner.py": ["/automonkey/config.py", "/automonkey/case.py", "/automonkey/exception.py", "/automonkey/monkey_runner.py", "/automonkey/tcloud_update.py...
58,193
lin54241930/monkey_tcloud
refs/heads/master
/automonkey/exception.py
class MonkeyBaseException(Exception): pass class MonkeyTypeErrorException(MonkeyBaseException): pass class FileDownloadErrorException(MonkeyBaseException): pass class CaseBaseException(Exception): pass class CaseTypeErrorException(CaseBaseException): pass class DeviceNotConnectedException(...
{"/automonkey/device.py": ["/automonkey/adb.py", "/automonkey/exception.py"], "/automonkey/utils.py": ["/automonkey/config.py", "/automonkey/exception.py"], "/automonkey/runner.py": ["/automonkey/config.py", "/automonkey/case.py", "/automonkey/exception.py", "/automonkey/monkey_runner.py", "/automonkey/tcloud_update.py...
58,194
lin54241930/monkey_tcloud
refs/heads/master
/automonkey/program.py
import logging from .config import DefaultConfig from .loader import Loader from .recorder import Recorder from .runner import Runner from .utils import Utils logger = logging.getLogger(__name__) """ # ProgramMain 主程序 # 通过 Loader 解析参数 构建 CaseConfig 和 MonkeyConfig # 通过 Config 构建 Case 和 # 启动和控制 runner 的运行 # 通过 Re...
{"/automonkey/device.py": ["/automonkey/adb.py", "/automonkey/exception.py"], "/automonkey/utils.py": ["/automonkey/config.py", "/automonkey/exception.py"], "/automonkey/runner.py": ["/automonkey/config.py", "/automonkey/case.py", "/automonkey/exception.py", "/automonkey/monkey_runner.py", "/automonkey/tcloud_update.py...
58,195
lin54241930/monkey_tcloud
refs/heads/master
/automonkey/ExeInstall.py
import os import sys import time import traceback import re from multiprocessing import Pool import multiprocessing import prettytable import requests import datetime import uiautomator2 as u2 import subprocess import logging logger = logging.getLogger(__name__) def getDevicesAll(): # 获取devices数量和名称 devices =...
{"/automonkey/device.py": ["/automonkey/adb.py", "/automonkey/exception.py"], "/automonkey/utils.py": ["/automonkey/config.py", "/automonkey/exception.py"], "/automonkey/runner.py": ["/automonkey/config.py", "/automonkey/case.py", "/automonkey/exception.py", "/automonkey/monkey_runner.py", "/automonkey/tcloud_update.py...
58,196
lin54241930/monkey_tcloud
refs/heads/master
/automonkey/performance.py
#!/usr/bin/python # -*- coding: utf-8 -*- import traceback from .result import MonkeyCaseResult from .device import Device from .config import MonkeyConfig, PerformanceConfig """ # MonkeyCase, 每个 device 对应一个 MonkeyCase # monkey_runner 运行的基本单位 """ class PerformanceCase(object): def __init__(...
{"/automonkey/device.py": ["/automonkey/adb.py", "/automonkey/exception.py"], "/automonkey/utils.py": ["/automonkey/config.py", "/automonkey/exception.py"], "/automonkey/runner.py": ["/automonkey/config.py", "/automonkey/case.py", "/automonkey/exception.py", "/automonkey/monkey_runner.py", "/automonkey/tcloud_update.py...
58,197
lin54241930/monkey_tcloud
refs/heads/master
/automonkey/result.py
#!/usr/bin/python # -*- coding: utf-8 -*- import traceback from datetime import datetime from .config import MonkeyConfig """ # 运行的 Case 的 结果 # 每个 Case 有多个 MonkeyCase # MonkeyCase 的结果 # 每个对应 一个 device """ class CaseResult(object): def __init__(self): self.begin_time = '' self.end_time = ''...
{"/automonkey/device.py": ["/automonkey/adb.py", "/automonkey/exception.py"], "/automonkey/utils.py": ["/automonkey/config.py", "/automonkey/exception.py"], "/automonkey/runner.py": ["/automonkey/config.py", "/automonkey/case.py", "/automonkey/exception.py", "/automonkey/monkey_runner.py", "/automonkey/tcloud_update.py...
58,198
lin54241930/monkey_tcloud
refs/heads/master
/automonkey/logcat.py
import json import logging import os import traceback from .adb import AdbTool from .config import DefaultConfig from .utils import Utils logger = logging.getLogger(__name__) """ # LogCat """ class LogCat(object): def __init__(self, device_id, pid): super(LogCat, self).__init__() self.daemon...
{"/automonkey/device.py": ["/automonkey/adb.py", "/automonkey/exception.py"], "/automonkey/utils.py": ["/automonkey/config.py", "/automonkey/exception.py"], "/automonkey/runner.py": ["/automonkey/config.py", "/automonkey/case.py", "/automonkey/exception.py", "/automonkey/monkey_runner.py", "/automonkey/tcloud_update.py...
58,199
lin54241930/monkey_tcloud
refs/heads/master
/automonkey/case.py
from automonkey.performance import PerformanceCase from .device import Device from .monkey import MonkeyCase from .result import CaseResult """ # 运行的 Case # runner 运行的基本操作单位 """ class Case(object): def __init__(self): self.name = '' self.cases = [] self.case_type = 1 self.monke...
{"/automonkey/device.py": ["/automonkey/adb.py", "/automonkey/exception.py"], "/automonkey/utils.py": ["/automonkey/config.py", "/automonkey/exception.py"], "/automonkey/runner.py": ["/automonkey/config.py", "/automonkey/case.py", "/automonkey/exception.py", "/automonkey/monkey_runner.py", "/automonkey/tcloud_update.py...
58,200
lin54241930/monkey_tcloud
refs/heads/master
/automonkey/monkey.py
from .config import MonkeyConfig from .device import Device from .result import MonkeyCaseResult """ # MonkeyCase, 每个 device 对应一个 MonkeyCase # monkey_runner 运行的基本单位 """ class MonkeyCase(object): def __init__(self): self.config = MonkeyConfig() self.device = Device() self.result = Monke...
{"/automonkey/device.py": ["/automonkey/adb.py", "/automonkey/exception.py"], "/automonkey/utils.py": ["/automonkey/config.py", "/automonkey/exception.py"], "/automonkey/runner.py": ["/automonkey/config.py", "/automonkey/case.py", "/automonkey/exception.py", "/automonkey/monkey_runner.py", "/automonkey/tcloud_update.py...
58,201
lin54241930/monkey_tcloud
refs/heads/master
/automonkey/loader.py
from argparse import Namespace from .case import Case """ # Loader : 将参数转化为 Config, 并构建 Case """ class Loader(object): def __init__(self): self.params = { 'monkey_id': '', 'device': [], 'monkey': { 'config': {} }, 'config': {}...
{"/automonkey/device.py": ["/automonkey/adb.py", "/automonkey/exception.py"], "/automonkey/utils.py": ["/automonkey/config.py", "/automonkey/exception.py"], "/automonkey/runner.py": ["/automonkey/config.py", "/automonkey/case.py", "/automonkey/exception.py", "/automonkey/monkey_runner.py", "/automonkey/tcloud_update.py...
58,210
tim-chow/common-object-pool
refs/heads/master
/test_dedicate_object_pool.py
from common_object_pool.dedicate_object_pool import DedicateObjectPool from test_shared_object_pool import test, Factory if __name__ == "__main__": thread_count = 20 sleep_time = 3 max_count = 3 object_pool = DedicateObjectPool( max_count, Factory ) timeout = 1.5 max_att...
{"/test_dedicate_object_pool.py": ["/common_object_pool/dedicate_object_pool.py", "/test_shared_object_pool.py"], "/common_object_pool/dedicate_object_pool.py": ["/common_object_pool/abstract_object_pool.py"], "/common_object_pool/shared_object_pool.py": ["/common_object_pool/abstract_object_pool.py"], "/test_drop_obje...
58,211
tim-chow/common-object-pool
refs/heads/master
/common_object_pool/exceptions.py
class ObjectPoolException(Exception): pass class MaxAttemptsReached(ObjectPoolException): pass class ObjectUnusable(ObjectPoolException): pass
{"/test_dedicate_object_pool.py": ["/common_object_pool/dedicate_object_pool.py", "/test_shared_object_pool.py"], "/common_object_pool/dedicate_object_pool.py": ["/common_object_pool/abstract_object_pool.py"], "/common_object_pool/shared_object_pool.py": ["/common_object_pool/abstract_object_pool.py"], "/test_drop_obje...
58,212
tim-chow/common-object-pool
refs/heads/master
/common_object_pool/__init__.py
from contextlib import contextmanager import sys from .exceptions import ObjectUnusable @contextmanager def get_object( object_pool, *args, **kwargs): object_id, obj = object_pool.get_object(*args, **kwargs) exc_info = None try: yield obj except ObjectUnusable: ...
{"/test_dedicate_object_pool.py": ["/common_object_pool/dedicate_object_pool.py", "/test_shared_object_pool.py"], "/common_object_pool/dedicate_object_pool.py": ["/common_object_pool/abstract_object_pool.py"], "/common_object_pool/shared_object_pool.py": ["/common_object_pool/abstract_object_pool.py"], "/test_drop_obje...
58,213
tim-chow/common-object-pool
refs/heads/master
/common_object_pool/abstract_object_pool.py
# coding: utf8 import logging import abc import threading import sys from .exceptions import MaxAttemptsReached LOGGER = logging.getLogger(__name__) class AbstractObjectPool(object): __metaclass__ = abc.ABCMeta __LOCK = threading.Lock() __ID = 0 def __init__(self, max_count, factory=None): ...
{"/test_dedicate_object_pool.py": ["/common_object_pool/dedicate_object_pool.py", "/test_shared_object_pool.py"], "/common_object_pool/dedicate_object_pool.py": ["/common_object_pool/abstract_object_pool.py"], "/common_object_pool/shared_object_pool.py": ["/common_object_pool/abstract_object_pool.py"], "/test_drop_obje...
58,214
tim-chow/common-object-pool
refs/heads/master
/common_object_pool/dedicate_object_pool.py
from .abstract_object_pool import AbstractObjectPool class DedicateObjectPool(AbstractObjectPool): def __init__(self, max_count, factory=None): AbstractObjectPool.__init__(self, max_count, factory) self._idle_object_ids = [] self._idle_objects = {} self._using_objects = {} def...
{"/test_dedicate_object_pool.py": ["/common_object_pool/dedicate_object_pool.py", "/test_shared_object_pool.py"], "/common_object_pool/dedicate_object_pool.py": ["/common_object_pool/abstract_object_pool.py"], "/common_object_pool/shared_object_pool.py": ["/common_object_pool/abstract_object_pool.py"], "/test_drop_obje...
58,215
tim-chow/common-object-pool
refs/heads/master
/common_object_pool/shared_object_pool.py
from .abstract_object_pool import AbstractObjectPool class SharedObjectPool(AbstractObjectPool): def __init__(self, max_shared_count, max_count, factory=None): AbstractObjectPool.__init__(self, max_count, factory) self._max_shared_count = max_shared_count self._objects = {} self._i...
{"/test_dedicate_object_pool.py": ["/common_object_pool/dedicate_object_pool.py", "/test_shared_object_pool.py"], "/common_object_pool/dedicate_object_pool.py": ["/common_object_pool/abstract_object_pool.py"], "/common_object_pool/shared_object_pool.py": ["/common_object_pool/abstract_object_pool.py"], "/test_drop_obje...
58,216
tim-chow/common-object-pool
refs/heads/master
/test_drop_object.py
import logging from common_object_pool.dedicate_object_pool import DedicateObjectPool from common_object_pool.exceptions import MaxAttemptsReached logging.basicConfig( level=logging.DEBUG, format="%(asctime)s %(message)s", ) LOGGER = logging.getLogger(__name__) def test(timeout=1, max_attempts=2): max_...
{"/test_dedicate_object_pool.py": ["/common_object_pool/dedicate_object_pool.py", "/test_shared_object_pool.py"], "/common_object_pool/dedicate_object_pool.py": ["/common_object_pool/abstract_object_pool.py"], "/common_object_pool/shared_object_pool.py": ["/common_object_pool/abstract_object_pool.py"], "/test_drop_obje...
58,217
tim-chow/common-object-pool
refs/heads/master
/test_shared_object_pool.py
import logging import threading import time from common_object_pool.shared_object_pool import SharedObjectPool from common_object_pool import get_object from common_object_pool.exceptions import MaxAttemptsReached LOGGER = logging.getLogger(__name__) logging.basicConfig( level=logging.DEBUG, format="%(thread...
{"/test_dedicate_object_pool.py": ["/common_object_pool/dedicate_object_pool.py", "/test_shared_object_pool.py"], "/common_object_pool/dedicate_object_pool.py": ["/common_object_pool/abstract_object_pool.py"], "/common_object_pool/shared_object_pool.py": ["/common_object_pool/abstract_object_pool.py"], "/test_drop_obje...
58,219
galenscovell/CommuteMap
refs/heads/master
/services/google_maps_client.py
""" Client for interacting with the Google Maps API. @Author GalenS <galen.scovell@gmail.com> """ import googlemaps from models.distance_matrix import DistanceMatrix from models.location import Location class MapClient: def __init__(self): self.client = googlemaps.Client(key='AIzaSyAoo39xmVMOA6K90WzGNF...
{"/services/google_maps_client.py": ["/models/distance_matrix.py", "/models/location.py"], "/run.py": ["/util/constants.py", "/graphics/visualizer.py", "/services/google_maps_client.py"], "/graphics/visualizer.py": ["/models/distance_matrix.py", "/models/location.py", "/graphics/cell.py", "/util/constants.py"]}
58,220
galenscovell/CommuteMap
refs/heads/master
/models/distance_matrix.py
""" Defines a Distance containing search terms and travel distance/time. @author GalenS <galen.scovell@gmail.com> """ class DistanceMatrix(dict): def __init__(self, origin, destination, row): super(DistanceMatrix, self).__init__() self['start'] = origin self['end'] = destination ...
{"/services/google_maps_client.py": ["/models/distance_matrix.py", "/models/location.py"], "/run.py": ["/util/constants.py", "/graphics/visualizer.py", "/services/google_maps_client.py"], "/graphics/visualizer.py": ["/models/distance_matrix.py", "/models/location.py", "/graphics/cell.py", "/util/constants.py"]}
58,221
galenscovell/CommuteMap
refs/heads/master
/run.py
""" Entrypoint for commute map tool. Fill in `params.json` with desired values, then run `python run.py` @Author GalenS <galen.scovell@gmail.com> """ import json from datetime import datetime import util.constants as constants from graphics.visualizer import Visualizer from services.google_maps_client import MapC...
{"/services/google_maps_client.py": ["/models/distance_matrix.py", "/models/location.py"], "/run.py": ["/util/constants.py", "/graphics/visualizer.py", "/services/google_maps_client.py"], "/graphics/visualizer.py": ["/models/distance_matrix.py", "/models/location.py", "/graphics/cell.py", "/util/constants.py"]}
58,222
galenscovell/CommuteMap
refs/heads/master
/models/location.py
""" Defines a Location containing name, central point, and region boundaries via NW and SW point. @author GalenS <galen.scovell@gmail.com> """ import math class Location(dict): def __init__(self, details): super(Location, self).__init__() if 'address' in details: self['label'] = det...
{"/services/google_maps_client.py": ["/models/distance_matrix.py", "/models/location.py"], "/run.py": ["/util/constants.py", "/graphics/visualizer.py", "/services/google_maps_client.py"], "/graphics/visualizer.py": ["/models/distance_matrix.py", "/models/location.py", "/graphics/cell.py", "/util/constants.py"]}
58,223
galenscovell/CommuteMap
refs/heads/master
/util/constants.py
""" Values used throughout tool. @author GalenS <galen.scovell@gmail.com> """ import os params_path = os.path.join(os.getcwd(), 'params.json') # Dimensions window_x = 640 window_y = 960 cell_size = 5 margin = 1 # Color setup c_background = (62, 70, 73) c_empty = (47, 47, 49) c_origin = (34, 168, 109) c_destination...
{"/services/google_maps_client.py": ["/models/distance_matrix.py", "/models/location.py"], "/run.py": ["/util/constants.py", "/graphics/visualizer.py", "/services/google_maps_client.py"], "/graphics/visualizer.py": ["/models/distance_matrix.py", "/models/location.py", "/graphics/cell.py", "/util/constants.py"]}
58,224
galenscovell/CommuteMap
refs/heads/master
/graphics/cell.py
class Cell: def __init__(self, grid_x, grid_y, pixel_x, pixel_y): self.id = -1 self.grid_x = grid_x self.grid_y = grid_y self.pixel_x = pixel_x self.pixel_y = pixel_y self.address = None self.duration = 0.0 def set_address(self, address): self.a...
{"/services/google_maps_client.py": ["/models/distance_matrix.py", "/models/location.py"], "/run.py": ["/util/constants.py", "/graphics/visualizer.py", "/services/google_maps_client.py"], "/graphics/visualizer.py": ["/models/distance_matrix.py", "/models/location.py", "/graphics/cell.py", "/util/constants.py"]}
58,225
galenscovell/CommuteMap
refs/heads/master
/graphics/visualizer.py
""" Takes in generated values and plots them into a graphical representation. @Author GalenS <galen.scovell@gmail.com> """ import math import pygame import sys from models.distance_matrix import DistanceMatrix from models.location import Location from graphics.cell import Cell import util.constants as constants ...
{"/services/google_maps_client.py": ["/models/distance_matrix.py", "/models/location.py"], "/run.py": ["/util/constants.py", "/graphics/visualizer.py", "/services/google_maps_client.py"], "/graphics/visualizer.py": ["/models/distance_matrix.py", "/models/location.py", "/graphics/cell.py", "/util/constants.py"]}
58,239
pythonpereira/goodreads-graphql
refs/heads/master
/init_database.py
from pymongo import MongoClient from mimesis import Text import pandas as pd from progress.bar import Bar client = MongoClient() text_faker = Text(locale='en') def connect_db(db_name, collection_name): db = client[db_name] collection = db[collection_name] return collection def store_books(): books_...
{"/schema.py": ["/basic_types.py"]}
58,240
pythonpereira/goodreads-graphql
refs/heads/master
/basic_types.py
import graphene from graphene.types.resolver import dict_resolver from pymongo import MongoClient client = MongoClient() reviews_collection = client.goodreads.reviews class Review(graphene.ObjectType): class Meta: default_resolver = dict_resolver _id = graphene.ID() bookId = graphene.ID() ra...
{"/schema.py": ["/basic_types.py"]}
58,241
pythonpereira/goodreads-graphql
refs/heads/master
/schema.py
import graphene from pymongo import MongoClient from bson.objectid import ObjectId from basic_types import Book, Review client = MongoClient() books_collection = client.goodreads.books reviews_collection = client.goodreads.reviews class CreateReview(graphene.Mutation): class Arguments: bookId = graphene....
{"/schema.py": ["/basic_types.py"]}
58,294
we-chatter/wechatter
refs/heads/main
/wechatter/shared/importers/importer.py
# -*- coding: utf-8 -*- """ @Author : Xu @Software: PyCharm @File : importer.py @Time : 2021/4/6 6:23 下午 @Desc : 数据加载 """ import asyncio from functools import reduce from typing import Text, Optional, List, Dict, Set, Any, Tuple import logging from wechatter.shared.dm.domain import Domai...
{"/wechatter/shared/dm/slots.py": ["/wechatter/shared/utils/io.py"], "/wechatter/server/run_server.py": ["/wechatter/config/__init__.py", "/wechatter/__init__.py", "/wechatter/shared/utils/io.py", "/wechatter/model_training.py"], "/wechatter/model.py": ["/wechatter/shared/utils/io.py", "/wechatter/utils/io.py", "/wecha...
58,295
we-chatter/wechatter
refs/heads/main
/wechatter/shared/dm/conversation.py
# -*- coding: utf-8 -*- """ @Author : Xu @Software: PyCharm @File : conversation.py @Time : 2021/4/2 3:33 下午 @Desc : """ from typing import Dict, List, Text, Any from wechatter.shared.dm.events import Event class Dialogue: """ 对话实例构造 """ def __init__(self, name: Text, ev...
{"/wechatter/shared/dm/slots.py": ["/wechatter/shared/utils/io.py"], "/wechatter/server/run_server.py": ["/wechatter/config/__init__.py", "/wechatter/__init__.py", "/wechatter/shared/utils/io.py", "/wechatter/model_training.py"], "/wechatter/model.py": ["/wechatter/shared/utils/io.py", "/wechatter/utils/io.py", "/wecha...
58,296
we-chatter/wechatter
refs/heads/main
/wechatter/__init__.py
# -*- coding: utf-8 -*- """ @Author : Xu @Software: PyCharm @File : __init__.py.py @Time : 2020/11/17 7:10 下午 @Desc : """ import logging from wechatter import version # define the version before the other imports since these need it __version__ = version.__version__
{"/wechatter/shared/dm/slots.py": ["/wechatter/shared/utils/io.py"], "/wechatter/server/run_server.py": ["/wechatter/config/__init__.py", "/wechatter/__init__.py", "/wechatter/shared/utils/io.py", "/wechatter/model_training.py"], "/wechatter/model.py": ["/wechatter/shared/utils/io.py", "/wechatter/utils/io.py", "/wecha...
58,297
we-chatter/wechatter
refs/heads/main
/wechatter/shared/dm/slots.py
# -*- coding: utf-8 -*- """ @Author : Xu @Software: PyCharm @File : slots.py @Time : 2021/4/1 5:05 下午 @Desc : 槽位的处理逻辑 """ import logging from typing import Any, Dict, List, Optional, Text, Type import wechatter.shared.dm.dm_config from wechatter.shared.exceptions import WechatterExcept...
{"/wechatter/shared/dm/slots.py": ["/wechatter/shared/utils/io.py"], "/wechatter/server/run_server.py": ["/wechatter/config/__init__.py", "/wechatter/__init__.py", "/wechatter/shared/utils/io.py", "/wechatter/model_training.py"], "/wechatter/model.py": ["/wechatter/shared/utils/io.py", "/wechatter/utils/io.py", "/wecha...
58,298
we-chatter/wechatter
refs/heads/main
/wechatter/shared/utils/io.py
# -*- coding: utf-8 -*- """ @Author : Xu @Software: PyCharm @File : io.py @Time : 2021/4/2 5:23 下午 @Desc : """ from collections import OrderedDict import errno import glob from hashlib import md5 from io import StringIO import json import os from pathlib import Path import re from typing im...
{"/wechatter/shared/dm/slots.py": ["/wechatter/shared/utils/io.py"], "/wechatter/server/run_server.py": ["/wechatter/config/__init__.py", "/wechatter/__init__.py", "/wechatter/shared/utils/io.py", "/wechatter/model_training.py"], "/wechatter/model.py": ["/wechatter/shared/utils/io.py", "/wechatter/utils/io.py", "/wecha...
58,299
we-chatter/wechatter
refs/heads/main
/wechatter/shared/nlu/interpreter.py
# -*- coding: utf-8 -*- """ @Author : Xu @Software: PyCharm @File : interpreter.py @Time : 2021/4/6 4:39 下午 @Desc : nlu解析器 """ import json import logging import re from json.decoder import JSONDecodeError from typing import Text, Optional, Dict, Any, Union, List, Tuple logger = logging....
{"/wechatter/shared/dm/slots.py": ["/wechatter/shared/utils/io.py"], "/wechatter/server/run_server.py": ["/wechatter/config/__init__.py", "/wechatter/__init__.py", "/wechatter/shared/utils/io.py", "/wechatter/model_training.py"], "/wechatter/model.py": ["/wechatter/shared/utils/io.py", "/wechatter/utils/io.py", "/wecha...
58,300
we-chatter/wechatter
refs/heads/main
/wechatter/server/run_server.py
# -*- coding: utf-8 -*- """ @Author : Xu @Software: PyCharm @File : run_server.py @Time : 2020/8/26 2:50 下午 @Desc : """ import asyncio import concurrent.futures import logging import multiprocessing import os import tempfile import traceback from collections import defaultdict from functools imp...
{"/wechatter/shared/dm/slots.py": ["/wechatter/shared/utils/io.py"], "/wechatter/server/run_server.py": ["/wechatter/config/__init__.py", "/wechatter/__init__.py", "/wechatter/shared/utils/io.py", "/wechatter/model_training.py"], "/wechatter/model.py": ["/wechatter/shared/utils/io.py", "/wechatter/utils/io.py", "/wecha...
58,301
we-chatter/wechatter
refs/heads/main
/wechatter/model.py
# -*- coding: utf-8 -*- """ @Author : Xu @Software: PyCharm @File : model.py @Time : 2021/4/14 6:26 下午 @Desc : 模型构建 """ import copy import glob import hashlib import logging import os import shutil from subprocess import CalledProcessError, DEVNULL, check_output # skipcq:BAN-B404 import...
{"/wechatter/shared/dm/slots.py": ["/wechatter/shared/utils/io.py"], "/wechatter/server/run_server.py": ["/wechatter/config/__init__.py", "/wechatter/__init__.py", "/wechatter/shared/utils/io.py", "/wechatter/model_training.py"], "/wechatter/model.py": ["/wechatter/shared/utils/io.py", "/wechatter/utils/io.py", "/wecha...
58,302
we-chatter/wechatter
refs/heads/main
/wechatter/shared/importers/wechatter_data.py
# -*- coding: utf-8 -*- """ @Author : Xu @Software: PyCharm @File : wechatter_data.py @Time : 2021/4/12 10:40 上午 @Desc : """ import logging from typing import Dict, List, Optional, Text, Union
{"/wechatter/shared/dm/slots.py": ["/wechatter/shared/utils/io.py"], "/wechatter/server/run_server.py": ["/wechatter/config/__init__.py", "/wechatter/__init__.py", "/wechatter/shared/utils/io.py", "/wechatter/model_training.py"], "/wechatter/model.py": ["/wechatter/shared/utils/io.py", "/wechatter/utils/io.py", "/wecha...
58,303
we-chatter/wechatter
refs/heads/main
/wechatter/dm/tracker_store.py
# -*- coding: utf-8 -*- """ @Author : Xu @Software: PyCharm @File : tracker_store.py @Time : 2021/4/1 3:32 下午 @Desc : 对话状态存储 """ import contextlib import itertools import json import logging import os import pickle from datetime import datetime, timezone from time import sleep from typi...
{"/wechatter/shared/dm/slots.py": ["/wechatter/shared/utils/io.py"], "/wechatter/server/run_server.py": ["/wechatter/config/__init__.py", "/wechatter/__init__.py", "/wechatter/shared/utils/io.py", "/wechatter/model_training.py"], "/wechatter/model.py": ["/wechatter/shared/utils/io.py", "/wechatter/utils/io.py", "/wecha...
58,304
we-chatter/wechatter
refs/heads/main
/wechatter/config/config.py
# -*- coding: utf-8 -*- """ @Author : Xu @Software: PyCharm @File : config.py @Time : 2020/11/10 9:04 上午 @Desc : """ import os class Config(): """ Basic config for demo02 """ # Application config TIMEZONE = 'Asia/Shanghai' # BASE_DIR = os.path.dirname(os.path.dirn...
{"/wechatter/shared/dm/slots.py": ["/wechatter/shared/utils/io.py"], "/wechatter/server/run_server.py": ["/wechatter/config/__init__.py", "/wechatter/__init__.py", "/wechatter/shared/utils/io.py", "/wechatter/model_training.py"], "/wechatter/model.py": ["/wechatter/shared/utils/io.py", "/wechatter/utils/io.py", "/wecha...
58,305
we-chatter/wechatter
refs/heads/main
/wechatter/model_training.py
# -*- coding: utf-8 -*- """ @Author : Xu @Software: PyCharm @File : model_training.py @Time : 2020/11/17 8:56 下午 @Desc : train model """ import asyncio import os import tempfile from contextlib import ExitStack from typing import ( Text, NamedTuple, Tuple, Optional, L...
{"/wechatter/shared/dm/slots.py": ["/wechatter/shared/utils/io.py"], "/wechatter/server/run_server.py": ["/wechatter/config/__init__.py", "/wechatter/__init__.py", "/wechatter/shared/utils/io.py", "/wechatter/model_training.py"], "/wechatter/model.py": ["/wechatter/shared/utils/io.py", "/wechatter/utils/io.py", "/wecha...
58,306
we-chatter/wechatter
refs/heads/main
/wechatter/exceptions.py
# -*- coding: utf-8 -*- """ @Author : Xu @Software: PyCharm @File : exceptions.py @Time : 2021/4/15 3:54 下午 @Desc : 异常处理 """ from typing import Text from wechatter.shared.exceptions import WechatterException class ModelNotFound(WechatterException): """Raised when a model is not fou...
{"/wechatter/shared/dm/slots.py": ["/wechatter/shared/utils/io.py"], "/wechatter/server/run_server.py": ["/wechatter/config/__init__.py", "/wechatter/__init__.py", "/wechatter/shared/utils/io.py", "/wechatter/model_training.py"], "/wechatter/model.py": ["/wechatter/shared/utils/io.py", "/wechatter/utils/io.py", "/wecha...
58,307
we-chatter/wechatter
refs/heads/main
/setup.py
# -*- coding: utf-8 -*- """ @Author : Xu @Software: PyCharm @File : setup.py @Time : 2020/9/17 7:20 下午 @Desc : version information """ from setuptools import setup packages = \ ['wechatter', ] package_data = \ {'': ['*'], 'wechatter.dm': ['schemas/*']} install_requires = [ 'tensorflow>=2...
{"/wechatter/shared/dm/slots.py": ["/wechatter/shared/utils/io.py"], "/wechatter/server/run_server.py": ["/wechatter/config/__init__.py", "/wechatter/__init__.py", "/wechatter/shared/utils/io.py", "/wechatter/model_training.py"], "/wechatter/model.py": ["/wechatter/shared/utils/io.py", "/wechatter/utils/io.py", "/wecha...