Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 776d3db

Browse files
committed
PEP8 : re-order imports + whitespace
1 parent 4c05e20 commit 776d3db

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

lib/matplotlib/finance.py

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,7 @@
1515
import contextlib
1616
import os
1717
import warnings
18-
19-
if six.PY3:
20-
from urllib.request import urlopen
21-
else:
22-
from urllib2 import urlopen
23-
24-
if six.PY3:
25-
import hashlib
26-
md5 = lambda x: hashlib.md5(x.encode())
27-
else:
28-
from hashlib import md5
18+
from six.moves.urllib.request import urlopen
2919

3020
import datetime
3121

@@ -41,6 +31,14 @@
4131
from matplotlib.transforms import Affine2D
4232

4333

34+
if six.PY3:
35+
import hashlib
36+
37+
def md5(x):
38+
return hashlib.md5(x.encode())
39+
else:
40+
from hashlib import md5
41+
4442
cachedir = get_cachedir()
4543
# cachedir will be None if there is no writable directory.
4644
if cachedir is not None:
@@ -802,10 +800,10 @@ def _candlestick(ax, quotes, width=0.2, colorup='k', colordown='r',
802800

803801
rect = Rectangle(
804802
xy=(t - OFFSET, lower),
805-
width = width,
806-
height = height,
807-
facecolor = color,
808-
edgecolor = color,
803+
width=width,
804+
height=height,
805+
facecolor=color,
806+
edgecolor=color,
809807
)
810808
rect.set_alpha(alpha)
811809

@@ -1075,7 +1073,7 @@ def candlestick2_ohlc(ax, opens, highs, lows, closes, width=4,
10751073
rangeCollection = LineCollection(rangeSegments,
10761074
colors=((0, 0, 0, 1), ),
10771075
linewidths=lw,
1078-
antialiaseds = useAA,
1076+
antialiaseds=useAA,
10791077
)
10801078

10811079
barCollection = PolyCollection(barVerts,

0 commit comments

Comments
 (0)