chore: import upstream snapshot with attribution
Validate YAML Workflows / Validate YAML Configuration Files (push) Has been cancelled
Validate YAML Workflows / Validate YAML Configuration Files (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
# Python Scratchpad Examples
|
||||
|
||||
Example: sum a list of numbers
|
||||
|
||||
```python
|
||||
numbers = [14, 27, 31, 8]
|
||||
print(sum(numbers))
|
||||
```
|
||||
|
||||
Expected structured result with `execute_code`:
|
||||
|
||||
```json
|
||||
{
|
||||
"ok": true,
|
||||
"exit_code": 0,
|
||||
"stdout": "80\n",
|
||||
"stderr": ""
|
||||
}
|
||||
```
|
||||
|
||||
Example: convert JSON to a sorted compact structure
|
||||
|
||||
```python
|
||||
import json
|
||||
|
||||
payload = {"b": 2, "a": 1, "nested": {"z": 3, "x": 2}}
|
||||
print(json.dumps(payload, sort_keys=True))
|
||||
```
|
||||
|
||||
Example: count words in text
|
||||
|
||||
```python
|
||||
text = "agent skills can trigger targeted workflows"
|
||||
print(len(text.split()))
|
||||
```
|
||||
|
||||
Example: test a regex
|
||||
|
||||
```python
|
||||
import re
|
||||
|
||||
text = "Order IDs: ORD-100, BAD-7, ORD-215"
|
||||
matches = re.findall(r"ORD-\d+", text)
|
||||
print(matches)
|
||||
```
|
||||
Reference in New Issue
Block a user