Tested on Amazon S3 with Amazon Linux 2023.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
with Image.open(image_path) as img: | |
img.load() | |
print(img.info) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
import json | |
def extract_workflow_from_png(image_path): | |
with Image.open(image_path) as img: | |
# Get all text chunks | |
for chunk in img.text.items(): | |
if chunk[0] == "workflow": | |
# Parse the JSON data | |
workflow_data = json.loads(chunk[1]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import awswrangler as wr | |
# Read multiple JSONs | |
# Paths are: s3://<bucket>/yyyy/mm/dd/filename.json | |
# Ref: https://aws-sdk-pandas.readthedocs.io/en/stable/tutorials/003%20-%20Amazon%20S3.html#2.3.2-Reading-JSON-by-prefix | |
df = wr.s3.read_json(f"s3://<bucket>/prefix/", lines=True).reset_index(drop=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use the native inference API to send a text message to Anthropic Claude. | |
import boto3 | |
import json | |
import base64 | |
import httpx | |
from botocore.exceptions import ClientError | |
# Create a Bedrock Runtime client in the AWS Region of your choice. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Hls.js demo - basic usage</title> | |
</head> | |
<body> | |
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/hls.min.js"></script> | |
<center> | |
<h1>Hls.js demo - basic usage</h1> | |
<video height="600" id="video" controls="" disableremoteplayback=""><source type="video/mp4"></video> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gist_id="YOUR_GIST_ID" # Replace with the actual Gist ID | |
download_path="." # Specify the download directory (optional) | |
# Get Gist information as JSON | |
gist_info=$(curl -s "https://api.github.com/gists/$gist_id") | |
# Extract file URLs using jq | |
file_urls=$(echo "$gist_info" | jq -r '.files[].raw_url') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I keep losing my keys. How can I keep track of them? |
👷♀️🚧🚧🚧👷 To strangers: this is a DRAFT. Don't do the same things as me!
Dependencies:
- Python 2.7 / 3.6
- Open Babel with Python Binding
- Officially recommended: Compile with Python Binding option enabled
- Compiling Open Babel (Latest Release: GitHub)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Revision list for Qwiklabs Challenge Labs: Classify Text into Categories with the Natural Language API (https://google.qwiklabs.com/focuses/12704?parent=catalog) |
NewerOlder