def dependencies(metadata_dict, field='depends'):
    """Returns a dictionary of (str, str) based on metadata's dependency field.

    The keys indicate the name of a package (shorthand name or full git URL).
    The names 'zeek' or 'zkg' may also be keys that indicate a dependency on a
    particular Zeek or zkg version.

    The values indicate a semantic version requirement.

    If the dependency field is malformed (e.g. number of keys not equal to
    number of values), then None is returned.
    """
    if field not in metadata_dict:
        return dict()
    rval = dict()
    depends = metadata_dict[field]
    parts = depends.split()
    keys = parts[::2]
    values = parts[1::2]
    if len(keys) != len(values):
        return None
    for i, k in enumerate(keys):
        if i < len(values):
            rval[k] = values[i]
    return rval
