File size: 22,157 Bytes
d5d908d
 
 
88824ab
d5d908d
 
 
64c54b6
 
 
 
 
 
 
d5d908d
 
 
 
 
 
 
 
 
88824ab
 
 
e7448b2
9d67e56
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88824ab
d5d908d
4c594fb
a45fc81
ade5f62
507df33
ade5f62
507df33
3768ed9
507df33
64c54b6
507df33
138a454
507df33
138a454
64c54b6
a45fc81
138a454
a45fc81
138a454
 
 
 
49da9e5
 
 
 
 
 
 
 
 
 
 
bfaeb07
49da9e5
 
 
 
 
 
 
 
 
 
 
bfaeb07
49da9e5
 
8afdf83
49da9e5
 
bfaeb07
138a454
 
 
2d58f3f
1c7eea6
 
 
586758a
 
 
 
1c7eea6
 
 
138a454
 
 
 
 
 
 
 
 
648ac52
138a454
 
2c689b9
 
 
 
138a454
 
 
 
 
 
7fb8c25
 
690efaf
 
 
 
354cfe9
690efaf
 
 
 
 
 
 
 
138a454
690efaf
 
 
 
 
 
 
 
 
 
 
138a454
8a907f7
 
 
 
354cfe9
76aff1f
 
8a907f7
2d58f3f
 
8a907f7
2d58f3f
 
 
 
 
 
 
 
 
 
138a454
 
 
 
 
 
d2425c2
138a454
 
690efaf
 
 
354cfe9
690efaf
 
 
 
 
 
 
 
354cfe9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8a907f7
 
 
 
354cfe9
138a454
 
 
 
354cfe9
 
 
 
 
 
 
 
 
138a454
 
d2425c2
 
 
 
99eb419
690efaf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d2425c2
690efaf
 
d2425c2
 
 
 
 
 
 
ec6cbf0
 
 
99eb419
ec6cbf0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99eb419
ec6cbf0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99eb419
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
464032f
99eb419
 
 
 
 
 
 
 
066849c
99eb419
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
138a454
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
---
language:
- en
license: apache-2.0
library_name: transformers
tags:
- python
- java
- cpp
- sql
- function calling
- unit tests
- causalLM
- codeLLAMA modified archi
- document
- code
- code2doc
- instruction_tuned
- basemodel
- pytorch
- docstring
- documentation
- text-generation-inference
metrics:
- accuracy
pipeline_tag: text-generation
widget:
- text: '<example_response>--code:def function_divide2(x): return x / 2--question:Document
    the code--doc:Description:This function takes a number and divides it by 2.Parameters:-
    x (numeric): The input value to be divided by 2.Returns:- float: The result of
    x divided by 2.Example:To call the function, use the following code:function_divide2(1.0)</example_response><function_code>def
    _plot_bounding_polygon(polygons_coordinates, output_html_path=bounding_polygon_map.html):map_center
    = [sum([coord[0]for polygon_coords in polygons_coordinatesfor coord in polygon_coords])/
    sum([len(polygon_coords) for polygon_coords in polygons_coordinates]),sum([coord[1]for
    polygon_coords in polygons_coordinatesfor coord in polygon_coords])/ sum([len(polygon_coords)
    for polygon_coords in polygons_coordinates]),]my_map = folium.Map(location=map_center,
    zoom_start=12)for polygon_coords in polygons_coordinates:folium.Polygon(locations=polygon_coords,color=blue,fill=True,fill_color=blue,fill_opacity=0.2,).add_to(my_map)marker_cluster
    = MarkerCluster().add_to(my_map)for polygon_coords in polygons_coordinates:for
    coord in polygon_coords:folium.Marker(location=[coord[0], coord[1]], popup=fCoordinates:
    {coord}).add_to(marker_cluster)draw = Draw(export=True)draw.add_to(my_map)my_map.save(output_html_path)return
    output_html_path</function_code><question>Document the python code above giving
    function description ,parameters and return type and example how to call the function</question><doc>'
  example_title: example
---
# pip-library-etl-1.3b

[pipableAi](https://www.pipable.ai/)

[colab_notebook](https://colab.research.google.com/drive/10av3SxFf0Psx_IkmZbcUhiVznStV5pVS?usp=sharing)

[pip etl](https://github.com/PipableAI/pip-library-etl)



## How we built it?

We used softmax cross entropy and a modified form of policy grad along with Q loss, optimized in an EM set up.
The performance for the metioned tasks are comparable to much bigger LLMs and GPT-3.5

## License

The model is open source under apache 2.0. License

## Usage

### NOTE:


If you wish to try this model without utilizing your GPU, we have hosted the model on our end. To execute the library using the hosted playground model, initialize the generator as shown below:

```python
from pip_library_etl import PipEtl

generator = PipEtl(device="cloud")
```

We have hosted the model at https://playground.pipable.ai/infer. Hence, one can also make a POST request to this endpoint with the following payload:

```json
{
    "model_name": "PipableAI/pip-library-etl-1.3b",
    "prompt": "prompt",
    "max_new_tokens": "400"
}
```

```bash
curl -X 'POST' \
  'https://playground.pipable.ai/infer' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'model_name=PipableAI%2Fpip-library-etl-1.3b&prompt="YOUR PROMPT"&max_new_tokens=400'
```

Alternatively, you can directly access UI endpoint at https://playground.pipable.ai/docs#/default/infer_infer_post.

### Library use

For directly using the capabilities of model without putting extra efforts on schems and prompts try to use [pip library_etl](https://github.com/PipableAI/pip-library-etl.git).

Here's a brief overview of what can be achieved using the PipEtl library:

- `Function Call Generation` : The generate_function_call method facilitates the generation of Python function calls based on provided questions and either docstrings or undocumented code. This feature can be useful for generating example function calls or for prototyping code snippets.
- `Automated Documentation Generation` : With the generate_docstring method, users can automatically generate comprehensive docstrings for Python functions. This feature aids in maintaining well-documented codebases and adhering to best practices.
- `Module Documentation` : The generate_module_docstrings method allows for generating documentation for all methods and functions within a given module or package. This capability streamlines the documentation process, especially for large codebases with numerous functions.
- `SQL Query Generation` : Users can leverage the generate_sql method to automatically generate SQL queries based on provided schemas and questions. This functionality simplifies the process of creating SQL queries, particularly for data-related tasks.

For detailed usage refer to the [colab_notebook](https://colab.research.google.com/drive/17PyMU_3QN9LROy7x-jmaema0cuLRzBvc?usp=sharing)


### Installation

```bash
pip install transformers
```

### Prompt
```python
prompt = f"""<example_response>{--question , --query}</example_response><function_code>{code}</function_code>
<question>Give one line description of the python code above in natural language.</question>
<doc>"""

prompt = f"""<example_response>{example of some  --question: , --query}</example_response><schema>{schema with cols described}</schema>
<question>Write a sql query to ....</question>
<sql>"""
```

### PyTorch
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
device = "cuda"
model = AutoModelForCausalLM.from_pretrained("PipableAI/pip-library-etl-1.3b").to(device)
tokenizer = AutoTokenizer.from_pretrained("PipableAI/pip-library-etl-1.3b")
prompt = f"""
<example_response>
--code:def divide_by_two(x: float) -> float: return x / 2
--question:Document the python code above giving function description ,parameters and return type and example on how to call the function
--doc:
Description: This function divides a given number by 2.
Parameters:
- x (float): The input value to be divided by 2.
Returns:
- float: The result of x divided by 2.
Example:
divide_by_two(1.0)
</example_response>
<function_code>
def download_file(shared_url, destination):
    try:
        if not shared_url.startswith("https://drive.google.com"):
            raise ValueError("Please provde a valid google drive link.")
        file_id = shared_url.split("/d/")[1]
        file_id = file_id.split("/")[0]
        url = f"https://drive.google.com/uc?id={file_id}"
        gdown.download(url, destination, quiet=False)
    except Exception as e:
        print(f"Error downloading file from Google Drive as {e}")
        raise e
</function_code>
<instructions> 
1. In the examples while calling function use the name mentioned after `def ` in the above function_code.
2. In the generated docs use valid python type hints as per PEP 484.
</instructions>
<question>Document the python code above giving function description ,parameters and return type and example how to call the function.</question>
<doc>
"""
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=450)
doc = (
    tokenizer.decode(outputs[0], skip_special_tokens=True)
    .split("<doc>")[-1]
    .split("</doc>")[0]
)
doc = (
    doc.replace("<p>", "")
    .replace("</p>", "")
    .replace("<function_description>", "")
    .replace("</function_description>", "")
)
print(doc)
```



## Examples

### 1. Code Documentation
### prompt
```python
prompt ='''<example_response>
--code:def divide_by_two(x: float) -> float: return x / 2
--question:Document the python code above giving function description ,parameters and return type and example on how to call the function
--doc:
Description: This function divides a given number by 2.
Parameters:
- x (float): The input value to be divided by 2.
Returns:
- float: The result of x divided by 2.
Example:
divide_by_two(1.0)
</example_response>
<function_code>def _plot_bounding_polygon(
    polygons_coordinates, output_html_path="bounding_polygon_map.html"
):
    # Create a Folium map centered at the average coordinates of all bounding boxes
    map_center = [
        sum(
            [
                coord[0]
                for polygon_coords in polygons_coordinates
                for coord in polygon_coords
            ]
        )
        / sum([len(polygon_coords) for polygon_coords in polygons_coordinates]),
        sum(
            [
                coord[1]
                for polygon_coords in polygons_coordinates
                for coord in polygon_coords
            ]
        )
        / sum([len(polygon_coords) for polygon_coords in polygons_coordinates]),
    ]

    my_map = folium.Map(location=map_center, zoom_start=12)

    # Add each bounding polygon to the map
    for polygon_coords in polygons_coordinates:
        folium.Polygon(
            locations=polygon_coords,
            color="blue",
            fill=True,
            fill_color="blue",
            fill_opacity=0.2,
        ).add_to(my_map)

    # Add bounding boxes as markers to the map
    marker_cluster = MarkerCluster().add_to(my_map)

    for polygon_coords in polygons_coordinates:
        for coord in polygon_coords:
            folium.Marker(
                location=[coord[0], coord[1]], popup=f"Coordinates: {coord}"
            ).add_to(marker_cluster)

    # Add draw control to allow users to draw additional polygons
    draw = Draw(export=True)
    draw.add_to(my_map)

    # Save the map as an HTML file
    my_map.save(output_html_path)

    return output_html_path
    </function_code>
    <instructions> 
    1. In the examples while calling function use the name mentioned after `def ` in the above function_code.
    2. In the generated docs use valid python type hints as per PEP 484.
    </instructions>
    <question>Document the python code above giving function description ,parameters and return type and example how to call the function</question><doc>'''
```

### Response
```txt
 Description:This function generates a map of the bounding polygons and saves it as an HTML file.
    Parameters:
    - polygons_coordinates (list of lists of tuples): A list of lists of tuples representing the coordinates of the polygons. Each polygon is a list of coordinates.
    - output_html_path (str, optional): The path where the HTML file should be saved. Defaults to "bounding_polygon_map.html".
    Returns:
    - str: The path to the saved HTML file.
    Example:
    To call the function, use the following code:
    plot_bounding_polygon([[(0, 0), (1, 0), (1, 1), (0, 1)], [(2, 2), (3, 2), (3, 3), (2, 3)]], "my_map.html").
```


### 2. SQL Generation
### prompt
```python
prompt = """Generate a simple SQL query from the schema mentioned for the following question.
<schema>
CREATE TABLE department (
  Department_ID number,         -- Unique identifier for the department
  Name text,                     -- Name of the department
  Creation text,                 -- Date of creation or establishment
  Ranking number,                -- Ranking of the department
  Budget_in_Billions number,     -- Budget of the department in billions
  Num_Employees number          -- Number of employees in the department
);

CREATE TABLE head (
  head_ID number,                -- Unique identifier for the head
  name text,                     -- Name of the head
  born_state text,               -- State where the head was born
  age number                     -- Age of the head
);

CREATE TABLE management (
  department_ID number,          -- Foreign key referencing Department_ID in department table
  head_ID number,                -- Foreign key referencing head_ID in head table
  temporary_acting text          -- Indicates if the head is temporarily acting
);
</schema>
<question>What are the names of the heads who are born outside the California state?</question>
<sql>
"""
```

### response
```sql
SELECT head.name FROM head WHERE head.born_state <> 'California';
```

### 3. Performance Schema Monitoring
### prompt
```python
prompt = """Generate the SQL query for SkySQL performance schema for the following question.
<example>
--question: What are the top 10 most frequently used queries/statements?
--sql: SELECT DIGEST_TEXT, COUNT(*) as frequency FROM performance_schema.events_statements_summary_by_digest GROUP BY DIGEST_TEXT ORDER BY frequency DESC LIMIT 10;
</example>
<schema>
CREATE TABLE `accounts` (`USER` char(128)  DEFAULT NULL -- 'The connection''s client user name for the connection, or NULL if an internal thread.',
  `HOST` char(255)  DEFAULT NULL -- 'The connection client''s host name, or NULL if an internal thread.',
  `CURRENT_CONNECTIONS` bigint(20) NOT NULL -- 'Current connections for the account.',\n
  `TOTAL_CONNECTIONS` bigint(20) NOT NULL -- 'Total connections for the account.'
) ;
</schema>
<question>
Tell me the number of active connections each user has.
</question>
<sql>
"""
```
### response
```sql
SELECT USER, CURRENT_CONNECTIONS FROM accounts;
```

### prompt
```python
prompt = """Generate the SQL query for SkySQL performance schema for the following question.
<example>
--question: What are the top 10 most frequently used queries/statements?
--sql: SELECT DIGEST_TEXT, COUNT(*) as frequency FROM performance_schema.events_statements_summary_by_digest GROUP BY DIGEST_TEXT ORDER BY frequency DESC LIMIT 10;
</example>
<schema>
CREATE TABLE `file_summary_by_instance` (
    `FILE_NAME` varchar(512) NOT NULL -- 'File name.',
    `EVENT_NAME` varchar(128) NOT NULL -- 'Event name.',
    `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned NOT NULL -- 'Address in memory. Together with FILE_NAME and EVENT_NAME uniquely identifies a row.',
    `COUNT_STAR` bigint(20) unsigned NOT NULL -- 'Number of summarized events',
    `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL -- 'Total wait time of the summarized events that are timed.',
    `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL -- 'Minimum wait time of the summarized events that are timed.',
    `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL -- 'Average wait time of the summarized events that are timed.',
    `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL -- 'Maximum wait time of the summarized events that are timed.',
    `COUNT_READ` bigint(20) unsigned NOT NULL -- 'Number of all read operations, including FGETS, FGETC, FREAD, and READ.',
    `SUM_TIMER_READ` bigint(20) unsigned NOT NULL -- 'Total wait time of all read operations that are timed.',
    `MIN_TIMER_READ` bigint(20) unsigned NOT NULL -- 'Minimum wait time of all read operations that are timed.',
    `AVG_TIMER_READ` bigint(20) unsigned NOT NULL -- 'Average wait time of all read operations that are timed.',
    `MAX_TIMER_READ` bigint(20) unsigned NOT NULL -- 'Maximum wait time of all read operations that are timed.',
    `SUM_NUMBER_OF_BYTES_READ` bigint(20) NOT NULL -- 'Bytes read by read operations.',
    `COUNT_WRITE` bigint(20) unsigned NOT NULL -- 'Number of all write operations, including FPUTS, FPUTC, FPRINTF, VFPRINTF, FWRITE, and PWRITE.',
    `SUM_TIMER_WRITE` bigint(20) unsigned NOT NULL -- 'Total wait time of all write operations that are timed.',
    `MIN_TIMER_WRITE` bigint(20) unsigned NOT NULL -- 'Minimum wait time of all write operations that are timed.',
    `AVG_TIMER_WRITE` bigint(20) unsigned NOT NULL -- 'Average wait time of all write operations that are timed.',
    `MAX_TIMER_WRITE` bigint(20) unsigned NOT NULL -- 'Maximum wait time of all write operations that are timed.',
    `SUM_NUMBER_OF_BYTES_WRITE` bigint(20) NOT NULL -- 'Bytes written by write operations.',
    `COUNT_MISC` bigint(20) unsigned NOT NULL -- 'Number of all miscellaneous operations not counted above, including CREATE, DELETE, OPEN, CLOSE, STREAM_OPEN, STREAM_CLOSE, SEEK, TELL, FLUSH, STAT, FSTAT, CHSIZE, RENAME, and SYNC.',
    `SUM_TIMER_MISC` bigint(20) unsigned NOT NULL -- 'Total wait time of all miscellaneous operations that are timed.',
    `MIN_TIMER_MISC` bigint(20) unsigned NOT NULL -- 'Minimum wait time of all miscellaneous operations that are timed.',
    `AVG_TIMER_MISC` bigint(20) unsigned NOT NULL -- 'Average wait time of all miscellaneous operations that are timed.',
    `MAX_TIMER_MISC` bigint(20) unsigned NOT NULL -- 'Maximum wait time of all miscellaneous operations that are timed.'
    );
</schema>
<question>
List out 10 names of the files with the most read and writes
</question>
<sql>
"""
```

### response
```sql
SELECT FILE_NAME FROM file_summary_by_instance ORDER BY SUM_NUMBER_OF_BYTES_READ DESC, SUM_NUMBER_OF_BYTES_WRITE DESC LIMIT 10;
```


### 4. Function Calling

### prompt
```python
prompt = """
Give a function call in python langugae for the following question:
<example_response>
--doc: Description: This function logs a curl command in debug mode.
Parameters:
- method (str): The HTTP method to use for the request.
- url (str): The URL to send the request to.
- data (dict, optional): The data to send in the request. Defaults to None.
- headers (dict, optional): The headers to send with the request. Defaults to None.
- level (int, optional): The log level to use for this log message. Defaults to logging.DEBUG.
Returns:
- None
Example:
log_curl_debug('GET', 'https://example.com')
--question: log a curl PUT request for url https://web.io/
--function_call: log_curl_debug(method='PUT', url = 'https://web.io')
</example_response>
<doc>
Function Name: make_get_req()
Description: This function is used to make a GET request.
Parameters:
- path (str): The path of the URL to be requested.
- data (dict): The data to be sent in the body of the request.
- flags (dict): The flags to be sent in the request.
- params (dict): The parameters to be sent in the request.
- headers (dict): The headers to be sent in the request.
- not_json_response (bool): OPTIONAL: If set to True, the function will return the raw response content instead of trying to parse it as JSON.
- trailing (str): OPTIONAL: For wrapping slash symbol in the end of string.
- absolute (bool): OPTIONAL: If set to True, the function will not prefix the URL with the base URL.
- advanced_mode (bool): OPTIONAL: If set to True, the function will return the raw response instead of trying to parse it as JSON.
Returns:
- Union[str, dict, list, None]: The response content as a string, a dictionary, a list, or None if the response was not successful.
</doc>
<instruction>
1. Strictly use named parameters mentioned in the doc to generate function calls.
2. Only return the response as python parsable string version of function call.
3. mention the 'self' parameter if required.
</instruction>
<question>
Make a GET request for the URL parameter using variable_2. For the params parameter, use 'weight' as one of the keys with variable_3 as its value, and 'width' as another key with a value of 10. For the data parameter, use variable_1. Prefix the URL with the base URL, and ensure the response is in raw format.
</question>
<function_call>
"""
```

### response
```python
make_get_req(path='https://example.com/api/v1/users', data=variable_1, params={'weight': variable_3, 'width': 10}, headers={'Content-Type': 'application/json'}, not_json_response=True, absolute=True)
```

### prompt
```python
prompt = """
Give only function call in python langugae as response for the following question:
<example_response>
--doc:
Function:
Help on function head in module pandas.core.generic:

head(self, n: 'int' = 5) -> 'Self'
Return the first `n` rows.

This function returns the first `n` rows for the object based
on position. It is useful for quickly testing if your object
has the right type of data in it.

For negative values of `n`, this function returns all rows except
the last `|n|` rows, equivalent to ``df[:n]``.

If n is larger than the number of rows, this function returns all rows.

Parameters
----------
n : int, default 5
Number of rows to select.

Returns
-------
same type as caller
The first `n` rows of the caller object.

See Also
--------
DataFrame.tail: Returns the last `n` rows.

Examples
--------
>>> df = pd.DataFrame({'animal': ['alligator', 'bee', 'falcon', 'lion',
... 'monkey', 'parrot', 'shark', 'whale', 'zebra']})
>>> df
animal
0 alligator

--question: Get the top 5 rows with the highest Engagement_Score. Parameter Description: Use 5 as Number of rows to return ,Use variable_3 as Sorted DataFrame, Do not call any other function, Pass variable to self parameter for method calls
--function_call: head(self=variable_3, n=5)
</example_response>
<doc>
Function: sort_values
sort_values in module pandas.core.frame:
sort_values(self, by: 'IndexLabel', *, axis: 'Axis' = 0, ascending: 'bool | list[bool] | tuple[bool, ...]' = True, inplace: 'bool' = False, kind: 'SortKind' = 'quicksort', na_position: 'str' = 'last', ignore_index: 'bool' = False, key: 'ValueKeyFunc | None' = None) -> 'DataFrame | None'
Sort by the values along either axis.
Parameters
----------
by : str or list of str
Name or list of names to sort by.

- if `axis` is 0 or `'index'` then `by` may contain index
levels and/or column labels.
- if `axis` is 1 or `'columns'` then `by` may contain column
levels and/or index labels.
axis : "{0 or 'index', 1 or 'columns'}", default 0
Axis to be sorted.
ascending : bool or list of bool, default True
Sort ascending vs. descending. Specify list for multiple sort
orders. If this is a list of bools, must match the length of
the 
</doc>
<instruction>
1. Strictly use named parameters mentioned in the doc to generate function calls.
2. Only return the response as python parsable string version of function call.
3. Use the 'self' parameter if required in the function call with it's value in named keyword format.
</instruction>
<question>
Using the above function, Sort the DataFrame by the Engagement_Score in descending order. Parameter Description: Use Engagement_Score as Column name to sort by ,Use False as Sort in descending order ,Use variable_1 as DataFrame to sort, Do not call any other function, Pass variable to self parameter for method calls
</question>
<function_call>
"""
```
### response
```python
sort_values(self=variable_1, by='Engagement_Score', ascending=False)
```



### Team
Avi Kothari, Gyan Ranjan, Pratham Gupta, Ritvik Aryan Kalra, Soham Acharya