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
| # -*- coding: utf-8 -*- | |
| """ | |
| """ | |
| from importlib import import_module | |
| from inspect import stack | |
| from inspect import ismethod |
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
| <html> | |
| <script> | |
| // ......................................................................... // | |
| /* | |
| * Function to wrap every method in the function to have self | |
| */ | |
| function selfify (obj) { | |
| // go over each property in the given object |
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
| class ExactRequestParamPredicate(object): | |
| def __init__(self, val, config): | |
| val = _as_sorted_tuple(val) | |
| reqs = [] | |
| for p in val: | |
| k = p | |
| v = None | |
| if '=' in p: | |
| k, v = p.split('=', 1) | |
| k, v = k.strip(), v.strip() |
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
| class NoRequestParamsPredicate(object): | |
| def __init__(self, val, config): | |
| self.val = bool(val) | |
| def text(self): | |
| return 'no_request_params = %s' % self.val | |
| phash = text | |
| def __call__(self, context, request): |
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
| diff --git a/nixops/backends/__init__.py b/nixops/backends/__init__.py | |
| index 86ed0f4..c52e9d3 100644 | |
| --- a/nixops/backends/__init__.py | |
| +++ b/nixops/backends/__init__.py | |
| @@ -93,6 +93,17 @@ class MachineState(nixops.resources.ResourceState): | |
| except nixops.ssh_util.SSHCommandFailed: | |
| return None | |
| + def get_os_arch(self): | |
| + """Get the machine's OS archicture.""" |
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
| { system ? builtins.currentSystem, foo ? "hello" }: | |
| let | |
| pkgs = import <nixpkgs> { inherit system; }; | |
| callPackage = pkgs.lib.callPackageWith (pkgs // self // { foo = foo;} ); | |
| self = rec { | |
| myPackage = callPackage ./pkgs/my_package { | |
| some_argument = foo; | |
| }; | |
| }; |
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
| class Engine(object): | |
| def __init__(self, size): | |
| self.size = size | |
| def turn_on(self): | |
| print "vrooom" | |
| class BiggerEngine(object): | |
| def __init__(self, size): |
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
| Copying src/zope.interface.egg-info to build/bdist.linux-x86_64/wheel/zope.interface-4.1.3-py3.5.egg-info | |
| Installing build/bdist.linux-x86_64/wheel/zope.interface-4.1.3-py3.5-nspkg.pth | |
| running install_scripts | |
| Traceback (most recent call last): | |
| File "<string>", line 1, in <module> | |
| File "/tmp/pip-build-ctv9n1fs/zope.interface/setup.py", line 147, in <module> | |
| **extra) | |
| File "/usr/lib64/python3.5/distutils/core.py", line 148, in setup | |
| dist.run_commands() | |
| File "/usr/lib64/python3.5/distutils/dist.py", line 955, in run_commands |
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 wsgiref.simple_server import make_server | |
| from pyramid.config import Configurator | |
| from pyramid.response import Response | |
| from rest_toolkit import resource | |
| @resource('/') | |
| class Greeting(object): | |
| def __init__(self, request): | |
| pass |
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 timeit import Timer | |
| # ........................................................................... # | |
| FORBIDDEN_CHARS = \ | |
| ('!', | |
| '@', | |
| '#', | |
| '$', | |
| '%', |