This file contains hidden or 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
| >>> for c in ['a', 'c', 'c']: | |
| print(c) | |
| a | |
| c | |
| c | |
| >>> for c in 'abc': | |
| print c |
This file contains hidden or 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
| (test) ERROR [dimension-etl-copy-dims-to-local-and-load-fdm thread-6] (ExecutionModelImpl.java:159) : No workflow model exists with id: 1 | |
| (test) ERROR [dimension-etl-copy-dims-to-local-and-load-fdm thread-6] (ExecutionModelImpl.java:159) : No workflow model exists with id: 1 | |
| cwd=target/workflow-test/jobs | |
| (test) ERROR [dimension-etl-copy-dims-to-local-and-load-fdm thread-6] (LoggingJob.java:115) : Fatal error occurred while running job 'dimension-etl-copy-dims-to-local-and-load-fdm': | |
| java.lang.RuntimeException: Processes ended with exit code 1. | |
| at azkaban.jobs.builtin.ProcessJob.run(ProcessJob.java:103) | |
| at azkaban.app.LoggingJob.run(LoggingJob.java:106) | |
| at azkaban.flow.IndividualJobExecutableFlow$1.run(IndividualJobExecutableFlow.java:180) | |
| at java.lang.Thread.run(Thread.java:619) | |
| (test) ERROR [dimension-etl-copy-dims-to-local-and-load-fdm thread-6] (ExecutionModelImpl.java:178) : No workflow model exists with id: 1 |
This file contains hidden or 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
| from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler | |
| from threading import Thread | |
| class Handler(BaseHTTPRequestHandler): | |
| data = None # Data got from the request | |
| status = 200 # Status to return | |
| reply = 'wassup?' # Reply to return | |
| def do_POST(self): | |
| length = int(self.headers.get('Content-length')) |
This file contains hidden or 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
| import re | |
| def parse_cell(cell): | |
| '''Parse a cell, return row, column. | |
| Note that we convert rows to 0 based indexing. | |
| >>> prase_cell('A2') | |
| (1, 0) | |
| ''' | |
| column = re.match('[A-Z]+', cell).group() |
This file contains hidden or 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
| import "fmt" | |
| func main() { | |
| fmt.Println("Hello Go!") | |
| } |
This file contains hidden or 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
| #!/usr/bin/env python | |
| from urllib import urlopen | |
| def get_metrics(url): | |
| metrics = {} | |
| for line in urlopen(url): | |
| key, value = line.split(':', 1) | |
| try: | |
| value = float(value) |
This file contains hidden or 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
| package main | |
| import ( | |
| "fmt" | |
| ) | |
| func main() { | |
| answers := make(map[int]bool) | |
| answers[10] = true |
This file contains hidden or 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
| #!/usr/bin/env python | |
| import json | |
| from collections import OrderedDict | |
| def make_repr(*fields): | |
| def repr(self): | |
| return json.dumps(OrderedDict((f, getattr(self, f)) for f in fields), | |
| indent=4) | |
| return repr |
This file contains hidden or 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
| package main | |
| import ( | |
| "fmt" | |
| ) | |
| type Event interface { | |
| Equals(other Event) bool | |
| } |
This file contains hidden or 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
| from itertools import chain | |
| def istail(it): | |
| '''Check if iterator has one more element. Return True/False and | |
| iterator.''' | |
| try: | |
| i = next(it) | |
| except StopIteration: | |
| return False, it |