def PreconditionsFromHeaders(headers):
  return_preconditions = Preconditions()
  try:
    for header, value in headers.items():
      if GOOG_GENERATION_MATCH_REGEX.match(header):
        return_preconditions.gen_match = long(value)
      if GOOG_METAGENERATION_MATCH_REGEX.match(header):
        return_preconditions.meta_gen_match = long(value)
  except ValueError, _:
    raise ArgumentException('Invalid precondition header specified. '
                            'x-goog-if-generation-match and '
                            'x-goog-if-metageneration match must be specified '
                            'with a positive integer value.')
  return return_preconditions
:type name: str
dataset/ETHPy150Open GoogleCloudPlatform/gsutil/gslib/translation_helper.py/PreconditionsFromHeaders--crossover with--dataset/ETHPy150Open Blazemeter/taurus/bzt/modules/blazemeter.py/BlazeMeterClient.test_by_name