<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 This is a demonstration of how to use requests in Python. In this example, we are using requests to access a file using the GitHub API. The resulting JSON object contains a base64-encoded attribute (content), which is decoded, tuned into a list of lines. Lastly, we select some lines of interest.
This example is used in our work on software metrics and the literal include service (for writing projects).
Step1:  This shows how to base64 encode text. b64encode() expects bytes and returns bytes (b).
Step2:  To get the string representation of bytes, use decode().
<ASSISTANT_TASK:>
Python Code:
import requests
import base64
r = requests.get("https://api.github.com/repos/gkthiruvathukal/st-hec/contents/hydra/dataserver.py")
print(r.status_code)
r.json().keys()
b64data = r.json().get('content')
lines = base64.b64decode(b64data).decode("utf-8").split('\n')
selected_lines = lines[10:30]
print("\n".join(selected_lines))
Explanation: This is a demonstration of how to use requests in Python. In this example, we are using requests to access a file using the GitHub API. The resulting JSON object contains a base64-encoded attribute (content), which is decoded, tuned into a list of lines. Lastly, we select some lines of interest.
This example is used in our work on software metrics and the literal include service (for writing projects).
End of explanation
text = "How to encode some text"
bytes = text.encode("UTF-8")
encoded = base64.b64encode(bytes)
encoded
Explanation: This shows how to base64 encode text. b64encode() expects bytes and returns bytes (b).
End of explanation
encoded.decode("UTF-8")
Explanation: To get the string representation of bytes, use decode().
End of explanation
<END_TASK>