345
346
347def main(_argv):
348 """349 Main: Handling command line parameters.
350 """
351 logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO)
329 return keyword.upper() + 'opt'
330
331 def print_grammar(self):
332 """333 Print grammar of object.
334 """
335 logging.info("*** Grammar ***")
302 return True # reduce
303
304 def match(self, input):
305 """306 Searches for rules that match given input tokens.
307 """
308 tokens = input.split()
210 return sequences
211
212 def flatten_rules(self, max_sequences):
213 """214 Tokens of rules are replaced recursively.
215 """
216 for rulename, sequences in list(self.rules.items()):
193
194 @staticmethod
195 def __sort_attachments(sequences):
196 """197 Move all [[xxx]] to the end.
198 """
199 for i, sequence in enumerate(sequences):
If a docstring fits in a single line (72 characters according to PEP8), it is recommended to have the quotes on the same line.
def foo():
"""
Runs bar and returns baz.
"""
baz = bar()
return baz
def foo():
"""Runs bar and returns baz."""
baz = bar()
return baz