This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$1" == "--help" ]; then | |
printf "Usage: fetch-pull-request [--help] pull_request_id [remote=upstream] \n\n Locally fetch a pull request and test it. \n Remote is set to upstream by default.\n" | |
exit 1 | |
elif [ $# -eq 0 ]; then | |
echo "Pull request id not given." | |
exit 1 | |
else | |
set -e -x | |
remote=${2:-upstream} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Automaton: | |
def __init__(self, nstates): | |
self.transitions = [{} for i in range(nstates)] | |
self.accept_states = [False] * nstates | |
def register(self, source_state, char, target_state): | |
self.transitions[source_state][char] = target_state | |
def register_accept(self, state): | |
self.accept_states[state] = True |
NewerOlder