def filter_releases(package, settings, releases):
 platform_selectors = [((sublime.platform() + '-') + sublime.arch()), sublime.platform(), '*']
 install_prereleases = settings.get('install_prereleases')
 allow_prereleases = (install_prereleases is True)
 if ((not allow_prereleases) and isinstance(install_prereleases, list) and (package in install_prereleases)):
  allow_prereleases = True
 if (not allow_prereleases):
  releases = version_exclude_prerelease(releases)
 output = []
 for release in releases:
  platforms = release.get('platforms', '*')
  if (not isinstance(platforms, list)):
   platforms = [platforms]
  matched = False
  for selector in platform_selectors:
   if (selector in platforms):
    matched = True
    break
  if (not matched):
   continue
  if (not is_compatible_version(release.get('sublime_text', '*'))):
   continue
  output.append(release)
 return output

def filter_releases ( package , settings , releases ) : platform_selectors = [ ( ( sublime . platform ( ) + '-' ) + sublime . arch ( ) ) , sublime . platform ( ) , '*' ] install_prereleases = settings . get ( 'install_prereleases' ) allow_prereleases = ( install_prereleases is True ) if ( ( not allow_prereleases ) and isinstance ( install_prereleases , list ) and ( package in install_prereleases ) ) : allow_prereleases = True if ( not allow_prereleases ) : releases = version_exclude_prerelease ( releases ) output = [ ] for release in releases : platforms = release . get ( 'platforms' , '*' ) if ( not isinstance ( platforms , list ) ) : platforms = [ platforms ] matched = False for selector in platform_selectors : if ( selector in platforms ) : matched = True break if ( not matched ) : continue if ( not is_compatible_version ( release . get ( 'sublime_text' , '*' ) ) ) : continue output . append ( release ) return output
returns all releases in the list of releases that are compatible with the current platform and version of sublime text .