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 | |
import requests | |
from operator import itemgetter | |
from io import BytesIO | |
def get_exhibition_by_name(s): | |
url = "https://openaccess-api.clevelandart.org/api/exhibitions/" | |
params = { | |
"title": s |
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
# open access image urls | |
acc_nbr = "1922.1133" | |
url = f"https://openaccess-cdn.clevelandart.org/{acc_nbr}/{acc_nbr}_web.jpg" | |
print(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
## In CMA Tessitura Module, either add it to an existing class or create a new class/module | |
def post_custom_execute(self, procedure_id: int, procedure_name: str, **kwargs): | |
""" | |
Executes a custom procedure already registered in the Tessitura | |
Database. | |
""" | |
endpoint = "Custom/Execute" | |
params = { | |
"ProcedureId": procedure_id, | |
"ProcedureName": procedure_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
convert IMG-TRM-1916-1038.jpg -alpha on -background none \( +clone -channel a -evaluate multiply 0 +channel -fill white -draw "translate 1500,1000 circle 0,0 0,150" \) -compose DstIn -composite -trim out.png |
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
#!/usr/bin/python | |
import base64 | |
import re | |
import requests | |
import simplejson as json | |
from bs4 import BeautifulSoup as bs | |
########################## |
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
@classmethod | |
@pre_save | |
def handle_user_save(cls, sender, document, **kwargs): | |
# Don't save user if Roles are not defined | |
if Roles.objects(name__in=['authenticated', 'admin']).count() != 2: | |
message = "Missing required base roles" | |
raise ValidationError(message) | |
if not document.is_new() and \ | |
not (getattr(document, 'confirm_password', None) and getattr(document, 'password')): |
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
projects_root=/Users/ethanholda/projects | |
# client_repo=https://github.com/nysci/choreograph.git | |
# client_dir=/Users/ethanholda/projects/nysci-client-repos/nysci-ios-choreograph | |
# local_dir=/Users/ethanholda/projects/nysci-ios-choreograph | |
# client_repo=https://github.com/nysci/volumize.git | |
# client_dir=/Users/ethanholda/projects/nysci-client-repos/nysci-ios-volumize | |
# local_dir=/Users/ethanholda/projects/nysci-ios-volumize | |
# client_repo=https://github.com/nysci/fractionmash.git |
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
self.form_extra_fields = { | |
'image_file': FileUploadField(label="Upload Image", | |
base_path=self.base_path + "/images", | |
allowed_extensions=['jpg', 'JPG', 'jpeg', 'JPEG'], | |
validators=[validate_image]) | |
} |
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 base64 | |
import hashlib | |
import os | |
import re | |
import readline | |
import requests | |
import simplejson as json | |
import sys | |
from bs4 import BeautifulSoup as bs |
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
def get_achievements_from_run(run_data): | |
# DEBUG ONLY | |
te = float(200) | |
ke = float(500) | |
## | |
achvs = [] | |
tot_e = te + ke | |
err_margin = 0.02 |