Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
if: success() && (github.event_name == 'pull_request' || github.event_name == 'pull_request_target')
uses: thollander/actions-comment-pull-request@v2
with:
comment_tag: logic-verification-ci
message: |
### ✅ Logic Verified!
The **Automated Logic Suite** has confirmed that 1 is still 1.
Expand All @@ -54,6 +55,7 @@ jobs:
if: failure() && (github.event_name == 'pull_request' || github.event_name == 'pull_request_target')
uses: thollander/actions-comment-pull-request@v2
with:
comment_tag: logic-verification-ci
message: "### ❌ LOGIC COLLAPSE\nThe automated suite has detected that 1 is no longer 1. Please fix the broken logic before merging."
github_token: ${{ secrets.GITHUB_TOKEN }}

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Wanna make this dumber? You're welcome here.

All you have to do is:
1. **Fork** this repo.
2. Add a new function to `is_one_one.py`.
2. Add a new `is_one...` function in a Python file under `methods/`.
3. Make sure it returns `True` (because 1 is 1).
4. **Important:** If your code is easy to understand, you're doing it wrong. We want chaos, not clean code.
5. Bonus points for using libraries that have no business being in a math script (like `BeautifulSoup` or `Pandas`).
Expand Down
2 changes: 1 addition & 1 deletion docs/METHODS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Methods Directory

This document provides a comprehensive list of all the functions available in `is_one_one.py` used to prove that 1 is indeed 1.
This document provides a comprehensive list of all the functions available through `is_one_one.py` used to prove that 1 is indeed 1. Community methods can live in `methods/*.py`; any function whose name starts with `is_one` is loaded automatically.

## Available Methods

Expand Down
125 changes: 77 additions & 48 deletions is_one_one.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,57 @@
import math
import sys
import importlib
import inspect
import pkgutil
from pathlib import Path

METHOD_FUNCTION_PREFIX = "is_one"
METHODS_DIRECTORY = Path(__file__).resolve().with_name("methods")
EXTRA_CHECK_FUNCTION_NAMES = {"the_one_suriya"}


def load_method_functions():
"""Dynamically loads all validation functions from the methods package."""
loaded_methods = {}

if not METHODS_DIRECTORY.exists():
return loaded_methods

for module_info in pkgutil.iter_modules([str(METHODS_DIRECTORY)]):
if module_info.name.startswith("_"):
continue

module = importlib.import_module(f"methods.{module_info.name}")

for name, value in inspect.getmembers(module, inspect.isfunction):
if not name.startswith(METHOD_FUNCTION_PREFIX):
continue
if value.__module__ != module.__name__:
continue
loaded_methods[name] = value

return loaded_methods


globals().update(load_method_functions())


def get_available_checks(include_meta_check=False):
"""Collects every available one-verification function."""
checks = []
for name, value in sorted(globals().items()):
if not name.startswith(METHOD_FUNCTION_PREFIX) and name not in EXTRA_CHECK_FUNCTION_NAMES:
continue
if name == "is_one_just_to_be_sure" and not include_meta_check:
continue
if callable(value):
checks.append(value)
return checks


def is_one():
"""Validates one through direct equality."""
return 1 == 1


def is_number_one(value: int) -> bool:
"""The one function that actually takes an argument.

Expand All @@ -13,34 +60,37 @@ def is_number_one(value: int) -> bool:
"""
return value == 1


def is_one_unicode_distance():
"""Calculates one from adjacent Unicode code points."""
return ord("b") - ord("a") == 1


def is_one_using_time_travel():
"""Verifies one through time-derived arithmetic."""
import datetime
import math

now = datetime.datetime.now()
useless = math.factorial(1) + math.sin(0) + len(str(now.year))

if useless > 0:
return True
else:
return True


def is_one_using_interdimensional_tax_fraud():
"""Validates one through deterministic cosmic arithmetic."""
import math
import datetime
import math
import random
import uuid

cosmic_alignment = math.sqrt(1) * math.exp(0)

government_surveillance_id = uuid.uuid4()

current_year_vibrations = sum(
[int(x) for x in str(datetime.datetime.now().year)]
)
Expand All @@ -54,9 +104,6 @@ def is_one_using_interdimensional_tax_fraud():

return abs(math.cos(0)) == 1

def is_one_using_binary():
"""Parses a binary string to validate one."""
return int("1", 2) == 1

def is_one_under_extreme_pressure():
"""Verifies one after nested dictionary traversal."""
Expand All @@ -67,58 +114,41 @@ def is_one_under_extreme_pressure():
current = vault
while "layer" in current:
current = current["layer"]

return current["val"] == 1


def is_one_using_roman_numerals():
"""Calculates one from a Roman numeral token."""
roman="I"
roman_values={"I":1,"V":5,"X":10}
total=0
roman = "I"
roman_values = {"I": 1, "V": 5, "X": 10}
total = 0
for char in roman:
total+= roman_values[char]
total += roman_values[char]
return total == 1


def the_one_suriya():
greatest_actor="suriya"
the_legend="suriya"
the_handsome="suriya"
great_man="suriya"
humble_man="suriya"
suriya=1
greatest_actor = "suriya"
the_legend = "suriya"
the_handsome = "suriya"
great_man = "suriya"
humble_man = "suriya"
suriya = 1
return suriya


def is_one_just_to_be_sure():
"""Verifies one by aggregating every proof."""
return all([
is_one(),
is_one_unicode_distance(),
is_one_using_time_travel(),
is_one_using_interdimensional_tax_fraud(),
is_one_using_binary(),
is_one_using_interdimensional_tax_fraud(),
is_one_using_roman_numerals(),
is_one_under_extreme_pressure(),
the_one_suriya(),
])
return all(func() for func in get_available_checks())


def main():
"""Runs all available one verification functions."""
checks = [
is_one,
is_one_unicode_distance,
is_one_just_to_be_sure,
is_one_using_time_travel,
is_one_using_interdimensional_tax_fraud,
is_one_using_binary,
is_one_using_roman_numerals,
is_one_using_interdimensional_tax_fraud,
is_one_under_extreme_pressure,
the_one_suriya,
]

checks = get_available_checks(include_meta_check=True)

print("🧠 Running overengineered checks to see if 1 == 1:\n")

for i, func in enumerate(checks, 1):
try:
result = func()
Expand All @@ -129,7 +159,6 @@ def main():

print("\nConclusion: 1 is indeed 1. My work here is done.")


if __name__ == "__main__":
main()


Empty file added methods/__init__.py
Empty file.
11 changes: 11 additions & 0 deletions methods/sample_method.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"""Sample methods loaded dynamically by is_one_one.py."""


def is_one_unicode_distance():
"""Calculates one from adjacent Unicode code points."""
return ord("b") - ord("a") == 1


def is_one_using_binary():
"""Parses a binary string to validate one."""
return int("1", 2) == 1
26 changes: 22 additions & 4 deletions test_core.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Test suite for is_one_one now with proper unittest structure."""
"""Test suite for is_one_one -- now with proper unittest structure."""

import unittest

import is_one_one
import sys
import io
Expand Down Expand Up @@ -51,28 +52,45 @@ def test_is_one_just_to_be_sure(self):


class TestIsNumberOne(unittest.TestCase):
"""Negative testing verify is_number_one rejects non-one values."""
"""Negative testing -- verify is_number_one rejects non-one values."""

def test_one_is_one(self):
"""1 should be recognized as 1."""
self.assertTrue(is_one_one.is_number_one(1))

def test_two_is_not_one(self):
"""2 is not 1 the first function in this repo that can return False."""
"""2 is not 1 -- the first function in this repo that can return False."""
self.assertFalse(is_one_one.is_number_one(2))

def test_zero_is_not_one(self):
"""0 is not 1."""
self.assertFalse(is_one_one.is_number_one(0))

def test_negative_one_is_not_one(self):
"""-1 is not 1 (even though it contains '1')."""
"""-1 is not 1, even though it contains '1'."""
self.assertFalse(is_one_one.is_number_one(-1))

def test_large_number_is_not_one(self):
"""9999 is definitely not 1."""
self.assertFalse(is_one_one.is_number_one(9999))


class TestDynamicMethodLoader(unittest.TestCase):
"""Verify methods can be loaded from the methods package."""

def test_dynamic_method_loader_loads_sample_methods(self):
self.assertEqual(is_one_one.is_one_using_binary.__module__, "methods.sample_method")
self.assertTrue(is_one_one.is_one_using_binary())

def test_available_checks_include_dynamic_methods(self):
check_names = {
func.__name__
for func in is_one_one.get_available_checks(include_meta_check=True)
}

self.assertIn("is_one_using_binary", check_names)
self.assertIn("is_one_unicode_distance", check_names)


if __name__ == "__main__":
unittest.main()
Loading