prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  [BUG] Add copy button to code snippets
  We used to have this:
  ![image](https://user-images.githubusercontent.com/33841818/168883725-41ce6768-925f-4d62-8de7-b1e77502d685.png)
  
  For all code snippets (currently both in sphinx-gallery files. Doesn't appear anymore.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `docs/source/user-guide/tabular/tutorials/plot_quick_data_integrity.py`
  Content:
  ```
  1 # -*- coding: utf-8 -*-
  2 """
  3 Data Integrity Suite on Avocado Sales Data - Quickstart
  4 *******************************************************
  5 
  6 The deepchecks integrity suite is relevant any time you have data that you wish to validate:
  7 whether it's on a fresh batch of data, or right before splitting it or using it for training. 
  8 Here we'll use the avocado prices dataset, to demonstrate how you can run
  9 the suite with only a few simple lines of code, and see which kind of insights it can find.
  10 
  11 .. code-block:: bash
  12 
  13     # Before we start, if you don't have deepchecks installed yet,
  14     # make sure to run:
  15     pip install deepchecks -U --quiet #--user
  16 """
  17 
  18 #%%
  19 # Load and Prepare Data
  20 # ====================================================
  21 
  22 from deepchecks.tabular import datasets
  23 
  24 # load data
  25 data = datasets.regression.avocado.load_data(data_format='DataFrame', as_train_test=False)
  26 #%%
  27 
  28 # drop unused columns (remove after fix...)
  29 data = data.drop(columns=['Unnamed: 0'])
  30 
  31 #%%
  32 # Insert a few typcial problems to dataset for demonstration.
  33 
  34 import pandas as pd
  35 
  36 def add_dirty_data(df):
  37     # change strings
  38     df.loc[df[df['type'] == 'organic'].sample(frac=0.18).index,'type'] = 'Organic'
  39     df.loc[df[df['type'] == 'organic'].sample(frac=0.01).index,'type'] = 'ORGANIC'
  40     # add duplicates
  41     df = pd.concat([df, df.sample(frac=0.156)], axis=0, ignore_index=True)
  42     # add column with single value
  43     df['Is Ripe'] = True
  44     return df
  45 
  46 
  47 dirty_df = add_dirty_data(data)
  48 
  49 #%%
  50 # Run Deepchecks for Data Integrity
  51 # ====================================
  52 #
  53 # Define a Dataset Object
  54 # ------------------------
  55 #
  56 # Create a deepchecks Dataset, including the relevant metadata (label, date, index, etc.).
  57 # Check out :class:`deepchecks.tabular.Dataset` to see all of the columns that can be declared.
  58 
  59 from deepchecks.tabular import Dataset
  60 
  61 # We explicitly state the categorical features,
  62 # otherwise they will be automatically inferred, which may not work perfectly and is not recommended.
  63 # The label can be passed as a column name or a separate pd.Series / pd.DataFrame
  64 ds = Dataset(dirty_df, cat_features = ['type'], datetime_name='Date', label = 'AveragePrice')
  65 
  66 #%%
  67 # Run the Deepchecks Suite
  68 # --------------------------
  69 #
  70 # Validate your data with the :class:`deepchecks.tabular.suites.single_dataset_integrity` suite.
  71 # It runs on a single dataset, so you can run it on any batch of data (e.g. train data, test data, a new batch of data
  72 # that recently arrived)
  73 #
  74 # Check out the :doc:`when should you use </getting-started/when_should_you_use>`
  75 # deepchecks guide for some more info about the existing suites and when to use them.
  76 
  77 from deepchecks.tabular.suites import data_integrity
  78 
  79 # Run Suite:
  80 integ_suite = data_integrity()
  81 integ_suite.run(ds)
  82 
  83 #%%
  84 # We can inspect the suite outputs and see that there are a few problems we'd like to fix.
  85 # We'll now fix them and check that they're resolved by re-running those specific checks.
  86 
  87 
  88 #%%
  89 # Run a Single Check
  90 # -------------------
  91 # We can run a single check on a dataset, and see the results.
  92 
  93 from deepchecks.tabular.checks import IsSingleValue, DataDuplicates
  94 
  95 # first let's see how the check runs:
  96 IsSingleValue().run(ds)
  97 
  98 #%%
  99 
  100 # we can also add a condition:
  101 single_value_with_condition = IsSingleValue().add_condition_not_single_value()
  102 result = single_value_with_condition.run(ds)
  103 result
  104 
  105 #%%
  106 
  107 # We can also inspect and use the result's value:
  108 result.value
  109 
  110 #%%
  111 # Now let's remove the single value column and rerun (notice that we're using directly 
  112 # the ``data`` attribute that stores the dataframe inside the Dataset)
  113 
  114 ds.data.drop('Is Ripe', axis=1, inplace=True)
  115 result = single_value_with_condition.run(ds)
  116 result
  117 
  118 #%%
  119 
  120 # Alternatively we can fix the dataframe directly, and create a new dataset.
  121 # Let's fix also the duplicate values:
  122 dirty_df.drop_duplicates(inplace=True)
  123 dirty_df.drop('Is Ripe', axis=1, inplace=True)
  124 ds = Dataset(dirty_df, cat_features=['type'], datetime_name='Date', label='AveragePrice')
  125 result = DataDuplicates().add_condition_ratio_not_greater_than(0).run(ds)
  126 result
  127 
  128 #%%
  129 # Rerun Suite on the Fixed Dataset
  130 # ---------------------------------
  131 # Finally, we'll choose to keep the "organic" multiple spellings as they represent different sources.
  132 # So we'll customaize the suite by removing the condition from it (or delete check completely).
  133 # Alternatively - we can customize it by creating a new Suite with the desired checks and conditions.
  134 # See :doc:`/user-guide/general/customizations/examples/customizing-suites` for more info.
  135 
  136 # let's inspect the suite's structure
  137 integ_suite
  138 
  139 #%%
  140 
  141 # and remove the condition:
  142 integ_suite[3].clean_conditions()
  143 
  144 #%%
  145 # Now we can re-run the suite using:
  146 integ_suite.run(ds)
  147 
  148 #%%
  149 # and all of the conditions will pass.
  150 #
  151 # *Note: the check we manipulated will still run as part of the Suite, however
  152 # it won't appear in the Conditions Summary since it no longer has any
  153 # conditions defined on it. You can still see its display results in the 
  154 # Additional Outputs section*
  155 #
  156 # For more info about working with conditions, see the detailed
  157 # :doc:`/user-guide/general/customizations/examples/plot_configure_checks_conditions' guide.
  158
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/docs/source/user-guide/tabular/tutorials/plot_quick_data_integrity.py b/docs/source/user-guide/tabular/tutorials/plot_quick_data_integrity.py
  --- a/docs/source/user-guide/tabular/tutorials/plot_quick_data_integrity.py
  +++ b/docs/source/user-guide/tabular/tutorials/plot_quick_data_integrity.py
  @@ -143,7 +143,7 @@
   
   #%%
   # Now we can re-run the suite using:
  -integ_suite.run(ds)
  +res = integ_suite.run(ds)
   
   #%%
   # and all of the conditions will pass.
  
verification_info: {"golden_diff": "diff --git a/docs/source/user-guide/tabular/tutorials/plot_quick_data_integrity.py b/docs/source/user-guide/tabular/tutorials/plot_quick_data_integrity.py\n--- a/docs/source/user-guide/tabular/tutorials/plot_quick_data_integrity.py\n+++ b/docs/source/user-guide/tabular/tutorials/plot_quick_data_integrity.py\n@@ -143,7 +143,7 @@\n \n #%%\n # Now we can re-run the suite using:\n-integ_suite.run(ds)\n+res = integ_suite.run(ds)\n \n #%%\n # and all of the conditions will pass.\n", "issue": "[BUG] Add copy button to code snippets\nWe used to have this:\r\n![image](https://user-images.githubusercontent.com/33841818/168883725-41ce6768-925f-4d62-8de7-b1e77502d685.png)\r\n\r\nFor all code snippets (currently both in sphinx-gallery files. Doesn't appear anymore.\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\"\"\"\nData Integrity Suite on Avocado Sales Data - Quickstart\n*******************************************************\n\nThe deepchecks integrity suite is relevant any time you have data that you wish to validate:\nwhether it's on a fresh batch of data, or right before splitting it or using it for training. \nHere we'll use the avocado prices dataset, to demonstrate how you can run\nthe suite with only a few simple lines of code, and see which kind of insights it can find.\n\n.. code-block:: bash\n\n    # Before we start, if you don't have deepchecks installed yet,\n    # make sure to run:\n    pip install deepchecks -U --quiet #--user\n\"\"\"\n\n#%%\n# Load and Prepare Data\n# ====================================================\n\nfrom deepchecks.tabular import datasets\n\n# load data\ndata = datasets.regression.avocado.load_data(data_format='DataFrame', as_train_test=False)\n#%%\n\n# drop unused columns (remove after fix...)\ndata = data.drop(columns=['Unnamed: 0'])\n\n#%%\n# Insert a few typcial problems to dataset for demonstration.\n\nimport pandas as pd\n\ndef add_dirty_data(df):\n    # change strings\n    df.loc[df[df['type'] == 'organic'].sample(frac=0.18).index,'type'] = 'Organic'\n    df.loc[df[df['type'] == 'organic'].sample(frac=0.01).index,'type'] = 'ORGANIC'\n    # add duplicates\n    df = pd.concat([df, df.sample(frac=0.156)], axis=0, ignore_index=True)\n    # add column with single value\n    df['Is Ripe'] = True\n    return df\n\n\ndirty_df = add_dirty_data(data)\n\n#%%\n# Run Deepchecks for Data Integrity\n# ====================================\n#\n# Define a Dataset Object\n# ------------------------\n#\n# Create a deepchecks Dataset, including the relevant metadata (label, date, index, etc.).\n# Check out :class:`deepchecks.tabular.Dataset` to see all of the columns that can be declared.\n\nfrom deepchecks.tabular import Dataset\n\n# We explicitly state the categorical features,\n# otherwise they will be automatically inferred, which may not work perfectly and is not recommended.\n# The label can be passed as a column name or a separate pd.Series / pd.DataFrame\nds = Dataset(dirty_df, cat_features = ['type'], datetime_name='Date', label = 'AveragePrice')\n\n#%%\n# Run the Deepchecks Suite\n# --------------------------\n#\n# Validate your data with the :class:`deepchecks.tabular.suites.single_dataset_integrity` suite.\n# It runs on a single dataset, so you can run it on any batch of data (e.g. train data, test data, a new batch of data\n# that recently arrived)\n#\n# Check out the :doc:`when should you use </getting-started/when_should_you_use>`\n# deepchecks guide for some more info about the existing suites and when to use them.\n\nfrom deepchecks.tabular.suites import data_integrity\n\n# Run Suite:\ninteg_suite = data_integrity()\ninteg_suite.run(ds)\n\n#%%\n# We can inspect the suite outputs and see that there are a few problems we'd like to fix.\n# We'll now fix them and check that they're resolved by re-running those specific checks.\n\n\n#%%\n# Run a Single Check\n# -------------------\n# We can run a single check on a dataset, and see the results.\n\nfrom deepchecks.tabular.checks import IsSingleValue, DataDuplicates\n\n# first let's see how the check runs:\nIsSingleValue().run(ds)\n\n#%%\n\n# we can also add a condition:\nsingle_value_with_condition = IsSingleValue().add_condition_not_single_value()\nresult = single_value_with_condition.run(ds)\nresult\n\n#%%\n\n# We can also inspect and use the result's value:\nresult.value\n\n#%%\n# Now let's remove the single value column and rerun (notice that we're using directly \n# the ``data`` attribute that stores the dataframe inside the Dataset)\n\nds.data.drop('Is Ripe', axis=1, inplace=True)\nresult = single_value_with_condition.run(ds)\nresult\n\n#%%\n\n# Alternatively we can fix the dataframe directly, and create a new dataset.\n# Let's fix also the duplicate values:\ndirty_df.drop_duplicates(inplace=True)\ndirty_df.drop('Is Ripe', axis=1, inplace=True)\nds = Dataset(dirty_df, cat_features=['type'], datetime_name='Date', label='AveragePrice')\nresult = DataDuplicates().add_condition_ratio_not_greater_than(0).run(ds)\nresult\n\n#%%\n# Rerun Suite on the Fixed Dataset\n# ---------------------------------\n# Finally, we'll choose to keep the \"organic\" multiple spellings as they represent different sources.\n# So we'll customaize the suite by removing the condition from it (or delete check completely).\n# Alternatively - we can customize it by creating a new Suite with the desired checks and conditions.\n# See :doc:`/user-guide/general/customizations/examples/customizing-suites` for more info.\n\n# let's inspect the suite's structure\ninteg_suite\n\n#%%\n\n# and remove the condition:\ninteg_suite[3].clean_conditions()\n\n#%%\n# Now we can re-run the suite using:\ninteg_suite.run(ds)\n\n#%%\n# and all of the conditions will pass.\n#\n# *Note: the check we manipulated will still run as part of the Suite, however\n# it won't appear in the Conditions Summary since it no longer has any\n# conditions defined on it. You can still see its display results in the \n# Additional Outputs section*\n#\n# For more info about working with conditions, see the detailed\n# :doc:`/user-guide/general/customizations/examples/plot_configure_checks_conditions' guide.\n", "path": "docs/source/user-guide/tabular/tutorials/plot_quick_data_integrity.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n\"\"\"\nData Integrity Suite on Avocado Sales Data - Quickstart\n*******************************************************\n\nThe deepchecks integrity suite is relevant any time you have data that you wish to validate:\nwhether it's on a fresh batch of data, or right before splitting it or using it for training. \nHere we'll use the avocado prices dataset, to demonstrate how you can run\nthe suite with only a few simple lines of code, and see which kind of insights it can find.\n\n.. code-block:: bash\n\n    # Before we start, if you don't have deepchecks installed yet,\n    # make sure to run:\n    pip install deepchecks -U --quiet #--user\n\"\"\"\n\n#%%\n# Load and Prepare Data\n# ====================================================\n\nfrom deepchecks.tabular import datasets\n\n# load data\ndata = datasets.regression.avocado.load_data(data_format='DataFrame', as_train_test=False)\n#%%\n\n# drop unused columns (remove after fix...)\ndata = data.drop(columns=['Unnamed: 0'])\n\n#%%\n# Insert a few typcial problems to dataset for demonstration.\n\nimport pandas as pd\n\ndef add_dirty_data(df):\n    # change strings\n    df.loc[df[df['type'] == 'organic'].sample(frac=0.18).index,'type'] = 'Organic'\n    df.loc[df[df['type'] == 'organic'].sample(frac=0.01).index,'type'] = 'ORGANIC'\n    # add duplicates\n    df = pd.concat([df, df.sample(frac=0.156)], axis=0, ignore_index=True)\n    # add column with single value\n    df['Is Ripe'] = True\n    return df\n\n\ndirty_df = add_dirty_data(data)\n\n#%%\n# Run Deepchecks for Data Integrity\n# ====================================\n#\n# Define a Dataset Object\n# ------------------------\n#\n# Create a deepchecks Dataset, including the relevant metadata (label, date, index, etc.).\n# Check out :class:`deepchecks.tabular.Dataset` to see all of the columns that can be declared.\n\nfrom deepchecks.tabular import Dataset\n\n# We explicitly state the categorical features,\n# otherwise they will be automatically inferred, which may not work perfectly and is not recommended.\n# The label can be passed as a column name or a separate pd.Series / pd.DataFrame\nds = Dataset(dirty_df, cat_features = ['type'], datetime_name='Date', label = 'AveragePrice')\n\n#%%\n# Run the Deepchecks Suite\n# --------------------------\n#\n# Validate your data with the :class:`deepchecks.tabular.suites.single_dataset_integrity` suite.\n# It runs on a single dataset, so you can run it on any batch of data (e.g. train data, test data, a new batch of data\n# that recently arrived)\n#\n# Check out the :doc:`when should you use </getting-started/when_should_you_use>`\n# deepchecks guide for some more info about the existing suites and when to use them.\n\nfrom deepchecks.tabular.suites import data_integrity\n\n# Run Suite:\ninteg_suite = data_integrity()\ninteg_suite.run(ds)\n\n#%%\n# We can inspect the suite outputs and see that there are a few problems we'd like to fix.\n# We'll now fix them and check that they're resolved by re-running those specific checks.\n\n\n#%%\n# Run a Single Check\n# -------------------\n# We can run a single check on a dataset, and see the results.\n\nfrom deepchecks.tabular.checks import IsSingleValue, DataDuplicates\n\n# first let's see how the check runs:\nIsSingleValue().run(ds)\n\n#%%\n\n# we can also add a condition:\nsingle_value_with_condition = IsSingleValue().add_condition_not_single_value()\nresult = single_value_with_condition.run(ds)\nresult\n\n#%%\n\n# We can also inspect and use the result's value:\nresult.value\n\n#%%\n# Now let's remove the single value column and rerun (notice that we're using directly \n# the ``data`` attribute that stores the dataframe inside the Dataset)\n\nds.data.drop('Is Ripe', axis=1, inplace=True)\nresult = single_value_with_condition.run(ds)\nresult\n\n#%%\n\n# Alternatively we can fix the dataframe directly, and create a new dataset.\n# Let's fix also the duplicate values:\ndirty_df.drop_duplicates(inplace=True)\ndirty_df.drop('Is Ripe', axis=1, inplace=True)\nds = Dataset(dirty_df, cat_features=['type'], datetime_name='Date', label='AveragePrice')\nresult = DataDuplicates().add_condition_ratio_not_greater_than(0).run(ds)\nresult\n\n#%%\n# Rerun Suite on the Fixed Dataset\n# ---------------------------------\n# Finally, we'll choose to keep the \"organic\" multiple spellings as they represent different sources.\n# So we'll customaize the suite by removing the condition from it (or delete check completely).\n# Alternatively - we can customize it by creating a new Suite with the desired checks and conditions.\n# See :doc:`/user-guide/general/customizations/examples/customizing-suites` for more info.\n\n# let's inspect the suite's structure\ninteg_suite\n\n#%%\n\n# and remove the condition:\ninteg_suite[3].clean_conditions()\n\n#%%\n# Now we can re-run the suite using:\nres = integ_suite.run(ds)\n\n#%%\n# and all of the conditions will pass.\n#\n# *Note: the check we manipulated will still run as part of the Suite, however\n# it won't appear in the Conditions Summary since it no longer has any\n# conditions defined on it. You can still see its display results in the \n# Additional Outputs section*\n#\n# For more info about working with conditions, see the detailed\n# :doc:`/user-guide/general/customizations/examples/plot_configure_checks_conditions' guide.\n", "path": "docs/source/user-guide/tabular/tutorials/plot_quick_data_integrity.py"}]}