Did I find the right examples for you? yes no

All Samples(12)  |  Call(6)  |  Derive(0)  |  Import(6)

        def iso_to_datetime(text):
    if "T" in text:
        d, t = text.split("T")
    else:
        d = text
        t = None
    if "-" in d:
        year, month, day = d.split("-")
    else:
        year = d[0:4]
        month = d[4:6]
        day = d[6:8]
    if not t:
        return datetime(int(year), int(month), int(day))
    if "Z" in t:
        t = t.split("Z")[0]
        tz = UTC
    elif "+" in t:
        t, tz = t.split("+")
        h, m = tz.split(":")
        tz = FixedOffset(int(h), int(m))
    elif "-" in t:
        t, tz = t.split("-")
        h, m = tz.split(":")
        tz = FixedOffset(-int(h), -int(m))
    else:
        tz = None # local time
    parts = t.split(":")
    if len(parts) == 2:
        hour = parts[0]
        minute = parts[1]
        second = "0"
    else:
        hour = parts[0]
        minute = parts[1]
        second = parts[2]
    if "." in second:
        second, frac = second.split(".")
        frac = "0." + frac
    else:
        frac = 0
    return datetime(int(year), int(month), int(day), int(hour), int(minute), 
        int(second), int(float(frac) * 1000000), tz)
        


src/a/g/agnos-HEAD/libagnos/python/src/agnos/restful/xmlser.py   agnos(Download)
from agnos_compiler.langs.xml import XmlDoc
import xml.etree.ElementTree as etree
from .util import iso_to_datetime, long, basestring, url_to_proxy
 
 
        return bytes(elem.attrib["value"])
    elif elem.tag == "date":
        return iso_to_datetime(elem.attrib["value"])
    elif elem.tag == "list":
        return [_load(child, bindings_module, proxy_map) 

src/a/g/agnos-HEAD/libagnos/python/src/agnos/restful/jsonser.py   agnos(Download)
import agnos
from datetime import datetime
from .util import iso_to_datetime, long, basestring, url_to_proxy
 
 
        return base64.b64decode(obj["value"].encode("utf8"))
    elif obj["type"] == "datetime":
        return iso_to_datetime(obj["value"])
    elif obj["type"] == "set":
        return set(_load(item, bindings_module, proxy_map) for item in obj["value"])

src/a/g/agnos-1.0.2/src/agnos/restful/xmlser.py   agnos(Download)
from agnos_compiler.langs.xml import XmlDoc
import xml.etree.ElementTree as etree
from .util import iso_to_datetime, long, basestring, url_to_proxy
 
 
        return bytes(elem.attrib["value"])
    elif elem.tag == "date":
        return iso_to_datetime(elem.attrib["value"])
    elif elem.tag == "list":
        return [_load(child, bindings_module, proxy_map) 

src/a/g/agnos-1.0.2/src/agnos/restful/jsonser.py   agnos(Download)
import agnos
from datetime import datetime
from .util import iso_to_datetime, long, basestring, url_to_proxy
 
 
        return base64.b64decode(obj["value"].encode("utf8"))
    elif obj["type"] == "datetime":
        return iso_to_datetime(obj["value"])
    elif obj["type"] == "set":
        return set(_load(item, bindings_module, proxy_map) for item in obj["value"])

src/l/i/libagnos-1.0.1/src/agnos/restful/xmlser.py   libagnos(Download)
from agnos_compiler.langs.xml import XmlDoc
import xml.etree.ElementTree as etree
from .util import iso_to_datetime, long, basestring, url_to_proxy
 
 
        return bytes(elem.attrib["value"])
    elif elem.tag == "date":
        return iso_to_datetime(elem.attrib["value"])
    elif elem.tag == "list":
        return [_load(child, bindings_module, proxy_map) 

src/l/i/libagnos-1.0.1/src/agnos/restful/jsonser.py   libagnos(Download)
import agnos
from datetime import datetime
from .util import iso_to_datetime, long, basestring, url_to_proxy
 
 
        return obj["value"]
    elif obj["type"] == "datetime":
        return iso_to_datetime(obj["value"])
    elif obj["type"] == "set":
        return set(_load(item, bindings_module, proxy_map) for item in obj["value"])