


def __UpperCAmelCase       (		__A			)						->					int:



  '''simple docstring'''





  UpperCAmelCase__										=     abs(__A			)
  UpperCAmelCase__										=     0
  while n > 0:
    res += n % 1_0
    n //= 1_0
  return res





def __UpperCAmelCase       (		__A			)						->					int:



  '''simple docstring'''





  UpperCAmelCase__										=     abs(__A			)
  return n if n < 1_0 else n % 1_0 + sum_of_digits(n // 1_0			)





def __UpperCAmelCase       (		__A			)						->					int:



  '''simple docstring'''





  return sum(int(__A			) for c in str(abs(__A			)			)			)





def __UpperCAmelCase       (		)						->					None:



  '''simple docstring'''





  from collections.abc import Callable
  from timeit import timeit

  def benchmark_a_function(__A ,						__A			) -> None:
    UpperCAmelCase__										=     F"""{func.__name__}({value})"""
    UpperCAmelCase__										=     timeit(F"""__main__.{call}""" ,						setup="import __main__"			)
    print(F"""{call:56} = {func(__A			)} -- {timing:.4f} seconds"""			)

  for value in (2_6_2_1_4_4, 1_1_2_5_8_9_9_9_0_6_8_4_2_6_2_4, 1_2_6_7_6_5_0_6_0_0_2_2_8_2_2_9_4_0_1_4_9_6_7_0_3_2_0_5_3_7_6):
    for func in (sum_of_digits, sum_of_digits_recursion, sum_of_digits_compact):
      benchmark_a_function(__A ,						__A			)
    print()


if __name__ == "__main__":
    import doctest

    doctest.testmod()
    benchmark()









import csv

import tweepy

# Twitter API credentials
A      = ""
A      = ""
A      = ""
A      = ""





def __UpperCAmelCase       (		__A			)						->					None:



       '''simple docstring'''





       UpperCAmelCase__										=     tweepy.OAuthHandler(__A ,						__A			)
       auth.set_access_token(__A ,						__A			)
       UpperCAmelCase__										=     tweepy.API(__A			)

       # initialize a list to hold all the tweepy Tweets
       UpperCAmelCase__										=     []

       # make initial request for most recent tweets (200 is the maximum allowed count)
       UpperCAmelCase__										=     api.user_timeline(screen_name=__A ,						count=2_0_0			)

       # save most recent tweets
       alltweets.extend(__A			)

       # save the id of the oldest tweet less one
       UpperCAmelCase__										=     alltweets[-1].id - 1

       # keep grabbing tweets until there are no tweets left to grab
       while len(__A			) > 0:
              print(F"""getting tweets before {oldest}"""			)

              # all subsequent requests use the max_id param to prevent duplicates
              UpperCAmelCase__										=     api.user_timeline(
                  screen_name=__A ,						count=2_0_0 ,						max_id=__A			)

              # save most recent tweets
              alltweets.extend(__A			)

              # update the id of the oldest tweet less one
              UpperCAmelCase__										=     alltweets[-1].id - 1

              print(F"""...{len(__A			)} tweets downloaded so far"""			)

       # transform the tweepy tweets into a 2D array that will populate the csv
       UpperCAmelCase__										=     [[tweet.id_str, tweet.created_at, tweet.text] for tweet in alltweets]

       # write the csv
       with open(F"""new_{screen_name}_tweets.csv""" ,						"w"			) as f:
              UpperCAmelCase__										=     csv.writer(__A			)
              writer.writerow(["id", "created_at", "text"]			)
              writer.writerows(__A			)


if __name__ == "__main__":
    # pass in the username of the account you want to download
    get_all_tweets("FirePing32")





