def is_docstring(physical_line, previous_logical):
 line = physical_line.lstrip()
 start = max([line.find(i) for i in START_DOCSTRING_TRIPLE])
 end = max([(line[(-4):(-1)] == i) for i in END_DOCSTRING_TRIPLE])
 if (previous_logical.startswith('def ') or previous_logical.startswith('class ')):
  if (start is 0):
   return True
  else:
   return (end and (start in ((-1), (len(line) - 4))))

def is_docstring ( physical_line , previous_logical ) : line = physical_line . lstrip ( ) start = max ( [ line . find ( i ) for i in START_DOCSTRING_TRIPLE ] ) end = max ( [ ( line [ ( - 4 ) : ( - 1 ) ] == i ) for i in END_DOCSTRING_TRIPLE ] ) if ( previous_logical . startswith ( 'def ' ) or previous_logical . startswith ( 'class ' ) ) : if ( start is 0 ) : return True else : return ( end and ( start in ( ( - 1 ) , ( len ( line ) - 4 ) ) ) )
return true if found docstring a docstring is a string literal that occurs as the first statement in a module .