<s> from github2 . core import ( BaseData , GithubCommand , Attribute , DateAttribute , <EOL> requires_auth ) <EOL> from github2 . repositories import Repository <EOL> from github2 . teams import Team <EOL> from github2 . users import User <EOL> class Organization ( BaseData ) : <EOL> """<STR_LIT>""" <EOL> id = Attribute ( "<STR_LIT>" ) <EOL> name = Attribute ( "<STR_LIT>" ) <EOL> blog = Attribute ( "<STR_LIT>" ) <EOL> location = Attribute ( "<STR_LIT>" ) <EOL> gravatar_id = Attribute ( "<STR_LIT>" ) <EOL> login = Attribute ( "<STR_LIT>" ) <EOL> email = Attribute ( "<STR_LIT>" ) <EOL> company = Attribute ( "<STR_LIT>" ) <EOL> created_at = DateAttribute ( "<STR_LIT>" , <EOL> format = "<STR_LIT>" ) <EOL> following_count = Attribute ( "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> followers_count = Attribute ( "<STR_LIT>" ) <EOL> public_gist_count = Attribute ( "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> public_repo_count = Attribute ( "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> permission = Attribute ( "<STR_LIT>" ) <EOL> plan = Attribute ( "<STR_LIT>" ) <EOL> def is_authenticated ( self ) : <EOL> return self . plan is not None <EOL> def __repr__ ( self ) : <EOL> return "<STR_LIT>" % self . login <EOL> class Organizations ( GithubCommand ) : <EOL> """<STR_LIT>""" <EOL> domain = "<STR_LIT>" <EOL> def show ( self , organization ) : <EOL> """<STR_LIT>""" <EOL> return self . get_value ( organization , filter = "<STR_LIT>" , <EOL> datatype = Organization ) <EOL> def list ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . get_values ( '<STR_LIT>' , filter = "<STR_LIT>" , <EOL> datatype = Organization ) <EOL> def repositories ( self , organization = '<STR_LIT>' ) : <EOL> """<STR_LIT>""" <EOL> return self . get_values ( organization , '<STR_LIT>' , <EOL> filter = "<STR_LIT>" , datatype = Repository ) <EOL> def public_repositories ( self , organization ) : <EOL> """<STR_LIT>""" <EOL> return self . get_values ( organization , '<STR_LIT>' , <EOL> filter = "<STR_LIT>" , datatype = Repository ) <EOL> def public_members ( self , organization ) : <EOL> """<STR_LIT>""" <EOL> return self . get_values ( organization , '<STR_LIT>' , filter = "<STR_LIT>" , <EOL> datatype = User ) <EOL> def teams ( self , organization ) : <EOL> """<STR_LIT>""" <EOL> return self . get_values ( organization , '<STR_LIT>' , filter = "<STR_LIT>" , <EOL> datatype = Team ) <EOL> @ requires_auth <EOL> def add_team ( self , organization , name , permission = '<STR_LIT>' , projects = None ) : <EOL> """<STR_LIT>""" <EOL> team_data = { '<STR_LIT>' : name , '<STR_LIT>' : permission } <EOL> if projects : <EOL> team_data [ '<STR_LIT>' ] = projects <EOL> return self . get_value ( organization , '<STR_LIT>' , post_data = team_data , <EOL> method = '<STR_LIT:POST>' , filter = '<STR_LIT>' , datatype = Team ) </s>
