@classmethod
  def _guess_package(self, path):
    supported_prefixes = ('com', 'org', 'net',)
    package = ''
    slash = path.rfind(os.path.sep)
    prefix_with_slash = max(path.rfind(os.path.join('', prefix, ''))
                            for prefix in supported_prefixes)
    if prefix_with_slash < 0:
      package = path[:slash]
    elif prefix_with_slash >= 0:
      package = path[prefix_with_slash:slash]
    package = package.replace(os.path.sep, ' ')
    package = package.strip().replace(' ', '.')
    return package
Write some data to the serial device.
dataset/ETHPy150Open pantsbuild/pants/src/python/pants/backend/codegen/tasks/jaxb_gen.py/JaxbGen._guess_package--crossover with--dataset/ETHPy150Open nlloyd/SubliminalCollaborator/libs/twisted/internet/_posixserialport.py/SerialPort.writeSomeData