index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
57,703 | TheoKlein/snake-core | refs/heads/master | /snake/utils/__init__.py | """The Utils Module"""
from snake.utils.file_storage import FileStorage # noqa
| {"/snake/core/route_support.py": ["/snake/config/__init__.py", "/snake/managers.py"], "/tests/core/test_route_support.py": ["/snake/config/__init__.py"], "/snake/snaked.py": ["/snake/config/__init__.py", "/snake/core/celery.py", "/snake/core/route_manager.py", "/snake/core/snake_handler.py"], "/snake/routes/download.py... |
57,704 | TheoKlein/snake-core | refs/heads/master | /snake/core/snake_handler.py | """The snake requet handling module.
Basically this is the module that contains all comminality for Tornado based
aspects of snake.
Attributes:
TAIL_SIZE (int): The size of the sliding window for the stream based
request handler.
"""
import json
import logging
import tempfile
from datetime import datetime
fr... | {"/snake/core/route_support.py": ["/snake/config/__init__.py", "/snake/managers.py"], "/tests/core/test_route_support.py": ["/snake/config/__init__.py"], "/snake/snaked.py": ["/snake/config/__init__.py", "/snake/core/celery.py", "/snake/core/route_manager.py", "/snake/core/snake_handler.py"], "/snake/routes/download.py... |
57,705 | TheoKlein/snake-core | refs/heads/master | /snake/schema.py | """The schema module.
This contains the schema used throughout snake.
"""
import copy
import marshmallow
from snake import enums
from snake import fields
class Schema(marshmallow.Schema):
"""Extends `Schema`.
This allows for dynamic creation of a schema which is needed to validate
arguments within sc... | {"/snake/core/route_support.py": ["/snake/config/__init__.py", "/snake/managers.py"], "/tests/core/test_route_support.py": ["/snake/config/__init__.py"], "/snake/snaked.py": ["/snake/config/__init__.py", "/snake/core/celery.py", "/snake/core/route_manager.py", "/snake/core/snake_handler.py"], "/snake/routes/download.py... |
57,706 | TheoKlein/snake-core | refs/heads/master | /tests/core/test_celery.py | # pylint: disable=missing-docstring
import json
from celery.contrib.testing import mocks
import pytest
from snake import error
from snake import schema
from snake.core import celery
# pylint: disable=invalid-name
def test_snake_request_kill_child_processes(mocker):
"""
Test SnakeRequest: kill_child_proce... | {"/snake/core/route_support.py": ["/snake/config/__init__.py", "/snake/managers.py"], "/tests/core/test_route_support.py": ["/snake/config/__init__.py"], "/snake/snaked.py": ["/snake/config/__init__.py", "/snake/core/celery.py", "/snake/core/route_manager.py", "/snake/core/snake_handler.py"], "/snake/routes/download.py... |
57,707 | TheoKlein/snake-core | refs/heads/master | /snake/worker.py | """The worker module.
This is worker used by celery. They form the snake pit!
Example:
celery worker --app snake.worker # Spin a single snake worker
Attributes:
app (:obj:`Celery`): The celery object used by celery.
"""
from celery import bootsteps
from celery.bin import Option
from snake.config import co... | {"/snake/core/route_support.py": ["/snake/config/__init__.py", "/snake/managers.py"], "/tests/core/test_route_support.py": ["/snake/config/__init__.py"], "/snake/snaked.py": ["/snake/config/__init__.py", "/snake/core/celery.py", "/snake/core/route_manager.py", "/snake/core/snake_handler.py"], "/snake/routes/download.py... |
57,708 | TheoKlein/snake-core | refs/heads/master | /snake/routes/note.py | """ The note route module.
Attributes:
NoteRoute (tuple): The NoteRoute.
NotePostRoute (tuple): The NotePostRoute.
NotesRoute (tuple): The NotesRoute.
"""
from datetime import datetime
from webargs import tornadoparser
from snake import db
from snake import fields
from snake import schema
from snake.cor... | {"/snake/core/route_support.py": ["/snake/config/__init__.py", "/snake/managers.py"], "/tests/core/test_route_support.py": ["/snake/config/__init__.py"], "/snake/snaked.py": ["/snake/config/__init__.py", "/snake/core/celery.py", "/snake/core/route_manager.py", "/snake/core/snake_handler.py"], "/snake/routes/download.py... |
57,709 | TheoKlein/snake-core | refs/heads/master | /snake/routes/scale.py | """ The file route module.
Attributes:
ScaleRoute (tuple): The ScaleRoute.
ScaleCommandsRoute (tuple): The ScaleCommandsRoute.
ScaleInterfaceRoute (tuple): The ScaleInterfaceRoute.
ScaleUploadRoute (tuple): The ScaleUploadRoute.
ScalesRoute (tuple): The ScalesRoute.
"""
import asyncio
import hashl... | {"/snake/core/route_support.py": ["/snake/config/__init__.py", "/snake/managers.py"], "/tests/core/test_route_support.py": ["/snake/config/__init__.py"], "/snake/snaked.py": ["/snake/config/__init__.py", "/snake/core/celery.py", "/snake/core/route_manager.py", "/snake/core/snake_handler.py"], "/snake/routes/download.py... |
57,710 | TheoKlein/snake-core | refs/heads/master | /snake/routes/command.py | """ The command route module.
Attributes:
CommandRoute (tuple): The CommandRoute.
CommandsRoute (tuple): The CommandsRoute.
"""
import copy
import json
from marshmallow import exceptions
from webargs import tornadoparser
from snake import db
from snake import enums
from snake import fields
from snake import... | {"/snake/core/route_support.py": ["/snake/config/__init__.py", "/snake/managers.py"], "/tests/core/test_route_support.py": ["/snake/config/__init__.py"], "/snake/snaked.py": ["/snake/config/__init__.py", "/snake/core/celery.py", "/snake/core/route_manager.py", "/snake/core/snake_handler.py"], "/snake/routes/download.py... |
57,711 | TheoKlein/snake-core | refs/heads/master | /snake/scales/url/upload.py | # pylint: disable=missing-docstring
from os import path
from urllib import parse
import cgi
import requests
from snake import config
from snake import error
from snake import fields
from snake import scale
PROXIES = {}
if config.snake_config['http_proxy']:
PROXIES['http'] = config.snake_config['http_proxy']
if ... | {"/snake/core/route_support.py": ["/snake/config/__init__.py", "/snake/managers.py"], "/tests/core/test_route_support.py": ["/snake/config/__init__.py"], "/snake/snaked.py": ["/snake/config/__init__.py", "/snake/core/celery.py", "/snake/core/route_manager.py", "/snake/core/snake_handler.py"], "/snake/routes/download.py... |
57,712 | TheoKlein/snake-core | refs/heads/master | /snake/engines/mongo/note.py | """The Mongo Note Collection Module.
This module provides everything required to communicate with the Mongo NoteCollection.
"""
class NoteCollection():
"""Synchronous Note Collection.
Attributes:
db (obj): The database object
"""
def __init__(self, db):
self.db = db
def delete(s... | {"/snake/core/route_support.py": ["/snake/config/__init__.py", "/snake/managers.py"], "/tests/core/test_route_support.py": ["/snake/config/__init__.py"], "/snake/snaked.py": ["/snake/config/__init__.py", "/snake/core/celery.py", "/snake/core/route_manager.py", "/snake/core/snake_handler.py"], "/snake/routes/download.py... |
57,713 | TheoKlein/snake-core | refs/heads/master | /snake/fields.py | """The fields module.
This replicates and extends the marshmallow fields module.
NOTEs:
* We are bringing fields into our namespace.
TODOs:
* Extend all fields with a valid arguments option.
"""
# pylint: disable=arguments-differ
# pylint: disable=wildcard-import
# pylint: disable=unused-wildcard-import
im... | {"/snake/core/route_support.py": ["/snake/config/__init__.py", "/snake/managers.py"], "/tests/core/test_route_support.py": ["/snake/config/__init__.py"], "/snake/snaked.py": ["/snake/config/__init__.py", "/snake/core/celery.py", "/snake/core/route_manager.py", "/snake/core/snake_handler.py"], "/snake/routes/download.py... |
57,714 | TheoKlein/snake-core | refs/heads/master | /snake/error.py | """The errors module.
All of the custom exceptions used within snake.
"""
class SnakeError(Exception):
"""The base error class for snake.
This contains a message, an HTTP status code, and a payload (additional data).
Attributes:
message (str): The error message.
status_code (int): The H... | {"/snake/core/route_support.py": ["/snake/config/__init__.py", "/snake/managers.py"], "/tests/core/test_route_support.py": ["/snake/config/__init__.py"], "/snake/snaked.py": ["/snake/config/__init__.py", "/snake/core/celery.py", "/snake/core/route_manager.py", "/snake/core/snake_handler.py"], "/snake/routes/download.py... |
57,715 | TheoKlein/snake-core | refs/heads/master | /snake/scales/hashes/__init__.py | # pylint: disable=missing-docstring
from snake.config import constants
from snake.scale import scale
__scale__ = scale(
name='hashes',
description='a module to calculate hashes on files',
version=constants.VERSION,
author="Countercept",
supports=[
]
)
| {"/snake/core/route_support.py": ["/snake/config/__init__.py", "/snake/managers.py"], "/tests/core/test_route_support.py": ["/snake/config/__init__.py"], "/snake/snaked.py": ["/snake/config/__init__.py", "/snake/core/celery.py", "/snake/core/route_manager.py", "/snake/core/snake_handler.py"], "/snake/routes/download.py... |
57,716 | tdzell/VisionSystem | refs/heads/master | /IDStest.py | from pyueye import ueye
from pyueye_example_camera import Camera
from pyueye_example_utils import FrameThread
import cv2
import numpy as np
cam = Camera()
cam.init()
cam.set_colormode(ueye.IS_CM_BGR8_PACKED)
cam.set_aoi(0,0, 1280, 1024)
cam.alloc()
cam.capture_video()
thread = FrameThread(cam, view)
thread.start()... | {"/utils.py": ["/AlarmDetector.py"], "/liveVideoDetect.py": ["/utils.py", "/AlarmDetector.py"]} |
57,717 | tdzell/VisionSystem | refs/heads/master | /data/BoltPictures/Training_Images/nameconvert.py | import os
import glob
for f in glob.glob('*.jpg'):
new_name = f.replace('276853_D2768 ', "")
os.rename(f,new_name) | {"/utils.py": ["/AlarmDetector.py"], "/liveVideoDetect.py": ["/utils.py", "/AlarmDetector.py"]} |
57,718 | tdzell/VisionSystem | refs/heads/master | /AlarmDetector.py | # Python modules
import sharing
def GlobeCreate(): ###initializes all global variables that need to be tracked in this module
boltCount = 0
global oneBoltSeen
oneBoltSeen = 0
global twoBoltSeen
twoBoltSeen = 0
global threeBoltSeen
threeBoltSeen = 0
global fourBoltSeen
... | {"/utils.py": ["/AlarmDetector.py"], "/liveVideoDetect.py": ["/utils.py", "/AlarmDetector.py"]} |
57,719 | tdzell/VisionSystem | refs/heads/master | /utils.py | # Python default libraries
import os
from math import exp, ceil, floor
from copy import copy
import time
# Python external libraries
import torch
import numpy as np
from torch.autograd import Variable
import cv2
import struct # get_image_size
import imghdr # get_image_size
import sharing
# Python modules
import A... | {"/utils.py": ["/AlarmDetector.py"], "/liveVideoDetect.py": ["/utils.py", "/AlarmDetector.py"]} |
57,720 | tdzell/VisionSystem | refs/heads/master | /liveVideoDetect.py | from utils import *
from darknet import Darknet
import cv2
import AlarmDetector
from pyueye import ueye #importing this too early would require IDS camera drivers to be installed just to run the "StandardCamera" code
from pyueye_example_camera import Camera
from pyueye_example_utils import *
import numpy as np
import ... | {"/utils.py": ["/AlarmDetector.py"], "/liveVideoDetect.py": ["/utils.py", "/AlarmDetector.py"]} |
57,721 | farizrahman4u/skorch | refs/heads/master | /skorch/tests/callbacks/test_all.py | import itertools
import pytest
class TestAllCallbacks:
@pytest.fixture
def callbacks(self):
"""Return all callbacks"""
import skorch.callbacks
callbacks = []
for name in dir(skorch.callbacks):
attr = getattr(skorch.callbacks, name)
# pylint: disable=un... | {"/skorch/tests/test_regressor.py": ["/skorch/exceptions.py"], "/skorch/tests/test_history.py": ["/skorch/history.py"]} |
57,722 | farizrahman4u/skorch | refs/heads/master | /skorch/history.py | """Contains history class and helper functions."""
import json
from skorch.utils import open_file_like
# pylint: disable=invalid-name
class _none:
"""Special placeholder since ``None`` is a valid value."""
def _not_none(items):
"""Whether the item is a placeholder or contains a placeholder."""
if not ... | {"/skorch/tests/test_regressor.py": ["/skorch/exceptions.py"], "/skorch/tests/test_history.py": ["/skorch/history.py"]} |
57,723 | farizrahman4u/skorch | refs/heads/master | /skorch/exceptions.py | """Contains skorch-specific exceptions and warnings."""
class SkorchException(BaseException):
"""Base skorch exception."""
class NotInitializedError(SkorchException):
"""Module is not initialized, please call the ``.initialize``
method or train the model by calling ``.fit(...)``.
"""
class Skorch... | {"/skorch/tests/test_regressor.py": ["/skorch/exceptions.py"], "/skorch/tests/test_history.py": ["/skorch/history.py"]} |
57,724 | farizrahman4u/skorch | refs/heads/master | /skorch/tests/test_regressor.py | """Tests for regressor.py
Only contains tests that are specific for regressor subclasses.
"""
import numpy as np
import pytest
from sklearn.base import clone
from skorch.tests.conftest import INFERENCE_METHODS
class TestNeuralNetRegressor:
@pytest.fixture(scope='module')
def data(self, regression_data):
... | {"/skorch/tests/test_regressor.py": ["/skorch/exceptions.py"], "/skorch/tests/test_history.py": ["/skorch/history.py"]} |
57,725 | farizrahman4u/skorch | refs/heads/master | /skorch/tests/test_history.py | """Tests for history.py."""
import pytest
from skorch.history import History
class TestHistory:
test_epochs = 3
test_batches = 4
@pytest.fixture
def history(self):
"""Return a history filled with epoch and batch data."""
h = History()
for num_epoch in range(self.test_epochs... | {"/skorch/tests/test_regressor.py": ["/skorch/exceptions.py"], "/skorch/tests/test_history.py": ["/skorch/history.py"]} |
57,733 | futahi/tsar | refs/heads/master | /secapp/migrations/0010_auto_20190909_1859.py | # Generated by Django 2.2.4 on 2019-09-09 15:59
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('secapp', '0009_auto_20190909_1841'),
]
operations = [
migrations.RenameField(
model_name='last',
old_name='dost_alte... | {"/secapp/admin.py": ["/secapp/models.py"], "/secapp/views.py": ["/secapp/models.py"]} |
57,734 | futahi/tsar | refs/heads/master | /secapp/migrations/0006_services.py | # Generated by Django 2.2.4 on 2019-09-09 11:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('secapp', '0005_dost'),
]
operations = [
migrations.CreateModel(
name='Services',
fields=[
('id', mod... | {"/secapp/admin.py": ["/secapp/models.py"], "/secapp/views.py": ["/secapp/models.py"]} |
57,735 | futahi/tsar | refs/heads/master | /secapp/admin.py | from django.contrib import admin
from .models import Bottom
from .models import Dost
from .models import Services
from .models import Offers
from .models import Last, Famous, City
admin.site.register(Bottom)
admin.site.register(Dost)
admin.site.register(Services)
admin.site.register(Offers)
admin.site.register(Last)
... | {"/secapp/admin.py": ["/secapp/models.py"], "/secapp/views.py": ["/secapp/models.py"]} |
57,736 | futahi/tsar | refs/heads/master | /secapp/migrations/0009_auto_20190909_1841.py | # Generated by Django 2.2.4 on 2019-09-09 15:41
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('secapp', '0008_bottom_lin'),
]
operations = [
migrations.CreateModel(
name='Last',
fields=[
('id', m... | {"/secapp/admin.py": ["/secapp/models.py"], "/secapp/views.py": ["/secapp/models.py"]} |
57,737 | futahi/tsar | refs/heads/master | /secapp/migrations/0004_auto_20190905_0119.py | # Generated by Django 2.2.4 on 2019-09-04 22:19
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('secapp', '0003_auto_20190905_0041'),
]
operations = [
migrations.RenameField(
model_name='bottom',
old_name='alter1',
... | {"/secapp/admin.py": ["/secapp/models.py"], "/secapp/views.py": ["/secapp/models.py"]} |
57,738 | futahi/tsar | refs/heads/master | /secondsite/wsgi.py | import os
import sys
# add your project directory to the sys.path
path = '/home/futahi1/tsar/'
if path not in sys.path:
# sys.path.insert(0, path)
sys.path.append(path)
os.chdir(path)
# set environment variable to tell django where your settings.py is
# os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settin... | {"/secapp/admin.py": ["/secapp/models.py"], "/secapp/views.py": ["/secapp/models.py"]} |
57,739 | futahi/tsar | refs/heads/master | /secapp/migrations/0005_dost.py | # Generated by Django 2.2.4 on 2019-09-08 02:21
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('secapp', '0004_auto_20190905_0119'),
]
operations = [
migrations.CreateModel(
name='Dost',
fields=[
... | {"/secapp/admin.py": ["/secapp/models.py"], "/secapp/views.py": ["/secapp/models.py"]} |
57,740 | futahi/tsar | refs/heads/master | /secapp/migrations/0013_city_famous.py | # Generated by Django 2.2.4 on 2019-10-25 21:19
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('secapp', '0012_auto_20190909_2303'),
]
operations = [
migrations.CreateModel(
name='City',
fields=[
... | {"/secapp/admin.py": ["/secapp/models.py"], "/secapp/views.py": ["/secapp/models.py"]} |
57,741 | futahi/tsar | refs/heads/master | /secapp/urls.py |
from django.urls import path
from secapp import views
urlpatterns = [
path('', views.home, name='home'),
path('ourservices/', views.ourservices, name='ourservices'),
path('ourteam/', views.ourteam, name='ourteam'),
path('tovisit/', views.tovisit, name='tovisit'),
path('dosto/', views.dosto, name='dos... | {"/secapp/admin.py": ["/secapp/models.py"], "/secapp/views.py": ["/secapp/models.py"]} |
57,742 | futahi/tsar | refs/heads/master | /secapp/views.py | from django.shortcuts import render, get_object_or_404
from django.utils.safestring import mark_safe
from .models import Bottom
from .models import Last
from .models import Offers
from .models import Services
from .models import Dost, City, Famous
def index(request):
return render (request,'secapp/index.html')
def h... | {"/secapp/admin.py": ["/secapp/models.py"], "/secapp/views.py": ["/secapp/models.py"]} |
57,743 | futahi/tsar | refs/heads/master | /secapp/migrations/0011_auto_20190909_2257.py | # Generated by Django 2.2.4 on 2019-09-09 19:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('secapp', '0010_auto_20190909_1859'),
]
operations = [
migrations.AlterField(
model_name='bottom',
name='lin',
... | {"/secapp/admin.py": ["/secapp/models.py"], "/secapp/views.py": ["/secapp/models.py"]} |
57,744 | futahi/tsar | refs/heads/master | /secapp/migrations/0012_auto_20190909_2303.py | # Generated by Django 2.2.4 on 2019-09-09 20:03
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('secapp', '0011_auto_20190909_2257'),
]
operations = [
migrations.AlterField(
model_name='dost',
name='dost_link',
... | {"/secapp/admin.py": ["/secapp/models.py"], "/secapp/views.py": ["/secapp/models.py"]} |
57,745 | futahi/tsar | refs/heads/master | /secapp/models.py | from django.db import models
class Offers(models.Model):
primary_key=True
offer_name= models.CharField(max_length=100)
offer_image= models.ImageField(upload_to='Services')
offer_alter= models.CharField(max_length=50)
offer_desc= models.TextField()
offer_link= models.CharField(max_length=150, null=True, blank=Tr... | {"/secapp/admin.py": ["/secapp/models.py"], "/secapp/views.py": ["/secapp/models.py"]} |
57,746 | futahi/tsar | refs/heads/master | /secapp/migrations/0007_offers.py | # Generated by Django 2.2.4 on 2019-09-09 12:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('secapp', '0006_services'),
]
operations = [
migrations.CreateModel(
name='Offers',
fields=[
('id', m... | {"/secapp/admin.py": ["/secapp/models.py"], "/secapp/views.py": ["/secapp/models.py"]} |
57,747 | futahi/tsar | refs/heads/master | /secapp/migrations/0003_auto_20190905_0041.py | # Generated by Django 2.2.4 on 2019-09-04 21:41
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('secapp', '0002_auto_20190904_2349'),
]
operations = [
migrations.AlterField(
model_name='bottom',
name='img1',
... | {"/secapp/admin.py": ["/secapp/models.py"], "/secapp/views.py": ["/secapp/models.py"]} |
57,748 | ZiyadBastaili/nfts_data_scraping | refs/heads/main | /collections/test.py | from Pillow import Image
im = Image.open("Fluf World.png")
im.show() | {"/main_scrape.py": ["/web_scraping/dappRadar_alltable.py"]} |
57,749 | ZiyadBastaili/nfts_data_scraping | refs/heads/main | /main_scrape.py | from web_scraping.dappRadar_alltable import Scrap
app = Scrap()
def run_app():
app.run_app()
run_app()
| {"/main_scrape.py": ["/web_scraping/dappRadar_alltable.py"]} |
57,750 | ZiyadBastaili/nfts_data_scraping | refs/heads/main | /web_scraping/dappRadar_alltable.py | import time
from datetime import datetime
import os
from bs4 import BeautifulSoup
#import twint
import pandas as pd
#from selenium import webdriver
import warnings
warnings.filterwarnings('ignore')
import streamlit as st
import re
from GrabzIt import GrabzItClient
from GrabzIt import GrabzItImageOptions
fr... | {"/main_scrape.py": ["/web_scraping/dappRadar_alltable.py"]} |
57,846 | klgentle/lc_python | refs/heads/master | /leet_code/A_LeetCode_Grinding_Guide/Greedy/P0135_Candy.py | """
135. Candy
Hard
There are N children standing in a line. Each child is assigned a rating value.
You are giving candies to these children subjected to the following requirements:
Each child must have at least one candy.
Children with a higher rating get more candies than their neighbors.
What is the mini... | {"/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", ... |
57,847 | klgentle/lc_python | refs/heads/master | /frequency_model/setVolume.py | # coding=utf-8
import win32api
WM_APPCOMMAND = 0x319
APPCOMMAND_VOLUME_MAX = 0x0A
APPCOMMAND_VOLUME_MIN = 0x09
def setVolume(volume: int):
# 按公式处理音量数值
# l = int(APPCOMMAND_VOLUME_MAX) - int(APPCOMMAND_VOLUME_MIN)
volume = volume / 100
mult = int(volume*0x10000)
win32api.SendMessage(-1, WM_APPCO... | {"/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", ... |
57,848 | klgentle/lc_python | refs/heads/master | /leet_code/labuladong/array/p0556_Next_Greater_Element_III.py | """
556. Next Greater Element III
Medium
Given a positive integer n, find the smallest integer which has exactly the same digits existing in the integer n and is greater in value than n. If no such positive integer exists, return -1.
Note that the returned integer should fit in 32-bit integer, if there is a valid ans... | {"/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", ... |
57,849 | klgentle/lc_python | refs/heads/master | /base_practice/list_test.py | from timeit import Timer
def test_list_append():
li = []
for i in range(10000):
li.append(i)
return li
def test_list_add():
li = []
for i in range(10000):
li += [i]
return li
def test_list_derivation():
return [i for i in range(10000)]
def test_list_functi... | {"/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", ... |
57,850 | klgentle/lc_python | refs/heads/master | /automatic_office/decryptZipFile.py | import os
import py7zr
def decryptZipFile(filename):
print("current dir is: ", os.getcwd())
print(f"filename is: {filename}")
a = 0
with open('pwd_guss.txt', "r", encoding="utf8") as fpPwd:
for pwd in fpPwd:
pwd = pwd.rstrip()
print(f'Try password {pwd} ...')
... | {"/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", ... |
57,851 | klgentle/lc_python | refs/heads/master | /leet_code/easy_case/validPalindrome.py | # coding:utf8
import pysnooper
class Solution:
# @pysnooper.snoop()
def validPalindrome(self, s: str) -> bool:
r = s[::-1]
if r == s:
return True
l = len(s)
for i in range(l):
if s[i] != r[i]:
m = s[:i] + s[i + 1 :]
n = r[... | {"/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", ... |
57,852 | klgentle/lc_python | refs/heads/master | /leet_code/labuladong/dynamic_programming/P0322_Coin_Change.py | """
322. Coin Change TODO enhance
Medium
You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you need to make up that amount. If that amount of money cannot be made up by any combination of the coins, return -1.
You may assume ... | {"/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", ... |
57,853 | klgentle/lc_python | refs/heads/master | /leet_code/easy_case/sumRange.py | class NumArray:
def __init__(self, nums: list):
self.sum = [0]
s = 0
for n in nums:
s += n
self.sum.append(s)
def sumRange(self, i: int, j: int) -> int:
print(f"i:{i}")
print(f"sum[i]:{self.sum[i]}")
print(f"j:{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", ... |
57,854 | klgentle/lc_python | refs/heads/master | /database/change_files_encode.py | import chardet
import codecs
import logging
import sys
import os
import encodings.idna
logging.basicConfig(level=logging.INFO, format="%(levelname)s: %(message)s")
def convert_file(filename, out_enc):
# !!! does not backup the origin file
content = ""
with codecs.open(filename, "rb") as f:
content... | {"/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", ... |
57,855 | klgentle/lc_python | refs/heads/master | /tests/testCreateWeekReport.py | import os
import sys
from os.path import dirname
import datetime
import pprint
import unittest
import docx
# 项目根目录
BASE_DIR = dirname(dirname(os.path.abspath(__file__)))
# 添加系统环境变量
sys.path.append(BASE_DIR)
from automatic_office.CreateWeekReport import CreateWeekReport
class testCreateWeekReport(unittest.TestCase):
... | {"/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", ... |
57,856 | klgentle/lc_python | refs/heads/master | /vs_code/docxAddPicture.py | from PIL import Image
import os
import cv2
from docx import Document
class SplitPicture(object):
def __init__(self):
self.path = "/mnt/c/Users/klgentle/Desktop/老婆专用"
os.chdir(self.path)
def splitPicture(self):
# for filename in os.listdir(self.path):
for folderName, subfolders... | {"/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", ... |
57,857 | klgentle/lc_python | refs/heads/master | /leet_code/classic_topic/0053_Maximum_Subarray.py | class Solution:
def maxSubArray(self, nums: List[int]) -> int:
# modify nums inplace, turn nums[i] into sum of nums[k:i]
for i in range(1,len(nums)):
nums[i] += max(nums[i-1], 0)
return max(nums)
| {"/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", ... |
57,858 | klgentle/lc_python | refs/heads/master | /leet_code/easy_case/titleToNumber.py | class Solution:
def titleToNumber(self, s: str) -> int:
ret = 0
i = 0
l = len(s)
while i < l:
# ret += 1
ret += ord(s[i]) - ord("A") + 1
if i < l - 1:
ret *= 26
i += 1
print(f"s:{s}, ret:{ret}")
return r... | {"/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", ... |
57,859 | klgentle/lc_python | refs/heads/master | /leet_code/labuladong/tree/p0222_Count_Complete_Tree_Nodes.py | """
Given the root of a complete binary tree, return the number of the nodes in the tree.
According to Wikipedia, every level, except possibly the last, is completely filled in a complete binary tree, and all nodes in the last level are as far left as possible. It can have between 1 and 2h nodes inclusive at the last ... | {"/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", ... |
57,860 | klgentle/lc_python | refs/heads/master | /tests/re_test.py | import unittest
import re
import os
import sys
from os.path import dirname
# 项目根目录
BASE_DIR = dirname(dirname(os.path.abspath(__file__)))
# 添加系统环境变量
sys.path.append(BASE_DIR)
from database.Procedure import Procedure
class ReTest(unittest.TestCase):
def test_normalize_report_log_insert(self):
"""
... | {"/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", ... |
57,861 | klgentle/lc_python | refs/heads/master | /vs_code/send_mail.py | import smtplib
from pysnooper import snoop
#@snoop()
def send_mail():
from_email = "klgentle@sina.com"
to_email = 'jian.dong2@pactera.com'
smtpObj = smtplib.SMTP_SSL('smtp.sina.com',465)
ret = smtpObj.ehlo()
if ret[0] != 250:
print("Smtp say hello failed!")
return -1
ret = sm... | {"/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", ... |
57,862 | klgentle/lc_python | refs/heads/master | /leet_code/easy_case/maxSubArray_ans.py | class Solution:
"""
53. 最大子序和
给定一个整数数组 nums ,找到一个具有最大和的连续子数组(子数组最少包含一个元素),返回其最大和。
Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.
"""
def maxSubArray(self, nums: list) -> int:
for i in range(1, len(... | {"/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", ... |
57,863 | klgentle/lc_python | refs/heads/master | /leet_code/labuladong/tree/P0654_Maximum_Binary_Tree.py | """
You are given an integer array nums with no duplicates. A maximum binary tree can be built recursively from nums using the following algorithm:
Create a root node whose value is the maximum value in nums.
Recursively build the left subtree on the subarray prefix to the left of the maximum value.
Recurs... | {"/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", ... |
57,864 | klgentle/lc_python | refs/heads/master | /leet_code/labuladong/tree/p0653_Two_Sum_IV_-_Input_is_a_BST.py | """
653. Two Sum IV - Input is a BST
Easy
Given the root of a Binary Search Tree and a target number k, return true if there exist two elements in the BST such that their sum is equal to the given target.
Example 1:
Input: root = [5,3,6,2,4,null,7], k = 9
Output: true
Example 2:
Input: root = [5,3,6,2,4,null,7]... | {"/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", ... |
57,865 | klgentle/lc_python | refs/heads/master | /data_structure/Countable.py | class Countable:
counter = 0
def __init__(self):
Countable.counter += 1
@classmethod
def get_count(cls):
return Countable.counter
x = Countable()
y = Countable()
z = Countable()
print(Countable.get_count())
| {"/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", ... |
57,866 | klgentle/lc_python | refs/heads/master | /database/data_base_connect.py | import cx_Oracle
def connect(da_name="171"):
conn = cx_Oracle.connect('rptuser', 'rptuser','100.11.94.176:1521/odsdb')
return conn
| {"/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", ... |
57,867 | klgentle/lc_python | refs/heads/master | /svn_operate/config_default.py | configs = {"path": {
"svn_home_path": "/mnt/e",
"svn_procedure_path": "/mnt/e/svn/1300_编码/1301_ODSDB/RPTUSER/05Procedures",
"win_svn_procedure_path": r"E:\svn\1300_编码\1301_ODSDB\RPTUSER\05Procedures",
"win_svn_home_path": "E:\\"}}
| {"/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", ... |
57,868 | klgentle/lc_python | refs/heads/master | /leet_code/labuladong/backtracking/p0040_Combination_Sum_II.py | 40. Combination Sum II
"""
Medium
Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numbers sum to target.
Each number in candidates may only be used once in the combination.
Note: The solution set must not contain duplic... | {"/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", ... |
57,869 | klgentle/lc_python | refs/heads/master | /leet_code/labuladong/backtracking/p0022_Generate_Parentheses.py | """
22. Generate Parentheses
Medium
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
Example 1:
Input: n = 3
Output: ["((()))","(()())","(())()","()(())","()()()"]
Example 2:
Input: n = 1
Output: ["()"]
"""
class Solution:
# 编程要非常注意细节
def generate... | {"/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", ... |
57,870 | klgentle/lc_python | refs/heads/master | /leet_code/easy_case/fib.py | class Solution:
def fib(self, N:int)->int:
F = [0, 1]
while len(F) <= N:
F.append(F[-1] + F[-2])
return F[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", ... |
57,871 | klgentle/lc_python | refs/heads/master | /database/FindViewOriginalTable.py | import os
import json
import sys
import logging
logging.basicConfig(level=logging.DEBUG, format="%(levelname)s: %(message)s")
class FindViewOriginalTable(object):
def __init__(self):
# linux
# self.view_path = "/home/kl/svn/1300_编码/1301_ODSDB/RPTUSER/03Views"
# self.new_path = "/mnt/e/yx_... | {"/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", ... |
57,872 | klgentle/lc_python | refs/heads/master | /vs_code/test.py | from PIL import Image
import pytesseract
#上面都是导包,只需要下面这一行就能实现图片文字识别
file_name ="/mnt/c/Users/klgentle/Desktop/老婆专用/2019版药学(初级西药师)考前押题[专业代码:201]/押题密卷一/专业知识/2019-05-13 223410.png"
text = pytesseract.image_to_string(Image.open(file_name),lang='chi_sim')
print(text)
| {"/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", ... |
57,873 | klgentle/lc_python | refs/heads/master | /quantitative_trading/quan_test.py | #先引入后面可能用到的包(package)
import pandas as pd
from datetime import datetime
import backtrader as bt
import matplotlib.pyplot as plt
#%matplotlib inline #在jupyter notebook上运行
#正常显示画图时出现的中文和负号
from pylab import mpl
mpl.rcParams['font.sans-serif']=['SimHei']
class my_strategy1(bt.Strategy):
#全局设定交易策略的参数
params=(... | {"/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", ... |
57,874 | klgentle/lc_python | refs/heads/master | /leet_code/top_interview_questions/Medium_Case/P0078_Subsets.py | """
78.Subsets
Given an integer array nums, return all possible subsets (the power set).
The solution set must not contain duplicate subsets.
Example 1:
Input: nums = [1,2,3]
Output: [[],[1],[2],[1,2],[3],[1,3],[2,3],[1,2,3]]
Example 2:
Input: nums = [0]
Output: [[],[0]]
"""
class Solution:
# 利用 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", ... |
57,875 | klgentle/lc_python | refs/heads/master | /tests/test_procedure.py | import unittest
import os
import sys
from os.path import dirname
# 项目根目录
BASE_DIR = dirname(dirname(os.path.abspath(__file__)))
# 添加系统环境变量
sys.path.append(BASE_DIR)
from database.Procedure import Procedure
class TestProcedure(unittest.TestCase):
def test_deal_with_report_log_blanks(self):
a = Procedure('... | {"/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", ... |
57,876 | klgentle/lc_python | refs/heads/master | /leet_code/easy_case/num_partition.py | from collections import Counter
class Solution:
def hasGroupsSizeX(self, deck: List[int]) -> bool:
if len(deck) <= 1 or len(deck) > 26:
return False
a = Counter(deck).most_common()
num_list = [i[1] for i in a]
num_list.sort()
print("num_list:", num_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", ... |
57,877 | klgentle/lc_python | refs/heads/master | /stock_pandas/textmine.py | import pandas as pd
import re
from nltk.tokenize import sent_tokenize, word_tokenize
from nltk.corpus import stopwords
from nltk.stem.wordnet import WordNetLemmatizer
lemma = WordNetLemmatizer()
# lda model
import gensim
from gensim import corpora
print("reading file...")
rawdata = pd.read_csv('disney.csv',header=No... | {"/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", ... |
57,878 | klgentle/lc_python | refs/heads/master | /data_structure/maze.py |
def passable(maze, pos):
return maze(pos[0], pos[1]) == 0
def mark(maze, pos):
maze(pos[0], pos[1]) = 2
def maze_resolve(maze, start, end):
dirs = ([1, 0], [0, 1], [-1, 0], [0, -1])
if start == end:
return
st = SStack()
mark(maze, start)
st.push((start, 0))
while not st.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", ... |
57,879 | klgentle/lc_python | refs/heads/master | /leet_code/easy_case/findContentChildren_ans.py | class Solution {
//贪心的思想是,用尽量小的饼干去满足小需求的孩子,所以需要进行排序先
public int findContentChildren(int[] g, int[] s) {
int child = 0;
int cookie = 0;
Arrays.sort(g); //先将饼干 和 孩子所需大小都进行排序
Arrays.sort(s);
while (child < g.length && cookie < s.length ){ //当其中一个遍历就结束
if (g[chil... | {"/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", ... |
57,880 | klgentle/lc_python | refs/heads/master | /leet_code/medium_case/0016_3Sum_Closest.py | """
Given an array nums of n integers and an integer target, find three integers in nums such that the sum is closest to target. Return the sum of the three integers. You may assume that each input would have exactly one solution.
Example:
Given array nums = [-1, 2, 1, -4], and target = 1.
The sum that is closest to ... | {"/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", ... |
57,881 | klgentle/lc_python | refs/heads/master | /leet_code/labuladong/array/p0026_Remove_Duplicates_from_Sorted_Array.py | """
26. Remove Duplicates from Sorted Array
Easy
Given a sorted array nums, remove the duplicates in-place such that each element appears only once and returns the new length.
Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory.
Clarification:
... | {"/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", ... |
57,882 | klgentle/lc_python | refs/heads/master | /svn_operate/date_add.py |
import datetime
def date_add(day: int) -> str:
date=datetime.date.today()+datetime.timedelta(days=day)
return date.strftime("%Y%m%d")
| {"/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", ... |
57,883 | klgentle/lc_python | refs/heads/master | /base_practice/annuity_test.py | month=0
investment=10000 #int(input("Please enter your initial investment: "))
rate=3.6 #float(input("Please enter annual interest rate(ex. 2.5): "))
payout=600 #int(input("Please enter the monthly annuity payout: "))
rate = rate / 100
balance=investment
#balance=investment-payout/rate*(1-1/(1+rate/12)**month)
if payo... | {"/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", ... |
57,884 | klgentle/lc_python | refs/heads/master | /scrapy_test/imas_report_download.py | import requests #导入requests包
import json
def get_report_date(word=None):
url = 'http://10.95.64.198:9086/SmartReport/RegularReport'
From_data={
'ajax': 1,
's_id': None,
'type': 'GRKHXX.xls',
'freq': 'ymd',
'branchCap': '000000 - 创兴银行有限公司(管理行汇总)',
'branch': ... | {"/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", ... |
57,885 | klgentle/lc_python | refs/heads/master | /leet_code/top_interview_questions/Medium_Case/P0048_Rotate_Image.py | import copy
class Solution:
def rotate(self, matrix: List[List[int]]) -> None:
"""
Do not return anything, modify matrix in-place instead.
核心思想,行转列。
此处有一个copy的坑,直接copy原二维数组,数据会变
"""
original_matrix = copy.deepcopy(matrix)
n = len(matrix)
for c in rang... | {"/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", ... |
57,886 | klgentle/lc_python | refs/heads/master | /leet_code/easy_case/p1025_Divisor_Game.py | class Solution:
def divisorGame(self, N: int) -> bool:
# 可以用归纳法证明,当N为偶数时,Alice会win
"""
N == 2 Alice (Choosing) win;
假设 N == M (偶数) 时 Alice (Choosing) win, 则 M+2 时 Alice 也会 win
当 N = m+1 时, Alice会输,因为奇数只能被奇数整除,所以alice取完数后,剩下偶数,所以对方(Choosing)会赢。
当 n = m+2 (偶数) 时,Alice 先... | {"/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", ... |
57,887 | klgentle/lc_python | refs/heads/master | /base_practice/add_and_square.py | import time
def add_and_square(number: int):
"""求指定范围内所有满足 a*a + b*b = c*c 的a,b,c"""
for a in range(0, number):
for b in range(0, number):
c = number - a - b
if a**2 + b**2 == c**2:
print(f"a : {a}, b: {b}, c:{c}")
if __name__ == "__main__":
start_time = t... | {"/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", ... |
57,888 | klgentle/lc_python | refs/heads/master | /svn_operate/copy_svn_modify.py | import shutil, os
import openpyxl
import pprint
#import codecs
import csv
import os
import time
import platform
# import pysvn
import sys
from sys import argv
from openpyxl import Workbook
from backupToZip import backupToZip
from datetime import datetime
# from send_mail_with_attach import mail
from config_default i... | {"/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", ... |
57,889 | klgentle/lc_python | refs/heads/master | /leet_code/labuladong/sliding_window/p0076_Minimum_Window_Substring.py | """
76. Minimum Window Substring
Hard
Given two strings s and t, return the minimum window in s which will contain all the characters in t. If there is no such window in s that covers all characters in t, return the empty string "".
Note that If there is such a window, it is guaranteed that there will always be only ... | {"/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", ... |
57,890 | klgentle/lc_python | refs/heads/master | /automatic_office/test_docx.py | import unittest
import docx
class TestDocx(unittest.TestCase):
def test_para_run(self):
doc = docx.Document('automatic_office/文思员工-8月签到表_新模版_带加班.docx')
# print(len(doc.paragraphs))
print(f"styles:{doc.styles}")
for style in doc.styles:
print(f"doc style name:{style.name... | {"/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", ... |
57,891 | klgentle/lc_python | refs/heads/master | /leet_code/labuladong/union_find/p0990_Satisfiability_of_Equality_Equations.py | """
990. Satisfiability of Equality Equations
Medium
Given an array equations of strings that represent relationships between variables, each string equations[i] has length 4 and takes one of two different forms: "a==b" or "a!=b". Here, a and b are lowercase letters (not necessarily different) that represent one-lett... | {"/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", ... |
57,892 | klgentle/lc_python | refs/heads/master | /send_sms/send_sms.py | from twilio.rest import Client
from sys import argv
# Your Account SID from twilio.com/console
account_sid = "ACeef1b02b359fad7bf493f482dd52a669"
# Your Auth Token from twilio.com/console
auth_token = "d1e6e6ff2d46d7046163b0931e5bb85a"
from_phone = "+18070265802"
client = Client(account_sid, auth_token)
def send_sm... | {"/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", ... |
57,893 | klgentle/lc_python | refs/heads/master | /stock_pandas/plt_bar2.py | import matplotlib.pyplot as plt
import pandas as pd
# x 是x轴,y是y轴,
loan = pd.read_csv("loan.csv")
x = loan["Credit_score"]
y = loan["Credit_score"].groupby(loan["Credit_score"]).count()
#print(f"x:{x}")
#print(f"y:{y}")
#x = [625, 650, 675, 700, 725, 750, 775, 800]
#y = [2.0, 2.0, 1.0, 3.0, 4.0, 2.0, 1.0, 2.0]
p1 = pl... | {"/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", ... |
57,894 | klgentle/lc_python | refs/heads/master | /tests/test_proc_log_modify.py | import unittest
import os
import sys
from os.path import dirname
# 项目根目录
BASE_DIR = dirname(dirname(os.path.abspath(__file__)))
# 添加系统环境变量
sys.path.append(BASE_DIR)
from database.ProcedureLogModify import ProcedureLogModify
class TestProcLogMod(unittest.TestCase):
def test_reset_job_step_value(self):
obj =... | {"/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", ... |
57,895 | klgentle/lc_python | refs/heads/master | /wechat/VisitRecordDC.py | # py3.7
@dataclass(unsafe_hash=True)
class VisitRecordDC(object):
first_name: str
last_name: str
phone_number: str
# 跳过“访问时间”字段,不作为任何对比条件
date_visited: str = field(hash=False, compare=False)
def find_potential_customers_v4():
return set(VisitRecordDC(**r) for r in users_visited_puket)... | {"/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", ... |
57,896 | klgentle/lc_python | refs/heads/master | /svn_operate/skip_table_structure_change.py | def skip_table_structure_change(commit_list):
"""
如果即写了modify文件,又改了表结构,则不将表结构变更写入登记表
"""
folder_index = 4
has_modify = False
modify_tables = []
for row in commit_list:
if row[folder_index].endswith("01Tables\\modify"):
has_modify = True
elif row[folder_index].end... | {"/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", ... |
57,897 | klgentle/lc_python | refs/heads/master | /leet_code/labuladong/array/p0046_Permutations.py | """
46. Permutations
Medium
Given an array nums of distinct integers, return all the possible permutations. You can return the answer in any order.
Example 1:
Input: nums = [1,2,3]
Output: [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]
Example 2:
Input: nums = [0,1]
Output: [[0,1],[1,0]]
Example 3:
Input: 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", ... |
57,898 | klgentle/lc_python | refs/heads/master | /leet_code/labuladong/tree/p0449_Serialize_and_Deserialize_BST.py | """
Serialization is converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or transmitted across a network connection link to be reconstructed later in the same or another computer environment.
Design an algorithm to serialize and deserialize a binary search... | {"/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", ... |
57,899 | klgentle/lc_python | refs/heads/master | /automatic_office/__init__.py | import os
import sys
# 绝对路径的import
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../")
| {"/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", ... |
57,900 | klgentle/lc_python | refs/heads/master | /data_structure/c9_2_insert_sort.py | def insert_sort(lst):
for i in range(1, len(lst)): # 开始时片段[0:1]已排序
x = lst[i]
j = i
while j > 0 and lst[j - 1].key > x.key:
lst[j] = lst[j - 1] # 反序逐个后移元素,确定插入位置
j -= 1
lst[j] = x
| {"/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", ... |
57,901 | klgentle/lc_python | refs/heads/master | /svn_operate/PlatformOperation.py | import os
class PlatformOperation(object):
@staticmethod
def change_path_sep(path):
if path.find("\\") > -1 and os.sep != "\\":
path = path.replace("\\", os.sep)
elif path.find("/") > -1 and os.sep != "/":
path = path.replace("/", os.sep)
return path
if __nam... | {"/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", ... |
57,902 | klgentle/lc_python | refs/heads/master | /leet_code/medium_case/p1195_Fizz_Buzz_Multithreaded.py | from threading import Semaphore
class FizzBuzz:
def __init__(self, n: int):
self.n = n
self.sem = Semaphore() # default is 1
self.sem3 = Semaphore(0)
self.sem5 = Semaphore(0)
self.sem15 = Semaphore(0)
# printFizz() outputs "fizz"
def fizz(self, pri... | {"/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", ... |
57,903 | klgentle/lc_python | refs/heads/master | /leet_code/hard_case/p0037_Sudoku_Solver_3.py | import heapq
class Solution:
#Does a DFS
def solve(self, board, heap):
if len(heap)==0:
return True
# (len(remaining), idy, idx, remaining)
procitem = heapq.heappop(heap)
if procitem[0] == 0:
return False
for value in procitem[3]:
boar... | {"/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", ... |
57,904 | klgentle/lc_python | refs/heads/master | /leet_code/labuladong/tree/p0103_Binary_Tree_Zigzag_Level_Order_Traversal.py | """
Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and alternate between).
For example:
Given binary tree [3,9,20,null,null,15,7],
3
/ \
9 20
/ \
15 7
return its zigzag level order traversal as:
[
... | {"/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", ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.