# Path: transitfeed/version.py



import codecs
import csv
import datetime
import math
import optparse
import random
import re
import socket
import sys
import time
import urllib2
    import inspect
    import traceback
      import transitfeed
      import copy
    import pytz
      import pytz
from . import errors
from .version import __version__
  from collections import defaultdict
  if allow_empty and IsEmpty(value):
    return default
  try:
    int_value = int(value)
  except (ValueError, TypeError):
    if problems and column_name:
      problems.InvalidValue(column_name, value)
    return default
  else:
    if int_value not in allowed_values:
      if problems and column_name:
        problems.InvalidValue(column_name, value,
                              type=errors.TYPE_WARNING)
    return int_value

def ColorLuminance(color):
  """Compute the brightness of an sRGB color using the formula from
  http://www.w3.org/TR/2000/WD-AERT-20000426#color-contrast.

  Args:
    color: a string of 6 hex digits in the format verified by IsValidHexColor().

  Returns:
    A floating-point number between 0.0 (black) and 255.0 (white). """
  r = int(color[0:2], 16)
  g = int(color[2:4], 16)
  b = int(color[4:6], 16)
  return (299*r + 587*g + 114*b) / 1000.0

def IsValidYesNoUnknown(value):

# Path: transitfeed/version.py



# Path: transitfeed/util.py
import codecs
import csv
import datetime
import math
import optparse
import random
import re
import socket
import sys
import time
import urllib2
    import inspect
    import traceback
      import transitfeed
      import copy
    import pytz
      import pytz
from . import errors
from .version import __version__
  from collections import defaultdict

  if allow_empty and IsEmpty(value):
    return default
  try:
    int_value = int(value)
  except (ValueError, TypeError):
    if problems and column_name:
      problems.InvalidValue(column_name, value)
    return default
  else:
    if int_value not in allowed_values:
      if problems and column_name:
        problems.InvalidValue(column_name, value,
                              type=errors.TYPE_WARNING)
    return int_value

def ColorLuminance(color):
  """Compute the brightness of an sRGB color using the formula from
  http://www.w3.org/TR/2000/WD-AERT-20000426#color-contrast.

  Args:
    color: a string of 6 hex digits in the format verified by IsValidHexColor().

  Returns:
    A floating-point number between 0.0 (black) and 255.0 (white). """
  r = int(color[0:2], 16)
  g = int(color[2:4], 16)
  b = int(color[4:6], 16)
  return (299*r + 587*g + 114*b) / 1000.0

def IsValidYesNoUnknown(value):

  return value in ['0', '1', '2'];