repo_full_name stringlengths 6 93 | repo_url stringlengths 25 112 | repo_api_url stringclasses 28
values | owner stringclasses 28
values | repo_name stringclasses 28
values | description stringclasses 28
values | stars int64 617 98.8k | forks int64 31 355 ⌀ | watchers int64 990 999 ⌀ | license stringclasses 2
values | default_branch stringclasses 2
values | repo_created_at timestamp[s]date 2012-07-24 23:12:50 2025-06-16 08:07:28 ⌀ | repo_updated_at timestamp[s]date 2026-02-23 15:23:15 2026-05-03 18:52:12 ⌀ | repo_topics listlengths 0 13 ⌀ | repo_languages unknown | is_fork bool 1
class | open_issues int64 3 104 ⌀ | file_path stringlengths 3 208 | file_name stringclasses 509
values | file_extension stringclasses 1
value | file_size_bytes int64 101 84k ⌀ | file_url stringclasses 627
values | file_raw_url stringclasses 627
values | file_sha stringclasses 624
values | language stringclasses 8
values | parsed_at stringdate 2026-05-04 01:12:36 2026-05-04 19:41:55 | text stringlengths 100 102k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI | null | null | null | null | 35,448 | null | null | mit | null | null | null | null | null | null | null | infer/lib/uvr5_pack/lib_v5/nets_33966KB.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:31.112447 | import torch
import torch.nn.functional as F
from torch import nn
from . import layers_33966KB as layers
class BaseASPPNet(nn.Module):
def __init__(self, nin, ch, dilations=(4, 8, 16, 32)):
super(BaseASPPNet, self).__init__()
self.enc1 = layers.Encoder(nin, ch, 3, 2, 1)
self.enc2 = layers... |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI | null | null | null | null | 35,448 | null | null | mit | null | null | null | null | null | null | null | infer/lib/uvr5_pack/lib_v5/nets_123812KB.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:31.132772 | import torch
import torch.nn.functional as F
from torch import nn
from . import layers_123821KB as layers
class BaseASPPNet(nn.Module):
def __init__(self, nin, ch, dilations=(4, 8, 16)):
super(BaseASPPNet, self).__init__()
self.enc1 = layers.Encoder(nin, ch, 3, 2, 1)
self.enc2 = layers.En... |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI | null | null | null | null | 35,448 | null | null | mit | null | null | null | null | null | null | null | infer/lib/uvr5_pack/lib_v5/model_param_init.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:31.146465 | import json
import os
import pathlib
default_param = {}
default_param["bins"] = 768
default_param["unstable_bins"] = 9 # training only
default_param["reduction_bins"] = 762 # training only
default_param["sr"] = 44100
default_param["pre_filter_start"] = 757
default_param["pre_filter_stop"] = 768
default_param["band"]... |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI | null | null | null | null | 35,448 | null | null | mit | null | null | null | null | null | null | null | infer/lib/uvr5_pack/lib_v5/nets_537227KB.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:31.343819 | import numpy as np
import torch
import torch.nn.functional as F
from torch import nn
from . import layers_537238KB as layers
class BaseASPPNet(nn.Module):
def __init__(self, nin, ch, dilations=(4, 8, 16)):
super(BaseASPPNet, self).__init__()
self.enc1 = layers.Encoder(nin, ch, 3, 2, 1)
se... |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI | null | null | null | null | 35,448 | null | null | mit | null | null | null | null | null | null | null | infer/lib/uvr5_pack/lib_v5/nets_537238KB.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:31.347085 | import numpy as np
import torch
import torch.nn.functional as F
from torch import nn
from . import layers_537238KB as layers
class BaseASPPNet(nn.Module):
def __init__(self, nin, ch, dilations=(4, 8, 16)):
super(BaseASPPNet, self).__init__()
self.enc1 = layers.Encoder(nin, ch, 3, 2, 1)
se... |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI | null | null | null | null | 35,448 | null | null | mit | null | null | null | null | null | null | null | infer/lib/uvr5_pack/lib_v5/nets_61968KB.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:31.432777 | import torch
import torch.nn.functional as F
from torch import nn
from . import layers_123821KB as layers
class BaseASPPNet(nn.Module):
def __init__(self, nin, ch, dilations=(4, 8, 16)):
super(BaseASPPNet, self).__init__()
self.enc1 = layers.Encoder(nin, ch, 3, 2, 1)
self.enc2 = layers.En... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | 1 File handle/File handle text/file handle 12 length of line in text file.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:34.148520 | import os
import time
file_name = input("Enter the file name to create:- ")
print(file_name)
def write_to_file(file_name):
if os.path.exists(file_name):
print(f"Error: {file_name} already exists.")
return
with open(file_name, "a") as F:
while True:
text = ... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | 1 File handle/File handle binary/read.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:34.150585 | import pickle
def binary_read():
with open("studrec.dat", "rb") as b:
stud = pickle.load(b)
print(stud)
# prints the whole record in nested list format
print("contents of binary file")
for ch in stud:
print(ch) # prints one of the chosen rec in list
... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | 1 File handle/File handle text/input,output and error streams.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:34.151930 | # practicing with streams
import sys
sys.stdout.write("Enter the name of the file")
file = sys.stdin.readline()
with open(
file.strip(),
) as F:
while True:
ch = F.readlines()
for i in ch: # ch is the whole file,for i in ch gives lines, for j in i gives letters,for j in i.split giv... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | 1 File handle/File handle text/counter.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:34.153538 | """
Class resposible for counting words for different files:
- Reduce redundant code
- Easier code management/debugging
- Code readability
"""
class Counter:
def __init__(self, text: str) -> None:
self.text = text
# Define the initial count of the lower and upper case.
self.count_lower = ... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | 1 File handle/File handle binary/delete.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:34.155098 | import logging
import os
import pickle
from dotenv import load_dotenv
base = os.path.dirname(__file__)
load_dotenv(os.path.join(base, ".env"))
logging.basicConfig(level=logging.INFO, format="%(levelname)s: %(message)s")
student_record = os.getenv("STUDENTS_RECORD_FILE")
def b_read():
# Opening a file & loading... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | 1 File handle/File handle binary/update2.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:34.156162 | # Updating records in a binary file
# ! Have a .env file please
import pickle
import os
from dotenv import load_dotenv
base = os.path.dirname(__file__)
load_dotenv(os.path.join(base, ".env"))
student_record = os.getenv("STUDENTS_RECORD_FILE")
def update():
with open(student_record, "rb") as F:
S = pickle... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | 1 File handle/File handle binary/Update a binary file2.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:34.157104 | # updating records in a binary file
import pickle
def update():
with open("studrec.dat", "rb+") as File:
value = pickle.load(File)
found = False
roll = int(input("Enter the roll number of the record"))
for i in value:
if roll == i[0]:
prin... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | 1 File handle/File handle binary/search record in binary file.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:34.211349 | # binary file to search a given record
import pickle
from dotenv import load_dotenv
def search():
with open("student_records.pkl", "rb") as F:
# your file path will be different
search = True
rno = int(input("Enter the roll number of the student"))
for i in pickle.loa... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | 1 File handle/File handle binary/question 1 (elegible for remedial, top marks).py | null | null | null | null | null | null | Python | 2026-05-04T02:22:34.261352 | """Amit is a monitor of class XII-A and he stored the record of all
the students of his class in a file named “student_records.pkl”.
Structure of record is [roll number, name, percentage]. His computer
teacher has assigned the following duty to Amit
Write a function remcount( ) to count the number of students who... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | 1 File handle/File handle text/question 2.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:34.281299 | """Write a method/function DISPLAYWORDS() in python to read lines
from a text file STORY.TXT,
using read function
and display those words, which are less than 4 characters."""
print("Hey!! You can print the word which are less then 4 characters")
def display_words(file_path):
try:
with open(f... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | 1 File handle/File handle text/question3.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:34.761264 | """Write a user-defined function named count() that will read
the contents of text file named “happy.txt” and count
the number of lines which starts with either “I‟ or “M‟."""
import os
import time
file_name = input("Enter the file name to create:- ")
# step1:
print(file_name)
def write_to_file(file_n... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | A solution to project euler problem 3.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:34.790828 | """
Problem:
The prime factors of 13195 are 5,7,13 and 29. What is the largest prime factor
of a given number N?
e.g. for 10, largest prime factor = 5. For 17, largest prime factor = 17.
"""
# def solution(n: int) -> int:
def solution(n: int = 600851475143) -> int:
"""Returns the largest prime factor of a given ... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | 1 File handle/File handle text/question 6.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:34.839904 | """Write a function in python to count the number of lowercase
alphabets present in a text file “happy.txt”"""
from counter import Counter
def lowercase():
with open("happy.txt") as F:
word_counter = Counter(F.read())
print(
f"The total number of lower case letters are {wo... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | ARKA.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:34.840982 | def sumOfSeries(n):
x = n * (n + 1) / 2
return (int)(x * x)
# Driver Function
n = 5
print(sumOfSeries(n))
|
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | AREA OF TRIANGLE.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:34.860119 | def get_valid_side(prompt:str):
while True:
try:
value = float(input(prompt))
if value <=0:
print("Side must be positive")
continue
return value
except ValueError:
print("Invalid Input")
a = get_valid_side("Enter side 1: ")
b = get_valid_side("Enter side 2: ")
c = get... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | ASCIIvaluecharacter.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:34.872421 | # Program to find the ASCII value of the given character
c = "p"
print("The ASCII value of '" + c + "' is", ord(c))
|
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | Add_two_Linked_List.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:34.886388 | class Node:
def __init__(self, data):
self.data = data
self.next = None
class LinkedList:
def __init__(self):
self.head = None
def insert_at_beginning(self, new_data):
new_node = Node(new_data)
if self.head is None:
self.head = new_node
... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | 1 File handle/File handle text/question 5.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:34.911111 | """Write a function in python to count the number of lowercase
alphabets present in a text file “happy.txt"""
import time
import os
from counter import Counter
print(
"You will see the count of lowercase, uppercase and total count of alphabets in provided file.."
)
file_path = input("Please, Enter f... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | 8_puzzle.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:34.912554 | from queue import PriorityQueue
from typing import List, Tuple, Optional, Set
class PuzzleState:
"""Represents a state in 8-puzzle solving with A* algorithm."""
def __init__(
self,
board: List[List[int]],
goal: List[List[int]],
moves: int = 0,
previous: Optional["Puzzl... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | 1 File handle/File handle text/special symbol after word.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:34.953323 | with open("happy.txt", "r") as F:
# method 1
for i in F.read().split():
print(i, "*", end="")
print("\n")
# method 2
F.seek(0)
for line in F.readlines():
for word in line.split():
print(word, "*", end="")
|
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | AutoComplete_App/backend.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:35.457177 | import sqlite3
import json
class AutoComplete:
"""
It works by building a `WordMap` that stores words to word-follower-count
----------------------------
e.g. To train the following statement:
It is not enough to just know how tools work and what they worth,
we have got to learn how to use th... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | AutoComplete_App/frontend.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:35.476272 | from tkinter import *
import backend
def train():
sentence = train_entry.get()
ac = backend.AutoComplete()
ac.train(sentence)
def predict_word():
word = predict_word_entry.get()
ac = backend.AutoComplete()
print(ac.predict(word))
if __name__ == "__main__":
root = Tk()
root.title("I... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | Audio_Summarizer.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:35.476812 | import whisper
import re
import openai
import os
def transcript_generator():
# Load Whisper model
model = whisper.load_model("base")
# Transcribe audio file
result = model.transcribe("audio.mp4")
# Send the transcript to the summarizer
provide_summarizer(result)
def provide_summarizer(Text... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | AreaOfTriangle.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:35.490824 | # Python Program to find the area of triangle when all three side-lengths are known!
a = 5
b = 6
c = 7
# Uncomment below to take inputs from the user
# a = float(input('Enter first side: '))
# b = float(input('Enter second side: '))
# c = float(input('Enter third side: '))
# calculate the semi-perimeter
s = (a + b +... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | Assembler/assembler.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:35.500608 | from __future__ import print_function
import sys
lines = [] # contains the lines of the file.
tokens = [] # contains all tokens of the source code.
# register eax, ebx,..., ecx
eax = 1
ebx = 0
ecx = 0
edx = 0
# status register
zeroFlag = False
# stack data structure
# push --> append
# pop --> pop
stack = []
# ... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | Automated Scheduled Call Reminders/caller.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:35.512386 | # The project automates calls for people from the firebase cloud database and the schedular keeps it running and checks for entries
# every 1 hour using aps scedular
# The project can be used to set 5 min before reminder calls to a set of people for doing a particular job
from firebase_admin import credentials, firesto... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | Automated Scheduled Call Reminders/schedular.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:35.543871 | # schedular code for blocking schedular as we have only 1 process to run
from apscheduler.schedulers.blocking import BlockingScheduler
from caller import search
sched = BlockingScheduler()
# Schedule job_function to be called every two hours
sched.add_job(search, "interval", hours=1) # for testing instead add hou... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | Anonymous_TextApp.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:35.544988 | import tkinter as tk
from PIL import Image, ImageTk
from twilio.rest import Client
window = tk.Tk()
window.title("Anonymous_Text_App")
window.geometry("800x750")
# Define global variables
body = ""
to = ""
def message():
global body, to
account_sid = "Your_account_sid" # Your account sid
auth_token = "... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | Armstrong_number.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:35.587508 | def is_armstrong_number(number: str) -> bool:
"""Check if a number (as a string) is a narcissistic/Armstrong number."""
# Logic: Get the exponent (number of digits)
exponent = len(number)
# Logic: Sum each digit raised to the power in a single line
# This uses a generator, which is memory... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | Base Converter Number system.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:35.636608 | def base_check(xnumber, xbase):
for char in xnumber[len(xnumber) - 1]:
if int(char) >= int(xbase):
return False
return True
def convert_from_10(xnumber, xbase, arr, ybase):
if int(xbase) == 2 or int(xbase) == 4 or int(xbase) == 6 or int(xbase) == 8:
if xnumber == 0:
... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | BlackJack_game/blackjack.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:36.283104 | # master
# master
# BLACK JACK - CASINO A GAME OF FORTUNE!!!
from time import sleep
# BLACK JACK - CASINO
# PYTHON CODE BASE
# master
import random
deck = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10, 11] * 4
random.shuffle(deck)
print(f"{'*' * 58} \n Welcome to the game Casino - BLACK JACK ! \n{'*' * 58}")
sleep(2... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | Battery_notifier.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:36.285120 | from plyer import notification # pip install plyer
import psutil # pip install psutil
# psutil.sensors_battery() will return the information related to battery
battery = psutil.sensors_battery()
# battery percent will return the current battery prcentage
percent = battery.percent
charging = battery.power_plugged
#... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | Binary Coefficients.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:36.326189 | def pascal_triangle(lineNumber):
list1 = list()
list1.append([1])
i = 1
while i <= lineNumber:
j = 1
l = []
l.append(1)
while j < i:
l.append(list1[i - 1][j] + list1[i - 1][j - 1])
j = j + 1
l.append(1)
list1.append(l)
i = i... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | BoardGame-CLI/python.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:36.357360 | import random
# Define the game board with snakes and ladders
snakes_and_ladders = {
2: 38,
7: 14,
8: 31,
15: 26,
16: 6,
21: 42,
28: 84,
36: 44,
46: 25,
49: 11,
51: 67,
62: 19,
64: 60,
71: 91,
74: 53,
78: 98,
87: 94,
89: 68,
92: 88,
95: 75... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | BlackJack_game/blackjack_rr.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:36.366583 | import random
class Colour:
BLACK = "\033[30m"
RED = "\033[91m"
GREEN = "\033[32m"
END = "\033[0m"
suits = (
Colour.RED + "Hearts" + Colour.END,
Colour.RED + "Diamonds" + Colour.END,
Colour.BLACK + "Spades" + Colour.END,
Colour.BLACK + "Clubs" + Colour.END,
)
ranks = (
"Two",
... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | BoardGame-CLI/snakeLadder.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:36.590200 | import random
# Taking players data
players = {} # stores players name their locations
isReady = {}
current_loc = 1 # variable for iterating location
imp = True
# players input function
def player_input():
global players
global current_loc
global isReady
x = True
while x:
player_num =... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | BrowserHistory/rock_paper_scissors.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:36.883157 | """
Triple Round : Rock, Paper, Scissors Game (CLI Version)
Final round is the Winning Round
Author: Your Name
"""
import random
def get_user_choice():
"""Prompt the user to enter their choice."""
choice = input("Enter your choice (rock, paper, scissors): ").lower()
if choice in ["rock", "paper", "scisso... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | BruteForce.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:37.286553 | from itertools import product
def findPassword(chars, function, show=50, format_="%s"):
password = None
attempts = 0
size = 1
stop = False
while not stop:
# Obtém todas as combinações possíveis com os dígitos do parâmetro "chars".
for pw in product(chars, repeat=size):
... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | CRC/crc.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:37.287449 | def crc_check(data, div):
l = len(div)
ct = 0
data = [int(i) for i in data]
div = [int(i) for i in div]
zero = [0 for i in range(l)]
temp_data = [data[i] for i in range(l)]
result = []
for j in range(len(data) - len(div) + 1):
print("Temp_dividend", temp_data)
m... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | BrowserHistory/tests/test_browser_history.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:37.493545 | import unittest
import sys
import os
# Add parent directory to path to import backend
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from backend import BrowserHistory
class TestBrowserHistory(unittest.TestCase):
def setUp(self):
"""Set up test cases"""
self.browser ... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | BrowserHistory/backend.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:37.495051 | class DLL:
"""
a doubly linked list that holds the current page,
next page, and previous page.
Used to enforce order in operations.
"""
def __init__(self, val: str = None):
self.val = val
self.nxt = None
self.prev = None
class BrowserHistory:
"""
This class des... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | BlackJack_game/blackjack_simulate.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:37.495865 | import os
import random
from functools import namedtuple
"""
Target: BlackJack 21 simulate
- Role
- Dealer: 1
- Insurance: (When dealer Get A(1) face up)
- When dealer got 21
- lost chips
- When dealer doesn't got 21
- win ... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | Binary_search.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:37.685844 | # It returns location of x in given array arr
# if present, else returns -1
def binary_search(arr, l, r, x):
# Base case: if left index is greater than right index, element is not present
if l > r:
return -1
# Calculate the mid index
mid = (l + r) // 2
# If element is present at the middle... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | CSV_file.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:37.686314 | import pandas as pd
# loading the dataset
df = pd.read_csv(
r"c:\PROJECT\Drug_Recommendation_System\drug_recommendation_system\Drugs_Review_Datasets.csv"
)
print(df) # prints Dataset
# funtions
print(df.tail())
print(df.head())
print(df.info())
print(df.describe())
print(df.column)
print(df.shape())
|
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | Binary_to_Decimal.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:37.715123 | # Program to convert binary to decimal
def binaryToDecimal(binary):
"""
>>> binaryToDecimal(111110000)
496
>>> binaryToDecimal(10100)
20
>>> binaryToDecimal(101011)
43
"""
decimal, i, n = 0, 0, 0
while binary != 0:
dec = binary % 10
decimal = decimal + dec * pow... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | Calculate resistance.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:38.044292 | def res(R1, R2):
sum = R1 + R2
if option == "series":
return sum
elif option == "parallel":
return (R1 * R2) / sum
return 0
Resistance1 = float(input("Enter R1 : "))
Resistance2 = float(input("Enter R2 : "))
option = input("Enter series or parallel :")
print("\n")
R = res(Resistance1, ... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | Calculator with simple ui.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:38.088840 | # Program make a simple calculator
class Calculator:
def __init__(self):
pass
def add(self, num1, num2):
"""
This function adds two numbers.
Examples:
>>> add(2, 3)
5
>>> add(5, 9)
14
>>> add(-1, 2)
1
"""
return ... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | Calendar (GUI).py | null | null | null | null | null | null | Python | 2026-05-04T02:22:38.142773 | from tkinter import *
import calendar
root = Tk()
# root.geometry("400x300")
root.title("Calendar")
# Function
def text():
month_int = int(month.get())
year_int = int(year.get())
cal = calendar.month(year_int, month_int)
textfield.delete(0.0, END)
textfield.insert(INSERT, cal)
# Creating Label... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | Caesar Cipher Encoder & Decoder.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:42.704744 | # PROJECT1
# CAESAR CIPHER ENCODER/DECODER
# Author: InTruder
# Cloned from: https://github.com/InTruder-Sec/caesar-cipher
# Improved by: OfficialAhmed (https://github.com/OfficialAhmed)
def get_int() -> int:
"""
Get integer, otherwise redo
"""
try:
key = int(input("Enter number of characte... |
geekcomputers/Python | https://github.com/geekcomputers/Python | null | null | null | null | 34,997 | null | null | mit | null | null | null | null | null | null | null | BoardGame-CLI/uno.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:46.321291 | # uno game #
import random
from typing import List
"""
Generate the UNO deck of 108 cards.
Doctest examples:
>>> deck = buildDeck()
>>> len(deck)
108
>>> sum(1 for c in deck if 'Wild' in c)
8
Return: list of card strings (e.g. 'Red 7', 'Wild Draw Four')
"""
def buildDeck() -> List[str]:
deck: List[... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | jieba/analyse/textrank.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:48.522091 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import sys
from operator import itemgetter
from collections import defaultdict
import jieba.posseg
from .tfidf import KeywordExtractor
from .._compat import *
class UndirectWeightedGraph:
d = 0.85
def __in... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | jieba/analyse/tfidf.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:48.540488 | # encoding=utf-8
from __future__ import absolute_import
import os
import jieba
import jieba.posseg
from operator import itemgetter
_get_module_path = lambda path: os.path.normpath(os.path.join(os.getcwd(),
os.path.dirname(__file__), path))
_get_abs_path = jieba._get_abs... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | jieba/analyse/analyzer.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:48.542168 | # encoding=utf-8
from __future__ import unicode_literals
from whoosh.analysis import RegexAnalyzer, LowercaseFilter, StopFilter, StemFilter
from whoosh.analysis import Tokenizer, Token
from whoosh.lang.porter import stem
import jieba
import re
STOP_WORDS = frozenset(('a', 'an', 'and', 'are', 'as', 'at', 'be', 'by', '... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | jieba/__main__.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:48.544006 | """Jieba command line interface."""
import sys
import jieba
from argparse import ArgumentParser
from ._compat import *
parser = ArgumentParser(usage="%s -m jieba [options] filename" % sys.executable, description="Jieba command line interface.", epilog="If no filename specified, use STDIN instead.")
parser.add_argument... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | jieba/finalseg/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:48.545225 | from __future__ import absolute_import, unicode_literals
import re
import os
import sys
import pickle
from .._compat import *
MIN_FLOAT = -3.14e100
PROB_START_P = "prob_start.p"
PROB_TRANS_P = "prob_trans.p"
PROB_EMIT_P = "prob_emit.p"
PrevStatus = {
'B': 'ES',
'M': 'MB',
'S': 'SE',
'E': 'BM'
}
For... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | jieba/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:48.560269 | from __future__ import absolute_import, unicode_literals
__version__ = '0.42.1'
__license__ = 'MIT'
import marshal
import re
import tempfile
import threading
import time
from hashlib import md5
from math import log
from . import finalseg
from ._compat import *
if os.name == 'nt':
from shutil import move as _rep... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | jieba/analyse/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:48.566155 | from __future__ import absolute_import
from .tfidf import TFIDF
from .textrank import TextRank
try:
from .analyzer import ChineseAnalyzer
except ImportError:
pass
default_tfidf = TFIDF()
default_textrank = TextRank()
extract_tags = tfidf = default_tfidf.extract_tags
set_idf_path = default_tfidf.set_idf_path
t... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | jieba/finalseg/prob_trans.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:48.572598 | P={'B': {'E': -0.510825623765990, 'M': -0.916290731874155},
'E': {'B': -0.5897149736854513, 'S': -0.8085250474669937},
'M': {'E': -0.33344856811948514, 'M': -1.2603623820268226},
'S': {'B': -0.7211965654669841, 'S': -0.6658631448798212}}
|
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | jieba/_compat.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:48.574519 | # -*- coding: utf-8 -*-
import logging
import os
import sys
log_console = logging.StreamHandler(sys.stderr)
default_logger = logging.getLogger(__name__)
default_logger.setLevel(logging.DEBUG)
def setLogLevel(log_level):
default_logger.setLevel(log_level)
check_paddle_install = {'is_paddle_installed': False}
t... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | jieba/lac_small/creator.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:49.134105 | # -*- coding: UTF-8 -*-
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | jieba/lac_small/nets.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:49.170804 | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | jieba/lac_small/utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:49.185392 | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | jieba/lac_small/reader_small.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:49.186816 | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | jieba/lac_small/predict.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:49.200525 | # -*- coding: UTF-8 -*-
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | setup.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:49.203719 | # -*- coding: utf-8 -*-
from distutils.core import setup
LONGDOC = """
jieba
=====
“结巴”中文分词:做最好的 Python 中文分词组件
"Jieba" (Chinese for "to stutter") Chinese text segmentation: built to
be the best Python Chinese word segmentation module.
完整文档见 ``README.md``
GitHub: https://github.com/fxsjy/jieba
特点
====
- 支持三种分词模式:... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | jieba/posseg/viterbi.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:49.204390 | import sys
import operator
MIN_FLOAT = -3.14e100
MIN_INF = float("-inf")
if sys.version_info[0] > 2:
xrange = range
def get_top_states(t_state_v, K=4):
return sorted(t_state_v, key=t_state_v.__getitem__, reverse=True)[:K]
def viterbi(obs, states, start_p, trans_p, emit_p):
V = [{}] # tabular
mem_p... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | jieba/posseg/prob_start.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:49.206278 | P={('B', 'a'): -4.762305214596967,
('B', 'ad'): -6.680066036784177,
('B', 'ag'): -3.14e+100,
('B', 'an'): -8.697083223018778,
('B', 'b'): -5.018374362109218,
('B', 'bg'): -3.14e+100,
('B', 'c'): -3.423880184954888,
('B', 'd'): -3.9750475297585357,
('B', 'df'): -8.888974230828882,
('B', 'dg'): -3.14e+100,
('B'... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | jieba/posseg/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:49.223692 | from __future__ import absolute_import, unicode_literals
import pickle
import re
import jieba
from .viterbi import viterbi
from .._compat import *
PROB_START_P = "prob_start.p"
PROB_TRANS_P = "prob_trans.p"
PROB_EMIT_P = "prob_emit.p"
CHAR_STATE_TAB_P = "char_state_tab.p"
re_han_detail = re.compile("([\u4E00-\u9FD5... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | test/demo.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:49.817428 | #encoding=utf-8
from __future__ import unicode_literals
import sys
sys.path.append("../")
import jieba
import jieba.posseg
import jieba.analyse
print('='*40)
print('1. 分词')
print('-'*40)
seg_list = jieba.cut("我来到北京清华大学", cut_all=True)
print("Full Mode: " + "/ ".join(seg_list)) # 全模式
seg_list = jieba.cut("我来到北京清华大学... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | test/extract_tags_stop_words.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:49.985488 | import sys
sys.path.append('../')
import jieba
import jieba.analyse
from optparse import OptionParser
USAGE = "usage: python extract_tags_stop_words.py [file name] -k [top k]"
parser = OptionParser(USAGE)
parser.add_option("-k", dest="topK")
opt, args = parser.parse_args()
if len(args) < 1:
print(USAGE)
... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | test/extract_topic.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:49.986066 | import sys
sys.path.append("../")
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn import decomposition
import jieba
import time
import glob
import sys
import os
import random
if len(sys.argv)<2:
print("usage: extract_topic.py di... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | test/extract_tags_with_weight.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:49.988098 | import sys
sys.path.append('../')
import jieba
import jieba.analyse
from optparse import OptionParser
USAGE = "usage: python extract_tags_with_weight.py [file name] -k [top k] -w [with weight=1 or 0]"
parser = OptionParser(USAGE)
parser.add_option("-k", dest="topK")
parser.add_option("-w", dest="withWeight")
opt,... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | test/parallel/extract_tags.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:49.990124 | import sys
sys.path.append('../../')
import jieba
jieba.enable_parallel(4)
import jieba.analyse
from optparse import OptionParser
USAGE ="usage: python extract_tags.py [file name] -k [top k]"
parser = OptionParser(USAGE)
parser.add_option("-k",dest="topK")
opt, args = parser.parse_args()
if len(args) <1:
pr... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | test/jiebacmd.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:49.991104 | '''
usage example (find top 100 words in abc.txt):
cat abc.txt | python jiebacmd.py | sort | uniq -c | sort -nr -k1 | head -100
'''
from __future__ import unicode_literals
import sys
sys.path.append("../")
import jieba
default_encoding='utf-8'
if len(sys.argv)>1:
default_encoding = sys.argv[1]
while True:
... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | test/jieba_test.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:49.992613 | #-*-coding: utf-8 -*-
from __future__ import unicode_literals, print_function
import sys
sys.path.append("../")
import unittest
import types
import jieba
if sys.version_info[0] > 2:
from imp import reload
jieba.initialize()
test_contents = [
"这是一个伸手不见五指的黑夜。我叫孙悟空,我爱北京,我爱Python和C++。",
"我不喜欢日本和服。",
"雷猴回... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | test/extract_tags.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:50.021611 | import sys
sys.path.append('../')
import jieba
import jieba.analyse
from optparse import OptionParser
USAGE = "usage: python extract_tags.py [file name] -k [top k]"
parser = OptionParser(USAGE)
parser.add_option("-k", dest="topK")
opt, args = parser.parse_args()
if len(args) < 1:
print(USAGE)
sys.exit(1... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | test/parallel/test.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:50.022974 | #encoding=utf-8
from __future__ import print_function
import sys
sys.path.append("../../")
import jieba
jieba.enable_parallel(4)
def cuttest(test_sent):
result = jieba.cut(test_sent)
for word in result:
print(word, "/", end=' ')
print("")
if __name__ == "__main__":
cuttest("这是一个伸手不见五指的黑夜。我叫孙... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | test/extract_tags_idfpath.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:50.023920 | import sys
sys.path.append('../')
import jieba
import jieba.analyse
from optparse import OptionParser
USAGE = "usage: python extract_tags_idfpath.py [file name] -k [top k]"
parser = OptionParser(USAGE)
parser.add_option("-k", dest="topK")
opt, args = parser.parse_args()
if len(args) < 1:
print(USAGE)
sy... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | test/parallel/test2.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:51.042341 | #encoding=utf-8
from __future__ import print_function
import sys
sys.path.append("../../")
import jieba
jieba.enable_parallel(4)
def cuttest(test_sent):
result = jieba.cut(test_sent,cut_all=True)
for word in result:
print(word, "/", end=' ')
print("")
if __name__ == "__main__":
cuttest("这是一个... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | test/test_cutall.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:51.871930 | #encoding=utf-8
from __future__ import print_function
import sys
sys.path.append("../")
import jieba
def cuttest(test_sent):
result = jieba.cut(test_sent,cut_all=True)
for word in result:
print(word, "/", end=' ')
print("")
if __name__ == "__main__":
cuttest("这是一个伸手不见五指的黑夜。我叫孙悟空,我爱北京,我爱Pytho... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | test/test_file.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:52.691218 | import time
import sys
sys.path.append("../")
import jieba
jieba.initialize()
url = sys.argv[1]
content = open(url,"rb").read()
t1 = time.time()
words = "/ ".join(jieba.cut(content))
t2 = time.time()
tm_cost = t2-t1
log_f = open("1.log","wb")
log_f.write(words.encode('utf-8'))
log_f.close()
print('cost ' + str(tm_c... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | test/test_lock.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:53.480740 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import jieba
import threading
def inittokenizer(tokenizer, group):
print('===> Thread %s:%s started' % (group, threading.current_thread().ident))
tokenizer.initialize()
print('<=== Thread %s:%s finished' % (group, threading.current_thread().ident))
tokrs1 = [jieba.Tok... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | test/test_multithread.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:54.299933 | #encoding=utf-8
import sys
import threading
sys.path.append("../")
import jieba
class Worker(threading.Thread):
def run(self):
seg_list = jieba.cut("我来到北京清华大学",cut_all=True)
print("Full Mode:" + "/ ".join(seg_list)) #全模式
seg_list = jieba.cut("我来到北京清华大学",cut_all=False)
print("Defau... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | test/test_no_hmm.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:55.122692 | #encoding=utf-8
import sys
sys.path.append("../")
import jieba
def cuttest(test_sent):
result = jieba.cut(test_sent,HMM=False)
print(" / ".join(result))
if __name__ == "__main__":
cuttest("这是一个伸手不见五指的黑夜。我叫孙悟空,我爱北京,我爱Python和C++。")
cuttest("我不喜欢日本和服。")
cuttest("雷猴回归人间。")
cuttest("工信处女干事每月经过下属科... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | test/parallel/test_pos_file.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:55.610185 | from __future__ import print_function
import sys,time
import sys
sys.path.append("../../")
import jieba
import jieba.posseg as pseg
jieba.enable_parallel(4)
url = sys.argv[1]
content = open(url,"rb").read()
t1 = time.time()
words = list(pseg.cut(content))
t2 = time.time()
tm_cost = t2-t1
log_f = open("1.log","w")
l... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | test/test.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:55.627837 | #encoding=utf-8
import sys
sys.path.append("../")
import jieba
def cuttest(test_sent):
result = jieba.cut(test_sent)
print(" / ".join(result))
if __name__ == "__main__":
cuttest("这是一个伸手不见五指的黑夜。我叫孙悟空,我爱北京,我爱Python和C++。")
cuttest("我不喜欢日本和服。")
cuttest("雷猴回归人间。")
cuttest("工信处女干事每月经过下属科室都要亲口交代24口... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | test/parallel/test_cut_for_search.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:55.629518 | #encoding=utf-8
from __future__ import print_function
import sys
sys.path.append("../../")
import jieba
jieba.enable_parallel(4)
def cuttest(test_sent):
result = jieba.cut_for_search(test_sent)
for word in result:
print(word, "/", end=' ')
print("")
if __name__ == "__main__":
cuttest("这是一个伸手... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | test/parallel/test_file.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:55.630962 | import sys
import time
sys.path.append("../../")
import jieba
jieba.enable_parallel()
url = sys.argv[1]
content = open(url,"rb").read()
t1 = time.time()
words = "/ ".join(jieba.cut(content))
t2 = time.time()
tm_cost = t2-t1
log_f = open("1.log","wb")
log_f.write(words.encode('utf-8'))
print('speed %s bytes/second'... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | test/parallel/test_pos.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:55.631971 | #encoding=utf-8
from __future__ import print_function
import sys
sys.path.append("../../")
import jieba
jieba.enable_parallel(4)
import jieba.posseg as pseg
def cuttest(test_sent):
result = pseg.cut(test_sent)
for w in result:
print(w.word, "/", w.flag, ", ", end=' ')
print("")
if __name__ == "... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | test/test_bug.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:55.636834 | #encoding=utf-8
from __future__ import print_function
import sys
sys.path.append("../")
import jieba
import jieba.posseg as pseg
words=pseg.cut("又跛又啞")
for w in words:
print(w.word,w.flag)
|
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | test/parallel/test_disable_hmm.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:55.647045 | #encoding=utf-8
from __future__ import print_function
import sys
sys.path.append("../../")
import jieba
jieba.enable_parallel(4)
def cuttest(test_sent):
result = jieba.cut(test_sent, HMM=False)
for word in result:
print(word, "/", end=' ')
print("")
if __name__ == "__main__":
cuttest("这是一个伸手不... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | test/test_change_dictpath.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:55.647678 | #encoding=utf-8
from __future__ import print_function
import sys
sys.path.append("../")
import jieba
def cuttest(test_sent):
result = jieba.cut(test_sent)
print(" ".join(result))
def testcase():
cuttest("这是一个伸手不见五指的黑夜。我叫孙悟空,我爱北京,我爱Python和C++。")
cuttest("我不喜欢日本和服。")
cuttest("雷猴回归人间。")
cuttest(... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | test/test_cut_for_search.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:55.676514 | #encoding=utf-8
from __future__ import print_function
import sys
sys.path.append("../")
import jieba
def cuttest(test_sent):
result = jieba.cut_for_search(test_sent)
for word in result:
print(word, "/", end=' ')
print("")
if __name__ == "__main__":
cuttest("这是一个伸手不见五指的黑夜。我叫孙悟空,我爱北京,我爱Python和... |
fxsjy/jieba | https://github.com/fxsjy/jieba | null | null | null | null | 34,929 | null | null | mit | null | null | null | null | null | null | null | test/test_paddle.py | null | null | null | null | null | null | Python | 2026-05-04T02:22:55.713544 | #encoding=utf-8
import sys
sys.path.append("../")
import jieba
jieba.enable_paddle()
def cuttest(test_sent):
result = jieba.cut(test_sent, use_paddle=True)
print(" / ".join(result))
if __name__ == "__main__":
cuttest("这是一个伸手不见五指的黑夜。我叫孙悟空,我爱北京,我爱Python和C++。")
cuttest("我不喜欢日本和服。")
cuttest("雷猴回归人间。"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.