Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix part of #7427: Adds args, returns and raises in docstrings of utils.py #8134

Merged
merged 9 commits into from
Dec 13, 2019
Prev Previous commit
Next Next commit
Removes Whitespace #2
  • Loading branch information
Arnesh07 committed Dec 5, 2019
commit e7362dd584a345c504fc3839bd0a65e410a0ce69
8 changes: 4 additions & 4 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ def are_datetimes_close(later_datetime, earlier_datetime):
earlier_datetime: datetime. The earlier datetime.

Returns:
bool. Returns true if difference between two datetimes is less than
bool. Returns true if difference between two datetimes is less than
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto, no need of 'Returns' in this line.

feconf.PROXIMAL_TIMEDELTA_SECS seconds otherwise returns false.
"""
difference_in_secs = (later_datetime - earlier_datetime).total_seconds()
Expand Down Expand Up @@ -541,7 +541,7 @@ def require_valid_name(name, name_type, allow_empty=False):

Raises:
Exception: Raised when name isn't a string.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, no need to have 'Raises' in all these definitions, since the heading is 'Raises'. Just have the exception message itself here and elsewhere.

Exception: Raised when the length of the name_type isn't between
Exception: Raised when the length of the name_type isn't between
1 and 50.
Exception: Raised when name starts or ends with whitespace.
Exception: Raised when adjacent whitespace in name_type isn't collapsed.
Expand Down Expand Up @@ -678,7 +678,7 @@ def unescape_encoded_uri_component(escaped_string):
escaped_string: str. String that is encoded with encodeURIComponent.

Returns:
str. Returns decoded string that was initially encoded with
str. Returns decoded string that was initially encoded with
encodeURIComponent.
"""
return python_utils.urllib_unquote(escaped_string).decode('utf-8')
Expand All @@ -689,7 +689,7 @@ def get_asset_dir_prefix():
It is used as a prefix in urls for images, css and script files.

Returns:
str. Returns prefix '/build' if constants,DEV_MODE is false, otherwise
str. Returns prefix '/build' if constants,DEV_MODE is false, otherwise
returns null string.
"""
asset_dir_prefix = ''
Expand Down