All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
4 result = type(message)("")
7 # Don't merge multiline (e.g. triple-quoted) strings.
10 """SELECT xxxxxxxxxxxxxxxxxxxx(xxx)"""
11 """ FROM xxxxxxxxxxxxxxxx WHERE xxxxxxxxxx AND xxx <> xxxxxxxxxxxxxx()""")
13 # There was a bug where tuples were being identified as long strings.
14 long_tuple = ('Apple', 'Berry', 'Cherry', 'Dill', 'Evergreen', 'Fig',
15 'Grape', 'Harry', 'Iglu', 'Jaguar')
17 stupid_format_method_bug = "Some really long string that just so happens to be the {} {} to force the 'format' method to hang over the line length boundary. This is pretty annoying.".format("perfect", "length")
21 os.system("This is a regression test. xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxxx.".format("xxxxxxxxxx", "xxxxxx", "xxxxxxxxxx"))
28 "xxx_xxxxxxxxxx(xxxxx={}, xxxx={}, xxxxx, xxxx_xxxx_xxxxxxxxxx={})".format(
29 xxxxx, xxxx, xxxx_xxxx_xxxxxxxxxx
41 "[{}]: xxx_xxxxxxxxxx(xxxxx={}, xxxx={}, xxxxx={}"
42 " xxxx_xxxx_xxxxxxxxxx={}, xxxx={})"
43 .format(xxxx._xxxxxxxxxxxxxx, xxxxx, xxxx, xxxx_xxxx_xxxxxxxxxx, xxxxxxx)
51 for (xxx_xxxx, _xxx_xxx, _xxx_xxxxx, xxx_xxxx) in xxxx:
53 assert ("x" in xxx) or (
55 ), "{0} xxxxxxx xx {1}, xxx {1} xx xxx xx xxxx xx xxx xxxx: xxx xxxx {2}".format(
56 xxx_xxxx, xxx, xxxxxx.xxxxxxx(xxx_xxx_xxxxx)
60 def disappearing_comment():
62 ( # xx -x xxxxxxx xx xxx xxxxxxx.
63 '{{xxx_xxxxxxxxxx_xxxxxxxx}} xxx xxxx'
67 if xxxxx.xx_xxxxxxxxxx
68 else ( # Disappearing Comment
69 "--xxxxxxx --xxxxxx=x --xxxxxx-xxxxx=xxxxxx"
70 " --xxxxxx-xxxx=xxxxxxxxxxx.xxx"
82 "@xxxxxx '{xxxx_xxx}\t' > {xxxxxx_xxxx}.xxxxxxx;"
83 "{xxxx_xxx} >> {xxxxxx_xxxx}.xxxxxxx 2>&1; xx=$$?;"
85 .format(xxxx_xxx=xxxx_xxxxxxx, xxxxxx_xxxx=xxxxxxx + "/" + xxxx_xxx_xxxx, x=xxx_xxxxx_xxxxx_xxx),
91 func_call_where_string_arg_has_method_call_and_bad_parens(
93 "A long string with {}. This string is so long that it is ridiculous. It can't fit on one line at alllll.".format("formatting")
97 func_call_where_string_arg_has_old_fmt_and_bad_parens(
99 "A long string with {}. This string is so long that it is ridiculous. It can't fit on one line at alllll." % "formatting"
103 func_call_where_string_arg_has_old_fmt_and_bad_parens(
105 "A long string with {}. This {} is so long that it is ridiculous. It can't fit on one line at alllll." % ("formatting", "string")
112 xxxx.xxxxxxx.xxxxx( ('xxxxxxxxxx xxxx xx xxxxxx(%x) xx %x xxxx xx xxx %x.xx'
116 + (' %.3f (%s) to %.3f (%s).\n'
118 xxxx.xxxxxxxxxxxxxx(xxxx.xxxxxxxxx),
120 xxxx.xxxxxxxxxxxxxx( xx)
128 "xx {xxxxxxxxxxx}/xxxxxxxxxxx.xxx xxxx.xxx && xxxxxx -x "
129 "\"xxxx xxxxxxx xxxxxx xxxx; xxxx xxxxxx_xxxxx xxxxxx xxxx; "
130 "xxxx.xxxx_xxxxxx(['xxxx.xxx'], xxxx.xxxxxxx().xxxxxxxxxx)\" "
140 "xx {xxxxxxxxxxx}/xxxxxxxxxxx.xxx xxxx.xxx && xxxxxx -x "
141 "xxxx, ('xxxxxxx xxxxxx xxxx, xxxx') xxxxxx_xxxxx xxxxxx xxxx; "
142 "xxxx.xxxx_xxxxxx(['xxxx.xxx'], xxxx.xxxxxxx().xxxxxxxxxx)\" "
148 xxxxxxx = { 'xx' : 'xxxx xxxxxxx xxxxxxxxx -x xxx -x /xxx/{0} -x xxx,xxx -xx {1} \
149 -xx {1} -xx xxx=xxx_xxxx,xxx_xx,xxx_xxx,xxx_xxxx,xxx_xx,xxx_xxx |\
150 xxxxxx -x xxxxxxxx -x xxxxxxxx -x',
151 'xx' : 'xxxx xxxxxxx xxxxxxxxx -x xxx -x /xxx/{0} -x xxx,xxx -xx {1} \
152 -xx {1} -xx xxx=xxx_xxxx_xxx_xxxx,xxx_xx_xxx_xxxx,xxx_xxxx_xxx_xxxx,\
153 xxx_xx_xxxx_xxxx,xxx_xxx_xxxx,xxx_xxx_xxxx xxxx=xxx | xxxxxx -x xxxxxxxx -x xxxxxxxx -x'
159 xxxxx_xxxxxxxxxxxx('xxx xxxxxx xxx xxxxxxxxx.xx xx xxxxxxxx. xxx xxxxxxxxxxxxx.xx xxxxxxx '
160 + 'xx xxxxxx xxxxxx xxxxxx xx xxxxxxx xxx xxx ${0} xx x xxxxxxxx xxxxx'.xxxxxx(xxxxxx_xxxxxx_xxx))
166 'xxxxxxxxxxxxxxx' : xxxxxx_xxxxx_xxxx,
167 # 'xxxxxxxxxxxxxxxxxxxxxxx'
168 # 'xxxxxxxxxxxxxxxxxxxxxx'
169 # 'xxxxxxxxxxxxxxxxxx'
170 # 'xxxxxxxxxxxxxxxxx'
171 'xxxxxxxxxx' : xxxxx_xxxxx,
175 def xxxx_xxx_xx_xxxxxxxxxx_xxxx_xxxxxxxxx(xxxx):
182 xxxxxx={'xxxxxx 1' : xxxxxx(xxxx='xxxxxx 1', xxxxxx=600.0)},
183 xxxxxxxx_xxxxxxx=0.0,
190 xxxxxx={'xxxxxx 1' : xxxxxx(xxxx='xxxxxx 1', xxxxxx=200.0)},
191 xxxxxxxx_xxxxxxx=0.0,
199 'xxxxx006': ['xxx-xxx xxxxx3xxxx1xx2xxxxxxxxxxxxxx0xx6xxxxxxxxxx2xxxxxx9xxxxxxxxxx0xxxxx1xxx2x/xx9xx6+x+xxxxxxxxxxxxxx4xxxxxxxxxxxxxxxxxxxxx43xxx2xx2x4x++xxx6xxxxxxxxx+xxxxx/xx9x+xxxxxxxxxxxxxx8x15xxxxxxxxxxxxxxxxx82xx/xxxxxxxxxxxxxx/x5xxxxxxxxxxxxxx6xxxxxx74x4/xxx4x+xxxxxxxxx2xxxxxxxx87xxxxx4xxxxxxxx3xx0xxxxx4xxx1xx9xx5xxxxxxx/xxxxx5xx6xx4xxxx1x/x2xxxxxxxxxxxx64xxxxxxx1x0xx5xxxxxxxxxxxxxx== xxxxx000 xxxxxxxxxx\n',
200 'xxx-xxx xxxxx3xxxx1xx2xxxxxxxxxxxxxx6xxxxxxxxxxxxxx9xxxxxxxxxxxxx3xxx9xxxxxxxxxxxxxxxx0xxxxxxxxxxxxxxxxx2xxxx2xxx6xxxxx/xx54xxxxxxxxx4xxx3xxxxxx9xx3xxxxx39xxxxxxxxx5xx91xxxx7xxxxxx8xxxxxxxxxxxxxxxx9xxx93xxxxxxxxxxxxxxxxx7xxx8xx8xx4/x1xxxxx1x3xxxxxxxxxxxxx3xxxxxx9xx4xx4x7xxxxxxxxxxxxx1xxxxxxxxx7xxxxxxxxxxxxxx4xx6xxxxxxxxx9xxx7xxxx2xxxxxxxxxxxxxxxxxxxxxx8xxxxxxxxxxxxxxxxxxxx6xx== xxxxx010 xxxxxxxxxx\n'],
201 'xxxxx016': ['xxx-xxx xxxxx3xxxx1xx2xxxxxxxxxxxxxx0xx6xxxxxxxxxx2xxxxxx9xxxxxxxxxx0xxxxx1xxx2x/xx9xx6+x+xxxxxxxxxxxxxx4xxxxxxxxxxxxxxxxxxxxx43xxx2xx2x4x++xxx6xxxxxxxxx+xxxxx/xx9x+xxxxxxxxxxxxxx8x15xxxxxxxxxxxxxxxxx82xx/xxxxxxxxxxxxxx/x5xxxxxxxxxxxxxx6xxxxxx74x4/xxx4x+xxxxxxxxx2xxxxxxxx87xxxxx4xxxxxxxx3xx0xxxxx4xxx1xx9xx5xxxxxxx/xxxxx5xx6xx4xxxx1x/x2xxxxxxxxxxxx64xxxxxxx1x0xx5xxxxxxxxxxxxxx== xxxxx000 xxxxxxxxxx\n',
202 'xxx-xxx xxxxx3xxxx1xx2xxxxxxxxxxxxxx6xxxxxxxxxxxxxx9xxxxxxxxxxxxx3xxx9xxxxxxxxxxxxxxxx0xxxxxxxxxxxxxxxxx2xxxx2xxx6xxxxx/xx54xxxxxxxxx4xxx3xxxxxx9xx3xxxxx39xxxxxxxxx5xx91xxxx7xxxxxx8xxxxxxxxxxxxxxxx9xxx93xxxxxxxxxxxxxxxxx7xxx8xx8xx4/x1xxxxx1x3xxxxxxxxxxxxx3xxxxxx9xx4xx4x7xxxxxxxxxxxxx1xxxxxxxxx7xxxxxxxxxxxxxx4xx6xxxxxxxxx9xxx7xxxx2xxxxxxxxxxxxxxxxxxxxxx8xxxxxxxxxxxxxxxxxxxx6xx== xxxxx010 xxxxxxxxxx\n']
207 'xxxx xxx xxxxxxxx_xxxx xx "xxxxxxxxxx".'
208 '\n xxx: xxxxxx xxxxxxxx_xxxx=xxxxxxxxxx'
209 ) # xxxx xxxxxxxxxx xxxx xx xxxx xx xxx xxxxxxxx xxxxxx xxxxx.
211 some_tuple = ("some string", "some string" " which should be joined")
213 some_commented_string = (
214 "This string is long but not so long that it needs hahahah toooooo be so greatttt" # This comment gets thrown to the top.
215 " {} that I just can't think of any more good words to say about it at"
216 " allllllllllll".format("ha") # comments here are fine
219 some_commented_string = (
220 "This string is long but not so long that it needs hahahah toooooo be so greatttt" # But these
221 " {} that I just can't think of any more good words to say about it at" # comments will stay
222 " allllllllllll".format("ha") # comments here are fine
225 lpar_and_rpar_have_comments = func_call( # LPAR Comment
226 "Long really ridiculous type of string that shouldn't really even exist at all. I mean commmme onnn!!!", # Comma Comment
230 f"sudo -E deluge-console info --detailed --sort-reverse=time_added "
231 f"{'' if ID is None else ID} | perl -nE 'print if /^{field}:/'"
234 cmd_fstring = f"sudo -E deluge-console info --detailed --sort-reverse=time_added {'' if ID is None else ID} | perl -nE 'print if /^{field}:/'"
236 cmd_fstring = f"sudo -E deluge-console info --detailed --sort-reverse=time_added {'{{}}' if ID is None else ID} | perl -nE 'print if /^{field}:/'"
238 cmd_fstring = f"sudo -E deluge-console info --detailed --sort-reverse=time_added {{'' if ID is None else ID}} | perl -nE 'print if /^{field}:/'"
240 fstring = f"This string really doesn't need to be an {{{{fstring}}}}, but this one most certainly, absolutely {does}."
243 f"We have to remember to escape {braces}."
252 f"This string ({string_leaf.value}) appears to be pointless (i.e. has"
257 user_regex = _lazy_re_compile(
258 r"(^[-!#$%&'*+/=?^_`{}|~0-9A-Z]+(\.[-!#$%&'*+/=?^_`{}|~0-9A-Z]+)*\Z" # dot-atom
259 r'|^"([\001-\010\013\014\016-\037!#-\[\]-\177]|\\[\001-\011\013\014\016-\177])*"\Z)', # quoted-string
263 user_regex = _lazy_re_compile(
264 "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" # dot-atom
265 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', # quoted-string
270 user_regex = _lazy_re_compile(
271 "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" # dot-atom
272 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', # quoted-string
279 if not hasattr(module, name):
281 "Could not find object %s in %s.\n"
282 "Please note that you cannot serialize things like inner "
283 "classes. Please move the object into the main module "
284 "body to use migrations.\n"
285 "For more information, see "
286 "https://docs.djangoproject.com/en/%s/topics/migrations/#serializing-values"
287 % (name, module_name, get_docs_version()))
292 if not hasattr(module, name):
294 "Could not find object %s in %s.\nPlease note that you cannot serialize things like inner classes. Please move the object into the main module body to use migrations.\nFor more information, see https://docs.djangoproject.com/en/%s/topics/migrations/#serializing-values"
295 % (name, module_name, get_docs_version()))
298 "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
299 "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
300 "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
301 "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
304 class Step(StepBase):
306 self.cmd = 'SR AAAA-CORRECT NAME IS {last_name} {first_name}{middle_name} {title}/P{passenger_association}'.format(
308 first_name=first_name,
309 middle_name=middle_name,
311 passenger_association=passenger_association,
314 xxxxxxx_xxxxxx_xxxxxxx = xxx(
318 '((x.aaaaaaaaa = "xxxxxx.xxxxxxxxxxxxxxxxxxxxx") || (x.xxxxxxxxx = "xxxxxxxxxxxx")) && '
319 # xxxxx xxxxxxxxxxxx xxxx xxx (xxxxxxxxxxxxxxxx) xx x xxxxxxxxx xx xxxxxx.
320 "(x.bbbbbbbbbbbb.xxx != "
321 '"xxx:xxx:xxx::cccccccccccc:xxxxxxx-xxxx/xxxxxxxxxxx/xxxxxxxxxxxxxxxxx") && '
327 if __name__ == "__main__":
328 for i in range(4, 8):
330 r"for pid in $(ps aux | grep paster | grep -v grep | grep '\-%d' | awk '{print $2}'); do kill $pid; done"
342 c_float(val[0][0] / val[0][1]).value
343 == c_float(value[0][0] / value[0][1]).value
344 ), "%s didn't roundtrip" % tag
346 class xxxxxxxxxxxxxxxxxxxxx(xxxx.xxxxxxxxxxxxx):
347 def xxxxxxx_xxxxxx(xxxx):
348 assert xxxxxxx_xxxx in [
349 x.xxxxx.xxxxxx.xxxxx.xxxxxx,
350 x.xxxxx.xxxxxx.xxxxx.xxxx,
351 ], ("xxxxxxxxxxx xxxxxxx xxxx (xxxxxx xxxx) %x xxx xxxxx" % xxxxxxx_xxxx)
355 ] = "test" # set some Thrift field to non-None in the struct aa bb cc dd ee
358 "asdf_hjkl_jkl": re.compile(
359 r"(?<!([0-9]\ ))(?<=(^|\ ))([A-Z]+(\ )?|[0-9](\ )|[a-z](\ )){4,7}([A-Z]|[0-9]|[a-z])($|\b)(?!(\ ?([0-9]\ )|(\.)))"
363 RE_TWO_BACKSLASHES = {
364 "asdf_hjkl_jkl": re.compile(
365 r"(?<!([0-9]\ ))(?<=(^|\ ))([A-Z]+(\ )?|[0-9](\ )|[a-z](\\ )){4,7}([A-Z]|[0-9]|[a-z])($|\b)(?!(\ ?([0-9]\ )|(\.)))"
369 RE_THREE_BACKSLASHES = {
370 "asdf_hjkl_jkl": re.compile(
371 r"(?<!([0-9]\ ))(?<=(^|\ ))([A-Z]+(\ )?|[0-9](\ )|[a-z](\\\ )){4,7}([A-Z]|[0-9]|[a-z])($|\b)(?!(\ ?([0-9]\ )|(\.)))"
375 # We do NOT split on f-string expressions.
376 print(f"Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam. {[f'{i}' for i in range(10)]}")
377 x = f"This is a long string which contains an f-expr that should not split {{{[i for i in range(5)]}}}."
379 # The parens should NOT be removed in this case.
381 "my very long string that should get formatted if I'm careful to make sure it goes"
382 " over 88 characters which it has now"
385 # The parens should NOT be removed in this case.
387 "my very long string that should get formatted if I'm careful to make sure it goes over 88 characters which"
391 # The parens should NOT be removed in this case.
393 "my very long string"
394 " that should get formatted"
395 " if I'm careful to make sure"
396 " it goes over 88 characters which"
401 def _legacy_listen_examples():
403 " \"listen for the '%(event_name)s' event\"\n"
404 "\n # ... (event logic logic logic) ...\n"
414 for candidate in CANDIDATES:
416 "**{candidate.object_type} {candidate.rev}**"
417 " - {candidate.description}\n"
422 f"{f'{humanize_number(pos)}.': <{pound_len+2}} "
423 f"{balance: <{bal_len + 5}} "
424 f"<<{author.display_name}>>\n"
427 assert str(suffix_arr) == (
428 "['$', 'angaroo$', 'angrykangaroo$', 'aroo$', 'garoo$', "
429 "'grykangaroo$', 'kangaroo$', 'ngaroo$', 'ngrykangaroo$', "
430 "'o$', 'oo$', 'roo$', 'rykangaroo$', 'ykangaroo$']"
432 assert str(suffix_arr) != (
433 "['$', 'angaroo$', 'angrykangaroo$', 'aroo$', 'garoo$', "
434 "'grykangaroo$', 'kangaroo$', 'ngaroo$', 'ngrykangaroo$', "
435 "'o$', 'oo$', 'roo$', 'rykangaroo$', 'ykangaroo$']"
437 assert str(suffix_arr) <= (
438 "['$', 'angaroo$', 'angrykangaroo$', 'aroo$', 'garoo$', "
439 "'grykangaroo$', 'kangaroo$', 'ngaroo$', 'ngrykangaroo$', "
440 "'o$', 'oo$', 'roo$', 'rykangaroo$', 'ykangaroo$']"
442 assert str(suffix_arr) >= (
443 "['$', 'angaroo$', 'angrykangaroo$', 'aroo$', 'garoo$', "
444 "'grykangaroo$', 'kangaroo$', 'ngaroo$', 'ngrykangaroo$', "
445 "'o$', 'oo$', 'roo$', 'rykangaroo$', 'ykangaroo$']"
447 assert str(suffix_arr) < (
448 "['$', 'angaroo$', 'angrykangaroo$', 'aroo$', 'garoo$', "
449 "'grykangaroo$', 'kangaroo$', 'ngaroo$', 'ngrykangaroo$', "
450 "'o$', 'oo$', 'roo$', 'rykangaroo$', 'ykangaroo$']"
452 assert str(suffix_arr) > (
453 "['$', 'angaroo$', 'angrykangaroo$', 'aroo$', 'garoo$', "
454 "'grykangaroo$', 'kangaroo$', 'ngaroo$', 'ngrykangaroo$', "
455 "'o$', 'oo$', 'roo$', 'rykangaroo$', 'ykangaroo$']"
457 assert str(suffix_arr) in "['$', 'angaroo$', 'angrykangaroo$', 'aroo$', 'garoo$', 'grykangaroo$', 'kangaroo$', 'ngaroo$', 'ngrykangaroo$', 'o$', 'oo$', 'roo$', 'rykangaroo$', 'ykangaroo$']"
458 assert str(suffix_arr) not in "['$', 'angaroo$', 'angrykangaroo$', 'aroo$', 'garoo$', 'grykangaroo$', 'kangaroo$', 'ngaroo$', 'ngrykangaroo$', 'o$', 'oo$', 'roo$', 'rykangaroo$', 'ykangaroo$']"
460 f"1. Go to Google Developers Console and log in with your Google account."
461 "(https://console.developers.google.com/)"
462 "2. You should be prompted to create a new project (name does not matter)."
463 "3. Click on Enable APIs and Services at the top."
464 "4. In the list of APIs choose or search for YouTube Data API v3 and "
465 "click on it. Choose Enable."
466 "5. Click on Credentials on the left navigation bar."
467 "6. Click on Create Credential at the top."
468 '7. At the top click the link for "API key".'
469 "8. No application restrictions are needed. Click Create at the bottom."
470 "9. You now have a key to add to `{prefix}set api youtube api_key`"
473 f"1. Go to Google Developers Console and log in with your Google account."
474 "(https://console.developers.google.com/)"
475 "2. You should be prompted to create a new project (name does not matter)."
476 f"3. Click on Enable APIs and Services at the top."
477 "4. In the list of APIs choose or search for YouTube Data API v3 and "
478 "click on it. Choose Enable."
479 f"5. Click on Credentials on the left navigation bar."
480 "6. Click on Create Credential at the top."
481 '7. At the top click the link for "API key".'
482 "8. No application restrictions are needed. Click Create at the bottom."
483 "9. You now have a key to add to `{prefix}set api youtube api_key`"
486 f"1. Go to Google Developers Console and log in with your Google account."
487 "(https://console.developers.google.com/)"
488 "2. You should be prompted to create a new project (name does not matter)."
489 f"3. Click on Enable APIs and Services at the top."
490 "4. In the list of APIs choose or search for YouTube Data API v3 and "
491 "click on it. Choose Enable."
492 f"5. Click on Credentials on the left navigation bar."
493 "6. Click on Create Credential at the top."
494 '7. At the top click the link for "API key".'
495 "8. No application restrictions are needed. Click Create at the bottom."
496 f"9. You now have a key to add to `{prefix}set api youtube api_key`"
499 # It shouldn't matter if the string prefixes are capitalized.
501 F"{F'{humanize_number(pos)}.': <{pound_len+2}} "
502 F"{balance: <{bal_len + 5}} "
503 F"<<{author.display_name}>>\n"
507 F"We have to remember to escape {braces}."
512 welcome_to_programming = R"hello," R" world!"
514 fstring = F"f-strings definitely make things more {difficult} than they need to be for {{black}}. But boy they sure are handy. The problem is that some lines will need to have the 'f' whereas others do not. This {line}, for example, needs one."
516 x = F"This is a long string which contains an f-expr that should not split {{{[i for i in range(5)]}}}."
519 "\N{BLACK RIGHT-POINTING TRIANGLE WITH DOUBLE VERTICAL BAR}\N{VARIATION SELECTOR-16}"
522 xxxxxx_xxx_xxxx_xx_xxxxx_xxxxxxxx_xxxxxxxx_xxxxxxxxxx_xxxx_xxxx_xxxxx = xxxx.xxxxxx.xxxxxxxxx.xxxxxxxxxxxxxxxxxxxx(
524 "x3_xxxxxxxx": "xxx3_xxxxx_xxxxxxxx_xxxxxxxx_xxxxxxxxxx_xxxxxxxx_xxxxxx_xxxxxxx",
528 # Regression test for https://github.com/psf/black/issues/3117.
530 "something_something":
531 r"Lorem ipsum dolor sit amet, an sed convenire eloquentiam \t"
532 r"signiferumque, duo ea vocibus consetetur scriptorem. Facer \t",
535 # Regression test for https://github.com/psf/black/issues/3459.
537 empty_str_as_first_split=''
538 f'xxxxxxx {xxxxxxxxxx} xxx xxxxxxxxxx xxxxx xxx xxx xx '
539 'xxxxx xxxxxxxxx xxxxxxx, xxx xxxxxxxxxxx xxx xxxxx. '
540 f'xxxxxxxxxxxxx xxxx xx xxxxxxxxxx. xxxxx: {x.xxx}',
541 empty_u_str_as_first_split=u''
542 f'xxxxxxx {xxxxxxxxxx} xxx xxxxxxxxxx xxxxx xxx xxx xx '
543 'xxxxx xxxxxxxxx xxxxxxx, xxx xxxxxxxxxxx xxx xxxxx. '
544 f'xxxxxxxxxxxxx xxxx xx xxxxxxxxxx. xxxxx: {x.xxx}',
547 # Regression test for https://github.com/psf/black/issues/3455.
549 "/this/is/a/very/very/very/very/very/very/very/very/very/very/long/key/without/spaces":
550 # And there is a comment before the value
551 ("item1", "item2", "item3"),
554 # Regression test for https://github.com/psf/black/issues/3506.
556 "With single quote: ' "
558 ' With double quote: " '
562 s = f'Lorem Ipsum is simply dummy text of the printing and typesetting industry:\'{my_dict["foo"]}\''
570 result = type(message)("")
573 # Don't merge multiline (e.g. triple-quoted) strings.
576 """SELECT xxxxxxxxxxxxxxxxxxxx(xxx)"""
577 """ FROM xxxxxxxxxxxxxxxx WHERE xxxxxxxxxx AND xxx <> xxxxxxxxxxxxxx()"""
581 # There was a bug where tuples were being identified as long strings.
595 stupid_format_method_bug = (
596 "Some really long string that just so happens to be the {} {} to force the 'format'"
597 " method to hang over the line length boundary. This is pretty annoying.".format(
606 "This is a regression test. xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx"
607 " xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx"
608 " xxxx.".format("xxxxxxxxxx", "xxxxxx", "xxxxxxxxxx")
616 "xxx_xxxxxxxxxx(xxxxx={}, xxxx={}, xxxxx, xxxx_xxxx_xxxxxxxxxx={})"
617 .format(xxxxx, xxxx, xxxx_xxxx_xxxxxxxxxx),
628 "[{}]: xxx_xxxxxxxxxx(xxxxx={}, xxxx={}, xxxxx={}"
629 " xxxx_xxxx_xxxxxxxxxx={}, xxxx={})".format(
630 xxxx._xxxxxxxxxxxxxx, xxxxx, xxxx, xxxx_xxxx_xxxxxxxxxx, xxxxxxx
639 for xxx_xxxx, _xxx_xxx, _xxx_xxxxx, xxx_xxxx in xxxx:
641 assert ("x" in xxx) or (xxx in xxx_xxx_xxxxx), (
642 "{0} xxxxxxx xx {1}, xxx {1} xx xxx xx xxxx xx xxx xxxx: xxx xxxx {2}"
643 .format(xxx_xxxx, xxx, xxxxxx.xxxxxxx(xxx_xxx_xxxxx))
648 def disappearing_comment():
650 ( # xx -x xxxxxxx xx xxx xxxxxxx.
651 "{{xxx_xxxxxxxxxx_xxxxxxxx}} xxx xxxx {} {{xxxx}} >&2".format(
653 if xxxxx.xx_xxxxxxxxxx
654 else ( # Disappearing Comment
655 "--xxxxxxx --xxxxxx=x --xxxxxx-xxxxx=xxxxxx"
656 " --xxxxxx-xxxx=xxxxxxxxxxx.xxx"
670 "@xxxxxx '{xxxx_xxx}\t' > {xxxxxx_xxxx}.xxxxxxx;"
671 "{xxxx_xxx} >> {xxxxxx_xxxx}.xxxxxxx 2>&1; xx=$$?;"
673 xxxx_xxx=xxxx_xxxxxxx,
674 xxxxxx_xxxx=xxxxxxx + "/" + xxxx_xxx_xxxx,
675 x=xxx_xxxxx_xxxxx_xxx,
683 func_call_where_string_arg_has_method_call_and_bad_parens(
684 "A long string with {}. This string is so long that it is ridiculous. It can't fit"
685 " on one line at alllll.".format("formatting"),
688 func_call_where_string_arg_has_old_fmt_and_bad_parens(
689 "A long string with {}. This string is so long that it is ridiculous. It can't fit"
690 " on one line at alllll." % "formatting",
693 func_call_where_string_arg_has_old_fmt_and_bad_parens(
694 "A long string with {}. This {} is so long that it is ridiculous. It can't fit on"
695 " one line at alllll." % ("formatting", "string"),
703 "xxxxxxxxxx xxxx xx xxxxxx(%x) xx %x xxxx xx xxx %x.xx"
704 % (len(self) + 1, xxxx.xxxxxxxxxx, xxxx.xxxxxxxxxx)
705 + " %.3f (%s) to %.3f (%s).\n"
708 xxxx.xxxxxxxxxxxxxx(xxxx.xxxxxxxxx),
710 xxxx.xxxxxxxxxxxxxx(xx),
719 "xx {xxxxxxxxxxx}/xxxxxxxxxxx.xxx xxxx.xxx && xxxxxx -x "
720 '"xxxx xxxxxxx xxxxxx xxxx; xxxx xxxxxx_xxxxx xxxxxx xxxx; '
721 "xxxx.xxxx_xxxxxx(['xxxx.xxx'], xxxx.xxxxxxx().xxxxxxxxxx)\" ",
730 "xx {xxxxxxxxxxx}/xxxxxxxxxxx.xxx xxxx.xxx && xxxxxx -x "
731 "xxxx, ('xxxxxxx xxxxxx xxxx, xxxx') xxxxxx_xxxxx xxxxxx xxxx; "
732 "xxxx.xxxx_xxxxxx(['xxxx.xxx'], xxxx.xxxxxxx().xxxxxxxxxx)\" ",
740 "xxxx xxxxxxx xxxxxxxxx -x xxx -x /xxx/{0} -x xxx,xxx -xx {1} -xx {1} -xx"
741 " xxx=xxx_xxxx,xxx_xx,xxx_xxx,xxx_xxxx,xxx_xx,xxx_xxx | xxxxxx -x xxxxxxxx -x"
745 "xxxx xxxxxxx xxxxxxxxx -x xxx -x /xxx/{0} -x xxx,xxx -xx {1} -xx {1} -xx"
746 " xxx=xxx_xxxx_xxx_xxxx,xxx_xx_xxx_xxxx,xxx_xxxx_xxx_xxxx,xxx_xx_xxxx_xxxx,xxx_xxx_xxxx,xxx_xxx_xxxx"
747 " xxxx=xxx | xxxxxx -x xxxxxxxx -x xxxxxxxx -x"
756 "xxx xxxxxx xxx xxxxxxxxx.xx xx xxxxxxxx. xxx xxxxxxxxxxxxx.xx"
758 + "xx xxxxxx xxxxxx xxxxxx xx xxxxxxx xxx xxx ${0} xx x xxxxxxxx xxxxx"
759 .xxxxxx(xxxxxx_xxxxxx_xxx)
767 "xxxxxxxxxxxxxxx": xxxxxx_xxxxx_xxxx,
768 # 'xxxxxxxxxxxxxxxxxxxxxxx'
769 # 'xxxxxxxxxxxxxxxxxxxxxx'
770 # 'xxxxxxxxxxxxxxxxxx'
771 # 'xxxxxxxxxxxxxxxxx'
772 "xxxxxxxxxx": xxxxx_xxxxx,
777 def xxxx_xxx_xx_xxxxxxxxxx_xxxx_xxxxxxxxx(xxxx):
784 xxxxxx={"xxxxxx 1": xxxxxx(xxxx="xxxxxx 1", xxxxxx=600.0)},
785 xxxxxxxx_xxxxxxx=0.0,
792 xxxxxx={"xxxxxx 1": xxxxxx(xxxx="xxxxxx 1", xxxxxx=200.0)},
793 xxxxxxxx_xxxxxxx=0.0,
805 " xxxxx3xxxx1xx2xxxxxxxxxxxxxx0xx6xxxxxxxxxx2xxxxxx9xxxxxxxxxx0xxxxx1xxx2x/xx9xx6+x+xxxxxxxxxxxxxx4xxxxxxxxxxxxxxxxxxxxx43xxx2xx2x4x++xxx6xxxxxxxxx+xxxxx/xx9x+xxxxxxxxxxxxxx8x15xxxxxxxxxxxxxxxxx82xx/xxxxxxxxxxxxxx/x5xxxxxxxxxxxxxx6xxxxxx74x4/xxx4x+xxxxxxxxx2xxxxxxxx87xxxxx4xxxxxxxx3xx0xxxxx4xxx1xx9xx5xxxxxxx/xxxxx5xx6xx4xxxx1x/x2xxxxxxxxxxxx64xxxxxxx1x0xx5xxxxxxxxxxxxxx=="
806 " xxxxx000 xxxxxxxxxx\n"
810 " xxxxx3xxxx1xx2xxxxxxxxxxxxxx6xxxxxxxxxxxxxx9xxxxxxxxxxxxx3xxx9xxxxxxxxxxxxxxxx0xxxxxxxxxxxxxxxxx2xxxx2xxx6xxxxx/xx54xxxxxxxxx4xxx3xxxxxx9xx3xxxxx39xxxxxxxxx5xx91xxxx7xxxxxx8xxxxxxxxxxxxxxxx9xxx93xxxxxxxxxxxxxxxxx7xxx8xx8xx4/x1xxxxx1x3xxxxxxxxxxxxx3xxxxxx9xx4xx4x7xxxxxxxxxxxxx1xxxxxxxxx7xxxxxxxxxxxxxx4xx6xxxxxxxxx9xxx7xxxx2xxxxxxxxxxxxxxxxxxxxxx8xxxxxxxxxxxxxxxxxxxx6xx=="
811 " xxxxx010 xxxxxxxxxx\n"
817 " xxxxx3xxxx1xx2xxxxxxxxxxxxxx0xx6xxxxxxxxxx2xxxxxx9xxxxxxxxxx0xxxxx1xxx2x/xx9xx6+x+xxxxxxxxxxxxxx4xxxxxxxxxxxxxxxxxxxxx43xxx2xx2x4x++xxx6xxxxxxxxx+xxxxx/xx9x+xxxxxxxxxxxxxx8x15xxxxxxxxxxxxxxxxx82xx/xxxxxxxxxxxxxx/x5xxxxxxxxxxxxxx6xxxxxx74x4/xxx4x+xxxxxxxxx2xxxxxxxx87xxxxx4xxxxxxxx3xx0xxxxx4xxx1xx9xx5xxxxxxx/xxxxx5xx6xx4xxxx1x/x2xxxxxxxxxxxx64xxxxxxx1x0xx5xxxxxxxxxxxxxx=="
818 " xxxxx000 xxxxxxxxxx\n"
822 " xxxxx3xxxx1xx2xxxxxxxxxxxxxx6xxxxxxxxxxxxxx9xxxxxxxxxxxxx3xxx9xxxxxxxxxxxxxxxx0xxxxxxxxxxxxxxxxx2xxxx2xxx6xxxxx/xx54xxxxxxxxx4xxx3xxxxxx9xx3xxxxx39xxxxxxxxx5xx91xxxx7xxxxxx8xxxxxxxxxxxxxxxx9xxx93xxxxxxxxxxxxxxxxx7xxx8xx8xx4/x1xxxxx1x3xxxxxxxxxxxxx3xxxxxx9xx4xx4x7xxxxxxxxxxxxx1xxxxxxxxx7xxxxxxxxxxxxxx4xx6xxxxxxxxx9xxx7xxxx2xxxxxxxxxxxxxxxxxxxxxx8xxxxxxxxxxxxxxxxxxxx6xx=="
823 " xxxxx010 xxxxxxxxxx\n"
830 xxx_xxx = ( # xxxx xxxxxxxxxx xxxx xx xxxx xx xxx xxxxxxxx xxxxxx xxxxx.
831 'xxxx xxx xxxxxxxx_xxxx xx "xxxxxxxxxx".\n xxx: xxxxxx xxxxxxxx_xxxx=xxxxxxxxxx'
835 some_tuple = ("some string", "some string which should be joined")
837 some_commented_string = ( # This comment gets thrown to the top.
838 "This string is long but not so long that it needs hahahah toooooo be so greatttt"
839 " {} that I just can't think of any more good words to say about it at"
840 " allllllllllll".format("ha") # comments here are fine
843 some_commented_string = (
844 "This string is long but not so long that it needs hahahah toooooo be so greatttt" # But these
845 " {} that I just can't think of any more good words to say about it at" # comments will stay
846 " allllllllllll".format("ha") # comments here are fine
849 lpar_and_rpar_have_comments = func_call( # LPAR Comment
850 "Long really ridiculous type of string that shouldn't really even exist at all. I"
851 " mean commmme onnn!!!", # Comma Comment
855 "sudo -E deluge-console info --detailed --sort-reverse=time_added "
856 f"{'' if ID is None else ID} | perl -nE 'print if /^{field}:/'"
860 "sudo -E deluge-console info --detailed --sort-reverse=time_added"
861 f" {'' if ID is None else ID} | perl -nE 'print if /^{field}:/'"
865 "sudo -E deluge-console info --detailed --sort-reverse=time_added"
866 f" {'{{}}' if ID is None else ID} | perl -nE 'print if /^{field}:/'"
870 "sudo -E deluge-console info --detailed --sort-reverse=time_added {'' if ID is"
871 f" None else ID}} | perl -nE 'print if /^{field}:/'"
875 "This string really doesn't need to be an {{fstring}}, but this one most"
876 f" certainly, absolutely {does}."
879 fstring = f"We have to remember to escape {braces}. Like {{these}}. But not {this}."
886 f"This string ({string_leaf.value}) appears to be pointless (i.e. has"
892 user_regex = _lazy_re_compile(
893 r"(^[-!#$%&'*+/=?^_`{}|~0-9A-Z]+(\.[-!#$%&'*+/=?^_`{}|~0-9A-Z]+)*\Z" # dot-atom
894 r'|^"([\001-\010\013\014\016-\037!#-\[\]-\177]|\\[\001-\011\013\014\016-\177])*"\Z)', # quoted-string
900 user_regex = _lazy_re_compile(
901 "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" # dot-atom
902 "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", # quoted-string
908 user_regex = _lazy_re_compile(
909 "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" # dot-atom
910 "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", # quoted-string
918 if not hasattr(module, name):
920 "Could not find object %s in %s.\n"
921 "Please note that you cannot serialize things like inner "
922 "classes. Please move the object into the main module "
923 "body to use migrations.\n"
924 "For more information, see "
925 "https://docs.djangoproject.com/en/%s/topics/migrations/#serializing-values"
926 % (name, module_name, get_docs_version())
933 if not hasattr(module, name):
935 "Could not find object %s in %s.\nPlease note that you cannot"
936 " serialize things like inner classes. Please move the object into"
937 " the main module body to use migrations.\nFor more information,"
938 " see https://docs.djangoproject.com/en/%s/topics/migrations/#serializing-values"
939 % (name, module_name, get_docs_version())
944 "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
945 "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
946 "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
947 "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
951 class Step(StepBase):
954 "SR AAAA-CORRECT NAME IS {last_name} {first_name}{middle_name}"
955 " {title}/P{passenger_association}".format(
957 first_name=first_name,
958 middle_name=middle_name,
960 passenger_association=passenger_association,
965 xxxxxxx_xxxxxx_xxxxxxx = xxx(
969 '((x.aaaaaaaaa = "xxxxxx.xxxxxxxxxxxxxxxxxxxxx") || (x.xxxxxxxxx ='
970 ' "xxxxxxxxxxxx")) && '
971 # xxxxx xxxxxxxxxxxx xxxx xxx (xxxxxxxxxxxxxxxx) xx x xxxxxxxxx xx xxxxxx.
972 "(x.bbbbbbbbbbbb.xxx != "
973 '"xxx:xxx:xxx::cccccccccccc:xxxxxxx-xxxx/xxxxxxxxxxx/xxxxxxxxxxxxxxxxx") && '
979 if __name__ == "__main__":
980 for i in range(4, 8):
982 r"for pid in $(ps aux | grep paster | grep -v grep | grep '\-%d' | awk"
983 r" '{print $2}'); do kill $pid; done" % (i)
995 c_float(val[0][0] / val[0][1]).value
996 == c_float(value[0][0] / value[0][1]).value
997 ), "%s didn't roundtrip" % tag
1000 class xxxxxxxxxxxxxxxxxxxxx(xxxx.xxxxxxxxxxxxx):
1001 def xxxxxxx_xxxxxx(xxxx):
1002 assert xxxxxxx_xxxx in [
1003 x.xxxxx.xxxxxx.xxxxx.xxxxxx,
1004 x.xxxxx.xxxxxx.xxxxx.xxxx,
1006 "xxxxxxxxxxx xxxxxxx xxxx (xxxxxx xxxx) %x xxx xxxxx" % xxxxxxx_xxxx
1010 value.__dict__[key] = (
1011 "test" # set some Thrift field to non-None in the struct aa bb cc dd ee
1014 RE_ONE_BACKSLASH = {
1015 "asdf_hjkl_jkl": re.compile(
1016 r"(?<!([0-9]\ ))(?<=(^|\ ))([A-Z]+(\ )?|[0-9](\ )|[a-z](\ )){4,7}([A-Z]|[0-9]|[a-z])($|\b)(?!(\ ?([0-9]\ )|(\.)))"
1020 RE_TWO_BACKSLASHES = {
1021 "asdf_hjkl_jkl": re.compile(
1022 r"(?<!([0-9]\ ))(?<=(^|\ ))([A-Z]+(\ )?|[0-9](\ )|[a-z](\\"
1023 r" )){4,7}([A-Z]|[0-9]|[a-z])($|\b)(?!(\ ?([0-9]\ )|(\.)))"
1027 RE_THREE_BACKSLASHES = {
1028 "asdf_hjkl_jkl": re.compile(
1029 r"(?<!([0-9]\ ))(?<=(^|\ ))([A-Z]+(\ )?|[0-9](\ )|[a-z](\\\ )){4,7}([A-Z]|[0-9]|[a-z])($|\b)(?!(\ ?([0-9]\ )|(\.)))"
1033 # We do NOT split on f-string expressions.
1035 "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam."
1036 f" {[f'{i}' for i in range(10)]}"
1039 "This is a long string which contains an f-expr that should not split"
1040 f" {{{[i for i in range(5)]}}}."
1043 # The parens should NOT be removed in this case.
1045 "my very long string that should get formatted if I'm careful to make sure it goes"
1046 " over 88 characters which it has now"
1049 # The parens should NOT be removed in this case.
1051 "my very long string that should get formatted if I'm careful to make sure it goes"
1052 " over 88 characters which it has now"
1055 # The parens should NOT be removed in this case.
1057 "my very long string"
1058 " that should get formatted"
1059 " if I'm careful to make sure"
1060 " it goes over 88 characters which"
1065 def _legacy_listen_examples():
1067 " \"listen for the '%(event_name)s' event\"\n"
1068 "\n # ... (event logic logic logic) ...\n"
1076 async def foo(self):
1078 for candidate in CANDIDATES:
1080 "**{candidate.object_type} {candidate.rev}**"
1081 " - {candidate.description}\n"
1086 f"{f'{humanize_number(pos)}.': <{pound_len+2}} "
1087 f"{balance: <{bal_len + 5}} "
1088 f"<<{author.display_name}>>\n"
1093 == "['$', 'angaroo$', 'angrykangaroo$', 'aroo$', 'garoo$', "
1094 "'grykangaroo$', 'kangaroo$', 'ngaroo$', 'ngrykangaroo$', "
1095 "'o$', 'oo$', 'roo$', 'rykangaroo$', 'ykangaroo$']"
1099 != "['$', 'angaroo$', 'angrykangaroo$', 'aroo$', 'garoo$', "
1100 "'grykangaroo$', 'kangaroo$', 'ngaroo$', 'ngrykangaroo$', "
1101 "'o$', 'oo$', 'roo$', 'rykangaroo$', 'ykangaroo$']"
1105 <= "['$', 'angaroo$', 'angrykangaroo$', 'aroo$', 'garoo$', "
1106 "'grykangaroo$', 'kangaroo$', 'ngaroo$', 'ngrykangaroo$', "
1107 "'o$', 'oo$', 'roo$', 'rykangaroo$', 'ykangaroo$']"
1111 >= "['$', 'angaroo$', 'angrykangaroo$', 'aroo$', 'garoo$', "
1112 "'grykangaroo$', 'kangaroo$', 'ngaroo$', 'ngrykangaroo$', "
1113 "'o$', 'oo$', 'roo$', 'rykangaroo$', 'ykangaroo$']"
1117 < "['$', 'angaroo$', 'angrykangaroo$', 'aroo$', 'garoo$', "
1118 "'grykangaroo$', 'kangaroo$', 'ngaroo$', 'ngrykangaroo$', "
1119 "'o$', 'oo$', 'roo$', 'rykangaroo$', 'ykangaroo$']"
1123 > "['$', 'angaroo$', 'angrykangaroo$', 'aroo$', 'garoo$', "
1124 "'grykangaroo$', 'kangaroo$', 'ngaroo$', 'ngrykangaroo$', "
1125 "'o$', 'oo$', 'roo$', 'rykangaroo$', 'ykangaroo$']"
1129 in "['$', 'angaroo$', 'angrykangaroo$', 'aroo$', 'garoo$', 'grykangaroo$',"
1130 " 'kangaroo$', 'ngaroo$', 'ngrykangaroo$', 'o$', 'oo$', 'roo$', 'rykangaroo$',"
1135 not in "['$', 'angaroo$', 'angrykangaroo$', 'aroo$', 'garoo$', 'grykangaroo$',"
1136 " 'kangaroo$', 'ngaroo$', 'ngrykangaroo$', 'o$', 'oo$', 'roo$',"
1137 " 'rykangaroo$', 'ykangaroo$']"
1140 f"1. Go to Google Developers Console and log in with your Google account."
1141 f"(https://console.developers.google.com/)"
1142 f"2. You should be prompted to create a new project (name does not matter)."
1143 f"3. Click on Enable APIs and Services at the top."
1144 f"4. In the list of APIs choose or search for YouTube Data API v3 and "
1145 f"click on it. Choose Enable."
1146 f"5. Click on Credentials on the left navigation bar."
1147 f"6. Click on Create Credential at the top."
1148 f'7. At the top click the link for "API key".'
1149 f"8. No application restrictions are needed. Click Create at the bottom."
1150 f"9. You now have a key to add to `{{prefix}}set api youtube api_key`"
1153 f"1. Go to Google Developers Console and log in with your Google account."
1154 f"(https://console.developers.google.com/)"
1155 f"2. You should be prompted to create a new project (name does not matter)."
1156 f"3. Click on Enable APIs and Services at the top."
1157 f"4. In the list of APIs choose or search for YouTube Data API v3 and "
1158 f"click on it. Choose Enable."
1159 f"5. Click on Credentials on the left navigation bar."
1160 f"6. Click on Create Credential at the top."
1161 f'7. At the top click the link for "API key".'
1162 f"8. No application restrictions are needed. Click Create at the bottom."
1163 f"9. You now have a key to add to `{{prefix}}set api youtube api_key`"
1166 "1. Go to Google Developers Console and log in with your Google account."
1167 "(https://console.developers.google.com/)"
1168 "2. You should be prompted to create a new project (name does not matter)."
1169 "3. Click on Enable APIs and Services at the top."
1170 "4. In the list of APIs choose or search for YouTube Data API v3 and "
1171 "click on it. Choose Enable."
1172 "5. Click on Credentials on the left navigation bar."
1173 "6. Click on Create Credential at the top."
1174 '7. At the top click the link for "API key".'
1175 "8. No application restrictions are needed. Click Create at the bottom."
1176 f"9. You now have a key to add to `{prefix}set api youtube api_key`"
1179 # It shouldn't matter if the string prefixes are capitalized.
1181 f"{F'{humanize_number(pos)}.': <{pound_len+2}} "
1182 f"{balance: <{bal_len + 5}} "
1183 f"<<{author.display_name}>>\n"
1186 fstring = f"We have to remember to escape {braces}. Like {{these}}. But not {this}."
1188 welcome_to_programming = R"hello," R" world!"
1191 f"f-strings definitely make things more {difficult} than they need to be for"
1192 " {black}. But boy they sure are handy. The problem is that some lines will need"
1193 f" to have the 'f' whereas others do not. This {line}, for example, needs one."
1197 "This is a long string which contains an f-expr that should not split"
1198 f" {{{[i for i in range(5)]}}}."
1202 "\N{BLACK RIGHT-POINTING TRIANGLE WITH DOUBLE VERTICAL BAR}\N{VARIATION SELECTOR-16}"
1205 xxxxxx_xxx_xxxx_xx_xxxxx_xxxxxxxx_xxxxxxxx_xxxxxxxxxx_xxxx_xxxx_xxxxx = xxxx.xxxxxx.xxxxxxxxx.xxxxxxxxxxxxxxxxxxxx(
1208 "xxx3_xxxxx_xxxxxxxx_xxxxxxxx_xxxxxxxxxx_xxxxxxxx_xxxxxx_xxxxxxx"
1213 # Regression test for https://github.com/psf/black/issues/3117.
1215 "something_something": (
1216 r"Lorem ipsum dolor sit amet, an sed convenire eloquentiam \t"
1217 r"signiferumque, duo ea vocibus consetetur scriptorem. Facer \t"
1221 # Regression test for https://github.com/psf/black/issues/3459.
1223 empty_str_as_first_split=(
1225 f"xxxxxxx {xxxxxxxxxx} xxx xxxxxxxxxx xxxxx xxx xxx xx "
1226 "xxxxx xxxxxxxxx xxxxxxx, xxx xxxxxxxxxxx xxx xxxxx. "
1227 f"xxxxxxxxxxxxx xxxx xx xxxxxxxxxx. xxxxx: {x.xxx}"
1229 empty_u_str_as_first_split=(
1231 f"xxxxxxx {xxxxxxxxxx} xxx xxxxxxxxxx xxxxx xxx xxx xx "
1232 "xxxxx xxxxxxxxx xxxxxxx, xxx xxxxxxxxxxx xxx xxxxx. "
1233 f"xxxxxxxxxxxxx xxxx xx xxxxxxxxxx. xxxxx: {x.xxx}"
1237 # Regression test for https://github.com/psf/black/issues/3455.
1239 "/this/is/a/very/very/very/very/very/very/very/very/very/very/long/key/without/spaces":
1240 # And there is a comment before the value
1241 ("item1", "item2", "item3"),
1244 # Regression test for https://github.com/psf/black/issues/3506.
1245 s = f"With single quote: ' {my_dict['foo']} With double quote: \" {my_dict['bar']}"
1248 "Lorem Ipsum is simply dummy text of the printing and typesetting"
1249 f" industry:'{my_dict['foo']}'"