MCPcopy Index your code
hub / github.com/github/copilot-sdk / _parse_session_timestamp

Function _parse_session_timestamp

python/copilot/client.py:886–895  ·  view source on GitHub ↗

Parse a wire-format timestamp into ``datetime``. Accepts either an ISO-8601 string (server-sent JSON) or an existing ``datetime`` (round-tripped from a previous parse). Returns the value as-is if it's already a ``datetime``.

(value: Any)

Source from the content-addressed store, hash-verified

884
885
886def _parse_session_timestamp(value: Any) -> datetime:
887 """Parse a wire-format timestamp into ``datetime``.
888
889 Accepts either an ISO-8601 string (server-sent JSON) or an existing
890 ``datetime`` (round-tripped from a previous parse). Returns the value
891 as-is if it's already a ``datetime``.
892 """
893 if isinstance(value, datetime):
894 return value
895 return from_datetime(value)
896
897
898# ============================================================================

Callers 2

from_dictMethod · 0.85
from_dictMethod · 0.85

Calls 1

from_datetimeFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…