import numpy as np
import matplotlib.pyplot as plt

'normal string'

x = np.linspace(0, 2*np.pi)
plt.plot(x, np.sin(x))

"""
.. image:: PLOT2RST.current_figure

Here's an image plot:
"""
# code comment
plt.figure()
plt.imshow(np.random.random(size=(20, 20)))

"""
.. image:: PLOT2RST.current_figure

# docstring comment
"""

string = """
Fake out
"""
plt.show()


import numpy as np
import matplotlib.pyplot as plt

'normal string'

x = np.linspace(0, 2*np.pi)
plt.plot(x, np.sin(x))

def dummy():
    """Dummy docstring"""
    pass

"""
.. image:: PLOT2RST.current_figure

Here's an image plot:
"""
# code comment
plt.figure()
plt.imshow(np.random.random(size=(20, 20)))

"""
.. image:: PLOT2RST.current_figure

# docstring comment
"""

string = """
Triple-quoted string which tries to break parser.
"""
plt.show()


Make plot2rst example more strict.
DOC: Make plot2rst example more strict.

  import numpy as np
  import matplotlib.pyplot as plt
  
  'normal string'
  
  x = np.linspace(0, 2*np.pi)
  plt.plot(x, np.sin(x))
+ 
+ def dummy():
+     """Dummy docstring"""
+     pass
  
  """
  .. image:: PLOT2RST.current_figure
  
  Here's an image plot:
  """
  # code comment
  plt.figure()
  plt.imshow(np.random.random(size=(20, 20)))
  
  """
  .. image:: PLOT2RST.current_figure
  
  # docstring comment
  """
  
  string = """
- Fake out
+ Triple-quoted string which tries to break parser.
  """
  plt.show()
  
  
Make plot2rst example more strict.
## Code Before:
import numpy as np
import matplotlib.pyplot as plt

'normal string'

x = np.linspace(0, 2*np.pi)
plt.plot(x, np.sin(x))

"""
.. image:: PLOT2RST.current_figure

Here's an image plot:
"""
# code comment
plt.figure()
plt.imshow(np.random.random(size=(20, 20)))

"""
.. image:: PLOT2RST.current_figure

# docstring comment
"""

string = """
Fake out
"""
plt.show()


## Instruction:
Make plot2rst example more strict.
## Code After:
import numpy as np
import matplotlib.pyplot as plt

'normal string'

x = np.linspace(0, 2*np.pi)
plt.plot(x, np.sin(x))

def dummy():
    """Dummy docstring"""
    pass

"""
.. image:: PLOT2RST.current_figure

Here's an image plot:
"""
# code comment
plt.figure()
plt.imshow(np.random.random(size=(20, 20)))

"""
.. image:: PLOT2RST.current_figure

# docstring comment
"""

string = """
Triple-quoted string which tries to break parser.
"""
plt.show()

