From 7061f25208445e6cf07067885f959af53c2ad28d Mon Sep 17 00:00:00 2001 From: transcendentsky Date: Fri, 6 Jul 2018 18:50:30 +0800 Subject: [PATCH] Changes to be committed: new file: TSP/GA.py new file: TSP/Life.py new file: TSP/tsp_ga.py new file: os_test.py modified: plt/plt_basic.py deleted: py_plt.py new file: pylintrc --- TSP/GA.py | 100 ++++++++++++++ TSP/Life.py | 34 +++++ TSP/tsp_ga.py | 189 ++++++++++++++++++++++++++ os_test.py | 4 + plt/plt_basic.py | 31 +++-- py_plt.py | 66 ---------- pylintrc | 335 +++++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 682 insertions(+), 77 deletions(-) create mode 100644 TSP/GA.py create mode 100644 TSP/Life.py create mode 100644 TSP/tsp_ga.py create mode 100644 os_test.py delete mode 100644 py_plt.py create mode 100644 pylintrc diff --git a/TSP/GA.py b/TSP/GA.py new file mode 100644 index 00000000..a7c966b1 --- /dev/null +++ b/TSP/GA.py @@ -0,0 +1,100 @@ +# -*- coding: utf-8 -*- + +"""GA.py +遗传算法类 +""" + +import random +from Life import Life + + +class GA(object): + + def __init__(self, x_rate=0.7, mutation_rate=0.005, life_count=50, gene_length=100, judge=lambda lf, av: 1, + save=lambda: 1, mk_life=lambda: None, x_func=None, m_func=None): + self.x_rate = x_rate + self.mutation_rate = mutation_rate + self.mutation_count = 0 + self.generation = 0 + self.lives = [] + self.bounds = 0.0 # 得分总数 + self.best = None + self.life_count = life_count + self.gene_length = gene_length + self.__judge = judge + self.save = save + self.mk_life = mk_life # 默认的产生生命的函数 + self.x_func = (x_func, self.__x_func)[x_func == None] # 自定义交叉函数 + self.m_func = (m_func, self.__m_func)[m_func == None] # 自定义变异函数 + + for i in range(life_count): + self.lives.append(Life(self, self.mk_life())) + + def __x_func(self, p1, p2): + # 默认交叉函数 + r = random.randint(0, self.gene_length) + gene = p1.gene[0:r] + p2.gene[r:] + return gene + + def __m_func(self, gene): + # 默认突变函数 + r = random.randint(0, self.gene_length - 1) + gene = gene[:r] + ("0", "1")[gene[r:r] == "1"] + gene[r + 1:] + return gene + + def __bear(self, p1, p2): + # 根据父母 p1, p2 生成一个后代 + r = random.random() + if r < self.x_rate: + # 交叉 + gene = self.x_func(p1, p2) + else: + gene = p1.gene + + r = random.random() + if r < self.mutation_rate: + # 突变 + gene = self.m_func(gene) + self.mutation_count += 1 + + return Life(self, gene) + + def __get_one(self): + # 根据得分情况,随机取得一个个体,机率正比于个体的score属性 + r = random.uniform(0, self.bounds) + for lf in self.lives: + r -= lf.score; + if r <= 0: + return lf + + def __new_child(self): + # 产生新的后代 + return self.__bear(self.__get_one(), self.__get_one()) + + def judge(self, f=lambda lf, av: 1): + # 根据传入的方法 f ,计算每个个体的得分 + last_avg = self.bounds / float(self.life_count) + self.bounds = 0.0 + self.best = Life(self) + self.best.set_score(-1.0) + for lf in self.lives: + lf.score = f(lf, last_avg) + if lf.score > self.best.score: + self.best = lf + self.bounds += lf.score + + def next(self, n=1): + # 演化至下n代 + while n > 0: + # self.__getBounds() + self.judge(self.__judge) + new_lives = [Life(self, self.best.gene)] + # self.bestHistory.append(self.best) + while len(new_lives) < self.life_count: + new_lives.append(self.__new_child()) + self.lives = new_lives + self.generation += 1 + # print("gen: %d, mutation: %d, best: %f" % (self.generation, self.mutationCount, self.best.score)) + self.save(self.best, self.generation) + + n -= 1 diff --git a/TSP/Life.py b/TSP/Life.py new file mode 100644 index 00000000..6c242b61 --- /dev/null +++ b/TSP/Life.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- + +"""Life.py +生命类 +""" + +import random + + +class Life(object): + + def __init__(self, env, gene=None): + self.env = env + self.score = 0 + + if gene is None: + self.__rnd_gene() + elif isinstance(gene, list): + self.gene = [] + for k in gene: + self.gene.append(k) + else: + self.gene = gene + + def __rnd_gene(self): + self.gene = "" + for i in range(self.env.gene_length): + self.gene += str(random.randint(0, 1)) + + def set_score(self, v): + self.score = v + + def add_score(self, v): + self.score += v \ No newline at end of file diff --git a/TSP/tsp_ga.py b/TSP/tsp_ga.py new file mode 100644 index 00000000..fe7009ed --- /dev/null +++ b/TSP/tsp_ga.py @@ -0,0 +1,189 @@ +# -*- coding: utf-8 -*- + +"""TSP.py + +TSP问题 +""" + +import sys +import random +import math +import time +import Tkinter +import threading + +from GA import GA + + +class MyTSP(object): + """TSP""" + + def __init__(self, root, width=800, height=600, n=32): + self.root = root + self.width = width + self.height = height + self.n = n + self.canvas = Tkinter.Canvas( + root, + width=self.width, + height=self.height, + bg="#ffffff", + xscrollincrement=1, + yscrollincrement=1 + ) + self.canvas.pack(expand=Tkinter.YES, fill=Tkinter.BOTH) + self.title("TSP") + self.__r = 5 + self.__t = None + self.__lock = threading.RLock() + self.__running = False + self.nodes = [] + self.nodes2 = [] + self.ga = None + self.order = [] + + self.__bind_events() + self.new() + + def __bind_events(self): + self.root.bind("q", self.quite) + self.root.bind("n", self.new) + self.root.bind("e", self.evolve) + self.root.bind("s", self.stop) + + def title(self, s): + self.root.title(s) + + def new(self, evt=None): + self.__lock.acquire() + self.__running = False + self.__lock.release() + + self.clear() + self.nodes = [] # 节点坐标 + self.nodes2 = [] # 节点图片对象 + for i in range(self.n): + x = random.random() * (self.width - 60) + 30 + y = random.random() * (self.height - 60) + 30 + self.nodes.append((x, y)) + node = self.canvas.create_oval( + x - self.__r, + y - self.__r, x + self.__r, y + self.__r, + fill="#ff0000", + outline="#000000", + tags="node", + ) + self.nodes2.append(node) + + self.ga = GA( + life_count=50, + mutation_rate=0.05, + judge=self.judge(), + mk_life=self.mk_life(), + x_func=self.x_func(), + m_func=self.m_func(), + save=self.save() + ) + self.order = range(self.n) + self.line(self.order) + + def distance(self, order): + """得到当前顺序下连线总长度""" + distance = 0 + for i in range(-1, self.n - 1): + i1, i2 = order[i], order[i + 1] + p1, p2 = self.nodes[i1], self.nodes[i2] + distance += math.sqrt((p1[0] - p2[0]) ** 2 + (p1[1] - p2[1]) ** 2) + + return distance + + def mk_life(self): + def f(): + lst = range(self.n) + random.shuffle(lst) + return lst + + return f + + def judge(self): + """评估函数""" + return lambda lf, av=100: 1.0 / self.distance(lf.gene) + + def x_func(self): + """交叉函数""" + + def f(lf1, lf2): + p1 = random.randint(0, self.n - 1) + p2 = random.randint(self.n - 1, self.n) + g1 = lf2.gene[p1:p2] + lf1.gene + # g2 = lf1.gene[p1:p2] + lf2.gene + g11 = [] + for i in g1: + if i not in g11: + g11.append(i) + return g11 + + return f + + def m_func(self): + """变异函数""" + + def f(gene): + p1 = random.randint(0, self.n - 2) + p2 = random.randint(self.n - 2, self.n - 1) + gene[p1], gene[p2] = gene[p2], gene[p1] + return gene + + return f + + def save(self): + def f(lf, gen): + pass + + return f + + def evolve(self, evt=None): + self.__lock.acquire() + self.__running = True + self.__lock.release() + + while self.__running: + self.ga.next() + self.line(self.ga.best.gene) + self.title("TSP - gen: %d" % self.ga.generation) + self.canvas.update() + + self.__t = None + + def line(self, order): + """将节点按 order 顺序连线""" + self.canvas.delete("line") + + def line2(i1, i2): + p1, p2 = self.nodes[i1], self.nodes[i2] + self.canvas.create_line(p1, p2, fill="#000000", tags="line") + return i2 + + reduce(line2, order, order[-1]) + + def clear(self): + for item in self.canvas.find_all(): + self.canvas.delete(item) + + def quite(self, evt): + self.__lock.acquire() + self.__running = False + self.__lock.release() + sys.exit() + + def stop(self, evt): + self.__lock.acquire() + self.__running = False + self.__lock.release() + + def mainloop(self): + self.root.mainloop() + + +if __name__ == "__main__": + MyTSP(Tkinter.Tk()).mainloop() \ No newline at end of file diff --git a/os_test.py b/os_test.py new file mode 100644 index 00000000..f464da64 --- /dev/null +++ b/os_test.py @@ -0,0 +1,4 @@ +import os + +os.mkdir('dsds/dsds') # Failed , could only make one dir +os.makedirs('sdsd/ldsd/ds') # Success, can make multi dirs \ No newline at end of file diff --git a/plt/plt_basic.py b/plt/plt_basic.py index 8fa16105..eeeaf7fc 100644 --- a/plt/plt_basic.py +++ b/plt/plt_basic.py @@ -1,4 +1,4 @@ -#coding:utf-8 +# coding:utf-8 """ def plt_bboxes(img, rclasses, rscores, rbboxes, \ @@ -42,22 +42,31 @@ def plt_r(): import matplotlib.pyplot as plt import numpy as np -def plt_tables(times, epochs, data): +def plt_tables(times, epochs, data): print("plt show") fig = plt.figure(figsize=None) def show_plot(times, epochs, data): # 折线图 Or Scatter - plt.figure(figsize=(8,5)) - plt.plot(epochs, data, marker='ro') + plt.figure(figsize=(8, 5)) + """ + args: + marker='o' ,'x', + color= + """ + + plt.plot(epochs, data[:, 0], color='red', label='0') + plt.plot(epochs, data[:, 1], color='green', marker='x', label='1') + plt.legend() # 显示图例 plt.grid(True) plt.xlabel('epochs') plt.ylabel('data') plt.title('Test') plt.show() + def show_scatter(times, epochs, data): # scatter plt.figure(figsize=(8, 5)) @@ -65,7 +74,7 @@ def show_scatter(times, epochs, data): # plt.scatter(epochs, data, 'o') # 3-dimensions # - c = np.random.randint(0,10,100) + c = np.random.randint(0, 10, 100) plt.scatter(epochs, data, c=c, marker='o') plt.colorbar() @@ -75,12 +84,13 @@ def show_scatter(times, epochs, data): plt.title('Scatter Plot') plt.show() + def show_hist(times, epochs, data): # histogram plt.figure(figsize=(8, 5)) # ValueError: `bins` must increase monotonically, when an array # plt.hist(data, epochs,label=['1st', '2nd']) - plt.hist(data, 100,label=['1st']) + plt.hist(data, 100, label=['1st']) plt.grid(True) plt.legend(loc=0) # 表示最佳位置显示图例 @@ -101,16 +111,15 @@ def others(): plt.setp(ax, xticklabels=['1st', '2nd']) 表示刻度值标签设置为'1st' 和 '2nd' ''' - - pass if __name__ == '__main__': epochs = np.array(range(100)) # epochs = np.random.rand(100) - data = np.random.rand(100) + # data = np.random.rand(100) + data = np.random.rand(200).reshape((100, 2)) - # show_plot(None, epochs, data) + show_plot(None, epochs, data) # show_scatter(None, epochs, data) - show_hist(None, epochs, data) + # show_hist(None, epochs, data) diff --git a/py_plt.py b/py_plt.py deleted file mode 100644 index 2b1dd891..00000000 --- a/py_plt.py +++ /dev/null @@ -1,66 +0,0 @@ -import matplotlib.pyplot as plt - -def plt_bboxes(img, rclasses, rscores, rbboxes, \ - nms_rclasses, nms_rscores, nms_rbboxes, \ - all_rclasses, all_rscores, all_rbboxes, \ - gbboxes, figsize=(10, 10), linewidth=1.5): - """Visualize bounding boxes. Largely inspired by SSD-MXNET! - """ - print('plt.show') - fig = plt.figure(figsize=figsize) - plt.imshow(img) - height = img.shape[0] - width = img.shape[1] - colors = dict() - - def plt_r(): - ''' - ''' - print('rclass.shape: ') - print(rclasses.shape) - print("rclass id: ") - print(rclasses[0]) - for i in range(rclasses.shape[0]): - cls_id = int(rclasses[i]) - if cls_id >= 0: - score = rscores[i] - if cls_id not in colors: - colors[cls_id] = (random.random(), random.random(), random.random()) - ymin = int(rbboxes[i, 0] * height) - xmin = int(rbboxes[i, 1] * width) - ymax = int(rbboxes[i, 2] * height) - xmax = int(rbboxes[i, 3] * width) - rect = plt.Rectangle((xmin, ymin), xmax - xmin, - ymax - ymin, fill=False, - # edgecolor=colors[cls_id], - edgecolor=(0.9, 0.9, 0.3), - linewidth=linewidth) - plt.gca().add_patch(rect) - - # class_name = str(cls_id) - # plt.gca().text(xmin, ymin - 2, - # '{:s} | {:.3f}'.format(class_name, score), - # bbox=dict(facecolor=colors[cls_id], alpha=0.5), - # fontsize=12, color='white') - - - def plt_gb(): - for i in range(len(gbboxes)): - # print(gbboxes) - xmin = gbboxes[i][0] - ymin = gbboxes[i][1] - xmax = gbboxes[i][2] - ymax = gbboxes[i][3] - rect = plt.Rectangle((xmin, ymin), xmax - xmin, - ymax - ymin, fill=False, - edgecolor=(1, 1, 1), - linewidth=linewidth) - plt.gca().add_patch(rect) - - plt_r() - # plt_nmsr() - # plt_allr() - # plt_gb() - - plt.show() - fig.savefig('test.pdf') \ No newline at end of file diff --git a/pylintrc b/pylintrc new file mode 100644 index 00000000..68fdb617 --- /dev/null +++ b/pylintrc @@ -0,0 +1,335 @@ +[MASTER] + +# Specify a configuration file. +#rcfile= + +# Python code to execute, usually for sys.path manipulation such as +# pygtk.require(). +#init-hook= + +# Profiled execution. +profile=no + +# Add files or directories to the blacklist. They should be base names, not +# paths. +ignore=CVS + +# Pickle collected data for later comparisons. +persistent=yes + +# List of plugins (as comma separated values of python modules names) to load, +# usually to register additional checkers. +load-plugins= + + +[MESSAGES CONTROL] + +# Enable the message, report, category or checker with the given id(s). You can +# either give multiple identifier separated by comma (,) or put this option +# multiple time. See also the "--disable" option for examples. +enable=indexing-exception,old-raise-syntax + +# Disable the message, report, category or checker with the given id(s). You +# can either give multiple identifiers separated by comma (,) or put this +# option multiple times (only on the command line, not in the configuration +# file where it should appear only once).You can also use "--disable=all" to +# disable everything first and then reenable specific checks. For example, if +# you want to run only the similarities checker, you can use "--disable=all +# --enable=similarities". If you want to run only the classes checker, but have +# no Warning level messages displayed, use"--disable=all --enable=classes +# --disable=W" +disable=design,similarities,no-self-use,attribute-defined-outside-init,locally-disabled,star-args,pointless-except,bad-option-value,global-statement,fixme,suppressed-message,useless-suppression,locally-enabled,no-member,no-name-in-module,import-error,unsubscriptable-object,unbalanced-tuple-unpacking,undefined-variable,not-context-manager + + +# Set the cache size for astng objects. +cache-size=500 + + +[REPORTS] + +# Set the output format. Available formats are text, parseable, colorized, msvs +# (visual studio) and html. You can also give a reporter class, eg +# mypackage.mymodule.MyReporterClass. +output-format=text + +# Put messages in a separate file for each module / package specified on the +# command line instead of printing them on stdout. Reports (if any) will be +# written in a file name "pylint_global.[txt|html]". +files-output=no + +# Tells whether to display a full report or only the messages +reports=no + +# Python expression which should return a note less than 10 (10 is the highest +# note). You have access to the variables errors warning, statement which +# respectively contain the number of errors / warnings messages and the total +# number of statements analyzed. This is used by the global evaluation report +# (RP0004). +evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) + +# Add a comment according to your evaluation note. This is used by the global +# evaluation report (RP0004). +comment=no + +# Template used to display messages. This is a python new-style format string +# used to format the message information. See doc for all details +#msg-template= + + +[TYPECHECK] + +# Tells whether missing members accessed in mixin class should be ignored. A +# mixin class is detected if its name ends with "mixin" (case insensitive). +ignore-mixin-members=yes + +# List of classes names for which member attributes should not be checked +# (useful for classes with attributes dynamically set). +ignored-classes=SQLObject + +# When zope mode is activated, add a predefined set of Zope acquired attributes +# to generated-members. +zope=no + +# List of members which are set dynamically and missed by pylint inference +# system, and so shouldn't trigger E0201 when accessed. Python regular +# expressions are accepted. +generated-members=REQUEST,acl_users,aq_parent + +# List of decorators that create context managers from functions, such as +# contextlib.contextmanager. +contextmanager-decorators=contextlib.contextmanager,contextlib2.contextmanager + + +[VARIABLES] + +# Tells whether we should check for unused import in __init__ files. +init-import=no + +# A regular expression matching the beginning of the name of dummy variables +# (i.e. not used). +dummy-variables-rgx=^\*{0,2}(_$|unused_|dummy_) + +# List of additional names supposed to be defined in builtins. Remember that +# you should avoid to define new builtins when possible. +additional-builtins= + + +[BASIC] + +# Required attributes for module, separated by a comma +required-attributes= + +# List of builtins function names that should not be used, separated by a comma +bad-functions=apply,input,reduce + + +# Disable the report(s) with the given id(s). +# All non-Google reports are disabled by default. +disable-report=R0001,R0002,R0003,R0004,R0101,R0102,R0201,R0202,R0220,R0401,R0402,R0701,R0801,R0901,R0902,R0903,R0904,R0911,R0912,R0913,R0914,R0915,R0921,R0922,R0923 + +# Regular expression which should only match correct module names +module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ + +# Regular expression which should only match correct module level names +const-rgx=^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$ + +# Regular expression which should only match correct class names +class-rgx=^_?[A-Z][a-zA-Z0-9]*$ + +# Regular expression which should only match correct function names +function-rgx=^(?:(?P_?[A-Z][a-zA-Z0-9]*)|(?P_?[a-z][a-z0-9_]*))$ + +# Regular expression which should only match correct method names +method-rgx=^(?:(?P__[a-z0-9_]+__|next)|(?P_{0,2}[A-Z][a-zA-Z0-9]*)|(?P_{0,2}[a-z][a-z0-9_]*))$ + +# Regular expression which should only match correct instance attribute names +attr-rgx=^_{0,2}[a-z][a-z0-9_]*$ + +# Regular expression which should only match correct argument names +argument-rgx=^[a-z][a-z0-9_]*$ + +# Regular expression which should only match correct variable names +variable-rgx=^[a-z][a-z0-9_]*$ + +# Regular expression which should only match correct attribute names in class +# bodies +class-attribute-rgx=^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$ + +# Regular expression which should only match correct list comprehension / +# generator expression variable names +inlinevar-rgx=^[a-z][a-z0-9_]*$ + +# Good variable names which should always be accepted, separated by a comma +good-names=main,_ + +# Bad variable names which should always be refused, separated by a comma +bad-names= + +# Regular expression which should only match function or class names that do +# not require a docstring. +no-docstring-rgx=(__.*__|main) + +# Minimum line length for functions/classes that require docstrings, shorter +# ones are exempt. +docstring-min-length=10 + + +[FORMAT] + +# Maximum number of characters on a single line. +max-line-length=80 + +# Regexp for a line that is allowed to be longer than the limit. +ignore-long-lines=(?x) + (^\s*(import|from)\s + |\$Id:\s\/\/depot\/.+#\d+\s\$ + |^[a-zA-Z_][a-zA-Z0-9_]*\s*=\s*("[^"]\S+"|'[^']\S+') + |^\s*\#\ LINT\.ThenChange + |^[^#]*\#\ type:\ [a-zA-Z_][a-zA-Z0-9_.,[\] ]*$ + |pylint + |""" + |\# + |lambda + |(https?|ftp):) + +# Allow the body of an if to be on the same line as the test if there is no +# else. +single-line-if-stmt=y + +# List of optional constructs for which whitespace checking is disabled +no-space-check= + +# Maximum number of lines in a module +max-module-lines=99999 + +# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 +# tab). +indent-string=' ' + + +[SIMILARITIES] + +# Minimum lines number of a similarity. +min-similarity-lines=4 + +# Ignore comments when computing similarities. +ignore-comments=yes + +# Ignore docstrings when computing similarities. +ignore-docstrings=yes + +# Ignore imports when computing similarities. +ignore-imports=no + + +[MISCELLANEOUS] + +# List of note tags to take in consideration, separated by a comma. +notes= + + +[IMPORTS] + +# Deprecated modules which should not be used, separated by a comma +deprecated-modules=regsub,TERMIOS,Bastion,rexec,sets + +# Create a graph of every (i.e. internal and external) dependencies in the +# given file (report RP0402 must not be disabled) +import-graph= + +# Create a graph of external dependencies in the given file (report RP0402 must +# not be disabled) +ext-import-graph= + +# Create a graph of internal dependencies in the given file (report RP0402 must +# not be disabled) +int-import-graph= + + +[CLASSES] + +# List of interface methods to ignore, separated by a comma. This is used for +# instance to not check methods defines in Zope's Interface base class. +ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by + +# List of method names used to declare (i.e. assign) instance attributes. +defining-attr-methods=__init__,__new__,setUp + +# List of valid names for the first argument in a class method. +valid-classmethod-first-arg=cls,class_ + +# List of valid names for the first argument in a metaclass class method. +valid-metaclass-classmethod-first-arg=mcs + + +[DESIGN] + +# Maximum number of arguments for function / method +max-args=5 + +# Argument names that match this expression will be ignored. Default to name +# with leading underscore +ignored-argument-names=_.* + +# Maximum number of locals for function / method body +max-locals=15 + +# Maximum number of return / yield for function / method body +max-returns=6 + +# Maximum number of branch for function / method body +max-branches=12 + +# Maximum number of statements in function / method body +max-statements=50 + +# Maximum number of parents for a class (see R0901). +max-parents=7 + +# Maximum number of attributes for a class (see R0902). +max-attributes=7 + +# Minimum number of public methods for a class (see R0903). +min-public-methods=2 + +# Maximum number of public methods for a class (see R0904). +max-public-methods=20 + + +[EXCEPTIONS] + +# Exceptions that will emit a warning when being caught. Defaults to +# "Exception" +overgeneral-exceptions=Exception,StandardError,BaseException + + +[AST] + +# Maximum line length for lambdas +short-func-length=1 + +# List of module members that should be marked as deprecated. +# All of the string functions are listed in 4.1.4 Deprecated string functions +# in the Python 2.4 docs. +deprecated-members=string.atof,string.atoi,string.atol,string.capitalize,string.expandtabs,string.find,string.rfind,string.index,string.rindex,string.count,string.lower,string.split,string.rsplit,string.splitfields,string.join,string.joinfields,string.lstrip,string.rstrip,string.strip,string.swapcase,string.translate,string.upper,string.ljust,string.rjust,string.center,string.zfill,string.replace,sys.exitfunc + + +[DOCSTRING] + +# List of exceptions that do not need to be mentioned in the Raises section of +# a docstring. +ignore-exceptions=AssertionError,NotImplementedError,StopIteration,TypeError + + + +[TOKENS] + +# Number of spaces of indent required when the last token on the preceding line +# is an open (, [, or {. +indent-after-paren=4 + + +[GOOGLE LINES] + +# Regexp for a proper copyright notice. +copyright=Copyright \d{4} The TensorFlow Authors\. +All [Rr]ights [Rr]eserved\.