package time
import (
	πg "grumpy"
	π_reflect "reflect"
	π_time "time"
)
func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseException) {
	ßNow := πg.InternStr("Now")
	ßSecond := πg.InternStr("Second")
	ßSleep := πg.InternStr("Sleep")
	ßUnixNano := πg.InternStr("UnixNano")
	ßfloat := πg.InternStr("float")
	ßsleep := πg.InternStr("sleep")
	ßtime := πg.InternStr("time")
	var πTemp001 *πg.Object
	_ = πTemp001
	var πTemp002 map[string]*πg.Object
	_ = πTemp002
	var πTemp003 *πg.Object
	_ = πTemp003
	var πTemp004 []πg.FunctionArg
	_ = πTemp004
	var πE *πg.BaseException; _ = πE
	for ; πF.State() >= 0; πF.PopCheckpoint() {
		switch πF.State() {
		case 0:
		default: panic("unexpected function state")
		}
		// line 15: """Time access and conversions."""
		πF.SetLineno(15)
		// line 17: from __go__.time import Now, Second, Sleep  # pylint: disable=g-multiple-import
		πF.SetLineno(17)
		πTemp002 = map[string]*πg.Object{}
		if πTemp003, πE = πg.WrapNative(πF, π_reflect.ValueOf(π_time.Now)); πE != nil {
			continue
		}
		πTemp002["Now"] = πTemp003
		if πTemp003, πE = πg.WrapNative(πF, π_reflect.ValueOf(π_time.Second)); πE != nil {
			continue
		}
		πTemp002["Second"] = πTemp003
		if πTemp003, πE = πg.WrapNative(πF, π_reflect.ValueOf(π_time.Sleep)); πE != nil {
			continue
		}
		πTemp002["Sleep"] = πTemp003
		if πTemp001, πE = πg.ImportNativeModule(πF, "__go__.time", πTemp002); πE != nil {
			continue
		}
		if πTemp003, πE = πg.GetAttr(πF, πTemp001, ßNow, nil); πE != nil {
			continue
		}
		if πE = πF.Globals().SetItem(πF, ßNow.ToObject(), πTemp003); πE != nil {
			continue
		}
		if πTemp003, πE = πg.GetAttr(πF, πTemp001, ßSecond, nil); πE != nil {
			continue
		}
		if πE = πF.Globals().SetItem(πF, ßSecond.ToObject(), πTemp003); πE != nil {
			continue
		}
		if πTemp003, πE = πg.GetAttr(πF, πTemp001, ßSleep, nil); πE != nil {
			continue
		}
		if πE = πF.Globals().SetItem(πF, ßSleep.ToObject(), πTemp003); πE != nil {
			continue
		}
		// line 20: def sleep(secs):
		πF.SetLineno(20)
		πTemp004 = make([]πg.FunctionArg, 1)
		πTemp004[0] = πg.FunctionArg{Name: "secs", Def: nil}
		πTemp001 = πg.NewFunction(πg.NewCode("sleep", "lib/time.py", πTemp004, 0, func(πF *πg.Frame, πArgs []*πg.Object) (*πg.Object, *πg.BaseException) {
			var µsecs *πg.Object = πArgs[0]; _ = µsecs
			var πTemp001 []*πg.Object
			_ = πTemp001
			var πTemp002 *πg.Object
			_ = πTemp002
			var πTemp003 *πg.Object
			_ = πTemp003
			var πE *πg.BaseException; _ = πE
			for ; πF.State() >= 0; πF.PopCheckpoint() {
				switch πF.State() {
				case 0:
				default: panic("unexpected function state")
				}
				// line 21: Sleep(secs * Second)
				πF.SetLineno(21)
				πTemp001 = πF.MakeArgs(1)
				if πE = πg.CheckLocal(πF, µsecs, "secs"); πE != nil {
					continue
				}
				if πTemp003, πE = πg.ResolveGlobal(πF, ßSecond); πE != nil {
					continue
				}
				if πTemp002, πE = πg.Mul(πF, µsecs, πTemp003); πE != nil {
					continue
				}
				πTemp001[0] = πTemp002
				if πTemp002, πE = πg.ResolveGlobal(πF, ßSleep); πE != nil {
					continue
				}
				if πTemp003, πE = πTemp002.Call(πF, πTemp001, nil); πE != nil {
					continue
				}
				πF.FreeArgs(πTemp001)
				return nil, nil
			}
			return nil, πE
		}), πF.Globals()).ToObject()
		if πE = πF.Globals().SetItem(πF, ßsleep.ToObject(), πTemp001); πE != nil {
			continue
		}
		// line 24: def time():
		πF.SetLineno(24)
		πTemp004 = make([]πg.FunctionArg, 0)
		πTemp003 = πg.NewFunction(πg.NewCode("time", "lib/time.py", πTemp004, 0, func(πF *πg.Frame, πArgs []*πg.Object) (*πg.Object, *πg.BaseException) {
			var πTemp001 *πg.Object
			_ = πTemp001
			var πTemp002 []*πg.Object
			_ = πTemp002
			var πTemp003 *πg.Object
			_ = πTemp003
			var πTemp004 *πg.Object
			_ = πTemp004
			var πE *πg.BaseException; _ = πE
			for ; πF.State() >= 0; πF.PopCheckpoint() {
				switch πF.State() {
				case 0:
				default: panic("unexpected function state")
				}
				// line 25: return float(Now().UnixNano()) / Second
				πF.SetLineno(25)
				πTemp002 = πF.MakeArgs(1)
				if πTemp003, πE = πg.ResolveGlobal(πF, ßNow); πE != nil {
					continue
				}
				if πTemp004, πE = πTemp003.Call(πF, nil, nil); πE != nil {
					continue
				}
				if πTemp003, πE = πg.GetAttr(πF, πTemp004, ßUnixNano, nil); πE != nil {
					continue
				}
				if πTemp004, πE = πTemp003.Call(πF, nil, nil); πE != nil {
					continue
				}
				πTemp002[0] = πTemp004
				if πTemp003, πE = πg.ResolveGlobal(πF, ßfloat); πE != nil {
					continue
				}
				if πTemp004, πE = πTemp003.Call(πF, πTemp002, nil); πE != nil {
					continue
				}
				πF.FreeArgs(πTemp002)
				if πTemp003, πE = πg.ResolveGlobal(πF, ßSecond); πE != nil {
					continue
				}
				if πTemp001, πE = πg.Div(πF, πTemp004, πTemp003); πE != nil {
					continue
				}
				return πTemp001, nil
				return nil, nil
			}
			return nil, πE
		}), πF.Globals()).ToObject()
		if πE = πF.Globals().SetItem(πF, ßtime.ToObject(), πTemp003); πE != nil {
			continue
		}
		return nil, nil
	}
	return nil, πE
}
var Code *πg.Code
func init() {
	Code = πg.NewCode("<module>", "lib/time.py", nil, 0, initModule)
}
