def _infer_schema(obj):
  if isinstance(obj, bool):
    return 'boolean'
  elif isinstance(obj, string_types):
    return 'string'
  elif isinstance(obj, integer_types): # Python 3 doesn't have `long`.
    return 'int'
  elif isinstance(obj, float):
    return 'float'
  elif isinstance(obj, list):
    if not obj:
      raise ValueError('Cannot infer type of empty array.')
    return {
      'type': 'array',
      'items': _infer_schema(obj[0])
    }
  elif isinstance(obj, dict):
    if not obj:
      raise ValueError('Cannot infer type of empty record.')
    return {
      'type': 'record',
      'fields': [
        {'name': k, 'type': _infer_schema(v)}
        for k, v in obj.items()
      ]
    }
  raise ValueError('Cannot infer type from %s: %r' % (type(obj), obj))
Fills a dictionary with some parameters that can be put into a trajectory.
dataset/ETHPy150Open mtth/hdfs/hdfs/ext/avro/__init__.py/_infer_schema--crossover with--dataset/ETHPy150Open SmokinCaterpillar/pypet/pypet/tests/testutils/data.py/create_param_dict