def jid_dir(jid, job_dir=None, hash_type='sha256'):
 if six.PY3:
  jhash = getattr(hashlib, hash_type)(jid.encode('utf-8')).hexdigest()
 else:
  jhash = getattr(hashlib, hash_type)(str(jid)).hexdigest()
 parts = []
 if (job_dir is not None):
  parts.append(job_dir)
 parts.extend([jhash[:2], jhash[2:]])
 return os.path.join(*parts)

def jid_dir ( jid , job_dir = None , hash_type = 'sha256' ) : if six . PY3 : jhash = getattr ( hashlib , hash_type ) ( jid . encode ( 'utf-8' ) ) . hexdigest ( ) else : jhash = getattr ( hashlib , hash_type ) ( str ( jid ) ) . hexdigest ( ) parts = [ ] if ( job_dir is not None ) : parts . append ( job_dir ) parts . extend ( [ jhash [ : 2 ] , jhash [ 2 : ] ] ) return os . path . join ( * parts )
return the jid_dir for the given job id .