Skip to content

Instantly share code, notes, and snippets.

import xml.etree.ElementTree as ET
from datetime import datetime, timedelta
from isodate import parse_duration
import json
import pytz # Import the required library
def convert_xml_to_json(xml_str):
namespace = {'ns': 'urn:iec62325.351:tc57wg16:451-6:balancingdocument:4:4'}
root = ET.fromstring(xml_str)
<%_
import SourceryRuntime
let ConvertibleTypes = types.implementing["KeyPathConvertible"]
-%>
<%_ for Convertible in types.implementing["KeyPathConvertible"] { -%>
extension PartialKeyPath where Root == <%= Convertible.name %> {
var stringValue: String {
switch self {
// MARK: - typed predicate types
public protocol PredicateProtocol: NSPredicate {}
public protocol TypedPredicateProtocol: PredicateProtocol { associatedtype Root }
public final class CompoundPredicate<Root>: NSCompoundPredicate, TypedPredicateProtocol {}
public final class ComparisonPredicate<Root>: NSComparisonPredicate, TypedPredicateProtocol {}
// MARK: - compound operators
public func && <TP1: TypedPredicateProtocol, TP2: TypedPredicateProtocol>(p1: TP1, p2: TP2) -> CompoundPredicate<TP1.Root> where TP1.Root == TP2.Root {
CompoundPredicate(type: .and, subpredicates: [p1, p2])
}
@hhanesand
hhanesand / README.md
Created June 12, 2018 06:09
pure-ios-sdk documentation

Pure SDK iOS

Requirements

The iOS SDK is available for applications targeting the iOS 9.0 SDK and above.

Dependencies

The iOS SDK has no dependencies.

Installation

You need a key to use this pod, and Unacast should have provided you with one.

* thread #1, queue = 'com.apple.main-thread', stop reason = Null pointer use
frame #0: 0x0000000105479e68 libclang_rt.asan_ios_dynamic.dylib`__ubsan_on_report
frame #1: 0x0000000105479edc libclang_rt.asan_ios_dynamic.dylib`__ubsan::UndefinedBehaviorReport::UndefinedBehaviorReport(char const*, __ubsan::Location&, __sanitizer::InternalScopedString&) + 112
frame #2: 0x00000001054760ec libclang_rt.asan_ios_dynamic.dylib`__ubsan::Diag::~Diag() + 168
frame #3: 0x00000001054776cc libclang_rt.asan_ios_dynamic.dylib`handleTypeMismatchImpl(__ubsan::TypeMismatchData*, unsigned long, __ubsan::ReportOptions) + 440
frame #4: 0x0000000105477508 libclang_rt.asan_ios_dynamic.dylib`__ubsan_handle_type_mismatch_v1 + 52
* frame #5: 0x00000001084a8d0c Realm`-[RLMResults valueForKey:]::$_10::operator(this=0x000000016b502f40)() const at RLMResults.mm:260
frame #6: 0x0000000108492d58 Realm`auto translateRLMResultsErrors<-[RLMResults valueForKey:]::$_10>(f=0x000000016b502f40, aggregateMethod=0x00000000000000
+ (void)writeTransactionWithDefaultRealm:(void(^)(RLMRealm *realm))block completion:(void (^_Nullable)(void))completion {
@autoreleasepool {
RLMRealm *realm = [self openRealm];
if (realm.inWriteTransaction) {
safe_block(block, realm);
return safe_block(completion);
}
// Fire any notifications waiting before we start a write tranaction
+ (void)shareMultitrack:(MUSMultitrack *)multitrackToShare toGroups:(id<MUSSubscriptable>)sharedToGroups {
NSMutableArray *newTrackLinks = [NSMutableArray array];
NSMutableArray *sharedMultitracks = [NSMutableArray arrayWithCapacity:sharedToGroups.count];
// Copy track links and multitracks, but do not copy tracks to avoid duplicating recording files.
[MUSLocalStorageService writeTransaction:^{
for (MUSGroup *group in sharedToGroups) {
MUSMultitrack *sharedMultitrack = [group createNewMultitrackInGroup];
[multitrackToShare duplicateShareableAttributesToMultitrack:sharedMultitrack];
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 2.2
frame #0: 0x0000000186503e20 libc++abi.dylib`__cxa_throw
frame #1: 0x00000001016a7dfc Realm`void realm::SharedGroup::advance_read<(anonymous namespace)::TransactLogValidator>(this=0x0000000104875800, observer=0x000000016fd38578, version_id=(version = 494, index = 10))::TransactLogValidator*, realm::VersionID) at group_shared.hpp:958
frame #2: 0x00000001016a7d14 Realm`void realm::_impl::SharedGroupFriend::advance_read<(anonymous namespace)::TransactLogValidator>(sg=0x0000000104875800, obs=0x000000016fd38578, ver=(version = 494, index = 10))::TransactLogValidator*, realm::VersionID) at group_shared.hpp:1134
frame #3: 0x0000000101691208 Realm`void realm::LangBindHelper::advance_read<(anonymous namespace)::TransactLogValidator>(sg=0x0000000104875800, observer=0x000000016fd38578, version=(version = 494, index = 10))::TransactLogValidator&&, realm::VersionID) at lang_bind_helper.hpp:333
frame #4: 0x00000001016a9ef8 Realm`
- (RLMNotificationToken *)startCreatingTasksForOperationType:(MUSOperationType)type {
RLMResults *results = self.resultsBlock(type);
if (!results) {
return nil;
}
return [results addNotificationBlock:^(RLMResults * _Nullable results, RLMCollectionChange * _Nullable change, NSError * _Nullable error) {
if (error) {
NSLog(@"%@ results error : %@", self, error);
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 5.1
frame #0: 0x00000001811804f0 libobjc.A.dylib`objc_exception_throw
frame #1: 0x000000010229ad50 Realm`auto translateErrors<-[RLMThreadSafeReference initWithThreadConfined:]::$_0>(f=0x000000016ee67de0) at RLMThreadSafeReference.mm:28
frame #2: 0x000000010229ac5c Realm`::-[RLMThreadSafeReference initWithThreadConfined:](self=0x00000001c44237e0, _cmd="initWithThreadConfined:", threadConfined=0x00000001c41735c0) at RLMThreadSafeReference.mm:53
frame #3: 0x000000010229ade0 Realm`::+[RLMThreadSafeReference referenceWithThreadConfined:](self=RLMThreadSafeReference, _cmd="referenceWithThreadConfined:", threadConfined=0x00000001c41735c0) at RLMThreadSafeReference.mm:63
frame #4: 0x0000000100fd3a4c Jambuddy β`+[MUSLocalStorageService threadSafeReferenceForObject:](self=MUSLocalStorageService, _cmd="threadSafeReferenceForObject:", object=0x00000001c41735c0) at MUSLocalStorageService.m:30
frame #5: 0x00000001010213f8 Jambudd