# Utility

{% hint style="info" %}
*Check out this walk-through on how to import a Utility scrip file to the DS Lab Project.*
{% endhint %}

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBLGYLEkBUnc8nVEBAuEI%2Fuploads%2FK9y7gVipiqTCE0gRlKvn%2FImporting%20Utility%20V2.mp4?alt=media&token=e2bb6abe-8f19-41ed-b599-f09662defd1c>" %}
***Importing a Utility Script file***
{% endembed %}

## Importing a Utility Script <a href="#importing-a-utility-script" id="importing-a-utility-script"></a>

* Navigate to the ***Utility*** tab for a Project.
* Click the ***Add Script*** option.

<figure><img src="https://2587201349-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBLGYLEkBUnc8nVEBAuEI%2Fuploads%2FrdbX1VlbFOaRYdEzCJAq%2Fimage.png?alt=media&#x26;token=07b115ed-00e5-43c5-8547-b2e049f64252" alt=""><figcaption></figcaption></figure>

* The ***Add utility script*** page opens.
* Select the Import Utility option.
* Provide a **Name for the Utility script.**
* Provide ***description*** for the Utility script.
* Use the ***Choose File*** option to import a Utility file from the system.

<figure><img src="https://2587201349-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBLGYLEkBUnc8nVEBAuEI%2Fuploads%2FmQWGz82RgXg2723QLwAy%2Fimage.png?alt=media&#x26;token=df2bf225-8d26-4248-a282-2cc98818b09e" alt=""><figcaption></figcaption></figure>

* After the file gets imported from the system, the file name appears next to the ***Choose File*** option.
* The ***Save*** option will be enabled, click the ***Save*** option.

<figure><img src="https://2587201349-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBLGYLEkBUnc8nVEBAuEI%2Fuploads%2Fa1rWcGMooYeQOdOWakW4%2Fimage.png?alt=media&#x26;token=0bb3766d-4eb1-418e-84e8-23645805eeca" alt=""><figcaption></figcaption></figure>

* A notification message appears.
* The imported script gets added under the Utility tab.

<figure><img src="https://2587201349-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBLGYLEkBUnc8nVEBAuEI%2Fuploads%2F0Nt4Vy7Z9LiM5w8SFqnq%2Fimage.png?alt=media&#x26;token=e015fd43-290c-4b5c-a660-2500a6518251" alt=""><figcaption></figcaption></figure>

## Importing the Utility Script inside a Notebook <a href="#importing-the-utility-script-inside-a-notebook" id="importing-the-utility-script-inside-a-notebook"></a>

* Copy a utility script name using the Utility list.
* Navigate to the Notebook tab.

<figure><img src="https://2587201349-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBLGYLEkBUnc8nVEBAuEI%2Fuploads%2FmdVrKl2219FMPk9maqLD%2Fimage.png?alt=media&#x26;token=138747ac-0886-4405-a63a-e323737e4423" alt=""><figcaption></figcaption></figure>

* Upload a Notebook or create a new Notebook and Navigate to the Notebook page.
* Add a ***Code*** ***cell***.
* Write code to import data with specific class.
* Provide the Utility script as the resource to get data.
* Specify the variables to get the class and get the data in the next code cell.
* Provide print function to see the data.
* Run all the cells.
* You can get the output below.​

<figure><img src="https://2587201349-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBLGYLEkBUnc8nVEBAuEI%2Fuploads%2F5RiAUUuGUGdgRp0ZP2V9%2Fimage.png?alt=media&#x26;token=42f8e8e9-f995-4e20-a5f4-005abc52333d" alt=""><figcaption></figcaption></figure>

## Updating the Utility Script

* Navigate to the ***Utility*** tab.
* Select an uploaded utility script from the list.
* Click the ***Edit*** icon.        &#x20;

<figure><img src="https://2587201349-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBLGYLEkBUnc8nVEBAuEI%2Fuploads%2Fhb7uZMNnZsEt8FXqIqY4%2Fimage.png?alt=media&#x26;token=1b6959cf-fb1c-4e7b-a7a2-ba754e223ac7" alt=""><figcaption></figcaption></figure>

* The ***Update Utility Script*** page opens displaying the utility script content.
* Click the ***Validate*** option.

<figure><img src="https://2587201349-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBLGYLEkBUnc8nVEBAuEI%2Fuploads%2FKMuYGGW7Y95ykntW50bB%2Fimage.png?alt=media&#x26;token=0ce7549d-154e-4ea8-b546-48abbba94d12" alt=""><figcaption></figcaption></figure>

* The Logs will be displayed in the Logs space.
* Click the ***Update*** option.

<figure><img src="https://2587201349-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBLGYLEkBUnc8nVEBAuEI%2Fuploads%2FckdXC8M5kbnNrHvelbbe%2Fimage.png?alt=media&#x26;token=6c81567a-cf8e-43af-9810-5b3ba5a462e1" alt=""><figcaption></figcaption></figure>

* A success message appears.
* The selected Utility script gets updated.

<figure><img src="https://2587201349-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBLGYLEkBUnc8nVEBAuEI%2Fuploads%2FKFJDLheNehnl5Or8HXV0%2Fimage.png?alt=media&#x26;token=e52e795c-12d5-47bc-8d0f-77f0a97b7925" alt=""><figcaption><p><em><strong>the Utility Script get updated.</strong></em></p></figcaption></figure>

{% hint style="info" %}
*<mark style="color:green;">Please Note:</mark>*&#x20;

* The name of the selected utility script cannot be changed by using the update option.
* *Refer the* [***Data Science Lab Quick Start Flow*** ](https://docs.bdb.ai/data-science-lab-3/data-science-lab-quick-start-flow)*page to get an overview of the **Data Science Lab** module in nutshell.*&#x20;
  {% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bdb.ai/data-science-lab-3/project/tabs-for-a-data-science-lab-project/tabs-for-tensorflow-and-pytorch-environment/utility.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
