Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

Important code snippet for Python (and other) developers

April 1, 2016
Mike Guerette
Related topics:
Linux
Related products:
Red Hat Enterprise Linux

    Special thanks to Red Hat's Petr Viktorin for sharing this bit of clever code.

    #! /usr/bin/python3 -O
    # finite_function_recursion:lazy_runtime_recoding:raw_unicode_escape
    
    from functools import partial
    
    
    def main():
        """Print an encouraging message to stdout"""
        print()
        for m in get_strings():
            print(m)
        print()
    
    
    def get_strings(c=0):
        """Return list of strings to display to the user"""
        I = L = C = s = 0
        S = o(
            41825590960378124374546057353963710973031568,
            1128197075877756693608173239149061571294131523370094467240707291316,
            28634919999905333837375431815649071658638057502987522288563421,
            365227113932356026740958928599365475099366847504156564532,
            10832, 9648, 1547030252077890721054968240874293402,
            6848886034432315113697, 1026545237296201918476380,
            136341829649174, 3484359852033570050171, 10968655762475855182,
            39478210171221680, 3160248663052126290380, 3160029950901936033378,
        )
        z, Z = O(-280271215295199, -2736841616)
        the_center = -277841241930399
    
        try:
            Z = O(Z, -c)
        except:
            try:
                K = next(O(-265771809929214))
                G = [S[8]]
                G.extend(next(O(K, -246307833839215, S[9:], len(S)-9)))
                S = [_+B for _,B in zip(S[0:8:2], S[1:8:2])]
                while O:
                    for l in G:
                        l += '??'  # why? O.O
                        K = -277962714030097
                        for i, R in enumerate(l):
                            g = O(z, -4799136684787408983396238841240584605, L, C)
                            if not s or all(g):
                                (L, C), g = O(c, -26332501388653470403, c,
                                              -926028122499)
                                if L < len(S)+1 or C < max(len(l) for l in S): 
                                    # that won't work 
                                    raise KeyboardInterrupt() 
                                s = (L-len(S)-1)//3 
                                for R in S: 
                                    [R] = O(R, the_center, C) 
                                    if not all(O(c, K, s, 0, R)): 
                                        s += 1 
                                I = C 
                            i = list(O( 
                                c, -2737653409, s, 0, c, -23700765332242292499, c, 
                                K, s, (C - len(l) + 2) >>True,
                                l[:i], c, -76096271187210414, Z, -909936122515, 1
                                /0b1001))
                        any(O(Z, -2135*426199589, 2))
            except KeyboardInterrupt:
                # job security here
                S+=[G[0]]
                S[-1]+=l[-1]
                return [next(O(G, the_center, I)) for G in S]
        else:
            return z.wrapper(get_strings)
    
    def O(*g):
        # XXX: document this
        G,* a = isinstance                                         ,
        yield from [(a.append(getattr(a[-1], *o(-A)))  #  lol  _.-^ ^-._
        if a else (yield __import__(*o(-A))))
        if G(A, int) and A <False> -3 else a.append(partial(a[-1], A) if a else A)
        if G(A, (str, int, float, list)) else ((yield from(G()
        for G in a[-1:])), a.append(A)) if a else (a.append(A))
        for A in g]
        yield from(G()for G in a[-1:])
    
    
    def o(*l, N=300):
        # made with curses
        o = lambda n: chr(n%N) + o(n//N) if n else ''
        return list(filter(bool, map(o, l)))
    
    
    main()
    

    Newb hint: You need Python3

    Still can't wait?  Learn about this here.

     

     

    Last updated: January 18, 2023

    Recent Posts

    • Deploy MemPalace MCP Server on Red Hat OpenShift AI

    • Get ready for Ansible Automation Platform 2.7

    • Manage LLM evaluation workloads at scale with EvalHub and Kueue

    • Troubleshoot application misbehavior after an OpenShift upgrade

    • Preserve OpenShift Pipelines logs with OpenTelemetry

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Chat Support

    Please log in with your Red Hat account to access chat support.