f14de2403b7255d3703d0f558d481c164080fd1e,utils/story_functions.py,,pre_process_story,#Any#,35

Before Change


    
def pre_process_story(entry):
    date_published = entry.get("published", entry.get("updated"))
    if not date_published:
        date_published = str(datetime.datetime.now())
        entry["published_now"] = True
    if not isinstance(date_published, datetime.datetime):
        date_published = dateutil_parse(date_published)
    // Change the date to UTC and remove timezone info since 
    // MySQL doesn"t support it.

After Change


    return parsed_date, date_tuple, today_tuple, yesterday_tuple
    
def pre_process_story(entry):
    entry["published"] = datetime.datetime(*entry.get("published_parsed", entry.get("updated_parsed", datetime.datetime.utcnow()))[:6])
    
    entry_link = entry.get("link", "")
    protocol_index = entry_link.find("://")
    if protocol_index != -1:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: samuelclay/NewsBlur
Commit Name: f14de2403b7255d3703d0f558d481c164080fd1e
Time: 2010-09-16
Author: samuel@ofbrooklyn.com
File Name: utils/story_functions.py
Class Name:
Method Name: pre_process_story


Project Name: home-assistant/home-assistant
Commit Name: 40d27cde0edb705bfa742a2f784d7a67b1d16e81
Time: 2017-05-09
Author: adam@armills.info
File Name: tests/components/test_sun.py
Class Name: TestSun
Method Name: test_state_change


Project Name: hellohaptik/chatbot_ner
Commit Name: f6ca50a271426e0102bacab4fe7dc38cd2479007
Time: 2018-12-03
Author: amans.rlx@gmail.com
File Name: ner_v2/detectors/temporal/date/en/date_detection.py
Class Name: DateDetector
Method Name: _date_range_ddth_of_mmm_to_ddth