Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
print(('Could not find %s, provide "derived" and'
' "entity"' % item['unit']))
return
if entity == 'unknown':
derived = [{
'base': l.NAMES[i['base']].entity.name,
'power': i['power']
} for i in item['dimensions']]
entity = c.Entity(name='unknown', dimensions=derived)
elif entity in l.ENTITIES:
entity = l.ENTITIES[entity]
else:
print(('Could not find %s, provide "derived" and'
' "entity"' % item['unit']))
return
unit = c.Unit(
name=item['unit'],
dimensions=item['dimensions'],
entity=entity)
try:
span = next(
re.finditer(re.escape(item['surface']),
test['req'])).span()
except StopIteration:
print('Surface mismatch for "%s"' % test['req'])
return
uncert = None
if 'uncertainty' in item:
uncert = item['uncertainty']
res.append(
c.Quantity(
value=item['value'],