"""
#### Key Formulae

1. **Day of the Year (`N`)**:
    
    N = $\text{day\_of\_year(year, month, day)}$
    
    Calculates the day number within the year, accounting for leap years.
    
2. **Longitude to Hour Value (`lng_hour`)**:
    
    $\text{lng\_hour} = \frac{\text{longitude}}{15.0}$
    
    Converts longitude to an hour value, as the Earth rotates 15 degrees per hour.
    
3. **Approximate Times for Sunrise (`t_rise`) and Sunset (`t_set`)**:
    
    $t\_rise = N + \frac{6 - \text{lng\_hour}}{24}$
    
    $t\_set = N + \frac{18 - \text{lng\_hour}}{24}$
    
    Estimates the fractional day for sunrise and sunset.
    
4. **Sun's Mean Anomaly (`M`)**:
    
    $M = 0.9856 \times t - 3.289$
    
    Represents the position of the sun in its orbit.
    
5. **Sun's True Longitude (`L`)**:
    
    $L = M + (1.916 \times \sin(M)) + (0.020 \times \sin(2 \times M)) + 282.634 \mod 360$
    
    Corrects the mean anomaly to account for orbital eccentricity and the Earth's axial tilt.
    
6. **Sun's Right Ascension (`RA`)**:
    
    $RA = \text{atan}(0.91764 \times \tan(L)) \mod 360$
    
    Determines the celestial equivalent of longitude, adjusted to the correct quadrant.
    
7. **Sun's Declination (`sin_dec` and `cos_dec`)**:
    
    $\sin\_dec = 0.39782 \times \sin(L)$
    
    $\cos\_dec = \cos(\arcsin(\sin\_dec))$
    
    Represents the angle between the sun and the celestial equator.
    
8. **Sun's Local Hour Angle (`cos_h`)**:
    
   $\cos\_h = \frac{\cos(zenith) - (\sin\_dec \times \sin(\text{latitude}))}{\cos\_dec \times \cos(\text{latitude})}$
    
    Determines the hour angle at sunrise and sunset.
    
9. **Local Mean Time of Rising and Setting (`T`)**:
    
    $T = H + RA - (0.06571 \times t) - 6.622$
    
    Calculates the local mean time based on the hour angle and right ascension.
    
10. **Universal Time (`UT`)**:
    
    $UT = (T - \text{lng\_hour}) \mod 24$
    
    Converts local mean time to universal time.
    
11. **Local Time (`sunrise_time` and `sunset_time`)**:
    
    $\text{sunrise\_time} = (UT\_rise + \text{timezone\_offset}) \mod 24$
    
    $\text{sunset\_time} = (UT\_set + \text{timezone\_offset}) \mod 24$
    
    Adjusts universal time to the specified timezone.
    

#### Overall Calculation Steps

1. **Determine the Day of the Year (`N`)**:
    
    - Accounts for leap years to accurately determine the day count within the year.
2. **Convert Longitude to Hour Value (`lng_hour`)**:
    
    - Facilitates the conversion between geographic coordinates and time.
3. **Calculate Approximate Times for Sunrise and Sunset (`t_rise` and `t_set`)**:
    
    - Provides initial estimates for further refinement.
4. **Compute the Sun's Mean Anomaly (`M_rise` and `M_set`)**:
    
    - Sets the stage for determining the sun's true position.
5. **Determine the Sun's True Longitude (`L_rise` and `L_set`)**:
    
    - Adjusts for orbital eccentricity and axial tilt.
6. **Calculate the Sun's Right Ascension (`RA_rise` and `RA_set`)**:
    
    - Ensures the right ascension is in the correct quadrant.
7. **Compute the Sun's Declination (`sin_dec` and `cos_dec`)**:
    
    - Determines the sun's position relative to the celestial equator.
8. **Calculate the Sun's Local Hour Angle (`cos_h_rise` and `cos_h_set`)**:
    
    - Essential for identifying the precise times of sunrise and sunset.
9. **Handle Polar Day/Night Scenarios**:
    
    - Detects cases where the sun does not rise or set, returning `None` values accordingly.
10. **Compute the Local Mean Time of Rising and Setting (`T_rise` and `T_set`)**:
    
    - Refines the approximate times to account for celestial mechanics.
11. **Convert to Universal Time (`UT_rise` and `UT_set`) and Adjust for Timezone**:
    
    - Finalizes the sunrise and sunset times in local time.
"""

change the above to consider the new function
```
def calculate_sunrise_sunset(latitude, longitude, year, month, day, timezone_offset=0):
    """
    Calculate sunrise and sunset times using NOAA's method for a given location and date.

    Parameters:
        latitude (float): Latitude in decimal degrees (positive for north).
        longitude (float): Longitude in decimal degrees (positive for east).
        year (int): Year of the date.
        month (int): Month of the date.
        day (int): Day of the date.
        timezone_offset (float): Offset from UTC in hours.

    Returns:
        tuple: Sunrise and sunset times in decimal hours (0-24), adjusted for timezone.
               Returns (None, None) if the sun does not rise or set on the given date/location.
    """
    # Step 1: Calculate Julian Day
    if month <= 2:
        year -= 1
        month += 12
    A = int(year / 100)
    B = 2 - A + int(A / 4)
    JD = int(365.25 * (year + 4716)) + int(30.6001 * (month + 1)) + day + B - 1524.5

    # Step 2: Calculate Julian Century
    JC = (JD - 2451545.0) / 36525.0

    # Step 3: Calculate Geometric Mean Longitude of the Sun
    L0 = mod(280.46646 + JC * (36000.76983 + JC * 0.0003032), 360)

    # Step 4: Calculate Geometric Mean Anomaly of the Sun
    M = 357.52911 + JC * (35999.05029 - 0.0001537 * JC)

    # Step 5: Calculate Eccentricity of Earth's Orbit
    e = 0.016708634 - JC * (0.000042037 + 0.0000001267 * JC)

    # Step 6: Calculate Sun's Equation of the Center
    C = sin(M) * (1.914602 - JC * (0.004817 + 0.000014 * JC)) + sin(2 * M) * (0.019993 - 0.000101 * JC) + sin(3 * M) * 0.000289

    # Step 7: Calculate Sun's True Longitude
    true_long = L0 + C

    # Step 8: Calculate Sun's Apparent Longitude
    omega = 125.04 - 1934.136 * JC
    lambda_sun = true_long - 0.00569 - 0.00478 * sin(omega)

    # Step 9: Calculate Mean Obliquity of the Ecliptic
    U = JC / 100
    epsilon0 = 23 + (26 + ((21.448 - U * (46.815 + U * (0.00059 - U * 0.001813)))) / 60) / 60

    # Step 10: Calculate Corrected Obliquity
    epsilon = epsilon0 + 0.00256 * cos(omega)

    # Step 11: Calculate Sun's Declination
    sin_decl = sin(epsilon) * sin(lambda_sun)
    cos_decl = cos(asin(sin_decl))

    # Step 12: Calculate Equation of Time
    y = tan(epsilon / 2) ** 2
    EoT = 4 * degrees(y * sin(2 * L0) - 2 * e * sin(M) + 4 * e * y * sin(M) * cos(2 * L0) - 0.5 * y ** 2 * sin(4 * L0) - 1.25 * e ** 2 * sin(2 * M))

    # Step 13: Calculate Hour Angle
    cos_ha = (cos(90.833) / (cos(latitude) * cos_decl)) - (tan(latitude) * tan(asin(sin_decl)))
    if abs(cos_ha) > 1:
        return None, None  # Sun never rises or sets
    ha = acos(cos_ha)

    # Step 14: Calculate Solar Noon
    solar_noon = (720 - 4 * longitude - EoT + timezone_offset * 60) / 1440

    # Step 15: Calculate Sunrise and Sunset Times
    sunrise_time = solar_noon - ha * 4 / 1440
    sunset_time = solar_noon + ha * 4 / 1440

    # Convert times to decimal hours
    sunrise = mod(sunrise_time * 24, 24)
    sunset = mod(sunset_time * 24, 24)

    return sunrise, sunset
```

Change Key Formulae and Improvements and also Overall Calculation Steps as required. Keep in my tone and return full thing txt