Get a configuration as size in bytes (parses special strings like "1Mb"). Return {@code null}
if missing, wrong type or bad value.

@param config
@param path
@return
5865
public static Optional<Long> getBytesOptional(Config config, String path) {
        return Optional.ofNullable(getBytes(config, path));
    }
997605
private void parseConfigFile(PodsConfig podsConfig, String path)
  {
    String configDir = "/config/pods";
    
    PathImpl configPath = VfsOld.lookup("bfs://" + configDir + "/" + path);
    
    /*
    ConfigContext config = new ConfigContext();

    try {
      podsConfig.setCurrentDepend(new Depend(configPath));

      config.configure2(podsConfig, configPath);
    } catch (Exception e) {
      e.printStackTrace();
      log.warning(e.toString());
      
      podsConfig.setConfigException(e);
    }
    */
  }
162623
private void parseExternalsConfig(final Node node,
			final ConfigSettings config)
	{

		String name, value;
		Node nnode;
		NodeList list = node.getChildNodes();

		int length = list.getLength();
		for (int i = 0; i < length; i++) {
			nnode = list.item(i);

			name = nnode.getNodeName().toUpperCase();
			if (name.equals(KEY_SEVENZIP)) {

				value = nnode.getChildNodes().item(0).getNodeValue();
				value = value.substring(1, value.length() - 1);

				config.setConfigParameter(ConfigurationKeys.PATH_PROGRAM_7ZIP,
						value);

			}
		}
	}
439723
public static byte[] passwordBytes(AbstractConfig config, String key, Charset charset) {
    final Password password = config.getPassword(key);
    return password.value().getBytes(charset);
  }
100569
public static List<Boolean> getBooleanList(Config config, String path) {
        try {
            return config.getBooleanList(path);
        } catch (ConfigException.Missing | ConfigException.WrongType e) {
            if (e instanceof ConfigException.WrongType) {
                LOGGER.warn(e.getMessage(), e);
            }
            return null;
        }
    }
120754
def _get_file_size(file_path):
    

    size = getsize(file_path)

    file_size = bytearray(4)
    pack_into(b"I", file_size, 0, size)

    return file_size
1082314
public long getNodeChangedSize(String nodePath)
   {
      Long delta = calculatedChangedNodesSize.get(nodePath);
      return delta == null ? 0 : delta;
   }
150584
public static Optional<List<Integer>> getIntegerListOptional(Config config, String path) {
        return Optional.ofNullable(getIntegerList(config, path));
    }
606879
public static ConfigList getValueList(Config config, String path) {
        try {
            return config.getList(path);
        } catch (ConfigException.Missing | ConfigException.WrongType e) {
            if (e instanceof ConfigException.WrongType) {
                LOGGER.warn(e.getMessage(), e);
            }
            return null;
        }
    }
43396
public synchronized Configuration loadConfiguration() {
    if (configurationBuffer.position(0).readByte() == 1) {
      int bytesLength = configurationBuffer.readInt();
      if (bytesLength == 0) {
        return null;
      }
      return serializer.decode(configurationBuffer.readBytes(bytesLength));
    }
    return null;
  }
1147627
def get_size(path):
    ''''''
    size = os.path.getsize(path)
    for item in os.walk(path):
        for file in item[2]:
            size += os.path.getsize(os.path.join(item[0], file))
    return size
233127
public static long getDirSize(String path) {
        StatFs stat;
        try {
            stat = new StatFs(path);
        } catch (Exception e) {
            return 0;
        }
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
            return stat.getBlockSizeLong() * stat.getAvailableBlocksLong();
        } else {
            return (long)stat.getBlockSize() * (long)stat.getAvailableBlocks();
        }
    }
343963
public static Point getSize(String path) {
        BitmapFactory.Options options = new BitmapFactory.Options();
        options.inJustDecodeBounds = true;
        BitmapFactory.decodeFile(path, options);
        int width = options.outWidth;
        int height = options.outHeight;
        return new Point(width, height);
    }
15498
def load_config(path):
   
   with path.open('rb') as fi:
       file_bytes = fi.read()
       config = yaml.load(file_bytes.decode('utf-8'))

   return config
283823
public static Optional<ConfigList> getValueListOptional(Config config, String path) {
        return Optional.ofNullable(getValueList(config, path));
    }
758123
public InputStream create(String path, int size) {
        String url = WxEndpoint.get("url.qrcode.create");
        String json = "{\"path\": \"%s\", \"width\": %s}";
        return wxClient.copyStream(url, String.format(json, path, size));
    }
514051
def get_file_size(self, path):
        
        id = self._get_id_for_path(path)
        blob = self.repository._repo[id]
        return blob.raw_length()