Skip to content

Commit

Permalink
update dwenhao data
Browse files Browse the repository at this point in the history
  • Loading branch information
terryyz committed Apr 14, 2024
1 parent 08a3199 commit 4921c89
Show file tree
Hide file tree
Showing 52 changed files with 392 additions and 392 deletions.
4 changes: 2 additions & 2 deletions data/clean/f_746_wenhao.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ def f_746(d, keys=['x', 'y', 'z']):
>>> data = [{'x': 1, 'y': 10, 'z': 5}, {'x': 3, 'y': 15, 'z': 6}, {'x': 2, 'y': 1, 'z': 7}]
>>> ax = f_746(data)
>>> type(ax)
<class 'matplotlib.axes._subplots.AxesSubplot'>
<class 'matplotlib.axes._subplots.Axes'>
>>> ax = f_746(data, keys=['x', 'y'])
>>> type(ax)
<class 'matplotlib.axes._subplots.AxesSubplot'>
<class 'matplotlib.axes._subplots.Axes'>
"""
# Convert the list of dictionaries to a DataFrame
df = pd.DataFrame(d)
Expand Down
2 changes: 1 addition & 1 deletion data/clean/f_752_wenhao.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def f_752(letters, repetitions, colors):
Example:
>>> ax = f_752(['A', 'B', 'C'], [3, 5, 2], ['red', 'green', 'blue'])
>>> type(ax)
<class 'matplotlib.axes._subplots.AxesSubplot'>
<class 'matplotlib.axes._subplots.Axes'>
"""
if len(letters) != len(repetitions) or len(letters) != len(colors) or len(letters) == 0:
raise ValueError("All lists must be the same length and non-empty.")
Expand Down
3 changes: 1 addition & 2 deletions data/clean/f_761_wenhao.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def f_761(df, column):
- column (str): The name of the column in the DataFrame that contains the categories.
Output:
- matplotlib.axes._subplots.AxesSubplot: The Axes object for the generated plot.
- matplotlib.axes._subplots.Axes: The Axes object for the generated plot.
Requirements:
- pandas
Expand All @@ -30,7 +30,6 @@ def f_761(df, column):
>>> df = pd.DataFrame({'Type': ['A', 'A', 'C', 'E', 'D', 'E', 'D']})
>>> ax = f_761(df, 'Type')
# This generates and displays a bar chart showing the distribution of each category within the 'Type' column, including categories with zero occurrences.
"""
# Define the categories
CATEGORIES = ['A', 'B', 'C', 'D', 'E']
Expand Down
4 changes: 2 additions & 2 deletions data/clean/f_762_wenhao.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def f_762(df):
df (pandas.DataFrame): The DataFrame containing numerical columns to be used for correlation.
Returns:
matplotlib.axes._subplots.AxesSubplot: The matplotlib Axes object representing the heatmap.
matplotlib.axes._subplots.Axes: The matplotlib Axes object representing the heatmap.
Requirements:
- pandas
Expand All @@ -22,7 +22,7 @@ def f_762(df):
>>> df = pd.DataFrame({'a': [1, 2, 3], 'b': [4, 5, 6], 'c': [7, 8, 9]})
>>> ax = f_762(df)
>>> type(ax)
<class 'matplotlib.axes._subplots.AxesSubplot'>
<class 'matplotlib.axes._subplots.Axes'>
"""
correlation_matrix = df.corr()
Expand Down
5 changes: 3 additions & 2 deletions data/clean/f_765_wenhao.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ def f_765(person_names, email_domains, num_records=5):
- ValueError: If the number of names provided is less than the number of records requested or if no email domains are provided.
Example:
>>> random.seed(0) # Initialize random seed
>>> f_765(['John Doe', 'Jane Smith'], ['gmail.com', 'yahoo.com'], 2)
Name Email
0 John Doe john[at]yahoo.com
1 Jane Smith jane[at]gmail.com
0 Jane Smith jane[at]gmail.com
1 John Doe john[at]yahoo.com
>>> f_765(['Alice'], ['outlook.com'], 1)
Name Email
0 Alice alice[at]outlook.com
Expand Down
4 changes: 2 additions & 2 deletions data/clean/f_770_wenhao.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ def f_770(word: str) -> dict:
- The function uses the `string` library to get a string of lowercase alphabets.
Example:
>>> f_770('abcdef')
{'ab': 1, 'ac': 0, 'ad': 0, ..., 'yx': 0, 'yz': 0, 'za': 0, ..., 'zx': 0, 'zy': 0}
>>> list(f_770('abcdef').items())[:5]
[('ab', 1), ('ac', 0), ('ad', 0), ('ae', 0), ('af', 0)]
"""
ALPHABETS = string.ascii_lowercase
# Generate all two-letter combinations of alphabets
Expand Down
626 changes: 313 additions & 313 deletions data/open-eval.jsonl

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions data/processed/f_331_jenny_w_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def f_331(data, column="c"):
- column (str): Name of column to remove. Defaults to "c".
Returns:
- matplotlib.axes._subplots.AxesSubplot or None: The Axes object of the heatmap
- matplotlib.axes._subplots.Axes or None: The Axes object of the heatmap
or None if the heatmap is not generated.
Requirements:
Expand All @@ -23,7 +23,7 @@ def f_331(data, column="c"):
Example:
>>> f_331({'a': [1, 2, 3], 'b': [4, 5, 6], 'c': [7, 8, 9]})
<Axes: >
<Axes:>
>>> f_331(pd.DataFrame({'a': ["foo", "bar"]}))
"""
df = pd.DataFrame(data)
Expand Down
2 changes: 1 addition & 1 deletion data/processed/f_336_jenny_w_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def f_336(df1, df2):
Returns:
- tuple: A tuple containing:
- list: A list of the selected features.
- AxesSubplot: A heatmap showing the correlation between the selected features.
- Axes: A heatmap showing the correlation between the selected features.
Requirements:
- pandas
Expand Down
2 changes: 1 addition & 1 deletion data/processed/f_367_jenny_wo_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def f_367(file_path="data.csv", columns=["A", "B", "C"]):
0 1.0 2.0 3.0
1 4.0 5.0 6.0
>>> ax
<matplotlib.axes._subplots.AxesSubplot object at 0x7f24b00f4a90>
<matplotlib.axes._subplots.Axes object at 0x7f24b00f4a90>
>>> croot
0 1.0
"""
Expand Down
2 changes: 1 addition & 1 deletion data/processed/f_407_jenny_wo_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def f_407(data):
are not the expected type, this function raises TypeError.
Returns:
- matplotlib.axes._subplots.AxesSubplot: The generated plot's Axes object.
- matplotlib.axes._subplots.Axes: The generated plot's Axes object.
Requirements:
- pandas
Expand Down
2 changes: 1 addition & 1 deletion data/processed/f_411_jenny_w_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def f_411(data):
data (list): A list of dictionaries. The keys are labels and the values are data points.
Returns:
matplotlib.axes._subplots.AxesSubplot or None: Axes object of the plot showing 'Data over Time',
matplotlib.axes._subplots.Axes or None: Axes object of the plot showing 'Data over Time',
with 'Time' on the x-axis and 'Data Points' on the y-axis.
If data is empty, return None.
Expand Down
2 changes: 1 addition & 1 deletion data/processed/f_413_jenny_wo_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def f_413(input_file):
Returns:
- result (dict): each key corresponds to those in the input dictionaries, and the corresponding
value is another dict with keys 'mean' and 'median', representing the calculated statistics.
- plots (list[matplotlib.axes._subplots.AxesSubplot]): A list of bar charts, one for
- plots (list[matplotlib.axes._subplots.Axes]): A list of bar charts, one for
each key in the dictionaries, visualizing the mean and median values.
Requirements:
Expand Down
2 changes: 1 addition & 1 deletion data/processed/f_423_jenny_wo_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def f_423(db_name="test.db", table_name="People"):
table_name (str, optional): The name of the table to plot from. Defaults to 'People'.
Returns:
matplotlib.axes._subplots.AxesSubplot: Axes object representing the age distribution plot,
matplotlib.axes._subplots.Axes: Axes object representing the age distribution plot,
with x-axis showing age and a default of bins=30, kde=True.
Requirements:
Expand Down
4 changes: 2 additions & 2 deletions data/processed/f_746_wenhao_w_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ def f_746(d, keys=['x', 'y', 'z']):
>>> data = [{'x': 1, 'y': 10, 'z': 5}, {'x': 3, 'y': 15, 'z': 6}, {'x': 2, 'y': 1, 'z': 7}]
>>> ax = f_746(data)
>>> type(ax)
<class 'matplotlib.axes._subplots.AxesSubplot'>
<class 'matplotlib.axes._subplots.Axes'>
>>> ax = f_746(data, keys=['x', 'y'])
>>> type(ax)
<class 'matplotlib.axes._subplots.AxesSubplot'>
<class 'matplotlib.axes._subplots.Axes'>
"""
# Convert the list of dictionaries to a DataFrame
df = pd.DataFrame(d)
Expand Down
2 changes: 1 addition & 1 deletion data/processed/f_750_wenhao_wo_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def f_750(directory: str, pattern: str) -> list:
- pattern (str): The regular expression pattern to match the filenames.
Returns:
- A list of matplotlib.axes._subplots.AxesSubplot objects, each representing a plot of sales data from a matched CSV file.
- A list of matplotlib.axes._subplots.Axes objects, each representing a plot of sales data from a matched CSV file.
Example usage:
>>> axes = f_750('/path/to/data/', r'^sales_data_\d{4}.csv')
Expand Down
2 changes: 1 addition & 1 deletion data/processed/f_752_wenhao_w_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def f_752(letters, repetitions, colors):
Example:
>>> ax = f_752(['A', 'B', 'C'], [3, 5, 2], ['red', 'green', 'blue'])
>>> type(ax)
<class 'matplotlib.axes._subplots.AxesSubplot'>
<class 'matplotlib.axes._subplots.Axes'>
"""
if len(letters) != len(repetitions) or len(letters) != len(colors) or len(letters) == 0:
raise ValueError("All lists must be the same length and non-empty.")
Expand Down
2 changes: 1 addition & 1 deletion data/processed/f_757_wenhao_w_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def f_757(df, z_threshold=2):
Returns:
tuple: A tuple containing the following elements:
- pandas.DataFrame: A DataFrame containing the outliers in the 'closing_price' column.
- matplotlib.axes._subplots.AxesSubplot: The plot object displaying the outliers.
- matplotlib.axes._subplots.Axes: The plot object displaying the outliers.
Requirements:
- pandas
Expand Down
2 changes: 1 addition & 1 deletion data/processed/f_758_wenhao_w_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def f_758(df: pd.DataFrame) -> tuple:
with stock closing prices.
Returns:
tuple: A tuple containing two matplotlib.axes._subplots.AxesSubplot objects: the first for the boxplot
tuple: A tuple containing two matplotlib.axes._subplots.Axes objects: the first for the boxplot
and the second for the histogram.
Example:
Expand Down
3 changes: 1 addition & 2 deletions data/processed/f_761_wenhao_w_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def f_761(df, column):
- column (str): The name of the column in the DataFrame that contains the categories.
Output:
- matplotlib.axes._subplots.AxesSubplot: The Axes object for the generated plot.
- matplotlib.axes._subplots.Axes: The Axes object for the generated plot.
Requirements:
- pandas
Expand All @@ -30,7 +30,6 @@ def f_761(df, column):
>>> df = pd.DataFrame({'Type': ['A', 'A', 'C', 'E', 'D', 'E', 'D']})
>>> ax = f_761(df, 'Type')
# This generates and displays a bar chart showing the distribution of each category within the 'Type' column, including categories with zero occurrences.
"""
# Define the categories
CATEGORIES = ['A', 'B', 'C', 'D', 'E']
Expand Down
4 changes: 2 additions & 2 deletions data/processed/f_762_wenhao_w_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def f_762(df):
df (pandas.DataFrame): The DataFrame containing numerical columns to be used for correlation.
Returns:
matplotlib.axes._subplots.AxesSubplot: The matplotlib Axes object representing the heatmap.
matplotlib.axes._subplots.Axes: The matplotlib Axes object representing the heatmap.
Requirements:
- pandas
Expand All @@ -22,7 +22,7 @@ def f_762(df):
>>> df = pd.DataFrame({'a': [1, 2, 3], 'b': [4, 5, 6], 'c': [7, 8, 9]})
>>> ax = f_762(df)
>>> type(ax)
<class 'matplotlib.axes._subplots.AxesSubplot'>
<class 'matplotlib.axes._subplots.Axes'>
"""
correlation_matrix = df.corr()
Expand Down
5 changes: 3 additions & 2 deletions data/processed/f_765_wenhao_w_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ def f_765(person_names, email_domains, num_records=5):
- ValueError: If the number of names provided is less than the number of records requested or if no email domains are provided.
Example:
>>> random.seed(0) # Initialize random seed
>>> f_765(['John Doe', 'Jane Smith'], ['gmail.com', 'yahoo.com'], 2)
Name Email
0 John Doe john[at]yahoo.com
1 Jane Smith jane[at]gmail.com
0 Jane Smith jane[at]gmail.com
1 John Doe john[at]yahoo.com
>>> f_765(['Alice'], ['outlook.com'], 1)
Name Email
0 Alice alice[at]outlook.com
Expand Down
4 changes: 2 additions & 2 deletions data/processed/f_770_wenhao_w_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ def f_770(word: str) -> dict:
- The function uses the `string` library to get a string of lowercase alphabets.
Example:
>>> f_770('abcdef')
{'ab': 1, 'ac': 0, 'ad': 0, ..., 'yx': 0, 'yz': 0, 'za': 0, ..., 'zx': 0, 'zy': 0}
>>> list(f_770('abcdef').items())[:5]
[('ab', 1), ('ac', 0), ('ad', 0), ('ae', 0), ('af', 0)]
"""
ALPHABETS = string.ascii_lowercase
# Generate all two-letter combinations of alphabets
Expand Down
2 changes: 1 addition & 1 deletion data/processed/f_778_wenhao_w_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def f_778(word):
Should contain only lowercase alphabetic characters.
Returns:
AxesSubplot: A matplotlib.axes._subplots.AxesSubplot object representing the generated plot.
Axes: A matplotlib.axes._subplots.Axes object representing the generated plot.
Requirements:
- numpy
Expand Down
2 changes: 1 addition & 1 deletion data/processed/f_798_wenhao_wo_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def f_798(mystrings, text):
Examples:
>>> ax = f_798(['Lorem ipsum', 'consectetur adipiscing'], 'Lorem ipsum dolor sit amet lorem Ipsum')
>>> type(ax)
<class 'matplotlib.axes._subplots.AxesSubplot'>
<class 'matplotlib.axes._subplots.Axes'>
"""

if not text:
Expand Down
2 changes: 1 addition & 1 deletion data/processed/f_810_wenhao_w_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def f_810(func, x_range=(-2, 2), num_points=1000):
Example:
>>> ax = f_810(np.sin)
>>> type(ax)
<class 'matplotlib.axes._subplots.AxesSubplot'>
<class 'matplotlib.axes._subplots.Axes'>
>>> ax.get_legend_handles_labels()[-1]
['sin(x)', 'Integral of sin(x)']
"""
Expand Down
12 changes: 6 additions & 6 deletions data/processed/f_811_wenhao_w_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def f_811(df):
- df (pandas.DataFrame): A DataFrame with numerical values.
Returns:
- matplotlib.axes._subplots.AxesSubplot: The AxesSubplot object of the Seaborn heatmap.
- matplotlib.axes._subplots.Axes: The Axes object of the Seaborn heatmap.
Raises:
- ValueError: If the DataFrame is empty or if no numeric columns are present.
Expand Down Expand Up @@ -55,7 +55,7 @@ def test_non_numeric_columns_ignored(self):
df = pd.DataFrame({"A": [1, 2, 3], "B": ["one", "two", "three"]})
ax = f_811(df)
self.assertIsInstance(
ax, plt.Axes, "The result should be a matplotlib AxesSubplot object"
ax, plt.Axes, "The result should be a matplotlib Axes object"
)
self.assertEqual(
len(ax.get_xticklabels()), 1, "Non-numeric columns should be ignored"
Expand All @@ -64,25 +64,25 @@ def test_with_positive_numbers(self):
df = pd.DataFrame({"A": [1, 2, 3], "B": [4, 5, 6]})
result = f_811(df)
self.assertIsInstance(
result, plt.Axes, "The result should be a matplotlib AxesSubplot object"
result, plt.Axes, "The result should be a matplotlib Axes object"
)
def test_with_negative_numbers(self):
df = pd.DataFrame({"A": [-1, -2, -3], "B": [-4, -5, -6]})
result = f_811(df)
self.assertIsInstance(
result, plt.Axes, "The result should be a matplotlib AxesSubplot object"
result, plt.Axes, "The result should be a matplotlib Axes object"
)
def test_with_mixed_numbers(self):
df = pd.DataFrame({"A": [1, -2, 3], "B": [-4, 5, -6]})
result = f_811(df)
self.assertIsInstance(
result, plt.Axes, "The result should be a matplotlib AxesSubplot object"
result, plt.Axes, "The result should be a matplotlib Axes object"
)
def test_with_zeroes(self):
df = pd.DataFrame({"A": [0, 0, 0], "B": [0, 0, 0]})
result = f_811(df)
self.assertIsInstance(
result, plt.Axes, "The result should be a matplotlib AxesSubplot object"
result, plt.Axes, "The result should be a matplotlib Axes object"
)
def test_with_empty_dataframe(self):
df = pd.DataFrame({"A": [], "B": []})
Expand Down
2 changes: 1 addition & 1 deletion data/processed/f_820_wenhao_w_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def f_820(array, features=None, seed=None):
>>> array = np.random.rand(2, 5)
>>> ax = f_820(array, features=['A', 'B', 'C', 'D', 'E'], seed=1)
>>> type(ax)
<class 'matplotlib.axes._subplots.AxesSubplot'>
<class 'matplotlib.axes._subplots.Axes'>
>>> ax.collections[0].get_array().data.flatten()
array([0.60276338, 0.71518937, 0.4236548 , 0.5488135 , 0.54488318,
0.891773 , 0.43758721, 0.38344152, 0.64589411, 0.96366276])
Expand Down
4 changes: 2 additions & 2 deletions data/processed/f_827_wenhao_w_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def f_827(df, x_column, y_column):
y_column (str): The column name for the y-axis. Data contained in column must be numeric.
Returns:
matplotlib.axes._subplots.AxesSubplot: The Axes object containing the scatter plot and the linear regression line.
matplotlib.axes._subplots.Axes: The Axes object containing the scatter plot and the linear regression line.
Requirements:
- pandas
Expand All @@ -28,7 +28,7 @@ def f_827(df, x_column, y_column):
>>> df = pd.DataFrame({'A': [1, 2, 3], 'B': [2, 3, 4]})
>>> ax = f_827(df, 'A', 'B')
>>> type(ax)
<class 'matplotlib.axes._subplots.AxesSubplot'>
<class 'matplotlib.axes._subplots.Axes'>
"""
X = df[x_column].values.reshape(-1, 1)
Y = df[y_column].values
Expand Down
2 changes: 1 addition & 1 deletion data/processed/f_830_wenhao_w_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def f_830(json_data: str, data_key: str):
>>> json_str = '{"data": {"values": [5, 10, 15, 20, 25]}}'
>>> original_data, normalized_data, ax = f_830(json_str, 'data.values')
>>> type(original_data), type(normalized_data), type(ax)
(<class 'pandas.core.series.Series'>, <class 'pandas.core.series.Series'>, <class 'matplotlib.axes._subplots.AxesSubplot'>)
(<class 'pandas.core.series.Series'>, <class 'pandas.core.series.Series'>, <class 'matplotlib.axes._subplots.Axes'>)
"""
data = json.loads(json_data)
try:
Expand Down
2 changes: 1 addition & 1 deletion data/processed/f_836_chien_w_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def f_836(text):
of characters and punctuation.
Returns:
matplotlib.axes._subplots.AxesSubplot: An Axes object showing the histogram and optionally the KDE
matplotlib.axes._subplots.Axes: An Axes object showing the histogram and optionally the KDE
plot of word lengths. This visual representation helps in
understanding the distribution of word lengths in the given text.
Expand Down
2 changes: 1 addition & 1 deletion data/processed/f_857_chien_wo_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def f_857(api_url):
Returns:
- DataFrame: A pandas DataFrame with the parsed data from the API.
- AxesSubplot or None: A matplotlib AxesSubplot object representing the plot of the data, or None if the data is empty.
- Axes or None: A matplotlib Axes object representing the plot of the data, or None if the data is empty.
Raises:
- HTTPError: If the API request fails due to issues like network problems, invalid response, etc.
Expand Down
Loading

0 comments on commit 4921c89

Please sign in to comment.