This file contains hidden or 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 | |
from mcp import ClientSession, StdioServerParameters | |
from mcp.client.stdio import stdio_client | |
import asyncio | |
from google import genai | |
from google.genai import types | |
from google.genai.types import Tool, FunctionDeclaration | |
server_params = StdioServerParameters( | |
command="python", |
This file contains hidden or 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 gzip | |
import json | |
import logging | |
import os | |
from StringIO import StringIO | |
from datetime import datetime, timedelta | |
firehose = boto3.client('firehose') | |
ec2 = boto3.client('ec2') |
This file contains hidden or 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 bs4 import BeautifulSoup | |
import requests | |
import argparse | |
import csv | |
def getPageSource(url, result_path): | |
if not url: | |
print "No url entered" | |
return None | |
source = requests.get(url, verify=False).text |
This file contains hidden or 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
# recursion approach | |
def iterCount(numList, itemCount, maxIteration): | |
if itemCount == 0: | |
return numList | |
outputList = [] | |
lastSeen = numList[0] | |
count = 1 | |
if len(numList) == 1: |
This file contains hidden or 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
def getMaxFromList(max, items): | |
""" | |
Function to return the max integer found in the list. This could be a recursive call where the max value is compared with the items in the list and the if an item greater than max is found then | |
we set max to that item value and return max | |
@param max: Maximum value found in the root array so far | |
@type max: integer | |
@param items: List of items that includes items and other lists |