Dataset Viewer
Auto-converted to Parquet Duplicate
hexsha
stringlengths
40
40
size
int64
3
1.03M
content
stringlengths
3
1.03M
avg_line_length
float64
1.33
100
max_line_length
int64
2
1k
alphanum_fraction
float64
0.25
0.99
2fd0f3906db69aab26a29f53d1d0abbfa7632c7d
360
// // Empty.swift // BaseUI // // Copyright © 2020 E-SOFT, OOO. All rights reserved. // import XCTest final class BaseUITests: XCTestCase { func testExample() { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct resu...
18.947368
96
0.641667
6180196fe1b51149c2484cbc7b4a45e9e9d68e55
2,778
// RUN: %empty-directory(%t) // RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/reflect_Character // RUN: %target-codesign %t/reflect_Character // RUN: %target-run %target-swift-reflection-test %t/reflect_Character | %FileCheck %s --check-prefix=CHECK-%target-ptrsize %add_num_extra_inhabitants // REQUIRE...
45.540984
156
0.706983
915713b5c2f273688ddf5f2fdafc86048717b7b7
1,025
// swift-tools-version:4.0 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription let package = Package( name: "{PROJECT}", products: [ // Products define the executables and libraries produced by a package, and make them visible to o...
35.344828
122
0.60878
69af03da82635488df9ea55546e391debed63a0a
5,886
// // Calculate.swift // News // // Created by 杨蒙 on 2017/12/10. // Copyright © 2017年 hrscy. All rights reserved. // import UIKit protocol Calculatable { // MARK: 计算宽度 static func collectionViewWidth(_ count: Int) -> CGFloat // MARK: 计算高度 static func collectionViewHeight(_ count: Int) -> CGFloat ...
35.672727
209
0.599218
14883300cd75c720e1c0010c0531f92fefd03acb
4,418
// // DataManager.swift // insulin_calculator // // Created by 李灿晨 on 10/11/19. // Copyright © 2019 李灿晨. All rights reserved. // import UIKit import CoreData class DataManager: NSObject { /** The shared instance of object `DataManager`. */ static var shared: DataManager = DataManager() ...
32.485294
121
0.628112
22306d2541c1481b44bff9870cbb0dc98f0f7168
1,141
// swift-tools-version:5.1 // We're hiding dev, test, and danger dependencies with // dev to make sure they're not fetched by users of this package. import PackageDescription let package = Package( name: "UINotifications", platforms: [ .iOS(.v13) ], products: [ // dev .library(name: "Da...
43.884615
187
0.650307
ab7e5b4e8dc4311d717796b8ca6d9185d3012ac3
1,512
// // ContactEntity+CoreDataProperties.swift // iOS_Example // // Created by Seyed Samad Gholamzadeh on 9/15/18. // Copyright © 2018 Seyed Samad Gholamzadeh. All rights reserved. // // import Foundation import CoreData import ModelAssistant extension ContactEntity: MAEntity { @nonobjc public class func fetch...
23.625
108
0.70172
1e4394ba25f593496349495754d31f71b5de5f7c
10,304
// // CFAlertActionSheetInteractiveTransition.swift // CFAlertViewControllerDemo // // Created by Shivam Bhalla on 1/20/17. // Copyright © 2017 Codigami Inc. All rights reserved. // import UIKit class CFAlertActionSheetInteractiveTransition: CFAlertBaseInteractiveTransition { // MARK: - Initialisation Me...
44.413793
199
0.586471
03929c4672e93fae63b89d4bb9df6ec837373bda
505
// This source file is part of the Swift.org open source project // Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information // See https://swift.org/CONTRIBUTORS.txt for the li...
22.954545
79
0.673267
26751a8c8513770aaa918f1216006cc527ad9a62
647
// // ElementInteraction.swift // Skylark // // Created by Ross Butler on 3/3/19. // import Foundation struct ElementInteraction: Codable { typealias InteractionType = ElementInteractionType let action: InteractionType let element: Element.Identifier init(action: InteractionType, ele...
22.310345
87
0.680062
50d8a2fc3f2fd6cc1d59b8760cba00b0a3831722
403
//: [< Sommaire](Sommaire) /*: # Gestion des erreurs --- ### Maxime Britto - Swift 4 */ import Foundation let url = URL(string: "http://www.addpple.fr")! if let contenuHTML = try? String(contentsOf: url) { print(contenuHTML) } do { let contenuHTML = try String(contentsOf:url) print(contenuHTML) } cat...
13.433333
51
0.630273
26e1f4b50b3c02d69109de63f7d4e7edc6e05b81
3,558
/* * Copyright IBM Corp. 2017 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in wri...
35.58
111
0.606521
f5b94faec1926967715d018f43babc8711d49ed5
1,110
// // FooterKey.swift // Refresh // // Created by Gesen on 2020/3/22. // https://github.com/wxxsw/Refresh import SwiftUI @available(iOS 13.0, *) extension EnvironmentValues { var refreshFooterUpdate: Refresh.FooterUpdateKey.Value { get { self[Refresh.FooterUpdateKey.self] } set { self[Refresh....
21.764706
68
0.646847
d6e47792624b41a6ddbc297ab7246bc5472f8fe5
1,568
// // KeychainCreator.swift // StandUp-iOS // // Created by Peter on 12/01/19. // Copyright © 2019 BlockchainCommons. All rights reserved. // import Foundation import LibWally class KeychainCreator { func createKeyChain(completion: @escaping ((mnemonic: String?, error: Bool)) -> Void) { ...
28
101
0.453444
265d273818d4e10279575e5e8ca51fc4a1559278
10,218
// // MultiLineChartData.swift // // // Created by Will Dale on 24/01/2021. // import SwiftUI import Combine /** Data for drawing and styling a multi line, line chart. This model contains all the data and styling information for a single line, line chart. */ public final class MultiLineChartData: CTLineChart...
46.445455
175
0.56146
67f7db629e55b7ce5e763ede0e1647ec1d05c1de
3,929
// // Todo+Networking.swift // grokRouter // // Created by Christina Moulton on 2018-03-28. // Copyright © 2018 Christina Moulton. All rights reserved. // import Foundation import Alamofire enum BackendError: Error { case parsing(reason: String) case urlError(reason: String) } struct CreateTodoResult: Codabl...
30.937008
98
0.63044
03408dff7c805aa70359d4b92292a55ef33b58e5
3,011
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you ...
46.323077
147
0.726005
7247a6a6c585ac9f9b43a94ecead34c39d56bf32
240
// // DetailsRouterInput.swift // SwinjectDependencyInjection // // Created by Igor Kotkovets on 12/24/16. // Copyright © 2016 Igor Kotkovets. All rights reserved. // import Foundation protocol DetailsRouterInput { func close() }
17.142857
57
0.725
5baa5b1a34c8cd7b87848aa9ef82dc8a7ced96cd
204
// // Clock.swift // VIPER-SWIFT // // Created by Conrad Stoll on 6/4/14. // Copyright (c) 2014 Mutual Mobile. All rights reserved. // import Foundation protocol Clock { func today() -> NSDate }
15.692308
58
0.651961
3963ce7399893e5dbe9efecb878f81b78034e227
4,708
// // MainViewController.swift // DaangnMarketStyleApp // // Created by 윤병일 on 2021/12/23. // import UIKit import RxSwift import RxCocoa import SnapKit class MainViewController : UIViewController { //MARK: - Properties let disposeBag = DisposeBag() let tableView = UITableView() let submitButton = UIB...
35.134328
160
0.684792
0ec4e56155fff95e0b0817567ef2c4b671c8081f
236
// // File.swift // // // Created by Виталий Зарубин on 31.01.2022. // import Foundation struct Samsung: IPhone { var cpu: ICPU = Snapdragon() func call() { print("\(cpu.work()) -> call samsung") } }
13.111111
46
0.542373
7168c9896afd859dae285fcbc38eabba0517c09a
8,188
// // NSHTTPURLResponse+Utility.swift // swiftlets // // Created by Frank Vernon on 6/27/16. // Copyright © 2016 Frank Vernon. All rights reserved. // import Foundation /** Enumeration of HTTP result values categorized by class of status code. This is useful in processing results of web service calls, for exam...
30.102941
96
0.629213
484ef6bdaa11cafab2da6d6f0941bd67b29e9026
2,290
@objc(MWMDiscoveryLocalExpertCell) final class DiscoveryLocalExpertCell: UICollectionViewCell { @IBOutlet private weak var avatar: UIImageView! @IBOutlet private weak var name: UILabel! @IBOutlet private weak var rating: RatingSummaryView! { didSet { rating.defaultConfig() rating.textFont = UIFont...
30.945946
166
0.632314
e4866b758ae6ad9d15e6da559668c6ee1f25961d
7,971
// // ContactsCellContentView.swift // MyMonero // // Created by Paul Shapiro on 6/15/17. // Copyright (c) 2014-2019, MyMonero.com // // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // ...
38.694175
451
0.752478
5beb63691737da0c0320e660a7c938f230484415
5,030
// // BooksListViewController.swift // BooksList // // Created by Andrey Konstantinov on 04/06/2017. // Copyright © 2017 8of. All rights reserved. // import UIKit final class BooksListViewController: UIViewController { fileprivate weak var output: BooksListViewOutput? fileprivate let collectionView: UIColle...
30.670732
198
0.733002
46be5688a2ab1813b8393b2653ad1b87466e044f
338
//:## User Data import VisualRecognitionV3 let visualRecognition = setupVisualRecognitionV3() //:### Delete labeled data visualRecognition.deleteUserData(customerID: "my-customer-id") { _, error in if let error = error { print(error.localizedDescription) return } print("delete requ...
17.789474
64
0.689349
dd87b24d7b6f615db0ba995641efa7e0794720f9
5,498
// // RSClient+Plugins.swift // RudderStack // // Created by Pallab Maiti on 24/02/22. // Copyright © 2021 Rudder Labs India Pvt Ltd. All rights reserved. // import Foundation extension RSClient { internal func addPlugins() { add(plugin: RSReplayQueuePlugin()) let logPlugin =...
32.152047
163
0.580029
fced4dc35bef6ecbb2bec3a7fb87d440a0666c5f
2,030
// // HLSNative+ExposureContext+Creation.swift // Exposure // // Created by Fredrik Sjöberg on 2017-11-27. // Copyright © 2017 emp. All rights reserved. // import Foundation import Player import Exposure /// Extends `Player` using `HLSNative` tech in an `ExposureContext` with a convenience initializer extension P...
48.333333
251
0.733498
6412d588f3ccab8bdfcc1c7046aa639170e56705
2,803
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. import Foundation import azureSwiftRuntime internal struct ComputeNodeRebootHeadersData : Comp...
42.469697
149
0.700321
de83c1f019c40660e506ab0778c0f353fece75da
2,489
// // SceneDelegate.swift // Assignment1 // // Created by Mohmed Master on 2021/02/10. // import UIKit class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions)...
44.446429
147
0.71595
38989d90bf24b0dffbf6011c028c3bc8f82c6e1d
2,526
import Foundation import StandardLibraries public struct Day7 { public init() {} public typealias Reducer = (Int, (Int, Int)) throws -> Int /* Each submarine has a horizontal position (puzzle input). Moving 1 step costs 1 fuel. What is the least amount of fuel required to align all submarines to the ...
25.515152
177
0.41053
508a0bb6cbdebec5954a76c391d48db9c1ef7ec6
898
// // MinifyCSSTransform.swift // FilestackSDK // // Created by Ruben Nine on 13/08/2019. // Copyright © 2019 Filestack. All rights reserved. // import Foundation /** Minifies your CSS files. */ @objc(FSMinifyCSSTransform) public class MinifyCSSTransform: Transform { /** Initializes a `MinifyCSSTransfo...
22.45
86
0.632517
b91cbbecf40dea8dab37719bc5185a3c9f0b407d
1,580
// swift-tools-version:5.1 // // Package.swift // // Copyright (c) Ramotion Inc. (https://www.ramotion.com/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, in...
35.909091
81
0.703165
f50a74722a8b70f43a42b493695236f551e8a611
16,011
// // Script.swift // // Copyright © 2018 BitcoinKit developers // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to ...
32.944444
165
0.593217
29061467ac3d11b0d1ebac762fb66c8af4dbc726
17,052
// // IQKeyboardReturnKeyHandler.swift // https://github.com/hackiftekhar/IQKeyboardManager // Copyright (c) 2013-16 Iftekhar Qurashi. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software w...
36.358209
156
0.592482
7a5ea33310dc766c937f18f1283f772a065c17ec
3,039
// // AppDelegate.swift // iOSSwift // // Created by C.W. Betts on 10/3/14. // // import UIKit import CocoaLumberjack import CocoaLumberjackSwift let ddloglevel = DDLogLevel.verbose private func printSomething() { DDLogVerbose("Verbose") DDLogDebug("Debug") DDLogInfo("Info") DDLogWarn("Warn") ...
35.752941
279
0.731162
fe6e277c5751ee4090a3d7e3524117597ff91c4a
653
// // Created by Papp Imre on 2019-02-15. // Copyright (c) 2019 CocoaPods. All rights reserved. // import NMDEF_Base import RxFlow import Reusable class Tab2Flow: TabFlow, FlowWithNavigationRoot, StoryboardSceneBased { static var sceneIdentifier: String { return "Tab2Navigation" } func navigate(t...
25.115385
74
0.658499
f575bf4ff8455e5aa6b2f8c2b6545666d1afca6a
181
import Foundation #if os(Linux) import FoundationNetworking #endif public extension URL { /// Easy request generation. var urlRequest: URLRequest { URLRequest(url: self) } }
13.923077
29
0.745856
f9ccf05d36d3158143718384827213947a640a9b
1,126
import UIKit /** Batch Actions View Controller, contains the replication and batch operation actions. */ class HomeActionsViewController: UIViewController { //@IBOutlet weak var dfdfgd: UIButton! fileprivate var eventAPI: EventAPI! fileprivate var remoteReplicator: RemoteReplicator! override func...
30.432432
106
0.728242
383bff4d953659825864ce71a20ef98a38682463
1,161
//: [⇐ Previous: 02 - Functions](@previous) //: ## Episode 03: Challenge - Functions /*: ## Challenge 1 - Create a closure version of the function below. - Try out the function & closure! */ // -------------------------------------- func calculateFullName(firstName: String, lastName: String?) -> String { firstNa...
25.23913
84
0.569337
efec532266ece66de510f196bddd897f5d44ea86
2,358
// // Context.swift // SlackBlocksModel // // Created by Helge Heß. // Copyright © 2020 ZeeZide GmbH. All rights reserved. // public extension Block { struct Context: Encodable { /** * Context's can contain just text (w/ or w/o markdown) and images. */ public enum Element: Encodable { ...
23.117647
73
0.583545
03574c62496676d2903d1c440612a83d3ba3c5b8
2,288
// // SceneDelegate.swift // LableWhisperer // // Created by asc on 11/12/21. // import UIKit class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { ...
43.169811
147
0.71285
3847619aa1e01290175ef4b71979258bd60b8e3c
94
public protocol SpeculidConfigurationProtocol { var mode: SpeculidApplicationMode { get } }
23.5
47
0.808511
db55fc8ba938f0c3ca7c79529e584addad1e0155
3,488
import UIKit //: # Lesson 2 Exercises //: ## Optionals //: ### Exercise 1 //: When retrieving a value from a dictionary, Swift returns an optional. //: //: 1a) The variable, director, is an optional type. Its value cannot be used until it is unwrapped. Use `if let` to carefully unwrap the value returned by `moviesDict...
44.717949
314
0.739392
ab522774bc3f8d38b66c443cee0614d99804c2e5
3,088
// // CGPointExtensions.swift // SSTests // // Created by Omar Albeik on 07/12/2016. // Copyright © 2016 Omar Albeik. All rights reserved. // #if os(macOS) import Cocoa #else import UIKit #endif // MARK: - Methods public extension CGPoint { /// SwifterSwift: Distance from another CGPoint. /// /// - Parame...
27.087719
91
0.645725
c19a157c62fd5578fdb68363d9f9d72804bb87db
1,244
/* Copyright 2017 Ryuichi Intellectual Property and the Yanagiba project contributors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 ...
32.736842
85
0.737942
abe5534d2d4c5225008bc6df2641eb93e1a85571
5,332
/* THIS FILE WAS AUTOGENERATED! DO NOT EDIT! file to edit: 00_load_data.ipynb */ import Foundation import Just import Path public func shellCommand(_ launchPath: String, _ arguments: [String]) -> String? { let task = Process() task.executableURL = URL.init(fileURLWithPath:launchPath) task.argumen...
37.286713
125
0.626594
26c82d6c72bffdb0d05282386b0ef9c209c725ea
1,746
// // DrawTimerBarView.swift // drawAI // // Created by Alessandro Negrão on 25/10/21. // import UIKit protocol DrawTimerBarDelegate: AnyObject { func didFinishTime() } class DrawTimerBarView: ANView { private var timerValue: Double = 1.0 private var progressLayer = CAShapeLayer() weak var del...
26.861538
113
0.607102
3a3136d762cbea5f878a98f045af5aad3de7e9a9
2,237
// // UIViewController+JX.swift // JXPhotoBrowser // // Created by JiongXing on 2018/10/14. // import Foundation import UIKit extension UIViewController: JXNamespaceWrappable {} extension JXTypeWrapperProtocol where JXWrappedType == UIViewController { /// Returns the current application's top most view c...
36.080645
91
0.664283
eb3749fcf1a67449f39e5903f0511e85c7c1cc9f
68
import Foundation enum FormatError: Error { case stringError }
11.333333
25
0.75
4829cf1c3baec0fcd6d704b58d984daa744f511a
346
// // EmptyReuseView.swift // musicSheet // // Created by Jz D on 2020/8/24. // Copyright © 2020 Jz D. All rights reserved. // import UIKit class EmptyReuseView: UICollectionReusableView { override func awakeFromNib() { super.awakeFromNib() // Initialization code backgroundCo...
16.47619
48
0.624277
69dcb86b4e864ea1148b4c29a687eb5c54651023
8,755
// // Infallible+Tests.swift // Tests // // Created by Shai Mishali on 11/20/20. // Copyright © 2020 Krunoslav Zaher. All rights reserved. // import RxSwift import RxCocoa import RxRelay import RxTest import XCTest class InfallibleTest: RxTest { } extension InfallibleTest { func testAsInfallible_OnErrorJustR...
25.979228
98
0.52964
1646434524dbc8cab18dcffd598562c0aee6c48c
1,812
// // BeNilSpec.swift // Sleipnir // // Created by Artur Termenji on 7/16/14. // Copyright (c) 2014 railsware. All rights reserved. // import Foundation class BeNilSpec : SleipnirSpec { var beNilSpec : () = describe("BeNil matcher") { context("value") { var value: Int? ...
28.761905
75
0.370861
7521f8bab56026d86480f1aba131e9eb2070f02c
7,660
// // LogViewHelper.swift // TTBaseUIKit // // Created by Tuan Truong Quang on 9/11/19. // Copyright © 2019 Truong Quang Tuan. All rights reserved. // import Foundation import UIKit open class LogViewHelper { fileprivate var viewModel:LogTrackingViewModel = LogTrackingViewModel() public static l...
39.282051
144
0.591253
87571fa5b1e094bd1211e9235e4fcee7d69d49f8
1,391
// // UIButton-Extension.swift // YoungWeibo // // Created by Young on 2016/12/10. // Copyright © 2016年 杨羽. All rights reserved. // import UIKit extension UIButton { class func creatButton(_ iamgeName : String , bgImageName : String) -> UIButton { let btn = UIButton() btn.setImage(UIImage.in...
32.348837
100
0.642703
End of preview. Expand in Data Studio

Dataset 1: TheStack - Swift - Cleaned

Description: This dataset is drawn from TheStack Corpus, an open-source code dataset with over 3TB of GitHub data covering 48 programming languages. We selected a small portion of this dataset to optimize smaller language models for Swift, a popular statically typed language.

Target Language: Swift

Dataset Size:

  • Training: 900,000 files
  • Validation: 50,000 files
  • Test: 50,000 files

Preprocessing:

  1. Selected Swift as the target language due to its popularity on GitHub.
  2. Filtered out files with average line length > 100 characters, maximum line length > 1000 characters, and alphabet ratio < 25%.
  3. Split files into 90% training, 5% validation, and 5% test sets.

Tokenizer: Byte Pair Encoding (BPE) tokenizer with tab and whitespace tokens. GPT-2 vocabulary extended with special tokens.

Training Sequences: Sequences constructed by joining training data text to reach a context length of 2048 tokens (1024 tokens for full fine-tuning).

Downloads last month
41

Models trained or fine-tuned on ammarnasr/the-stack-swift-clean