Skip to content
This repository has been archived by the owner on Feb 14, 2024. It is now read-only.

Commit

Permalink
Simplify return statements
Browse files Browse the repository at this point in the history
- I prefer to keep the rest "as is" for the purpose of readability
  • Loading branch information
aloftus23 committed Mar 8, 2022
1 parent 90dbfcf commit 0a1df35
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
5 changes: 1 addition & 4 deletions src/pe_source/data/sixgill/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ def alerts_list(organization_id, fetch_size, offset):
"fetch_size": fetch_size,
"offset": offset,
}

resp = requests.get(url, headers=headers, params=payload)
return resp

Expand Down Expand Up @@ -116,7 +115,5 @@ def credential_auth(params):
"Cache-Control": "no-cache",
"Authorization": "Bearer " + auth,
}

resp = requests.get(url, headers=headers, params=params)
resp = resp.json()
resp = requests.get(url, headers=headers, params=params).json()
return resp
3 changes: 1 addition & 2 deletions src/pe_source/data/sixgill/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,4 @@ def token():
"client_secret": client_secret,
}
resp = requests.post(url, headers=headers, data=payload).json()
token = resp["access_token"]
return token
return resp["access_token"]
6 changes: 2 additions & 4 deletions src/pe_source/data/sixgill/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,13 @@ def alerts(org_id):
def top_cves(size):
"""Top 10 CVEs mentioned in the dark web."""
resp = dve_top_cves(size)
df_top_cves = pd.DataFrame(resp)
return df_top_cves
return pd.DataFrame(resp)


def cve_summary(cveid):
"""Get CVE summary data."""
url = f"https://cve.circl.lu/api/cve/{cveid}"
resp = requests.get(url).json()
return resp
return requests.get(url).json()


def creds(domain, from_date, to_date):
Expand Down

0 comments on commit 0a1df35

Please sign in to comment.