Best Python code snippet using localstack_python
batch_timestamp.py
Source: batch_timestamp.py
1import os.path2# ## {R2D2919B742E} ##3# ###########################################################################4# What if magic existed?5# What if a place existed where your every thought and dream come to life.6# There is only one catch: it has to be written down.7# Such a place exists, it is called programming.8# - Scott Taylor Reph, RightThumb.com9# ###########################################################################10# ## {C3P0D40fAe8B} ##11def GENERATE_FILE(programs):12 fileName = programs + _v.slash+'batch\\timestamp.bat'13 fileData = """@echo off14set YYYY=%DATE:~10,4%15set MM=%DATE:~4,2%16set DD=%DATE:~7,2%17set HH=%TIME: =0%18set HH=%HH:~0,2%19set MI=%TIME:~3,2%20set SS=%TIME:~6,2%21set FF=%TIME:~9,2%22set theEcho=%223IF [%1] == [?] call :THEHELP24IF [%1] == [epoch] call :EPOCH25IF [%1] == [csdel] call :CSDEL26IF [%1] == [t] call :THETIME27IF [%1] == [t2] call :THETIMETWO28IF [%1] == [d] call :THEDATE29IF [%1] == [d2] call :THEDATETWO30IF [%1] == [s] call :SINGLE31IF [%1] == [sdel] call :SINGLEDELIM32IF [%1] == [ats] call :THEAT33IF [%1] == [ats2] call :THEAT234IF [%1] == [sec] call :SEC35IF [%1] == [ms] call :MS36IF [%1] == [msdel] call :MSDELIM37IF [%1] == [msdel2] call :MSDELIMTWO38IF [%1] == [] call :DEFAULT39IF [%1] == [default] call :DEFAULT40IF [%1] == [dt] call :DATETIMEDEFAULT41GOTO:EOF42:THEHELP43set theEcho=noEcho44call :EPOCH45echo epoch %now%46call :CSDEL47echo csdel %now%48call :THETIME49echo t %now%50call :THETIMETWO51echo t2 %now%52call :THEDATE53echo d %now%54call :THEDATETWO55echo d2 %now%56call :SINGLE57echo s %now%58call :SINGLEDELIM59echo sdel %now%60call :THEAT61echo ats %now%62call :THEAT263echo ats2 %now%64call :SEC65echo sec %now%66call :MS67echo ms %now%68call :MSDELIM69echo msdel %now%70call :MSDELIMTWO71echo msdel2 %now%72echo.73echo var name = ^%%now^%% 74echo.75echo Example:76echo timestamp ats noEcho77GOTO:EOF78:EPOCH79%py% "%python%\simpleEpoch.py">%stmp%\simpleEpoch.txt80set /p now=<%stmp%\simpleEpoch.txt81IF NOT [%theEcho%] == [noEcho] (echo now = %now%)82GOTO:EOF83:CSDEL84set now=%YYYY%-%MM%-%DD%,%HH%:%MI%.%SS%.%FF%85IF NOT [%theEcho%] == [noEcho] (echo now = %now%)86GOTO:EOF87:THEDATE88set now=%date:~-4,4%/%date:~-10,2%/%date:~-7,2%89IF NOT [%theEcho%] == [noEcho] (echo now = %now%)90GOTO:EOF91:THEDATETWO92set now=%date:~-4,4%.%date:~-10,2%.%date:~-7,2%93IF NOT [%theEcho%] == [noEcho] (echo now = %now%)94GOTO:EOF95:THETIME96set now=%time:~0,2%:%time:~3,2%97IF NOT [%theEcho%] == [noEcho] (echo now = %now%)98GOTO:EOF99:THETIMETWO100set now=%time:~0,2%.%time:~3,2%101IF NOT [%theEcho%] == [noEcho] (echo now = %now%)102GOTO:EOF103:DEFAULT104set now=%date:~-4,4%.%date:~-10,2%.%date:~-7,2%@%time:~0,2%:%time:~3,2%105IF NOT [%theEcho%] == [noEcho] (echo { epoch d d2 t t2 s sdel sec ms msdel msdel2 default ; noEcho })106IF NOT [%theEcho%] == [noEcho] (echo now = %now%)107GOTO:EOF108:DATETIMEDEFAULT109set now=%date:~-4,4%/%date:~-10,2%/%date:~-7,2% %time:~0,2%:%time:~3,2%110IF NOT [%theEcho%] == [noEcho] (echo { d d2 t t2 s sdel sec ms msdel msdel2 default ; noEcho })111IF NOT [%theEcho%] == [noEcho] (echo now = %now%)112GOTO:EOF113:SINGLE114set now=%YYYY%%MM%%DD%%HH%%MI%115IF NOT [%theEcho%] == [noEcho] (echo now = %now%)116GOTO:EOF117:SINGLEDELIM118set now=%YYYY%.%MM%.%DD%-%HH%.%MI%119IF NOT [%theEcho%] == [noEcho] (echo now = %now%)120GOTO:EOF121:THEAT122set now=%YYYY%.%MM%.%DD%@%HH%.%MI%123IF NOT [%theEcho%] == [noEcho] (echo now = %now%)124GOTO:EOF125:THEAT2126set now=%YYYY%.%MM%.%DD% @ %HH%.%MI%127IF NOT [%theEcho%] == [noEcho] (echo now = %now%)128GOTO:EOF129:SEC130set now=%YYYY%%MM%%DD%%HH%%MI%%SS%%131IF NOT [%theEcho%] == [noEcho] (echo now = %now%)132GOTO:EOF133:MS134set now=%YYYY%%MM%%DD%%HH%%MI%%SS%%FF%135IF NOT [%theEcho%] == [noEcho] (echo now = %now%)136GOTO:EOF137:MSDELIM138set now=%YYYY%.%MM%.%DD%.%HH%.%MI%.%SS%.%FF%139IF NOT [%theEcho%] == [noEcho] (echo now = %now%)140GOTO:EOF141:MSDELIMTWO142set now=%YYYY%.%MM%.%DD%-%HH%.%MI%_%SS%.%FF%143IF NOT [%theEcho%] == [noEcho] (echo now = %now%)144GOTO:EOF145 """146 if not os.path.isfile( fileName ):...
batch_theUSB.py
Source: batch_theUSB.py
1import os.path 2# ## {R2D2919B742E} ##3# ###########################################################################4# What if magic existed?5# What if a place existed where your every thought and dream come to life.6# There is only one catch: it has to be written down.7# Such a place exists, it is called programming.8# - Scott Taylor Reph, RightThumb.com9# ###########################################################################10# ## {C3P0D40fAe8B} ##11def GENERATE_FILE(programs):12 fileName = programs + _v.slash+'batch\\theUSB.bat'13 fileData = """@echo off14set YYYY=%DATE:~10,4%15set MM=%DATE:~4,2%16set DD=%DATE:~7,2%17set HH=%TIME: =0%18set HH=%HH:~0,2%19set MI=%TIME:~3,2%20set SS=%TIME:~6,2%21set FF=%TIME:~9,2%22set theEcho=%223IF [%1] == [?] call :THEHELP24IF [%1] == [epoch] call :EPOCH25IF [%1] == [csdel] call :CSDEL26IF [%1] == [t] call :THETIME27IF [%1] == [t2] call :THETIMETWO28IF [%1] == [d] call :THEDATE29IF [%1] == [d2] call :THEDATETWO30IF [%1] == [s] call :SINGLE31IF [%1] == [sdel] call :SINGLEDELIM32IF [%1] == [ats] call :THEAT33IF [%1] == [ats2] call :THEAT234IF [%1] == [sec] call :SEC35IF [%1] == [ms] call :MS36IF [%1] == [msdel] call :MSDELIM37IF [%1] == [msdel2] call :MSDELIMTWO38IF [%1] == [] call :DEFAULT39IF [%1] == [default] call :DEFAULT40IF [%1] == [dt] call :DATETIMEDEFAULT41GOTO:EOF42:THEHELP43set theEcho=noEcho44call :EPOCH45echo epoch %now%46call :CSDEL47echo csdel %now%48call :THETIME49echo t %now%50call :THETIMETWO51echo t2 %now%52call :THEDATE53echo d %now%54call :THEDATETWO55echo d2 %now%56call :SINGLE57echo s %now%58call :SINGLEDELIM59echo sdel %now%60call :THEAT61echo ats %now%62call :THEAT263echo ats2 %now%64call :SEC65echo sec %now%66call :MS67echo ms %now%68call :MSDELIM69echo msdel %now%70call :MSDELIMTWO71echo msdel2 %now%72echo.73echo var name = ^%%now^%% 74echo.75echo Example:76echo timestamp ats noEcho77GOTO:EOF78:EPOCH79%py% "%python%\simpleEpoch.py">%stmp%\simpleEpoch.txt80set /p now=<%stmp%\simpleEpoch.txt81IF NOT [%theEcho%] == [noEcho] (echo now = %now%)82GOTO:EOF83:CSDEL84set now=%YYYY%-%MM%-%DD%,%HH%:%MI%.%SS%.%FF%85IF NOT [%theEcho%] == [noEcho] (echo now = %now%)86GOTO:EOF87:THEDATE88set now=%date:~-4,4%/%date:~-10,2%/%date:~-7,2%89IF NOT [%theEcho%] == [noEcho] (echo now = %now%)90GOTO:EOF91:THEDATETWO92set now=%date:~-4,4%.%date:~-10,2%.%date:~-7,2%93IF NOT [%theEcho%] == [noEcho] (echo now = %now%)94GOTO:EOF95:THETIME96set now=%time:~0,2%:%time:~3,2%97IF NOT [%theEcho%] == [noEcho] (echo now = %now%)98GOTO:EOF99:THETIMETWO100set now=%time:~0,2%.%time:~3,2%101IF NOT [%theEcho%] == [noEcho] (echo now = %now%)102GOTO:EOF103:DEFAULT104set now=%date:~-4,4%.%date:~-10,2%.%date:~-7,2%@%time:~0,2%:%time:~3,2%105IF NOT [%theEcho%] == [noEcho] (echo { epoch d d2 t t2 s sdel sec ms msdel msdel2 default ; noEcho })106IF NOT [%theEcho%] == [noEcho] (echo now = %now%)107GOTO:EOF108:DATETIMEDEFAULT109set now=%date:~-4,4%/%date:~-10,2%/%date:~-7,2% %time:~0,2%:%time:~3,2%110IF NOT [%theEcho%] == [noEcho] (echo { d d2 t t2 s sdel sec ms msdel msdel2 default ; noEcho })111IF NOT [%theEcho%] == [noEcho] (echo now = %now%)112GOTO:EOF113:SINGLE114set now=%YYYY%%MM%%DD%%HH%%MI%115IF NOT [%theEcho%] == [noEcho] (echo now = %now%)116GOTO:EOF117:SINGLEDELIM118set now=%YYYY%.%MM%.%DD%-%HH%.%MI%119IF NOT [%theEcho%] == [noEcho] (echo now = %now%)120GOTO:EOF121:THEAT122set now=%YYYY%.%MM%.%DD%@%HH%.%MI%123IF NOT [%theEcho%] == [noEcho] (echo now = %now%)124GOTO:EOF125:THEAT2126set now=%YYYY%.%MM%.%DD% @ %HH%.%MI%127IF NOT [%theEcho%] == [noEcho] (echo now = %now%)128GOTO:EOF129:SEC130set now=%YYYY%%MM%%DD%%HH%%MI%%SS%%131IF NOT [%theEcho%] == [noEcho] (echo now = %now%)132GOTO:EOF133:MS134set now=%YYYY%%MM%%DD%%HH%%MI%%SS%%FF%135IF NOT [%theEcho%] == [noEcho] (echo now = %now%)136GOTO:EOF137:MSDELIM138set now=%YYYY%.%MM%.%DD%.%HH%.%MI%.%SS%.%FF%139IF NOT [%theEcho%] == [noEcho] (echo now = %now%)140GOTO:EOF141:MSDELIMTWO142set now=%YYYY%.%MM%.%DD%-%HH%.%MI%_%SS%.%FF%143IF NOT [%theEcho%] == [noEcho] (echo now = %now%)144GOTO:EOF145 """146 if not os.path.isfile( fileName ):...
echo.py
Source: echo.py
1# https://deeplearningcourses.com/c/deep-learning-convolutional-neural-networks-theano-tensorflow2# https://udemy.com/deep-learning-convolutional-neural-networks-theano-tensorflow3from __future__ import print_function, division4from builtins import range5# Note: you may need to update your version of future6# sudo pip install -U future7import matplotlib.pyplot as plt8import numpy as np9import wave10import sys11from scipy.io.wavfile import write12# If you right-click on the file and go to "Get Info", you can see:13# sampling rate = 16000 Hz14# bits per sample = 1615# The first is quantization in time16# The second is quantization in amplitude17# We also do this for images!18# 2^16 = 65536 is how many different sound levels we have19# 2^8 * 2^8 * 2^8 = 2^24 is how many different colors we can represent20spf = wave.open('helloworld.wav', 'r')21#Extract Raw Audio from Wav File22signal = spf.readframes(-1)23signal = np.fromstring(signal, 'Int16')24print("numpy signal:", signal.shape)25plt.plot(signal)26plt.title("Hello world without echo")27plt.show()28delta = np.array([1., 0., 0.])29noecho = np.convolve(signal, delta)30print("noecho signal:", noecho.shape)31assert(np.abs(noecho[:len(signal)] - signal).sum() < 0.000001)32noecho = noecho.astype(np.int16) # make sure you do this, otherwise, you will get VERY LOUD NOISE33write('noecho.wav', 16000, noecho)34filt = np.zeros(16000)35filt[0] = 136filt[4000] = 0.637filt[8000] = 0.338filt[12000] = 0.239filt[15999] = 0.140out = np.convolve(signal, filt)41out = out.astype(np.int16) # make sure you do this, otherwise, you will get VERY LOUD NOISE42write('out.wav', 16000, out)43# plt.plot(out)44# plt.title("Hello world with small echo")...
Check out the latest blogs from LambdaTest on this topic:
The fact is not alien to us anymore that cross browser testing is imperative to enhance your application’s user experience. Enhanced knowledge of popular and highly acclaimed testing frameworks goes a long way in developing a new app. It holds more significance if you are a full-stack developer or expert programmer.
QA testers have a unique role and responsibility to serve the customer. Serving the customer in software testing means protecting customers from application defects, failures, and perceived failures from missing or misunderstood requirements. Testing for known requirements based on documentation or discussion is the core of the testing profession. One unique way QA testers can both differentiate themselves and be innovative occurs when senseshaping is used to improve the application user experience.
Having a good web design can empower business and make your brand stand out. According to a survey by Top Design Firms, 50% of users believe that website design is crucial to an organization’s overall brand. Therefore, businesses should prioritize website design to meet customer expectations and build their brand identity. Your website is the face of your business, so it’s important that it’s updated regularly as per the current web design trends.
Enterprise resource planning (ERP) is a form of business process management software—typically a suite of integrated applications—that assists a company in managing its operations, interpreting data, and automating various back-office processes. The introduction of a new ERP system is analogous to the introduction of a new product into the market. If the product is not handled appropriately, it will fail, resulting in significant losses for the business. Most significantly, the employees’ time, effort, and morale would suffer as a result of the procedure.
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!