input: Write a function to parse the given URL and return the protocol, domain name, and path using Python. If the URL is empty, return an empty dictionary.
  assert parse_url('https://www.example.com/path/to/file') == {'protocol': 'https', 'domain_name': 'www.example.com', 'path': '/path/to/file'}
  assert parse_url('http://www.google.com') == {'protocol': 'http', 'domain_name': 'www.google.com', 'path': ''}
  assert parse_url('') == {}
  assert parse_url('ftp://user:pass@ftp.example.com/') == {'protocol': 'ftp', 'domain_name': 'user:pass@ftp.example.com', 'path': '/'}
output: def parse_url(url):
      if not url:
          return {}
      protocol_end = url.find('://')
      if protocol_end == -1:
          return {}
      protocol = url[:protocol_end]
      remaining_url = url[protocol_end + 3:]
      domain_end = remaining_url.find('/')
      if domain_end == -1:
          domain_name = remaining_url
          path = ''
      else:
          domain_name = remaining_url[:domain_end]
          path = remaining_url[domain_end:]
      return {'protocol': protocol, 'domain_name': domain_name, 'path': path}