File size: 1,104 Bytes
75075b9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import os
import requests

# Remove unused import
# Break long URL into multiple lines using parentheses
JOIN_ORG_URL = (
    os.getenv("JOIN_ORG_URL")
    or "https://huggingface.co/organizations/agents-course-finishers/share/"
    "XmxAybhNLOogLeBzZnBUVbazpTlDETqFId"
)


def join_finishers_org():
    """Join the finishers organization using the provided auth cookie.

    Args:
        user_auth_cookie (str): User's authentication cookie

    Returns:
        bool: True if join was successful, False otherwise
    """

    # If you need to include a cookie for authentication, you can do so here
    # Otherwise, you can leave the headers empty
    headers = {
        # "Cookie": "session=abc123def456ghi789jkl012mno345pqr678"  # Uncomment and add your cookie if needed
    }

    # Send the POST request
    response = requests.post(url=JOIN_ORG_URL, headers=headers)

    # Check the response status code
    if response.status_code == 200:
        print("Successfully joined the organization!")
    else:
        print(f"Failed to join the organization. Status code: {response.status_code}")