

import math

def        lowerCamelCase__       (    _a):
	SCREAMING_SNAKE_CASE      :					Tuple    =				0
	SCREAMING_SNAKE_CASE      :					Tuple    =				0
	while num > 0:
		SCREAMING_SNAKE_CASE      :					List[Any]    =				num % 8
		SCREAMING_SNAKE_CASE      :					Optional[int]    =				octal + (remainder * math.floor(math.pow(10							,	__lowerCAmelCase)))
		counter += 1
		SCREAMING_SNAKE_CASE      :					Optional[Any]    =				math.floor(num / 8)  # basically /= 8 without remainder if any
		# This formatting removes trailing '.0' from `octal`.
	return f"0o{int(__lowerCAmelCase)}"

def        lowerCamelCase__       (    ):
	print("\n2 in octal is:")
	print(decimal_to_octal(2))  # = 2
	print("\n8 in octal is:")
	print(decimal_to_octal(8))  # = 10
	print("\n65 in octal is:")
	print(decimal_to_octal(65))  # = 101
	print("\n216 in octal is:")
	print(decimal_to_octal(216))  # = 330
	print("\n512 in octal is:")
	print(decimal_to_octal(512))  # = 1000
	print("\n")


if __name__ == "__main__":
			main()



'''simple docstring'''


from __future__ import annotations

lowerCamelCase__					=   'Muhammad Umer Farooq'
lowerCamelCase__					=   'MIT'
lowerCamelCase__					=   '1.0.0'
lowerCamelCase__					=   'Muhammad Umer Farooq'
lowerCamelCase__					=   'contact@muhammadumerfarooq.me'
lowerCamelCase__					=   'Alpha'

import re
from html.parser import HTMLParser
from urllib import parse

import requests






class 		lowerCAmelCase__	(	UpperCAmelCase__		):




			def __init__(						self     :   Any		,     lowerCamelCase__     :   str       )      ->None:



					'''simple docstring'''







					super().__init__()
					_UpperCAmelCase						:				list[str]	    =					[]
					_UpperCAmelCase						:				List[str]	    =					domain






			def 							lowerCAmelCase__			(						self     :   Optional[Any]		,     lowerCamelCase__     :   str		,     lowerCamelCase__     :   list[tuple[str, str | None]]       )      ->None:



					'''simple docstring'''







					if tag == "a":
							# Check the list of defined attributes.
							for name, value in attrs:
									# If href is defined, and not empty nor # print it.
									if name == "href" and value != "#" and value != "":
											# If not already in urls.
											if value not in self.urls:
													_UpperCAmelCase						:				Dict	    =					parse.urljoin(self.domain		,     lowerCamelCase__       )
													self.urls.append(lowerCamelCase__       )






def        __lowerCAmelCase       (__lowerCAmelCase      ):
		return ".".join(get_sub_domain_name(__lowerCAmelCase      ).split("."      )[-2:]      )






def        __lowerCAmelCase       (__lowerCAmelCase      ):
		return parse.urlparse(__lowerCAmelCase      ).netloc






def        __lowerCAmelCase       (__lowerCAmelCase = "https://github.com"      ):
		_UpperCAmelCase						:				List[str]	    =					get_domain_name(__lowerCAmelCase      )

		# Initialize the parser
		_UpperCAmelCase						:				int	    =					Parser(__lowerCAmelCase      )

		try:
				# Open URL
				_UpperCAmelCase						:				Any	    =					requests.get(__lowerCAmelCase      )

				# pass the raw HTML to the parser to get links
				parser.feed(r.text      )

				# Get links and loop through
				_UpperCAmelCase						:				Any	    =					set()
				for link in parser.urls:
						# open URL.
						# read = requests.get(link)
						try:
								_UpperCAmelCase						:				List[str]	    =					requests.get(__lowerCAmelCase      )
								# Get the valid email.
								_UpperCAmelCase						:				Optional[int]	    =					re.findall("[a-zA-Z0-9]+@" + domain					,       read.text      )
								# If not in list then append it.
								for email in emails:
										valid_emails.add(__lowerCAmelCase      )
						except ValueError:
								pass
		except ValueError:
				raise SystemExit(1      )

		# Finally return a sorted list of email addresses with no duplicates.
		return sorted(__lowerCAmelCase      )


if __name__ == "__main__":
						lowerCamelCase__					=   emails_from_url('https://github.com')
						print(F'''{len(emails)} emails found:''')
						print('\n'.join(sorted(emails)))



