From 306e43bbffe8c9dfbdd3bfe8ca13bf01e7213028 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Sun, 27 May 2012 12:24:21 +0100 Subject: [PATCH] Move 'todo's out of generated code --- codegen/JsonDescriptionOfGithubApiV3/normalize.py | 3 +++ codegen/templates/GithubObject.py | 2 -- src/github/AuthenticatedUser.py | 1 - src/github/Authorization.py | 1 - src/github/Branch.py | 1 - src/github/Commit.py | 1 - src/github/CommitComment.py | 1 - src/github/CommitFile.py | 1 - src/github/CommitStats.py | 1 - src/github/Download.py | 1 - src/github/Event.py | 1 - src/github/Gist.py | 1 - src/github/GistComment.py | 1 - src/github/GistHistoryState.py | 1 - src/github/GitAuthor.py | 1 - src/github/GitBlob.py | 1 - src/github/GitCommit.py | 1 - src/github/GitObject.py | 1 - src/github/GitRef.py | 1 - src/github/GitTag.py | 1 - src/github/GitTree.py | 1 - src/github/GitTreeElement.py | 1 - src/github/Hook.py | 1 - src/github/Issue.py | 1 - src/github/IssueComment.py | 1 - src/github/IssueEvent.py | 1 - src/github/Milestone.py | 1 - src/github/NamedUser.py | 2 -- src/github/Organization.py | 1 - src/github/Permissions.py | 1 - src/github/Plan.py | 1 - src/github/PullRequest.py | 1 - src/github/PullRequestComment.py | 1 - src/github/PullRequestFile.py | 1 - src/github/Repository.py | 2 -- src/github/RepositoryKey.py | 1 - src/github/Tag.py | 1 - src/github/Team.py | 1 - src/github/UserKey.py | 1 - 39 files changed, 3 insertions(+), 41 deletions(-) diff --git a/codegen/JsonDescriptionOfGithubApiV3/normalize.py b/codegen/JsonDescriptionOfGithubApiV3/normalize.py index 52d40027..214d7ab4 100644 --- a/codegen/JsonDescriptionOfGithubApiV3/normalize.py +++ b/codegen/JsonDescriptionOfGithubApiV3/normalize.py @@ -4,6 +4,9 @@ import os.path import json import itertools +### @todo Mandatory/optional attributes +### @todo Remove '_identity' from the normalized json description + def checkKeys( d, mandatoryKeys, optionalKeys = [] ): assert set( d.keys() ) >= set( mandatoryKeys ), d.keys() assert set( d.keys() ) <= set( mandatoryKeys ) | set( optionalKeys ) | set( [ "@todo" ] ), d.keys() diff --git a/codegen/templates/GithubObject.py b/codegen/templates/GithubObject.py index 6215d121..831a0555 100644 --- a/codegen/templates/GithubObject.py +++ b/codegen/templates/GithubObject.py @@ -36,7 +36,6 @@ class {{ class.name }}( object ): {% endfor %} {% if class.identity %} - # @todo Remove '_identity' from the normalized json description @property def _identity( self ): return {% include "GithubObject.Concatenation.py" with concatenation=class.identity only %} @@ -64,7 +63,6 @@ class {{ class.name }}( object ): {% endif %} def __useAttributes( self, attributes ): - # @todo No need to check if attribute is in attributes when attribute is mandatory {% for attribute in class.attributes|dictsort:"name" %} if "{{ attribute.name }}" in attributes and attributes[ "{{ attribute.name }}" ] is not None: # pragma no branch diff --git a/src/github/AuthenticatedUser.py b/src/github/AuthenticatedUser.py index d6a5babf..1bfdf4ea 100644 --- a/src/github/AuthenticatedUser.py +++ b/src/github/AuthenticatedUser.py @@ -564,7 +564,6 @@ class AuthenticatedUser( object ): self.__completed = True def __useAttributes( self, attributes ): - # @todo No need to check if attribute is in attributes when attribute is mandatory if "avatar_url" in attributes and attributes[ "avatar_url" ] is not None: # pragma no branch assert isinstance( attributes[ "avatar_url" ], ( str, unicode ) ) self.__avatar_url = attributes[ "avatar_url" ] diff --git a/src/github/Authorization.py b/src/github/Authorization.py index 2b7b1442..9a1d7b46 100644 --- a/src/github/Authorization.py +++ b/src/github/Authorization.py @@ -113,7 +113,6 @@ class Authorization( object ): self.__completed = True def __useAttributes( self, attributes ): - # @todo No need to check if attribute is in attributes when attribute is mandatory if "app" in attributes and attributes[ "app" ] is not None: # pragma no branch self.__app = attributes[ "app" ] if "created_at" in attributes and attributes[ "created_at" ] is not None: # pragma no branch diff --git a/src/github/Branch.py b/src/github/Branch.py index b71d37ec..28562f7e 100644 --- a/src/github/Branch.py +++ b/src/github/Branch.py @@ -24,7 +24,6 @@ class Branch( object ): self.__name = None def __useAttributes( self, attributes ): - # @todo No need to check if attribute is in attributes when attribute is mandatory if "commit" in attributes and attributes[ "commit" ] is not None: # pragma no branch assert isinstance( attributes[ "commit" ], dict ) self.__commit = Commit.Commit( self.__requester, attributes[ "commit" ], completion = LazyCompletion ) diff --git a/src/github/Commit.py b/src/github/Commit.py index a7cde039..a3046870 100644 --- a/src/github/Commit.py +++ b/src/github/Commit.py @@ -116,7 +116,6 @@ class Commit( object ): self.__completed = True def __useAttributes( self, attributes ): - # @todo No need to check if attribute is in attributes when attribute is mandatory if "author" in attributes and attributes[ "author" ] is not None: # pragma no branch assert isinstance( attributes[ "author" ], dict ) self.__author = NamedUser.NamedUser( self.__requester, attributes[ "author" ], completion = LazyCompletion ) diff --git a/src/github/CommitComment.py b/src/github/CommitComment.py index f4c2c67a..669578ec 100644 --- a/src/github/CommitComment.py +++ b/src/github/CommitComment.py @@ -117,7 +117,6 @@ class CommitComment( object ): self.__completed = True def __useAttributes( self, attributes ): - # @todo No need to check if attribute is in attributes when attribute is mandatory if "body" in attributes and attributes[ "body" ] is not None: # pragma no branch assert isinstance( attributes[ "body" ], ( str, unicode ) ) self.__body = attributes[ "body" ] diff --git a/src/github/CommitFile.py b/src/github/CommitFile.py index 8469636d..d512e408 100644 --- a/src/github/CommitFile.py +++ b/src/github/CommitFile.py @@ -58,7 +58,6 @@ class CommitFile( object ): self.__status = None def __useAttributes( self, attributes ): - # @todo No need to check if attribute is in attributes when attribute is mandatory if "additions" in attributes and attributes[ "additions" ] is not None: # pragma no branch self.__additions = attributes[ "additions" ] if "blob_url" in attributes and attributes[ "blob_url" ] is not None: # pragma no branch diff --git a/src/github/CommitStats.py b/src/github/CommitStats.py index e663c60c..2a7a4727 100644 --- a/src/github/CommitStats.py +++ b/src/github/CommitStats.py @@ -28,7 +28,6 @@ class CommitStats( object ): self.__total = None def __useAttributes( self, attributes ): - # @todo No need to check if attribute is in attributes when attribute is mandatory if "additions" in attributes and attributes[ "additions" ] is not None: # pragma no branch assert isinstance( attributes[ "additions" ], int ) self.__additions = attributes[ "additions" ] diff --git a/src/github/Download.py b/src/github/Download.py index f47c95f8..342e3094 100644 --- a/src/github/Download.py +++ b/src/github/Download.py @@ -158,7 +158,6 @@ class Download( object ): self.__completed = True def __useAttributes( self, attributes ): - # @todo No need to check if attribute is in attributes when attribute is mandatory if "accesskeyid" in attributes and attributes[ "accesskeyid" ] is not None: # pragma no branch self.__accesskeyid = attributes[ "accesskeyid" ] if "acl" in attributes and attributes[ "acl" ] is not None: # pragma no branch diff --git a/src/github/Event.py b/src/github/Event.py index ca639d35..19a9e1af 100644 --- a/src/github/Event.py +++ b/src/github/Event.py @@ -56,7 +56,6 @@ class Event( object ): self.__type = None def __useAttributes( self, attributes ): - # @todo No need to check if attribute is in attributes when attribute is mandatory if "actor" in attributes and attributes[ "actor" ] is not None: # pragma no branch assert isinstance( attributes[ "actor" ], dict ) self.__actor = NamedUser.NamedUser( self.__requester, attributes[ "actor" ], completion = LazyCompletion ) diff --git a/src/github/Gist.py b/src/github/Gist.py index c4c01a88..81bd9b74 100644 --- a/src/github/Gist.py +++ b/src/github/Gist.py @@ -216,7 +216,6 @@ class Gist( object ): self.__completed = True def __useAttributes( self, attributes ): - # @todo No need to check if attribute is in attributes when attribute is mandatory if "comments" in attributes and attributes[ "comments" ] is not None: # pragma no branch assert isinstance( attributes[ "comments" ], int ) self.__comments = attributes[ "comments" ] diff --git a/src/github/GistComment.py b/src/github/GistComment.py index ccaa9e57..5af4f71e 100644 --- a/src/github/GistComment.py +++ b/src/github/GistComment.py @@ -64,7 +64,6 @@ class GistComment( object ): self.__user = None def __useAttributes( self, attributes ): - # @todo No need to check if attribute is in attributes when attribute is mandatory if "body" in attributes and attributes[ "body" ] is not None: # pragma no branch self.__body = attributes[ "body" ] if "created_at" in attributes and attributes[ "created_at" ] is not None: # pragma no branch diff --git a/src/github/GistHistoryState.py b/src/github/GistHistoryState.py index 0cdf588f..6e39b7ff 100644 --- a/src/github/GistHistoryState.py +++ b/src/github/GistHistoryState.py @@ -40,7 +40,6 @@ class GistHistoryState( object ): self.__version = None def __useAttributes( self, attributes ): - # @todo No need to check if attribute is in attributes when attribute is mandatory if "change_status" in attributes and attributes[ "change_status" ] is not None: # pragma no branch assert isinstance( attributes[ "change_status" ], dict ) self.__change_status = CommitStats.CommitStats( self.__requester, attributes[ "change_status" ], completion = LazyCompletion ) diff --git a/src/github/GitAuthor.py b/src/github/GitAuthor.py index 718993ca..024c380c 100644 --- a/src/github/GitAuthor.py +++ b/src/github/GitAuthor.py @@ -28,7 +28,6 @@ class GitAuthor( object ): self.__name = None def __useAttributes( self, attributes ): - # @todo No need to check if attribute is in attributes when attribute is mandatory if "date" in attributes and attributes[ "date" ] is not None: # pragma no branch assert isinstance( attributes[ "date" ], ( str, unicode ) ) self.__date = attributes[ "date" ] diff --git a/src/github/GitBlob.py b/src/github/GitBlob.py index 7c8bbe67..e6d686e2 100644 --- a/src/github/GitBlob.py +++ b/src/github/GitBlob.py @@ -38,7 +38,6 @@ class GitBlob( object ): self.__url = None def __useAttributes( self, attributes ): - # @todo No need to check if attribute is in attributes when attribute is mandatory if "content" in attributes and attributes[ "content" ] is not None: # pragma no branch assert isinstance( attributes[ "content" ], ( str, unicode ) ) self.__content = attributes[ "content" ] diff --git a/src/github/GitCommit.py b/src/github/GitCommit.py index 742c399f..2b100ca9 100644 --- a/src/github/GitCommit.py +++ b/src/github/GitCommit.py @@ -51,7 +51,6 @@ class GitCommit( object ): self.__url = None def __useAttributes( self, attributes ): - # @todo No need to check if attribute is in attributes when attribute is mandatory if "author" in attributes and attributes[ "author" ] is not None: # pragma no branch assert isinstance( attributes[ "author" ], dict ) self.__author = GitAuthor.GitAuthor( self.__requester, attributes[ "author" ], completion = LazyCompletion ) diff --git a/src/github/GitObject.py b/src/github/GitObject.py index 2adb574d..ac7e3b41 100644 --- a/src/github/GitObject.py +++ b/src/github/GitObject.py @@ -28,7 +28,6 @@ class GitObject( object ): self.__url = None def __useAttributes( self, attributes ): - # @todo No need to check if attribute is in attributes when attribute is mandatory if "sha" in attributes and attributes[ "sha" ] is not None: # pragma no branch assert isinstance( attributes[ "sha" ], ( str, unicode ) ) self.__sha = attributes[ "sha" ] diff --git a/src/github/GitRef.py b/src/github/GitRef.py index 2fbd5b5b..8d449e1b 100644 --- a/src/github/GitRef.py +++ b/src/github/GitRef.py @@ -51,7 +51,6 @@ class GitRef( object ): self.__url = None def __useAttributes( self, attributes ): - # @todo No need to check if attribute is in attributes when attribute is mandatory if "object" in attributes and attributes[ "object" ] is not None: # pragma no branch assert isinstance( attributes[ "object" ], dict ) self.__object = GitObject.GitObject( self.__requester, attributes[ "object" ], completion = LazyCompletion ) diff --git a/src/github/GitTag.py b/src/github/GitTag.py index 94d6bdce..caa95bc0 100644 --- a/src/github/GitTag.py +++ b/src/github/GitTag.py @@ -45,7 +45,6 @@ class GitTag( object ): self.__url = None def __useAttributes( self, attributes ): - # @todo No need to check if attribute is in attributes when attribute is mandatory if "message" in attributes and attributes[ "message" ] is not None: # pragma no branch assert isinstance( attributes[ "message" ], ( str, unicode ) ) self.__message = attributes[ "message" ] diff --git a/src/github/GitTree.py b/src/github/GitTree.py index bcec07f8..a60bb204 100644 --- a/src/github/GitTree.py +++ b/src/github/GitTree.py @@ -29,7 +29,6 @@ class GitTree( object ): self.__url = None def __useAttributes( self, attributes ): - # @todo No need to check if attribute is in attributes when attribute is mandatory if "sha" in attributes and attributes[ "sha" ] is not None: # pragma no branch assert isinstance( attributes[ "sha" ], ( str, unicode ) ) self.__sha = attributes[ "sha" ] diff --git a/src/github/GitTreeElement.py b/src/github/GitTreeElement.py index 5260d7a0..85782925 100644 --- a/src/github/GitTreeElement.py +++ b/src/github/GitTreeElement.py @@ -43,7 +43,6 @@ class GitTreeElement( object ): self.__url = None def __useAttributes( self, attributes ): - # @todo No need to check if attribute is in attributes when attribute is mandatory if "mode" in attributes and attributes[ "mode" ] is not None: # pragma no branch assert isinstance( attributes[ "mode" ], ( str, unicode ) ) self.__mode = attributes[ "mode" ] diff --git a/src/github/Hook.py b/src/github/Hook.py index 8d6c939c..4d099db2 100644 --- a/src/github/Hook.py +++ b/src/github/Hook.py @@ -95,7 +95,6 @@ class Hook( object ): self.__url = None def __useAttributes( self, attributes ): - # @todo No need to check if attribute is in attributes when attribute is mandatory if "active" in attributes and attributes[ "active" ] is not None: # pragma no branch self.__active = attributes[ "active" ] if "config" in attributes and attributes[ "config" ] is not None: # pragma no branch diff --git a/src/github/Issue.py b/src/github/Issue.py index fb9c9f1b..14fb13c9 100644 --- a/src/github/Issue.py +++ b/src/github/Issue.py @@ -264,7 +264,6 @@ class Issue( object ): self.__completed = True def __useAttributes( self, attributes ): - # @todo No need to check if attribute is in attributes when attribute is mandatory if "assignee" in attributes and attributes[ "assignee" ] is not None: # pragma no branch assert isinstance( attributes[ "assignee" ], dict ) self.__assignee = NamedUser.NamedUser( self.__requester, attributes[ "assignee" ], completion = LazyCompletion ) diff --git a/src/github/IssueComment.py b/src/github/IssueComment.py index 9d44e11d..5d198891 100644 --- a/src/github/IssueComment.py +++ b/src/github/IssueComment.py @@ -64,7 +64,6 @@ class IssueComment( object ): self.__user = None def __useAttributes( self, attributes ): - # @todo No need to check if attribute is in attributes when attribute is mandatory if "body" in attributes and attributes[ "body" ] is not None: # pragma no branch self.__body = attributes[ "body" ] if "created_at" in attributes and attributes[ "created_at" ] is not None: # pragma no branch diff --git a/src/github/IssueEvent.py b/src/github/IssueEvent.py index 5dcda3a2..cd9103f0 100644 --- a/src/github/IssueEvent.py +++ b/src/github/IssueEvent.py @@ -74,7 +74,6 @@ class IssueEvent( object ): self.__completed = True def __useAttributes( self, attributes ): - # @todo No need to check if attribute is in attributes when attribute is mandatory if "actor" in attributes and attributes[ "actor" ] is not None: # pragma no branch assert isinstance( attributes[ "actor" ], dict ) self.__actor = NamedUser.NamedUser( self.__requester, attributes[ "actor" ], completion = LazyCompletion ) diff --git a/src/github/Milestone.py b/src/github/Milestone.py index 6d390134..90c3a58f 100644 --- a/src/github/Milestone.py +++ b/src/github/Milestone.py @@ -110,7 +110,6 @@ class Milestone( object ): self.__url = None def __useAttributes( self, attributes ): - # @todo No need to check if attribute is in attributes when attribute is mandatory if "closed_issues" in attributes and attributes[ "closed_issues" ] is not None: # pragma no branch assert isinstance( attributes[ "closed_issues" ], int ) self.__closed_issues = attributes[ "closed_issues" ] diff --git a/src/github/NamedUser.py b/src/github/NamedUser.py index 8b3b8427..3f19c68d 100644 --- a/src/github/NamedUser.py +++ b/src/github/NamedUser.py @@ -313,7 +313,6 @@ class NamedUser( object ): data ) - # @todo Remove '_identity' from the normalized json description @property def _identity( self ): return str( self.login ) @@ -361,7 +360,6 @@ class NamedUser( object ): self.__completed = True def __useAttributes( self, attributes ): - # @todo No need to check if attribute is in attributes when attribute is mandatory if "avatar_url" in attributes and attributes[ "avatar_url" ] is not None: # pragma no branch assert isinstance( attributes[ "avatar_url" ], ( str, unicode ) ) self.__avatar_url = attributes[ "avatar_url" ] diff --git a/src/github/Organization.py b/src/github/Organization.py index 3c25307d..febd06ef 100644 --- a/src/github/Organization.py +++ b/src/github/Organization.py @@ -386,7 +386,6 @@ class Organization( object ): self.__completed = True def __useAttributes( self, attributes ): - # @todo No need to check if attribute is in attributes when attribute is mandatory if "avatar_url" in attributes and attributes[ "avatar_url" ] is not None: # pragma no branch assert isinstance( attributes[ "avatar_url" ], ( str, unicode ) ) self.__avatar_url = attributes[ "avatar_url" ] diff --git a/src/github/Permissions.py b/src/github/Permissions.py index 90e3880b..ec3b7efc 100644 --- a/src/github/Permissions.py +++ b/src/github/Permissions.py @@ -28,7 +28,6 @@ class Permissions( object ): self.__push = None def __useAttributes( self, attributes ): - # @todo No need to check if attribute is in attributes when attribute is mandatory if "admin" in attributes and attributes[ "admin" ] is not None: # pragma no branch assert isinstance( attributes[ "admin" ], bool ) self.__admin = attributes[ "admin" ] diff --git a/src/github/Plan.py b/src/github/Plan.py index 4cd55323..fe874c44 100644 --- a/src/github/Plan.py +++ b/src/github/Plan.py @@ -33,7 +33,6 @@ class Plan( object ): self.__space = None def __useAttributes( self, attributes ): - # @todo No need to check if attribute is in attributes when attribute is mandatory if "collaborators" in attributes and attributes[ "collaborators" ] is not None: # pragma no branch assert isinstance( attributes[ "collaborators" ], int ) self.__collaborators = attributes[ "collaborators" ] diff --git a/src/github/PullRequest.py b/src/github/PullRequest.py index a4608e23..b434f56c 100644 --- a/src/github/PullRequest.py +++ b/src/github/PullRequest.py @@ -290,7 +290,6 @@ class PullRequest( object ): self.__completed = True def __useAttributes( self, attributes ): - # @todo No need to check if attribute is in attributes when attribute is mandatory if "additions" in attributes and attributes[ "additions" ] is not None: # pragma no branch self.__additions = attributes[ "additions" ] if "base" in attributes and attributes[ "base" ] is not None: # pragma no branch diff --git a/src/github/PullRequestComment.py b/src/github/PullRequestComment.py index 45a016c6..54483403 100644 --- a/src/github/PullRequestComment.py +++ b/src/github/PullRequestComment.py @@ -117,7 +117,6 @@ class PullRequestComment( object ): self.__completed = True def __useAttributes( self, attributes ): - # @todo No need to check if attribute is in attributes when attribute is mandatory if "body" in attributes and attributes[ "body" ] is not None: # pragma no branch self.__body = attributes[ "body" ] if "commit_id" in attributes and attributes[ "commit_id" ] is not None: # pragma no branch diff --git a/src/github/PullRequestFile.py b/src/github/PullRequestFile.py index 82baa77c..6395c614 100644 --- a/src/github/PullRequestFile.py +++ b/src/github/PullRequestFile.py @@ -58,7 +58,6 @@ class PullRequestFile( object ): self.__status = None def __useAttributes( self, attributes ): - # @todo No need to check if attribute is in attributes when attribute is mandatory if "additions" in attributes and attributes[ "additions" ] is not None: # pragma no branch self.__additions = attributes[ "additions" ] if "blob_url" in attributes and attributes[ "blob_url" ] is not None: # pragma no branch diff --git a/src/github/Repository.py b/src/github/Repository.py index 5529d547..794e87c3 100644 --- a/src/github/Repository.py +++ b/src/github/Repository.py @@ -865,7 +865,6 @@ class Repository( object ): None ) - # @todo Remove '_identity' from the normalized json description @property def _identity( self ): return str( self.owner.login ) + "/" + str( self.name ) @@ -917,7 +916,6 @@ class Repository( object ): self.__completed = True def __useAttributes( self, attributes ): - # @todo No need to check if attribute is in attributes when attribute is mandatory if "clone_url" in attributes and attributes[ "clone_url" ] is not None: # pragma no branch assert isinstance( attributes[ "clone_url" ], ( str, unicode ) ) self.__clone_url = attributes[ "clone_url" ] diff --git a/src/github/RepositoryKey.py b/src/github/RepositoryKey.py index d6341016..b6c7c44c 100644 --- a/src/github/RepositoryKey.py +++ b/src/github/RepositoryKey.py @@ -83,7 +83,6 @@ class RepositoryKey( object ): self.__completed = True def __useAttributes( self, attributes ): - # @todo No need to check if attribute is in attributes when attribute is mandatory if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch self.__id = attributes[ "id" ] if "key" in attributes and attributes[ "key" ] is not None: # pragma no branch diff --git a/src/github/Tag.py b/src/github/Tag.py index 74fe1397..6a982bcb 100644 --- a/src/github/Tag.py +++ b/src/github/Tag.py @@ -34,7 +34,6 @@ class Tag( object ): self.__zipball_url = None def __useAttributes( self, attributes ): - # @todo No need to check if attribute is in attributes when attribute is mandatory if "commit" in attributes and attributes[ "commit" ] is not None: # pragma no branch assert isinstance( attributes[ "commit" ], dict ) self.__commit = Commit.Commit( self.__requester, attributes[ "commit" ], completion = LazyCompletion ) diff --git a/src/github/Team.py b/src/github/Team.py index 3e29dbf8..15875b91 100644 --- a/src/github/Team.py +++ b/src/github/Team.py @@ -168,7 +168,6 @@ class Team( object ): self.__completed = True def __useAttributes( self, attributes ): - # @todo No need to check if attribute is in attributes when attribute is mandatory if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch self.__id = attributes[ "id" ] if "members_count" in attributes and attributes[ "members_count" ] is not None: # pragma no branch diff --git a/src/github/UserKey.py b/src/github/UserKey.py index d7a908a4..7b8d8f96 100644 --- a/src/github/UserKey.py +++ b/src/github/UserKey.py @@ -83,7 +83,6 @@ class UserKey( object ): self.__completed = True def __useAttributes( self, attributes ): - # @todo No need to check if attribute is in attributes when attribute is mandatory if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch self.__id = attributes[ "id" ] if "key" in attributes and attributes[ "key" ] is not None: # pragma no branch