Skip to content

Instantly share code, notes, and snippets.

View MrCreosote's full-sized avatar

MrCreosote

  • Lawrence Berkeley National Laboratory
View GitHub Profile
@MrCreosote
MrCreosote / hideWS.py
Last active February 11, 2016 03:27
Hide public workspaces via the administration interface
'''
Makes the specified workspaces non-public.
Parameters:
wsclient - an initialized workspace client. The user logged into the client
must be a workspace administrator.
wslist - a list of workspace IDs and / or names.
'''
import datetime, time, functools, operator, types
default_fudge = datetime.timedelta(seconds=0, microseconds=0, days=0)
def deep_eq(_v1, _v2, datetime_fudge=default_fudge, _assert=False):
"""
Tests for deep equality between two python data structures recursing
into sub-structures if necessary. Works with all python types including
iterators and generators. This function was dreampt up to test API responses
but could be used for anything. Be careful. With deeply nested structures