vania-janet/multiturn-rag-retrieval-data huggingface dataset:
Solution: The first step to resolving this issue would be to reinstall the Aspera libraries. There might have been a failure during the installation. As a result this might have affected the DLL files. If that does not resolve the issues, then you will be required to update your version of Python. If you are unable to do this, then you can use installation [Intel® Distribution for Python*](https://software.intel.com/en-us/distribution-for-python). This should allow you to install the Aspera SDK on Python 3.6.x without any issues.







 Updating metadata 

There are two ways to update the metadata on an existing object:



* A PUT request with the new metadata and the original object contents
* Running a COPY request with the new metadata specifying the original object as the copy source





 Using PUT to update metadata 

Note: The PUT request overwrites the existing contents of the object so it must first be downloaded and re-uploaded with the new metadata.

def update_metadata_put(bucket_name, item_name, key, value):
try:
 retrieve the existing item to reload the contents
response = cos_cli.get_object(Bucket=bucket_name, Key=item_name)
existing_body = response.get("Body").read()

 set the new metadata
new_metadata = {
key: value
}

cos_cli.put_object(Bucket=bucket_name, Key=item_name, Body=existing_body, Metadata=new_metadata)

print("Metadata update (PUT) for {0} Complete!n".format(item_name))
except ClientError as be:
print("CLIENT ERROR: {0}n".format(be))
except Exception as e:
log_error("Unable to update metadata: {0}".format(e))
Show more





 Using COPY to update metadata 

def update_metadata_copy(bucket_name, item_name, key, value):
try:
 set the new metadata
new_metadata = {
key: value
=> [internal] load build definition from Dockerfile.ml 0.0s
=> => transferring dockerfile: 40B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/ibmfunctions/action-python-v3.9:1.0.0 0.0s
=> [1/2] FROM docker.io/ibmfunctions/action-python-v3.9:1.0.0 0.0s
=> CACHED [2/2] RUN pip install --upgrade pip matplotlib seaborn pandas statsmodels 0.0s
=> exporting to image 0.0s
=> => exporting layers 0.0s
=> => writing image sha256:4a0d140e65fc379d8c25d18fce9aedd580203f768f43da011149993cd57565d4 0.0s
=> => naming to docker.io/docker-username/repo-name:tag
...
...
Show more
8. Push your image to Docker Hub.

docker push <dockerhub_username>/<repo_name>:<tag_name>

Be sure to log in to Docker Hub before you attempt to push your image.
9. Save the following code as seaborn.py in your functions directory. This code generates a joint plot in [seaborn](https://seaborn.pydata.org/) that uses random data. You can then create a web action with Cloud Functions to return the plot to a Cloud Functions endpoint.

 import modules
import base64
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns

 optional: set seaborn style
sns.set(style="dark")
def on_queued(self, future, kwargs):
print("Directory download queued.")

class CallbackOnProgress(AsperaBaseSubscriber):
def __init__(self):
pass

def on_progress(self, future, bytes_transferred, kwargs):
print("Directory download in progress: %s bytes transferred" % bytes_transferred)

class CallbackOnDone(AsperaBaseSubscriber):
def __init__(self):
pass

def on_done(self, future, kwargs):
print("Downloads complete!")

 Create Transfer manager
transfer_manager = AsperaTransferManager(client)

 Attach subscribers
subscribers = [CallbackOnQueued(), CallbackOnProgress(), CallbackOnDone()]

 Get object with Aspera
future = transfer_manager.download_directory(bucket_name, remote_directory, local_download_directory, None, subscribers)

 Wait for download to complete
future.result()
Show more

Key Values



* <bucket-name> - name of the bucket in your Object Storage service instance that has Aspera enabled
* <absolute-path-to-directory> - local directory to save the downloaded files. Must have leading and trailing slash / (that is, /Users/testuser/Downloads/)
* <object prefix> - name of the directory in the bucket to store the files. Must not have a leading slash / (that is, todownload/)



The sample code above produces the following output:

Directory download queued.
Directory download in progress: 5632 bytes transferred
Directory download in progress: 1047552 bytes transferred
...
Directory download in progress: 53295130 bytes transferred
Directory download in progress: 62106855 bytes transferred
Download complete!





 Pause/Resume/Cancel 

The SDK provides the ability to manage the progress of file/directory transfers through the following methods of the AsperaTransferFuture object:



* pause()
Swift 

As stated in the [general SDK Guidelines](https://cloud.ibm.com/docs/sdk-handbook?topic=sdk-handbook-intro), the SDK should make it easy for application developers to access your API in their preferred language. Given its adoption by Apple developers, providing a Swift SDK will allow iOS, macOS, and even server-side applications to leverage the capabilities of your service API in their applications.



 Environment support 

Your Swift SDK should support the latest major release of Swift, in order to ensure compatibility with developers using Xcode.

To increase adoption of the SDK, it should be compatible in all Swift environments:



* tvOS
* iOS
* macOS
* watchOS
* Linux systems, for backend server-side Swift projects



If your SDK does not support one of these for specific operations, you must use the proper annotations so that developers can work around these limitations when incorporating the SDK into their Xcode projects.



 Objective-C compatibility 

Given the goal of Swift to be a self-sufficient language, Objective-C compatibility does not necessarily need to be maintained. Some SDK service teams may opt to include this as part of their SDK where merited. If consumption by Objective-C applications is important for your service, providing reference material describing how to construct a [custom bridge](https://watson-developer-cloud.github.io/swift-sdk/docs/objective-c) could be beneficial.







 Publishing 

All Swift SDKs should be publicly available in an [IBM GitHub organization](https://test.cloud.ibm.com/docs/sdk-handbook?topic=sdk-handbook-distributionopen-source). To aid in adoption of your SDK, you should make your SDKs available in all three major package managers in the Swift network, if they are still useful to your target audience.

Your SDK should follow the [semantic versioning best practices](https://test.cloud.ibm.com/docs/sdk-handbook?topic=sdk-handbook-distributionsemantic-versioning).



 Community support 

Allow your users to find answers to their questions.
python:3.9 [3.9.x](https://github.com/docker-library/python/blob/6a2c0f48f011aa279a0c9190725fc84a220460bc/3.9/buster/Dockerfile) Python actions are executed in a Python version 3.11.x environment (Debian Buster based) unless you specify the --kind flag when you create or update an action. To explicitly use this runtime, specify the CLI parameter --kind python:3.9 when you create or update an action. The runtime contains SDK packages for IBM Cloud services available for use by Python actions, in addition to the Python 3.9 standard libraries. [CHANGELOG.md](https://github.com/ibm-functions/runtime-python/blob/master/python3.9/CHANGELOG.md). 
 python:3.7 [3.7.x](https://github.com/docker-library/python/blob/ab8b829cfefdb460ebc17e570332f0479039e918/3.7/stretch/Dockerfile) Python actions are executed in a Python version 3.11.x environment (Debian Stretch based) unless you specify the --kind flag when you create or update an action. To explicitly use this runtime, specify the CLI parameter --kind python:3.7 when you create or update an action. The runtime contains SDK packages for IBM Cloud services available for use by Python actions, in addition to the Python 3.7 standard libraries. [CHANGELOG.md](https://github.com/ibm-functions/runtime-python/blob/master/python3.7/CHANGELOG.md). 
 3.6 Python 3.6 reached end of support on 2021/12/23. <br>See [end of life Python Releases](https://endoflife.date/python). 
 2.7 Python 2.7 reached end of support on 2020/01/01.
with AsperaTransferManager(client) as transfer_manager:

 Get object with Aspera
future = transfer_manager.download_directory(bucket_name, remote_directory, local_download_directory)

 Wait for download to complete
future.result()

Key Values



* <bucket-name> - name of the bucket in your Object Storage service instance that has Aspera enabled
* <absolute-path-to-directory> - local directory to save the downloaded files. Must have leading and trailing slash / (i.e. /Users/testuser/Downloads/)
* <object prefix> - name of the directory in the bucket to store the files. Must not have a leading slash / (that is, todownload/)







 Using Subscribers 

Subscribers provide observability into transfers by attaching custom callback methods. All transfers transition between the following phases:

Queued - In Progress - Done

There are three available subscribers for each phase:



* CallbackOnQueued() - called when a new transfer has been added to the AsperaTransferManager
* CallbackOnProgress() - called when a transfer has transmitted data (fired repeatedly while the transfer is in progress).
* CallbackOnDone() - called once the transfer is completed



bucket_name = "<bucket-name>"
local_download_directory = "<absolute-path-to-directory>"
remote_directory = "<object prefix>"

 Subscriber callbacks
class CallbackOnQueued(AsperaBaseSubscriber):
def __init__(self):
pass

def on_queued(self, future, kwargs):
print("Directory download queued.")

class CallbackOnProgress(AsperaBaseSubscriber):
def __init__(self):
pass

def on_progress(self, future, bytes_transferred, kwargs):
print("Directory download in progress: %s bytes transferred" % bytes_transferred)
Runs into a bar. Crawls into a bar. Dances into a bar. Tiptoes into a bar. Rams a bar. Jumps into a bar."
}



You can use this method to extend the functionality of Cloud Functions actions by using other Python packages.





 Packaging Python code with a Docker virtual environment in an archive 

You can package Python dependencies by using a virtual environment, virtualenv. By using the virtual environment, you can link more packages that can be installed by using [pip](https://packaging.python.org/en/latest/tutorials/installing-packages/).

This approach is recommended when you want to add additional required python packages. It ensures that the generated compressed action file is compatible with the Python runtime used for later execution of the action.

Before you begin



* [Review the packages that are included with the Python runtime](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-runtimesopenwhisk_ref_python_environments) to see whether a dependency of your app is already included with the runtime. If your dependency is not included, you must package it with your app.
* The following steps assume that you are running the commands on a Linux-based distribution on a processor with AMD64-based architecture.



Package your app by completing the following steps.



1. Create a directory that you can use to create your virtual environment. In this example, a test directory is created on the desktop. After you create the test directory, cd to it.

cd desktop; mkdir test; cd test
2. Create a [requirements.txt ![External link icon](https://cloud.ibm.com/docs-content/v1/content/adc643f3bedeea02b638bc1c34732852dcb40a45/icons/launch-glyph.svg)](https://pip.pypa.io/en/latest/user_guide/requirements-files) in your file in your test directory that contains the pip modules and versions to install.
!/usr/bin/env python3

import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), '..'))
from sdcclient import IbmAuthHelper, SdMonitorClient

 Parse arguments.
def usage():
print('usage: %s <endpoint-url> <apikey> <instance-guid>' % sys.argv[0])
print('endpoint-url: The endpoint URL that should point to IBM Cloud')
print('apikey: IBM Cloud IAM apikey that will be used to retrieve an access token')
print('instance-guid: GUID of an IBM Cloud Monitoring with monitoring instance')
sys.exit(1)

if len(sys.argv) != 4:
usage()

URL = sys.argv[1]
APIKEY = sys.argv[2]
GUID = sys.argv[3]

 Name for the dashboard to create
dashboard_name = "My new CPU dashboard"
 Existing dashboard to copy
existing_dashboard_name = "My Existing Dashboard"
 New filter to apply
scope_filter = 'host.hostName = "virtualserver02"'

 Instantiate the client
ibm_headers = IbmAuthHelper.get_headers(URL, APIKEY, GUID)
sdclient = SdMonitorClient(sdc_url=URL, custom_headers=ibm_headers)

 Copy a dashboard
ok, res = sdclient.create_dashboard_from_dashboard(dashboard_name, existing_dashboard_name, scope_filter, shared=False, public=True)

 Check the result

if ok:
print('Dashboard created successfully')
else:
print(res)
sys.exit(1)
Show more
The target directory /hana/shared/myHooks was already created for hook SAPHanaSR.py. Create a HA/DR provider hook in /hana/shared/myHooks. The following hook script is based on the HADRdummy.pysample.

On NODE2, edit the file /hana/shared/myHooks/SAPHanaCostOptSR.py and add the following content.

"""
Sample for a HA/DR hook provider.

When using your own code in here, please copy this file to location on /hana/shared outside the HANA installation.
This file will be overwritten with each hdbupd call! To configure your own changed version of this file, please add
to your global.ini lines similar to this:

[ha_dr_provider_<className>]
provider = <className>
path = /hana/shared/haHook
execution_order = 1

For all hooks, 0 must be returned in case of success.
"""

from __future__ import absolute_import
from hdb_ha_dr.client import HADRBase, Helper
from hdbcli import dbapi
import os, time

class SAPHanaCostOptSR(HADRBase):

def __init__(self, args, kwargs):
 delegate construction to base class
super(SAPHanaCostOptSR, self).__init__(args, kwargs)

def about(self):
return {"provider_company" : "SAP",
"provider_name" : "SAPHanaCostOptSR", provider name = class name
"provider_description" : "Handle reconfiguration event for cost-optimized system replication",
"provider_version" : "1.0"}

def postTakeover(self, rc, kwargs):
"""Post takeover hook."""

 prepared SQL statements to remove memory allocation limit and pre-load of column tables
pip3 install -r requirements.txt

setuptools facilitate packaging Python projects by enhancing the Python standard library distutils. The requirements.txt files install the Python libraries that are required in the script.
3. Run the following database migration script:

python3 db_migration.py







 Provide migration details 

After you run the database migration script, you need to provide the details for the following parameters:



* Object Storage
* Source server
* Source server database
* Target server
* Target server database





 Object Storage details 

The Object Storage bucket acts as centralized storage for the source and the target server. By using the s3fs utility, the bucket is mounted as a file system on both the source and target server. The source uses the bucket to store the database backup, and the target uses the bucket to retrieve the database backup, which minimizes the migration duration.

Complete the following steps to mount the Object Storage bucket:



1. Enter the Object Storage bucket name; for example, my-db-bucket. This is the name of the bucket that's already been provisioned.
2. Enter the Object Storage endpoint, which is the location of the bucket; for example, https://s3.dal.us.cloud-object-storage.appdomain.cloud. For more information, see [Endpoints and storage locations](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-endpoints).
3. Enter your IBM Cloud API key. For more information, see [Creating an IBM Cloud API key](https://www.ibm.com/docs/en/app-connect/containers_cd?topic=servers-creating-cloud-api-key).







 Source server details 

After you mount your Object Storage bucket, you need to provide your source server details:



1. Enter the source server IP address or hostname (this is the MySQL database that needs to be migrated).
2. Enter the source server login credentials. The script needs to authenticate with the username and password.
[External link icon](https://cloud.ibm.com/docs-content/v1/content/4d8c6eec891cff72b666dc24bd3211810c77fb42/icons/launch-glyph.svg)](https://sldn.softlayer.com/article/getting-started/)



For API usage examples, see the following resources:



* [Understanding and building an order by using the SoftLayer API order CLI](https://softlayer.github.io/article/understanding-ordering/)
* [SoftLayer API Examples - Release Notes](https://softlayer.github.io/)
* [Python examples](https://softlayer.github.io/python/)
Directory download in progress: 5632 bytes transferred
Directory download in progress: 1047552 bytes transferred
...
Directory download in progress: 53295130 bytes transferred
Directory download in progress: 62106855 bytes transferred
Download complete!





 Pause/Resume/Cancel 

The SDK provides the ability to manage the progress of file/directory transfers through the following methods of the AsperaTransferFuture object:



* pause()
* resume()
* cancel()



There are no side-effects from calling either of the methods outlined above. Proper clean up and housekeeping is handled by the SDK.

 Create Transfer manager
bucket_name = "<bucket-name>"
local_download_directory = "<absolute-path-to-directory>"
remote_directory = "<object prefix>"

with AsperaTransferManager(client) as transfer_manager:

 download a directory with Aspera
future = transfer_manager.download_directory(bucket_name, remote_directory, local_download_directory, None, None)

 pause the transfer
future.pause()

 resume the transfer
future.resume()

 cancel the transfer
future.cancel()
Show more





 Troubleshooting Aspera Issues 

Issue: Developers using any version of Python besides 3.6 may experience failures when installing or using Aspera SDK.

Cause: If there are different versions of Python installed on your environment, then you might encounter installation failures when you try to install the Aspera SDK. This can be caused by a missing DLL files or wrong DLL in path.

Solution: The first step to resolving this issue would be to reinstall the Aspera libraries. There might have been a failure during the installation. As a result this might have affected the DLL files. If that does not resolve the issues, then you will be required to update your version of Python. If you are unable to do this, then you can use installation [Intel® Distribution for Python*](https://software.intel.com/en-us/distribution-for-python).
Go 

Given its rapidly increasing popularity as a server-side language with strong cross-platform portability, Go support is imperative to increase adoption of your IBM Cloud service.



 Environment support 

Your Go SDK should support Go releases go1.12 and up.





 Publishing 

All Go SDKs should be publicly available in an [IBM GitHub organization](https://cloud.ibm.com/docs/sdk-handbook?topic=sdk-handbook-distributiondistribution-opensrc).

Your SDK should follow the [semantic versioning best practices](https://cloud.ibm.com/docs/sdk-handbook?topic=sdk-handbook-distributiondistribution-semver).





 Community support 

Allow your users to find answers to their questions. Users should be able to report problems on GitHub by raising issues on your SDK repository. Having a public Slack channel is a great way to engage with users who have questions specific to their use cases.





 Style guidelines 

You should follow the conventions from [Golang "Effective Go" style guide](https://golang.org/doc/effective_go.html).

You should use the standard [development tools](https://cloud.ibm.com/docs/sdk-handbook?topic=sdk-handbook-devtools) for Go to check style and code coverage.





 Streaming support 

If your API takes file parameters, you should accept Go file streams (e.g. io.ReadCloser) as an input type.





 Dependencies 

You should use the standard dependencies provided by Go, like net/http, os, strings, and fmt to write your code.





 Objects for arguments 

The methods of your SDK that represent operations of your service should take a single argument - an instance of an "options" struct. Each operation should have its own options struct which contains fields that represent the operation parameters.





 Standard features 



 Authentication 

You are not required to use a particular library to provide the authentication for your service.

Your SDK must support all of the authentication methods supported by your service.





 Configuration
Managing dashboards by using the Python client 

Use the Python Client to manage dashboards programmatically.

To learn how to use the Python client, see [Using the Python client](https://cloud.ibm.com/docs/monitoring?topic=monitoring-python-client).

To work with resources in a specific team, you must use the Monitoring (sysdig) token.

The following table lists some of the Python functions that you can use to manage dashboards:



Table 1. Dashboard Python functions

 Action Function 

 Create a dashboard sdclient.create_dashboard(dashboard_name) 
 Create a dashboard from a file sdclient.create_dashboard_from_file('dashboard_name', 'dashboard_name.json', scope_filter, shared=False, public=True) 
 Copy a dashboard sdclient.create_dashboard_from_dashboard(dashboard_name, existing_dashboard_name, scope_filter, shared=False, public=True) 
 Download a dashboard sdclient.get_dashboards() 
 Update a dashboard sdclient.update_dashboard(dashboard_name) 
 Delete a dashboard sdclient.delete_dashboard(dashboard_name) 
 Find a dashboard sdclient.find_dashboard_by(dashboard_name) 
 Add a time series sdclient.add_dashboard_panel(dashboard_name, panel_name, panel_type, metrics, scope=scope) 
 Add dashboard panel sdclient.add_dashboard_panel(dashboard_name, panel_name, panel_type, metrics, sort_direction=sort_direction, limit=limit, layout=layout) 
 Remove a panel sdclient.remove_dashboard_panel(dashboard_name, 'CPU Over Time') 
 Save a dashboard to a file sdclient.save_dashboard_to_file('dashboard_name', 'dashboard_name.json') 





 List dashboards per team 

You can use Python to list the dashboards available to teams.



 List the dashboards that are available in the default team 

The following code shows the structure of a Python script to list the dashboards available in the default team.

!/usr/bin/env python3
Your SDK needs to contain the following resources to help your users:



* README.md
* NPM metadata
* [Contributor guidelines](https://cloud.ibm.com/docs/sdk-handbook?topic=sdk-handbook-documentationsdk-contributor-docs)
* Code Samples
* [Service documentation](https://cloud.ibm.com/docs/sdk-handbook?topic=sdk-handbook-documentation)







 Samples 

For your JavaScript SDK, you will want some simple code samples and explanations of what each does. Linking out to the API reference documentation for more advanced use is strongly encouraged.

At minimum, the samples should be included in the README.md file. They should communicate how to install the library, and complete the basic operations provided by your API.

The samples should include JavaScript and TypeScript examples where applicable as well as simple installation and initialization instructions for Angular and React.