Skip to content

Commit

Permalink
[FORMATTER] - Testing autopep8 formatter using single --aggressive
Browse files Browse the repository at this point in the history
  • Loading branch information
The-inside-man committed Jun 21, 2021
1 parent 9d9088b commit 9d71d56
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions optimizely/helpers/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def are_attributes_valid(attributes):
Boolean depending upon whether attributes are in valid format or not.
"""

return type(attributes) is dict
return isinstance(attributes, dict)


def are_event_tags_valid(event_tags):
Expand All @@ -160,7 +160,7 @@ def are_event_tags_valid(event_tags):
Boolean depending upon whether event_tags are in valid format or not.
"""

return type(event_tags) is dict
return isinstance(event_tags, dict)


def is_user_profile_valid(user_profile):
Expand All @@ -176,7 +176,7 @@ def is_user_profile_valid(user_profile):
if not user_profile:
return False

if not type(user_profile) is dict:
if not isinstance(user_profile, dict):
return False

if UserProfile.USER_ID_KEY not in user_profile:
Expand All @@ -186,11 +186,11 @@ def is_user_profile_valid(user_profile):
return False

experiment_bucket_map = user_profile.get(UserProfile.EXPERIMENT_BUCKET_MAP_KEY)
if not type(experiment_bucket_map) is dict:
if not isinstance(experiment_bucket_map, dict):
return False

for decision in experiment_bucket_map.values():
if type(decision) is not dict or UserProfile.VARIATION_ID_KEY not in decision:
if not isinstance(decision, dict) or UserProfile.VARIATION_ID_KEY not in decision:
return False

return True
Expand Down
2 changes: 1 addition & 1 deletion optimizely/optimizely.py
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ def create_user_context(self, user_id, attributes=None):
self.logger.error(enums.Errors.INVALID_INPUT.format('user_id'))
return None

if attributes is not None and type(attributes) is not dict:
if attributes is not None and not isinstance(attributes, dict):
self.logger.error(enums.Errors.INVALID_INPUT.format('attributes'))
return None

Expand Down

0 comments on commit 9d71d56

Please sign in to comment.