






from doctest import testmod
from math import sqrt

def 						snake_case      (UpperCAmelCase__						) ->       list:
  UpperCamelCase_:      list[int]					   =       []
  if num < 1:
    return facs
  facs.append(1						)
  if num == 1:
    return facs
  facs.append(UpperCAmelCase__						)
  for i in range(2			,					int(sqrt(UpperCAmelCase__						)						) + 1						):
    if num % i == 0:  # If i is a factor of num
      facs.append(UpperCAmelCase__						)
      UpperCamelCase_:      List[str]					   =       num // i  # num//i is the other factor of num
      if d != i:  # If d and i are distinct
        facs.append(UpperCAmelCase__						)  # we have found another factor
  facs.sort()
  return facs


if __name__ == "__main__":
   testmod(name='factors_of_a_number', verbose=True)







from datetime import date

import requests

A_	:	Any				=				'https://api.carbonintensity.org.uk/intensity'

def 						snake_case      () ->       str:
  UpperCamelCase_:      Any					   =       requests.get(UpperCAmelCase__						).json()['data'][0]
  return last_half_hour["intensity"]["actual"]

def 						snake_case      (UpperCAmelCase__			,					UpperCAmelCase__						) ->       list:
  return requests.get(F'''{BASE_URL}/{start}/{end}'''						).json()["data"]


if __name__ == "__main__":
   for entry in fetch_from_to(start=date(2020, 10, 1), end=date(2020, 10, 3)):
      print('from {from} to {to}: {intensity[actual]}'.format(**entry))
   print(F'''{fetch_last_half_hour() = }''')