MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / mk_tzaware

Method mk_tzaware

lib/matplotlib/tests/test_dates.py:1025–1041  ·  view source on GitHub ↗
(cls, datetime_obj)

Source from the content-addressed store, hash-verified

1023
1024 @classmethod
1025 def mk_tzaware(cls, datetime_obj):
1026 kwargs = {}
1027 attrs = ('year',
1028 'month',
1029 'day',
1030 'hour',
1031 'minute',
1032 'second',
1033 'microsecond',
1034 'tzinfo')
1035
1036 for attr in attrs:
1037 val = getattr(datetime_obj, attr, None)
1038 if val is not None:
1039 kwargs[attr] = val
1040
1041 return cls(**kwargs)
1042
1043 # Define a date_range function similar to pandas.date_range
1044 def date_range(start, freq, periods):

Callers 4

__sub__Method · 0.95
__add__Method · 0.95
astimezoneMethod · 0.95
date_rangeFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected