Skip to content

Instantly share code, notes, and snippets.

View bewestphal's full-sized avatar
🤠
Get that hitter

Brian Westphal bewestphal

🤠
Get that hitter
View GitHub Profile
@bewestphal
bewestphal / Json2XML
Created June 1, 2016 06:17
Python Function to Convert JSON to XML
def json2xml(json_obj, tag_name=None):
result_list = list()
json_obj_type = type(json_obj)
if json_obj_type is list:
for sub_elem in json_obj:
result_list.append("\n<%s>" % (tag_name))
result_list.append(json2xml(sub_elem, tag_name=tag_name))
tag_name = re.sub('\s\w+="\w+"', '', tag_name)
@bewestphal
bewestphal / .inputrc
Created November 9, 2019 02:19
Mac Terminal Autocomplete Configuration
set completion-ignore-case on
set show-all-if-ambiguous on
TAB: menu-complete
@bewestphal
bewestphal / generate_gif.sh
Created November 11, 2019 05:19
CS6475 Generate Texture GIF
#!/bin/bash
# Turns images produced by texture info a gif
INPUT_DIR=candle
ALPHA=0.005
source ~/.bashrc
eval "$(conda shell.bash hook)"
rm -rf videos/out/${INPUT_DIR}
@bewestphal
bewestphal / _description.md
Last active January 10, 2024 00:11
Ray Serve Unit Testing Examples

Ray Serve Unit Test Examples

1. test_deployment_class.py

Demonstrates how to test a Ray serve deployment class directly without spinning up a Ray cluster.

The key method: func_or_class, allows accessing the underlying class directly where normally, the class would be revised to a Ray serve deployment type due to the @serve.deployment decorator.

2. test_deployment_requests.py