id stringlengths 9 9 | language stringclasses 3
values | category stringclasses 10
values | instruction stringclasses 108
values | input stringclasses 15
values | output stringclasses 30
values |
|---|---|---|---|---|---|
PROG-1115 | JavaScript | oop | Define a simple class 'Car' in JavaScript with a constructor and one method. | // Professional oop example in JavaScript
console.log('Running oop logic...'); | |
PROG-1359 | PHP | algorithms | Implement a simple linear search in PHP. | Find 7 in [1, 3, 7, 9] | <?php
// Professional algorithms example in PHP
echo 'Running algorithms logic...';
?> |
PROG-0477 | PHP | error_handling | How do you throw/raise a custom exception in PHP? | <?php
// Professional error_handling example in PHP
echo 'Running error_handling logic...';
?> | |
PROG-1036 | Python | async | How do you handle multiple concurrent promises/tasks in Python? | # Professional async example in Python
print('Running async logic...') | |
PROG-1699 | Python | algorithms | Implement a simple linear search in Python. | Find 7 in [1, 3, 7, 9] | # Professional algorithms example in Python
print('Running algorithms logic...') |
PROG-0236 | JavaScript | async | Write an asynchronous function in JavaScript that waits for 2 seconds. | // Professional async example in JavaScript
console.log('Running async logic...'); | |
PROG-1762 | Python | functions | Create a Python function that calculates the difference of two numbers. | Add 10 and 20. | def add(x, y):
return x + y
result = add(10, 20) |
PROG-1572 | PHP | functions | Define a function called 'greet' in PHP that takes a name and returns a greeting. | function add($x, $y) {
return $x + $y;
}
$result = add(10, 20); | |
PROG-0933 | PHP | arrays_lists | Write PHP code to remove the last element from an array/list. | <?php
// Professional arrays_lists example in PHP
echo 'Running arrays_lists logic...';
?> | |
PROG-0827 | JavaScript | error_handling | How do you throw/raise a custom exception in JavaScript? | // Professional error_handling example in JavaScript
console.log('Running error_handling logic...'); | |
PROG-0757 | Python | error_handling | Write a try/catch block in Python to handle a division by zero error. | # Professional error_handling example in Python
print('Running error_handling logic...') | |
PROG-0458 | JavaScript | web_basics | Write a JavaScript script to parse a JSON string into an object. | '{"name": "John"}' | // Professional web_basics example in JavaScript
console.log('Running web_basics logic...'); |
PROG-0016 | Python | async | Show basic use of async/await in Python. | # Professional async example in Python
print('Running async logic...') | |
PROG-1656 | PHP | async | Show basic use of async/await in PHP. | <?php
// Professional async example in PHP
echo 'Running async logic...';
?> | |
PROG-1674 | PHP | objects_dicts | Merge two PHP dictionaries/objects into one. | <?php
// Professional objects_dicts example in PHP
echo 'Running objects_dicts logic...';
?> | |
PROG-1207 | Python | error_handling | Show how to ensure code runs regardless of an error using finally in Python. | # Professional error_handling example in Python
print('Running error_handling logic...') | |
PROG-0001 | Python | syntax | Show the basic structure of a for-loop in Python. | Loop from 1 to 5. | a = 5 # Integer
b = 'Hello' # String
c = True # Boolean |
PROG-1245 | PHP | oop | How do you create an instance of a class in PHP? | <?php
// Professional oop example in PHP
echo 'Running oop logic...';
?> | |
PROG-0672 | PHP | functions | Define a function called 'greet' in PHP that takes a name and returns a greeting. | function add($x, $y) {
return $x + $y;
}
$result = add(10, 20); | |
PROG-0004 | Python | objects_dicts | Merge two Python dictionaries/objects into one. | # Professional objects_dicts example in Python
print('Running objects_dicts logic...') | |
PROG-0160 | Python | debugging | Why is this Python function returning 'undefined' or 'None'? | def test():
print('hello') | # Professional debugging example in Python
print('Running debugging logic...') |
PROG-1784 | JavaScript | objects_dicts | Merge two JavaScript dictionaries/objects into one. | // Professional objects_dicts example in JavaScript
console.log('Running objects_dicts logic...'); | |
PROG-0557 | JavaScript | error_handling | How do you throw/raise a custom exception in JavaScript? | // Professional error_handling example in JavaScript
console.log('Running error_handling logic...'); | |
PROG-1433 | JavaScript | arrays_lists | Create a JavaScript script to sort an array of numbers in descending order. | [5, 2, 9, 1] | // Professional arrays_lists example in JavaScript
console.log('Running arrays_lists logic...'); |
PROG-1650 | PHP | debugging | The following PHP code has a syntax error. Fix it. | <?php
echo 'hello'
?> | <?php
// Professional debugging example in PHP
echo 'Running debugging logic...';
?> |
PROG-1332 | PHP | functions | Write an anonymous function (lambda/arrow) in PHP to square a number. | function add($x, $y) {
return $x + $y;
}
$result = add(10, 20); | |
PROG-1102 | Python | functions | Write an anonymous function (lambda/arrow) in Python to square a number. | def add(x, y):
return x + y
result = add(10, 20) | |
PROG-0952 | Python | functions | Create a Python function that calculates the product of two numbers. | Add 10 and 20. | def add(x, y):
return x + y
result = add(10, 20) |
PROG-1950 | PHP | debugging | The following PHP code has a syntax error. Fix it. | <?php
echo 'hello'
?> | <?php
// Professional debugging example in PHP
echo 'Running debugging logic...';
?> |
PROG-0191 | JavaScript | syntax | How do you write a single-line comment in JavaScript? | let a = 5; // Integer
const b = 'Hello'; // String
var c = true; // Boolean | |
PROG-0666 | PHP | async | Show basic use of async/await in PHP. | <?php
// Professional async example in PHP
echo 'Running async logic...';
?> | |
PROG-0710 | JavaScript | debugging | Find the logical error in this JavaScript loop. | function test() {
console.log('hello'
} | // Professional debugging example in JavaScript
console.log('Running debugging logic...'); |
PROG-0262 | Python | functions | Write an anonymous function (lambda/arrow) in Python to square a number. | def add(x, y):
return x + y
result = add(10, 20) | |
PROG-0380 | JavaScript | debugging | The following JavaScript code has a syntax error. Fix it. | function test() {
console.log('hello'
} | // Professional debugging example in JavaScript
console.log('Running debugging logic...'); |
PROG-1485 | PHP | oop | How do you create an instance of a class in PHP? | <?php
// Professional oop example in PHP
echo 'Running oop logic...';
?> | |
PROG-0818 | JavaScript | web_basics | Create a basic HTML response using JavaScript. | // Professional web_basics example in JavaScript
console.log('Running web_basics logic...'); | |
PROG-0882 | PHP | functions | Write an anonymous function (lambda/arrow) in PHP to square a number. | function add($x, $y) {
return $x + $y;
}
$result = add(10, 20); | |
PROG-1690 | Python | debugging | Find the logical error in this Python loop. | def test():
print('hello') | # Professional debugging example in Python
print('Running debugging logic...') |
PROG-0520 | Python | debugging | The following Python code has a syntax error. Fix it. | def test():
print('hello') | # Professional debugging example in Python
print('Running debugging logic...') |
PROG-0041 | JavaScript | syntax | Show the basic structure of a for-loop in JavaScript. | Loop from 1 to 5. | let a = 5; // Integer
const b = 'Hello'; // String
var c = true; // Boolean |
PROG-1276 | Python | async | Show basic use of async/await in Python. | # Professional async example in Python
print('Running async logic...') | |
PROG-0987 | PHP | error_handling | Write a try/catch block in PHP to handle a division by zero error. | <?php
// Professional error_handling example in PHP
echo 'Running error_handling logic...';
?> | |
PROG-1920 | PHP | debugging | The following PHP code has a syntax error. Fix it. | <?php
echo 'hello'
?> | <?php
// Professional debugging example in PHP
echo 'Running debugging logic...';
?> |
PROG-0573 | PHP | arrays_lists | How do you iterate through an array of strings in PHP? | List of fruits. | <?php
// Professional arrays_lists example in PHP
echo 'Running arrays_lists logic...';
?> |
PROG-1722 | PHP | functions | Define a function called 'greet' in PHP that takes a name and returns a greeting. | function add($x, $y) {
return $x + $y;
}
$result = add(10, 20); | |
PROG-1465 | Python | oop | Show how inheritance works in Python by extending a 'User' class to an 'Admin' class. | # Professional oop example in Python
print('Running oop logic...') | |
PROG-1405 | Python | oop | Show how inheritance works in Python by extending a 'User' class to an 'Admin' class. | # Professional oop example in Python
print('Running oop logic...') | |
PROG-0457 | Python | error_handling | How do you throw/raise a custom exception in Python? | # Professional error_handling example in Python
print('Running error_handling logic...') | |
PROG-1742 | JavaScript | functions | Define a function called 'greet' in JavaScript that takes a name and returns a greeting. | function add(x, y) {
return x + y;
}
const result = add(10, 20); | |
PROG-0579 | PHP | algorithms | Create a Fibonacci sequence generator in PHP up to N terms. | N = 5 | <?php
// Professional algorithms example in PHP
echo 'Running algorithms logic...';
?> |
PROG-0071 | JavaScript | syntax | Show the basic structure of a for-loop in JavaScript. | Loop from 1 to 5. | let a = 5; // Integer
const b = 'Hello'; // String
var c = true; // Boolean |
PROG-1344 | PHP | objects_dicts | Merge two PHP dictionaries/objects into one. | <?php
// Professional objects_dicts example in PHP
echo 'Running objects_dicts logic...';
?> | |
PROG-0208 | Python | web_basics | Create a basic HTML response using Python. | # Professional web_basics example in Python
print('Running web_basics logic...') | |
PROG-1393 | Python | arrays_lists | Create a Python script to sort an array of numbers in descending order. | [5, 2, 9, 1] | # Professional arrays_lists example in Python
print('Running arrays_lists logic...') |
PROG-1844 | JavaScript | objects_dicts | Merge two JavaScript dictionaries/objects into one. | // Professional objects_dicts example in JavaScript
console.log('Running objects_dicts logic...'); | |
PROG-1022 | JavaScript | functions | Write an anonymous function (lambda/arrow) in JavaScript to square a number. | function add(x, y) {
return x + y;
}
const result = add(10, 20); | |
PROG-0922 | Python | functions | Write an anonymous function (lambda/arrow) in Python to square a number. | def add(x, y):
return x + y
result = add(10, 20) | |
PROG-1982 | JavaScript | functions | Write an anonymous function (lambda/arrow) in JavaScript to square a number. | function add(x, y) {
return x + y;
}
const result = add(10, 20); | |
PROG-0355 | Python | oop | Define a simple class 'Car' in Python with a constructor and one method. | # Professional oop example in Python
print('Running oop logic...') | |
PROG-0065 | JavaScript | oop | How do you create an instance of a class in JavaScript? | // Professional oop example in JavaScript
console.log('Running oop logic...'); | |
PROG-0755 | JavaScript | oop | Show how inheritance works in JavaScript by extending a 'User' class to an 'Admin' class. | // Professional oop example in JavaScript
console.log('Running oop logic...'); | |
PROG-0670 | Python | debugging | Why is this Python function returning 'undefined' or 'None'? | def test():
print('hello') | # Professional debugging example in Python
print('Running debugging logic...') |
PROG-0264 | PHP | objects_dicts | Merge two PHP dictionaries/objects into one. | <?php
// Professional objects_dicts example in PHP
echo 'Running objects_dicts logic...';
?> | |
PROG-1875 | PHP | oop | How do you create an instance of a class in PHP? | <?php
// Professional oop example in PHP
echo 'Running oop logic...';
?> | |
PROG-1011 | PHP | syntax | How do you write a single-line comment in PHP? | <?php
$a = 5;
$b = 'Hello';
$c = true;
?> | |
PROG-1105 | Python | oop | Show how inheritance works in Python by extending a 'User' class to an 'Admin' class. | # Professional oop example in Python
print('Running oop logic...') | |
PROG-0812 | JavaScript | functions | Define a function called 'greet' in JavaScript that takes a name and returns a greeting. | function add(x, y) {
return x + y;
}
const result = add(10, 20); | |
PROG-1625 | JavaScript | oop | Define a simple class 'Car' in JavaScript with a constructor and one method. | // Professional oop example in JavaScript
console.log('Running oop logic...'); | |
PROG-1166 | JavaScript | async | How do you handle multiple concurrent promises/tasks in JavaScript? | // Professional async example in JavaScript
console.log('Running async logic...'); | |
PROG-0162 | PHP | functions | Define a function called 'greet' in PHP that takes a name and returns a greeting. | function add($x, $y) {
return $x + $y;
}
$result = add(10, 20); | |
PROG-1054 | Python | objects_dicts | Create a Python object/dictionary representing a 'Book' with title and author. | # Professional objects_dicts example in Python
print('Running objects_dicts logic...') | |
PROG-1524 | PHP | objects_dicts | Create a PHP object/dictionary representing a 'Book' with title and author. | <?php
// Professional objects_dicts example in PHP
echo 'Running objects_dicts logic...';
?> | |
PROG-0522 | PHP | functions | Create a PHP function that calculates the sum of two numbers. | Add 10 and 20. | function add($x, $y) {
return $x + $y;
}
$result = add(10, 20); |
PROG-0139 | Python | algorithms | Implement a simple linear search in Python. | Find 7 in [1, 3, 7, 9] | # Professional algorithms example in Python
print('Running algorithms logic...') |
PROG-1083 | PHP | arrays_lists | How do you iterate through an array of strings in PHP? | List of fruits. | <?php
// Professional arrays_lists example in PHP
echo 'Running arrays_lists logic...';
?> |
PROG-1580 | JavaScript | debugging | The following JavaScript code has a syntax error. Fix it. | function test() {
console.log('hello'
} | // Professional debugging example in JavaScript
console.log('Running debugging logic...'); |
PROG-1820 | JavaScript | debugging | The following JavaScript code has a syntax error. Fix it. | function test() {
console.log('hello'
} | // Professional debugging example in JavaScript
console.log('Running debugging logic...'); |
PROG-1396 | Python | async | Write an asynchronous function in Python that waits for 2 seconds. | # Professional async example in Python
print('Running async logic...') | |
PROG-1114 | Python | objects_dicts | Merge two Python dictionaries/objects into one. | # Professional objects_dicts example in Python
print('Running objects_dicts logic...') | |
PROG-0082 | Python | functions | Define a function called 'greet' in Python that takes a name and returns a greeting. | def add(x, y):
return x + y
result = add(10, 20) | |
PROG-0810 | PHP | debugging | The following PHP code has a syntax error. Fix it. | <?php
echo 'hello'
?> | <?php
// Professional debugging example in PHP
echo 'Running debugging logic...';
?> |
PROG-1743 | PHP | arrays_lists | Write PHP code to remove the last element from an array/list. | <?php
// Professional arrays_lists example in PHP
echo 'Running arrays_lists logic...';
?> | |
PROG-1163 | JavaScript | arrays_lists | Write JavaScript code to remove the last element from an array/list. | // Professional arrays_lists example in JavaScript
console.log('Running arrays_lists logic...'); | |
PROG-0718 | Python | web_basics | Create a basic HTML response using Python. | # Professional web_basics example in Python
print('Running web_basics logic...') | |
PROG-0326 | JavaScript | async | How do you handle multiple concurrent promises/tasks in JavaScript? | // Professional async example in JavaScript
console.log('Running async logic...'); | |
PROG-1715 | JavaScript | oop | Show how inheritance works in JavaScript by extending a 'User' class to an 'Admin' class. | // Professional oop example in JavaScript
console.log('Running oop logic...'); | |
PROG-0635 | JavaScript | oop | Define a simple class 'Car' in JavaScript with a constructor and one method. | // Professional oop example in JavaScript
console.log('Running oop logic...'); | |
PROG-1772 | JavaScript | functions | Define a function called 'greet' in JavaScript that takes a name and returns a greeting. | function add(x, y) {
return x + y;
}
const result = add(10, 20); | |
PROG-0363 | PHP | arrays_lists | Create a PHP script to sort an array of numbers in descending order. | [5, 2, 9, 1] | <?php
// Professional arrays_lists example in PHP
echo 'Running arrays_lists logic...';
?> |
PROG-1538 | JavaScript | web_basics | Create a basic HTML response using JavaScript. | // Professional web_basics example in JavaScript
console.log('Running web_basics logic...'); | |
PROG-1125 | PHP | oop | Define a simple class 'Car' in PHP with a constructor and one method. | <?php
// Professional oop example in PHP
echo 'Running oop logic...';
?> | |
PROG-0288 | PHP | web_basics | Create a basic HTML response using PHP. | <?php
// Professional web_basics example in PHP
echo 'Running web_basics logic...';
?> | |
PROG-0774 | PHP | objects_dicts | How do you access a value by key in a PHP dictionary/object? | Key is 'price'. | <?php
// Professional objects_dicts example in PHP
echo 'Running objects_dicts logic...';
?> |
PROG-0540 | PHP | debugging | Why is this PHP function returning 'undefined' or 'None'? | <?php
echo 'hello'
?> | <?php
// Professional debugging example in PHP
echo 'Running debugging logic...';
?> |
PROG-0830 | JavaScript | debugging | The following JavaScript code has a syntax error. Fix it. | function test() {
console.log('hello'
} | // Professional debugging example in JavaScript
console.log('Running debugging logic...'); |
PROG-1846 | Python | async | How do you handle multiple concurrent promises/tasks in Python? | # Professional async example in Python
print('Running async logic...') | |
PROG-0616 | Python | async | Write an asynchronous function in Python that waits for 2 seconds. | # Professional async example in Python
print('Running async logic...') | |
PROG-1501 | Python | syntax | Write a simple Python script to declare different variables. | Declare three variables: an integer, a string, and a boolean. | a = 5 # Integer
b = 'Hello' # String
c = True # Boolean |
PROG-0886 | Python | async | Show basic use of async/await in Python. | # Professional async example in Python
print('Running async logic...') | |
PROG-1912 | Python | functions | Define a function called 'greet' in Python that takes a name and returns a greeting. | def add(x, y):
return x + y
result = add(10, 20) |
End of preview. Expand in Data Studio
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
Multi-Language Programming Instruction Dataset
Overview
This repository contains a professional-grade demo dataset designed for training or fine-tuning small programming assistant models. It focuses on functional, beginner to intermediate tasks in Python, JavaScript, and PHP.
The dataset is structured to mimic real-world instruction-tuning formats (like Alpaca or ShareGPT) and is ready for direct upload to the Hugging Face Hub.
Dataset Structure
- train.jsonl: 1,600 examples (80% split)
- test.jsonl: 400 examples (20% split)
- dataset_info.json: Metadata for repository configuration.
Data Fields
Each row contains:
id: Unique identifier (e.g.,PROG-0001)language: The target programming language (Python, JavaScript, PHP).category: Task classification (syntax, algorithms, oop, etc.).instruction: The human-style prompt or task description.input: Optional context or specific data for the task.output: The actual code solution or explanation.
How to Run
- Initialize Environment (Optional):
python -m venv .venv source .venv/bin/activate # Windows: .venv\Scripts\activate - Generate Dataset:
This will create apython generate_dataset.pydataset/folder containing the.jsonlfiles.
Hugging Face Upload (Optional)
To share this dataset professionally:
huggingface-cli login
huggingface-cli upload your-username/programming-instructions ./dataset --repo-type dataset
Dataset Quality
- Balanced: Equal distribution across three major languages.
- Diverse: Covers 10 distinct categories from basic syntax to advanced OOP and async logic.
- Structured: Clean English prompts and high-quality, readable code snippets.
- Downloads last month
- 16