本文整理汇总了Python中Filter.Filter.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Filter.__init__方法的具体用法?Python Filter.__init__怎么用?Python Filter.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Filter.Filter
的用法示例。
在下文中一共展示了Filter.__init__方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from Filter import Filter [as 别名]
# 或者: from Filter.Filter import __init__ [as 别名]
def __init__(self, args, current=None):
'''
Constructor
'''
options = list(range(25, 250, 50))
Filter.__init__(self, args, options, current)
示例2: __init__
# 需要导入模块: from Filter import Filter [as 别名]
# 或者: from Filter.Filter import __init__ [as 别名]
def __init__(self, args, current=None):
'''
Constructor
'''
options = [float(n) for n in range(5000, 30000, 5000)]
Filter.__init__(self, args, options, current)
示例3: __init__
# 需要导入模块: from Filter import Filter [as 别名]
# 或者: from Filter.Filter import __init__ [as 别名]
def __init__(self, args, current=None):
'''
Constructor
'''
options = [12, 24, 60]
Filter.__init__(self, args, options, current)
示例4: __init__
# 需要导入模块: from Filter import Filter [as 别名]
# 或者: from Filter.Filter import __init__ [as 别名]
def __init__(self, args, current=None):
'''
Constructor
'''
options = ["Exclude loans with public records"]
Filter.__init__(self, args, options, current)
示例5: __init__
# 需要导入模块: from Filter import Filter [as 别名]
# 或者: from Filter.Filter import __init__ [as 别名]
def __init__(self, args, current=None):
'''
Constructor
'''
options = [1.0, 5.0, 10.0]
Filter.__init__(self, args, options, current)
示例6: __init__
# 需要导入模块: from Filter import Filter [as 别名]
# 或者: from Filter.Filter import __init__ [as 别名]
def __init__(self, args, current=None):
'''
Constructor
'''
purpose_bitmap = {'other': 1 << 0,
'debt_consolidation': 1 << 1,
'educational': 1 << 2,
'credit_card': 1 << 3,
'car': 1 << 4,
'home_improvement': 1 << 5,
'small_business': 1 << 6,
'vacation': 1 << 7,
'moving': 1 << 8,
'wedding': 1 << 9,
'house': 1 << 10,
'medical': 1 << 11,
'major_purchase': 1 << 12,
'renewable_energy': 1 << 13,
}
self.conversion_table = purpose_bitmap.copy()
options = self.powerBitSet(purpose_bitmap.values())
Filter.__init__(self, args, options, current)
示例7: __init__
# 需要导入模块: from Filter import Filter [as 别名]
# 或者: from Filter.Filter import __init__ [as 别名]
def __init__(self, args, current=None):
'''
Construct a set similar to this based on the passed in grades
'A',
'AB',
'ABC',
'ABCD',
'ABCDE',
'ABCDEF',
'ABCDEFG',
'B',
'BC',
'BCD',
'BCDE',
'BCDEF',
'BCDEFG',
'C',
'CD',
'CDE',
'CDEF',
'CDEFG',
'D',
'DE',
'DEF',
'DEFG',
'E',
'EF',
'EFG',
'F',
'FG',
'G'
'''
options = []
grades_bitmap = {'A': 1 << 0,
'B': 1 << 1,
'C': 1 << 2,
'D': 1 << 3,
'E': 1 << 4,
'F': 1 << 5,
'G': 1 << 6,
}
self.conversion_table = grades_bitmap.copy()
self.reverse_table = {v:k for k, v in grades_bitmap.items()}
num_grades = len(args.grades)
for i in range(1, num_grades + 1):
for j in range(num_grades):
if (j + i) <= num_grades:
grades = args.grades[j:j + i]
grades_bit_value = 0
for grade in grades:
grades_bit_value += grades_bitmap[grade]
options.append(grades_bit_value)
self.conversion_table[grades] = grades_bit_value
self.reverse_table[grades_bit_value] = grades
Filter.__init__(self, args, options, current)
示例8: __init__
# 需要导入模块: from Filter import Filter [as 别名]
# 或者: from Filter.Filter import __init__ [as 别名]
def __init__(self, args, current=None):
'''
Constructor
'''
options = [0, 1, 2, 3, 4, 5]
Filter.__init__(self, args, options, current)
self.reverse_table = ["MORTGAGE", "OWN", "RENT", "OTHER", "NONE", "NULL"]
示例9: __init__
# 需要导入模块: from Filter import Filter [as 别名]
# 或者: from Filter.Filter import __init__ [as 别名]
def __init__(self, args, current=None):
'''
Constructor
'''
options = [
1 << 0, # 0
1 << 0 | 1 << 1 | 1 << 2 | 1 << 3, # 0, 1-3
1 << 0 | 1 << 1 | 1 << 2 | 1 << 3, # 0, 1-3, 4
1 << 1 | 1 << 2 | 1 << 3, # 1-3
1 << 1 | 1 << 2 | 1 << 3 | 1 << 4, # 1-3, 4
1 << 4, # 4
1 << 5 | 1 << 6 | 1 << 7 | 1 << 8 | 1 << 9 | 1 << 10 | 1 << 11, # 5 - 11
]
Filter.__init__(self, args, options, current)
示例10: __init__
# 需要导入模块: from Filter import Filter [as 别名]
# 或者: from Filter.Filter import __init__ [as 别名]
def __init__(self):
Filter.__init__(self)
self.filterExpression = ""
self.filteredPacketList = []
self.originalPacketList = []
示例11: __init__
# 需要导入模块: from Filter import Filter [as 别名]
# 或者: from Filter.Filter import __init__ [as 别名]
def __init__(self):
Filter.__init__(self)
print "Custom Filter Base Class"
示例12: __init__
# 需要导入模块: from Filter import Filter [as 别名]
# 或者: from Filter.Filter import __init__ [as 别名]
def __init__(self, args, current=None):
'''
Constructor
'''
state_bitmap = {'AK': 1 << 0,
'AL': 1 << 1,
'AR': 1 << 2,
'AZ': 1 << 3,
'CA': 1 << 4,
'CO': 1 << 5,
'CT': 1 << 6,
'DC': 1 << 7,
'DE': 1 << 8,
'FL': 1 << 9,
'GA': 1 << 10,
'HI': 1 << 11,
'IA': 1 << 12,
'ID': 1 << 13,
'IL': 1 << 14,
'IN': 1 << 15,
'KS': 1 << 16,
'KY': 1 << 17,
'LA': 1 << 18,
'MA': 1 << 19,
'MD': 1 << 20,
'ME': 1 << 21,
'MI': 1 << 22,
'MN': 1 << 23,
'MO': 1 << 24,
'MS': 1 << 25,
'MT': 1 << 26,
'NC': 1 << 27,
'NE': 1 << 28,
'NH': 1 << 29,
'NJ': 1 << 30,
'NM': 1 << 31,
'NV': 1 << 32,
'NY': 1 << 33,
'OH': 1 << 34,
'OK': 1 << 35,
'OR': 1 << 36,
'PA': 1 << 37,
'RI': 1 << 38,
'SC': 1 << 39,
'SD': 1 << 40,
'TN': 1 << 41,
'TX': 1 << 42,
'UT': 1 << 43,
'VA': 1 << 44,
'VT': 1 << 45,
'WA': 1 << 46,
'WI': 1 << 47,
'WV': 1 << 48,
'WY': 1 << 49,
'NULL': 1 << 50,
}
self.conversion_table = state_bitmap.copy()
options = self.powerBitSet([state_bitmap[state] for state in ["CA", "AZ", "FL", "GA", "IL", "MD", "MO", "NV"]])
# self.options = self.powerSet(["AK", "AL", "AR", "AZ", "CA", "CO", "CT", "DC", "DE", "FL", "GA",
# "HI", "IA", "ID", "IL", "IN", "KS", "KY", "LA", "MA", "MD", "ME",
# "MI", "MN", "MO", "MS", "MT", "NC", "NE", "NH", "NJ", "NM", "NV",
# "NY", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT",
# "VA", "VT", "WA", "WI", "WV", "WY", "NULL"])
Filter.__init__(self, args, options, current)