<s> import re <EOL> import json <EOL> def extract ( pre , path ) : <EOL> '''<STR_LIT>''' <EOL> r = re . search ( "<STR_LIT>" % pre , path ) . group ( <NUM_LIT:0> ) <EOL> r = re . search ( "<STR_LIT>" , r ) . group ( <NUM_LIT:0> ) <EOL> return r <EOL> PROJ = extract ( "<STR_LIT>" , HIP ) <EOL> PROJ = extract ( PROJ , HIP ) <EOL> PROJSH = PROJ <EOL> projs = { } <EOL> try : <EOL> with open ( "<STR_LIT>" % ENV_SCRIPT_PATH ) as f : <EOL> projs = json . loads ( f . read ( ) ) <EOL> except : <EOL> err ( '<STR_LIT>' ) <EOL> if PROJ in projs : <EOL> PROJSH = projs [ PROJ ] [ '<STR_LIT>' ] <EOL> if "<STR_LIT>" in HIP : <EOL> ASSETNAME = extract ( "<STR_LIT>" , HIP ) <EOL> if "<STR_LIT>" in HIP : <EOL> SHOT = extract ( "<STR_LIT>" , HIP ) <EOL> ranges = { } <EOL> try : <EOL> with open ( "<STR_LIT>" % ( ENV_SCRIPT_PATH , PROJ , ) ) as f : <EOL> ranges = json . loads ( f . read ( ) ) <EOL> except : <EOL> err ( '<STR_LIT>' ) <EOL> if SHOT in ranges : <EOL> r = ranges [ str ( SHOT ) ] <EOL> SHOTSTART , SHOTEND = r [ <NUM_LIT:0> ] , r [ <NUM_LIT:1> ] </s>
