<commit_before>import Dispatch

struct FutureExecution {
  private static let sharedQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)

  typealias Group = dispatch_group_t

  static func makeGroup() -> Group {
    return dispatch_group_create()
  }

  static func async(block: () -> Void) {
    dispatch_async(sharedQueue, block)
  }

  static func async(group: Group, block: () -> Void) {
    dispatch_group_async(group, sharedQueue, block)
  }

  static func sync(block: () -> Void) {
    dispatch_sync(sharedQueue, block)
  }

  static func notify(group: Group, block: () -> Void) {
    dispatch_group_notify(group, sharedQueue, block)
  }

  static func wait(group: Group) {
    dispatch_group_wait(group, DISPATCH_TIME_FOREVER)
  }
}

public class Future<T> {
  public class func async(block: () -> Try<T>) -> Future<T> {
    return AsyncFuture(block)
  }

  public class func succeeded(val: T) -> Future<T> {
    return fromTry(.Success(val))
  }

  public class func failed(val: String) -> Future<T> {
    return fromTry(.Failure(val))
  }

  public class func fromTry(val: Try<T>) -> Future<T> {
    return ImmediateFuture(val)
  }

  public class func promise() -> PromiseFuture<T> {
    return PromiseFuture()
  }

  public typealias CompletionCallback = Try<T> -> Void
<commit_msg>Add public main functions, specify returned types accurately<commit_after>import Dispatch

public func async<T>(block: () -> Try<T>) -> AsyncFuture<T> {
  return Future.async(block)
}

public func succeeded<T>(val: T) -> ImmediateFuture<T> {
  return Future.succeeded(val)
}

public func failed<T>(val: String) -> ImmediateFuture<T> {
  return Future.failed(val)
}

public func fromTry<T>(val: Try<T>) -> ImmediateFuture<T> {
  return Future.fromTry(val)
}

public func promise<T>() -> PromiseFuture<T> {
  return Future.promise()
}

struct FutureExecution {
  private static let sharedQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)

  typealias Group = dispatch_group_t

  static func makeGroup() -> Group {
    return dispatch_group_create()
  }

  static func async(block: () -> Void) {
    dispatch_async(sharedQueue, block)
  }

  static func async(group: Group, block: () -> Void) {
    dispatch_group_async(group, sharedQueue, block)
  }

  static func sync(block: () -> Void) {
    dispatch_sync(sharedQueue, block)
  }

  static func notify(group: Group, block: () -> Void) {
    dispatch_group_notify(group, sharedQueue, block)
  }

  static func wait(group: Group) {
    dispatch_group_wait(group, DISPATCH_TIME_FOREVER)
  }
}

public class Future<T> {
  public class func async(block: () -> Try<T>) -> AsyncFuture<T> {
    return AsyncFuture(block)
  }

  public class func succeeded(val: T) -> ImmediateFuture<T> {
    return fromTry(.Success(val))
  }

  public class func failed(val: String) -> ImmediateFuture<T> {
    return fromTry(.Failure(val))
  }

  public class func fromTry(val: Try<T>) -> ImmediateFuture<T> {
    return ImmediateFuture(val)
  }

  public class func promise() -> PromiseFuture<T> {
    return PromiseFuture()
  }

  public typealias CompletionCallback = Try<T> -> Void

{'fraction_non_alphanumeric': 0.12396694214876033, 'fraction_numerical': 0.0006357279084551812, 'mean_word_length': 4.051364365971107, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 63, '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': '1957003', 'n_tokens_mistral': 1039, 'n_tokens_neox': 996, 'n_words': 245}