text
stringlengths
1
93.6k
parser.add_argument(
"--quantize",
type=str,
default="none",
choices=["none", "avx2", "avx512", "avx512_vnni"],
)
args = parser.parse_args()
if args.size_th_kb <= 1:
raise ValueError("invalid size_th")
print(args.input_shape)
simplify_large_onnx(args)
# <FILESEP>
#!/usr/bin/env python3
__author__ = 'Pavel Polishchuk'
import argparse
import numpy as np
from read_input import read_input
def main():
parser = argparse.ArgumentParser(description='Returns a geometrical center of input 3D molecules. '
'All explicit atoms will be considered.')
parser.add_argument('-i', '--input', metavar='FILENAME', required=True,
help='input SDF file with 3D structures.')
parser.add_argument('-o', '--output', metavar='FILENAME', required=True,
help='text file with molecule name and three columns of x, y and z coordinates. No header.')
args = parser.parse_args()
with open(args.output, 'wt') as fout:
for mol, mol_name in read_input(args.input):
conf = mol.GetConformer()
xyz = conf.GetPositions()
res = np.mean(xyz, axis=0)
fout.write(mol.GetProp('_Name') + '\t' + '\t'.join(map(str, res)) + '\n')
if __name__ == '__main__':
main()
# <FILESEP>
import pca9685
import math
class Servos:
def __init__(self, i2c, address=0x40, freq=50, min_us=600, max_us=2400,
degrees=180):
self.period = 1000000 / freq
self.min_duty = self._us2duty(min_us)
self.max_duty = self._us2duty(max_us)
self.degrees = degrees
self.freq = freq
self.pca9685 = pca9685.PCA9685(i2c, address)
self.pca9685.freq(freq)
def _us2duty(self, value):
return int(4095 * value / self.period)
def position(self, index, degrees=None, radians=None, us=None, duty=None):
span = self.max_duty - self.min_duty
if degrees is not None:
duty = self.min_duty + span * degrees / self.degrees
elif radians is not None:
duty = self.min_duty + span * radians / math.radians(self.degrees)
elif us is not None:
duty = self._us2duty(us)
elif duty is not None:
pass
else:
return self.pca9685.duty(index)
duty = min(self.max_duty, max(self.min_duty, int(duty)))
self.pca9685.duty(index, duty)
def release(self, index):
self.pca9685.duty(index, 0)
# <FILESEP>
"""
Skelenox: the collaborative IDA Pro Agent
This file is part of Polichombr
(c) ANSSI-FR 2018
"""
import os
import logging
import idaapi
from skelenox_plugin.core import SkelCore
g_logger = logging.getLogger(__name__)