Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def write_placeholder(self, i, arg):
source = ''.format(optional_numeric_label(i, self.args))
return self.write(source, arg)
def get_text_with_indentation(self, node):
result = self.asttokens().get_text(node)
if not result:
if isinstance(node, FormattedValue):
fvals = [
n for n in node.parent.values
if isinstance(n, FormattedValue)
]
return ''.format(
optional_numeric_label(
fvals.index(node),
fvals,
)
)
else:
return ""
if '\n' in result:
result = ' ' * node.first_token.start[1] + result
result = dedent(result)
else:
result = result.strip()
return result
def get_text_with_indentation(self, node):
result = self.asttokens().get_text(node)
if not result:
if isinstance(node, FormattedValue):
fvals = [
n for n in node.parent.values
if isinstance(n, FormattedValue)
]
return u''.format(
optional_numeric_label(
fvals.index(node),
fvals,
)
)
else:
return ""
if '\n' in result:
result = ' ' * node.first_token.start[1] + result
result = dedent(result)
else:
result = result.strip()
return result