Datasets:
repo_name stringlengths 6 91 | path stringlengths 8 968 | copies stringclasses 210
values | size stringlengths 2 7 | content stringlengths 61 1.01M | license stringclasses 15
values | hash stringlengths 32 32 | line_mean float64 6 99.8 | line_max int64 12 1k | alpha_frac float64 0.3 0.91 | ratio float64 2 9.89 | autogenerated bool 1
class | config_or_test bool 2
classes | has_no_keywords bool 2
classes | has_few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
FuckBoilerplate/RxCache | watchOS/Pods/RxSwift/RxSwift/DataStructures/Bag.swift | 12 | 7470 | //
// Bag.swift
// Rx
//
// Created by Krunoslav Zaher on 2/28/15.
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
//
import Foundation
import Swift
let arrayDictionaryMaxSize = 30
/**
Class that enables using memory allocations as a means to uniquely identify objects.
*/
class Identity {
// weird ... | mit | e97e8b50c9bc581f43e4f2839c508cdd | 21.229167 | 99 | 0.544383 | 4.246163 | false | false | false | false |
Q42/NoticeWindow | Pod/Classes/NoticeView.swift | 1 | 2780 | //
// NoticeView.swift
// Pods
//
// Created by Tim van Steenis on 09/12/15.
//
//
import Foundation
import UIKit
class NoticeView: UIView {
@IBOutlet weak var horizontalStackView: UIStackView!
@IBOutlet weak var leftImage: UIImageView!
@IBOutlet weak var rightImage: UIImageView!
@IBOutlet weak var left... | mit | ade02138ed007fd54ccc2b1ac695f3e3 | 26.524752 | 147 | 0.713309 | 5.063752 | false | false | false | false |
Brightify/ReactantUI | Sources/Tokenizer/Properties/AssignableProperty.swift | 1 | 3261 | //
// AssignablePropertyDescription.swift
// ReactantUI
//
// Created by Tadeas Kriz.
// Copyright © 2017 Brightify. All rights reserved.
//
import Foundation
#if canImport(UIKit)
import UIKit
#endif
/**
* Standard typed property obtained from an XML attribute.
*/
public struct AssignableProperty<T: AttributeS... | mit | d5cff34220c9fdac380e03cc3400d03f | 34.053763 | 124 | 0.654294 | 4.865672 | false | false | false | false |
mownier/pyrobase | Pyrobase/Pyrobase.swift | 1 | 2029 | //
// Pyrobase.swift
// Pyrobase
//
// Created by Mounir Ybanez on 01/05/2017.
// Copyright © 2017 Ner. All rights reserved.
//
public class Pyrobase {
internal var path: RequestPathProtocol
internal var request: RequestProtocol
public var baseURL: String {
return path.baseURL
}
... | mit | b32ea17f27966b0a373e97cf7eecb516 | 32.8 | 124 | 0.642505 | 4.38013 | false | false | false | false |
lukejmann/FBLA2017 | Pods/Instructions/Sources/Helpers/CoachMarkLayoutHelper.swift | 1 | 9860 | // CoachMarkLayoutHelper.swift
//
// Copyright (c) 2016 Frédéric Maquin <fred@ephread.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, including without limitat... | mit | 7fdccdfcd965ef43f7c5ba5fbd1a879f | 44.851163 | 311 | 0.638771 | 6.130597 | false | false | false | false |
keyeMyria/edx-app-ios | Source/OEXStyles+Swift.swift | 4 | 3515 | //
// OEXStyles+Swift.swift
// edX
//
// Created by Ehmad Zubair Chughtai on 25/05/2015.
// Copyright (c) 2015 edX. All rights reserved.
//
import Foundation
import UIKit
extension OEXStyles {
var navigationTitleTextStyle : OEXTextStyle {
return OEXTextStyle(weight: .SemiBold, size: .Base, color ... | apache-2.0 | edc461ffa186f25450b182ac5b367538 | 38.066667 | 136 | 0.676814 | 5.230655 | false | false | false | false |
relayr/apple-sdk | Sources/common/services/API/APIUsers.swift | 1 | 7530 | import ReactiveSwift
import Result
import Foundation
internal extension API {
/// User entity as represented on the relayr API platform.
struct User: JSONable {
let identifier: String
var email: String?
var nickname: String?
var name: (first: String?, last: String?)
var ... | mit | 0be95a152765dc0a5ccd308ef878da96 | 53.963504 | 193 | 0.684329 | 4.458259 | false | false | false | false |
dnosk/Explore | Example/Explore/ViewController.swift | 1 | 1164 | //
// ViewController.swift
// Explore
//
// Created by dnosk on 04/26/2017.
// Copyright (c) 2017 dnosk. All rights reserved.
//
import Explore
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var tableView: UITableView!
var appsDownloaded = [String]()
override func view... | mit | 5f0de78f81567cdd2699c4a3f8098caf | 23.25 | 100 | 0.646048 | 5.173333 | false | false | false | false |
bm842/TradingLibrary | Sources/OandaRestV1Instrument.swift | 2 | 9009 | /*
The MIT License (MIT)
Copyright (c) 2016 Bertrand Marlier
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 use, copy, modify, mer... | mit | 0ed0ff9ff97bd8abe6524c5b70220f67 | 37.5 | 133 | 0.487734 | 5.869055 | false | false | false | false |
pocketworks/Dollar.swift | Cent/Cent/Int.swift | 1 | 2807 | //
// Int.swift
// Cent
//
// Created by Ankur Patel on 6/30/14.
// Copyright (c) 2014 Encore Dev Labs LLC. All rights reserved.
//
import Foundation
extension Int {
/// Invoke a callback n times
///
/// :param callback The function to invoke that accepts the index
public func times(callback:... | mit | 9070a125d16521f2339d81c148398aef | 23.840708 | 82 | 0.530816 | 4.379095 | false | false | false | false |
natecook1000/swift | test/PlaygroundTransform/high_performance.swift | 7 | 1253 | // RUN: %empty-directory(%t)
// RUN: cp %s %t/main.swift
// RUN: %target-build-swift -Xfrontend -playground -Xfrontend -playground-high-performance -o %t/main %S/Inputs/PlaygroundsRuntime.swift %t/main.swift
// RUN: %target-codesign %t/main
// RUN: %target-run %t/main | %FileCheck %s
// RUN: %target-build-swift -Xfront... | apache-2.0 | d179622ada08036ee51d59e0127cbe28 | 28.139535 | 209 | 0.592179 | 2.962175 | false | false | false | false |
danfsd/FolioReaderKit | Example/Example/ViewController.swift | 1 | 1987 | //
// ViewController.swift
// Example
//
// Created by Heberti Almeida on 08/04/15.
// Copyright (c) 2015 Folio Reader. All rights reserved.
//
import UIKit
import FolioReaderKit
class ViewController: UIViewController {
@IBOutlet var bookOne: UIButton!
@IBOutlet var bookTwo: UIButton!
let epubSampleF... | bsd-3-clause | ce6ce0d71999c9a27aaba194bb77f96c | 31.57377 | 130 | 0.645194 | 4.485327 | false | true | false | false |
codercd/DPlayer | DPlayer/Model.swift | 1 | 1721 | //
// Model.swift
// DPlayer
//
// Created by LiChendi on 16/4/19.
// Copyright © 2016年 LiChendi. All rights reserved.
//
import UIKit
class Model: NSObject {
}
enum LiveBaseURL:String {
case rtmp = "rtmp://live.quanmin.tv/live/1456011"
case hls = "http://hls.quanmin.tv/live/1456011/playlist.m3u8"
c... | mit | 33dc39063638b30d5f30014ddc75bfcc | 20.475 | 77 | 0.525029 | 3.571726 | false | false | false | false |
ociata/OCIKeyboardAdjuster | OCIKeyboardAdjuster.swift | 1 | 7643 | //
// KeyboardAdjuster.swift
//
//
// Created by Hristo Todorov - Oci on 6/5/15.
// Copyright (c) 2015
//
import UIKit
class OCIKeyboardAdjuster: NSObject
{
static let sharedKeyboardAdjuster = OCIKeyboardAdjuster()
weak var focusedControl: UIView?
private override init() {
//this way ... | mit | 561c2b437bbbff08384fa7aeca0021c0 | 45.603659 | 209 | 0.568887 | 6.986289 | false | false | false | false |
RCacheaux/BitbucketKit | Carthage/Checkouts/Swinject/Sources/SwinjectStoryboard/Container+SwinjectStoryboard.swift | 1 | 2302 | //
// Container+SwinjectStoryboard.swift
// Swinject
//
// Created by Yoichi Tagaya on 11/28/15.
// Copyright © 2015 Swinject Contributors. All rights reserved.
//
#if os(iOS) || os(OSX) || os(tvOS)
extension Container {
/// Adds a registration of the specified view or window controller that is configured in a... | apache-2.0 | 9d7ea5cf5edf5bce1301df0b168b9915 | 49.021739 | 139 | 0.679704 | 4.773859 | false | false | false | false |
adamnemecek/SortedArray.swift | Cmdline/main.swift | 1 | 931 | //
// main.swift
// Cmdline
//
// Created by Adam Nemecek on 5/6/17.
//
//
import Foundation
import SortedArray
let s = SortedSet([5,2,1,2,3,6,7,8])
let a = [1,2,3,4,5,6]
let b = [1, 2, 2, 3, 3, 5, 6]
print(b)
//var u = UnionIterator(a: a, b: b) { $0 < $1 }
//print(s.contains(1))
//while let n = u.next() {
//... | mit | 74a3837179a3dd1ff29794093f81f149 | 17.254902 | 76 | 0.538131 | 2.690751 | false | false | false | false |
KBryan/SwiftFoundation | Darwin Support/NSUUID.swift | 1 | 1268 | //
// NSUUID.swift
// SwiftFoundation
//
// Created by Alsey Coleman Miller on 7/4/15.
// Copyright © 2015 PureSwift. All rights reserved.
//
import Foundation
public extension NSUUID {
convenience init(byteValue: uuid_t) {
var value = byteValue
let buffer = withUnsafeMu... | mit | 1023223f8088c42049b746835267a916 | 23.365385 | 134 | 0.561168 | 4.891892 | false | false | false | false |
EstebanVallejo/sdk-ios | MercadoPagoSDK/MercadoPagoSDK/MercadoPago.swift | 1 | 17199 |
//
// MercadoPago.swift
// MercadoPagoSDK
//
// Created by Matias Gualino on 28/12/14.
// Copyright (c) 2014 com.mercadopago. All rights reserved.
//
import Foundation
import UIKit
public class MercadoPago : NSObject {
public class var PUBLIC_KEY : String {
return "public_key"
}
public c... | mit | 03de915deb85beca28b7b6b05d95b922 | 45.736413 | 341 | 0.589603 | 5.089672 | false | false | false | false |
xmartlabs/XLSlidingContainer | Example/Example/ScrollViewController.swift | 1 | 1800 | //
// ScrollViewController.swift
//
// Copyright (c) 2017 Xmartlabs ( http://xmartlabs.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, including without ... | mit | 76c16078fe4dec4f78599e3cf6f925aa | 35 | 80 | 0.729444 | 4.675325 | false | false | false | false |
abdullahselek/SwiftyNotifications | Sample/Sample/ViewController.swift | 1 | 2983 | //
// ViewController.swift
// Sample
//
// Created by Abdullah Selek on 03/04/2017.
// Copyright © 2017 Abdullah Selek. All rights reserved.
//
import UIKit
import SwiftyNotifications
class ViewController: UIViewController, SwiftyNotificationsDelegate {
private var notification: SwiftyNotifications!
priv... | mit | 4ba557ef5e2e6bd0df2cbc38a191927d | 27.951456 | 151 | 0.57277 | 5.881657 | false | false | false | false |
wireapp/wire-ios | Wire-iOS Tests/DeviceManagement/CoreDataFixture+MockUserClient.swift | 1 | 1530 | //
// Wire
// Copyright (C) 2018 Wire Swiss GmbH
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This progr... | gpl-3.0 | a3410644d49cd1688a58e23709109c7c | 33.772727 | 126 | 0.711111 | 4.409222 | false | false | false | false |
novi/i2c-swift-example | Sources/I2CDeviceModule/SHT21.swift | 1 | 1397 | //
// SHT21.swift
// I2CDeviceModule
//
// Created by Yusuke Ito on 3/1/17.
// Copyright © 2017 Yusuke Ito. All rights reserved.
//
import Foundation
import I2C
public final class SHT21 {
public let address: UInt8
public let device: I2CDevice
public init(device: I2CDevice, address: UInt8 = 0x40) {
... | mit | 6647d0ed733129788e5abfb9c1537916 | 23.491228 | 98 | 0.606017 | 3.607235 | false | false | false | false |
HasanEdain/NPCColorPicker | NPCColorPicker/NPCPaleteUtility.swift | 1 | 4578 | //
// NPCPaleteUtility.swift
// NPCColorPicker
//
// Created by Hasan D Edain and Andrew Bush on 12/6/15.
// Copyright © 2015-2017 NPC Unlimited. All rights reserved.
//
import UIKit
open class NPCPaleteUtility {
open static func twelveColorWheel()->[UIColor] {
let colorArray =
[NPCColorUtili... | mit | a3df61595c574825edbf2506c1150447 | 36.211382 | 110 | 0.629233 | 4.884739 | false | false | false | false |
ByteriX/BxInputController | BxInputController/Sources/Rows/Boolean/View/BxInputCheckRowBinder.swift | 1 | 1126 | /**
* @file BxInputCheckRowBinder.swift
* @namespace BxInputController
*
* @details Binder for check box row subclasses
* @date 17.03.2017
* @author Sergey Balalaev
*
* @version last in https://github.com/ByteriX/BxInputController.git
* @copyright The MIT License (MIT) https://opensource.org/licenses/MIT
* C... | mit | 4524d134178bdc3d45cd42285ff23c16 | 27.871795 | 102 | 0.674067 | 4.217228 | false | false | false | false |
LunaGao/cnblogs-Mac-Swift | CNBlogsForMac/WebApi/BaseWebApi.swift | 1 | 1904 | //
// BaseWebApi.swift
// CNBlogsForMac
//
// Created by Luna Gao on 15/11/16.
// Copyright © 2015年 gao.luna.com. All rights reserved.
//
import Foundation
class BaseWebApi : NSObject {
func basicRequest(callback:(String?)->Void){
let basicAuth = "Basic 这个值是根据ClientId和ClientSercret计算得来,这里隐藏"
... | mit | f60ff12f936f92dc73c4c8c7b585015c | 33.735849 | 142 | 0.555676 | 4.672589 | false | false | false | false |
q231950/appwatch | AppWatch/ViewControllers/TimeTableViewController.swift | 1 | 1268 | //
// TimeTableViewController.swift
// AppWatch
//
// Created by Martin Kim Dung-Pham on 25.08.15.
// Copyright © 2015 Martin Kim Dung-Pham. All rights reserved.
//
import AppKit
class TimeTableViewController: NSViewController {
@IBOutlet weak var collectionView: NSCollectionView!
override func ... | mit | f58453514cd32b3c8d5c19ddc6cdce77 | 28.465116 | 145 | 0.648777 | 4.727612 | false | false | false | false |
praca-japao/156 | PMC156Inteligente/MyProfileTableViewController.swift | 1 | 3269 | //
// MyProfileTableViewController.swift
// PMC156Inteligente
//
// Created by Giovanni Pietrangelo on 11/29/15.
// Copyright © 2015 Sigma Apps. All rights reserved.
//
import UIKit
class MyProfileTableViewController: UITableViewController {
override func viewDidLoad() {
super.viewDidLoad()
... | gpl-2.0 | a4c6d543bbda53199ba57cdbef76256a | 33.4 | 157 | 0.690024 | 5.576792 | false | false | false | false |
tdscientist/ShelfView-iOS | Example/Pods/Kingfisher/Sources/General/ImageSource/ImageDataProvider.swift | 1 | 5571 | //
// ImageDataProvider.swift
// Kingfisher
//
// Created by onevcat on 2018/11/13.
//
// Copyright (c) 2018 Wei Wang <onevcat@gmail.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 S... | mit | 968c0e7519d64e9a12ef46d66b5dff30 | 37.42069 | 115 | 0.680129 | 4.496368 | false | false | false | false |
therealbnut/swift | stdlib/public/SDK/Foundation/NSString.swift | 9 | 4420 | //===----------------------------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... | apache-2.0 | 2d7638467eddfa465fb0cb69a0bba20e | 32.740458 | 97 | 0.659955 | 4.851811 | false | false | false | false |
Fenrikur/ef-app_ios | EurofurenceTests/Presenter Tests/Dealer Detail/Presenter Tests/WhenBindingAboutTheArtistComponent_DealerDetailPresenterShould.swift | 1 | 1348 | @testable import Eurofurence
import EurofurenceModel
import XCTest
class WhenBindingAboutTheArtistComponent_DealerDetailPresenterShould: XCTestCase {
func testBindTheArtistDescriptionOntoTheComponent() {
let aboutTheArtistViewModel = DealerDetailAboutTheArtistViewModel.random
let viewModel = FakeD... | mit | e76b55b76698623a595eea851280ea45 | 45.482759 | 130 | 0.793027 | 6.912821 | false | true | false | false |
grandiere/box | box/Metal/Texture/MetalTexture.swift | 1 | 1392 | import UIKit
import MetalKit
class MetalTexture
{
let totalFrames:Int
var currentFrame:Int
private var frameTick:Int
private let frames:[MTLTexture]
private let ticksPerFrame:Int
init(
ticksPerFrame:Int,
images:[UIImage],
textureLoader:MTKTextureLoader)
{
... | mit | cddadf31969df21e35d795e9584c88dd | 17.810811 | 77 | 0.475575 | 5.8 | false | false | false | false |
serieuxchat/SwiftySRP | SwiftySRP/SRPData+BigIntType.swift | 1 | 9367 | //
// SRPData+BigIntType.swift
// SwiftySRP
//
// Created by Sergey A. Novitsky on 20/03/2017.
// Copyright © 2017 Flock of Files. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to dea... | mit | 0ffc35fd5a580d9ccd033be597b69b8b | 33.307692 | 216 | 0.623425 | 5.008556 | false | false | false | false |
tokyovigilante/CesiumKit | CesiumKit/Core/EllipsoidGeodesic.swift | 1 | 14805 | //
// EllipsoidGeodesic.swift
// CesiumKit
//
// Created by Ryan Walklin on 2/11/2015.
// Copyright © 2015 Test Toast. All rights reserved.
//
import Foundation
/**
* Initializes a geodesic on the ellipsoid connecting the two provided planetodetic points.
*
* @alias EllipsoidGeodesic
* @constructor
*
* @par... | apache-2.0 | b0b90ae8d322df29746dac6160cefefb | 37.855643 | 208 | 0.596663 | 4.13058 | false | false | false | false |
3drobotics/SwiftIO | Sources/UDPChannel.swift | 1 | 9242 | //
// UDPMavlinkReceiver.swift
// SwiftIO
//
// Created by Jonathan Wight on 4/22/15.
//
// Copyright (c) 2014, Jonathan Wight
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * R... | mit | 620890acea87fea54837254886f27626 | 31.42807 | 154 | 0.59143 | 4.651233 | false | false | false | false |
jisudong/study | MyPlayground.playground/Pages/可选链式调用.xcplaygroundpage/Contents.swift | 1 | 1812 | //: [Previous](@previous)
import Foundation
class Person {
var residence: Residence?
}
class Residence {
var rooms = [Room]()
var address: Address?
var numberOfRooms: Int {
return rooms.count
}
subscript(i: Int) -> Room{
get {
return rooms[i]
}
set ... | mit | 313678c8e211e0d19402b9f62c2d931c | 21.625 | 87 | 0.596133 | 4.049217 | false | false | false | false |
STShenZhaoliang/Swift2Guide | Swift2Guide/Swift100Tips/Swift100Tips/ErrorController.swift | 1 | 3869 | //
// ErrorController.swift
// Swift100Tips
//
// Created by 沈兆良 on 16/5/30.
// Copyright © 2016年 ST. All rights reserved.
//
import UIKit
class ErrorController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let path = NSBundle.mainBundle().pathForResource("", ofType: ... | mit | 5ae8aec70819aa3815fe0d599929e09c | 22.068702 | 279 | 0.592323 | 3.610514 | false | false | false | false |
AaronMT/firefox-ios | Client/Frontend/AuthenticationManager/PagingPasscodeViewController.swift | 9 | 3110 | /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import Foundation
private let PaneSwipeDuration: TimeInterval = 0.3
/// Base class for implementing a Passcode co... | mpl-2.0 | 4507c007c889d6b3e1dec35f7693579d | 33.94382 | 117 | 0.667524 | 4.960128 | false | false | false | false |
djq993452611/YiYuDaoJia_Swift | YiYuDaoJia/YiYuDaoJia/Classes/Main/Controller/BaseViewController.swift | 1 | 2249 | //
// BaseViewController.swift
// YiYuDaoJia
//
// Created by 蓝海天网Djq on 2017/4/25.
// Copyright © 2017年 蓝海天网Djq. All rights reserved.
//
import UIKit
class BaseViewController: UIViewController {
// MARK: 定义属性
var contentView : UIView?
var baseVM : BaseViewModel!
// MARK: 懒加载属性
filep... | mit | f5150ca70d079a567cca399132d57cee | 20.353535 | 169 | 0.613529 | 4.848624 | false | false | false | false |
piv199/LocalisysChat | LocalisysChat/Sources/Modules/Common/Chat/Views/Inputs/AutoTextView.swift | 1 | 5792 | //
// ALTextView.swift
// ALTextInputBar
//
// Created by Alex Littlejohn on 2015/04/24.
// Copyright (c) 2015 zero. All rights reserved.
//
import UIKit
public protocol AutoTextViewDelegate: UITextViewDelegate {
/**
Notifies the receiver of a change to the contentSize of the textView
The receiver is re... | unlicense | 774bc41b3204ccedfb4a8d3907e0bfce | 28.105528 | 126 | 0.710117 | 5.00605 | false | false | false | false |
te-th/xID3 | Tests/xID3Tests/WithFilesTests.swift | 1 | 1814 | /*
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 may not use this f... | apache-2.0 | 600176efee8ee7d638c3171d6a45b298 | 36.791667 | 109 | 0.68688 | 4.308789 | false | true | false | false |
MarvinNazari/ICSPullToRefresh.Swift | ICSPullToRefresh/NVActivityIndicatorAnimationBallPulseRise.swift | 1 | 3984 | //
// NVActivityIndicatorAnimationBallPulseRise.swift
// NVActivityIndicatorViewDemo
//
// Created by Nguyen Vinh on 7/24/15.
// Copyright (c) 2015 Nguyen Vinh. All rights reserved.
//
import UIKit
class NVActivityIndicatorAnimationBallPulseRise: NVActivityIndicatorAnimationDelegate {
func setUpAnimation... | mit | 0799c7876c929d3978b3c612e614659f | 40.936842 | 139 | 0.646586 | 5.304927 | false | false | false | false |
neotron/SwiftBot-Discord | DiscordAPI/Source/API/Utility/URLEndpoints.swift | 1 | 727 | //
// Created by David Hedbor on 2/12/16.
// Copyright (c) 2016 NeoTron. All rights reserved.
//
import Foundation
import Alamofire
enum URLEndpoint: String {
case Login = "auth/login",
Logout = "auth/logout",
Gateway = "gateway",
Channel = "channels",
User = "users"
}
class ... | gpl-3.0 | 74117925a32497bf72326f993237c1e7 | 24.068966 | 72 | 0.609354 | 3.972678 | false | false | false | false |
IVA Swift GitHub Code Dataset
Dataset Description
This is the curated IVA Swift dataset extracted from GitHub. It contains curated Swift files gathered with the purpose to train a code generation model.
The dataset consists of 383380 swift code files from GitHub totaling ~542MB of data. The uncurated dataset was created from the public GitHub dataset on Google BiqQuery.
How to use it
To download the full dataset:
from datasets import load_dataset
dataset = load_dataset('mvasiliniuc/iva-swift-codeint-clean', split='train')
from datasets import load_dataset
dataset = load_dataset('mvasiliniuc/iva-swift-codeint-clean', split='train')
print(dataset[723])
#OUTPUT:
{
"repo_name":"jdkelley/Udacity-OnTheMap-ExampleApps",
"path":"TheMovieManager-v2/TheMovieManager/BorderedButton.swift",
"copies":"2",
"size":"2649",
"content":"...let phoneBorderedButtonExtraPadding: CGFloat = 14.0\n \n var backingColor: UIColor? = nil\n var highlightedBackingColor: UIColor? = nil\n \n // MARK: Initialization\n}",
"license":"mit",
"hash":"db1587fd117e9a835f58cf8203d8bf05",
"line_mean":29.1136363636,
"line_max":87,
"alpha_frac":0.6700641752,
"ratio":5.298,
"autogenerated":false,
"config_or_test":false,
"has_no_keywords":false,
"has_few_assignments":false
}
Data Structure
Data Fields
| Field | Type | Description |
|---|---|---|
| repo_name | string | name of the GitHub repository |
| path | string | path of the file in GitHub repository |
| copies | string | number of occurrences in dataset |
| content | string | content of source file |
| size | string | size of the source file in bytes |
| license | string | license of GitHub repository |
| hash | string | Hash of content field. |
| line_mean | number | Mean line length of the content. |
| line_max | number | Max line length of the content. |
| alpha_frac | number | Fraction between mean and max line length of content. |
| ratio | number | Character/token ratio of the file with tokenizer. |
| autogenerated | boolean | True if the content is autogenerated by looking for keywords in the first few lines of the file. |
| config_or_test | boolean | True if the content is a configuration file or a unit test. |
| has_no_keywords | boolean | True if a file has none of the keywords for Swift Programming Language. |
| has_few_assignments | boolean | True if file uses symbol '=' less than minimum times. |
Instance
{
"repo_name":"...",
"path":".../BorderedButton.swift",
"copies":"2",
"size":"2649",
"content":"...",
"license":"mit",
"hash":"db1587fd117e9a835f58cf8203d8bf05",
"line_mean":29.1136363636,
"line_max":87,
"alpha_frac":0.6700641752,
"ratio":5.298,
"autogenerated":false,
"config_or_test":false,
"has_no_keywords":false,
"has_few_assignments":false
}
Languages
The dataset contains only Swift files.
{
"Swift": [".swift"]
}
Licenses
Each entry in the dataset contains the associated license. The following is a list of licenses involved and their occurrences.
{
"agpl-3.0":1695,
"apache-2.0":85514,
"artistic-2.0":207,
"bsd-2-clause":3132,
"bsd-3-clause":6600,
"cc0-1.0":1409,
"epl-1.0":605,
"gpl-2.0":9374,
"gpl-3.0":18920,
"isc":808,
"lgpl-2.1":1122,
"lgpl-3.0":3103,
"mit":240929,
"mpl-2.0":8181,
"unlicense":1781
}
Dataset Statistics
{
"Total size": "~542 MB",
"Number of files": 383380,
"Number of files under 500 bytes": 3680,
"Average file size in bytes": 5942,
}
Curation Process
- Removal of duplication files based on file hash.
- Removal of file templates. File containing the following:
___FILENAME___, ___PACKAGENAME___, ___FILEBASENAME___, ___FILEHEADER___, ___VARIABLE - Removal of the files containing the following words in the first 10 lines:
generated, auto-generated", "autogenerated", "automatically generated - Removal of the files containing the following words in the first 10 lines with a probability of 0.7:
test", "unit test", "config", "XCTest", "JUnit - Removal of file with the rate of alphanumeric characters below 0.3 of the file.
- Removal of near duplication based MinHash and Jaccard similarity.
- Removal of files with mean line length above 100.
- Removal of files without mention of keywords with a probability of 0.7:
struct ", "class ", "for ", "while ", "enum ", "func ", "typealias ", "var ", "let ", "protocol ", "public ", "private ", "internal ", "import " - Removal of files that use the assignment operator
=less than 3 times. - Removal of files with the ratio between the number of characters and number of tokens after tokenization lower than 1.5.
Curation process is a derivation of the one used in CodeParrot project: https://huggingface.co/codeparrot
Data Splits
The dataset only contains a train split which is separated into train and valid which can be found here:
- Clean Version Train: https://huggingface.co/datasets/mvasiliniuc/iva-swift-codeint-clean-train
- Clean Version Valid: https://huggingface.co/datasets/mvasiliniuc/iva-swift-codeint-clean-valid
Considerations for Using the Data
The dataset comprises source code from various repositories, potentially containing harmful or biased code, along with sensitive information such as passwords or usernames.
- Downloads last month
- 15