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 os | |
import boto3 | |
from tqdm import tqdm | |
s3_client = boto3.client('s3') | |
def upload_and_sign(file_path, bucket): | |
file_name = os.path.basename(file_path) | |
file_size = os.path.getsize(file_path) |
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 os | |
import boto3 | |
s3_client = boto3.client('s3') | |
def upload_and_sign(file_path, bucket): | |
file_name = os.path.basename(file_path) | |
s3_client.upload_file(file_path, bucket, file_name) |
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 json | |
from typing import List, Dict, Optional | |
def parse_and_validate_recommendations(llm_output: str) -> List[Dict[str, str]]: | |
try: | |
# Attempt to parse the JSON output | |
data = json.loads(llm_output) | |
# Validate the structure of the parsed data | |
if not isinstance(data, list): |
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 boto3 | |
client = boto3.client('bedrock-runtime', region_name='us-east-1') | |
model_id = 'anthropic.claude-3-sonnet-20240229-v1:0' | |
user_message = "Who is Alan Ford, the comic book character?" | |
conversation = [ | |
{ | |
"role": "user", | |
"content": [{"text":user_message}], |
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 boto3 | |
import os | |
# Set up AWS credentials (fetch from environment variables) | |
session = boto3.Session() | |
bedrock_client = session.client('bedrock-runtime') | |
# Set the model ID for Anthropic Claude 3 Sonnet | |
model_id = "anthropic.claude-3-sonnet-20240229-v1:0" |
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
#!/bin/bash | |
# function that shows you how to use this tool | |
usage() { | |
echo "Usage $0 [-o outfile] [-d outdir] [-f fps]" | |
echo " -o: Specify the output file (default: screen_rec_<current_time_and_date>.mp4)" | |
echo " -d: Specify the output directory (default: ./)" | |
echo " -f: Specify the fps (default: 30)" | |
exit 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 * as cdk from 'aws-cdk-lib'; | |
import * as apigateway from 'aws-cdk-lib/aws-apigateway'; | |
import * as dynamodb from 'aws-cdk-lib/aws-dynamodb'; | |
import * as iam from 'aws-cdk-lib/aws-iam'; | |
import * as lambda from 'aws-cdk-lib/aws-lambda'; | |
import * as pylambda from '@aws-cdk/aws-lambda-python-alpha'; | |
import * as lambdaEventSources from 'aws-cdk-lib/aws-lambda-event-sources'; | |
import * as sqs from 'aws-cdk-lib/aws-sqs'; | |
import { Construct } from 'constructs'; |
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 boto3 | |
from InquirerPy import inquirer | |
# Create an Amazon Bedrock Runtime client | |
bedrock_client = boto3.client('bedrock-runtime') | |
# dictionary that contains multiple model ids | |
model_ids = [ |
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
10 GOSUB 1100 | |
11 HOME | |
20 GOSUB 1000 | |
30 GOSUB 30 | |
40 HTAB X: VTAB Y | |
50 PRINT "Hello Internet"; | |
60 FOR I = 1 TO 1000 | |
70 NEXT I | |
80 GOTO 11 | |
100 REM randomize x and y |
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
/// @ts-check | |
/// <reference path="./node_modules/@types/p5/global.d.ts" /> | |
//const p5 = require("./node_modules/@types/p5"); | |
const CANVAS_WIDTH = 400; | |
const CANVAS_HEIGHT = 400; | |
const CANVAS_COLOR = 'pink'; | |
let number_of_circles = 50; | |
let circle_colors = ['purple', 'blue', 'red', 'cyan', 'green', 'magenta', 'indigo'] |
NewerOlder