Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_spikes_description(fetcol=None):
spikes_description = OrderedDict([
('time', tables.UInt64Col()),
('features', tables.Float32Col(shape=(fetcol,))),
('cluster_auto', tables.UInt32Col()),
('cluster_manual', tables.UInt32Col()),
('masks', tables.UInt8Col(shape=(fetcol,))),])
return spikes_description
lr = tables.UInt64Col()
lrlo = tables.UInt32Col()
lrhi = tables.UInt32Col()
relocatedlr = tables.UInt64Col()
relocatedlrlo = tables.UInt32Col()
relocatedlrhi = tables.UInt32Col()
time = tables.Float64Col()
reportedsize = tables.Int64Col()
cpsr = tables.UInt64Col()
substage = tables.UInt8Col()
callindex = tables.UInt32Col()
class TraceWriteRange(tables.IsDescription):
index = tables.UInt32Col()
destlo = tables.UInt64Col()
destlo = tables.UInt32Col()
destlolo = tables.UInt32Col()
destlohi = tables.UInt32Col()
desthi = tables.UInt64Col()
desthilo = tables.UInt32Col()
desthihi = tables.UInt32Col()
pc = tables.UInt64Col()
pclo = tables.UInt32Col()
pchi = tables.UInt32Col()
relocatedpc = tables.UInt64Col()
relocatedpclo = tables.UInt32Col()
relocatedpchi = tables.UInt32Col()
lr = tables.UInt64Col()
lrlo = tables.UInt32Col()
lrhi = tables.UInt32Col()
relocatedlr = tables.UInt64Col()
writesize = tables.UInt64Col()
start = tables.UInt64Col()
startlo = tables.UInt32Col()
starthi = tables.UInt32Col()
end = tables.UInt64Col()
endlo = tables.UInt32Col()
endhi = tables.UInt32Col()
class SkipEntry(tables.IsDescription):
pc = tables.UInt64Col()
pclo = tables.UInt32Col()
pchi = tables.UInt32Col()
disasm = tables.StringCol(256)
thumb = tables.BoolCol()
resumepc = tables.UInt64Col()
resumepclo = tables.UInt32Col()
resumepchi = tables.UInt32Col()
isfunction = tables.BoolCol()
class LongWriteDescriptorGenerator():
def __init__(self, name, inplace, table):
self.table = table
self.stage = table.stage
self.name = name
self.inplace = inplace
def generate_descriptor(self):
labels = WriteSearch.find_labels(labeltool.LongwriteLabel, "",
self.stage, self.name)
if len(labels) == 0:
import sys
import math
def ProgressBar(cur, total):
percent = '{:.2%}'.format(cur / total)
sys.stdout.write('\r')
sys.stdout.write("[%-50s] %s" % ('=' * int(math.floor(cur * 50 / total)),percent))
sys.stdout.flush()
class FiveMinDataRecordH5File(tables.IsDescription):
datetime = tables.UInt64Col() #IGNORE:E1101
openPrice = tables.UInt32Col() #IGNORE:E1101
highPrice = tables.UInt32Col() #IGNORE:E1101
lowPrice = tables.UInt32Col() #IGNORE:E1101
closePrice = tables.UInt32Col() #IGNORE:E1101
transAmount = tables.UInt64Col() #IGNORE:E1101
transCount = tables.UInt64Col() #IGNORE:E1101
def fenge(src_file_name, dest_file_name, start_date, end_date):
"""
将原始数据按日期范围分隔,方便同步备份
"""
print("正在进行,请稍候.....")
src_hdf5 = tables.openFile(src_file_name, mode='r', filters=tables.Filters(complevel=9,complib='zlib', shuffle=True))
dest_hdf5 = tables.openFile(dest_file_name, mode = "w", filters=tables.Filters(complevel=9,complib='zlib', shuffle=True))
dest_group = dest_hdf5.create_group("/", "data")
start = start_date
end = end_date
all_table = [x for x in src_hdf5.walkNodes("/data")]
total = len(all_table)
for i in range(1,total):
import db_info
import substage
import sys
import pure_utils
from capstone import *
import os
l = logging.getLogger("")
class FramaCDstEntry(tables.IsDescription):
line = tables.StringCol(512) # file/lineno
lvalue = tables.StringCol(512) # lvalue as reported by framac
dstlo = tables.UInt64Col() # low value of write dst range
dstlolo = tables.UInt32Col() # low value of write dst range
dstlohi = tables.UInt32Col() # low value of write dst range
dsthi = tables.UInt64Col() # high value of write dst range
dsthilo = tables.UInt32Col() # high value of write dst range
dsthihi = tables.UInt32Col() # high value of write dst range
dst_not_in_ram = tables.BoolCol() # true if range is not RAM
writepc = tables.UInt64Col() # corresponding store instruction PC to src line (if just 1)
writepclo = tables.UInt32Col() # corresponding store instruction PC to src line (if just 1)
writepchi = tables.UInt32Col() # corresponding store instruction PC to src line (if just 1)
origpc = tables.UInt64Col() # corresponding store instruction PC to src line (if just 1)
origpclo = tables.UInt32Col() # corresponding store instruction PC to src line (if just 1)
origpchi = tables.UInt32Col() # corresponding store instruction PC to src line (if just 1)
substage = tables.UInt8Col()
class WriteDstTable():
def _find_mux_pc(self, dst):
user = {'res': None,
'dst': long(dst)}
class HisparcEvent(tables.IsDescription):
event_id = tables.UInt64Col()
timestamp = tables.Time32Col()
nanoseconds = tables.UInt32Col()
ext_timestamp = tables.UInt64Col()
pulseheights = tables.Int16Col(shape=4, dflt=-9999)
integrals = tables.Int32Col(shape=4, dflt=-9999)
n_peaks = tables.Int32Col(shape=4, dflt=-9999)
traces = tables.Int32Col(shape=4, dflt=-1)
class Coincidence(tables.IsDescription):
event_id = tables.UInt64Col()
k_event_id = tables.UInt64Col()
timestamp = tables.Time32Col()
nanoseconds = tables.UInt32Col()
ext_timestamp = tables.UInt64Col()
pulseheights = tables.Int16Col(shape=4, dflt=-9999)
integrals = tables.Int32Col(shape=4, dflt=-9999)
n_peaks = tables.Int32Col(shape=4, dflt=-9999)
traces = tables.Int32Col(shape=4, dflt=-1)
k_timestamp = tables.Time32Col()
k_nanoseconds = tables.UInt32Col()
k_ext_timestamp = tables.UInt64Col()
k_energy = tables.FloatCol()
k_core_pos = tables.FloatCol(shape=2)
k_zenith = tables.FloatCol()
k_azimuth = tables.FloatCol()
k_Num_e = tables.FloatCol()
k_Num_mu = tables.FloatCol()
addrhi = tables.UInt32Col()
line = tables.StringCol(512) # file/lineno
src = tables.StringCol(512) # contents of source code at this location
ivalue = tables.StringCol(12)
ilength = tables.UInt8Col()
thumb = tables.BoolCol()
mne = tables.StringCol(10)
disasm = tables.StringCol(256)
class RelocInfo(tables.IsDescription):
startaddr = tables.UInt64Col() # first address in relocation block
startaddrlo = tables.UInt32Col() # first address in relocation block
startaddrhi = tables.UInt32Col() # first address in relocation block
size = tables.UInt64Col() # number of relocated bytes
relocpc = tables.UInt64Col() # what the pc is once it is relocated
relocpclo = tables.UInt32Col() # what the pc is once it is relocated
relocpchi = tables.UInt32Col() # what the pc is once it is relocated
reldelorig = tables.BoolCol() # whether to delete the original once relocated
reloffset = tables.Int64Col() # (orig addr + offset) % relmod = new address
relmod = tables.UInt64Col()
relbegin = tables.UInt64Col() # address of where relocation starts happening
name = tables.StringCol(255)
symname = tables.StringCol(128)
cardinal = tables.UInt8Col()
class StageExitInfo(tables.IsDescription):
addr = tables.UInt64Col() # non-relocated addr
addrlo = tables.UInt32Col() # non-relocated addr
addrhi = tables.UInt32Col() # non-relocated addr
success = tables.BoolCol()
def _create_lightning_table(file, group):
"""Create lightning table in PyTables file
Create an lightning table containing the ESD data columns which are
available in the TSV download.
:param file: PyTables file.
:param group: the group to contain the lightning table, which need not
exist.
"""
description = {'event_id': tables.UInt32Col(pos=0),
'timestamp': tables.Time32Col(pos=1),
'nanoseconds': tables.UInt32Col(pos=2),
'ext_timestamp': tables.UInt64Col(pos=3),
'latitude': tables.Float32Col(pos=4),
'longitude': tables.Float32Col(pos=5),
'current': tables.Float32Col(pos=6)}
return file.create_table(group, 'lightning', description, createparents=True)
class ProcessEvents(object):
"""Process HiSPARC events to obtain several observables.
This class can be used to process a set of HiSPARC events and adds a
few observables like particle arrival time and number of particles in
the detector to a copy of the event table.
"""
processed_events_description = {
'event_id': tables.UInt32Col(pos=0),
'timestamp': tables.Time32Col(pos=1),
'nanoseconds': tables.UInt32Col(pos=2),
'ext_timestamp': tables.UInt64Col(pos=3),
'data_reduction': tables.BoolCol(pos=4),
'trigger_pattern': tables.UInt32Col(pos=5),
'baseline': tables.Int16Col(pos=6, shape=4, dflt=-1),
'std_dev': tables.Int16Col(pos=7, shape=4, dflt=-1),
'n_peaks': tables.Int16Col(pos=8, shape=4, dflt=-1),
'pulseheights': tables.Int16Col(pos=9, shape=4, dflt=-1),
'integrals': tables.Int32Col(pos=10, shape=4, dflt=-1),
'traces': tables.Int32Col(pos=11, shape=4, dflt=-1),
'event_rate': tables.Float32Col(pos=12),
't1': tables.Float32Col(pos=13, dflt=-1),
't2': tables.Float32Col(pos=14, dflt=-1),
't3': tables.Float32Col(pos=15, dflt=-1),
't4': tables.Float32Col(pos=16, dflt=-1),
'n1': tables.Float32Col(pos=17, dflt=-1),
'n2': tables.Float32Col(pos=18, dflt=-1),
'n3': tables.Float32Col(pos=19, dflt=-1),