Skip to content

Commit

Permalink
update wenhao data
Browse files Browse the repository at this point in the history
  • Loading branch information
terryyz committed Apr 14, 2024
1 parent 8d026f3 commit 7ce2053
Show file tree
Hide file tree
Showing 43 changed files with 385 additions and 388 deletions.
4 changes: 1 addition & 3 deletions data/clean/f_761_wenhao.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ def f_761(df, column):
Example:
>>> df = pd.DataFrame({'Category': ['A', 'B', 'B', 'C', 'A', 'D', 'E', 'E', 'D']})
>>> ax = f_761(df, 'Category')
# This generates and displays a bar chart showing the distribution of each category within the 'Category' column.
>>> ax = f_761(df, 'Category')
>>> df = pd.DataFrame({'Type': ['A', 'A', 'C', 'E', 'D', 'E', 'D']})
>>> ax = f_761(df, 'Type')
"""
Expand Down
9 changes: 5 additions & 4 deletions data/clean/f_772_wenhao.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ def f_772(word):
list: A list of random pairs of adjacent letters from the word. If the word has fewer than 2 letters, returns a list of empty strings based on POSSIBLE_LETTERS length.
Examples:
>>> random.seed(0); f_772('abcdef')
['ab', 'bc', 'cd']
>>> random.seed(0); f_772('xyz')
['xy', 'xy', 'yz']
>>> random.seed(0)
>>> f_772('abcdef')
['de', 'de', 'ab']
>>> f_772('xyz')
['yz', 'yz', 'yz']
"""
if not all(char in string.ascii_letters for char in word):
raise ValueError("Input must only contain letters.")
Expand Down
4 changes: 2 additions & 2 deletions data/clean/f_832_wenhao.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def f_832(length: int, predicates: list, seed: int = None):
- random
Example:
>>> f_832(10, ['has_uppercase', 'has_numbers'], seed=42)
('8czu("@iNc', {'has_uppercase': True, 'has_numbers': True})
>>> f_832(10, ['has_uppercase', 'has_numbers'], seed=42)[0]
'8czu("@iNc'
>>> f_832(5, ['has_lowercase'], seed=123)
('eiMk[', {'has_lowercase': True})
"""
Expand Down
644 changes: 322 additions & 322 deletions data/open-eval.jsonl

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion 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.Axes or None: The Axes object of the heatmap
- matplotlib.axes._axes.Axes or None: The Axes object of the heatmap
or None if the heatmap is not generated.
Requirements:
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.Axes object at 0x7f24b00f4a90>
<matplotlib.axes._axes.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.Axes: The generated plot's Axes object.
- matplotlib.axes._axes.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.Axes or None: Axes object of the plot showing 'Data over Time',
matplotlib.axes._axes.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
4 changes: 2 additions & 2 deletions 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.Axes]): A list of bar charts, one for
- plots (list[matplotlib.axes._axes.Axes]): A list of bar charts, one for
each key in the dictionaries, visualizing the mean and median values.
Requirements:
Expand All @@ -28,7 +28,7 @@ def f_413(input_file):
Example:
>>> results, plots = f_413("sample_data.json")
>>> type(plots[0])
<class 'matplotlib.axes._subplots.Axes'>
<class 'matplotlib.axes._axes.Axes'>
>>> results
{'a': {'mean': 3.0, 'median': 3.0}, 'b': {'mean': 6.0, 'median': 6.0}}
"""
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.Axes: Axes object representing the age distribution plot,
matplotlib.axes._axes.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.Axes'>
<class 'matplotlib.axes._axes.Axes'>
>>> ax = f_746(data, keys=['x', 'y'])
>>> type(ax)
<class 'matplotlib.axes._subplots.Axes'>
<class 'matplotlib.axes._axes.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.Axes objects, each representing a plot of sales data from a matched CSV file.
- A list of matplotlib.axes._axes.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.Axes'>
<class 'matplotlib.axes._axes.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.Axes: The plot object displaying the outliers.
- matplotlib.axes._axes.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.Axes objects: the first for the boxplot
tuple: A tuple containing two matplotlib.axes._axes.Axes objects: the first for the boxplot
and the second for the histogram.
Example:
Expand Down
6 changes: 2 additions & 4 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.Axes: The Axes object for the generated plot.
- matplotlib.axes._axes.Axes: The Axes object for the generated plot.
Requirements:
- pandas
Expand All @@ -25,9 +25,7 @@ def f_761(df, column):
Example:
>>> df = pd.DataFrame({'Category': ['A', 'B', 'B', 'C', 'A', 'D', 'E', 'E', 'D']})
>>> ax = f_761(df, 'Category')
# This generates and displays a bar chart showing the distribution of each category within the 'Category' column.
>>> ax = f_761(df, 'Category')
>>> df = pd.DataFrame({'Type': ['A', 'A', 'C', 'E', 'D', 'E', 'D']})
>>> ax = f_761(df, 'Type')
"""
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.Axes: The matplotlib Axes object representing the heatmap.
matplotlib.axes._axes.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.Axes'>
<class 'matplotlib.axes._axes.Axes'>
"""
correlation_matrix = df.corr()
Expand Down
9 changes: 5 additions & 4 deletions data/processed/f_772_wenhao_w_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ def f_772(word):
list: A list of random pairs of adjacent letters from the word. If the word has fewer than 2 letters, returns a list of empty strings based on POSSIBLE_LETTERS length.
Examples:
>>> random.seed(0); f_772('abcdef')
['ab', 'bc', 'cd']
>>> random.seed(0); f_772('xyz')
['xy', 'xy', 'yz']
>>> random.seed(0)
>>> f_772('abcdef')
['de', 'de', 'ab']
>>> f_772('xyz')
['yz', 'yz', 'yz']
"""
if not all(char in string.ascii_letters for char in word):
raise ValueError("Input must only contain letters.")
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:
Axes: A matplotlib.axes._subplots.Axes object representing the generated plot.
Axes: A matplotlib.axes._axes.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.Axes'>
<class 'matplotlib.axes._axes.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.Axes'>
<class 'matplotlib.axes._axes.Axes'>
>>> ax.get_legend_handles_labels()[-1]
['sin(x)', 'Integral of sin(x)']
"""
Expand Down
2 changes: 1 addition & 1 deletion 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.Axes: The Axes object of the Seaborn heatmap.
- matplotlib.axes._axes.Axes: The Axes object of the Seaborn heatmap.
Raises:
- ValueError: If the DataFrame is empty or if no numeric columns are present.
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.Axes'>
<class 'matplotlib.axes._axes.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.Axes: The Axes object containing the scatter plot and the linear regression line.
matplotlib.axes._axes.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.Axes'>
<class 'matplotlib.axes._axes.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.Axes'>)
(<class 'pandas.core.series.Series'>, <class 'pandas.core.series.Series'>, <class 'matplotlib.axes._axes.Axes'>)
"""
data = json.loads(json_data)
try:
Expand Down
4 changes: 2 additions & 2 deletions data/processed/f_832_wenhao_w_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def f_832(length: int, predicates: list, seed: int = None):
- random
Example:
>>> f_832(10, ['has_uppercase', 'has_numbers'], seed=42)
('8czu("@iNc', {'has_uppercase': True, 'has_numbers': True})
>>> f_832(10, ['has_uppercase', 'has_numbers'], seed=42)[0]
'8czu("@iNc'
>>> f_832(5, ['has_lowercase'], seed=123)
('eiMk[', {'has_lowercase': True})
"""
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.Axes: An Axes object showing the histogram and optionally the KDE
matplotlib.axes._axes.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_875_chien_w_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def f_875(rows=1000, string_length=3):
Default is 3. A value of 0 results in the generation of empty strings.
Returns:
- matplotlib.axes._subplots.Axes or None: A seaborn heatmap plot object if
- matplotlib.axes._axes.Axes or None: A seaborn heatmap plot object if
data is generated; otherwise, None.
Requirements:
Expand Down
2 changes: 1 addition & 1 deletion data/processed/f_887_chien_w_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def f_887(data_list):
- data_list (list): A list containing category labels (strings).
Returns:
- Axes object (matplotlib.axes._subplots.Axes): The histogram displaying the distribution of categories.
- Axes object (matplotlib.axes._axes.Axes): The histogram displaying the distribution of categories.
Requirements:
- pandas
Expand Down
2 changes: 1 addition & 1 deletion data/processed/f_891_chien_wo_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def f_891(date_str):
Example:
>>> ax = f_891('2023-06-15')
>>> type(ax)
<class 'matplotlib.axes._subplots.Axes'>
<class 'matplotlib.axes._axes.Axes'>
"""
date = datetime.strptime(date_str, "%Y-%m-%d")
num_of_values = date.day
Expand Down
2 changes: 1 addition & 1 deletion data/processed/f_895_chien_w_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def f_895(data_dict):
Returns:
- tuple: A tuple containing:
- matplotlib.axes._subplots.Axes: The axes object of the histogram.
- matplotlib.axes._axes.Axes: The axes object of the histogram.
- str: A message indicating whether the distribution is uniform ("The distribution is uniform.")
or not ("The distribution is not uniform.").
Expand Down
4 changes: 2 additions & 2 deletions data/processed/f_898_chien_wo_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ def f_898(file_path):
a single numeric value representing an individual in the population.
Returns:
- Tuple (float, float, matplotlib.axes._subplots.Axes): The function returns a tuple containing
- Tuple (float, float, matplotlib.axes._axes.Axes): The function returns a tuple containing
three elements:
- Sample mean (float): The mean of the sample.
- Sample standard deviation (float): The standard deviation of the sample, calculated with a
degrees of freedom (ddof) of 1.
- Matplotlib subplot (matplotlib.axes._subplots.Axes): An object representing the
- Matplotlib subplot (matplotlib.axes._axes.Axes): An object representing the
generated histogram plot with the normal distribution curve.
Requirements:
Expand Down
2 changes: 1 addition & 1 deletion data/processed/f_902_chien_w_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def f_902(num_pairs=10):
possible unique combinations (100), it is adjusted to the valid range (1 to 100).
Returns:
- ax (matplotlib.axes._subplots.Axes): The Axes object of the countplot, which can be used for
- ax (matplotlib.axes._axes.Axes): The Axes object of the countplot, which can be used for
further customizations or to retrieve information about the plot.
Requirements:
Expand Down
2 changes: 1 addition & 1 deletion data/processed/f_906_chien_w_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def f_906(arr):
arr (numpy.ndarray): A 2D numpy array.
Returns:
matplotlib.axes._subplots.Axes: A plot representing the time series of row sums.
matplotlib.axes._axes.Axes: A plot representing the time series of row sums.
Requirements:
- pandas
Expand Down
2 changes: 1 addition & 1 deletion data/processed/f_910_chien_w_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def f_910(num_samples=NUM_SAMPLES, num_outliers=NUM_OUTLIERS):
the artificially introduced outliers.
- outliers_detected (numpy array): The outliers detected using the IQR method. This
detection is based solely on the normally distributed portion of the data.
- ax (matplotlib.axes._subplots.Axes): The Axes object for the histogram
- ax (matplotlib.axes._axes.Axes): The Axes object for the histogram
plot of the combined dataset.
Requirements:
Expand Down
2 changes: 1 addition & 1 deletion data/processed/f_915_chien_w_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def test_return_types(self):
self.assertIsInstance(
ax,
Axes,
"The second return value should be an instance of matplotlib.axes._subplots.Axes.",
"The second return value should be an instance of matplotlib.axes._axes.Axes.",
)
def test_number_of_lines(self):
"""Check that the correct number of lines are plotted."""
Expand Down
2 changes: 1 addition & 1 deletion data/processed/f_917_chien_wo_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def f_917(time_strings, time_format="%d/%m/%Y %H:%M:%S.%f"):
The default format is '%d/%m/%Y %H:%M:%S.%f', representing day/month/year hours:minutes:seconds.microseconds.
Returns:
- ax (matplotlib.axes._subplots.Axes or None): An Axes object with the histogram plotted if
- ax (matplotlib.axes._axes.Axes or None): An Axes object with the histogram plotted if
parsing is successful. Returns None if a parsing error occurs.
Requirements:
Expand Down
Loading

0 comments on commit 7ce2053

Please sign in to comment.