<commit_before>#! /usr/bin/python
'''
find unique responses in fdsn stationxml file
'''
import checkNRL as checkNRL
import sisxmlparser2_0 as sisxmlparser
import uniqResponses as uniqResponses

import datetime
import os
import re
import sys


def usage():
    print "python compare2chans <file.staxml> <chanAId> <chanBId>"


def main():
    checkNRL.setVerbose(True)
    args = sys.argv[1:]
    if len(args) == 0:
        usage()
        return
    if not os.path.isfile(args[0]):
        print "Can't find file %s"%(args[0],)
        return
    staxml = sisxmlparser.parse(args[0])
    chanA = None
    chanB = None
    for n in staxml.Network:
      for s in n.Station:
        for c in s.Channel:
          cCode = checkNRL.getChanCodeId(n,s,c)<commit_msg>add --list to list all chan ids<commit_after>#! /usr/bin/python
'''
find unique responses in fdsn stationxml file
'''
import checkNRL as checkNRL
import sisxmlparser2_0 as sisxmlparser
import uniqResponses as uniqResponses

import datetime
import os
import re
import sys


def usage():
    print "python compare2chans <file.staxml> <chanAId> <chanBId>"
    print "python compare2chans <file.staxml> --list"


def main():
    checkNRL.setVerbose(True)
    args = sys.argv[1:]
    if len(args) == 0:
        usage()
        return
    if not os.path.isfile(args[0]):
        print "Can't find file %s"%(args[0],)
        return
    staxml = sisxmlparser.parse(args[0])
    if args[1] == '--list':
      print "--all channels--"
      for n in staxml.Network:
        for s in n.Station:
          for c in s.Channel:
            cCode = checkNRL.getChanCodeId(n,s,c)
            print cCode
    return

    chanA = None
    chanB = None
    for n in staxml.Network:
      for s in n.Station:
        for c in s.Channel:
          cCode = checkNRL.getChanCodeId(n,s,c)
{'fraction_non_alphanumeric': 0.10855263157894737, 'fraction_numerical': 0.009868421052631578, 'mean_word_length': 2.613861386138614, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 16}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4354027', 'n_tokens_mistral': 663, 'n_tokens_neox': 633, 'n_words': 185}