Dataset Viewer
Auto-converted to Parquet Duplicate
code
stringlengths
1
1.05M
repo_name
stringlengths
6
83
path
stringlengths
3
242
language
stringclasses
222 values
license
stringclasses
20 values
size
int64
1
1.05M
#!/bin/sh # defines variable git=`ls -d */` && path=`pwd` && gitpath=$path/$git # git pull cd $gitpath && git pull && sh init.sh \ && now=`git log -1 --format="%at"` \ && last=`cat $path/last` # check timestamp, if changed print git log if [ ! $last ] || [ $now -gt $last ] ; then echo "git changed!!" && echo $now>...
00fly/git-auto-push
all-in-one-cron-push.sh
Shell
apache-2.0
546
#!/bin/bash cp all-in-one-cron*.sh .. dos2unix ../*.sh && chmod +x ../*.sh
00fly/git-auto-push
init.sh
Shell
apache-2.0
76
#!/bin/sh # defines variable git=`ls -d */` && path=`pwd` && gitpath=$path/$git # git pull cd $gitpath && git pull \ && now=`git log -1 --format="%at"` \ && last=`cat $path/last` # check timestamp, if changed print git log if [ ! $last ] || [ $now -gt $last ] ; then echo "git changed!!" && echo $now>$path/last && e...
00fly/git-auto-push
run.sh
Shell
apache-2.0
369
QT += core gui network greaterThan(QT_MAJOR_VERSION, 4): QT += widgets CONFIG += c++11 # The following define makes your compiler emit warnings if you use # any Qt feature that has been marked deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated API in...
2201_75373101/CloudFileManagementSystem
Client/Client.pro
QMake
unknown
1,330
#include "chat.h" #include "protocol.h" #include "ui_chat.h" #include "client.h" Chat::Chat(QWidget *parent) : QWidget(parent), ui(new Ui::Chat) { ui->setupUi(this); setAttribute(Qt::WA_QuitOnClose, false); } Chat::~Chat() { delete ui; } void Chat::updateShowContent(QString strMsg) { ui->show...
2201_75373101/CloudFileManagementSystem
Client/chat.cpp
C++
unknown
920
#ifndef CHAT_H #define CHAT_H #include <QWidget> namespace Ui { class Chat; } class Chat : public QWidget { Q_OBJECT public: explicit Chat(QWidget *parent = nullptr); ~Chat(); QString m_strChatName; void updateShowContent(QString strMsg); void setChatName(QString strName); private slots: ...
2201_75373101/CloudFileManagementSystem
Client/chat.h
C++
unknown
400
#include <QFile> #include <QDebug> #include <QHostAddress> #include <QMessageBox> #include "client.h" #include "protocol.h" #include "ui_client.h" #include "index.h" Client::Client(QWidget *parent): QWidget(parent), ui(new Ui::Client) { ui->setupUi(this); rh = new ResHandler(); loadConfig(); //加载配置 co...
2201_75373101/CloudFileManagementSystem
Client/client.cpp
C++
unknown
4,954
#ifndef CLIENT_H #define CLIENT_H #include <QWidget> #include <QTcpSocket> #include "protocol.h" #include "index.h" #include "reshandler.h" QT_BEGIN_NAMESPACE namespace Ui { class Client; } QT_END_NAMESPACE class Client : public QWidget { Q_OBJECT public: ~Client(); static Client& getInstance(); // 单...
2201_75373101/CloudFileManagementSystem
Client/client.h
C++
unknown
1,326
#include "client.h" #include "file.h" #include "ui_file.h" #include <QInputDialog> #include <QMessageBox> File::File(QWidget *parent) : QWidget(parent), ui(new Ui::File) { ui->setupUi(this); m_strUserPath = QString("%1/%2").arg(Client::getInstance().getRootPath()).arg(Client::getInstance().m_strLoginName); ...
2201_75373101/CloudFileManagementSystem
Client/file.cpp
C++
unknown
987
#ifndef FILE_H #define FILE_H #include <QWidget> namespace Ui { class File; } class File : public QWidget { Q_OBJECT public: explicit File(QWidget *parent = nullptr); ~File(); QString m_strUserPath; QString m_strCurPath ; private slots: void on_mkdir_PB_clicked(); private: Ui::File *u...
2201_75373101/CloudFileManagementSystem
Client/file.h
C++
unknown
344
#include "friend.h" #include "protocol.h" #include "ui_friend.h" #include "client.h" #include <QInputDialog> #include <QMessageBox> Friend::Friend(QWidget *parent) : QWidget(parent), ui(new Ui::Friend) { ui->setupUi(this); m_pOnlineUser = new OnlineUser; m_pChat = new Chat; flushFriend(); } Friend::~...
2201_75373101/CloudFileManagementSystem
Client/friend.cpp
C++
unknown
2,265
#ifndef FRIEND_H #define FRIEND_H #include <QWidget> #include "onlineuser.h" #include "chat.h" namespace Ui { class Friend; } class Friend : public QWidget { Q_OBJECT public: explicit Friend(QWidget *parent = nullptr); ~Friend(); OnlineUser* getOnlineUser(); void flushFriend(); void updateF...
2201_75373101/CloudFileManagementSystem
Client/friend.h
C++
unknown
663
#include "index.h" #include "ui_index.h" Index::Index(QWidget *parent) : QWidget(parent), ui(new Ui::Index) { ui->setupUi(this); } Index::~Index() { delete ui; } Index& Index::getInstance() { static Index instance; return instance; } Friend *Index::getFriend() { return ui->friendPage; } Fil...
2201_75373101/CloudFileManagementSystem
Client/index.cpp
C++
unknown
979
#ifndef INDEX_H #define INDEX_H #include <QWidget> #include "friend.h" #include "file.h" namespace Ui { class Index; } class Index : public QWidget { Q_OBJECT public: ~Index(); static Index& getInstance(); Friend* getFriend(); File * getFile (); private slots: void on_friend_PB_clicked()...
2201_75373101/CloudFileManagementSystem
Client/index.h
C++
unknown
452
#include "client.h" #include "protocol.h" #include "index.h" #include <QApplication> int main(int argc, char *argv[]) { QApplication a(argc, argv); Client::getInstance().show(); return a.exec(); }
2201_75373101/CloudFileManagementSystem
Client/main.cpp
C++
unknown
211
#include "client.h" #include "onlineuser.h" #include "ui_onlineuser.h" OnlineUser::OnlineUser(QWidget *parent) : QWidget(parent), ui(new Ui::OnlineUser) { ui->setupUi(this); setAttribute(Qt::WA_QuitOnClose, false); } OnlineUser::~OnlineUser() { delete ui; } void OnlineUser::updateOnlineUserWigetL...
2201_75373101/CloudFileManagementSystem
Client/onlineuser.cpp
C++
unknown
845
#ifndef ONLINEUSER_H #define ONLINEUSER_H #include <QListWidget> #include <QWidget> namespace Ui { class OnlineUser; } class OnlineUser : public QWidget { Q_OBJECT public: explicit OnlineUser(QWidget *parent = nullptr); ~OnlineUser(); void updateOnlineUserWigetList(QStringList& userlist); private s...
2201_75373101/CloudFileManagementSystem
Client/onlineuser.h
C++
unknown
455
#include "protocol.h" #include <stdlib.h> PDU *mkPDU(uint uiMsgType, uint uiMsgLen) { PDU* pdu = (PDU*)malloc(sizeof (PDU) + uiMsgLen); if(pdu == NULL){ //判断是否成功分配内存 exit(1); } pdu->uiMsgLen = uiMsgLen; pdu->uiPDULen = uiMsgLen + sizeof(PDU); pdu->uiMsgType = uiMsgType; return pd...
2201_75373101/CloudFileManagementSystem
Client/protocol.cpp
C++
unknown
345
#ifndef PROTOCOL_H #define PROTOCOL_H typedef unsigned int uint; enum ENUM_MSG_TYPE{ // 消息类型 ENUM_MSG_TYPE_MIN = 0, ENUM_MSG_TYPE_REGIST_REQUEST, // 注册请求 ENUM_MSG_TYPE_REGIST_RESPOND, // 注册应答 ENUM_MSG_TYPE_LOGIN_REQUEST , // 登录请求 ENUM_MSG_TYPE_LOGIN_RESPOND , // 登录应答 ENUM_MSG_TYPE_FIND_USER_...
2201_75373101/CloudFileManagementSystem
Client/protocol.h
C
unknown
1,649
#include <QMessageBox> #include "index.h" #include "reshandler.h" #include "client.h" ResHandler::ResHandler(QObject *parent) : QObject(parent) { } ResHandler::~ResHandler() { // delete pdu; } void ResHandler::regist() { bool ret; memcpy(&ret, pdu->caData, sizeof(bool)); if(ret) { QMessa...
2201_75373101/CloudFileManagementSystem
Client/reshandler.cpp
C++
unknown
4,932
#ifndef RESHANDLER_H #define RESHANDLER_H #include <QObject> #include "protocol.h" class ResHandler : public QObject { Q_OBJECT public: explicit ResHandler(QObject *parent = nullptr); ~ResHandler(); PDU* pdu; void regist(); void login(); void findUser(); void onlineUser(QString login...
2201_75373101/CloudFileManagementSystem
Client/reshandler.h
C++
unknown
531
QT += core gui network sql greaterThan(QT_MAJOR_VERSION, 4): QT += widgets CONFIG += c++11 # The following define makes your compiler emit warnings if you use # any Qt feature that has been marked deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated AP...
2201_75373101/CloudFileManagementSystem
Server/Server.pro
QMake
unknown
1,219
#include "server.h" #include <QApplication> #include "operatedb.h" int main(int argc, char *argv[]) { QApplication a(argc, argv); OperateDB::getInstance().connect(); Server::getInstance(); // w.show(); return a.exec(); }
2201_75373101/CloudFileManagementSystem
Server/main.cpp
C++
unknown
242
#include "mytcpserver.h" #include "mytcpsocket.h" MyTcpServer &MyTcpServer::getInstance() { static MyTcpServer instance; return instance; } void MyTcpServer::incomingConnection(qintptr handle) { qDebug() << "新的客户端连接"; // 每一个新的客户端连接都其tcpSocket将存入的列表中 MyTcpSocket* pTcpSocket = new MyTcpSocket; p...
2201_75373101/CloudFileManagementSystem
Server/mytcpserver.cpp
C++
unknown
1,639
#ifndef MYTCPSERVER_H #define MYTCPSERVER_H #include "mytcpsocket.h" #include <QObject> #include <QTcpServer> class MyTcpServer : public QTcpServer { Q_OBJECT public: // 返回单例模式下的静态实例 static MyTcpServer& getInstance(); void incomingConnection(qintptr handle); void resend(char* tarName, PDU* pdu);...
2201_75373101/CloudFileManagementSystem
Server/mytcpserver.h
C++
unknown
675
#include <QString> #include "mytcpsocket.h" #include "protocol.h" #include "operatedb.h" #include "mytcpserver.h" MyTcpSocket::MyTcpSocket() { rh = new ReqHandler(); connect(this, &QTcpSocket::readyRead , this, &MyTcpSocket::recvMsg ); connect(this, &QTcpSocket::disconnected, this, &MyTcpSocket::cl...
2201_75373101/CloudFileManagementSystem
Server/mytcpsocket.cpp
C++
unknown
3,549
#ifndef MYTCPSOCKET_H #define MYTCPSOCKET_H #include "protocol.h" #include "reqhandler.h" #include <QObject> #include <QTcpSocket> class MyTcpSocket : public QTcpSocket { Q_OBJECT public: MyTcpSocket(); ~MyTcpSocket(); // 发送消息 void sendMsg(PDU* pdu); PDU* readPDU(); PDU* handleReq(PDU* pd...
2201_75373101/CloudFileManagementSystem
Server/mytcpsocket.h
C++
unknown
539
#include "operatedb.h" #include <QDebug> #include <QSqlError> #include <QSqlQuery> OperateDB &OperateDB::getInstance() { static OperateDB instance; return instance; } OperateDB::OperateDB(QObject *parent) : QObject(parent) { m_db = QSqlDatabase::addDatabase("QMYSQL"); } // 连接数据库 void OperateDB::connect()...
2201_75373101/CloudFileManagementSystem
Server/operatedb.cpp
C++
unknown
7,215
#ifndef OPERATEDB_H #define OPERATEDB_H #include <QObject> #include <QSqlDatabase> class OperateDB : public QObject { Q_OBJECT public: QSqlDatabase m_db; //数据库对象 static OperateDB& getInstance(); // 连接数据库 void connect(); ~OperateDB(); bool handleResgist (const char* name, const char* pwd);...
2201_75373101/CloudFileManagementSystem
Server/operatedb.h
C++
unknown
1,318
#include "protocol.h" #include <stdlib.h> #include <string.h> PDU *mkPDU(uint uiMsgType, uint uiMsgLen) { PDU* pdu = (PDU*)malloc(sizeof (PDU) + uiMsgLen); if(pdu == NULL) { exit(1); } memset(pdu, 0, sizeof (PDU) + uiMsgLen); pdu->uiMsgLen = uiMsgLen; pdu->uiPDULen = uiMsgLen + s...
2201_75373101/CloudFileManagementSystem
Server/protocol.cpp
C++
unknown
382
#ifndef PROTOCOL_H #define PROTOCOL_H typedef unsigned int uint; enum ENUM_MSG_TYPE{ // 消息类型 ENUM_MSG_TYPE_MIN = 0, ENUM_MSG_TYPE_REGIST_REQUEST, // 注册请求 ENUM_MSG_TYPE_REGIST_RESPOND, // 注册应答 ENUM_MSG_TYPE_LOGIN_REQUEST , // 登录请求 ENUM_MSG_TYPE_LOGIN_RESPOND , // 登录应答 ENUM_MSG_TYPE_FIND_USE...
2201_75373101/CloudFileManagementSystem
Server/protocol.h
C
unknown
1,653
#include <QDebug> #include <QDir> #include "operatedb.h" #include "reqhandler.h" #include "mytcpserver.h" ReqHandler::ReqHandler(QObject *parent) : QObject(parent) { } PDU *ReqHandler::regist() { char caName[32] = { '\0' }; char caPwd [32] = { '\0' }; memcpy(caName, pdu->caData , 32); memcpy(caP...
2201_75373101/CloudFileManagementSystem
Server/reqhandler.cpp
C++
unknown
5,569
#ifndef REQHANDLER_H #define REQHANDLER_H #include <QObject> #include "protocol.h" #include "server.h" class ReqHandler : public QObject { Q_OBJECT public: PDU* pdu; explicit ReqHandler(QObject *parent = nullptr); PDU* regist (); PDU* login (QString &m_strLoginName); PDU* findUser (...
2201_75373101/CloudFileManagementSystem
Server/reqhandler.h
C++
unknown
539
#include "server.h" #include "ui_server.h" #include "mytcpserver.h" #include <QFile> #include <QDebug> #include <QHostAddress> Server::Server(QWidget *parent): QWidget(parent), ui(new Ui::Server) { ui->setupUi(this); loadConfig(); MyTcpServer::getInstance().listen(QHostAddress(m_strIP), m_usPORT); } Ser...
2201_75373101/CloudFileManagementSystem
Server/server.cpp
C++
unknown
1,122
#ifndef SERVER_H #define SERVER_H #include <QWidget> #include <QTcpSocket> QT_BEGIN_NAMESPACE namespace Ui { class Server; } QT_END_NAMESPACE class Server : public QWidget { Q_OBJECT public: ~Server(); void loadConfig(); // 加载配置 static Server& getInstance(); QString getRootRath(); private: ...
2201_75373101/CloudFileManagementSystem
Server/server.h
C++
unknown
530
End of preview. Expand in Data Studio

GitCode Code Dataset

Dataset Description

This dataset was compiled from code repositories hosted on GitCode, a code hosting platform in China backed by CSDN (China Software Developer Network). GitCode serves as a domestic alternative to GitHub, widely used by Chinese developers, students, and enterprises for hosting open-source projects and educational resources, making this dataset particularly valuable for training code models with Chinese language understanding and Chinese coding conventions.

Dataset Summary

Statistic Value
Total Files 48,142,567
Total Repositories 85,632
Total Size 40 GB (compressed Parquet)
Programming Languages 537
File Format Parquet with Zstd compression (34 files)

Key Features

  • Chinese code corpus: Contains code from over 85,000 repositories, many featuring Chinese comments, documentation, and variable names
  • Diverse language coverage: Spans 537 programming languages identified by go-enry (based on GitHub Linguist rules)
  • Rich metadata: Includes repository name, file path, detected language, license information, and file size
  • Open-source and educational projects: Includes code from individual developers, students, and Chinese enterprises
  • Quality filtered: Extensive filtering to remove vendor code, build artifacts, generated files, and low-quality content

Languages

The dataset includes 537 programming languages. The top 30 languages by file count:

Rank Language File Count
1 C++ 9,513,619
2 C 8,220,317
3 Java 5,362,924
4 Python 3,428,302
5 TypeScript 3,166,959
6 JavaScript 2,540,280
7 HTML 1,578,824
8 Kotlin 1,413,651
9 C# 1,232,638
10 Go 1,159,708
11 Rust 812,959
12 Dart 767,731
13 TSX 749,355
14 PHP 663,953
15 Shell 629,436
16 Vue 563,754
17 Makefile 471,588
18 CMake 460,428
19 CSS 381,628
20 Ruby 350,213
21 Objective-C 347,251
22 LLVM 297,591
23 Unix Assembly 291,826
24 Swift 206,725
25 Objective-C++ 160,526
26 Scala 157,367
27 QML 157,088
28 Lua 149,114
29 SCSS 141,661
30 GLSL 129,124

Licenses

The dataset includes files from repositories with various licenses. Repositories with restrictive licenses (CC-BY-ND variants, Commons Clause, SSPL) were excluded:

License File Count
unknown 23,567,463
apache-2.0 8,722,445
mit 7,743,613
gpl-2.0 3,528,526
agpl-3.0 2,300,580
lgpl 1,013,654
bsd-3-clause 528,980
gpl-3.0 305,332
public-domain 163,493
bsd-2-clause 94,426
bsd 69,967
isc 36,117
unlicense 28,411
cc0-1.0 26,799
mpl-2.0 9,459
Other licenses ~5,000

Dataset Structure

Data Fields

Field Type Description
code string Content of the source file (UTF-8 encoded)
repo_name string Name of the GitCode repository (format: username/repo)
path string Path of the file within the repository (relative to repo root)
language string Programming language as identified by go-enry
license string License of the repository (SPDX identifier or "unknown")
size int64 Size of the source file in bytes

Data Format

  • Format: Apache Parquet with Zstd compression
  • File Structure: 34 files (gitcode_0000.parquet to gitcode_0033.parquet)

Data Splits

All examples are in the train split. There is no validation or test split.

Example Data Point

{
    'code': '#!/bin/sh\n# defines variable\ngit=`ls -d */` && path=`pwd` && gitpath=$path/$git\n...',
    'repo_name': '00fly/git-auto-push',
    'path': 'all-in-one-cron-push.sh',
    'language': 'Shell',
    'license': 'apache-2.0',
    'size': 546
}

Dataset Creation

Pipeline Overview

The dataset was created through a multi-stage pipeline:

  1. User Discovery: Collecting usernames via GitCode API
  2. Repository Discovery: Fetching repository lists for each user via GitCode API
  3. Repository Cloning: Using Git partial clone with blob size filtering
  4. Content Extraction: Extracting and filtering source code files
  5. Parquet Generation: Writing filtered records to Parquet shards with Zstd compression

Language Detection

Programming languages are detected using go-enry, a Go port of GitHub's Linguist library. Only files classified as Programming or Markup language types are included (Data and Prose types are excluded).

License Detection

Licenses are detected by:

  1. Scanning for license files (LICENSE, LICENSE.txt, LICENSE.md, COPYING, etc.)
  2. Matching license text against known patterns (MIT, Apache 2.0, GPL variants, BSD, Creative Commons, etc.)
  3. Defaulting to "unknown" if no license can be detected

Blocked Licenses: The following restrictive licenses are excluded from the dataset:

  • cc-by-nd, cc-by-nd-2.0, cc-by-nd-3.0, cc-by-nd-4.0 (Creative Commons No-Derivatives)
  • commons-clause
  • sspl, sspl-1.0 (Server Side Public License)

File Filtering

Extensive filtering is applied to ensure data quality:

Size Limits

Limit Value
Max single file size 1 MB
Max line length 1,000 characters

Excluded Directories

  • Configuration: .git/, .github/, .gitlab/, .vscode/, .idea/
  • Vendor/Dependencies: node_modules/, vendor/, third_party/, bower_components/
  • Build Output: build/, dist/, out/, bin/, target/, __pycache__/, .next/, .nuxt/, coverage/, .nyc_output/

Excluded Files

  • Lock Files: package-lock.json, yarn.lock, pnpm-lock.yaml, Cargo.lock, go.sum, composer.lock, Gemfile.lock, poetry.lock, Pipfile.lock
  • Minified Files: Any file containing .min. in the name
  • Binary Files: .exe, .dll, .so, .dylib, .a, .o, .obj, .lib, .jar, .class, .pyc, .pyo, .wasm, .zip, .tar, .gz, .bz2, .7z, .rar, .png, .jpg, .jpeg, .gif, .bmp, .ico, .svg, .webp, .mp3, .mp4, .avi, .mov, .wav, .pdf, .doc, .docx, .xls, .xlsx, .ttf, .otf, .woff, .woff2, .eot

Content Filtering

  • UTF-8 Validation: Files must be valid UTF-8 encoded text
  • Binary Detection: Files detected as binary by go-enry are excluded
  • Generated Files: Files with generation markers in the first 500 bytes are excluded:
    • generated by, do not edit, auto-generated, autogenerated, automatically generated, @generated, <auto-generated, this file is generated
  • Empty Files: Files that are empty or contain only whitespace are excluded
  • Long Lines: Files with any line exceeding 1,000 characters are excluded
  • go-enry Filters: Additional filtering using go-enry's IsVendor(), IsImage(), IsDotFile(), and IsGenerated() functions
  • Documentation-only Repos: Repositories containing only documentation files (no actual code) are skipped

Source Data

All data originates from public repositories hosted on GitCode.

Considerations for Using the Data

Personal and Sensitive Information

The dataset may contain:

  • Email addresses in code comments or configuration files
  • API keys or credentials that were accidentally committed
  • Personal information in comments or documentation

Users should exercise caution and implement appropriate filtering when using this data.

Licensing Information

This dataset is a collection of source code from repositories with various licenses. Any use of all or part of the code gathered in this dataset must abide by the terms of the original licenses, including attribution clauses when relevant. The license field in each data point indicates the license of the source repository.

Downloads last month
1,862

Collection including nyuuzyou/gitcode-code