<human>:  Python function to get cookie from request in Python.
<bot>: Here is a Python function to get a cookie from a request

import requests

def get_cookie(request):
  """
  Returns a cookie from a request object.
  """
  cookie = request.cookies.get('my_cookie')
  if cookie is None:
    cookie ='my_cookie'
  return cookie

# Enter the request
request = requests.get('http://www.google.com')

# Calling the function
cookie = get_cookie(request)

# Printing the cookie
print(cookie)

#Example Output
# my_cookie

#Remember to inspect code for bugs.