This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def xxxx(ph, sin_id): | |
with OracleConnect(xxxx) as db_oracle: | |
sql = u"xxxxx" | |
has_data, sql_data = db_oracle.get_one(sql) | |
if has_data: | |
return sql_data.get("task_id", ""), "rollback" | |
else: | |
return sin_id, "calculate" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# test.py | |
with freeze_time(datetime.datetime(2016, 2, 10, tzinfo=pytz.timezone('US/Pacific'))): | |
from mymodule import date_manager | |
# mymodule.py | |
class _DateManager(object): | |
def __init__(self): | |
self._today = datetime.datetime.now(pytz.timezone('US/Pacific')) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61.135.186.214 baidupcs.com | |
61.135.186.214 cdn.baidupcs.com | |
61.135.186.214 sslpcslimit.jomodns.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from requests.adapters import HTTPAdapter | |
from threading import Thread | |
import logging | |
logging.basicConfig(filename='out.txt', level=logging.DEBUG, filemode='w') | |
requests_log = logging.getLogger("requests.packages.urllib3") | |
requests_log.setLevel(logging.DEBUG) | |
requests_log.propagate = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# coding: utf-8 | |
from asset.models import * | |
from common.models import * | |
from cost.models import * | |
from django.core.cache import cache | |
import inspect | |
from django.contrib.contenttypes.models import ContentType | |
from django.db.models.signals import pre_save, pre_delete |
NewerOlder