def discover_extensions(version, only_contrib=False):
 if (not isinstance(version, api_versions.APIVersion)):
  version = api_versions.get_api_version(version)
 if only_contrib:
  chain = _discover_via_contrib_path(version)
 else:
  chain = itertools.chain(_discover_via_python_path(), _discover_via_contrib_path(version), _discover_via_entry_points())
 return [ext.Extension(name, module) for (name, module) in chain]

def discover_extensions ( version , only_contrib = False ) : if ( not isinstance ( version , api_versions . APIVersion ) ) : version = api_versions . get_api_version ( version ) if only_contrib : chain = _discover_via_contrib_path ( version ) else : chain = itertools . chain ( _discover_via_python_path ( ) , _discover_via_contrib_path ( version ) , _discover_via_entry_points ( ) ) return [ ext . Extension ( name , module ) for ( name , module ) in chain ]
returns the list of extensions .