Get the current volume.
@return The current set volume of the device between 0 and 100.
@throws CommandExecutionException When there has been a error during the communication or the response was invalid.
179174
public int getSoundVolume() throws CommandExecutionException {
        JSONArray res = sendToArray("get_sound_volume");
        if (res == null) throw new CommandExecutionException(CommandExecutionException.Error.INVALID_RESPONSE);
        int vol = res.optInt(0, -1);
        if (vol < 0) throw new CommandExecutionException(CommandExecutionException.Error.INVALID_RESPONSE);
        return vol;
    }
868059
public JSONObject getCarpetModeState() throws CommandExecutionException {
        JSONArray ret = sendToArray("get_carpet_mode");
        if (ret == null) return null;
        return ret.optJSONObject(0);
    }
710635
public int getBitRate() {
        int result;
        switch (audioVersionId) {
            case 1:
                // Unknown
                return -1;
            case 0:
            case 2:
                // Version 2 or 2.5
                if (layerDescription == 3) {
                    // Layer 1
                    result = BITRATES[3][bitRateIndex];
                } else if (layerDescription == 2 || layerDescription == 1) {
                    // Layer 2 or 3
                    result = BITRATES[4][bitRateIndex];
                } else {
                    // Unknown layer
                    return -1;
                }
                break;
            case 3:
                // Version 1
                if (layerDescription == 3) {
                    // Layer 1
                    result = BITRATES[0][bitRateIndex];
                } else if (layerDescription == 2) {
                    // Layer 2
                    result = BITRATES[1][bitRateIndex];
                } else if (layerDescription == 1) {
                    // Layer 3
                    result = BITRATES[2][bitRateIndex];
                } else {
                    // Unknown layer
                    return -1;
                }
                break;
            default:
                // Unknown version
                return -1;
        }
        return result * 1000;
    }
791903
public String getCommand()
    {
        String command = "";
        synchronized(this)
        {
            if (commandQueue.size() > 0)
            {
                command = commandQueue.remove(0).command;
            }
        }
        return command;
    }
44144
async def volume(self, ctx, volume: int):
        """"""

        if ctx.voice_client is None:
            return await ctx.send("Not connected to a voice channel.")

        ctx.voice_client.source.volume = volume / 100
        await ctx.send("Changed volume to {}%".format(volume))
149842
protected TryableSemaphore getExecutionSemaphore() {
        if (properties.executionIsolationStrategy().get() == ExecutionIsolationStrategy.SEMAPHORE) {
            if (executionSemaphoreOverride == null) {
                TryableSemaphore _s = executionSemaphorePerCircuit.get(commandKey.name());
                if (_s == null) {
                    // we didn't find one cache so setup
                    executionSemaphorePerCircuit.putIfAbsent(commandKey.name(), new TryableSemaphoreActual(properties.executionIsolationSemaphoreMaxConcurrentRequests()));
                    // assign whatever got set (this or another thread)
                    return executionSemaphorePerCircuit.get(commandKey.name());
                } else {
                    return _s;
                }
            } else {
                return executionSemaphoreOverride;
            }
        } else {
            // return NoOp implementation since we're not using SEMAPHORE isolation
            return TryableSemaphoreNoOp.DEFAULT;
        }
    }
82220
public String getSerialnumber() throws CommandExecutionException {
        JSONArray ret = sendToArray("get_serial_number");
        if (ret == null) return null;
        return ret.optJSONObject(0).optString("serial_number");
    }
585434
def get_volume(self):
        """"""
        self.request(EP_GET_VOLUME)
        return 0 if self.last_response is None else self.last_response.get('payload').get('volume')
611047
public static Double getDiskUsage() {
        if (!OSInfo.isLinux() && !OSInfo.isMac()) {
            return 0.0;
        }
        try {
            String output = SystemOperation.exec("df -h " + duHome);
            if (output != null) {
                String[] lines = output.split("[\\r\\n]+");
                if (lines.length >= 2) {
                    String[] parts = lines[1].split("\\s+");
                    if (parts.length >= 5) {
                        String pct = parts[4];
                        if (pct.endsWith("%")) {
                            return Integer.valueOf(pct.substring(0, pct.length() - 1)) / 100.0;
                        }
                    }
                }
            }
        } catch (Exception e) {
            LOG.warn("failed to get disk usage.");
        }
        return 0.0;
    }
1291287
@Override
    public int getBatchLimit ( String cmd ) {
        Integer set = this.batchLimits.get(cmd);
        if ( set != null ) {
            return set;
        }

        set = doGetBatchLimit(cmd);
        if ( set != null ) {
            this.batchLimits.put(cmd, set);
            return set;
        }

        set = DEFAULT_BATCH_LIMITS.get(cmd);
        if ( set != null ) {
            return set;
        }
        return 1;
    }
118247
def set_output_volume(volume):
    '''
    
    '''
    cmd = 'osascript -e "set volume output volume {0}"'.format(volume)
    call = __salt__['cmd.run_all'](
        cmd,
        output_loglevel='debug',
        python_shell=False
    )
    _check_cmd(call)

    return get_output_volume()
208588
public alluxio.grpc.MetaCommand getCommand() {
    alluxio.grpc.MetaCommand result = alluxio.grpc.MetaCommand.valueOf(command_);
    return result == null ? alluxio.grpc.MetaCommand.MetaCommand_Unknown : result;
  }
1109813
def get_output_volume():
    '''
    
    '''
    cmd = 'osascript -e "get output volume of (get volume settings)"'
    call = __salt__['cmd.run_all'](
        cmd,
        output_loglevel='debug',
        python_shell=False
    )
    _check_cmd(call)

    return call.get('stdout')
1129681
public long readExecutionCount (Path dir) throws IOException {
    State state = loadState(fs, dir);
    return Long.parseLong(state.getProp(CompactionSlaEventHelper.EXEC_COUNT_TOTAL, "0"));
  }
405335
public String getCommand() {
        lock.lock();
        try {
            String command = envState.commands.poll();
            if (command == null)
                return "";
            else
                return command;
        } finally {
            lock.unlock();
        }
    }
638577
def volume(self):
        
        volume = float(np.product(self.primitive.extents))
        return volume
542909
@Override // DataNodeMXBean
  public String getVolumeInfo() {
    final Map<String, Object> info = new HashMap<String, Object>();
    try {
      FSVolume[] volumes = ((FSDataset)this.data).volumes.getVolumes();
      for (FSVolume v : volumes) {
        final Map<String, Object> innerInfo = new HashMap<String, Object>();
        innerInfo.put("usedSpace", v.getDfsUsed());
        innerInfo.put("freeSpace", v.getAvailable());
        innerInfo.put("reservedSpace", v.getReserved());
        info.put(v.getDir().toString(), innerInfo);
      }
      return JSON.toString(info);
    } catch (IOException e) {
      LOG.info("Cannot get volume info.", e);
      return "ERROR";
    }
  }