• Aug 1, 2025 •AustinLeath
0 likes • 2 views
import re _proposal_regex = r'(?:(?:(IKE|ESP):)?[\w/]+(?:/NO_EXT_SEQ)?(?:, ?(IKE|ESP):[\w/]+(?:/NO_EXT_SEQ)?)*)?' _proposals_re = rf'(?P<proposals>{_proposal_regex}|)' pattern = rf'received proposals: {_proposals_re}' match = re.match(pattern, 'received proposals: ') print(match.group('proposals') if match else "No match") # Prints "No match"
• Oct 4, 2023 •AustinLeath
0 likes • 10 views
weigh = lambda a,b: sum(b)-sum(a) FindCoin = lambda A: 0 if (n := len(A)) == 1 else (m := n//3) * (w := 1 + weigh(A[:m], A[2*m:])) + FindCoin(A[m*w:m*(w+1)]) print(FindCoin([1,1,1,1,1,1,1,2,1]))
• Nov 19, 2022 •CodeCatch
# Deleting all even numbers from a list a = [1,2,3,4,5] del a[1::2] print(a)
• Jul 8, 2025 •AustinLeath
0 likes • 5 views
from datetime import datetime epoch_time = 1753823646 # Example epoch time (March 15, 2023 00:00:00 UTC) # Convert epoch time to a UTC datetime object utc_datetime = datetime.utcfromtimestamp(epoch_time) print(f"Epoch time: {epoch_time}") print(f"UTC datetime: {utc_datetime}") # You can also format the output string formatted_utc_time = utc_datetime.strftime('%m-%d-%Y %H:%M:%S UTC') print(f"Formatted UTC datetime: {formatted_utc_time}")
• Jun 1, 2023 •CodeCatch
0 likes • 4 views
bytes_data = b'Hello, World!' string_data = bytes_data.decode('utf-8') print("String:", string_data)
• Sep 20, 2025 •cntt.dsc-f4b6
1 like • 2 views
print(123)