





"""simple docstring"""






from __future__ import annotations

import requests

def       __lowerCamelCase    (       SCREAMING_SNAKE_CASE							)		->       dict:






       """simple docstring"""




       _UpperCAmelCase     =     F"""https://hacker-news.firebaseio.com/v0/item/{story_id}.json?print=pretty"""
       return requests.get(SCREAMING_SNAKE_CASE							).json()

def       __lowerCamelCase    (       SCREAMING_SNAKE_CASE = 10							)		->       list[dict]:






       """simple docstring"""




       _UpperCAmelCase     =     'https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty'
       _UpperCAmelCase     =     requests.get(SCREAMING_SNAKE_CASE							).json()[:max_stories]
       return [get_hackernews_story(SCREAMING_SNAKE_CASE							) for story_id in story_ids]

def       __lowerCamelCase    (       SCREAMING_SNAKE_CASE = 10							)		->       str:






       """simple docstring"""




       _UpperCAmelCase     =     hackernews_top_stories(SCREAMING_SNAKE_CASE							)
       return "\n".join('* [{title}]({url})'.format(**SCREAMING_SNAKE_CASE							) for story in stories							)


if __name__ == "__main__":
    print(hackernews_top_stories_as_markdown())













"""simple docstring"""






def       __lowerCamelCase    (       SCREAMING_SNAKE_CASE,SCREAMING_SNAKE_CASE							)		->       str:






       """simple docstring"""




       if a < 0 or b < 0:
              raise ValueError('the value of both inputs must be positive'							)

       _UpperCAmelCase     =     str(bin(SCREAMING_SNAKE_CASE							)							)[2:]  # remove the leading "0b"
       _UpperCAmelCase     =     str(bin(SCREAMING_SNAKE_CASE							)							)[2:]  # remove the leading "0b"

       _UpperCAmelCase     =     max(len(SCREAMING_SNAKE_CASE							),len(SCREAMING_SNAKE_CASE							)							)

       return "0b" + "".join(
           str(int(char_a == '1' and char_b == '1'							)							)
           for char_a, char_b in zip(a_binary.zfill(SCREAMING_SNAKE_CASE							),b_binary.zfill(SCREAMING_SNAKE_CASE							)							)							)


if __name__ == "__main__":
    import doctest

    doctest.testmod()






