This repository has been archived by the owner on Nov 18, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
66 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
*.pyc | ||
*.swp | ||
.tox/ | ||
boom.egg-info/ | ||
venv/ | ||
build/ | ||
dist/ | ||
.idea/ | ||
.coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
""" | ||
Functions | ||
""" | ||
|
||
import uuid | ||
import random | ||
|
||
|
||
def get_uuid_list(number, length): | ||
""" | ||
Returns a list of "sentences" of uuids of | ||
random length. | ||
Parameters: | ||
number the number of sentences to generate | ||
length the maximum length of a sentence | ||
""" | ||
|
||
utterances = [] | ||
|
||
for i in range(0, number): | ||
|
||
utterance = [] | ||
for j in range(1, random.randint(2, length)): | ||
utterance.append(uuid.uuid4().hex) | ||
utterances.append(" ".join(utterance)) | ||
|
||
return utterances | ||
|
||
|
||
def maybe_append_query_string(url, query_name, query_value): | ||
""" | ||
If the query_name is present, adds the | ||
query string to the URL, filling in the | ||
query_value. | ||
""" | ||
|
||
if query_name: | ||
url = "{}?{}={}".format(url, query_name, query_value) | ||
|
||
return url | ||
|