This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import threading | |
def Func1(num): | |
cal=num*10000 | |
print("\nI am From Func1 ") | |
def Func2(num): | |
print("\nI am from Func2".format(num * num)) | |
if __name__ == "__main__": | |
t1 = threading.Thread(target=Func1, args=(10,)) | |
t2=threading.Thread(target=Func2,args=(11,)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Default debugger | |
import pdb; pdb.set_trace() | |
# Use scrapy Logging | |
self.logger.info('this is Simple Log') | |
self.log('this is log example') | |
# Inspect in Shell | |
from scrapy.shell import inspect_response |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Created By : Ravishankar Chavare | |
# Reference : Cinfo(utility Tool) | |
# Link : github.com/chavarera/cinfo | |
# Date : 17-02-2021 | |
echo ' Architecture Info ' | |
echo '__________________________________________________________________________________' | |
hostnamectl | grep -e 'Machine ID' -e 'Boot ID' -e 'Operating System' -e Kernel -e Architecture |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RequestDelayMiddleware(object): | |
def process_request(self, request, spider): | |
# Add delay_by key in meta | |
delay_s = request.meta.get('delay_by', None) | |
if not delay_s: | |
return | |
deferred = Deferred() | |
reactor.callLater(delay_s, deferred.callback, None) | |
return deferred |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
from json import dump, load | |
def flat(object, sep='.'): | |
"""flatten nested object | |
Args: | |
object ([dict]): input document | |
sep (str, optional): an seperator. Defaults to '.'. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Author: Ravishankar Chavare | |
Version: 1.0 | |
File: pwbar.py | |
Description: This module provides a progress bar utility for tracking the | |
progress of iterative tasks. | |
1.1 | |
=== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sqlglot | |
import time | |
import os | |
import pandas as pd | |
from sqlglot import parse_one, exp, optimizer | |
from sqlglot.optimizer.scope import traverse_scope | |
from sqlglot.errors import OptimizeError | |
# Define the SQL query string |