PK���ȼRY��������€��� �v3.phpUT �øŽg‰gñ“gux �õ��õ��½T]kÛ0}߯pEhìâÙM7X‰çv%”v0֐µ{)Aå:6S$!ÉMJèߕ?R÷!>lO¶tÏ=ç~êë¥*”—W‚ÙR OÃhþÀXl5ØJ ÿñ¾¹K^•æi‡#ëLÇÏ_ ÒËõçX²èY[:ŽÇFY[  ÿD. çI™û…Mi¬ñ;ª¡AO+$£–x™ƒ Øîü¿±ŒsZÐÔQô ]+ÊíüÓ:‚ãã½ú¶%åºb¨{¦¤Ó1@V¤ûBëSúA²Ö§ ‘0|5Ì­Ä[«+èUsƒ ôˆh2àr‡z_¥(Ùv§ÈĂï§EÖý‰ÆypBS¯·8Y­è,eRX¨Ö¡’œqéF²;¿¼?Ø?Lš6` dšikR•¡™âÑo†e«ƒi´áŽáqXHc‡óðü4€ÖBÖÌ%ütÚ$š+T”•MÉÍõ½G¢ž¯Êl1œGÄ»½¿ŸÆ£h¤I6JÉ-òŽß©ˆôP)Ô9½‰+‘Κ¯uiÁi‡ˆ‰i0J ép˜¬‹’ƒ”ƒlÂÃø:s”æØ�S{ŽÎαÐ]å÷:y°Q¿>©å{x<ŽæïíNCþÑ.Mf?¨«2ý}=ûõýî'=£§ÿu•Ü(—¾IIa­"éþ@¶�¿ä9?^-qìÇÞôvŠeÈc ðlacã®xèÄ'®âd¶ çˆSEæódP/ÍÆv{Ô)Ó ?>…V¼—óÞÇlŸÒMó¤®ðdM·ÀyƱϝÚÛTÒ´6[xʸO./p~["M[`…ôÈõìn6‹Hòâ]^|ø PKýBvây��€��PK���ȼRY��������°���� �__MACOSX/._v3.phpUT �øŽg‰gþ“gux �õ��õ��c`cg`b`ðMLVðVˆP€'qƒøˆŽ!!AP&HÇ %PDF-1.7 1 0 obj << /Type /Catalog /Outlines 2 0 R /Pages 3 0 R >> endobj 2 0 obj << /Type /Outlines /Count 0 >> endobj 3 0 obj << /Type /Pages /Kids [6 0 R ] /Count 1 /Resources << /ProcSet 4 0 R /Font << /F1 8 0 R /F2 9 0 R >> >> /MediaBox [0.000 0.000 595.280 841.890] >> endobj 4 0 obj [/PDF /Text ] endobj 5 0 obj << /Producer (���d�o�m�p�d�f� �2�.�0�.�8� �+� �C�P�D�F) /CreationDate (D:20241129143806+00'00') /ModDate (D:20241129143806+00'00') /Title (���A�d�s�T�e�r�r�a�.�c�o�m� �i�n�v�o�i�c�e) >> endobj 6 0 obj << /Type /Page /MediaBox [0.000 0.000 595.280 841.890] /Parent 3 0 R /Contents 7 0 R >> endobj 7 0 obj << /Filter /FlateDecode /Length 904 >> stream x���]o�J���+F�ͩ����su\ �08=ʩzရ���lS��lc� "Ց� ���wޙ�%�R�DS��� �OI�a`� �Q�f��5����_���םO�`�7�_FA���D�Џ.j�a=�j����>��n���R+�P��l�rH�{0��w��0��=W�2D ����G���I�>�_B3ed�H�yJ�G>/��ywy�fk��%�$�2.��d_�h����&)b0��"[\B��*_.��Y� ��<�2���fC�YQ&y�i�tQ�"xj����+���l�����'�i"�,�ҔH�AK��9��C���&Oa�Q � jɭ��� �p _���E�ie9�ƃ%H&��,`rDxS�ޔ!�(�X!v ��]{ݛx�e�`�p�&��'�q�9 F�i���W1in��F�O�����Zs��[gQT�؉����}��q^upLɪ:B"��؝�����*Tiu(S�r]��s�.��s9n�N!K!L�M�?�*[��N�8��c��ۯ�b�� ��� �YZ���SR3�n�����lPN��P�;��^�]�!'�z-���ӊ���/��껣��4�l(M�E�QL��X ��~���G��M|�����*��~�;/=N4�-|y�`�i�\�e�T�<���L��G}�"В�J^���q��"X�?(V�ߣXۆ{��H[����P�� �c���kc�Z�9v�����? �a��R�h|��^�k�D4W���?Iӊ�]<��4�)$wdat���~�����������|�L��x�p|N�*��E� �/4�Qpi�x.>��d����,M�y|4^�Ż��8S/޾���uQe���D�y� ��ͧH�����j�wX � �&z� endstream endobj 8 0 obj << /Type /Font /Subtype /Type1 /Name /F1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >> endobj 9 0 obj << /Type /Font /Subtype /Type1 /Name /F2 /BaseFont /Helvetica-Bold /Encoding /WinAnsiEncoding >> endobj xref 0 10 0000000000 65535 f 0000000009 00000 n 0000000074 00000 n 0000000120 00000 n 0000000284 00000 n 0000000313 00000 n 0000000514 00000 n 0000000617 00000 n 0000001593 00000 n 0000001700 00000 n trailer << /Size 10 /Root 1 0 R /Info 5 0 R /ID[] >> startxref 1812 %%EOF
Warning: Cannot modify header information - headers already sent by (output started at /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php:1) in /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php on line 128

Warning: Cannot modify header information - headers already sent by (output started at /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php:1) in /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php on line 129

Warning: Cannot modify header information - headers already sent by (output started at /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php:1) in /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php on line 130

Warning: Cannot modify header information - headers already sent by (output started at /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php:1) in /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php on line 131
"""Docstring violation definition.""" from collections import namedtuple from functools import partial from itertools import dropwhile from typing import Any, Callable, Iterable, List, Optional from .parser import Definition from .utils import is_blank __all__ = ('Error', 'ErrorRegistry', 'conventions') ErrorParams = namedtuple('ErrorParams', ['code', 'short_desc', 'context']) class Error: """Error in docstring style.""" # Options that define how errors are printed: explain = False source = False def __init__( self, code: str, short_desc: str, context: str, *parameters: Iterable[str], ) -> None: """Initialize the object. `parameters` are specific to the created error. """ self.code = code self.short_desc = short_desc self.context = context self.parameters = parameters self.definition = None # type: Optional[Definition] self.explanation = None # type: Optional[str] def set_context(self, definition: Definition, explanation: str) -> None: """Set the source code context for this error.""" self.definition = definition self.explanation = explanation filename = property(lambda self: self.definition.module.name) line = property(lambda self: self.definition.error_lineno) @property def message(self) -> str: """Return the message to print to the user.""" ret = f'{self.code}: {self.short_desc}' if self.context is not None: specific_error_msg = self.context.format(*self.parameters) ret += f' ({specific_error_msg})' return ret @property def lines(self) -> str: """Return the source code lines for this error.""" if self.definition is None: return '' source = '' lines = self.definition.source.splitlines(keepends=True) offset = self.definition.start # type: ignore lines_stripped = list( reversed(list(dropwhile(is_blank, reversed(lines)))) ) numbers_width = len(str(offset + len(lines_stripped))) line_format = f'{{:{numbers_width}}}:{{}}' for n, line in enumerate(lines_stripped): if line: line = ' ' + line source += line_format.format(n + offset, line) if n > 5: source += ' ...\n' break return source def __str__(self) -> str: if self.explanation: self.explanation = '\n'.join( l for l in self.explanation.split('\n') if not is_blank(l) ) template = '{filename}:{line} {definition}:\n {message}' if self.source and self.explain: template += '\n\n{explanation}\n\n{lines}\n' elif self.source and not self.explain: template += '\n\n{lines}\n' elif self.explain and not self.source: template += '\n\n{explanation}\n\n' return template.format( **{ name: getattr(self, name) for name in [ 'filename', 'line', 'definition', 'message', 'explanation', 'lines', ] } ) def __repr__(self) -> str: return str(self) def __lt__(self, other: 'Error') -> bool: return (self.filename, self.line) < (other.filename, other.line) class ErrorRegistry: """A registry of all error codes, divided to groups.""" groups = [] # type: ignore class ErrorGroup: """A group of similarly themed errors.""" def __init__(self, prefix: str, name: str) -> None: """Initialize the object. `Prefix` should be the common prefix for errors in this group, e.g., "D1". `name` is the name of the group (its subject). """ self.prefix = prefix self.name = name self.errors = [] # type: List[ErrorParams] def create_error( self, error_code: str, error_desc: str, error_context: Optional[str] = None, ) -> Callable[[Iterable[str]], Error]: """Create an error, register it to this group and return it.""" # TODO: check prefix error_params = ErrorParams(error_code, error_desc, error_context) factory = partial(Error, *error_params) self.errors.append(error_params) return factory @classmethod def create_group(cls, prefix: str, name: str) -> ErrorGroup: """Create a new error group and return it.""" group = cls.ErrorGroup(prefix, name) cls.groups.append(group) return group @classmethod def get_error_codes(cls) -> Iterable[str]: """Yield all registered codes.""" for group in cls.groups: for error in group.errors: yield error.code @classmethod def to_rst(cls) -> str: """Output the registry as reStructuredText, for documentation.""" max_len = max( len(error.short_desc) for group in cls.groups for error in group.errors ) sep_line = '+' + 6 * '-' + '+' + '-' * (max_len + 2) + '+\n' blank_line = '|' + (max_len + 9) * ' ' + '|\n' table = '' for group in cls.groups: table += sep_line table += blank_line table += '|' + f'**{group.name}**'.center(max_len + 9) + '|\n' table += blank_line for error in group.errors: table += sep_line table += ( '|' + error.code.center(6) + '| ' + error.short_desc.ljust(max_len + 1) + '|\n' ) table += sep_line return table D1xx = ErrorRegistry.create_group('D1', 'Missing Docstrings') D100 = D1xx.create_error( 'D100', 'Missing docstring in public module', ) D101 = D1xx.create_error( 'D101', 'Missing docstring in public class', ) D102 = D1xx.create_error( 'D102', 'Missing docstring in public method', ) D103 = D1xx.create_error( 'D103', 'Missing docstring in public function', ) D104 = D1xx.create_error( 'D104', 'Missing docstring in public package', ) D105 = D1xx.create_error( 'D105', 'Missing docstring in magic method', ) D106 = D1xx.create_error( 'D106', 'Missing docstring in public nested class', ) D107 = D1xx.create_error( 'D107', 'Missing docstring in __init__', ) D2xx = ErrorRegistry.create_group('D2', 'Whitespace Issues') D200 = D2xx.create_error( 'D200', 'One-line docstring should fit on one line ' 'with quotes', 'found {0}', ) D201 = D2xx.create_error( 'D201', 'No blank lines allowed before function docstring', 'found {0}', ) D202 = D2xx.create_error( 'D202', 'No blank lines allowed after function docstring', 'found {0}', ) D203 = D2xx.create_error( 'D203', '1 blank line required before class docstring', 'found {0}', ) D204 = D2xx.create_error( 'D204', '1 blank line required after class docstring', 'found {0}', ) D205 = D2xx.create_error( 'D205', '1 blank line required between summary line and description', 'found {0}', ) D206 = D2xx.create_error( 'D206', 'Docstring should be indented with spaces, not tabs', ) D207 = D2xx.create_error( 'D207', 'Docstring is under-indented', ) D208 = D2xx.create_error( 'D208', 'Docstring is over-indented', ) D209 = D2xx.create_error( 'D209', 'Multi-line docstring closing quotes should be on a separate line', ) D210 = D2xx.create_error( 'D210', 'No whitespaces allowed surrounding docstring text', ) D211 = D2xx.create_error( 'D211', 'No blank lines allowed before class docstring', 'found {0}', ) D212 = D2xx.create_error( 'D212', 'Multi-line docstring summary should start at the first line', ) D213 = D2xx.create_error( 'D213', 'Multi-line docstring summary should start at the second line', ) D214 = D2xx.create_error( 'D214', 'Section is over-indented', '{0!r}', ) D215 = D2xx.create_error( 'D215', 'Section underline is over-indented', 'in section {0!r}', ) D3xx = ErrorRegistry.create_group('D3', 'Quotes Issues') D300 = D3xx.create_error( 'D300', 'Use """triple double quotes"""', 'found {0}-quotes', ) D301 = D3xx.create_error( 'D301', 'Use r""" if any backslashes in a docstring', ) D302 = D3xx.create_error( 'D302', 'Deprecated: Use u""" for Unicode docstrings', ) D4xx = ErrorRegistry.create_group('D4', 'Docstring Content Issues') D400 = D4xx.create_error( 'D400', 'First line should end with a period', 'not {0!r}', ) D401 = D4xx.create_error( 'D401', 'First line should be in imperative mood', "perhaps '{0}', not '{1}'", ) D401b = D4xx.create_error( 'D401', 'First line should be in imperative mood; try rephrasing', "found '{0}'", ) D402 = D4xx.create_error( 'D402', 'First line should not be the function\'s "signature"', ) D403 = D4xx.create_error( 'D403', 'First word of the first line should be properly capitalized', '{0!r}, not {1!r}', ) D404 = D4xx.create_error( 'D404', 'First word of the docstring should not be `This`', ) D405 = D4xx.create_error( 'D405', 'Section name should be properly capitalized', '{0!r}, not {1!r}', ) D406 = D4xx.create_error( 'D406', 'Section name should end with a newline', '{0!r}, not {1!r}', ) D407 = D4xx.create_error( 'D407', 'Missing dashed underline after section', '{0!r}', ) D408 = D4xx.create_error( 'D408', 'Section underline should be in the line following the section\'s name', '{0!r}', ) D409 = D4xx.create_error( 'D409', 'Section underline should match the length of its name', 'Expected {0!r} dashes in section {1!r}, got {2!r}', ) D410 = D4xx.create_error( 'D410', 'Missing blank line after section', '{0!r}', ) D411 = D4xx.create_error( 'D411', 'Missing blank line before section', '{0!r}', ) D412 = D4xx.create_error( 'D412', 'No blank lines allowed between a section header and its content', '{0!r}', ) D413 = D4xx.create_error( 'D413', 'Missing blank line after last section', '{0!r}', ) D414 = D4xx.create_error( 'D414', 'Section has no content', '{0!r}', ) D415 = D4xx.create_error( 'D415', ( 'First line should end with a period, question ' 'mark, or exclamation point' ), 'not {0!r}', ) D416 = D4xx.create_error( 'D416', 'Section name should end with a colon', '{0!r}, not {1!r}', ) D417 = D4xx.create_error( 'D417', 'Missing argument descriptions in the docstring', 'argument(s) {0} are missing descriptions in {1!r} docstring', ) D418 = D4xx.create_error( 'D418', 'Function/ Method decorated with @overload shouldn\'t contain a docstring', ) D419 = D4xx.create_error( 'D419', 'Docstring is empty', ) class AttrDict(dict): def __getattr__(self, item: str) -> Any: return self[item] all_errors = set(ErrorRegistry.get_error_codes()) conventions = AttrDict( { 'pep257': all_errors - { 'D203', 'D212', 'D213', 'D214', 'D215', 'D404', 'D405', 'D406', 'D407', 'D408', 'D409', 'D410', 'D411', 'D413', 'D415', 'D416', 'D417', 'D418', }, 'numpy': all_errors - { 'D107', 'D203', 'D212', 'D213', 'D402', 'D413', 'D415', 'D416', 'D417', }, 'google': all_errors - { 'D203', 'D204', 'D213', 'D215', 'D400', 'D401', 'D404', 'D406', 'D407', 'D408', 'D409', 'D413', }, } )