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
-- Copyright (c) 2015 Jonathan M. Lange <jml@mumak.net> | |
-- | |
-- Licensed under the Apache License, Version 2.0 (the "License"); | |
-- you may not use this file except in compliance with the License. | |
-- You may obtain a copy of the License at | |
-- | |
-- http://www.apache.org/licenses/LICENSE-2.0 | |
-- | |
-- Unless required by applicable law or agreed to in writing, software | |
-- distributed under the License is distributed on an "AS IS" BASIS, |
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
""" | |
Hypothesis strategies for testing ClusterHQ jira tools. | |
""" | |
import random | |
import networkx | |
from hypothesis.strategies import ( | |
dictionaries, |
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
def _flatten_graph_dict(d): | |
"""Map k [v] -> [(k, v)]""" | |
for k in d: | |
for v in d[k]: | |
yield (k, v) | |
# More complex arbitrary digraphs, where the nodes are integers, and each edge | |
# has a dictionary of text to text as metadata. |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
(Pdb) new_dict | |
pmap({'': '\x16)\x16\x11\x12\x16\x12\x16)\x06\x06\x11\x06\x11\x16\x12)\x12)\x06\x06)\x12\x12\x16)\x16\x12)\x12\x11\x11\x11\x12\x11\x11\x12\x06\x06', 'Zı': ')\x11\x12\x12\x06\x06\x12)))\x12\x06)\x16\x11\x11\x06\x11\x12\x16\x11\x06\x11\x16\x16', 'task_level': pvector([47, 633, 484, 681, 219, 27, 402, 525, 1812, 470, 523, 1]), 'MZMÖZ#ÖÖ': ')\x12\x11\x16\x06\x12\x11\x16\x06)\x11\x12)\x11\x12\x06\x06\x11\x12\x12\x06\x11)\x16\x11\x06\x16\x16\x11\x06))\x12)\x12\x16\x11\x12\x06\x11\x06\x12)\x06\x06))\x11\x06\x06\x12\x12)\x16\x12))', 'reason': 'Éo\t\tÉ\toÉ\toÉÉÉ\tooo\t\t\tÉoÉoÉoooo\t\t\tÉ', '<': ')\x06\x12\x16\x06\x06)\x16)\x12\x12\x16\x11\x06\x11\x12\x06)\x16\x06\x12\x12\x11\x06\x12\x16)\x12\x06\x11\x06\x16\x11\x16', '<ZÝııÝ': ')\x16\x16\x12\x06\x12))\x11\x11\x16\x16)\x11)\x06\x16)\x12\x16\x16)\x11\x11\x16\x12)', 'ÖıÝıZ##ıÝÖ#': '\x06\x06))\x11\x16\x11\x06\x16\x06\x11\x06\x11\x16\x16\x11\x12\x11\x11', 'action_status': 'failed', '#': ')\x06)\x06\x11\x16\x16\x12', 'exception': '¶q3\ng\x8aāG\x17¶¹GGXāĕ\x8a |
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
addToKey :: Ord k => k -> a -> Map k [a] -> Map k [a] | |
addToKey key value = | |
M.alter f key | |
where f Nothing = Just [value] | |
f (Just values) = Just (value:values) |
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
def orderable(*attributes): | |
def wrap(cl): | |
cl = _add_cmp(cl, attrs=attributes) | |
return cl | |
return wrap | |
def _attrs_to_tuple(obj, attrs): | |
""" | |
Create a tuple of values of *obj*'s *attributes*. |
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
{ mkDerivation, base, bytestring, containers, directory, hspec, mtl | |
, optparse-applicative, parsec, QuickCheck, rainbow, regex-compat | |
, stdenv, text, time, transformers, unix, vector, yaml | |
}: | |
mkDerivation { | |
pname = "hodor"; | |
version = "0.1.0.0"; | |
src = ./.; | |
isLibrary = false; | |
isExecutable = true; |
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
import Control.Monad.State | |
import Data.IORef | |
pop :: State [a] a | |
pop = do | |
x:xs <- get | |
put xs | |
return x |