parameters: (search_dirs)
return_statement: return extensions
docstring: collect prebuilt python extensions
docstring_summary: collect prebuilt python extensions
docstring_tokens: collect prebuilt python extensions
function: def find_prebuilt_extensions(search_dirs):
      """collect prebuilt python extensions"""
      extensions = []
      ext_pattern = ''
      if sys.platform == 'linux':
          ext_pattern = '**/*.so'
      elif sys.platform == 'win32':
          ext_pattern = '**/*.pyd'
      elif sys.platform == 'darwin':
          ext_pattern = '**/*.so'
      for base_dir in search_dirs:
          for path in Path(base_dir).glob(ext_pattern):
              if path.match('openvino/libs/*'):
                  continue
              relpath = path.relative_to(base_dir)
              if relpath.parent != '.':
                  package_names = str(relpath.parent).split(os.path.sep)
              else:
                  package_names = []
              package_names.append(path.name.split('.', 1)[0])
              name = '.'.join(package_names)
              extensions.append(PrebuiltExtension(name, sources=[str(path)]))
      if not extensions:
          extensions.append(PrebuiltExtension('openvino', sources=[str('setup.py')]))
      return extensions
function_tokens: def find_prebuilt_extensions ( search_dirs ) : extensions = [ ] ext_pattern = '' if sys . platform == 'linux' : ext_pattern = '**/*.so' elif sys . platform == 'win32' : ext_pattern = '**/*.pyd' elif sys . platform == 'darwin' : ext_pattern = '**/*.so' for base_dir in search_dirs : for path in Path ( base_dir ) . glob ( ext_pattern ) : if path . match ( 'openvino/libs/*' ) : continue relpath = path . relative_to ( base_dir ) if relpath . parent != '.' : package_names = str ( relpath . parent ) . split ( os . path . sep ) else : package_names = [ ] package_names . append ( path . name . split ( '.' , 1 ) [ 0 ] ) name = '.' . join ( package_names ) extensions . append ( PrebuiltExtension ( name , sources = [ str ( path ) ] ) ) if not extensions : extensions . append ( PrebuiltExtension ( 'openvino' , sources = [ str ( 'setup.py' ) ] ) ) return extensions