Dataset Viewer
Auto-converted to Parquet Duplicate
text
string
source
string
n=int(input()) a=list() for i in range(n): a.append('0') print (a) def gray(i): if(i==n-1): print("".join(a)) a[i]='1' if(a[i]=='0')else('0') print("".join(a)) return c=1 while (c<=2): gray(i+1) if(c!=2): a[i]='1' if(a[i]=='0')else('0') c+=1 gray(0)
code
from car import Car import math import numpy as np import random import shared as g class BufferBuilder(Car): def __init__(self, sim, lane, speed, maxspeed, id, carAhead, carUpAhead, carDownAhead, laneidx, size, canvasheight, lanes, slowdown): super(BufferBuilder, self).__init__(sim, lane...
code
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import math import torch class Search(object): def __init__(self, vocab_size, pad, unk, eos): self.pad = pad self.unk ...
code
#!/usr/bin/env python # coding=utf-8 """ @desc: @author: Luo.lu @date: 2019-07-10 """ class Solution(object): def wordBreak(self, s, wordDict): """ :type s: str :type wordDict: List[str] :rtype: List[str] """ # 借助139,判断是否存在可分的情况,否则特例可能会超时 if not s: ...
code
import os import sys import json import matplotlib.pyplot as plt import pandas as pd def test_plot(): test_reses = [] for i in range(10): res_path = './RESULTS/zoom20_rr%d/' % i test_file = os.path.join(res_path, 'test.json') with open(test_file, 'r') as f: test_res = json...
code
""" Description ----------- This module defines the :obj:`ParaMol.Force_field.force_field.ForceField` class which is the ParaMol representation of a force field that contains all the information about the force field terms and correspondent parameters (even relatively to those that will not enter the optimization). """...
code
# search any element in a html page from selenium import webdriver browser = webdriver.Firefox() type(browser) browser.get('https://gabrielecirulli.github.io/2048/') try: elem = browser.find_element_by_class_name('game-explanation') print('found <%s> element with this class name!' %(elem.tag_name)) except: prin...
code
class Solution: def isPowerOfTwo(self, n: int) -> bool: #方法2 # 若 x 为 2 的幂,则它的二进制表示中只包含一个 1,则有 x & (-x) = x; # 若x 不是2 的幂,则它的二进制中不止一个1,则有x &(-x) !=x #时间复杂度:O(1) #空间复杂度:O(1) #if n==0: # return False #return n&(-n)==n #方法1 #去除二进制中最右边的 1...
code
""" Metaprogramming """ from collections import namedtuple class ParamsRegistry(type): def __init__(cls, name, bases, namespace): super(ParamsRegistry, cls).__init__(name, bases, namespace) if not hasattr(cls, 'registry'): cls.registry = set() cls.registry.add(cls) cls.r...
code
# test cases: # cookie("Ryan") --> "Who ate the last cookie? It was Zach!" # cookie(26) --> "Who ate the last cookie? It was Monica!" # cookie(2.3) --> "Who ate the last cookie? It was Monica!" # cookie(true) --> "Who ate the last cookie? It was the dog!" def cookie(x): if type(x) is str: return "Who ate...
code
# -*- coding: utf-8 -*- """ Created on Mon Sep 9 10:01:24 2019 @author: ADMIN """ from sklearn.cluster import KMeans #from sklearn import metrics import numpy as np import matplotlib.pyplot as plt import pandas as pd data=pd.read_csv("km1.csv") df1=pd.DataFrame(data) print(df1) f1=df1['Distance_Featur...
code
#!/user/bin/env python # coding=utf-8 import traceback class func(object): def __enter__(self): # raise Exception("haha") pass def __exit__(self, type, value, trace): print type print value print trace print traceback.format_exc(trace) # return True ...
code
''' @Author: Shuai Wang @Github: https://github.com/wsustcid @Version: 1.0.0 @Date: 2020-03-26 11:45:38 @LastEditTime: 2020-04-02 11:26:00 ''' import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np # Read in the image image = mpimg.imread('lane.jpg') print('This image is: ',...
code
import numpy as np import numpy.linalg as alg l1 = [] rows = int(input("enter rows:")) cols = int(input("enter cols:")) for i in range(rows): for j in range(cols): l1.append(int(input())) print(l1) m = np.reshape(l1, (rows, cols)) print(m) Values, Vectors = alg.eig(m) print(Values) print(Vectors[:, 0]) prin...
code
# -*- coding: utf-8 -*- ## 时间: 2015-02-13 ## 跟新内容: ## 增加URL请求时间计算 ## 时间: 2015-04-01 ## 跟新内容: ## 将指定的测试文件名写入配置文件中,同时增加一个获取当前路径的类 ## import urllib.request import urllib.parse import urllib.error from pathlib import Path import json import io import sys import traceback import os import os.path import time import ...
code
number = int(input(" Please Enter any Positive Integer : ")) if((number % 5 == 0) and (number % 11 == 0)): print("Given Number is Divisible by 5 and 11",number) else: print("Given Number is Not Divisible by 5 and 11",number)
code
matriz = [[], [], []] R = list(range(0, 3)) for c in R: for i in R: matriz[c].append(int(input(f'Digite um valor para[{c}, {i}]: '))) print('-' * 30) for d in R: print('(', end=' ') for j in r: print(f'[{matriz[d][j]:^5}]', end=' ') print(')')
code
"""Sources: dataset: https://archive.ics.uci.edu/ml/datasets/Statlog+%28German+Credit+Data%29 """ import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from sklearn import preprocessing from sklearn.model_selection import train_test_split from sklearn.pipeline import Pipeline from sklearn.compose i...
code
v = int(input()) i = 0 while i < v: n, m = input().split(" ") n = int(n) m = int(m) tam = n ** m tam = str(tam) tam = list(tam) print(len(tam)) i = i + 1
code
import maya.cmds as cmds import random import math import imp v = imp.load_source('v', '/lhome/kristina/Documents/code/maya/boids/vector_class.py') # maya python 2.7 weirdness width = 100 height = 100 depth = 100 # was 150 class Particle(v.vec3): ''' Class defining a single particle. ''' def __init_...
code
# -*- coding: utf-8 -*- """ Created on Fri Jan 27 11:18:36 2017 @author: roger """ import numpy as np import itertools as itt import matplotlib.pyplot as plt from numpy import random as rand def proj_basis(d,D): #Projects the basis of a D-dim space to a d-dim space W=rand.normal(0,1/d,(d,D)) #Generate a rando...
code
import sublime, sublime_plugin class keymapperCommand(sublime_plugin.TextCommand,sublime_plugin.WindowCommand): """Key Mapper, sadly you still have to define all the keymaps in your .sublime-keymap just point them all here that you want to be able to map around. this subclasses both TextCommand and Windo...
code
# adapted from https://www.kaggle.com/dan3dewey/santa-s-simple-scheduler import numpy as np import matplotlib.pyplot as plt import pandas as pd from santaspkg.cost_function import soft_cost_function as cost_function from santaspkg.refinement import refinement_pass, refine_until_convergence from santaspkg.dataset impor...
code
#! python3 # _*_ coding: utf-8 _*_ from colorama import init, Fore init(autoreset=False) class Colored: # 前景色:红色 背景色:默认 def red(self, s): return Fore.LIGHTRED_EX + s + Fore.RESET # 前景色:绿色 背景色:默认 def green(self, s): return Fore.LIGHTGREEN_EX + s + Fore.RESET # 前景色:黄色 背景色:默...
code
from textblob import TextBlob lst=[] with open('Adverb.txt','r') as f: for i in f.readlines(): word=i.strip('\n') text=TextBlob(word) print(word,text.sentiment.polarity)
code
#!/usr/bin/env python import sys list1=[] for line in sys.stdin: line=line.strip() words=line.split("\n") list1.append(words[0]) for x in xrange(len(list1)): print list1[x]
code
# Lucas de Jesus Silva - 20731356 - atividade 2 PLP - Estruturado #================================================================================================= # método para determinar vencedor do levantamento de pesos def levantamentoPeso (x,y): vencedor = "" if x["peso"] > y["peso"]: vencedor = x["no...
code
# Import import pygame # Initialize game engine pygame.init() # Open window window_size = (640, 480) screen = pygame.display.set_mode(window_size) pygame.display.set_caption("The Quest") WHITE = (255, 255, 255) RED = (255, 0, 0) done = False clock = pygame.time.Clock() # MAIN GAME LOOP whil...
code
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2019/7/29 18:56 # @Site : # @File : qianxu_144.py # @Software: PyCharm # Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None #前序 class Solution(o...
code
import pandas as pd import spacy from spacy.kb import KnowledgeBase def entities_info(path): entity_info = dict() with open(path, 'r', encoding='utf8') as infile: for line in infile: row = line.split('\t') entity_info[row[0]] = dict() entity_info[row[0]]['name'] = r...
code
def process_text(filename): """Makes histogram of text""" d = dict() fp = open(filename, 'r') for line in fp: for word in line.split(): while not (word == '' or word[0].isalpha() or word[0].isdigit()): word = word[1:] while not (word == '' or word[-1].isalpha() or word[-1].isdigit()): word = word[0...
code
from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement from collections import deque,defaultdict,Counter from bisect import bisect_left,bisect_right from operator impor...
code
size = int(input("Enter no. of items you want to add: ")) array = [] for n in range(size): m = n + 1 array.insert(n, int(input("Enter item no. %d: " % m))) max_val = 0 pair = [] for n in range(size-1): for m in range(n+1, size): val = array[n] * array[m] if val > max_val: max_val...
code
import md5 import base64 import string b64_str='./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' final_str="" def b64_from_24bit(a, b ,c ,d): global final_str w = (ord(a)<<16)|(ord(b)<<8)|ord(c) for i in range(0, d): final_str+=b64_str[w & 0x3f] w = w >> 6 m=md5.new('chfT...
code
import os,magic import re from genericpath import isdir, isfile from flask import Flask,send_file,render_template,request def show_dir(pwd): files = os.listdir(pwd) return render_template("index.html",files = files,pwd = pwd) def send_to_client(pwd): path = pwd[:-1] return send_file(path,as_attac...
code
from pyspark.sql import SparkSession from pyspark.sql.functions import UserDefinedFunction from pyspark.sql.functions import collect_set, array_contains, col, max, mean, desc, sum from pyspark.sql.types import ArrayType import os os.environ["PYSPARK_PYTHON"] = "/home/pawel/PycharmProjects/HPC/venv/bin/python3.5" os.en...
code
#Number guessing program from random import randint a=(randint(0, 50)) print(a) inp=int(input(("Enter the value"))) while(1==1): if(inp>a): print('Your Guess is above the number please inputcorrectly') inp=int(input(("continue the game"))) elif(inp<a): print('Your Guess is below the number please...
code
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: 3ngthrust """ import os import gpiozero import functools import time from MCP3002 import MCP3002 def split_into_equal_sublists(a_list, number_of_parts): """ Splits a list into a list of sublists Arguments ---------- a_list : list object ...
code
# ex23 def compare(x, y): if x > y: return x elif y > x: return y else: raise Exception("Numbers are equal") def three_multiple(x): if x % 3 == 0: return True else: return False def power(a, n): return a ** n
code
from random import uniform from sys import argv from math import log from matplotlib import pyplot as plt counter = 0 Lambda=[] n=int(argv[1]) for i in range(int(argv[2])): Lambda.append(float(argv[i+3])) for l in Lambda: dist=[] for i in range(1,n+1): u = uniform(0,1) x_i = -1*log(1-u)/l ...
code
#! /usr/bin/env python3 # Copyright 2020 Desh Raj # Apache 2.0. """This script takes an input RTTM and transforms it in a particular way: all overlapping segments are re-labeled as "overlap". This is useful for 2 cases: 1. By retaining just the overlap segments (grep overlap), the resulting RTTM can be used to t...
code
# https://www.urionlinejudge.com.br/judge/pt/problems/view/1168 n = int(input()) for i in range(0,n): v = input() total = 0 for digito in v: if digito == '0': total += 6 elif digito == '1': total += 2 elif digito == '2': total += 5 elif digito == '3': total += 5 elif digito == '4': total +...
code
input_int = list(input()) for index in range(int(len(input_int) / 2)): temp = input_int[index] input_int[index] = input_int[-index - 1] input_int[-index - 1] = temp print(''.join(input_int))
code
from time import sleep from decouple import config from bot import Near from bot import Twitter if __name__ == '__main__': near = Near() twitter = Twitter() CURRENCY = config('CURRENCY_TO_CONVERT') TEXT_LAST_24_HRS = config('TEXT_LAST_24_HRS') sleep_time = 86400 / int(config('TWEETS_PER_DAY')) ...
code
import matplotlib.pyplot as plt import numpy as np import random from matplotlib.backends.backend_pdf import PdfPages from scipy import stats import math from scipy.special import factorial from scipy.optimize import curve_fit def poisson(k,lamb): return (lamb**k/factorial(k)) * np.exp(-lamb) if __name__ == "__ma...
code
from __future__ import division, print_function, absolute_import import numpy as np from ..util import img_as_ubyte, crop from ._skeletonize_3d_cy import _compute_thin_image def skeletonize_3d(img): """Compute the skeleton of a binary image. Thinning is used to reduce each connected component in a binary im...
code
def format_duration(seconds): if seconds==0: return "now" year = seconds // 31536000 yearDay = seconds % 31536000 day = yearDay // 86400 dayHour = yearDay % 86400 hour = dayHour // 3600 hourMinute = dayHour % 3600 minute = hourMinute // 60 second = hourMinute % 60 res = [...
code
import math class TreasureAngleToWorldmapPositionConverter: def __init__(self, table_calibration_service, treasure_angles, robot): self.table_calibration_service = table_calibration_service self.treasure_angles = treasure_angles self.robot_angle = robot.get_angle() self.robot_posit...
code
import sys # d = {'a': 'Maman', 'b': 'Papa', 'c':'Grand Father', 'd': 'Grand Mother', 'e': 'Son', 'f': 'Daughter'} # for k in sorted(d.keys()): # print('Key '+k.upper()+' -> '+d[k]) # print(d.items()[0]) def File(filename): f = open(filename, 'rU') for line in f: a = line.split() ...
code
import math # Anterior e Sucessor num = int(input('Digita um número aí: ')) ant = num - 1 suc = num + 1 print('O número antes de {} é {} e o depois dele é {}'.format(num, ant, suc)) # Dobro, Triplo e Raiz quadrada n = int(input('Manda um número: ')) d = n * 2 t = n * 3 r = math.sqrt(n) # print('O dobro de {} é {}'...
code
# Definition for an interval. class Interval: def __init__(self, s=0, e=0): self.start = s self.end = e class Solution: def merge(self, intervals): """ :type intervals: List[Interval] :rtype: List[Interval] """ intervals = intervals[:] #Always thi...
code
def check(lista): return sum(lista) == len(lista) def convert(string): return [True if i=='+' else False for i in string] def invert(lis): return [not i for i in lis] def fun(string,n): lista = convert(string) count = 0 for i in range(len(lista)-n+1): if not lista[i]: ...
code
# -*- coding: utf-8 -*- # Define here the models for your scraped items # # See documentation in: # https://doc.scrapy.org/en/latest/topics/items.html import scrapy from scrapy.loader import ItemLoader from scrapy.loader.processors import TakeFirst, MapCompose import re from w3lib.html import remove_tags # 这个模块专门用来去...
code
#!/usr/bin/python3 """Task 6""" from flask import Flask from flask import render_template from models import storage from models.state import State from models.city import City app = Flask(__name__) @app.route('/states', strict_slashes=False) def states(): """Function that return states""" states = storage.a...
code
greeting = "Hello" name = "Michael" message = f"{greeting}, {name}. Welcome!" print(message)
code
# Importing the required libraries import pandas as pd import lightkurve as lk import matplotlib.pyplot as plt import os, shutil import numpy as np from scipy.stats import skew from scipy.stats import kurtosis from tqdm import tqdm import warnings import seaborn as sns os.chdir('..') tqdm.pandas(desc="Progress: ") war...
code
import sys import cProfile def brute(arg): return reduce(lambda x, y: x + int(y), str(2**arg), 0) if __name__ == "__main__": arg = int(sys.argv[1]) def main(): print brute(arg) cProfile.run('main()')
code
_employeeName = input() fixedSalary = float(input()) salesBonus = float(input()) print(f"TOTAL = R$ {fixedSalary + (salesBonus * 0.15):.2f}")
code
import os import torch import torch.utils.data as data from datasets.datahelpers import default_loader class DigitsDataset(data.Dataset): """Digits dataset.""" def __init__(self, mode, data_root, transform=None, loader=default_loader): if not (mode == 'train' or mode == 'dev'): raise(Runt...
code
# # @lc app=leetcode.cn id=884 lang=python3 # # [884] 两句话中的不常见单词 # # @lc code=start class Solution: def uncommonFromSentences(self, A: str, B: str) -> List[str]: from collections import Counter ac = Counter(A.split()) bc = Counter(B.split()) answer = [] for k in ac....
code
End of preview. Expand in Data Studio

pretrain-mix-150b

A high-quality, 150-billion-token pre-training dataset meticulously curated for large language model research and development.

This dataset is a strategic mix of high-quality educational web text, comprehensive mathematical documents, and a diverse collection of source code, designed to foster strong reasoning and multi-domain capabilities in pre-trained models.

Dataset Composition


Dataset Overview

The pretrain-mix-150b dataset was created to provide a robust and balanced foundation for training novel language model architectures. The total dataset comprises approximately 130 million documents, amounting to ~150 billion tokens.

The curation process involved sourcing from three best-in-class, publicly available datasets and mixing them according to a specific ratio to ensure a balanced diet of general knowledge, logical reasoning, and programming syntax.

The composition was programmatically verified after creation:

Source Document Count Percentage Description
Web (FineWeb-Edu) 87,570,000 67.3% High-quality educational web content.
Code (Stack-Edu) 23,560,000 18.1% Curated source code from GitHub.
Math (FineMath) 18,900,000 14.5% Mathematical reasoning & problem-solving.
Total 130,030,000 100.0%

Why This Dataset?

While many large-scale datasets exist, pretrain-mix-150b was created with a specific philosophy in mind:

  • Balanced Diet for Models: Avoids over-indexing on generic web text by including substantial, high-quality code and math corpora.
  • Reproducibility: The entire creation process was scripted, and the composition is fully transparent.
  • Efficiency: The data is provided in the highly-efficient Parquet format, ready for large-scale training pipelines.

This dataset is ideal for researchers and engineers looking to pre-train foundation models from scratch, especially those with novel architectures (like Mixture-of-Experts) that can benefit from specialized data sources.

How to Use

The dataset is structured with a data/ directory containing 2,601 Parquet files. You can easily load it using the 🤗 datasets library.

It is highly recommended to use streaming=True to avoid downloading the entire dataset at once.

from datasets import load_dataset

# Load the dataset in streaming mode
# The 'data_files' argument points to all Parquet files in the 'data' directory
repo_id = "meryyllebr543/pretrain-mix-150b"
dataset = load_dataset(repo_id, data_files="data/*.parquet", split="train", streaming=True)

# You can then iterate over the dataset
print("First example from the dataset:")
example = next(iter(dataset))
print(example)

# {'text': '...', 'source': 'web'}

Dataset Schema

Each row in the dataset has a simple, uniform schema:

  • text (string): The main content of the document.
  • source (string): The origin of the document. Can be one of web, math, or code. This is useful for analyzing model performance on different domains.

Data Sources

This dataset is a mix of the following excellent open-source projects. Please refer to their original dataset cards for more information on their respective curation processes.

Author

This dataset was curated and processed by Francisco Antonio.

This project is part of ongoing independent research into novel AI architectures.

License

The dataset is released under the Apache 2.0 License. Please be aware that the underlying data sources may have their own licenses and terms of use. It is the user's responsibility to adhere to them. ```

Downloads last month
39