-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: split model in input/resolved (#40)
* chore: create packages * split model in input/resolved * split model in input/resolved (WIP) * lint/fixes * lint/fixes * lint/fixes * lint/fixes * lint/fixes
- Loading branch information
1 parent
dc8d411
commit d268342
Showing
38 changed files
with
1,068 additions
and
580 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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from typing import Any | ||
|
||
|
||
def has_property(target: Any, name: str) -> bool: | ||
""" | ||
Check if the target has a property with the given name. | ||
:param target: object of dict like | ||
:param name: attribute name | ||
:return: true if the target has the property | ||
""" | ||
if isinstance(target, dict): | ||
return name in target | ||
return hasattr(target, name) |
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
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
Oops, something went wrong.