Python __future__.generators() Examples
The following are 11
code examples of __future__.generators().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
__future__
, or try the search function
.
Example #1
Source File: fix_remove_old__future__imports.py From misp42splunk with GNU Lesser General Public License v3.0 | 5 votes |
def transform(self, node, results): remove_future_import(u"with_statement", node) remove_future_import(u"nested_scopes", node) remove_future_import(u"generators", node)
Example #2
Source File: fix_remove_old__future__imports.py From misp42splunk with GNU Lesser General Public License v3.0 | 5 votes |
def transform(self, node, results): remove_future_import(u"with_statement", node) remove_future_import(u"nested_scopes", node) remove_future_import(u"generators", node)
Example #3
Source File: factory.py From python-design-patterns with MIT License | 5 votes |
def generate_children(count, parent, life_min, life_max): """We are using a generator to randomly seed a sequence of specifications for the factory. While this is not strictly part of the Factory Pattern, it can be useful for testing the factory or for generating objects based on some pre-defined algorithm. It is perfectly acceptable to implement factories without generators (depends on your specific use-case).""" types = parent.__subclasses__() for i in range(count): yield { "class_name": random.choice(types).__name__, "lifespan": random.randint(life_min, life_max) }
Example #4
Source File: fix_remove_old__future__imports.py From deepWordBug with Apache License 2.0 | 5 votes |
def transform(self, node, results): remove_future_import(u"with_statement", node) remove_future_import(u"nested_scopes", node) remove_future_import(u"generators", node)
Example #5
Source File: fix_remove_old__future__imports.py From kgsgo-dataset-preprocessor with Mozilla Public License 2.0 | 5 votes |
def transform(self, node, results): remove_future_import(u"with_statement", node) remove_future_import(u"nested_scopes", node) remove_future_import(u"generators", node)
Example #6
Source File: fix_remove_old__future__imports.py From telegram-robot-rss with Mozilla Public License 2.0 | 5 votes |
def transform(self, node, results): remove_future_import(u"with_statement", node) remove_future_import(u"nested_scopes", node) remove_future_import(u"generators", node)
Example #7
Source File: fix_remove_old__future__imports.py From blackmamba with MIT License | 5 votes |
def transform(self, node, results): remove_future_import(u"with_statement", node) remove_future_import(u"nested_scopes", node) remove_future_import(u"generators", node)
Example #8
Source File: fix_remove_old__future__imports.py From gimp-plugin-export-layers with GNU General Public License v3.0 | 5 votes |
def transform(self, node, results): remove_future_import(u"with_statement", node) remove_future_import(u"nested_scopes", node) remove_future_import(u"generators", node)
Example #9
Source File: fix_remove_old__future__imports.py From arissploit with GNU General Public License v3.0 | 5 votes |
def transform(self, node, results): remove_future_import(u"with_statement", node) remove_future_import(u"nested_scopes", node) remove_future_import(u"generators", node)
Example #10
Source File: fix_remove_old__future__imports.py From Tautulli with GNU General Public License v3.0 | 5 votes |
def transform(self, node, results): remove_future_import(u"with_statement", node) remove_future_import(u"nested_scopes", node) remove_future_import(u"generators", node)
Example #11
Source File: fix_remove_old__future__imports.py From V1EngineeringInc-Docs with Creative Commons Attribution Share Alike 4.0 International | 5 votes |
def transform(self, node, results): remove_future_import(u"with_statement", node) remove_future_import(u"nested_scopes", node) remove_future_import(u"generators", node)