mirror of
https://github.com/aykhans/AzSuicideDataVisualization.git
synced 2025-09-06 10:54:17 +00:00
Version 0.1
Added sidebar, Dashboard, Line Graph
This commit is contained in:
26
.venv/Lib/site-packages/openpyxl/utils/bound_dictionary.py
Normal file
26
.venv/Lib/site-packages/openpyxl/utils/bound_dictionary.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# Copyright (c) 2010-2022 openpyxl
|
||||
|
||||
from collections import defaultdict
|
||||
|
||||
|
||||
class BoundDictionary(defaultdict):
|
||||
"""
|
||||
A default dictionary where elements are tightly coupled.
|
||||
|
||||
The factory method is responsible for binding the parent object to the child.
|
||||
|
||||
If a reference attribute is assigned then child objects will have the key assigned to this.
|
||||
|
||||
Otherwise it's just a defaultdict.
|
||||
"""
|
||||
|
||||
def __init__(self, reference=None, *args, **kw):
|
||||
self.reference = reference
|
||||
super(BoundDictionary, self).__init__(*args, **kw)
|
||||
|
||||
|
||||
def __getitem__(self, key):
|
||||
value = super(BoundDictionary, self).__getitem__(key)
|
||||
if self.reference is not None:
|
||||
setattr(value, self.reference, key)
|
||||
return value
|
Reference in New Issue
Block a user