// GetMotorStatus returns the status for the given motor.
345092
func (g *Driver) GetMotorStatus(motor Motor) (flags uint8, power uint16, encoder, dps int, err error) {
	message := GET_MOTOR_STATUS_RIGHT
	if motor == MOTOR_LEFT {
		message = GET_MOTOR_STATUS_LEFT
	}
	response, err := g.readBytes(goPiGo3Address, message, 12)
	if err != nil {
		return flags, power, encoder, dps, err
	}
	if err := g.responseValid(response); err != nil {
		return flags, power, encoder, dps, err
	}
	// get flags
	flags = uint8(response[4])
	// get power
	power = uint16(response[5])
	if power&0x80 == 0x80 {
		power = power - 0x100
	}
	// get encoder
	enc := make([]byte, 4)
	enc[3] = response[6]
	enc[2] = response[7]
	enc[1] = response[8]
	enc[0] = response[9]
	e := binary.LittleEndian.Uint32(enc)
	if e&0x80000000 == 0x80000000 {
		encoder = int(uint64(e) - 0x100000000)
	}
	encoder = int(e)
	//get dps
	d := make([]byte, 4)
	d[1] = response[10]
	d[0] = response[11]
	ds := binary.LittleEndian.Uint32(d)
	if ds&0x8000 == 0x8000 {
		dps = int(ds - 0x10000)
	}
	dps = int(ds)
	return flags, power, encoder / MOTOR_TICKS_PER_DEGREE, dps / MOTOR_TICKS_PER_DEGREE, nil
}
738952
func (v *Activatable) GetRelatedAction() *Action {
	deprecated_since(3, 10, 0, "gtk_activatable_get_related_action()")
	return &Action{glib.GObject{unsafe.Pointer(C.gtk_activatable_get_related_action(ACTIVATABLE(v)))}}
}
520519
func (s *VirtualMachineService) GetVirtualMachineByName(name string, opts ...OptionFunc) (*VirtualMachine, int, error) {
	id, count, err := s.GetVirtualMachineID(name, opts...)
	if err != nil {
		return nil, count, err
	}

	r, count, err := s.GetVirtualMachineByID(id, opts...)
	if err != nil {
		return nil, count, err
	}
	return r, count, nil
}
493931
func (az *Cloud) GetVirtualMachineWithRetry(name types.NodeName) (compute.VirtualMachine, error) {
	var machine compute.VirtualMachine
	var retryErr error
	err := wait.ExponentialBackoff(az.requestBackoff(), func() (bool, error) {
		machine, retryErr = az.getVirtualMachine(name)
		if retryErr == cloudprovider.InstanceNotFound {
			return true, cloudprovider.InstanceNotFound
		}
		if retryErr != nil {
			klog.Errorf("GetVirtualMachineWithRetry(%s): backoff failure, will retry, err=%v", name, retryErr)
			return false, nil
		}
		klog.V(2).Infof("GetVirtualMachineWithRetry(%s): backoff success", name)
		return true, nil
	})
	if err == wait.ErrWaitTimeout {
		err = retryErr
	}
	return machine, err
}
716336
func (c RekeyClient) GetPendingRekeyStatus(ctx context.Context, sessionID int) (res ProblemSetDevices, err error) {
	__arg := GetPendingRekeyStatusArg{SessionID: sessionID}
	err = c.Cli.Call(ctx, "keybase.1.rekey.getPendingRekeyStatus", []interface{}{__arg}, &res)
	return
}
27397
func (t *TeamDiscussion) GetCreatedAt() Timestamp {
	if t == nil || t.CreatedAt == nil {
		return Timestamp{}
	}
	return *t.CreatedAt
}
115612
func (s *BoltStateDB) GetTaskRunnerState(allocID, taskName string) (*trstate.LocalState, *structs.TaskState, error) {
	var ls *trstate.LocalState
	var ts *structs.TaskState

	err := s.db.View(func(tx *boltdd.Tx) error {
		allAllocsBkt := tx.Bucket(allocationsBucketName)
		if allAllocsBkt == nil {
			// No state, return
			return nil
		}

		allocBkt := allAllocsBkt.Bucket([]byte(allocID))
		if allocBkt == nil {
			// No state for alloc, return
			return nil
		}

		taskBkt := allocBkt.Bucket(taskBucketName(taskName))
		if taskBkt == nil {
			// No state for task, return
			return nil
		}

		// Restore Local State if it exists
		ls = &trstate.LocalState{}
		if err := taskBkt.Get(taskLocalStateKey, ls); err != nil {
			if !boltdd.IsErrNotFound(err) {
				return fmt.Errorf("failed to read local task runner state: %v", err)
			}

			// Key not found, reset ls to nil
			ls = nil
		}

		// Restore Task State if it exists
		ts = &structs.TaskState{}
		if err := taskBkt.Get(taskStateKey, ts); err != nil {
			if !boltdd.IsErrNotFound(err) {
				return fmt.Errorf("failed to read task state: %v", err)
			}

			// Key not found, reset ts to nil
			ts = nil
		}

		return nil
	})

	if err != nil {
		return nil, nil, err
	}

	return ls, ts, nil
}
1332016
func (s *BoltStateDB) GetDriverPluginState() (*driverstate.PluginState, error) {
	var ps *driverstate.PluginState

	err := s.db.View(func(tx *boltdd.Tx) error {
		driverBkt := tx.Bucket(driverManagerBucket)
		if driverBkt == nil {
			// No state, return
			return nil
		}

		// Restore Plugin State if it exists
		ps = &driverstate.PluginState{}
		if err := driverBkt.Get(managerPluginStateKey, ps); err != nil {
			if !boltdd.IsErrNotFound(err) {
				return fmt.Errorf("failed to read driver manager plugin state: %v", err)
			}

			// Key not found, reset ps to nil
			ps = nil
		}

		return nil
	})

	if err != nil {
		return nil, err
	}

	return ps, nil
}
184223
func GetActionDescriptor(action *Action) ActionDescriptor {
	bee := GetBee(action.Bee)
	if bee == nil {
		panic("Bee " + action.Bee + " not registered")
	}
	factory := (*GetFactory((*bee).Namespace()))
	for _, ac := range factory.Actions() {
		if ac.Name == action.Name {
			return ac
		}
	}

	return ActionDescriptor{}
}
1291764
func (r *ReleaseEvent) GetAction() string {
	if r == nil || r.Action == nil {
		return ""
	}
	return *r.Action
}
386241
func (tr *TaskRunner) getDriverHandle() *DriverHandle {
	tr.handleLock.Lock()
	defer tr.handleLock.Unlock()
	return tr.handle
}
965615
func GetStatus() *Statuses {
	result := &Statuses{}
	result.DeviceMapperStatusMap = make(map[string]*DeviceMapperStatus)
	result.SimpleStatusMap = make(map[string]*SimpleStatus)
	driverMap := getDrivers()
	for path, driver := range *driverMap {
		status, err := driver.Status()
		if err != nil {
			glog.Warningf("Error getting driver status for path %s: %v", path, err)
		}
		if status != nil {
			if driver.DriverType() == DriverTypeDeviceMapper {
				result.DeviceMapperStatusMap[path] = status.(*DeviceMapperStatus)
			} else {
				result.SimpleStatusMap[path] = status.(*SimpleStatus)
			}
		} else {
			glog.Warningf("nil status returned for path %s", path)
		}
	}
	return result
}
1318347
func (c *CreateCheckRunOptions) GetStartedAt() Timestamp {
	if c == nil || c.StartedAt == nil {
		return Timestamp{}
	}
	return *c.StartedAt
}
528489
func NewMotorDriver(a DigitalWriter, speedPin string) *MotorDriver {
	return &MotorDriver{
		name:             gobot.DefaultName("Motor"),
		connection:       a,
		SpeedPin:         speedPin,
		CurrentState:     0,
		CurrentSpeed:     0,
		CurrentMode:      "digital",
		CurrentDirection: "forward",
	}
}
74868
func (m *MemberEvent) GetAction() string {
	if m == nil || m.Action == nil {
		return ""
	}
	return *m.Action
}
1041852
func (d *DeploymentStatusRequest) GetAutoInactive() bool {
	if d == nil || d.AutoInactive == nil {
		return false
	}
	return *d.AutoInactive
}
971111
func (r *RepoStatus) GetCreatedAt() time.Time {
	if r == nil || r.CreatedAt == nil {
		return time.Time{}
	}
	return *r.CreatedAt
}