instruction stringclasses 1
value | input stringlengths 176 485 | output dict |
|---|---|---|
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def calculate_area(length, width):
2. area=length*width
3. return area | {
"line_content": "area=length*width",
"rule_violated": "Use Spaces Around Operators"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def calculate_tax(income):
2. tax=income*0.1
3. return tax | {
"line_content": "tax=income*0.1",
"rule_violated": "Use Spaces Around Operators"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def find_total(price, quantity):
2. total=price*quantity
3. return total | {
"line_content": "total=price*quantity",
"rule_violated": "Use Spaces Around Operators"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def calculate_discounted_price(price, discount):
2. final_price=price-discount
3. return final_price | {
"line_content": "final_price=price-discount",
"rule_violated": "Use Spaces Around Operators"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def compute_average(total, count):
2. average=total/count
3. return average | {
"line_content": "average=total/count",
"rule_violated": "Use Spaces Around Operators"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def calculate_final_score(score, bonus):
2. final_score=score+bonus
3. return final_score | {
"line_content": "final_score=score+bonus",
"rule_violated": "Use Spaces Around Operators"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def calculate_difference(value1, value2):
2. difference=value1-value2
3. return difference | {
"line_content": "difference=value1-value2",
"rule_violated": "Use Spaces Around Operators"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def calculate_total_cost(cost, tax):
2. total_cost=cost+tax
3. return total_cost | {
"line_content": "total_cost=cost+tax",
"rule_violated": "Use Spaces Around Operators"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def calculate_ratio(part, whole):
2. ratio=part/whole
3. return ratio | {
"line_content": "ratio=part/whole",
"rule_violated": "Use Spaces Around Operators"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def compute_net_profit(revenue, expenses):
2. net_profit=revenue-expenses
3. return net_profit | {
"line_content": "net_profit=revenue-expenses",
"rule_violated": "Use Spaces Around Operators"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def add(a,b):
2. return a+b | {
"line_content": "return a+b",
"rule_violated": "Use Spaces Around Operators"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def subtract(x,y):
2. return x-y | {
"line_content": "return x-y",
"rule_violated": "Use Spaces Around Operators"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def multiply(num1,num2):
2. return num1*num2 | {
"line_content": "return num1*num2",
"rule_violated": "Use Spaces Around Operators"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def divide(a,b):
2. return a/b | {
"line_content": "return a/b",
"rule_violated": "Use Spaces Around Operators"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def compute_remainder(x,y):
2. return x%y | {
"line_content": "return x%y",
"rule_violated": "Use Spaces Around Operators"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def power(base,exp):
2. return base**exp | {
"line_content": "return base**exp",
"rule_violated": "Use Spaces Around Operators"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def check_equal(a,b):
2. return a==b | {
"line_content": "return a==b",
"rule_violated": "Use Spaces Around Operators"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def is_greater(x,y):
2. return x>y | {
"line_content": "return x>y",
"rule_violated": "Use Spaces Around Operators"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def logical_and(a,b):
2. return a and b | {
"line_content": "return a and b",
"rule_violated": "Use Spaces Around Operators"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def logical_or(a,b):
2. return a or b | {
"line_content": "return a or b",
"rule_violated": "Use Spaces Around Operators"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def assign_value():
2. a=5 | {
"line_content": "a=5",
"rule_violated": "Use Spaces Around Operators"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def increment_value(a):
2. return a+=1 | {
"line_content": "return a+=1",
"rule_violated": "Use Spaces Around Operators"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def update_value(x):
2. x=x*2 | {
"line_content": "x=x*2",
"rule_violated": "Use Spaces Around Operators"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def compute_average(a,b):
2. return (a+b)/2 | {
"line_content": "return (a+b)/2",
"rule_violated": "Use Spaces Around Operators"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def calculate_area(length,width):
2. return length*width | {
"line_content": "return length*width",
"rule_violated": "Use Spaces Around Operators"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def total_cost(price,quantity):
2. return price*quantity | {
"line_content": "return price*quantity",
"rule_violated": "Use Spaces Around Operators"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def is_positive(num):
2. return num>0 | {
"line_content": "return num>0",
"rule_violated": "Use Spaces Around Operators"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def check_divisibility(num):
2. return num%3==0 | {
"line_content": "return num%3==0",
"rule_violated": "Use Spaces Around Operators"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. from torch import *
2. def tensor_operations(tensor):
3. return tensor.mean(), tensor.sum() | {
"line_content": "from torch import *",
"rule_violated": "Avoid Using Wildcard Imports"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. from langchain import *
2. def create_chain():
3. chain = SomeChainClass()
4. return chain | {
"line_content": "from langchain import *",
"rule_violated": "Avoid Using Wildcard Imports"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. from openai import *
2. def generate_response(prompt):
3. response = openai.ChatCompletion.create(model='gpt-3.5-turbo', messages=[{'role': 'user', 'content': prompt}])
4... | {
"line_content": "from openai import *",
"rule_violated": "Avoid Using Wildcard Imports"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. from huggingface import *
2. def load_model(model_name):
3. model = AutoModel.from_pretrained(model_name)
4. return model | {
"line_content": "from huggingface import *",
"rule_violated": "Avoid Using Wildcard Imports"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. from torch.nn import *
2. def create_neural_network(input_size, hidden_size, output_size):
3. model = Sequential(
4. Linear(input_size, hidden_size),
5. R... | {
"line_content": "from torch.nn import *",
"rule_violated": "Avoid Using Wildcard Imports"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. from langchain.agents import *
2. def agent_function():
3. agent = create_agent()
4. return agent.run() | {
"line_content": "from langchain.agents import *",
"rule_violated": "Avoid Using Wildcard Imports"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. from openai.api import *
2. def chat_with_model(prompt):
3. return openai.Completion.create(prompt=prompt, max_tokens=100) | {
"line_content": "from openai.api import *",
"rule_violated": "Avoid Using Wildcard Imports"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. from huggingface.transformers import *
2. def generate_text(input_text):
3. model = TFAutoModelForCausalLM.from_pretrained('gpt2')
4. return model.generate(input_text... | {
"line_content": "from huggingface.transformers import *",
"rule_violated": "Avoid Using Wildcard Imports"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. from torch.optim import *
2. def configure_optimizer(model_parameters):
3. optimizer = Adam(model_parameters, lr=0.001)
4. return optimizer | {
"line_content": "from torch.optim import *",
"rule_violated": "Avoid Using Wildcard Imports"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. from math import *
2. def calculate_square_root(x):
3. return sqrt(x) | {
"line_content": "from math import *",
"rule_violated": "Avoid Using Wildcard Imports"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. from os import *
2. def get_working_directory():
3. return getcwd() | {
"line_content": "from os import *",
"rule_violated": "Avoid Using Wildcard Imports"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. from numpy import *
2. def calculate_mean(array):
3. return mean(array) | {
"line_content": "from numpy import *",
"rule_violated": "Avoid Using Wildcard Imports"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. from random import *
2. def generate_random_number():
3. return randint(1, 10) | {
"line_content": "from random import *",
"rule_violated": "Avoid Using Wildcard Imports"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. from datetime import *
2. def get_current_date():
3. return datetime.now() | {
"line_content": "from datetime import *",
"rule_violated": "Avoid Using Wildcard Imports"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. from collections import *
2. def create_counter(items):
3. return Counter(items) | {
"line_content": "from collections import *",
"rule_violated": "Avoid Using Wildcard Imports"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. from itertools import *
2. def get_combinations(items):
3. return combinations(items, 2) | {
"line_content": "from itertools import *",
"rule_violated": "Avoid Using Wildcard Imports"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. from json import *
2. def parse_json(data):
3. return loads(data) | {
"line_content": "from json import *",
"rule_violated": "Avoid Using Wildcard Imports"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. from csv import *
2. def read_csv(file):
3. return reader(file) | {
"line_content": "from csv import *",
"rule_violated": "Avoid Using Wildcard Imports"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. from urllib import *
2. def fetch_url(url):
3. response = urlopen(url) | {
"line_content": "from urllib import *",
"rule_violated": "Avoid Using Wildcard Imports"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. from subprocess import *
2. def run_command(command):
3. return check_output(command, shell=True) | {
"line_content": "from subprocess import *",
"rule_violated": "Avoid Using Wildcard Imports"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. from xml.etree.ElementTree import *
2. def parse_xml(file):
3. tree = parse(file) | {
"line_content": "from xml.etree.ElementTree import *",
"rule_violated": "Avoid Using Wildcard Imports"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. from statistics import *
2. def calculate_mean(data):
3. return mean(data) | {
"line_content": "from statistics import *",
"rule_violated": "Avoid Using Wildcard Imports"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. from matplotlib.pyplot import *
2. def plot_data(data):
3. plot(data) | {
"line_content": "from matplotlib.pyplot import *",
"rule_violated": "Avoid Using Wildcard Imports"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. from pydub import *
2. def play_sound(file):
3. sound = AudioSegment.from_file(file) | {
"line_content": "from pydub import *",
"rule_violated": "Avoid Using Wildcard Imports"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. from sqlalchemy import *
2. def create_session(engine):
3. return sessionmaker(bind=engine)() | {
"line_content": "from sqlalchemy import *",
"rule_violated": "Avoid Using Wildcard Imports"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. from re import *
2. def find_pattern(text, pattern):
3. return findall(pattern, text) | {
"line_content": "f*rom re import ",
"rule_violated": "Avoid Using Wildcard Imports"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. from functools import *
2. def memoized_function(f):
3. return lru_cache()(f) | {
"line_content": "from functools import *",
"rule_violated": "Avoid Using Wildcard Imports"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. from xml.etree.ElementTree import *
2. def parse_xml(file):
3. tree = parse(file) | {
"line_content": "from xml.etree.ElementTree import *",
"rule_violated": "Avoid Using Wildcard Imports"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def divide(a, b):
2. result = a / b
3. return result | {
"line_content": "result = a / b",
"rule_violated": "Handle Errors Gracefully"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def open_file(filename):
2. file = open(filename, 'r')
3. return file.read() | {
"line_content": "file = open(filename, 'r')",
"rule_violated": "Handle Errors Gracefully"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def get_element(lst, index):
2. return lst[index] | {
"line_content": "return lst[index]",
"rule_violated": "Handle Errors Gracefully"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def read_json(file_path):
2. with open(file_path) as f:
3. data = json.load(f)
4. return data | {
"line_content": "data = json.load(f)",
"rule_violated": "Handle Errors Gracefully"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def connect_to_database(db_url):
2. conn = sqlite3.connect(db_url)
3. return conn | {
"line_content": "conn = sqlite3.connect(db_url)",
"rule_violated": "Handle Errors Gracefully"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def parse_int(value):
2. return int(value) | {
"line_content": "return int(value)",
"rule_violated": "Handle Errors Gracefully"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def fetch_data(url):
2. response = requests.get(url)
3. return response.json() | {
"line_content": "response = requests.get(url)",
"rule_violated": "Handle Errors Gracefully"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def get_dict_value(d, key):
2. return d[key] | {
"line_content": "return d[key]",
"rule_violated": "Handle Errors Gracefully"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def calculate_percentage(total, portion):
2. return (portion / total) * 100 | {
"line_content": "return (portion / total) * 100",
"rule_violated": "Handle Errors Gracefully"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def find_max(numbers):
2. return max(numbers) | {
"line_content": "return max(numbers)",
"rule_violated": "Handle Errors Gracefully"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def divide_numbers(a, b):
2. return a / b | {
"line_content": "return a / b",
"rule_violated": "Handle Errors Gracefully"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def read_file(file_path):
2. with open(file_path) as f:
3. return f.read() | {
"line_content": "with open(file_path) as f:",
"rule_violated": "Handle Errors Gracefully"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def get_item(lst, index):
2. return lst[index] | {
"line_content": "return lst[index]",
"rule_violated": "Handle Errors Gracefully"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def load_json(file_name):
2. with open(file_name) as f:
3. return json.load(f) | {
"line_content": "return json.load(f)",
"rule_violated": "Handle Errors Gracefully"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def connect_to_service(url):
2. connection = requests.get(url)
3. return connection.content | {
"line_content": "connection = requests.get(url)",
"rule_violated": "Handle Errors Gracefully"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def calculate_average(numbers):
2. return sum(numbers) / len(numbers) | {
"line_content": "return sum(numbers) / len(numbers)",
"rule_violated": "Handle Errors Gracefully"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def retrieve_value(dictionary, key):
2. return dictionary[key] | {
"line_content": "return dictionary[key]",
"rule_violated": "Handle Errors Gracefully"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def parse_date(date_string):
2. return datetime.strptime(date_string, '%Y-%m-%d') | {
"line_content": "return datetime.strptime(date_string, '%Y-%m-%d')",
"rule_violated": "Handle Errors Gracefully"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def find_max_value(numbers):
2. return max(numbers) | {
"line_content": "return max(numbers)",
"rule_violated": "Handle Errors Gracefully"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def calculate_discount(price, discount):
2. return price - (price * discount) | {
"line_content": "return price - (price * discount)",
"rule_violated": "Handle Errors Gracefully"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def divide_numbers(num1, num2):
2. return num1 / num2 | {
"line_content": "return num1 / num2",
"rule_violated": "Handle Errors Gracefully"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def read_file(file_path):
2. file = open(file_path)
3. return file.read() | {
"line_content": "file = open(file_path)",
"rule_violated": "Handle Errors Gracefully"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def parse_integer(value):
2. return int(value) | {
"line_content": "return int(value)",
"rule_violated": "Handle Errors Gracefully"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def access_element(my_list, index):
2. return my_list[index] | {
"line_content": "return my_list[index]",
"rule_violated": "Handle Errors Gracefully"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def connect_to_database(connection_string):
2. conn = database.connect(connection_string)
3. return conn | {
"line_content": "conn = database.connect(connection_string)",
"rule_violated": "Handle Errors Gracefully"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def find_item(item, item_list):
2. return item_list.index(item) | {
"line_content": "return item_list.index(item)",
"rule_violated": "Handle Errors Gracefully"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def convert_to_float(value):
2. return float(value) | {
"line_content": "return float(value)",
"rule_violated": "Handle Errors Gracefully"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def get_user_input():
2. return input('Enter a value: ')
3. print(get_user_input()) | {
"line_content": "return input('Enter a value: ')",
"rule_violated": "Handle Errors Gracefully"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def example_function():
2. x = 10
3. return x | {
"line_content": "x = 10",
"rule_violated": "Use Meaningful Variable Names"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def sample_function():
2. y = 20
3. return y | {
"line_content": "y = 20",
"rule_violated": "Use Meaningful Variable Names"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def add_numbers():
2. z = 30
3. return z | {
"line_content": "z = 30",
"rule_violated": "Use Meaningful Variable Names"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def process_data():
2. rslt = 15
3. return rslt | {
"line_content": "rslt = 15",
"rule_violated": "Use Meaningful Variable Names"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def calculate_sum():
2. total = 100
3. return total | {
"line_content": "total = 100",
"rule_violated": "Use Meaningful Variable Names"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def create_dict():
2. d = {}
3. return d | {
"line_content": "d = {}",
"rule_violated": "Use Meaningful Variable Names"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def initialize_list():
2. lst = []
3. return lst | {
"line_content": "lst = []",
"rule_violated": "Use Meaningful Variable Names"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def multiply():
2. p = 5
3. return p | {
"line_content": "p = 5",
"rule_violated": "Use Meaningful Variable Names"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def get_user_info():
2. user = 'John'
3. return user | {
"line_content": "user = 'John'",
"rule_violated": "Use Meaningful Variable Names"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def store_value():
2. val = 42
3. return val | {
"line_content": "val = 42",
"rule_violated": "Use Meaningful Variable Names"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def track_progress():
2. pr = 0
3. return pr | {
"line_content": "pr = 0",
"rule_violated": "Use Meaningful Variable Names"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def get_temperature():
2. temp = 22.5
3. return temp | {
"line_content": "temp = 22.5",
"rule_violated": "Use Meaningful Variable Names"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def calculate_discount():
2. disc = 0.15
3. return disc | {
"line_content": "disc = 0.15",
"rule_violated": "Use Meaningful Variable Names"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def send_message():
2. msg = 'Hello'
3. return msg | {
"line_content": "msg = 'Hello'",
"rule_violated": "Use Meaningful Variable Names"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def generate_report():
2. rprt = []
3. return rprt | {
"line_content": "rprt = []",
"rule_violated": "Use Meaningful Variable Names"
} |
Evaluate the code for adherence to the coding guidelines. | Guidelines:
1. Use Meaningful Variable Names
2. Avoid Using Wildcard Imports
3. Handle Errors Gracefully
4. Use Spaces Around Operators
Code:
1. def fetch_data():
2. data = 'sample'
3. return data | {
"line_content": "data = 'sample'",
"rule_violated": "Use Meaningful Variable Names"
} |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 4