code: def _maybe_get_plugin_name(cls, classpath_element):
      
      def process_info_file(cp_elem, info_file):
        plugin_info = ElementTree.parse(info_file).getroot()
        if plugin_info.tag != 'plugin':
          raise TaskError('File {} in {} is not a valid scalac plugin descriptor'.format(
              _SCALAC_PLUGIN_INFO_FILE, cp_elem))
        return plugin_info.find('name').text
  
      if os.path.isdir(classpath_element):
        try:
          with open(os.path.join(classpath_element, _SCALAC_PLUGIN_INFO_FILE), 'r') as plugin_info_file:
            return process_info_file(classpath_element, plugin_info_file)
        except IOError as e:
          if e.errno != errno.ENOENT:
            raise
      else:
        with open_zip(classpath_element, 'r') as jarfile:
          try:
            with closing(jarfile.open(_SCALAC_PLUGIN_INFO_FILE, 'r')) as plugin_info_file:
              return process_info_file(classpath_element, plugin_info_file)
          except KeyError:
            pass
      return None
docs: If classpath_element is a scalac plugin, returns its name.
  
      Returns None otherwise.