convert the following batch code to python code
batch code:
::BAV\_:git@github.com:anic17/Batch-Antivirus.git
@echo off
setlocal EnableDelayedExpansion
title Batch Antivirus Scanner
if /i "%~1"=="--help" goto help

call "%~dp0BAVStatus.bat" --skip || exit /b
set admin=1

set scanned\_files=0
set threats=0
if /i "%~1"=="--reg-scan" goto reg\_scan
if /i "%~2"=="--skip-update" (
 goto skipupdate
)
net session > nul 2>&1 || set admin=0
if !admin!==0 (
 echo Looks like you are running Batch Antivirus without administrator permissions...
 echo.
 echo This can make difficult to remove some malware.
 echo It is recommended to run the scan as administrator.
 echo.
 echo.Would you like to run scan as administrator? ^(y/n^)
 choice /c:YN /n
 if !errorlevel!==1 goto runas
)

call "%~dp0BAVUpdate.bat"
:skipupdate

if "%~1"=="" (
 cd \
) else (
 cd /d "%~1" > nul 2>&1
)
echo.
echo Scanning '%CD%' for threats...
echo.
call :reg\_scan
for /r %%A in (\*) do call :scan "%%~A" 2>nul

:finished
echo Scan finished.
echo.
call :settitle
echo Result: !scanned\_files! files scanned and !threats! threat(s) found
echo.
echo Press any key to quit...
pause>nul
exit /B %errorlevel%

:scan
set "filescan=%~1"
call :settitle
for /f %%A in ('sha256.exe "!filescan!" 2^>nul') do call :hashed %%A
set /a scanned\_files+=1
goto :EOF

:hashed

set "hash=%~1"
set "hash=!hash:\=!"

findstr /c:"!hash!" "%~dp0VirusDataBaseHash.bav" > nul || goto :EOF

for /f "tokens=1\* delims=:" %%a in ('findstr /c:"!hash!" "%~dp0VirusDataBaseHash.bav"') do (call :detection "%%~a" "%%~b")
goto :EOF

:detection
if "%~1" neq "!hash!" goto :EOF

start /b powershell [Reflection.Assembly]::LoadWithPartialName("""System.Windows.Forms""");$obj=New-Object Windows.Forms.NotifyIcon;$obj.Icon = [drawing.icon]::ExtractAssociatedIcon($PSHOME + """\powershell.exe""");$obj.Visible = $True;$obj.ShowBalloonTip(100000, """Batch Antivirus""","""Threats found: %~2""",2)>nul
echo Malware found: !filescan! ^| %~2
md "%~dp0Data\Quarantine\!hash!" > nul 2>&1
icacls "!filescan!" /setowner %username% > nul 2>&1
icacls "!filescan!" /grant %username%:(F,MA,WA,RA,WEA,REA,WDAC,DE) > nul 2>&1

move "!filescan!" "%~dp0Data\Quarantine\!hash!\!hash!" /y > nul 2>&1
icacls "%~dp0Data\Quarantine\!hash!\!hash!" /deny %username%:(RX,W,R,M,RD,WEA,REA,X,RA,WA) > nul 2>&1
set /a threats+=1
if not exist "!filescan!" (echo Malware successfully quarantined) else call :delete
goto :EOF

:delete
echo.
echo Failed to quarantine malware^^!
set /p "delmalware=Delete malware? (y/n): "
icacls "!filescan!" /setowner %username% > nul 2>&1
icacls "!filescan!" /grant %username%:(F,MA,WA,RA,WEA,REA,WDAC,DE) > nul 2>&1
if /i "%delmalware%"=="y" del !filescan! /s /q /f > nul
echo.
goto :EOF

:help
echo.
echo Batch Antivirus - Scanner
echo.
echo Syntax:
echo.
echo BAV [[folder] ^| --reg-scan ^| --help] [--skip-update]
echo.
echo Examples:
echo.
echo BAV
echo Will scan all the current drive. This may take some a lot of time depending
echo on the number of files and the computer performance.
echo.
echo BAV "%USERPROFILE%"
echo Will scan the folder "%USERPROFILE%" and all its subdirectories
echo It is recommended for a more precise and faster scan.
echo.
echo BAV --reg-scan
echo Only scan the autorun registry keys.
echo.
echo.BAV --skip-update
echo.Skip update checking and directly run scan.
echo.
echo BAV --help
echo Displays this help message.
echo.
echo Batch Antivirus will check at every startup new database updates to ensure you
echo have always the latest database.
echo.You can also manually check for updates by running 'BAVUpdate.bat' file.
echo.
echo Official GitHub repository:
echo https://github.com/anic17/Batch-Antivirus
echo.
echo If you accidentally downloaded some malware or PUP, contact batch.antivirus@gmail.com
echo and send the potentially malicious file via Mega, Dropbox, Google Drive, Mediafire or OneDrive.
echo.
echo Copyright (c) 2022 anic17 Software
endlocal
exit /B 0

:runas
powershell -ExecutionPolicy Bypass -Command Start-Process -FilePath """%~0""" -verb RunAs
exit /b

:reg\_scan
:: Run keys

for %%A in (HKEY\_LOCAL\_MACHINE HKEY\_CURRENT\_USER) do (
 rem Run and RunOnce
 for /f "tokens=3\* delims= " %%A in ('reg query "%%A\Software\Microsoft\Windows\CurrentVersion\Run"') do call :scan "%%~A"
 for /f "tokens=3\* delims= " %%A in ('reg query "%%A\Software\Microsoft\Windows\CurrentVersion\RunOnce"') do call :scan "%%~A"
)
:: Run WOW6432Node
for /f "tokens=3\* delims= " %%A in ('reg query "HKEY\_LOCAL\_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Run"') do call :scan "%%~A"
for /f "tokens=3\* delims= " %%A in ('reg query "HKEY\_LOCAL\_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\RunOnce"') do call :scan "%%~A"

:: Shell and userinit keys
for /f "tokens=3\* delims= " %%A in ('reg query "HKEY\_LOCAL\_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Userinit') do (
 for /f "tokens=1 delims=," %%X in ("%%~A") do call :scan "%%~X"
)
for /f "tokens=3\* delims= " %%A in ('reg query "HKEY\_LOCAL\_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Userinit') do (
 for /f "tokens=1 delims=," %%X in ("%%~A") do call :scan "%%~X"
)
goto :EOF

:settitle
title Scanning now: !filescan! ; !scanned\_files! scanned, !threats! threat(s) found
다음 배치 코드를 파이썬 코드로 변환합니다.배치 코드:::BAV\_:git@github.com:anic17/Batch-Antivirus.git에코 끄기setlocal EnableDelayedExpansion제목 배치 바이러스 백신 스캐너if /i "%~1"=="--help" goto helpcall "%~dp0BAVStatus.bat" --skip || exit /bset admin=1set scanned\_files=0set threats=0if /i "%~1"=="--reg-scan" goto reg\_scanif /i "%~2"=="--skip-update" ( 건너뛰기 업데이트)NET 세션 > NUL 2>&1 || SET ADMIN=0if !admin!==0 ( echo 관리자 권한 없이 일괄 바이러스 백신을 실행 중인 것 같습니다... echo. echo 이로 인해 일부 멀웨어를 제거하기 어려울 수 있습니다. echo 관리자 권한으로 검사를 실행하는 것이 좋습니다. echo. echo.관리자 권한으로 검사를 실행하시겠습니까? ^(Y/N^) 선택 /c:YN /n IF !ERRORLEVEL!==1 GOT RUNAS)호출 "%~dp0BAVUpdate.bat":skipupdateif "%~1"=="" ( cd \) else ( cd /d "%~1" > NUL 2>&1)echo.echo '%CD%'에서 위협 검색 중...echo.call :reg\_scanfor /r %%A in (\*) do call :scan "%%~A" 2>nul:finishedecho 스캔이 완료되었습니다.echo.call :setitleecho 결과: !scanned\_files! 파일 검사 및 !threats! 위협(들) 발견됨echo.echo 종료하려면 아무 키나 누르세요...일시 중지>nul종료 /B %errorlevel%scanset "filescan=%~1"call :setitlefor /f %%A in ('sha256.exe "!filescan!" 2^>nul') do call :hashed %%Aset /a scanned\_files+=1goto :EOF:해시set "해시=%~1"set "해시=!해시:\=!"findstr /c:"!해시!" "%~dp0바이러스데이터베이스해시.bav" > nul || goto :EOFfor /f "토큰=1\* 델림=:" %%a in ('findstr /c:"!hash!" "%~dp0VirusDataBaseHash.bav"') do (call :detection "%%~a" "%%~b")goto :EOF:detectionif "%~1" neq "!hash!" goto :EOFstart /b powershell [Reflection.Assembly]::LoadWithPartialName("""System.Windows.Forms""");$obj=New-Object Windows.Forms.NotifyIcon;$obj.Icon = [drawing. icon]::ExtractAssociatedIcon($PSHOME + """\powershell.exe""");$obj.Visible = $True;$obj.ShowBalloonTip(100000, """배치 안티바이러스""","""위협 발견: %~2""",2)>nulecho 악성코드 발견: !filescan! ^| %~2md "%~dp0데이터\검역\!해시!" > nul 2>&1ICACLS "!filescan!" /설정자 %사용자 이름% > nul 2>&1icacls "!filescan!" /grant %username%:(F,MA,WA,RA,WEA,REA,WDAC,DE) > nul 2>&1move "!filescan!" "%~dp0데이터\검역\!해시!\!해시!" /y > nul 2>&1icacls "%~dp0Data\Quarantine\!hash!\!hash!" /deny %사용자 이름%:(RX,W,R,M,RD,WEA,REA,X,RA,WA) > nul 2>&1set /a 위협+=1존재하지 않으면 "!filescan!" (echo 악성코드가 성공적으로 격리되었습니다) else call :deletegoto :EOF삭제echo.echo 악성코드 검역에 실패했습니다^^!set /p "delmalware=멀웨어를 삭제하시겠습니까? (y/n): "icacls "!filescan!" /setowner %사용자 이름% > nul 2>&1icacls "!filescan!" /grant %username%:(F,MA,WA,RA,WEA,REA,WDAC,DE) > nul 2>&1if /i "%delmalware%"=="y" del !filescan! /s /q /f > nulecho.goto :EOF:helpecho.echo 배치 바이러스 백신 - 스캐너echo.echo 구문:echo.echo BAV [[폴더] ^| --reg-scan ^| --help] [--skip-update]echo.echo 예제:echo.echo BAVecho 현재 드라이브를 모두 검사합니다. 파일 수와 컴퓨터 성능에 따라파일 수와 컴퓨터 성능에 따라 다소 시간이 걸릴 수 있습니다.echo.echo BAV "%사용자프로필%"echo "%사용자 프로필%" 폴더와 그 하위 디렉터리를 모두 검사합니다.보다 정확하고 빠른 검사를 위해 권장됩니다.echo.echo BAV --reg-scanecho 자동 실행 레지스트리 키만 검사합니다.echo.echo.BAV --skip-update업데이트 검사를 건너뛰고 직접 검사를 실행합니다.echo.echo BAV --helpecho 이 도움말 메시지를 표시합니다.echo.echo 배치 바이러스 백신은 시작할 때마다 새 데이터베이스 업데이트를 검사하여 항상 최신 데이터베이스를 유지합니다.항상 최신 데이터베이스가 있는지 확인합니다.echo.수동으로 'BAVUpdate.bat' 파일을 실행하여 업데이트를 확인할 수도 있습니다.echo.echo 공식 깃허브 리포지토리:echo https://github.com/anic17/Batch-Antivirusecho.echo 실수로 멀웨어나 PUP를 다운로드한 경우 batch.antivirus@gmail.comecho로 연락하여 잠재적으로 악성일 수 있는 파일을 Mega, Dropbox, Google Drive, Mediafire 또는 OneDrive를 통해 보내주세요.echo.echo 저작권 (c) 2022 anic17 소프트웨어endlocalexit /B 0:runaspowershell -ExecutionPolicy Bypass -Command Start-Process -FilePath """%~0""" -동사 RunAsexit /b:reg\_scan:: 실행 키for %%A in (HKEY\_LOCAL\_MACHINE HKEY\_CURRENT\_USER) do ( rem 실행 및 실행 한 번 for /f "tokens=3\* delims= " %%A in ('reg query "%%A\Software\Microsoft\Windows\CurrentVersion\Run"') do call :scan "%%~A" for /f "tokens=3\* delims= " %%A in ('reg query "%%A\Software\Microsoft\Windows\CurrentVersion\RunOnce"') do call :scan "%%~A"):: WOW6432Node 실행for /f "tokens=3\* delims= " %%A in ('reg query "HKEY\_LOCAL\_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Run"') do call :scan "%%~A"for /f "tokens=3\* delims= " %%A in ('reg query "HKEY\_LOCAL\_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\RunOnce"') do call :scan "%%~A":: 셸 및 사용자 초기화 키for /f "tokens=3\* delims= " %%A in ('reg query "HKEY\_LOCAL\_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Userinit') do ( for /f "tokens=1 delims=," %%X in ("%%~A") do call :scan "%%~X")for /f "tokens=3\* delims=