-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
794dc31
Merge pull request #1 from oppia/develop
Arnesh07 97068b6
Merge branch 'develop' of https://github.com/oppia/oppia into develop
Arnesh07 8d4d637
Merge branch 'develop' of https://github.com/oppia/oppia into develop
Arnesh07 f42eb0a
Adds docstrings for utils.py
Arnesh07 8d89813
Removes trailing whitespace
Arnesh07 5929a42
Shortens line length
Arnesh07 e7362dd
Removes Whitespace #2
Arnesh07 3c1c529
Minor changes
Arnesh07 1320f47
Minor changes
Arnesh07 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
|
@@ -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 | ||
feconf.PROXIMAL_TIMEDELTA_SECS seconds otherwise returns false. | ||
""" | ||
difference_in_secs = (later_datetime - earlier_datetime).total_seconds() | ||
|
@@ -541,7 +541,7 @@ def require_valid_name(name, name_type, allow_empty=False): | |
|
||
Raises: | ||
Exception: Raised when name isn't a string. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. | ||
|
@@ -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') | ||
|
@@ -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 = '' | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.