Septzzz's picture
Upload folder using huggingface_hub (part 4)
437d68a verified
Raw
History Blame Contribute Delete
1.86 kB
import requests
import json
from datetime import date, datetime, timedelta
import os
from typing import Optional, Dict, Union, List
def pow(base: int, exponent: int, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
"""
"number power"
"""
url = f"https://add2.p.rapidapi.com/pow"
querystring = {'base': base, 'exponent': exponent, }
headers = {
"X-RapidAPI-Key": toolbench_rapidapi_key,
"X-RapidAPI-Host": "add2.p.rapidapi.com"
}
response = requests.get(url, headers=headers, params=querystring)
try:
observation = response.json()
except:
observation = response.text
return observation
def add(a: int, b: int, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
"""
"addtion of numbers"
"""
url = f"https://add2.p.rapidapi.com/add"
querystring = {'a': a, 'b': b, }
headers = {
"X-RapidAPI-Key": toolbench_rapidapi_key,
"X-RapidAPI-Host": "add2.p.rapidapi.com"
}
response = requests.get(url, headers=headers, params=querystring)
try:
observation = response.json()
except:
observation = response.text
return observation
def multiply(a: int, b: int, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
"""
"number multiplication"
"""
url = f"https://add2.p.rapidapi.com/multiply"
querystring = {'a': a, 'b': b, }
headers = {
"X-RapidAPI-Key": toolbench_rapidapi_key,
"X-RapidAPI-Host": "add2.p.rapidapi.com"
}
response = requests.get(url, headers=headers, params=querystring)
try:
observation = response.json()
except:
observation = response.text
return observation