<commit_before>import Foundation

public struct Attachment {

  public enum Type {
    case Image, Video
  }

  public var type: Type
  public var source: NSURL

  public init(type: Type, source: NSURL) {
    self.type = type
    self.source = source
  }
}<commit_msg>Refactor Attachment<commit_after>import Foundation

public struct Attachment {

  public enum Type {
    case Image, Video
  }

  public var type: Type
  public var source: URLStringConvertible

  public init(_ source: URLStringConvertible, _ type: Type) {
    self.type = type
    self.source = source
  }
}

public protocol URLStringConvertible {
  var url: NSURL { get }
}

extension String: URLStringConvertible {

  public var url: NSURL {
    return NSURL(string: self)!
  }

}
{'fraction_non_alphanumeric': 0.0758988015978695, 'fraction_numerical': 0.0, 'mean_word_length': 3.346820809248555, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7537733', 'n_tokens_mistral': 235, 'n_tokens_neox': 225, 'n_words': 75}