commit
stringlengths
40
40
old_file
stringlengths
4
118
new_file
stringlengths
4
118
old_contents
stringlengths
0
2.94k
new_contents
stringlengths
1
4.43k
subject
stringlengths
15
444
message
stringlengths
16
3.45k
lang
stringclasses
1 value
license
stringclasses
13 values
repos
stringlengths
5
43.2k
prompt
stringlengths
17
4.58k
response
stringlengths
1
4.43k
prompt_tagged
stringlengths
58
4.62k
response_tagged
stringlengths
1
4.43k
text
stringlengths
132
7.29k
text_tagged
stringlengths
173
7.33k
656780b827202fc08992321ec2a98e91cb02da3b
utilities/__init__.py
utilities/__init__.py
#! /usr/bin/env python from subprocess import Popen, PIPE def _popen(cmd): """ Fork the specified command, returning a tuple of (stdout, stderr) """ return Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate()
#! /usr/bin/env python from subprocess import Popen, PIPE def launch(cmd): """ Fork the specified command, returning a tuple of (stdout, stderr) """ return Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate() def get_stdout(cmd): """ Fork the specified command, returning stdout ...
Add a wrapper to get just stdout back
Add a wrapper to get just stdout back
Python
mit
IanLee1521/utilities
#! /usr/bin/env python from subprocess import Popen, PIPE def _popen(cmd): """ Fork the specified command, returning a tuple of (stdout, stderr) """ return Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate() Add a wrapper to get just stdout back
#! /usr/bin/env python from subprocess import Popen, PIPE def launch(cmd): """ Fork the specified command, returning a tuple of (stdout, stderr) """ return Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate() def get_stdout(cmd): """ Fork the specified command, returning stdout ...
<commit_before>#! /usr/bin/env python from subprocess import Popen, PIPE def _popen(cmd): """ Fork the specified command, returning a tuple of (stdout, stderr) """ return Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate() <commit_msg>Add a wrapper to get just stdout back<commit_after>
#! /usr/bin/env python from subprocess import Popen, PIPE def launch(cmd): """ Fork the specified command, returning a tuple of (stdout, stderr) """ return Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate() def get_stdout(cmd): """ Fork the specified command, returning stdout ...
#! /usr/bin/env python from subprocess import Popen, PIPE def _popen(cmd): """ Fork the specified command, returning a tuple of (stdout, stderr) """ return Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate() Add a wrapper to get just stdout back#! /usr/bin/env python from subprocess impor...
<commit_before>#! /usr/bin/env python from subprocess import Popen, PIPE def _popen(cmd): """ Fork the specified command, returning a tuple of (stdout, stderr) """ return Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate() <commit_msg>Add a wrapper to get just stdout back<commit_after>#! /...
de3809a00703c5eaaaec856b152a2418debbb6c6
plugins/Tools/MirrorTool/__init__.py
plugins/Tools/MirrorTool/__init__.py
from . import MirrorTool def getMetaData(): return { 'type': 'tool', 'plugin': { 'name': 'Mirror Tool' }, 'tool': { 'name': 'Mirror', 'description': 'Mirror Object' }, } def register(app): return MirrorTool.MirrorTool()
from . import MirrorTool def getMetaData(): return { 'type': 'tool', 'plugin': { 'name': 'Mirror Tool' }, 'tool': { 'name': 'Mirror', 'description': 'Mirror Object', 'icon': 'mirror.png' }, } def register(app): return ...
Use the right icon for the mirror tool
Use the right icon for the mirror tool
Python
agpl-3.0
onitake/Uranium,onitake/Uranium
from . import MirrorTool def getMetaData(): return { 'type': 'tool', 'plugin': { 'name': 'Mirror Tool' }, 'tool': { 'name': 'Mirror', 'description': 'Mirror Object' }, } def register(app): return MirrorTool.MirrorTool() Use the ri...
from . import MirrorTool def getMetaData(): return { 'type': 'tool', 'plugin': { 'name': 'Mirror Tool' }, 'tool': { 'name': 'Mirror', 'description': 'Mirror Object', 'icon': 'mirror.png' }, } def register(app): return ...
<commit_before>from . import MirrorTool def getMetaData(): return { 'type': 'tool', 'plugin': { 'name': 'Mirror Tool' }, 'tool': { 'name': 'Mirror', 'description': 'Mirror Object' }, } def register(app): return MirrorTool.MirrorTo...
from . import MirrorTool def getMetaData(): return { 'type': 'tool', 'plugin': { 'name': 'Mirror Tool' }, 'tool': { 'name': 'Mirror', 'description': 'Mirror Object', 'icon': 'mirror.png' }, } def register(app): return ...
from . import MirrorTool def getMetaData(): return { 'type': 'tool', 'plugin': { 'name': 'Mirror Tool' }, 'tool': { 'name': 'Mirror', 'description': 'Mirror Object' }, } def register(app): return MirrorTool.MirrorTool() Use the ri...
<commit_before>from . import MirrorTool def getMetaData(): return { 'type': 'tool', 'plugin': { 'name': 'Mirror Tool' }, 'tool': { 'name': 'Mirror', 'description': 'Mirror Object' }, } def register(app): return MirrorTool.MirrorTo...
1724d05226a301bcedfebe963006818461c1b457
vispy/app/__init__.py
vispy/app/__init__.py
# -*- coding: utf-8 -*- # Copyright (c) 2014, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. """ The app module defines three classes: Application, Canvas, and Timer. On loading, vispy creates a default Application instance which can be used via functions in the modul...
# -*- coding: utf-8 -*- # Copyright (c) 2014, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. """ The app module defines three classes: Application, Canvas, and Timer. On loading, vispy creates a default Application instance which can be used via functions in the modul...
Fix for the tests, not complaining allowed about set_interactive not being used.
Fix for the tests, not complaining allowed about set_interactive not being used.
Python
bsd-3-clause
bollu/vispy,sbtlaarzc/vispy,michaelaye/vispy,jay3sh/vispy,ghisvail/vispy,dchilds7/Deysha-Star-Formation,Eric89GXL/vispy,QuLogic/vispy,dchilds7/Deysha-Star-Formation,jdreaver/vispy,RebeccaWPerry/vispy,hronoses/vispy,bollu/vispy,jdreaver/vispy,inclement/vispy,sbtlaarzc/vispy,QuLogic/vispy,julienr/vispy,michaelaye/vispy,E...
# -*- coding: utf-8 -*- # Copyright (c) 2014, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. """ The app module defines three classes: Application, Canvas, and Timer. On loading, vispy creates a default Application instance which can be used via functions in the modul...
# -*- coding: utf-8 -*- # Copyright (c) 2014, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. """ The app module defines three classes: Application, Canvas, and Timer. On loading, vispy creates a default Application instance which can be used via functions in the modul...
<commit_before># -*- coding: utf-8 -*- # Copyright (c) 2014, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. """ The app module defines three classes: Application, Canvas, and Timer. On loading, vispy creates a default Application instance which can be used via functio...
# -*- coding: utf-8 -*- # Copyright (c) 2014, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. """ The app module defines three classes: Application, Canvas, and Timer. On loading, vispy creates a default Application instance which can be used via functions in the modul...
# -*- coding: utf-8 -*- # Copyright (c) 2014, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. """ The app module defines three classes: Application, Canvas, and Timer. On loading, vispy creates a default Application instance which can be used via functions in the modul...
<commit_before># -*- coding: utf-8 -*- # Copyright (c) 2014, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. """ The app module defines three classes: Application, Canvas, and Timer. On loading, vispy creates a default Application instance which can be used via functio...
0daa2132c071cb667aca5dbc416872a278e91a2b
pycoin/coins/groestlcoin/hash.py
pycoin/coins/groestlcoin/hash.py
import hashlib import groestlcoin_hash from pycoin.encoding.hexbytes import bytes_as_revhex def sha256(data): return bytes_as_revhex(hashlib.sha256(data).digest()) def groestlHash(data): """Groestl-512 compound hash.""" return bytes_as_revhex(groestlcoin_hash.getHash(data, len(data)))
import hashlib from pycoin.encoding.hexbytes import bytes_as_revhex def sha256(data): return bytes_as_revhex(hashlib.sha256(data).digest()) def groestlHash(data): """Groestl-512 compound hash.""" try: import groestlcoin_hash except ImportError: t = 'Groestlcoin requires the groestlc...
Raise ImportError when GRS is used without dependency
Raise ImportError when GRS is used without dependency
Python
mit
richardkiss/pycoin,richardkiss/pycoin
import hashlib import groestlcoin_hash from pycoin.encoding.hexbytes import bytes_as_revhex def sha256(data): return bytes_as_revhex(hashlib.sha256(data).digest()) def groestlHash(data): """Groestl-512 compound hash.""" return bytes_as_revhex(groestlcoin_hash.getHash(data, len(data))) Raise ImportErro...
import hashlib from pycoin.encoding.hexbytes import bytes_as_revhex def sha256(data): return bytes_as_revhex(hashlib.sha256(data).digest()) def groestlHash(data): """Groestl-512 compound hash.""" try: import groestlcoin_hash except ImportError: t = 'Groestlcoin requires the groestlc...
<commit_before>import hashlib import groestlcoin_hash from pycoin.encoding.hexbytes import bytes_as_revhex def sha256(data): return bytes_as_revhex(hashlib.sha256(data).digest()) def groestlHash(data): """Groestl-512 compound hash.""" return bytes_as_revhex(groestlcoin_hash.getHash(data, len(data))) <...
import hashlib from pycoin.encoding.hexbytes import bytes_as_revhex def sha256(data): return bytes_as_revhex(hashlib.sha256(data).digest()) def groestlHash(data): """Groestl-512 compound hash.""" try: import groestlcoin_hash except ImportError: t = 'Groestlcoin requires the groestlc...
import hashlib import groestlcoin_hash from pycoin.encoding.hexbytes import bytes_as_revhex def sha256(data): return bytes_as_revhex(hashlib.sha256(data).digest()) def groestlHash(data): """Groestl-512 compound hash.""" return bytes_as_revhex(groestlcoin_hash.getHash(data, len(data))) Raise ImportErro...
<commit_before>import hashlib import groestlcoin_hash from pycoin.encoding.hexbytes import bytes_as_revhex def sha256(data): return bytes_as_revhex(hashlib.sha256(data).digest()) def groestlHash(data): """Groestl-512 compound hash.""" return bytes_as_revhex(groestlcoin_hash.getHash(data, len(data))) <...
b1b8e06b2b0ae6c79b94bd8e7b0b49721b7bdc13
web/attempts/tests.py
web/attempts/tests.py
from django.test import TestCase # Create your tests here.
from django.test import TestCase from rest_framework.test import APIClient from users.models import User # Create your tests here. class TokenLoginTestCase(TestCase): fixtures = ['users.json'] def testAttemptSubmit(self): user = User.objects.get(username='matija') client = APIClient() ...
Add simple Attempt submit test
Add simple Attempt submit test
Python
agpl-3.0
matijapretnar/projekt-tomo,ul-fmf/projekt-tomo,matijapretnar/projekt-tomo,ul-fmf/projekt-tomo,ul-fmf/projekt-tomo,ul-fmf/projekt-tomo,matijapretnar/projekt-tomo,matijapretnar/projekt-tomo,ul-fmf/projekt-tomo,ul-fmf/projekt-tomo,matijapretnar/projekt-tomo
from django.test import TestCase # Create your tests here. Add simple Attempt submit test
from django.test import TestCase from rest_framework.test import APIClient from users.models import User # Create your tests here. class TokenLoginTestCase(TestCase): fixtures = ['users.json'] def testAttemptSubmit(self): user = User.objects.get(username='matija') client = APIClient() ...
<commit_before>from django.test import TestCase # Create your tests here. <commit_msg>Add simple Attempt submit test<commit_after>
from django.test import TestCase from rest_framework.test import APIClient from users.models import User # Create your tests here. class TokenLoginTestCase(TestCase): fixtures = ['users.json'] def testAttemptSubmit(self): user = User.objects.get(username='matija') client = APIClient() ...
from django.test import TestCase # Create your tests here. Add simple Attempt submit testfrom django.test import TestCase from rest_framework.test import APIClient from users.models import User # Create your tests here. class TokenLoginTestCase(TestCase): fixtures = ['users.json'] def testAttemptSubmit(self...
<commit_before>from django.test import TestCase # Create your tests here. <commit_msg>Add simple Attempt submit test<commit_after>from django.test import TestCase from rest_framework.test import APIClient from users.models import User # Create your tests here. class TokenLoginTestCase(TestCase): fixtures = ['use...
4ed701a7afad4c8c3c04097e449e930cc4545e0d
mendel/admin.py
mendel/admin.py
from django.contrib import admin from import_export import resources from import_export.admin import ImportExportModelAdmin from mendel.models import Keyword, Category, Document, Context, Review class KeywordAdmin(ImportExportModelAdmin): pass class CategoryAdmin(ImportExportModelAdmin): pass class Docum...
from django.contrib import admin from import_export import resources from import_export.admin import ImportExportModelAdmin from mendel.models import Keyword, Category, Document, Context, Review class KeywordAdmin(ImportExportModelAdmin): list_display = ('id', 'name') pass class CategoryAdmin(ImportExportM...
Add list_displays for Admin views
Add list_displays for Admin views
Python
agpl-3.0
Architizer/mendel,Architizer/mendel,Architizer/mendel,Architizer/mendel
from django.contrib import admin from import_export import resources from import_export.admin import ImportExportModelAdmin from mendel.models import Keyword, Category, Document, Context, Review class KeywordAdmin(ImportExportModelAdmin): pass class CategoryAdmin(ImportExportModelAdmin): pass class Docum...
from django.contrib import admin from import_export import resources from import_export.admin import ImportExportModelAdmin from mendel.models import Keyword, Category, Document, Context, Review class KeywordAdmin(ImportExportModelAdmin): list_display = ('id', 'name') pass class CategoryAdmin(ImportExportM...
<commit_before>from django.contrib import admin from import_export import resources from import_export.admin import ImportExportModelAdmin from mendel.models import Keyword, Category, Document, Context, Review class KeywordAdmin(ImportExportModelAdmin): pass class CategoryAdmin(ImportExportModelAdmin): pas...
from django.contrib import admin from import_export import resources from import_export.admin import ImportExportModelAdmin from mendel.models import Keyword, Category, Document, Context, Review class KeywordAdmin(ImportExportModelAdmin): list_display = ('id', 'name') pass class CategoryAdmin(ImportExportM...
from django.contrib import admin from import_export import resources from import_export.admin import ImportExportModelAdmin from mendel.models import Keyword, Category, Document, Context, Review class KeywordAdmin(ImportExportModelAdmin): pass class CategoryAdmin(ImportExportModelAdmin): pass class Docum...
<commit_before>from django.contrib import admin from import_export import resources from import_export.admin import ImportExportModelAdmin from mendel.models import Keyword, Category, Document, Context, Review class KeywordAdmin(ImportExportModelAdmin): pass class CategoryAdmin(ImportExportModelAdmin): pas...
d879c6338449cd0c2f3c9a84162b3de688a55105
webdiff/gitwebdiff.py
webdiff/gitwebdiff.py
#!/usr/bin/env python '''This lets you run "git webdiff" instead of "git difftool".''' import os import subprocess import sys def any_nonflag_args(args): """Do any args not start with '-'? If so, this isn't a HEAD diff.""" return len([x for x in args if not x.startswith('-')]) > 0 def run(): if not any...
#!/usr/bin/env python '''This lets you run "git webdiff" instead of "git difftool".''' import os import subprocess import sys def any_nonflag_args(args): """Do any args not start with '-'? If so, this isn't a HEAD diff.""" return len([x for x in args if not x.startswith('-')]) > 0 def run(): if not any...
Exit cleanly from 'git webdiff'
Exit cleanly from 'git webdiff' - Don't allow a KeyboardInterrupt/sigint exception propagate up to the user when exiting webdiff with Ctrl-C
Python
apache-2.0
daytonb/webdiff,danvk/webdiff,daytonb/webdiff,daytonb/webdiff,danvk/webdiff,danvk/webdiff,danvk/webdiff,daytonb/webdiff,danvk/webdiff
#!/usr/bin/env python '''This lets you run "git webdiff" instead of "git difftool".''' import os import subprocess import sys def any_nonflag_args(args): """Do any args not start with '-'? If so, this isn't a HEAD diff.""" return len([x for x in args if not x.startswith('-')]) > 0 def run(): if not any...
#!/usr/bin/env python '''This lets you run "git webdiff" instead of "git difftool".''' import os import subprocess import sys def any_nonflag_args(args): """Do any args not start with '-'? If so, this isn't a HEAD diff.""" return len([x for x in args if not x.startswith('-')]) > 0 def run(): if not any...
<commit_before>#!/usr/bin/env python '''This lets you run "git webdiff" instead of "git difftool".''' import os import subprocess import sys def any_nonflag_args(args): """Do any args not start with '-'? If so, this isn't a HEAD diff.""" return len([x for x in args if not x.startswith('-')]) > 0 def run():...
#!/usr/bin/env python '''This lets you run "git webdiff" instead of "git difftool".''' import os import subprocess import sys def any_nonflag_args(args): """Do any args not start with '-'? If so, this isn't a HEAD diff.""" return len([x for x in args if not x.startswith('-')]) > 0 def run(): if not any...
#!/usr/bin/env python '''This lets you run "git webdiff" instead of "git difftool".''' import os import subprocess import sys def any_nonflag_args(args): """Do any args not start with '-'? If so, this isn't a HEAD diff.""" return len([x for x in args if not x.startswith('-')]) > 0 def run(): if not any...
<commit_before>#!/usr/bin/env python '''This lets you run "git webdiff" instead of "git difftool".''' import os import subprocess import sys def any_nonflag_args(args): """Do any args not start with '-'? If so, this isn't a HEAD diff.""" return len([x for x in args if not x.startswith('-')]) > 0 def run():...
a06f586ba95148643561122f051087db7b63fecb
registries/views.py
registries/views.py
from django.shortcuts import render from django.conf import settings from django.http import HttpResponse from rest_framework.generics import ListAPIView from registries.models import Organization from registries.serializers import DrillerListSerializer class APIDrillerListView(ListAPIView): queryset = Organizatio...
from django.shortcuts import render from django.conf import settings from django.http import HttpResponse from rest_framework.generics import ListAPIView from registries.models import Organization from registries.serializers import DrillerListSerializer class APIDrillerListView(ListAPIView): queryset = Organizatio...
Add prefetch to reduce queries on province_state
Add prefetch to reduce queries on province_state
Python
apache-2.0
rstens/gwells,rstens/gwells,rstens/gwells,bcgov/gwells,bcgov/gwells,rstens/gwells,bcgov/gwells,bcgov/gwells
from django.shortcuts import render from django.conf import settings from django.http import HttpResponse from rest_framework.generics import ListAPIView from registries.models import Organization from registries.serializers import DrillerListSerializer class APIDrillerListView(ListAPIView): queryset = Organizatio...
from django.shortcuts import render from django.conf import settings from django.http import HttpResponse from rest_framework.generics import ListAPIView from registries.models import Organization from registries.serializers import DrillerListSerializer class APIDrillerListView(ListAPIView): queryset = Organizatio...
<commit_before>from django.shortcuts import render from django.conf import settings from django.http import HttpResponse from rest_framework.generics import ListAPIView from registries.models import Organization from registries.serializers import DrillerListSerializer class APIDrillerListView(ListAPIView): queryse...
from django.shortcuts import render from django.conf import settings from django.http import HttpResponse from rest_framework.generics import ListAPIView from registries.models import Organization from registries.serializers import DrillerListSerializer class APIDrillerListView(ListAPIView): queryset = Organizatio...
from django.shortcuts import render from django.conf import settings from django.http import HttpResponse from rest_framework.generics import ListAPIView from registries.models import Organization from registries.serializers import DrillerListSerializer class APIDrillerListView(ListAPIView): queryset = Organizatio...
<commit_before>from django.shortcuts import render from django.conf import settings from django.http import HttpResponse from rest_framework.generics import ListAPIView from registries.models import Organization from registries.serializers import DrillerListSerializer class APIDrillerListView(ListAPIView): queryse...
67fb6076b98a25f22a343f0c6ec62193ed86125a
bmi_ilamb/bmi_ilamb.py
bmi_ilamb/bmi_ilamb.py
#! /usr/bin/env python import sys import subprocess from basic_modeling_interface import Bmi class BmiIlamb(Bmi): _command = 'ilamb-run' _args = None _env = None def __init__(self): self._time = self.get_start_time() @property def args(self): return [self._command] + (self._a...
"""Basic Model Interface (BMI) for the ILAMB benchmarking system.""" import os import subprocess from basic_modeling_interface import Bmi from .config import Configuration class BmiIlamb(Bmi): _component_name = 'ILAMB' _command = 'ilamb-run' _args = None def __init__(self): self._time = self...
Update ILAMB BMI to use Configuration
Update ILAMB BMI to use Configuration I also set ILAMB_ROOT and MPLBACKEND at `initialize`. Not sure if there's a better location.
Python
mit
permamodel/bmi-ilamb
#! /usr/bin/env python import sys import subprocess from basic_modeling_interface import Bmi class BmiIlamb(Bmi): _command = 'ilamb-run' _args = None _env = None def __init__(self): self._time = self.get_start_time() @property def args(self): return [self._command] + (self._a...
"""Basic Model Interface (BMI) for the ILAMB benchmarking system.""" import os import subprocess from basic_modeling_interface import Bmi from .config import Configuration class BmiIlamb(Bmi): _component_name = 'ILAMB' _command = 'ilamb-run' _args = None def __init__(self): self._time = self...
<commit_before>#! /usr/bin/env python import sys import subprocess from basic_modeling_interface import Bmi class BmiIlamb(Bmi): _command = 'ilamb-run' _args = None _env = None def __init__(self): self._time = self.get_start_time() @property def args(self): return [self._comm...
"""Basic Model Interface (BMI) for the ILAMB benchmarking system.""" import os import subprocess from basic_modeling_interface import Bmi from .config import Configuration class BmiIlamb(Bmi): _component_name = 'ILAMB' _command = 'ilamb-run' _args = None def __init__(self): self._time = self...
#! /usr/bin/env python import sys import subprocess from basic_modeling_interface import Bmi class BmiIlamb(Bmi): _command = 'ilamb-run' _args = None _env = None def __init__(self): self._time = self.get_start_time() @property def args(self): return [self._command] + (self._a...
<commit_before>#! /usr/bin/env python import sys import subprocess from basic_modeling_interface import Bmi class BmiIlamb(Bmi): _command = 'ilamb-run' _args = None _env = None def __init__(self): self._time = self.get_start_time() @property def args(self): return [self._comm...
b8df411dc6cbbad981c98d918627143ffd1c9ef3
kmeldb/AlbumIndexEntry.py
kmeldb/AlbumIndexEntry.py
from .BaseIndexEntry import BaseIndexEntry class AlbumIndexEntry(BaseIndexEntry): def __init__(self, name, titles, number): super(AlbumIndexEntry, self).__init__(name, titles, number) self._title_numbers = [] self._discs_and_tracks = {} for title in self._titles: # S...
from .BaseIndexEntry import BaseIndexEntry class AlbumIndexEntry(BaseIndexEntry): def __init__(self, name, titles, number): super(AlbumIndexEntry, self).__init__(name, titles, number) self._discs_and_tracks = {} for title in self._titles: # Set the album number on each of th...
Return title numbers in disc and track order, increment disc number if duplicated track number
Return title numbers in disc and track order, increment disc number if duplicated track number
Python
apache-2.0
chrrrisw/kmel_db,chrrrisw/kmel_db
from .BaseIndexEntry import BaseIndexEntry class AlbumIndexEntry(BaseIndexEntry): def __init__(self, name, titles, number): super(AlbumIndexEntry, self).__init__(name, titles, number) self._title_numbers = [] self._discs_and_tracks = {} for title in self._titles: # S...
from .BaseIndexEntry import BaseIndexEntry class AlbumIndexEntry(BaseIndexEntry): def __init__(self, name, titles, number): super(AlbumIndexEntry, self).__init__(name, titles, number) self._discs_and_tracks = {} for title in self._titles: # Set the album number on each of th...
<commit_before>from .BaseIndexEntry import BaseIndexEntry class AlbumIndexEntry(BaseIndexEntry): def __init__(self, name, titles, number): super(AlbumIndexEntry, self).__init__(name, titles, number) self._title_numbers = [] self._discs_and_tracks = {} for title in self._titles: ...
from .BaseIndexEntry import BaseIndexEntry class AlbumIndexEntry(BaseIndexEntry): def __init__(self, name, titles, number): super(AlbumIndexEntry, self).__init__(name, titles, number) self._discs_and_tracks = {} for title in self._titles: # Set the album number on each of th...
from .BaseIndexEntry import BaseIndexEntry class AlbumIndexEntry(BaseIndexEntry): def __init__(self, name, titles, number): super(AlbumIndexEntry, self).__init__(name, titles, number) self._title_numbers = [] self._discs_and_tracks = {} for title in self._titles: # S...
<commit_before>from .BaseIndexEntry import BaseIndexEntry class AlbumIndexEntry(BaseIndexEntry): def __init__(self, name, titles, number): super(AlbumIndexEntry, self).__init__(name, titles, number) self._title_numbers = [] self._discs_and_tracks = {} for title in self._titles: ...
a657792c10f59ed94af3039807ef92318b5c23f9
src/graphql/pyutils/is_iterable.py
src/graphql/pyutils/is_iterable.py
from array import array from typing import Any, ByteString, Collection, Iterable, Mapping, Text, ValuesView __all__ = ["is_collection", "is_iterable"] collection_types: Any = [Collection] if not isinstance({}.values(), Collection): # Python < 3.7.2 collection_types.append(ValuesView) if not isinstance(array, Co...
from array import array from typing import Any, ByteString, Collection, Iterable, Mapping, Text, ValuesView __all__ = ["is_collection", "is_iterable"] collection_types: Any = [Collection] if not isinstance({}.values(), Collection): # Python < 3.7.2 collection_types.append(ValuesView) if not issubclass(array, Co...
Correct a workaround for PyPy
Correct a workaround for PyPy
Python
mit
graphql-python/graphql-core
from array import array from typing import Any, ByteString, Collection, Iterable, Mapping, Text, ValuesView __all__ = ["is_collection", "is_iterable"] collection_types: Any = [Collection] if not isinstance({}.values(), Collection): # Python < 3.7.2 collection_types.append(ValuesView) if not isinstance(array, Co...
from array import array from typing import Any, ByteString, Collection, Iterable, Mapping, Text, ValuesView __all__ = ["is_collection", "is_iterable"] collection_types: Any = [Collection] if not isinstance({}.values(), Collection): # Python < 3.7.2 collection_types.append(ValuesView) if not issubclass(array, Co...
<commit_before>from array import array from typing import Any, ByteString, Collection, Iterable, Mapping, Text, ValuesView __all__ = ["is_collection", "is_iterable"] collection_types: Any = [Collection] if not isinstance({}.values(), Collection): # Python < 3.7.2 collection_types.append(ValuesView) if not isins...
from array import array from typing import Any, ByteString, Collection, Iterable, Mapping, Text, ValuesView __all__ = ["is_collection", "is_iterable"] collection_types: Any = [Collection] if not isinstance({}.values(), Collection): # Python < 3.7.2 collection_types.append(ValuesView) if not issubclass(array, Co...
from array import array from typing import Any, ByteString, Collection, Iterable, Mapping, Text, ValuesView __all__ = ["is_collection", "is_iterable"] collection_types: Any = [Collection] if not isinstance({}.values(), Collection): # Python < 3.7.2 collection_types.append(ValuesView) if not isinstance(array, Co...
<commit_before>from array import array from typing import Any, ByteString, Collection, Iterable, Mapping, Text, ValuesView __all__ = ["is_collection", "is_iterable"] collection_types: Any = [Collection] if not isinstance({}.values(), Collection): # Python < 3.7.2 collection_types.append(ValuesView) if not isins...
3749acbad597974ef2507b2e7e27240937658c0b
nilmtk/plots.py
nilmtk/plots.py
from __future__ import print_function, division import matplotlib.pyplot as plt import matplotlib.dates as mdates import numpy as np _to_ordinalf_np_vectorized = np.vectorize(mdates._to_ordinalf) def plot_series(series, ax=None, label=None, date_format='%d/%m/%y %H:%M:%S', **kwargs): """Plot function for series w...
from __future__ import print_function, division import matplotlib.pyplot as plt import matplotlib.dates as mdates import numpy as np _to_ordinalf_np_vectorized = np.vectorize(mdates._to_ordinalf) def plot_series(series, ax=None, label=None, date_format='%d/%m/%y %H:%M:%S', **kwargs): """Plot function for series w...
Fix bug where timezone was not used for xaxis.
Fix bug where timezone was not used for xaxis.
Python
apache-2.0
jaduimstra/nilmtk,josemao/nilmtk,pauldeng/nilmtk,AlexRobson/nilmtk,mmottahedi/nilmtk,nilmtk/nilmtk,nilmtk/nilmtk,HarllanAndrye/nilmtk
from __future__ import print_function, division import matplotlib.pyplot as plt import matplotlib.dates as mdates import numpy as np _to_ordinalf_np_vectorized = np.vectorize(mdates._to_ordinalf) def plot_series(series, ax=None, label=None, date_format='%d/%m/%y %H:%M:%S', **kwargs): """Plot function for series w...
from __future__ import print_function, division import matplotlib.pyplot as plt import matplotlib.dates as mdates import numpy as np _to_ordinalf_np_vectorized = np.vectorize(mdates._to_ordinalf) def plot_series(series, ax=None, label=None, date_format='%d/%m/%y %H:%M:%S', **kwargs): """Plot function for series w...
<commit_before>from __future__ import print_function, division import matplotlib.pyplot as plt import matplotlib.dates as mdates import numpy as np _to_ordinalf_np_vectorized = np.vectorize(mdates._to_ordinalf) def plot_series(series, ax=None, label=None, date_format='%d/%m/%y %H:%M:%S', **kwargs): """Plot functi...
from __future__ import print_function, division import matplotlib.pyplot as plt import matplotlib.dates as mdates import numpy as np _to_ordinalf_np_vectorized = np.vectorize(mdates._to_ordinalf) def plot_series(series, ax=None, label=None, date_format='%d/%m/%y %H:%M:%S', **kwargs): """Plot function for series w...
from __future__ import print_function, division import matplotlib.pyplot as plt import matplotlib.dates as mdates import numpy as np _to_ordinalf_np_vectorized = np.vectorize(mdates._to_ordinalf) def plot_series(series, ax=None, label=None, date_format='%d/%m/%y %H:%M:%S', **kwargs): """Plot function for series w...
<commit_before>from __future__ import print_function, division import matplotlib.pyplot as plt import matplotlib.dates as mdates import numpy as np _to_ordinalf_np_vectorized = np.vectorize(mdates._to_ordinalf) def plot_series(series, ax=None, label=None, date_format='%d/%m/%y %H:%M:%S', **kwargs): """Plot functi...
6d2d9088797aace5698a0e44ac3ed725148dd60b
decorators.py
decorators.py
from functools import update_wrapper from flask import session, redirect, flash import auth def login_required(permission=None): ''' Login required decorator. Requires user to be logged in. If a permission is provided, then user must also have the appropriate permissions to access the page. ''' def decorat...
from functools import update_wrapper from flask import session, redirect, flash import auth def login_required(permission=None): ''' Login required decorator. Requires user to be logged in. If a permission is provided, then user must also have the appropriate permissions to access the page. ''' def decorat...
Fix typo in login_required decorator
Fix typo in login_required decorator
Python
mit
RuddockHouse/RuddockWebsite,RuddockHouse/RuddockWebsite,RuddockHouse/RuddockWebsite
from functools import update_wrapper from flask import session, redirect, flash import auth def login_required(permission=None): ''' Login required decorator. Requires user to be logged in. If a permission is provided, then user must also have the appropriate permissions to access the page. ''' def decorat...
from functools import update_wrapper from flask import session, redirect, flash import auth def login_required(permission=None): ''' Login required decorator. Requires user to be logged in. If a permission is provided, then user must also have the appropriate permissions to access the page. ''' def decorat...
<commit_before>from functools import update_wrapper from flask import session, redirect, flash import auth def login_required(permission=None): ''' Login required decorator. Requires user to be logged in. If a permission is provided, then user must also have the appropriate permissions to access the page. ''...
from functools import update_wrapper from flask import session, redirect, flash import auth def login_required(permission=None): ''' Login required decorator. Requires user to be logged in. If a permission is provided, then user must also have the appropriate permissions to access the page. ''' def decorat...
from functools import update_wrapper from flask import session, redirect, flash import auth def login_required(permission=None): ''' Login required decorator. Requires user to be logged in. If a permission is provided, then user must also have the appropriate permissions to access the page. ''' def decorat...
<commit_before>from functools import update_wrapper from flask import session, redirect, flash import auth def login_required(permission=None): ''' Login required decorator. Requires user to be logged in. If a permission is provided, then user must also have the appropriate permissions to access the page. ''...
21ce1aeb0359ef760a7936ed4123041e29b4f0b1
scripts/maf_limit_to_species.py
scripts/maf_limit_to_species.py
#!/usr/bin/env python2.3 """ Read a maf file from stdin and write out a new maf with only blocks having all of the required in species, after dropping any other species and removing columns containing only gaps. usage: %prog species,species2,... < maf """ import psyco_full import bx.align.maf import copy import sys...
#!/usr/bin/env python2.3 """ Read a maf file from stdin and write out a new maf with only blocks having all of the required in species, after dropping any other species and removing columns containing only gaps. usage: %prog species,species2,... < maf """ import psyco_full import bx.align.maf import copy import sys...
Remove all-gap columns after removing rows of the alignment
Remove all-gap columns after removing rows of the alignment
Python
mit
bxlab/bx-python,bxlab/bx-python,bxlab/bx-python
#!/usr/bin/env python2.3 """ Read a maf file from stdin and write out a new maf with only blocks having all of the required in species, after dropping any other species and removing columns containing only gaps. usage: %prog species,species2,... < maf """ import psyco_full import bx.align.maf import copy import sys...
#!/usr/bin/env python2.3 """ Read a maf file from stdin and write out a new maf with only blocks having all of the required in species, after dropping any other species and removing columns containing only gaps. usage: %prog species,species2,... < maf """ import psyco_full import bx.align.maf import copy import sys...
<commit_before>#!/usr/bin/env python2.3 """ Read a maf file from stdin and write out a new maf with only blocks having all of the required in species, after dropping any other species and removing columns containing only gaps. usage: %prog species,species2,... < maf """ import psyco_full import bx.align.maf import ...
#!/usr/bin/env python2.3 """ Read a maf file from stdin and write out a new maf with only blocks having all of the required in species, after dropping any other species and removing columns containing only gaps. usage: %prog species,species2,... < maf """ import psyco_full import bx.align.maf import copy import sys...
#!/usr/bin/env python2.3 """ Read a maf file from stdin and write out a new maf with only blocks having all of the required in species, after dropping any other species and removing columns containing only gaps. usage: %prog species,species2,... < maf """ import psyco_full import bx.align.maf import copy import sys...
<commit_before>#!/usr/bin/env python2.3 """ Read a maf file from stdin and write out a new maf with only blocks having all of the required in species, after dropping any other species and removing columns containing only gaps. usage: %prog species,species2,... < maf """ import psyco_full import bx.align.maf import ...
9d44c515dbb253e214ac0cd1145bddacc2586380
example/urls.py
example/urls.py
from django.conf.urls.defaults import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^admin/doc/', include('django.contrib.admindocs.urls')), url(r'^admin/', include(admin.site.urls)), url(r'^comments/', include('fluent_comments.urls')), u...
from django.conf.urls.defaults import patterns, include, url from django.contrib import admin from django.views.generic import RedirectView admin.autodiscover() urlpatterns = patterns('', url(r'^admin/doc/', include('django.contrib.admindocs.urls')), url(r'^admin/', include(admin.site.urls)), url(r'^comme...
Fix running the example project with Django 1.5
Fix running the example project with Django 1.5
Python
apache-2.0
django-fluent/django-fluent-comments,akszydelko/django-fluent-comments,akszydelko/django-fluent-comments,Afnarel/django-fluent-comments,Afnarel/django-fluent-comments,edoburu/django-fluent-comments,Afnarel/django-fluent-comments,PetrDlouhy/django-fluent-comments,django-fluent/django-fluent-comments,edoburu/django-fluen...
from django.conf.urls.defaults import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^admin/doc/', include('django.contrib.admindocs.urls')), url(r'^admin/', include(admin.site.urls)), url(r'^comments/', include('fluent_comments.urls')), u...
from django.conf.urls.defaults import patterns, include, url from django.contrib import admin from django.views.generic import RedirectView admin.autodiscover() urlpatterns = patterns('', url(r'^admin/doc/', include('django.contrib.admindocs.urls')), url(r'^admin/', include(admin.site.urls)), url(r'^comme...
<commit_before>from django.conf.urls.defaults import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^admin/doc/', include('django.contrib.admindocs.urls')), url(r'^admin/', include(admin.site.urls)), url(r'^comments/', include('fluent_comments...
from django.conf.urls.defaults import patterns, include, url from django.contrib import admin from django.views.generic import RedirectView admin.autodiscover() urlpatterns = patterns('', url(r'^admin/doc/', include('django.contrib.admindocs.urls')), url(r'^admin/', include(admin.site.urls)), url(r'^comme...
from django.conf.urls.defaults import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^admin/doc/', include('django.contrib.admindocs.urls')), url(r'^admin/', include(admin.site.urls)), url(r'^comments/', include('fluent_comments.urls')), u...
<commit_before>from django.conf.urls.defaults import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^admin/doc/', include('django.contrib.admindocs.urls')), url(r'^admin/', include(admin.site.urls)), url(r'^comments/', include('fluent_comments...
c92a56dc937dc414139e2bff958190cfb18de5d9
tests/basics/try2.py
tests/basics/try2.py
# nested try's try: print("try 1") try: print("try 2") foo() except: print("except 2") bar() except: print("except 1") try: print("try 1") try: print("try 2") foo() except TypeError: print("except 2") bar() except NameError: print...
# nested try's try: print("try 1") try: print("try 2") foo() except: print("except 2") bar() except: print("except 1") try: print("try 1") try: print("try 2") foo() except TypeError: print("except 2") bar() except NameError: print...
Add testcase with exception handler spread across functions.
Add testcase with exception handler spread across functions.
Python
mit
SHA2017-badge/micropython-esp32,skybird6672/micropython,vriera/micropython,SHA2017-badge/micropython-esp32,jimkmc/micropython,cnoviello/micropython,cloudformdesign/micropython,emfcamp/micropython,dhylands/micropython,xuxiaoxin/micropython,AriZuu/micropython,cloudformdesign/micropython,selste/micropython,ryannathans/mic...
# nested try's try: print("try 1") try: print("try 2") foo() except: print("except 2") bar() except: print("except 1") try: print("try 1") try: print("try 2") foo() except TypeError: print("except 2") bar() except NameError: print...
# nested try's try: print("try 1") try: print("try 2") foo() except: print("except 2") bar() except: print("except 1") try: print("try 1") try: print("try 2") foo() except TypeError: print("except 2") bar() except NameError: print...
<commit_before># nested try's try: print("try 1") try: print("try 2") foo() except: print("except 2") bar() except: print("except 1") try: print("try 1") try: print("try 2") foo() except TypeError: print("except 2") bar() except NameE...
# nested try's try: print("try 1") try: print("try 2") foo() except: print("except 2") bar() except: print("except 1") try: print("try 1") try: print("try 2") foo() except TypeError: print("except 2") bar() except NameError: print...
# nested try's try: print("try 1") try: print("try 2") foo() except: print("except 2") bar() except: print("except 1") try: print("try 1") try: print("try 2") foo() except TypeError: print("except 2") bar() except NameError: print...
<commit_before># nested try's try: print("try 1") try: print("try 2") foo() except: print("except 2") bar() except: print("except 1") try: print("try 1") try: print("try 2") foo() except TypeError: print("except 2") bar() except NameE...
33c7bd546236497aae9b0c96d6ae4c41f317a00e
saau/sections/transportation/data.py
saau/sections/transportation/data.py
from operator import itemgetter from itertools import chain from typing import List from ...utils.py3_hook import with_hook with with_hook(): from arcrest import Catalog import numpy as np def get_layers(service): layers = service.layers return { layer.name: layer for layer in layers ...
from operator import itemgetter from itertools import chain from typing import List import cgi from urllib.parse import parse_qs from ...utils.py3_hook import with_hook with with_hook(): from arcrest import Catalog import numpy as np cgi.parse_qs = parse_qs def get_layers(service): layers = service.layer...
Patch missing method on cgi package
Patch missing method on cgi package
Python
mit
Mause/statistical_atlas_of_au
from operator import itemgetter from itertools import chain from typing import List from ...utils.py3_hook import with_hook with with_hook(): from arcrest import Catalog import numpy as np def get_layers(service): layers = service.layers return { layer.name: layer for layer in layers ...
from operator import itemgetter from itertools import chain from typing import List import cgi from urllib.parse import parse_qs from ...utils.py3_hook import with_hook with with_hook(): from arcrest import Catalog import numpy as np cgi.parse_qs = parse_qs def get_layers(service): layers = service.layer...
<commit_before>from operator import itemgetter from itertools import chain from typing import List from ...utils.py3_hook import with_hook with with_hook(): from arcrest import Catalog import numpy as np def get_layers(service): layers = service.layers return { layer.name: layer for laye...
from operator import itemgetter from itertools import chain from typing import List import cgi from urllib.parse import parse_qs from ...utils.py3_hook import with_hook with with_hook(): from arcrest import Catalog import numpy as np cgi.parse_qs = parse_qs def get_layers(service): layers = service.layer...
from operator import itemgetter from itertools import chain from typing import List from ...utils.py3_hook import with_hook with with_hook(): from arcrest import Catalog import numpy as np def get_layers(service): layers = service.layers return { layer.name: layer for layer in layers ...
<commit_before>from operator import itemgetter from itertools import chain from typing import List from ...utils.py3_hook import with_hook with with_hook(): from arcrest import Catalog import numpy as np def get_layers(service): layers = service.layers return { layer.name: layer for laye...
a818427216f71272ae8410f63927db4891dbe39e
netmiko/hp/hp_procurve_ssh.py
netmiko/hp/hp_procurve_ssh.py
from __future__ import print_function from __future__ import unicode_literals import re import time from netmiko.cisco_base_connection import CiscoSSHConnection class HPProcurveSSH(CiscoSSHConnection): def session_preparation(self): """ Prepare the session after the connection has been establishe...
from __future__ import print_function from __future__ import unicode_literals import re import time from netmiko.cisco_base_connection import CiscoSSHConnection class HPProcurveSSH(CiscoSSHConnection): def session_preparation(self): """ Prepare the session after the connection has been establishe...
Fix issue with HP ProCurve stacks and multiple hit enter to continue messages
Fix issue with HP ProCurve stacks and multiple hit enter to continue messages
Python
mit
fooelisa/netmiko,ktbyers/netmiko,shamanu4/netmiko,ktbyers/netmiko,isidroamv/netmiko,fooelisa/netmiko,shamanu4/netmiko,isidroamv/netmiko
from __future__ import print_function from __future__ import unicode_literals import re import time from netmiko.cisco_base_connection import CiscoSSHConnection class HPProcurveSSH(CiscoSSHConnection): def session_preparation(self): """ Prepare the session after the connection has been establishe...
from __future__ import print_function from __future__ import unicode_literals import re import time from netmiko.cisco_base_connection import CiscoSSHConnection class HPProcurveSSH(CiscoSSHConnection): def session_preparation(self): """ Prepare the session after the connection has been establishe...
<commit_before>from __future__ import print_function from __future__ import unicode_literals import re import time from netmiko.cisco_base_connection import CiscoSSHConnection class HPProcurveSSH(CiscoSSHConnection): def session_preparation(self): """ Prepare the session after the connection has ...
from __future__ import print_function from __future__ import unicode_literals import re import time from netmiko.cisco_base_connection import CiscoSSHConnection class HPProcurveSSH(CiscoSSHConnection): def session_preparation(self): """ Prepare the session after the connection has been establishe...
from __future__ import print_function from __future__ import unicode_literals import re import time from netmiko.cisco_base_connection import CiscoSSHConnection class HPProcurveSSH(CiscoSSHConnection): def session_preparation(self): """ Prepare the session after the connection has been establishe...
<commit_before>from __future__ import print_function from __future__ import unicode_literals import re import time from netmiko.cisco_base_connection import CiscoSSHConnection class HPProcurveSSH(CiscoSSHConnection): def session_preparation(self): """ Prepare the session after the connection has ...
b301d8b9860f93a2c1fecd552f8edda4c813c04a
controller.py
controller.py
import requests payload = {'session':{'email':'[email protected]','password':'Ovation1'}} r = requests.post('http://localhost:3000/login', json=payload) print r.status_code
import requests payload = {'session':{'email':'[email protected]','password':'Ovation1'}} session = requests.Session() r = session.post('http://localhost:3000/login', json=payload) print r.status_code payload = {'plant':{'name':'Test Name','species':'Test species','days_per_watering':'9','start_date':'9/9/19...
Add persistance of session across requests
Add persistance of session across requests
Python
mit
darmbrus/plant-watering-tracker,darmbrus/plant-watering-tracker,darmbrus/plant-watering-tracker,darmbrus/plant-watering-tracker,darmbrus/plant-watering-tracker
import requests payload = {'session':{'email':'[email protected]','password':'Ovation1'}} r = requests.post('http://localhost:3000/login', json=payload) print r.status_code Add persistance of session across requests
import requests payload = {'session':{'email':'[email protected]','password':'Ovation1'}} session = requests.Session() r = session.post('http://localhost:3000/login', json=payload) print r.status_code payload = {'plant':{'name':'Test Name','species':'Test species','days_per_watering':'9','start_date':'9/9/19...
<commit_before>import requests payload = {'session':{'email':'[email protected]','password':'Ovation1'}} r = requests.post('http://localhost:3000/login', json=payload) print r.status_code <commit_msg>Add persistance of session across requests<commit_after>
import requests payload = {'session':{'email':'[email protected]','password':'Ovation1'}} session = requests.Session() r = session.post('http://localhost:3000/login', json=payload) print r.status_code payload = {'plant':{'name':'Test Name','species':'Test species','days_per_watering':'9','start_date':'9/9/19...
import requests payload = {'session':{'email':'[email protected]','password':'Ovation1'}} r = requests.post('http://localhost:3000/login', json=payload) print r.status_code Add persistance of session across requestsimport requests payload = {'session':{'email':'[email protected]','password':'Ovation1'...
<commit_before>import requests payload = {'session':{'email':'[email protected]','password':'Ovation1'}} r = requests.post('http://localhost:3000/login', json=payload) print r.status_code <commit_msg>Add persistance of session across requests<commit_after>import requests payload = {'session':{'email':'david....
701a18199fd230f70793b2e2c23b84506b50014e
reports/urls.py
reports/urls.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf.urls import url from . import views urlpatterns = [ url(r'^reports/changes/lifetimes/(?P<slug>[^/.]+)/$', views.DiaperChangeLifetimesChildReport.as_view(), name='report-diaperchange-lifetimes-child'), url(r'^repo...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf.urls import url from . import views urlpatterns = [ url(r'^children/(?P<slug>[^/.]+)/reports/changes/lifetimes/$', views.DiaperChangeLifetimesChildReport.as_view(), name='report-diaperchange-lifetimes-child'), ur...
Change reports URLs to extend from /children/<slug>.
Change reports URLs to extend from /children/<slug>.
Python
bsd-2-clause
cdubz/babybuddy,cdubz/babybuddy,cdubz/babybuddy
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf.urls import url from . import views urlpatterns = [ url(r'^reports/changes/lifetimes/(?P<slug>[^/.]+)/$', views.DiaperChangeLifetimesChildReport.as_view(), name='report-diaperchange-lifetimes-child'), url(r'^repo...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf.urls import url from . import views urlpatterns = [ url(r'^children/(?P<slug>[^/.]+)/reports/changes/lifetimes/$', views.DiaperChangeLifetimesChildReport.as_view(), name='report-diaperchange-lifetimes-child'), ur...
<commit_before># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf.urls import url from . import views urlpatterns = [ url(r'^reports/changes/lifetimes/(?P<slug>[^/.]+)/$', views.DiaperChangeLifetimesChildReport.as_view(), name='report-diaperchange-lifetimes-child'), ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf.urls import url from . import views urlpatterns = [ url(r'^children/(?P<slug>[^/.]+)/reports/changes/lifetimes/$', views.DiaperChangeLifetimesChildReport.as_view(), name='report-diaperchange-lifetimes-child'), ur...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf.urls import url from . import views urlpatterns = [ url(r'^reports/changes/lifetimes/(?P<slug>[^/.]+)/$', views.DiaperChangeLifetimesChildReport.as_view(), name='report-diaperchange-lifetimes-child'), url(r'^repo...
<commit_before># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf.urls import url from . import views urlpatterns = [ url(r'^reports/changes/lifetimes/(?P<slug>[^/.]+)/$', views.DiaperChangeLifetimesChildReport.as_view(), name='report-diaperchange-lifetimes-child'), ...
96a313eef46c31af3308805f10ffa63e330cc817
02/test_move.py
02/test_move.py
from move import load_moves, encode_moves, normalize_index, move import unittest class TestMove(unittest.TestCase): def setUp(self): self.moves = ['ULL', 'RRDDD', 'LURDL', 'UUUUD'] def test_load_moves(self): assert load_moves('example.txt') == self.moves def test_encode_moves(self): ...
from move import load_moves, encode_moves, normalize_index, move import unittest class TestMove(unittest.TestCase): def setUp(self): self.moves = ['ULL', 'RRDDD', 'LURDL', 'UUUUD'] def test_load_moves(self): assert load_moves('example.txt') == self.moves def test_encode_moves(self): ...
Remove test of two-argument normalize function.
Remove test of two-argument normalize function.
Python
mit
machinelearningdeveloper/aoc_2016
from move import load_moves, encode_moves, normalize_index, move import unittest class TestMove(unittest.TestCase): def setUp(self): self.moves = ['ULL', 'RRDDD', 'LURDL', 'UUUUD'] def test_load_moves(self): assert load_moves('example.txt') == self.moves def test_encode_moves(self): ...
from move import load_moves, encode_moves, normalize_index, move import unittest class TestMove(unittest.TestCase): def setUp(self): self.moves = ['ULL', 'RRDDD', 'LURDL', 'UUUUD'] def test_load_moves(self): assert load_moves('example.txt') == self.moves def test_encode_moves(self): ...
<commit_before>from move import load_moves, encode_moves, normalize_index, move import unittest class TestMove(unittest.TestCase): def setUp(self): self.moves = ['ULL', 'RRDDD', 'LURDL', 'UUUUD'] def test_load_moves(self): assert load_moves('example.txt') == self.moves def test_encode...
from move import load_moves, encode_moves, normalize_index, move import unittest class TestMove(unittest.TestCase): def setUp(self): self.moves = ['ULL', 'RRDDD', 'LURDL', 'UUUUD'] def test_load_moves(self): assert load_moves('example.txt') == self.moves def test_encode_moves(self): ...
from move import load_moves, encode_moves, normalize_index, move import unittest class TestMove(unittest.TestCase): def setUp(self): self.moves = ['ULL', 'RRDDD', 'LURDL', 'UUUUD'] def test_load_moves(self): assert load_moves('example.txt') == self.moves def test_encode_moves(self): ...
<commit_before>from move import load_moves, encode_moves, normalize_index, move import unittest class TestMove(unittest.TestCase): def setUp(self): self.moves = ['ULL', 'RRDDD', 'LURDL', 'UUUUD'] def test_load_moves(self): assert load_moves('example.txt') == self.moves def test_encode...
496d7fd6e9b2b581bc470b57984473b29d084e74
contentpages/tests.py
contentpages/tests.py
from django.test import TestCase # Create your tests here.
from django.test import TestCase from django.urls import reverse from contentpages.views import ContentPage class TestContentPage(TestCase): def test_get_template(self): # test that the template view uses the template requested # using pliny as a view that will always be present route =...
Add coverage for content pages functionality
Add coverage for content pages functionality
Python
mit
bwhicks/PlinyProject,bwhicks/PlinyProject,bwhicks/PlinyProject,bwhicks/PlinyProject
from django.test import TestCase # Create your tests here. Add coverage for content pages functionality
from django.test import TestCase from django.urls import reverse from contentpages.views import ContentPage class TestContentPage(TestCase): def test_get_template(self): # test that the template view uses the template requested # using pliny as a view that will always be present route =...
<commit_before>from django.test import TestCase # Create your tests here. <commit_msg>Add coverage for content pages functionality<commit_after>
from django.test import TestCase from django.urls import reverse from contentpages.views import ContentPage class TestContentPage(TestCase): def test_get_template(self): # test that the template view uses the template requested # using pliny as a view that will always be present route =...
from django.test import TestCase # Create your tests here. Add coverage for content pages functionalityfrom django.test import TestCase from django.urls import reverse from contentpages.views import ContentPage class TestContentPage(TestCase): def test_get_template(self): # test that the template view...
<commit_before>from django.test import TestCase # Create your tests here. <commit_msg>Add coverage for content pages functionality<commit_after>from django.test import TestCase from django.urls import reverse from contentpages.views import ContentPage class TestContentPage(TestCase): def test_get_template(self...
641d548b536c1574454d0d140263c56b7a0abae9
pyfr/mpiutil.py
pyfr/mpiutil.py
# -*- coding: utf-8 -*- import os from mpi4py import MPI from excepthook import excepthook def init(): MPI.Init_thread() MPI.COMM_WORLD.barrier() def atexit(): if not MPI.Is_initialized() or MPI.Is_finalized(): return exc = excepthook.exception if MPI.COMM_WORLD.size > 1 and exc is n...
# -*- coding: utf-8 -*- import os from mpi4py import MPI from excepthook import excepthook def init(): MPI.Init_thread() MPI.COMM_WORLD.barrier() def atexit(): if not MPI.Is_initialized() or MPI.Is_finalized(): return exc = excepthook.exception if MPI.COMM_WORLD.size > 1 and exc is n...
Improve how we abort MPI runs.
Improve how we abort MPI runs.
Python
bsd-3-clause
tjcorona/PyFR,Aerojspark/PyFR,tjcorona/PyFR,tjcorona/PyFR,BrianVermeire/PyFR,iyer-arvind/PyFR
# -*- coding: utf-8 -*- import os from mpi4py import MPI from excepthook import excepthook def init(): MPI.Init_thread() MPI.COMM_WORLD.barrier() def atexit(): if not MPI.Is_initialized() or MPI.Is_finalized(): return exc = excepthook.exception if MPI.COMM_WORLD.size > 1 and exc is n...
# -*- coding: utf-8 -*- import os from mpi4py import MPI from excepthook import excepthook def init(): MPI.Init_thread() MPI.COMM_WORLD.barrier() def atexit(): if not MPI.Is_initialized() or MPI.Is_finalized(): return exc = excepthook.exception if MPI.COMM_WORLD.size > 1 and exc is n...
<commit_before># -*- coding: utf-8 -*- import os from mpi4py import MPI from excepthook import excepthook def init(): MPI.Init_thread() MPI.COMM_WORLD.barrier() def atexit(): if not MPI.Is_initialized() or MPI.Is_finalized(): return exc = excepthook.exception if MPI.COMM_WORLD.size >...
# -*- coding: utf-8 -*- import os from mpi4py import MPI from excepthook import excepthook def init(): MPI.Init_thread() MPI.COMM_WORLD.barrier() def atexit(): if not MPI.Is_initialized() or MPI.Is_finalized(): return exc = excepthook.exception if MPI.COMM_WORLD.size > 1 and exc is n...
# -*- coding: utf-8 -*- import os from mpi4py import MPI from excepthook import excepthook def init(): MPI.Init_thread() MPI.COMM_WORLD.barrier() def atexit(): if not MPI.Is_initialized() or MPI.Is_finalized(): return exc = excepthook.exception if MPI.COMM_WORLD.size > 1 and exc is n...
<commit_before># -*- coding: utf-8 -*- import os from mpi4py import MPI from excepthook import excepthook def init(): MPI.Init_thread() MPI.COMM_WORLD.barrier() def atexit(): if not MPI.Is_initialized() or MPI.Is_finalized(): return exc = excepthook.exception if MPI.COMM_WORLD.size >...
09fed8f6bfb32f0f4c3aba45d16a153eaefe79e4
fetch.py
fetch.py
import fetchparser def print_parsed(): for line in fetchparser.parse_input(open("sample.fetch").read()): print line def print_lexed(): import fetchlexer l=fetchlexer.get_lexer() # Give the lexer some input l.input(open("sample.fetch").read()) # Tokenize while True: tok = ...
import fetchparser def print_parsed(): for line in fetchparser.parse_input(open("sample.fetch").read()): print line def print_lexed(): import fetchlexer l=fetchlexer.get_lexer() # Give the lexer some input l.input(open("sample.fetch").read()) # Tokenize while True: tok = ...
Kill dad code for old compiler
Kill dad code for old compiler
Python
mit
buffis/fetch
import fetchparser def print_parsed(): for line in fetchparser.parse_input(open("sample.fetch").read()): print line def print_lexed(): import fetchlexer l=fetchlexer.get_lexer() # Give the lexer some input l.input(open("sample.fetch").read()) # Tokenize while True: tok = ...
import fetchparser def print_parsed(): for line in fetchparser.parse_input(open("sample.fetch").read()): print line def print_lexed(): import fetchlexer l=fetchlexer.get_lexer() # Give the lexer some input l.input(open("sample.fetch").read()) # Tokenize while True: tok = ...
<commit_before>import fetchparser def print_parsed(): for line in fetchparser.parse_input(open("sample.fetch").read()): print line def print_lexed(): import fetchlexer l=fetchlexer.get_lexer() # Give the lexer some input l.input(open("sample.fetch").read()) # Tokenize while True:...
import fetchparser def print_parsed(): for line in fetchparser.parse_input(open("sample.fetch").read()): print line def print_lexed(): import fetchlexer l=fetchlexer.get_lexer() # Give the lexer some input l.input(open("sample.fetch").read()) # Tokenize while True: tok = ...
import fetchparser def print_parsed(): for line in fetchparser.parse_input(open("sample.fetch").read()): print line def print_lexed(): import fetchlexer l=fetchlexer.get_lexer() # Give the lexer some input l.input(open("sample.fetch").read()) # Tokenize while True: tok = ...
<commit_before>import fetchparser def print_parsed(): for line in fetchparser.parse_input(open("sample.fetch").read()): print line def print_lexed(): import fetchlexer l=fetchlexer.get_lexer() # Give the lexer some input l.input(open("sample.fetch").read()) # Tokenize while True:...
a5fdffe2f37e2e1c34044c259ef56c0e5feca0cb
allegedb/allegedb/tests/test_branch_plan.py
allegedb/allegedb/tests/test_branch_plan.py
import pytest import allegedb @pytest.fixture(scope='function') def orm(): with allegedb.ORM("sqlite:///:memory:") as it: yield it def test_single_plan(orm): g = orm.new_graph('graph') g.add_node(0) orm.turn = 1 g.add_node(1) with orm.plan(): orm.turn = 2 g.add_node(2...
import pytest import allegedb @pytest.fixture(scope='function') def orm(): with allegedb.ORM("sqlite:///:memory:") as it: yield it def test_single_plan(orm): g = orm.new_graph('graph') g.add_node(0) orm.turn = 1 g.add_node(1) with orm.plan(): orm.turn = 2 g.add_node(2...
Add an extra check in that test
Add an extra check in that test
Python
agpl-3.0
LogicalDash/LiSE,LogicalDash/LiSE
import pytest import allegedb @pytest.fixture(scope='function') def orm(): with allegedb.ORM("sqlite:///:memory:") as it: yield it def test_single_plan(orm): g = orm.new_graph('graph') g.add_node(0) orm.turn = 1 g.add_node(1) with orm.plan(): orm.turn = 2 g.add_node(2...
import pytest import allegedb @pytest.fixture(scope='function') def orm(): with allegedb.ORM("sqlite:///:memory:") as it: yield it def test_single_plan(orm): g = orm.new_graph('graph') g.add_node(0) orm.turn = 1 g.add_node(1) with orm.plan(): orm.turn = 2 g.add_node(2...
<commit_before>import pytest import allegedb @pytest.fixture(scope='function') def orm(): with allegedb.ORM("sqlite:///:memory:") as it: yield it def test_single_plan(orm): g = orm.new_graph('graph') g.add_node(0) orm.turn = 1 g.add_node(1) with orm.plan(): orm.turn = 2 ...
import pytest import allegedb @pytest.fixture(scope='function') def orm(): with allegedb.ORM("sqlite:///:memory:") as it: yield it def test_single_plan(orm): g = orm.new_graph('graph') g.add_node(0) orm.turn = 1 g.add_node(1) with orm.plan(): orm.turn = 2 g.add_node(2...
import pytest import allegedb @pytest.fixture(scope='function') def orm(): with allegedb.ORM("sqlite:///:memory:") as it: yield it def test_single_plan(orm): g = orm.new_graph('graph') g.add_node(0) orm.turn = 1 g.add_node(1) with orm.plan(): orm.turn = 2 g.add_node(2...
<commit_before>import pytest import allegedb @pytest.fixture(scope='function') def orm(): with allegedb.ORM("sqlite:///:memory:") as it: yield it def test_single_plan(orm): g = orm.new_graph('graph') g.add_node(0) orm.turn = 1 g.add_node(1) with orm.plan(): orm.turn = 2 ...
46ebeba28f8fbb9d43457aa3fa539b29048a581b
netbox/users/api/views.py
netbox/users/api/views.py
from django.contrib.auth.models import Group, User from django.db.models import Count from users import filters from users.models import ObjectPermission from utilities.api import ModelViewSet from utilities.querysets import RestrictedQuerySet from . import serializers # # Users and groups # class UserViewSet(Model...
from django.contrib.auth.models import Group, User from django.db.models import Count from users import filters from users.models import ObjectPermission from utilities.api import ModelViewSet from utilities.querysets import RestrictedQuerySet from . import serializers # # Users and groups # class UserViewSet(Model...
Set default ordering for user and group API endpoints
Set default ordering for user and group API endpoints
Python
apache-2.0
digitalocean/netbox,digitalocean/netbox,digitalocean/netbox,digitalocean/netbox
from django.contrib.auth.models import Group, User from django.db.models import Count from users import filters from users.models import ObjectPermission from utilities.api import ModelViewSet from utilities.querysets import RestrictedQuerySet from . import serializers # # Users and groups # class UserViewSet(Model...
from django.contrib.auth.models import Group, User from django.db.models import Count from users import filters from users.models import ObjectPermission from utilities.api import ModelViewSet from utilities.querysets import RestrictedQuerySet from . import serializers # # Users and groups # class UserViewSet(Model...
<commit_before>from django.contrib.auth.models import Group, User from django.db.models import Count from users import filters from users.models import ObjectPermission from utilities.api import ModelViewSet from utilities.querysets import RestrictedQuerySet from . import serializers # # Users and groups # class Us...
from django.contrib.auth.models import Group, User from django.db.models import Count from users import filters from users.models import ObjectPermission from utilities.api import ModelViewSet from utilities.querysets import RestrictedQuerySet from . import serializers # # Users and groups # class UserViewSet(Model...
from django.contrib.auth.models import Group, User from django.db.models import Count from users import filters from users.models import ObjectPermission from utilities.api import ModelViewSet from utilities.querysets import RestrictedQuerySet from . import serializers # # Users and groups # class UserViewSet(Model...
<commit_before>from django.contrib.auth.models import Group, User from django.db.models import Count from users import filters from users.models import ObjectPermission from utilities.api import ModelViewSet from utilities.querysets import RestrictedQuerySet from . import serializers # # Users and groups # class Us...
b9fbc9ba6ab2c379e26d6e599fcaaf6ab9b84473
server/slack.py
server/slack.py
#!/usr/bin/python2.7 import json import kartlogic.rank import logging import prettytable import util.web import util.slack def handler(event, context): logging.warning(event['body']) logging.warning(json.dumps(util.slack.parse_input(event['body']))) return util.web.respond_success("Successful") def rank...
#!/usr/bin/python2.7 import kartlogic.rank import prettytable import util.web as webutil import util.slack as slackutil def handler(event, context): input_data = slackutil.slack.parse_input(event['body']) if slackutil.validate_slack_token(input_data) is False: return webutil.respond_unauthorized("Inv...
Add Slack token validation to handler
Add Slack token validation to handler
Python
mit
groppe/mario
#!/usr/bin/python2.7 import json import kartlogic.rank import logging import prettytable import util.web import util.slack def handler(event, context): logging.warning(event['body']) logging.warning(json.dumps(util.slack.parse_input(event['body']))) return util.web.respond_success("Successful") def rank...
#!/usr/bin/python2.7 import kartlogic.rank import prettytable import util.web as webutil import util.slack as slackutil def handler(event, context): input_data = slackutil.slack.parse_input(event['body']) if slackutil.validate_slack_token(input_data) is False: return webutil.respond_unauthorized("Inv...
<commit_before>#!/usr/bin/python2.7 import json import kartlogic.rank import logging import prettytable import util.web import util.slack def handler(event, context): logging.warning(event['body']) logging.warning(json.dumps(util.slack.parse_input(event['body']))) return util.web.respond_success("Successf...
#!/usr/bin/python2.7 import kartlogic.rank import prettytable import util.web as webutil import util.slack as slackutil def handler(event, context): input_data = slackutil.slack.parse_input(event['body']) if slackutil.validate_slack_token(input_data) is False: return webutil.respond_unauthorized("Inv...
#!/usr/bin/python2.7 import json import kartlogic.rank import logging import prettytable import util.web import util.slack def handler(event, context): logging.warning(event['body']) logging.warning(json.dumps(util.slack.parse_input(event['body']))) return util.web.respond_success("Successful") def rank...
<commit_before>#!/usr/bin/python2.7 import json import kartlogic.rank import logging import prettytable import util.web import util.slack def handler(event, context): logging.warning(event['body']) logging.warning(json.dumps(util.slack.parse_input(event['body']))) return util.web.respond_success("Successf...
d7e9244dcbfcb068305ab37ba2e08f0c19ffdd7d
nodeconductor/core/log.py
nodeconductor/core/log.py
from __future__ import absolute_import, unicode_literals import logging class EventLoggerAdapter(logging.LoggerAdapter): """ LoggerAdapter """ def __init__(self, logger): super(EventLoggerAdapter, self).__init__(logger, {}) def process(self, msg, kwargs): kwargs['extra'] = {'eve...
from __future__ import absolute_import, unicode_literals import logging class EventLoggerAdapter(logging.LoggerAdapter, object): """ LoggerAdapter """ def __init__(self, logger): super(EventLoggerAdapter, self).__init__(logger, {}) def process(self, msg, kwargs): kwargs['extra']...
Fix EventLoggerAdapter to work on py2.6
Fix EventLoggerAdapter to work on py2.6
Python
mit
opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor
from __future__ import absolute_import, unicode_literals import logging class EventLoggerAdapter(logging.LoggerAdapter): """ LoggerAdapter """ def __init__(self, logger): super(EventLoggerAdapter, self).__init__(logger, {}) def process(self, msg, kwargs): kwargs['extra'] = {'eve...
from __future__ import absolute_import, unicode_literals import logging class EventLoggerAdapter(logging.LoggerAdapter, object): """ LoggerAdapter """ def __init__(self, logger): super(EventLoggerAdapter, self).__init__(logger, {}) def process(self, msg, kwargs): kwargs['extra']...
<commit_before>from __future__ import absolute_import, unicode_literals import logging class EventLoggerAdapter(logging.LoggerAdapter): """ LoggerAdapter """ def __init__(self, logger): super(EventLoggerAdapter, self).__init__(logger, {}) def process(self, msg, kwargs): kwargs['...
from __future__ import absolute_import, unicode_literals import logging class EventLoggerAdapter(logging.LoggerAdapter, object): """ LoggerAdapter """ def __init__(self, logger): super(EventLoggerAdapter, self).__init__(logger, {}) def process(self, msg, kwargs): kwargs['extra']...
from __future__ import absolute_import, unicode_literals import logging class EventLoggerAdapter(logging.LoggerAdapter): """ LoggerAdapter """ def __init__(self, logger): super(EventLoggerAdapter, self).__init__(logger, {}) def process(self, msg, kwargs): kwargs['extra'] = {'eve...
<commit_before>from __future__ import absolute_import, unicode_literals import logging class EventLoggerAdapter(logging.LoggerAdapter): """ LoggerAdapter """ def __init__(self, logger): super(EventLoggerAdapter, self).__init__(logger, {}) def process(self, msg, kwargs): kwargs['...
506b193781462b0771e01df383d1197f64d576d4
tests/basics/ModuleAttributes.py
tests/basics/ModuleAttributes.py
# Copyright 2012, Kay Hayen, mailto:[email protected] # # Python tests originally created or extracted from other peoples work. The # parts were too small to be protected. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Lice...
# Copyright 2012, Kay Hayen, mailto:[email protected] # # Python tests originally created or extracted from other peoples work. The # parts were too small to be protected. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Lice...
Cover the "__debug__" attribute as well.
Cover the "__debug__" attribute as well.
Python
apache-2.0
wfxiang08/Nuitka,tempbottle/Nuitka,tempbottle/Nuitka,wfxiang08/Nuitka,tempbottle/Nuitka,kayhayen/Nuitka,wfxiang08/Nuitka,kayhayen/Nuitka,kayhayen/Nuitka,kayhayen/Nuitka,tempbottle/Nuitka,wfxiang08/Nuitka
# Copyright 2012, Kay Hayen, mailto:[email protected] # # Python tests originally created or extracted from other peoples work. The # parts were too small to be protected. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Lice...
# Copyright 2012, Kay Hayen, mailto:[email protected] # # Python tests originally created or extracted from other peoples work. The # parts were too small to be protected. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Lice...
<commit_before># Copyright 2012, Kay Hayen, mailto:[email protected] # # Python tests originally created or extracted from other peoples work. The # parts were too small to be protected. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in complianc...
# Copyright 2012, Kay Hayen, mailto:[email protected] # # Python tests originally created or extracted from other peoples work. The # parts were too small to be protected. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Lice...
# Copyright 2012, Kay Hayen, mailto:[email protected] # # Python tests originally created or extracted from other peoples work. The # parts were too small to be protected. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Lice...
<commit_before># Copyright 2012, Kay Hayen, mailto:[email protected] # # Python tests originally created or extracted from other peoples work. The # parts were too small to be protected. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in complianc...
f347341d138bb4f610dcca9c9791001d54e734be
diceclient.py
diceclient.py
#!/usr/bin/env python import sys from twisted.internet import reactor, defer from twisted.internet.protocol import ClientCreator from twisted.protocols import amp from twisted.python import usage from diceserver import RollDice, default_port class Options(usage.Options): optParameters = [ ["hos...
#!/usr/bin/env python import sys from twisted.internet import reactor, defer from twisted.internet.protocol import ClientCreator from twisted.protocols import amp from twisted.python import usage from diceserver import RollDice, default_port class Options(usage.Options): optParameters = [ ["hos...
Add a command line option for number of sides.
Add a command line option for number of sides.
Python
mit
dripton/ampchat
#!/usr/bin/env python import sys from twisted.internet import reactor, defer from twisted.internet.protocol import ClientCreator from twisted.protocols import amp from twisted.python import usage from diceserver import RollDice, default_port class Options(usage.Options): optParameters = [ ["hos...
#!/usr/bin/env python import sys from twisted.internet import reactor, defer from twisted.internet.protocol import ClientCreator from twisted.protocols import amp from twisted.python import usage from diceserver import RollDice, default_port class Options(usage.Options): optParameters = [ ["hos...
<commit_before>#!/usr/bin/env python import sys from twisted.internet import reactor, defer from twisted.internet.protocol import ClientCreator from twisted.protocols import amp from twisted.python import usage from diceserver import RollDice, default_port class Options(usage.Options): optParameters = [ ...
#!/usr/bin/env python import sys from twisted.internet import reactor, defer from twisted.internet.protocol import ClientCreator from twisted.protocols import amp from twisted.python import usage from diceserver import RollDice, default_port class Options(usage.Options): optParameters = [ ["hos...
#!/usr/bin/env python import sys from twisted.internet import reactor, defer from twisted.internet.protocol import ClientCreator from twisted.protocols import amp from twisted.python import usage from diceserver import RollDice, default_port class Options(usage.Options): optParameters = [ ["hos...
<commit_before>#!/usr/bin/env python import sys from twisted.internet import reactor, defer from twisted.internet.protocol import ClientCreator from twisted.protocols import amp from twisted.python import usage from diceserver import RollDice, default_port class Options(usage.Options): optParameters = [ ...
b71a96f818c66b5578fb7c4475b67ecdcb16937a
recipes/recipe_modules/gclient/tests/sync_failure.py
recipes/recipe_modules/gclient/tests/sync_failure.py
# Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from recipe_engine import post_process DEPS = ['gclient'] def RunSteps(api): src_cfg = api.gclient.make_config(CACHE_DIR='[ROOT]/git_cache') api.gclien...
# Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from recipe_engine import post_process DEPS = ['gclient'] def RunSteps(api): src_cfg = api.gclient.make_config(CACHE_DIR='[ROOT]/git_cache') api.gclien...
Replace customzied test failure assertion with ResultReasonRE from engine
Replace customzied test failure assertion with ResultReasonRE from engine This change is to facilitate the annotation protocol -> luciexe protocol migration in the future. The failure response structure will be changed after the migration. Therefore, we only need to change the implementation detail of ResultReasonRE a...
Python
bsd-3-clause
CoherentLabs/depot_tools,CoherentLabs/depot_tools
# Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from recipe_engine import post_process DEPS = ['gclient'] def RunSteps(api): src_cfg = api.gclient.make_config(CACHE_DIR='[ROOT]/git_cache') api.gclien...
# Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from recipe_engine import post_process DEPS = ['gclient'] def RunSteps(api): src_cfg = api.gclient.make_config(CACHE_DIR='[ROOT]/git_cache') api.gclien...
<commit_before># Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from recipe_engine import post_process DEPS = ['gclient'] def RunSteps(api): src_cfg = api.gclient.make_config(CACHE_DIR='[ROOT]/git_cache...
# Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from recipe_engine import post_process DEPS = ['gclient'] def RunSteps(api): src_cfg = api.gclient.make_config(CACHE_DIR='[ROOT]/git_cache') api.gclien...
# Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from recipe_engine import post_process DEPS = ['gclient'] def RunSteps(api): src_cfg = api.gclient.make_config(CACHE_DIR='[ROOT]/git_cache') api.gclien...
<commit_before># Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from recipe_engine import post_process DEPS = ['gclient'] def RunSteps(api): src_cfg = api.gclient.make_config(CACHE_DIR='[ROOT]/git_cache...
caab908d8f8948c3035c94018d7a1e31332edbad
udata/tests/frontend/__init__.py
udata/tests/frontend/__init__.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import json import re from udata.tests import TestCase, WebTestMixin, SearchTestMixin from udata import frontend, api class FrontTestCase(WebTestMixin, SearchTestMixin, TestCase): def create_app(self): app = super(FrontTestCase, self).crea...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import json import re from udata.tests import TestCase, WebTestMixin, SearchTestMixin from udata import frontend, api class FrontTestCase(WebTestMixin, SearchTestMixin, TestCase): def create_app(self): app = super(FrontTestCase, self).crea...
Add traces if there is no JSON-LD while it was expected
Add traces if there is no JSON-LD while it was expected
Python
agpl-3.0
opendatateam/udata,opendatateam/udata,etalab/udata,jphnoel/udata,jphnoel/udata,etalab/udata,davidbgk/udata,davidbgk/udata,jphnoel/udata,etalab/udata,davidbgk/udata,opendatateam/udata
# -*- coding: utf-8 -*- from __future__ import unicode_literals import json import re from udata.tests import TestCase, WebTestMixin, SearchTestMixin from udata import frontend, api class FrontTestCase(WebTestMixin, SearchTestMixin, TestCase): def create_app(self): app = super(FrontTestCase, self).crea...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import json import re from udata.tests import TestCase, WebTestMixin, SearchTestMixin from udata import frontend, api class FrontTestCase(WebTestMixin, SearchTestMixin, TestCase): def create_app(self): app = super(FrontTestCase, self).crea...
<commit_before># -*- coding: utf-8 -*- from __future__ import unicode_literals import json import re from udata.tests import TestCase, WebTestMixin, SearchTestMixin from udata import frontend, api class FrontTestCase(WebTestMixin, SearchTestMixin, TestCase): def create_app(self): app = super(FrontTestC...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import json import re from udata.tests import TestCase, WebTestMixin, SearchTestMixin from udata import frontend, api class FrontTestCase(WebTestMixin, SearchTestMixin, TestCase): def create_app(self): app = super(FrontTestCase, self).crea...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import json import re from udata.tests import TestCase, WebTestMixin, SearchTestMixin from udata import frontend, api class FrontTestCase(WebTestMixin, SearchTestMixin, TestCase): def create_app(self): app = super(FrontTestCase, self).crea...
<commit_before># -*- coding: utf-8 -*- from __future__ import unicode_literals import json import re from udata.tests import TestCase, WebTestMixin, SearchTestMixin from udata import frontend, api class FrontTestCase(WebTestMixin, SearchTestMixin, TestCase): def create_app(self): app = super(FrontTestC...
62cc65003a426c7144da5e24f4806eb89cfd8118
polling_stations/apps/data_collection/management/commands/import_south_cambridge.py
polling_stations/apps/data_collection/management/commands/import_south_cambridge.py
from data_collection.management.commands import BaseXpressDemocracyClubCsvImporter class Command(BaseXpressDemocracyClubCsvImporter): council_id = 'E07000012' addresses_name = 'May 2017/Democracy_Club__04May2017 (1).CSV' stations_name = 'May 2017/Democracy_Club__04May2017 (1).CSV' elections = [ ...
from data_collection.management.commands import BaseXpressDemocracyClubCsvImporter class Command(BaseXpressDemocracyClubCsvImporter): council_id = 'E07000012' addresses_name = 'May 2017/Democracy_Club__04May2017 (1).CSV' stations_name = 'May 2017/Democracy_Club__04May2017 (1).CSV' elections = [ ...
Comment out South Cambridgeshire election id
Comment out South Cambridgeshire election id Update provided but queries to chase :(
Python
bsd-3-clause
DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations,chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations
from data_collection.management.commands import BaseXpressDemocracyClubCsvImporter class Command(BaseXpressDemocracyClubCsvImporter): council_id = 'E07000012' addresses_name = 'May 2017/Democracy_Club__04May2017 (1).CSV' stations_name = 'May 2017/Democracy_Club__04May2017 (1).CSV' elections = [ ...
from data_collection.management.commands import BaseXpressDemocracyClubCsvImporter class Command(BaseXpressDemocracyClubCsvImporter): council_id = 'E07000012' addresses_name = 'May 2017/Democracy_Club__04May2017 (1).CSV' stations_name = 'May 2017/Democracy_Club__04May2017 (1).CSV' elections = [ ...
<commit_before>from data_collection.management.commands import BaseXpressDemocracyClubCsvImporter class Command(BaseXpressDemocracyClubCsvImporter): council_id = 'E07000012' addresses_name = 'May 2017/Democracy_Club__04May2017 (1).CSV' stations_name = 'May 2017/Democracy_Club__04May2017 (1).CSV' electi...
from data_collection.management.commands import BaseXpressDemocracyClubCsvImporter class Command(BaseXpressDemocracyClubCsvImporter): council_id = 'E07000012' addresses_name = 'May 2017/Democracy_Club__04May2017 (1).CSV' stations_name = 'May 2017/Democracy_Club__04May2017 (1).CSV' elections = [ ...
from data_collection.management.commands import BaseXpressDemocracyClubCsvImporter class Command(BaseXpressDemocracyClubCsvImporter): council_id = 'E07000012' addresses_name = 'May 2017/Democracy_Club__04May2017 (1).CSV' stations_name = 'May 2017/Democracy_Club__04May2017 (1).CSV' elections = [ ...
<commit_before>from data_collection.management.commands import BaseXpressDemocracyClubCsvImporter class Command(BaseXpressDemocracyClubCsvImporter): council_id = 'E07000012' addresses_name = 'May 2017/Democracy_Club__04May2017 (1).CSV' stations_name = 'May 2017/Democracy_Club__04May2017 (1).CSV' electi...
cf297fc336d069b9210cfebec9f2cd724faa62fa
src/acme/demo_bundle/command.py
src/acme/demo_bundle/command.py
# -*- coding: utf-8 -*- # This file is part of the pymfony package. # # (c) Alexandre Quercia <[email protected]> # # For the full copyright and license information, please view the LICENSE # file that was distributed with this source code. """ """ from __future__ import absolute_import; import time from pymfony.co...
# -*- coding: utf-8 -*- # This file is part of the pymfony package. # # (c) Alexandre Quercia <[email protected]> # # For the full copyright and license information, please view the LICENSE # file that was distributed with this source code. """ """ from __future__ import absolute_import; import time from pymfony.co...
Update with last version of pymfony
Update with last version of pymfony
Python
mit
pymfony/pymfony-standard
# -*- coding: utf-8 -*- # This file is part of the pymfony package. # # (c) Alexandre Quercia <[email protected]> # # For the full copyright and license information, please view the LICENSE # file that was distributed with this source code. """ """ from __future__ import absolute_import; import time from pymfony.co...
# -*- coding: utf-8 -*- # This file is part of the pymfony package. # # (c) Alexandre Quercia <[email protected]> # # For the full copyright and license information, please view the LICENSE # file that was distributed with this source code. """ """ from __future__ import absolute_import; import time from pymfony.co...
<commit_before># -*- coding: utf-8 -*- # This file is part of the pymfony package. # # (c) Alexandre Quercia <[email protected]> # # For the full copyright and license information, please view the LICENSE # file that was distributed with this source code. """ """ from __future__ import absolute_import; import time ...
# -*- coding: utf-8 -*- # This file is part of the pymfony package. # # (c) Alexandre Quercia <[email protected]> # # For the full copyright and license information, please view the LICENSE # file that was distributed with this source code. """ """ from __future__ import absolute_import; import time from pymfony.co...
# -*- coding: utf-8 -*- # This file is part of the pymfony package. # # (c) Alexandre Quercia <[email protected]> # # For the full copyright and license information, please view the LICENSE # file that was distributed with this source code. """ """ from __future__ import absolute_import; import time from pymfony.co...
<commit_before># -*- coding: utf-8 -*- # This file is part of the pymfony package. # # (c) Alexandre Quercia <[email protected]> # # For the full copyright and license information, please view the LICENSE # file that was distributed with this source code. """ """ from __future__ import absolute_import; import time ...
d7fdebdc4ce52e59c126a27ea06171994a6c846b
src/config/common/ssl_adapter.py
src/config/common/ssl_adapter.py
""" HTTPS Transport Adapter for python-requests, that allows configuration of SSL version""" # -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # @author: Sanju Abraham, Juniper Networks, OpenContrail from requests.adapters import HTTPAdapter try: # This is required for RDO, which installs both...
""" HTTPS Transport Adapter for python-requests, that allows configuration of SSL version""" # -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # @author: Sanju Abraham, Juniper Networks, OpenContrail from requests.adapters import HTTPAdapter try: # This is required for RDO, which installs both...
Add ssl_version to the list of attributes, required when vnc_api gets called via multiprocessing module. This will ensure ssl_version gets included when pickle calls __getstate__ and __setstate__.
Add ssl_version to the list of attributes, required when vnc_api gets called via multiprocessing module. This will ensure ssl_version gets included when pickle calls __getstate__ and __setstate__. Courtesy: https://github.com/sigmavirus24/requests-toolbelt/commit/decadbd3512444889feb30cf1ff2f1448a3ecfca Closes-Bug:#1...
Python
apache-2.0
codilime/contrail-controller,codilime/contrail-controller,codilime/contrail-controller,codilime/contrail-controller,codilime/contrail-controller,codilime/contrail-controller
""" HTTPS Transport Adapter for python-requests, that allows configuration of SSL version""" # -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # @author: Sanju Abraham, Juniper Networks, OpenContrail from requests.adapters import HTTPAdapter try: # This is required for RDO, which installs both...
""" HTTPS Transport Adapter for python-requests, that allows configuration of SSL version""" # -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # @author: Sanju Abraham, Juniper Networks, OpenContrail from requests.adapters import HTTPAdapter try: # This is required for RDO, which installs both...
<commit_before>""" HTTPS Transport Adapter for python-requests, that allows configuration of SSL version""" # -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # @author: Sanju Abraham, Juniper Networks, OpenContrail from requests.adapters import HTTPAdapter try: # This is required for RDO, whic...
""" HTTPS Transport Adapter for python-requests, that allows configuration of SSL version""" # -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # @author: Sanju Abraham, Juniper Networks, OpenContrail from requests.adapters import HTTPAdapter try: # This is required for RDO, which installs both...
""" HTTPS Transport Adapter for python-requests, that allows configuration of SSL version""" # -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # @author: Sanju Abraham, Juniper Networks, OpenContrail from requests.adapters import HTTPAdapter try: # This is required for RDO, which installs both...
<commit_before>""" HTTPS Transport Adapter for python-requests, that allows configuration of SSL version""" # -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # @author: Sanju Abraham, Juniper Networks, OpenContrail from requests.adapters import HTTPAdapter try: # This is required for RDO, whic...
01c17356bd9eed56979c55ccb55659508d08b218
src/waldur_openstack/openstack_tenant/migrations/0004_fill_tenant_id.py
src/waldur_openstack/openstack_tenant/migrations/0004_fill_tenant_id.py
from django.db import migrations def fill_tenant_id(apps, schema_editor): ServiceSettings = apps.get_model('structure', 'ServiceSettings') for service_settings in ServiceSettings.objects.filter(type='OpenStackTenant'): tenant = service_settings.scope if ( tenant and ten...
from django.core.exceptions import ObjectDoesNotExist from django.db import migrations def fill_tenant_id(apps, schema_editor): ServiceSettings = apps.get_model('structure', 'ServiceSettings') Tenant = apps.get_model('openstack', 'Tenant') for service_settings in ServiceSettings.objects.filter(type='OpenS...
Fix migration: don't use virtual field scope.
Fix migration: don't use virtual field scope.
Python
mit
opennode/nodeconductor-assembly-waldur,opennode/waldur-mastermind,opennode/nodeconductor-assembly-waldur,opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/nodeconductor-assembly-waldur,opennode/waldur-mastermind
from django.db import migrations def fill_tenant_id(apps, schema_editor): ServiceSettings = apps.get_model('structure', 'ServiceSettings') for service_settings in ServiceSettings.objects.filter(type='OpenStackTenant'): tenant = service_settings.scope if ( tenant and ten...
from django.core.exceptions import ObjectDoesNotExist from django.db import migrations def fill_tenant_id(apps, schema_editor): ServiceSettings = apps.get_model('structure', 'ServiceSettings') Tenant = apps.get_model('openstack', 'Tenant') for service_settings in ServiceSettings.objects.filter(type='OpenS...
<commit_before>from django.db import migrations def fill_tenant_id(apps, schema_editor): ServiceSettings = apps.get_model('structure', 'ServiceSettings') for service_settings in ServiceSettings.objects.filter(type='OpenStackTenant'): tenant = service_settings.scope if ( tenant ...
from django.core.exceptions import ObjectDoesNotExist from django.db import migrations def fill_tenant_id(apps, schema_editor): ServiceSettings = apps.get_model('structure', 'ServiceSettings') Tenant = apps.get_model('openstack', 'Tenant') for service_settings in ServiceSettings.objects.filter(type='OpenS...
from django.db import migrations def fill_tenant_id(apps, schema_editor): ServiceSettings = apps.get_model('structure', 'ServiceSettings') for service_settings in ServiceSettings.objects.filter(type='OpenStackTenant'): tenant = service_settings.scope if ( tenant and ten...
<commit_before>from django.db import migrations def fill_tenant_id(apps, schema_editor): ServiceSettings = apps.get_model('structure', 'ServiceSettings') for service_settings in ServiceSettings.objects.filter(type='OpenStackTenant'): tenant = service_settings.scope if ( tenant ...
8bbdadc61611512dbd1bfbff2495ff0dee101054
adhocracy4/categories/forms.py
adhocracy4/categories/forms.py
from django import forms from adhocracy4.categories import models as category_models class CategorizableFieldMixin: category_field_name = 'category' def __init__(self, *args, **kwargs): module = kwargs.pop('module') super().__init__(*args, **kwargs) queryset = category_models.Categor...
from adhocracy4.categories import models as category_models class CategorizableFieldMixin: category_field_name = 'category' def __init__(self, *args, **kwargs): module = kwargs.pop('module') super().__init__(*args, **kwargs) field = self.fields[self.category_field_name] field...
Modify generated category form field instead of reinitialize it
Modify generated category form field instead of reinitialize it The category fields had not been translated as the field had been reinitialized instead of modified. With this PR the auto generated field (with its localized verbose_name) will be kept and adapted to the filtered queryset. Furthermore the required param...
Python
agpl-3.0
liqd/adhocracy4,liqd/adhocracy4,liqd/adhocracy4,liqd/adhocracy4
from django import forms from adhocracy4.categories import models as category_models class CategorizableFieldMixin: category_field_name = 'category' def __init__(self, *args, **kwargs): module = kwargs.pop('module') super().__init__(*args, **kwargs) queryset = category_models.Categor...
from adhocracy4.categories import models as category_models class CategorizableFieldMixin: category_field_name = 'category' def __init__(self, *args, **kwargs): module = kwargs.pop('module') super().__init__(*args, **kwargs) field = self.fields[self.category_field_name] field...
<commit_before>from django import forms from adhocracy4.categories import models as category_models class CategorizableFieldMixin: category_field_name = 'category' def __init__(self, *args, **kwargs): module = kwargs.pop('module') super().__init__(*args, **kwargs) queryset = category...
from adhocracy4.categories import models as category_models class CategorizableFieldMixin: category_field_name = 'category' def __init__(self, *args, **kwargs): module = kwargs.pop('module') super().__init__(*args, **kwargs) field = self.fields[self.category_field_name] field...
from django import forms from adhocracy4.categories import models as category_models class CategorizableFieldMixin: category_field_name = 'category' def __init__(self, *args, **kwargs): module = kwargs.pop('module') super().__init__(*args, **kwargs) queryset = category_models.Categor...
<commit_before>from django import forms from adhocracy4.categories import models as category_models class CategorizableFieldMixin: category_field_name = 'category' def __init__(self, *args, **kwargs): module = kwargs.pop('module') super().__init__(*args, **kwargs) queryset = category...
957f3e82f13dc8a9bd09d40a25c1f65847e144b8
aiohttp_json_api/decorators.py
aiohttp_json_api/decorators.py
from functools import wraps from boltons.iterutils import first from .context import RequestContext from .errors import HTTPUnsupportedMediaType from .const import JSONAPI_CONTENT_TYPE def jsonapi_content(handler): @wraps(handler) async def wrapper(*args, **kwargs): context = kwargs.get('context') ...
from functools import wraps from aiohttp import web from boltons.iterutils import first from .context import RequestContext from .errors import HTTPUnsupportedMediaType from .const import JSONAPI, JSONAPI_CONTENT_TYPE def jsonapi_content(handler): @wraps(handler) async def wrapper(*args, **kwargs): ...
Fix bug with arguments handling in JSON API content decorator
Fix bug with arguments handling in JSON API content decorator
Python
mit
vovanbo/aiohttp_json_api
from functools import wraps from boltons.iterutils import first from .context import RequestContext from .errors import HTTPUnsupportedMediaType from .const import JSONAPI_CONTENT_TYPE def jsonapi_content(handler): @wraps(handler) async def wrapper(*args, **kwargs): context = kwargs.get('context') ...
from functools import wraps from aiohttp import web from boltons.iterutils import first from .context import RequestContext from .errors import HTTPUnsupportedMediaType from .const import JSONAPI, JSONAPI_CONTENT_TYPE def jsonapi_content(handler): @wraps(handler) async def wrapper(*args, **kwargs): ...
<commit_before>from functools import wraps from boltons.iterutils import first from .context import RequestContext from .errors import HTTPUnsupportedMediaType from .const import JSONAPI_CONTENT_TYPE def jsonapi_content(handler): @wraps(handler) async def wrapper(*args, **kwargs): context = kwargs.g...
from functools import wraps from aiohttp import web from boltons.iterutils import first from .context import RequestContext from .errors import HTTPUnsupportedMediaType from .const import JSONAPI, JSONAPI_CONTENT_TYPE def jsonapi_content(handler): @wraps(handler) async def wrapper(*args, **kwargs): ...
from functools import wraps from boltons.iterutils import first from .context import RequestContext from .errors import HTTPUnsupportedMediaType from .const import JSONAPI_CONTENT_TYPE def jsonapi_content(handler): @wraps(handler) async def wrapper(*args, **kwargs): context = kwargs.get('context') ...
<commit_before>from functools import wraps from boltons.iterutils import first from .context import RequestContext from .errors import HTTPUnsupportedMediaType from .const import JSONAPI_CONTENT_TYPE def jsonapi_content(handler): @wraps(handler) async def wrapper(*args, **kwargs): context = kwargs.g...
fb59f2e0bd01d75c90ea3cc0089c24fc5db86e8e
config/jupyter/jupyter_notebook_config.py
config/jupyter/jupyter_notebook_config.py
import sys sys.path.append('/root/.jupyter/extensions/') c.JupyterApp.ip = '*' c.JupyterApp.port = 80 c.JupyterApp.open_browser = False c.JupyterApp.allow_credentials = True c.JupyterApp.nbserver_extensions = ['jupyter_nbgallery.status', 'jupyter_nbgallery.post'] c.JupyterApp.reraise_server_extension_failures = True c...
import json import os import sys sys.path.append('/root/.jupyter/extensions/') c.JupyterApp.ip = '*' c.JupyterApp.port = 80 c.JupyterApp.open_browser = False c.JupyterApp.allow_credentials = True c.JupyterApp.nbserver_extensions = ['jupyter_nbgallery.status', 'jupyter_nbgallery.post'] c.JupyterApp.reraise_server_exten...
Set $NBGALLERY_URL to override gallery location
Set $NBGALLERY_URL to override gallery location
Python
mit
jupyter-gallery/jupyter-docker,jupyter-gallery/jupyter-docker,jupyter-gallery/jupyter-docker
import sys sys.path.append('/root/.jupyter/extensions/') c.JupyterApp.ip = '*' c.JupyterApp.port = 80 c.JupyterApp.open_browser = False c.JupyterApp.allow_credentials = True c.JupyterApp.nbserver_extensions = ['jupyter_nbgallery.status', 'jupyter_nbgallery.post'] c.JupyterApp.reraise_server_extension_failures = True c...
import json import os import sys sys.path.append('/root/.jupyter/extensions/') c.JupyterApp.ip = '*' c.JupyterApp.port = 80 c.JupyterApp.open_browser = False c.JupyterApp.allow_credentials = True c.JupyterApp.nbserver_extensions = ['jupyter_nbgallery.status', 'jupyter_nbgallery.post'] c.JupyterApp.reraise_server_exten...
<commit_before>import sys sys.path.append('/root/.jupyter/extensions/') c.JupyterApp.ip = '*' c.JupyterApp.port = 80 c.JupyterApp.open_browser = False c.JupyterApp.allow_credentials = True c.JupyterApp.nbserver_extensions = ['jupyter_nbgallery.status', 'jupyter_nbgallery.post'] c.JupyterApp.reraise_server_extension_fa...
import json import os import sys sys.path.append('/root/.jupyter/extensions/') c.JupyterApp.ip = '*' c.JupyterApp.port = 80 c.JupyterApp.open_browser = False c.JupyterApp.allow_credentials = True c.JupyterApp.nbserver_extensions = ['jupyter_nbgallery.status', 'jupyter_nbgallery.post'] c.JupyterApp.reraise_server_exten...
import sys sys.path.append('/root/.jupyter/extensions/') c.JupyterApp.ip = '*' c.JupyterApp.port = 80 c.JupyterApp.open_browser = False c.JupyterApp.allow_credentials = True c.JupyterApp.nbserver_extensions = ['jupyter_nbgallery.status', 'jupyter_nbgallery.post'] c.JupyterApp.reraise_server_extension_failures = True c...
<commit_before>import sys sys.path.append('/root/.jupyter/extensions/') c.JupyterApp.ip = '*' c.JupyterApp.port = 80 c.JupyterApp.open_browser = False c.JupyterApp.allow_credentials = True c.JupyterApp.nbserver_extensions = ['jupyter_nbgallery.status', 'jupyter_nbgallery.post'] c.JupyterApp.reraise_server_extension_fa...
08c54be9e2e34b5655b2ea6f7778a83b606acade
src/lexus/lexical_simplifier.py
src/lexus/lexical_simplifier.py
__author__ = 's7a' # All imports from extras import Sanitizer from replacer import Replacer # The Lexical simplification class class LexicalSimplifier: # Constructor for the Lexical Simplifier def __init__(self): # Unused pass # Simplify a given content @staticmethod def simplif...
__author__ = 's7a' # All imports from extras import Sanitizer from replacer import Replacer # The Lexical simplification class class LexicalSimplifier: # Constructor for the Lexical Simplifier def __init__(self): # Unused pass # Simplify a given content @staticmethod def simplif...
Reduce the runtime of webapp api
Reduce the runtime of webapp api
Python
mit
Somsubhra/Simplify,Somsubhra/Simplify,Somsubhra/Simplify
__author__ = 's7a' # All imports from extras import Sanitizer from replacer import Replacer # The Lexical simplification class class LexicalSimplifier: # Constructor for the Lexical Simplifier def __init__(self): # Unused pass # Simplify a given content @staticmethod def simplif...
__author__ = 's7a' # All imports from extras import Sanitizer from replacer import Replacer # The Lexical simplification class class LexicalSimplifier: # Constructor for the Lexical Simplifier def __init__(self): # Unused pass # Simplify a given content @staticmethod def simplif...
<commit_before>__author__ = 's7a' # All imports from extras import Sanitizer from replacer import Replacer # The Lexical simplification class class LexicalSimplifier: # Constructor for the Lexical Simplifier def __init__(self): # Unused pass # Simplify a given content @staticmethod ...
__author__ = 's7a' # All imports from extras import Sanitizer from replacer import Replacer # The Lexical simplification class class LexicalSimplifier: # Constructor for the Lexical Simplifier def __init__(self): # Unused pass # Simplify a given content @staticmethod def simplif...
__author__ = 's7a' # All imports from extras import Sanitizer from replacer import Replacer # The Lexical simplification class class LexicalSimplifier: # Constructor for the Lexical Simplifier def __init__(self): # Unused pass # Simplify a given content @staticmethod def simplif...
<commit_before>__author__ = 's7a' # All imports from extras import Sanitizer from replacer import Replacer # The Lexical simplification class class LexicalSimplifier: # Constructor for the Lexical Simplifier def __init__(self): # Unused pass # Simplify a given content @staticmethod ...
6d1612698c2e42ab60d521915f31ff08832e3745
waterbutler/providers/dropbox/settings.py
waterbutler/providers/dropbox/settings.py
try: from waterbutler import settings except ImportError: settings = {} config = settings.get('DROPBOX_PROVIDER_CONFIG', {}) BASE_URL = config.get('BASE_URL', 'https://api.dropbox.com/1/') BASE_CONTENT_URL = config.get('BASE_CONTENT_URL', 'https://api-content.dropbox.com/1/')
try: from waterbutler import settings except ImportError: settings = {} config = settings.get('DROPBOX_PROVIDER_CONFIG', {}) BASE_URL = config.get('BASE_URL', 'https://api.dropboxapi.com/1/') BASE_CONTENT_URL = config.get('BASE_CONTENT_URL', 'https://content.dropboxapi.com/1/')
Update drobox api urls h/t @felliott
Update drobox api urls h/t @felliott
Python
apache-2.0
RCOSDP/waterbutler,rdhyee/waterbutler,TomBaxter/waterbutler,felliott/waterbutler,CenterForOpenScience/waterbutler,Johnetordoff/waterbutler
try: from waterbutler import settings except ImportError: settings = {} config = settings.get('DROPBOX_PROVIDER_CONFIG', {}) BASE_URL = config.get('BASE_URL', 'https://api.dropbox.com/1/') BASE_CONTENT_URL = config.get('BASE_CONTENT_URL', 'https://api-content.dropbox.com/1/') Update drobox api urls h/t @fell...
try: from waterbutler import settings except ImportError: settings = {} config = settings.get('DROPBOX_PROVIDER_CONFIG', {}) BASE_URL = config.get('BASE_URL', 'https://api.dropboxapi.com/1/') BASE_CONTENT_URL = config.get('BASE_CONTENT_URL', 'https://content.dropboxapi.com/1/')
<commit_before>try: from waterbutler import settings except ImportError: settings = {} config = settings.get('DROPBOX_PROVIDER_CONFIG', {}) BASE_URL = config.get('BASE_URL', 'https://api.dropbox.com/1/') BASE_CONTENT_URL = config.get('BASE_CONTENT_URL', 'https://api-content.dropbox.com/1/') <commit_msg>Updat...
try: from waterbutler import settings except ImportError: settings = {} config = settings.get('DROPBOX_PROVIDER_CONFIG', {}) BASE_URL = config.get('BASE_URL', 'https://api.dropboxapi.com/1/') BASE_CONTENT_URL = config.get('BASE_CONTENT_URL', 'https://content.dropboxapi.com/1/')
try: from waterbutler import settings except ImportError: settings = {} config = settings.get('DROPBOX_PROVIDER_CONFIG', {}) BASE_URL = config.get('BASE_URL', 'https://api.dropbox.com/1/') BASE_CONTENT_URL = config.get('BASE_CONTENT_URL', 'https://api-content.dropbox.com/1/') Update drobox api urls h/t @fell...
<commit_before>try: from waterbutler import settings except ImportError: settings = {} config = settings.get('DROPBOX_PROVIDER_CONFIG', {}) BASE_URL = config.get('BASE_URL', 'https://api.dropbox.com/1/') BASE_CONTENT_URL = config.get('BASE_CONTENT_URL', 'https://api-content.dropbox.com/1/') <commit_msg>Updat...
9d78a7be6ea922844bc9c6a0795af8d7b7a247a3
bl/text.py
bl/text.py
import os, shutil, tempfile from bl.file import File from bl.string import String class Text(File): def __init__(self, fn=None, text=None, encoding='UTF-8', **args): File.__init__(self, fn=fn, encoding=encoding, **args) if text is not None: self.text = text elif fn ...
import os, shutil, tempfile from bl.file import File from bl.string import String class Text(File): def __init__(self, fn=None, text=None, encoding='UTF-8', **args): File.__init__(self, fn=fn, encoding=encoding, **args) if text is not None: self.text = text elif fn ...
Revert "allow to write Text with raw data"
Revert "allow to write Text with raw data" This reverts commit d05df9ea67bc626adc7a4940c9bad4881d672a38.
Python
mpl-2.0
BlackEarth/bl,BlackEarth/bl
import os, shutil, tempfile from bl.file import File from bl.string import String class Text(File): def __init__(self, fn=None, text=None, encoding='UTF-8', **args): File.__init__(self, fn=fn, encoding=encoding, **args) if text is not None: self.text = text elif fn ...
import os, shutil, tempfile from bl.file import File from bl.string import String class Text(File): def __init__(self, fn=None, text=None, encoding='UTF-8', **args): File.__init__(self, fn=fn, encoding=encoding, **args) if text is not None: self.text = text elif fn ...
<commit_before> import os, shutil, tempfile from bl.file import File from bl.string import String class Text(File): def __init__(self, fn=None, text=None, encoding='UTF-8', **args): File.__init__(self, fn=fn, encoding=encoding, **args) if text is not None: self.text = text ...
import os, shutil, tempfile from bl.file import File from bl.string import String class Text(File): def __init__(self, fn=None, text=None, encoding='UTF-8', **args): File.__init__(self, fn=fn, encoding=encoding, **args) if text is not None: self.text = text elif fn ...
import os, shutil, tempfile from bl.file import File from bl.string import String class Text(File): def __init__(self, fn=None, text=None, encoding='UTF-8', **args): File.__init__(self, fn=fn, encoding=encoding, **args) if text is not None: self.text = text elif fn ...
<commit_before> import os, shutil, tempfile from bl.file import File from bl.string import String class Text(File): def __init__(self, fn=None, text=None, encoding='UTF-8', **args): File.__init__(self, fn=fn, encoding=encoding, **args) if text is not None: self.text = text ...
c42092f643bf34c997f2b964e3d132ed95012755
scipy/testing/nulltester.py
scipy/testing/nulltester.py
''' Null tester (when nose not importable) Merely returns error reporting lack of nose package See pkgtester, nosetester modules ''' nose_url = 'http://somethingaboutorange.com/mrl/projects/nose' class NullTester(object): def __init__(self, *args, **kwargs): pass def test(self, labels=None, *args, ...
''' Null tester (when nose not importable) Merely returns error reporting lack of nose package See pkgtester, nosetester modules ''' nose_url = 'http://somethingaboutorange.com/mrl/projects/nose' class NullTester(object): def __init__(self, *args, **kwargs): pass def test(self, labels=None, *args, ...
Fix bench error on scipy import when nose is not installed
Fix bench error on scipy import when nose is not installed git-svn-id: 003f22d385e25de9cff933a5ea4efd77cb5e7b28@3851 d6536bca-fef9-0310-8506-e4c0a848fbcf
Python
bsd-3-clause
lesserwhirls/scipy-cwt,scipy/scipy-svn,jasonmccampbell/scipy-refactor,scipy/scipy-svn,jasonmccampbell/scipy-refactor,scipy/scipy-svn,jasonmccampbell/scipy-refactor,lesserwhirls/scipy-cwt,lesserwhirls/scipy-cwt,jasonmccampbell/scipy-refactor,scipy/scipy-svn,lesserwhirls/scipy-cwt
''' Null tester (when nose not importable) Merely returns error reporting lack of nose package See pkgtester, nosetester modules ''' nose_url = 'http://somethingaboutorange.com/mrl/projects/nose' class NullTester(object): def __init__(self, *args, **kwargs): pass def test(self, labels=None, *args, ...
''' Null tester (when nose not importable) Merely returns error reporting lack of nose package See pkgtester, nosetester modules ''' nose_url = 'http://somethingaboutorange.com/mrl/projects/nose' class NullTester(object): def __init__(self, *args, **kwargs): pass def test(self, labels=None, *args, ...
<commit_before>''' Null tester (when nose not importable) Merely returns error reporting lack of nose package See pkgtester, nosetester modules ''' nose_url = 'http://somethingaboutorange.com/mrl/projects/nose' class NullTester(object): def __init__(self, *args, **kwargs): pass def test(self, label...
''' Null tester (when nose not importable) Merely returns error reporting lack of nose package See pkgtester, nosetester modules ''' nose_url = 'http://somethingaboutorange.com/mrl/projects/nose' class NullTester(object): def __init__(self, *args, **kwargs): pass def test(self, labels=None, *args, ...
''' Null tester (when nose not importable) Merely returns error reporting lack of nose package See pkgtester, nosetester modules ''' nose_url = 'http://somethingaboutorange.com/mrl/projects/nose' class NullTester(object): def __init__(self, *args, **kwargs): pass def test(self, labels=None, *args, ...
<commit_before>''' Null tester (when nose not importable) Merely returns error reporting lack of nose package See pkgtester, nosetester modules ''' nose_url = 'http://somethingaboutorange.com/mrl/projects/nose' class NullTester(object): def __init__(self, *args, **kwargs): pass def test(self, label...
50e972491e7fbe62045a6bda4351428769103c81
annotateit/model/annotation.py
annotateit/model/annotation.py
from flask import g from annotator.annotation import Annotation as Annotation_ from annotator.authz import permissions_filter class Annotation(Annotation_): @classmethod def stats_for_user(cls, user): stats = {} q = {'query': {'match_all': {}}, 'filter': {'and': [permissions_fil...
from flask import g from annotator.annotation import Annotation as Annotation_ from annotator.authz import permissions_filter class Annotation(Annotation_): @classmethod def stats_for_user(cls, user): stats = {} q = {'query': {'match_all': {}}, 'filter': {'and': [permissions_fil...
Update for compatibility with pyes==0.19.1
Update for compatibility with pyes==0.19.1
Python
agpl-3.0
openannotation/annotateit,openannotation/annotateit
from flask import g from annotator.annotation import Annotation as Annotation_ from annotator.authz import permissions_filter class Annotation(Annotation_): @classmethod def stats_for_user(cls, user): stats = {} q = {'query': {'match_all': {}}, 'filter': {'and': [permissions_fil...
from flask import g from annotator.annotation import Annotation as Annotation_ from annotator.authz import permissions_filter class Annotation(Annotation_): @classmethod def stats_for_user(cls, user): stats = {} q = {'query': {'match_all': {}}, 'filter': {'and': [permissions_fil...
<commit_before>from flask import g from annotator.annotation import Annotation as Annotation_ from annotator.authz import permissions_filter class Annotation(Annotation_): @classmethod def stats_for_user(cls, user): stats = {} q = {'query': {'match_all': {}}, 'filter': {'and': [...
from flask import g from annotator.annotation import Annotation as Annotation_ from annotator.authz import permissions_filter class Annotation(Annotation_): @classmethod def stats_for_user(cls, user): stats = {} q = {'query': {'match_all': {}}, 'filter': {'and': [permissions_fil...
from flask import g from annotator.annotation import Annotation as Annotation_ from annotator.authz import permissions_filter class Annotation(Annotation_): @classmethod def stats_for_user(cls, user): stats = {} q = {'query': {'match_all': {}}, 'filter': {'and': [permissions_fil...
<commit_before>from flask import g from annotator.annotation import Annotation as Annotation_ from annotator.authz import permissions_filter class Annotation(Annotation_): @classmethod def stats_for_user(cls, user): stats = {} q = {'query': {'match_all': {}}, 'filter': {'and': [...
d7a227ae5f0f53b5c620864df08c7b883402e968
netmiko/brocade/brocade_nos_ssh.py
netmiko/brocade/brocade_nos_ssh.py
"""Support for Brocade NOS/VDX.""" from __future__ import unicode_literals import time from netmiko.cisco_base_connection import CiscoSSHConnection class BrocadeNosSSH(CiscoSSHConnection): """Support for Brocade NOS/VDX.""" def enable(self, *args, **kwargs): """No enable mode on Brocade VDX.""" ...
"""Support for Brocade NOS/VDX.""" from __future__ import unicode_literals import time from netmiko.cisco_base_connection import CiscoSSHConnection class BrocadeNosSSH(CiscoSSHConnection): """Support for Brocade NOS/VDX.""" def enable(self, *args, **kwargs): """No enable mode on Brocade VDX.""" ...
Add save_config for brocade VDX
Add save_config for brocade VDX
Python
mit
ktbyers/netmiko,ktbyers/netmiko
"""Support for Brocade NOS/VDX.""" from __future__ import unicode_literals import time from netmiko.cisco_base_connection import CiscoSSHConnection class BrocadeNosSSH(CiscoSSHConnection): """Support for Brocade NOS/VDX.""" def enable(self, *args, **kwargs): """No enable mode on Brocade VDX.""" ...
"""Support for Brocade NOS/VDX.""" from __future__ import unicode_literals import time from netmiko.cisco_base_connection import CiscoSSHConnection class BrocadeNosSSH(CiscoSSHConnection): """Support for Brocade NOS/VDX.""" def enable(self, *args, **kwargs): """No enable mode on Brocade VDX.""" ...
<commit_before>"""Support for Brocade NOS/VDX.""" from __future__ import unicode_literals import time from netmiko.cisco_base_connection import CiscoSSHConnection class BrocadeNosSSH(CiscoSSHConnection): """Support for Brocade NOS/VDX.""" def enable(self, *args, **kwargs): """No enable mode on Brocade...
"""Support for Brocade NOS/VDX.""" from __future__ import unicode_literals import time from netmiko.cisco_base_connection import CiscoSSHConnection class BrocadeNosSSH(CiscoSSHConnection): """Support for Brocade NOS/VDX.""" def enable(self, *args, **kwargs): """No enable mode on Brocade VDX.""" ...
"""Support for Brocade NOS/VDX.""" from __future__ import unicode_literals import time from netmiko.cisco_base_connection import CiscoSSHConnection class BrocadeNosSSH(CiscoSSHConnection): """Support for Brocade NOS/VDX.""" def enable(self, *args, **kwargs): """No enable mode on Brocade VDX.""" ...
<commit_before>"""Support for Brocade NOS/VDX.""" from __future__ import unicode_literals import time from netmiko.cisco_base_connection import CiscoSSHConnection class BrocadeNosSSH(CiscoSSHConnection): """Support for Brocade NOS/VDX.""" def enable(self, *args, **kwargs): """No enable mode on Brocade...
74888d07942c0ee9ab8accbe87732380a700f9d0
rule.py
rule.py
class PriceRule: """PriceRule is a rule that triggers when a stock price satisfies a condition. The condition is usually greater, equal or lesser than a given value. """ def __init__(self, symbol, condition): self.symbol = symbol self.condition = condition
Add PriceRule class and init method.
Add PriceRule class and init method.
Python
mit
bsmukasa/stock_alerter
Add PriceRule class and init method.
class PriceRule: """PriceRule is a rule that triggers when a stock price satisfies a condition. The condition is usually greater, equal or lesser than a given value. """ def __init__(self, symbol, condition): self.symbol = symbol self.condition = condition
<commit_before> <commit_msg>Add PriceRule class and init method.<commit_after>
class PriceRule: """PriceRule is a rule that triggers when a stock price satisfies a condition. The condition is usually greater, equal or lesser than a given value. """ def __init__(self, symbol, condition): self.symbol = symbol self.condition = condition
Add PriceRule class and init method.class PriceRule: """PriceRule is a rule that triggers when a stock price satisfies a condition. The condition is usually greater, equal or lesser than a given value. """ def __init__(self, symbol, condition): self.symbol = symbol self.condition = co...
<commit_before> <commit_msg>Add PriceRule class and init method.<commit_after>class PriceRule: """PriceRule is a rule that triggers when a stock price satisfies a condition. The condition is usually greater, equal or lesser than a given value. """ def __init__(self, symbol, condition): self.sy...
457a40d3487d59147bcea71dd06f49317167c8d1
hash_table.py
hash_table.py
#!/usr/bin/env python '''Implementation of a simple hash table. The table has `hash`, `get` and `set` methods. The hash function uses a very basic hash algorithm to insert the value into the table. ''' class HashItem(object): def __init__(self, key, value): self.key = key self.value = value cla...
#!/usr/bin/env python '''Implementation of a simple hash table. The table has `hash`, `get` and `set` methods. The hash function uses a very basic hash algorithm to insert the value into the table. ''' class HashItem(object): def __init__(self, key, value): self.key = key self.value = value cla...
Build out set function of hash table class; still need to deal with outcome of setting multiple values to same key
Build out set function of hash table class; still need to deal with outcome of setting multiple values to same key
Python
mit
jwarren116/data-structures-deux
#!/usr/bin/env python '''Implementation of a simple hash table. The table has `hash`, `get` and `set` methods. The hash function uses a very basic hash algorithm to insert the value into the table. ''' class HashItem(object): def __init__(self, key, value): self.key = key self.value = value cla...
#!/usr/bin/env python '''Implementation of a simple hash table. The table has `hash`, `get` and `set` methods. The hash function uses a very basic hash algorithm to insert the value into the table. ''' class HashItem(object): def __init__(self, key, value): self.key = key self.value = value cla...
<commit_before>#!/usr/bin/env python '''Implementation of a simple hash table. The table has `hash`, `get` and `set` methods. The hash function uses a very basic hash algorithm to insert the value into the table. ''' class HashItem(object): def __init__(self, key, value): self.key = key self.valu...
#!/usr/bin/env python '''Implementation of a simple hash table. The table has `hash`, `get` and `set` methods. The hash function uses a very basic hash algorithm to insert the value into the table. ''' class HashItem(object): def __init__(self, key, value): self.key = key self.value = value cla...
#!/usr/bin/env python '''Implementation of a simple hash table. The table has `hash`, `get` and `set` methods. The hash function uses a very basic hash algorithm to insert the value into the table. ''' class HashItem(object): def __init__(self, key, value): self.key = key self.value = value cla...
<commit_before>#!/usr/bin/env python '''Implementation of a simple hash table. The table has `hash`, `get` and `set` methods. The hash function uses a very basic hash algorithm to insert the value into the table. ''' class HashItem(object): def __init__(self, key, value): self.key = key self.valu...
84783cdcdd52108df359cbe2add8c41b92b97e0b
openfisca_web_api/scripts/serve.py
openfisca_web_api/scripts/serve.py
# -*- coding: utf-8 -*- import os import sys from logging.config import fileConfig from wsgiref.simple_server import make_server from paste.deploy import loadapp hostname = 'localhost' port = 2000 def main(): conf_file_path = os.path.join(sys.prefix, 'share', 'openfisca', 'openfisca-web-api', 'development-fr...
# -*- coding: utf-8 -*- import os import sys import argparse from logging.config import fileConfig from wsgiref.simple_server import make_server from paste.deploy import loadapp def main(): parser = argparse.ArgumentParser(description = __doc__) parser.add_argument('-p', '--port', action = 'store', default ...
Allow port to be changed
Allow port to be changed
Python
agpl-3.0
openfisca/openfisca-web-api,openfisca/openfisca-web-api
# -*- coding: utf-8 -*- import os import sys from logging.config import fileConfig from wsgiref.simple_server import make_server from paste.deploy import loadapp hostname = 'localhost' port = 2000 def main(): conf_file_path = os.path.join(sys.prefix, 'share', 'openfisca', 'openfisca-web-api', 'development-fr...
# -*- coding: utf-8 -*- import os import sys import argparse from logging.config import fileConfig from wsgiref.simple_server import make_server from paste.deploy import loadapp def main(): parser = argparse.ArgumentParser(description = __doc__) parser.add_argument('-p', '--port', action = 'store', default ...
<commit_before># -*- coding: utf-8 -*- import os import sys from logging.config import fileConfig from wsgiref.simple_server import make_server from paste.deploy import loadapp hostname = 'localhost' port = 2000 def main(): conf_file_path = os.path.join(sys.prefix, 'share', 'openfisca', 'openfisca-web-api', ...
# -*- coding: utf-8 -*- import os import sys import argparse from logging.config import fileConfig from wsgiref.simple_server import make_server from paste.deploy import loadapp def main(): parser = argparse.ArgumentParser(description = __doc__) parser.add_argument('-p', '--port', action = 'store', default ...
# -*- coding: utf-8 -*- import os import sys from logging.config import fileConfig from wsgiref.simple_server import make_server from paste.deploy import loadapp hostname = 'localhost' port = 2000 def main(): conf_file_path = os.path.join(sys.prefix, 'share', 'openfisca', 'openfisca-web-api', 'development-fr...
<commit_before># -*- coding: utf-8 -*- import os import sys from logging.config import fileConfig from wsgiref.simple_server import make_server from paste.deploy import loadapp hostname = 'localhost' port = 2000 def main(): conf_file_path = os.path.join(sys.prefix, 'share', 'openfisca', 'openfisca-web-api', ...
8dae2049c96932855cc0162437d799e258f94a53
test/absolute_import/local_module.py
test/absolute_import/local_module.py
""" This is a module that imports the *standard library* unittest, despite there being a local "unittest" module. It specifies that it wants the stdlib one with the ``absolute_import`` __future__ import. The twisted equivalent of this module is ``twisted.trial._synctest``. """ from __future__ import absolute_import i...
""" This is a module that imports the *standard library* unittest, despite there being a local "unittest" module. It specifies that it wants the stdlib one with the ``absolute_import`` __future__ import. The twisted equivalent of this module is ``twisted.trial._synctest``. """ from __future__ import absolute_import i...
Fix inaccuracy in test comment, since jedi now does the right thing
Fix inaccuracy in test comment, since jedi now does the right thing
Python
mit
dwillmer/jedi,flurischt/jedi,mfussenegger/jedi,tjwei/jedi,flurischt/jedi,jonashaag/jedi,jonashaag/jedi,mfussenegger/jedi,tjwei/jedi,WoLpH/jedi,WoLpH/jedi,dwillmer/jedi
""" This is a module that imports the *standard library* unittest, despite there being a local "unittest" module. It specifies that it wants the stdlib one with the ``absolute_import`` __future__ import. The twisted equivalent of this module is ``twisted.trial._synctest``. """ from __future__ import absolute_import i...
""" This is a module that imports the *standard library* unittest, despite there being a local "unittest" module. It specifies that it wants the stdlib one with the ``absolute_import`` __future__ import. The twisted equivalent of this module is ``twisted.trial._synctest``. """ from __future__ import absolute_import i...
<commit_before>""" This is a module that imports the *standard library* unittest, despite there being a local "unittest" module. It specifies that it wants the stdlib one with the ``absolute_import`` __future__ import. The twisted equivalent of this module is ``twisted.trial._synctest``. """ from __future__ import abs...
""" This is a module that imports the *standard library* unittest, despite there being a local "unittest" module. It specifies that it wants the stdlib one with the ``absolute_import`` __future__ import. The twisted equivalent of this module is ``twisted.trial._synctest``. """ from __future__ import absolute_import i...
""" This is a module that imports the *standard library* unittest, despite there being a local "unittest" module. It specifies that it wants the stdlib one with the ``absolute_import`` __future__ import. The twisted equivalent of this module is ``twisted.trial._synctest``. """ from __future__ import absolute_import i...
<commit_before>""" This is a module that imports the *standard library* unittest, despite there being a local "unittest" module. It specifies that it wants the stdlib one with the ``absolute_import`` __future__ import. The twisted equivalent of this module is ``twisted.trial._synctest``. """ from __future__ import abs...
e697e9887fa681918c9b10367ee2319969f591d0
test/auth/test_client_credentials.py
test/auth/test_client_credentials.py
from oauthlib.oauth2 import InvalidClientError import pytest from test import configure_mendeley, cassette def test_should_get_authenticated_session(): mendeley = configure_mendeley() auth = mendeley.start_client_credentials_flow() with cassette('fixtures/auth/client_credentials/get_authenticated_sessio...
from oauthlib.oauth2 import InvalidClientError import pytest from test import configure_mendeley, cassette def test_should_get_authenticated_session(): mendeley = configure_mendeley() auth = mendeley.start_client_credentials_flow() with cassette('fixtures/auth/client_credentials/get_authenticated_sessio...
Check for right kind of error in invalid creds test
Check for right kind of error in invalid creds test
Python
apache-2.0
Mendeley/mendeley-python-sdk
from oauthlib.oauth2 import InvalidClientError import pytest from test import configure_mendeley, cassette def test_should_get_authenticated_session(): mendeley = configure_mendeley() auth = mendeley.start_client_credentials_flow() with cassette('fixtures/auth/client_credentials/get_authenticated_sessio...
from oauthlib.oauth2 import InvalidClientError import pytest from test import configure_mendeley, cassette def test_should_get_authenticated_session(): mendeley = configure_mendeley() auth = mendeley.start_client_credentials_flow() with cassette('fixtures/auth/client_credentials/get_authenticated_sessio...
<commit_before>from oauthlib.oauth2 import InvalidClientError import pytest from test import configure_mendeley, cassette def test_should_get_authenticated_session(): mendeley = configure_mendeley() auth = mendeley.start_client_credentials_flow() with cassette('fixtures/auth/client_credentials/get_authe...
from oauthlib.oauth2 import InvalidClientError import pytest from test import configure_mendeley, cassette def test_should_get_authenticated_session(): mendeley = configure_mendeley() auth = mendeley.start_client_credentials_flow() with cassette('fixtures/auth/client_credentials/get_authenticated_sessio...
from oauthlib.oauth2 import InvalidClientError import pytest from test import configure_mendeley, cassette def test_should_get_authenticated_session(): mendeley = configure_mendeley() auth = mendeley.start_client_credentials_flow() with cassette('fixtures/auth/client_credentials/get_authenticated_sessio...
<commit_before>from oauthlib.oauth2 import InvalidClientError import pytest from test import configure_mendeley, cassette def test_should_get_authenticated_session(): mendeley = configure_mendeley() auth = mendeley.start_client_credentials_flow() with cassette('fixtures/auth/client_credentials/get_authe...
634e389ed260b404327e303afb4f5a1dc931ee36
storm/db.py
storm/db.py
from random import randrange import time from storm import error class Connection(object): def __init__(self, host='localhost', port=None, database=None, user=None, password=None): self.host = host self.port = port self.database = database self.user = user self.password = p...
import time from storm import error from tornado import gen class Connection(object): def __init__(self, host='localhost', port=None, database=None, user=None, password=None): self.host = host self.port = port self.database = database self.user = user self.password = passwo...
Make connection pool less smart
Make connection pool less smart You have to extend it and implement your own get_db function to use a connection pool now
Python
mit
liujiantong/storm,ccampbell/storm
from random import randrange import time from storm import error class Connection(object): def __init__(self, host='localhost', port=None, database=None, user=None, password=None): self.host = host self.port = port self.database = database self.user = user self.password = p...
import time from storm import error from tornado import gen class Connection(object): def __init__(self, host='localhost', port=None, database=None, user=None, password=None): self.host = host self.port = port self.database = database self.user = user self.password = passwo...
<commit_before>from random import randrange import time from storm import error class Connection(object): def __init__(self, host='localhost', port=None, database=None, user=None, password=None): self.host = host self.port = port self.database = database self.user = user se...
import time from storm import error from tornado import gen class Connection(object): def __init__(self, host='localhost', port=None, database=None, user=None, password=None): self.host = host self.port = port self.database = database self.user = user self.password = passwo...
from random import randrange import time from storm import error class Connection(object): def __init__(self, host='localhost', port=None, database=None, user=None, password=None): self.host = host self.port = port self.database = database self.user = user self.password = p...
<commit_before>from random import randrange import time from storm import error class Connection(object): def __init__(self, host='localhost', port=None, database=None, user=None, password=None): self.host = host self.port = port self.database = database self.user = user se...
2f65eba48e5bdeac85b12cac014cb648d068da46
tests/test_utils.py
tests/test_utils.py
import unittest from app import create_app, db from app.utils import get_or_create from app.models import User class TestUtils(unittest.TestCase): def setUp(self): self.app = create_app("testing") self.app_ctx = self.app.app_context() self.app_ctx.push() db.create_all() def t...
import unittest from app import create_app, db from app.utils import get_or_create, is_safe_url from app.models import User class TestUtils(unittest.TestCase): def setUp(self): self.app = create_app("testing") self.app_ctx = self.app.app_context() self.app_ctx.push() db.create_all...
Add unit test for is_safe_url utility function
Add unit test for is_safe_url utility function
Python
mit
Encrylize/MyDictionary,Encrylize/MyDictionary,Encrylize/MyDictionary
import unittest from app import create_app, db from app.utils import get_or_create from app.models import User class TestUtils(unittest.TestCase): def setUp(self): self.app = create_app("testing") self.app_ctx = self.app.app_context() self.app_ctx.push() db.create_all() def t...
import unittest from app import create_app, db from app.utils import get_or_create, is_safe_url from app.models import User class TestUtils(unittest.TestCase): def setUp(self): self.app = create_app("testing") self.app_ctx = self.app.app_context() self.app_ctx.push() db.create_all...
<commit_before>import unittest from app import create_app, db from app.utils import get_or_create from app.models import User class TestUtils(unittest.TestCase): def setUp(self): self.app = create_app("testing") self.app_ctx = self.app.app_context() self.app_ctx.push() db.create_a...
import unittest from app import create_app, db from app.utils import get_or_create, is_safe_url from app.models import User class TestUtils(unittest.TestCase): def setUp(self): self.app = create_app("testing") self.app_ctx = self.app.app_context() self.app_ctx.push() db.create_all...
import unittest from app import create_app, db from app.utils import get_or_create from app.models import User class TestUtils(unittest.TestCase): def setUp(self): self.app = create_app("testing") self.app_ctx = self.app.app_context() self.app_ctx.push() db.create_all() def t...
<commit_before>import unittest from app import create_app, db from app.utils import get_or_create from app.models import User class TestUtils(unittest.TestCase): def setUp(self): self.app = create_app("testing") self.app_ctx = self.app.app_context() self.app_ctx.push() db.create_a...
b33654567ad3588ba51874ef109a9ee8efc0b0f0
tests/functional/firefox/test_hello.py
tests/functional/firefox/test_hello.py
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import pytest from pages.firefox.hello import HelloPage @pytest.mark.smoke @pytest.mark.nondestructive def test_play_...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import pytest from pages.firefox.hello import HelloPage @pytest.mark.smoke @pytest.mark.nondestructive def test_play_...
Fix failing Firefox Hello test
Fix failing Firefox Hello test
Python
mpl-2.0
sgarrity/bedrock,TheJJ100100/bedrock,alexgibson/bedrock,schalkneethling/bedrock,TheJJ100100/bedrock,gerv/bedrock,mozilla/bedrock,flodolo/bedrock,kyoshino/bedrock,TheoChevalier/bedrock,mozilla/bedrock,sgarrity/bedrock,craigcook/bedrock,pascalchevrel/bedrock,alexgibson/bedrock,sylvestre/bedrock,Sancus/bedrock,ericawright...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import pytest from pages.firefox.hello import HelloPage @pytest.mark.smoke @pytest.mark.nondestructive def test_play_...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import pytest from pages.firefox.hello import HelloPage @pytest.mark.smoke @pytest.mark.nondestructive def test_play_...
<commit_before># This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import pytest from pages.firefox.hello import HelloPage @pytest.mark.smoke @pytest.mark.nondestructive...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import pytest from pages.firefox.hello import HelloPage @pytest.mark.smoke @pytest.mark.nondestructive def test_play_...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import pytest from pages.firefox.hello import HelloPage @pytest.mark.smoke @pytest.mark.nondestructive def test_play_...
<commit_before># This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import pytest from pages.firefox.hello import HelloPage @pytest.mark.smoke @pytest.mark.nondestructive...
df790275ba9f06296f800ecd913eca8393c300c6
psyparse/handler/base_handler.py
psyparse/handler/base_handler.py
class BaseHandler(object): """ An abstract hanlder class to help define how a handler should behave. No methods are actually implemented and will raise a not-implemented error if an instance of a handler subclass does not implement any of the following methods. """ def new(self, entry): ...
class BaseHandler(object): """ An abstract hanlder class to help define how a handler should behave. No methods are actually implemented and will raise a not-implemented error if an instance of a handler subclass does not implement any of the following methods. """ def new(self, entry): ...
Fix bug in exception throwing (it caused an exception!).
Fix bug in exception throwing (it caused an exception!).
Python
mit
tnez/PsyParse
class BaseHandler(object): """ An abstract hanlder class to help define how a handler should behave. No methods are actually implemented and will raise a not-implemented error if an instance of a handler subclass does not implement any of the following methods. """ def new(self, entry): ...
class BaseHandler(object): """ An abstract hanlder class to help define how a handler should behave. No methods are actually implemented and will raise a not-implemented error if an instance of a handler subclass does not implement any of the following methods. """ def new(self, entry): ...
<commit_before>class BaseHandler(object): """ An abstract hanlder class to help define how a handler should behave. No methods are actually implemented and will raise a not-implemented error if an instance of a handler subclass does not implement any of the following methods. """ def new(se...
class BaseHandler(object): """ An abstract hanlder class to help define how a handler should behave. No methods are actually implemented and will raise a not-implemented error if an instance of a handler subclass does not implement any of the following methods. """ def new(self, entry): ...
class BaseHandler(object): """ An abstract hanlder class to help define how a handler should behave. No methods are actually implemented and will raise a not-implemented error if an instance of a handler subclass does not implement any of the following methods. """ def new(self, entry): ...
<commit_before>class BaseHandler(object): """ An abstract hanlder class to help define how a handler should behave. No methods are actually implemented and will raise a not-implemented error if an instance of a handler subclass does not implement any of the following methods. """ def new(se...
567d7c57def91c95620e8e5b1acda640b9c48a9d
src/startGUI.py
src/startGUI.py
# -*- coding: utf-8 -*- import util.colored_exceptions from gui import main_window from core import volumes, control from PySide import QtGui import sys import os import core.calculation if __name__ == '__main__': app = QtGui.QApplication(sys.argv) control = control.Control() window = main_window.MainWind...
# -*- coding: utf-8 -*- import util.colored_exceptions from gui import main_window from core import volumes, control from PySide import QtGui from PySide import QtCore import signal import sys import os import core.calculation if __name__ == '__main__': app = QtGui.QApplication(sys.argv) control = control.Con...
Allow quitting the application with SIGINT (Ctrl-C)
Allow quitting the application with SIGINT (Ctrl-C)
Python
mit
sciapp/pyMolDyn,sciapp/pyMolDyn,sciapp/pyMolDyn,sciapp/pyMolDyn,sciapp/pyMolDyn
# -*- coding: utf-8 -*- import util.colored_exceptions from gui import main_window from core import volumes, control from PySide import QtGui import sys import os import core.calculation if __name__ == '__main__': app = QtGui.QApplication(sys.argv) control = control.Control() window = main_window.MainWind...
# -*- coding: utf-8 -*- import util.colored_exceptions from gui import main_window from core import volumes, control from PySide import QtGui from PySide import QtCore import signal import sys import os import core.calculation if __name__ == '__main__': app = QtGui.QApplication(sys.argv) control = control.Con...
<commit_before># -*- coding: utf-8 -*- import util.colored_exceptions from gui import main_window from core import volumes, control from PySide import QtGui import sys import os import core.calculation if __name__ == '__main__': app = QtGui.QApplication(sys.argv) control = control.Control() window = main_...
# -*- coding: utf-8 -*- import util.colored_exceptions from gui import main_window from core import volumes, control from PySide import QtGui from PySide import QtCore import signal import sys import os import core.calculation if __name__ == '__main__': app = QtGui.QApplication(sys.argv) control = control.Con...
# -*- coding: utf-8 -*- import util.colored_exceptions from gui import main_window from core import volumes, control from PySide import QtGui import sys import os import core.calculation if __name__ == '__main__': app = QtGui.QApplication(sys.argv) control = control.Control() window = main_window.MainWind...
<commit_before># -*- coding: utf-8 -*- import util.colored_exceptions from gui import main_window from core import volumes, control from PySide import QtGui import sys import os import core.calculation if __name__ == '__main__': app = QtGui.QApplication(sys.argv) control = control.Control() window = main_...
370c49eba30253f259454884441e9921b51719ab
dudebot/ai.py
dudebot/ai.py
class BotAI(object): def set_nickname(self, nickname): self.nickname = nickname def initialise(self, init_params_as_dict): pass def respond(self, sender_nickname, message): pass class Echo(BotAI): def respond(self, sender_nickname, message): return True, message
class BotAI(object): def set_nickname(self, nickname): self.nickname = nickname def initialise(self, init_params_as_dict): pass def respond(self, sender_nickname, message): return False, '' class message_must_begin_with_prefix(object): """A simple decorator so that a bot AI ...
Add some decorators to make life easier.
Add some decorators to make life easier.
Python
bsd-2-clause
sujaymansingh/dudebot
class BotAI(object): def set_nickname(self, nickname): self.nickname = nickname def initialise(self, init_params_as_dict): pass def respond(self, sender_nickname, message): pass class Echo(BotAI): def respond(self, sender_nickname, message): return True, message Add...
class BotAI(object): def set_nickname(self, nickname): self.nickname = nickname def initialise(self, init_params_as_dict): pass def respond(self, sender_nickname, message): return False, '' class message_must_begin_with_prefix(object): """A simple decorator so that a bot AI ...
<commit_before>class BotAI(object): def set_nickname(self, nickname): self.nickname = nickname def initialise(self, init_params_as_dict): pass def respond(self, sender_nickname, message): pass class Echo(BotAI): def respond(self, sender_nickname, message): return Tr...
class BotAI(object): def set_nickname(self, nickname): self.nickname = nickname def initialise(self, init_params_as_dict): pass def respond(self, sender_nickname, message): return False, '' class message_must_begin_with_prefix(object): """A simple decorator so that a bot AI ...
class BotAI(object): def set_nickname(self, nickname): self.nickname = nickname def initialise(self, init_params_as_dict): pass def respond(self, sender_nickname, message): pass class Echo(BotAI): def respond(self, sender_nickname, message): return True, message Add...
<commit_before>class BotAI(object): def set_nickname(self, nickname): self.nickname = nickname def initialise(self, init_params_as_dict): pass def respond(self, sender_nickname, message): pass class Echo(BotAI): def respond(self, sender_nickname, message): return Tr...
96a08a9c7b11ce96de1c2034efcc19622c4eb419
drillion/ship_keys.py
drillion/ship_keys.py
from pyglet.window import key PLAYER_SHIP_KEYS = dict(left=[key.A, key.LEFT], right=[key.D, key.RIGHT], thrust=[key.W, key.UP], fire=[key.S, key.DOWN]) PLAYER_1_SHIP_KEYS = dict(left=[key.A], right=[key.D], thrust=[key.W], fire=[key.S]) PLAYER_2_SHIP_KEYS = dict(left=[...
from pyglet.window import key PLAYER_SHIP_KEYS = dict(left=[key.A, key.J], right=[key.D, key.L], thrust=[key.W, key.I], fire=[key.S, key.K]) PLAYER_1_SHIP_KEYS = dict(left=[key.A], right=[key.D], thrust=[key.W], fire=[key.S]) PLAYER_2_SHIP_KEYS = dict(left=[key.J], rig...
Change second ship controls to IJKL
Change second ship controls to IJKL
Python
mit
elemel/drillion
from pyglet.window import key PLAYER_SHIP_KEYS = dict(left=[key.A, key.LEFT], right=[key.D, key.RIGHT], thrust=[key.W, key.UP], fire=[key.S, key.DOWN]) PLAYER_1_SHIP_KEYS = dict(left=[key.A], right=[key.D], thrust=[key.W], fire=[key.S]) PLAYER_2_SHIP_KEYS = dict(left=[...
from pyglet.window import key PLAYER_SHIP_KEYS = dict(left=[key.A, key.J], right=[key.D, key.L], thrust=[key.W, key.I], fire=[key.S, key.K]) PLAYER_1_SHIP_KEYS = dict(left=[key.A], right=[key.D], thrust=[key.W], fire=[key.S]) PLAYER_2_SHIP_KEYS = dict(left=[key.J], rig...
<commit_before>from pyglet.window import key PLAYER_SHIP_KEYS = dict(left=[key.A, key.LEFT], right=[key.D, key.RIGHT], thrust=[key.W, key.UP], fire=[key.S, key.DOWN]) PLAYER_1_SHIP_KEYS = dict(left=[key.A], right=[key.D], thrust=[key.W], fire=[key.S]) PLAYER_2_SHIP_KEY...
from pyglet.window import key PLAYER_SHIP_KEYS = dict(left=[key.A, key.J], right=[key.D, key.L], thrust=[key.W, key.I], fire=[key.S, key.K]) PLAYER_1_SHIP_KEYS = dict(left=[key.A], right=[key.D], thrust=[key.W], fire=[key.S]) PLAYER_2_SHIP_KEYS = dict(left=[key.J], rig...
from pyglet.window import key PLAYER_SHIP_KEYS = dict(left=[key.A, key.LEFT], right=[key.D, key.RIGHT], thrust=[key.W, key.UP], fire=[key.S, key.DOWN]) PLAYER_1_SHIP_KEYS = dict(left=[key.A], right=[key.D], thrust=[key.W], fire=[key.S]) PLAYER_2_SHIP_KEYS = dict(left=[...
<commit_before>from pyglet.window import key PLAYER_SHIP_KEYS = dict(left=[key.A, key.LEFT], right=[key.D, key.RIGHT], thrust=[key.W, key.UP], fire=[key.S, key.DOWN]) PLAYER_1_SHIP_KEYS = dict(left=[key.A], right=[key.D], thrust=[key.W], fire=[key.S]) PLAYER_2_SHIP_KEY...
074e711dd58e432c39906c1fe6f7e9944407b1e5
changes/api/snapshot_details.py
changes/api/snapshot_details.py
from __future__ import absolute_import from flask.ext.restful import reqparse from changes.api.base import APIView from changes.config import db from changes.db.utils import create_or_update from changes.models import ProjectOption, Snapshot, SnapshotStatus class SnapshotDetailsAPIView(APIView): parser = reqpar...
from __future__ import absolute_import from flask.ext.restful import reqparse from changes.api.base import APIView from changes.api.serializer.models.snapshot import SnapshotWithImagesSerializer from changes.config import db from changes.db.utils import create_or_update from changes.models import ProjectOption, Snaps...
Add images to snapshot details
Add images to snapshot details
Python
apache-2.0
dropbox/changes,bowlofstew/changes,bowlofstew/changes,dropbox/changes,wfxiang08/changes,wfxiang08/changes,bowlofstew/changes,wfxiang08/changes,dropbox/changes,wfxiang08/changes,dropbox/changes,bowlofstew/changes
from __future__ import absolute_import from flask.ext.restful import reqparse from changes.api.base import APIView from changes.config import db from changes.db.utils import create_or_update from changes.models import ProjectOption, Snapshot, SnapshotStatus class SnapshotDetailsAPIView(APIView): parser = reqpar...
from __future__ import absolute_import from flask.ext.restful import reqparse from changes.api.base import APIView from changes.api.serializer.models.snapshot import SnapshotWithImagesSerializer from changes.config import db from changes.db.utils import create_or_update from changes.models import ProjectOption, Snaps...
<commit_before>from __future__ import absolute_import from flask.ext.restful import reqparse from changes.api.base import APIView from changes.config import db from changes.db.utils import create_or_update from changes.models import ProjectOption, Snapshot, SnapshotStatus class SnapshotDetailsAPIView(APIView): ...
from __future__ import absolute_import from flask.ext.restful import reqparse from changes.api.base import APIView from changes.api.serializer.models.snapshot import SnapshotWithImagesSerializer from changes.config import db from changes.db.utils import create_or_update from changes.models import ProjectOption, Snaps...
from __future__ import absolute_import from flask.ext.restful import reqparse from changes.api.base import APIView from changes.config import db from changes.db.utils import create_or_update from changes.models import ProjectOption, Snapshot, SnapshotStatus class SnapshotDetailsAPIView(APIView): parser = reqpar...
<commit_before>from __future__ import absolute_import from flask.ext.restful import reqparse from changes.api.base import APIView from changes.config import db from changes.db.utils import create_or_update from changes.models import ProjectOption, Snapshot, SnapshotStatus class SnapshotDetailsAPIView(APIView): ...
2b9efb699d557cbd47d54b10bb6ff8be24596ab4
src/nodeconductor_assembly_waldur/packages/tests/unittests/test_models.py
src/nodeconductor_assembly_waldur/packages/tests/unittests/test_models.py
from decimal import Decimal import random from django.test import TestCase from .. import factories from ... import models class PackageTemplateTest(TestCase): def test_package_price_is_based_on_components(self): package_template = factories.PackageTemplateFactory(components=[]) total = Decimal...
from decimal import Decimal import random from django.test import TestCase from .. import factories from ... import models class PackageTemplateTest(TestCase): def test_package_price_is_based_on_components(self): package_template = factories.PackageTemplateFactory() total = Decimal('0.00') ...
Update test according to factory usage
Update test according to factory usage
Python
mit
opennode/waldur-mastermind,opennode/nodeconductor-assembly-waldur,opennode/waldur-mastermind,opennode/nodeconductor-assembly-waldur,opennode/waldur-mastermind,opennode/nodeconductor-assembly-waldur,opennode/waldur-mastermind
from decimal import Decimal import random from django.test import TestCase from .. import factories from ... import models class PackageTemplateTest(TestCase): def test_package_price_is_based_on_components(self): package_template = factories.PackageTemplateFactory(components=[]) total = Decimal...
from decimal import Decimal import random from django.test import TestCase from .. import factories from ... import models class PackageTemplateTest(TestCase): def test_package_price_is_based_on_components(self): package_template = factories.PackageTemplateFactory() total = Decimal('0.00') ...
<commit_before>from decimal import Decimal import random from django.test import TestCase from .. import factories from ... import models class PackageTemplateTest(TestCase): def test_package_price_is_based_on_components(self): package_template = factories.PackageTemplateFactory(components=[]) ...
from decimal import Decimal import random from django.test import TestCase from .. import factories from ... import models class PackageTemplateTest(TestCase): def test_package_price_is_based_on_components(self): package_template = factories.PackageTemplateFactory() total = Decimal('0.00') ...
from decimal import Decimal import random from django.test import TestCase from .. import factories from ... import models class PackageTemplateTest(TestCase): def test_package_price_is_based_on_components(self): package_template = factories.PackageTemplateFactory(components=[]) total = Decimal...
<commit_before>from decimal import Decimal import random from django.test import TestCase from .. import factories from ... import models class PackageTemplateTest(TestCase): def test_package_price_is_based_on_components(self): package_template = factories.PackageTemplateFactory(components=[]) ...
8c773a53902860409f83ff445402eb56d6376a88
app/utils/settings.py
app/utils/settings.py
from app.models import Setting class AppSettings(dict): def __init__(self): super().__init__() self.update({setting.name: setting.value for setting in Setting.query.all()}) self.__setitem__('posts_per_page', int(self.__getitem__('posts_per_page'))) def __setitem__(self, key, value): ...
from app.models import Setting class AppSettings(dict): def __init__(self): super().__init__() self.update({setting.name: setting.value for setting in Setting.query.all()}) try: self.__setitem__('posts_per_page', int(self.__getitem__('posts_per_page'))) except KeyError...
Add error handling for posts_per_page type conversion
Add error handling for posts_per_page type conversion
Python
mit
Encrylize/flask-blogger,Encrylize/flask-blogger,Encrylize/flask-blogger
from app.models import Setting class AppSettings(dict): def __init__(self): super().__init__() self.update({setting.name: setting.value for setting in Setting.query.all()}) self.__setitem__('posts_per_page', int(self.__getitem__('posts_per_page'))) def __setitem__(self, key, value): ...
from app.models import Setting class AppSettings(dict): def __init__(self): super().__init__() self.update({setting.name: setting.value for setting in Setting.query.all()}) try: self.__setitem__('posts_per_page', int(self.__getitem__('posts_per_page'))) except KeyError...
<commit_before>from app.models import Setting class AppSettings(dict): def __init__(self): super().__init__() self.update({setting.name: setting.value for setting in Setting.query.all()}) self.__setitem__('posts_per_page', int(self.__getitem__('posts_per_page'))) def __setitem__(self,...
from app.models import Setting class AppSettings(dict): def __init__(self): super().__init__() self.update({setting.name: setting.value for setting in Setting.query.all()}) try: self.__setitem__('posts_per_page', int(self.__getitem__('posts_per_page'))) except KeyError...
from app.models import Setting class AppSettings(dict): def __init__(self): super().__init__() self.update({setting.name: setting.value for setting in Setting.query.all()}) self.__setitem__('posts_per_page', int(self.__getitem__('posts_per_page'))) def __setitem__(self, key, value): ...
<commit_before>from app.models import Setting class AppSettings(dict): def __init__(self): super().__init__() self.update({setting.name: setting.value for setting in Setting.query.all()}) self.__setitem__('posts_per_page', int(self.__getitem__('posts_per_page'))) def __setitem__(self,...
7dd467f474675c2c2535b6c3b925340b72959089
tests/settings.py
tests/settings.py
import os CONNECT_ARGS = [] CONNECT_KWARGS = {} LIVE_TEST = 'HOST' in os.environ if LIVE_TEST: HOST = os.environ['HOST'] DATABASE = os.environ.get('DATABASE', 'test') USER = os.environ.get('SQLUSER', 'sa') PASSWORD = os.environ.get('SQLPASSWORD', 'sa') USE_MARS = bool(os.environ.get('USE_MARS', Tr...
import os CONNECT_ARGS = [] CONNECT_KWARGS = {} LIVE_TEST = 'HOST' in os.environ if LIVE_TEST: HOST = os.environ['HOST'] DATABASE = os.environ.get('DATABASE', 'test') USER = os.environ.get('SQLUSER', 'sa') PASSWORD = os.environ.get('SQLPASSWORD', 'sa') USE_MARS = bool(os.environ.get('USE_MARS', Tr...
Use connection pool by default during testing
Use connection pool by default during testing
Python
mit
m32/pytds,m32/pytds,denisenkom/pytds,tpow/pytds,denisenkom/pytds,tpow/pytds
import os CONNECT_ARGS = [] CONNECT_KWARGS = {} LIVE_TEST = 'HOST' in os.environ if LIVE_TEST: HOST = os.environ['HOST'] DATABASE = os.environ.get('DATABASE', 'test') USER = os.environ.get('SQLUSER', 'sa') PASSWORD = os.environ.get('SQLPASSWORD', 'sa') USE_MARS = bool(os.environ.get('USE_MARS', Tr...
import os CONNECT_ARGS = [] CONNECT_KWARGS = {} LIVE_TEST = 'HOST' in os.environ if LIVE_TEST: HOST = os.environ['HOST'] DATABASE = os.environ.get('DATABASE', 'test') USER = os.environ.get('SQLUSER', 'sa') PASSWORD = os.environ.get('SQLPASSWORD', 'sa') USE_MARS = bool(os.environ.get('USE_MARS', Tr...
<commit_before>import os CONNECT_ARGS = [] CONNECT_KWARGS = {} LIVE_TEST = 'HOST' in os.environ if LIVE_TEST: HOST = os.environ['HOST'] DATABASE = os.environ.get('DATABASE', 'test') USER = os.environ.get('SQLUSER', 'sa') PASSWORD = os.environ.get('SQLPASSWORD', 'sa') USE_MARS = bool(os.environ.get...
import os CONNECT_ARGS = [] CONNECT_KWARGS = {} LIVE_TEST = 'HOST' in os.environ if LIVE_TEST: HOST = os.environ['HOST'] DATABASE = os.environ.get('DATABASE', 'test') USER = os.environ.get('SQLUSER', 'sa') PASSWORD = os.environ.get('SQLPASSWORD', 'sa') USE_MARS = bool(os.environ.get('USE_MARS', Tr...
import os CONNECT_ARGS = [] CONNECT_KWARGS = {} LIVE_TEST = 'HOST' in os.environ if LIVE_TEST: HOST = os.environ['HOST'] DATABASE = os.environ.get('DATABASE', 'test') USER = os.environ.get('SQLUSER', 'sa') PASSWORD = os.environ.get('SQLPASSWORD', 'sa') USE_MARS = bool(os.environ.get('USE_MARS', Tr...
<commit_before>import os CONNECT_ARGS = [] CONNECT_KWARGS = {} LIVE_TEST = 'HOST' in os.environ if LIVE_TEST: HOST = os.environ['HOST'] DATABASE = os.environ.get('DATABASE', 'test') USER = os.environ.get('SQLUSER', 'sa') PASSWORD = os.environ.get('SQLPASSWORD', 'sa') USE_MARS = bool(os.environ.get...
69e081afd1d2b24d40a4992c6af4538aba86ca1c
brew_journal/brew_journal/urls.py
brew_journal/brew_journal/urls.py
from django.conf.urls import patterns, include, url from brew_journal.views import IndexView from rest_framework_nested import routers from authentication.views import AccountViewSet, LoginView router = routers.SimpleRouter() router.register(r'account', AccountViewSet) urlpatterns = patterns('', # Examples: ...
from django.conf.urls import patterns, include, url from brew_journal.views import IndexView from rest_framework_nested import routers from authentication.views import AccountViewSet, LoginView router = routers.SimpleRouter() router.register(r'account', AccountViewSet) urlpatterns = patterns('', # Examples: ...
Reset the base url matching regex to correctly reroute to the home page when provided an unknown url
Reset the base url matching regex to correctly reroute to the home page when provided an unknown url
Python
apache-2.0
moonboy13/brew-journal,moonboy13/brew-journal,moonboy13/brew-journal
from django.conf.urls import patterns, include, url from brew_journal.views import IndexView from rest_framework_nested import routers from authentication.views import AccountViewSet, LoginView router = routers.SimpleRouter() router.register(r'account', AccountViewSet) urlpatterns = patterns('', # Examples: ...
from django.conf.urls import patterns, include, url from brew_journal.views import IndexView from rest_framework_nested import routers from authentication.views import AccountViewSet, LoginView router = routers.SimpleRouter() router.register(r'account', AccountViewSet) urlpatterns = patterns('', # Examples: ...
<commit_before>from django.conf.urls import patterns, include, url from brew_journal.views import IndexView from rest_framework_nested import routers from authentication.views import AccountViewSet, LoginView router = routers.SimpleRouter() router.register(r'account', AccountViewSet) urlpatterns = patterns('', ...
from django.conf.urls import patterns, include, url from brew_journal.views import IndexView from rest_framework_nested import routers from authentication.views import AccountViewSet, LoginView router = routers.SimpleRouter() router.register(r'account', AccountViewSet) urlpatterns = patterns('', # Examples: ...
from django.conf.urls import patterns, include, url from brew_journal.views import IndexView from rest_framework_nested import routers from authentication.views import AccountViewSet, LoginView router = routers.SimpleRouter() router.register(r'account', AccountViewSet) urlpatterns = patterns('', # Examples: ...
<commit_before>from django.conf.urls import patterns, include, url from brew_journal.views import IndexView from rest_framework_nested import routers from authentication.views import AccountViewSet, LoginView router = routers.SimpleRouter() router.register(r'account', AccountViewSet) urlpatterns = patterns('', ...
6d84cdb641d2d873118cb6cb26c5a7521ae40bd8
dcclient/dcclient.py
dcclient/dcclient.py
""" Main class from dcclient. Manages XML interaction, as well as switch and creates the actual networks """ import rpc from xml_manager.manager import ManagedXml from oslo.config import cfg class Manager: def __init__(self): self.rpc = rpc.RPC(cfg.CONF.ml2_datacom.dm_username, ...
""" Main class from dcclient. Manages XML interaction, as well as switch and creates the actual networks """ import rpc from xml_manager.manager import ManagedXml from neutron.openstack.common import log as logger from oslo.config import cfg LOG = logger.getLogger(__name__) class Manager: def __init__(self): ...
Add error treatment for existing network
Add error treatment for existing network
Python
apache-2.0
NeutronUfscarDatacom/DriverDatacom
""" Main class from dcclient. Manages XML interaction, as well as switch and creates the actual networks """ import rpc from xml_manager.manager import ManagedXml from oslo.config import cfg class Manager: def __init__(self): self.rpc = rpc.RPC(cfg.CONF.ml2_datacom.dm_username, ...
""" Main class from dcclient. Manages XML interaction, as well as switch and creates the actual networks """ import rpc from xml_manager.manager import ManagedXml from neutron.openstack.common import log as logger from oslo.config import cfg LOG = logger.getLogger(__name__) class Manager: def __init__(self): ...
<commit_before>""" Main class from dcclient. Manages XML interaction, as well as switch and creates the actual networks """ import rpc from xml_manager.manager import ManagedXml from oslo.config import cfg class Manager: def __init__(self): self.rpc = rpc.RPC(cfg.CONF.ml2_datacom.dm_username, ...
""" Main class from dcclient. Manages XML interaction, as well as switch and creates the actual networks """ import rpc from xml_manager.manager import ManagedXml from neutron.openstack.common import log as logger from oslo.config import cfg LOG = logger.getLogger(__name__) class Manager: def __init__(self): ...
""" Main class from dcclient. Manages XML interaction, as well as switch and creates the actual networks """ import rpc from xml_manager.manager import ManagedXml from oslo.config import cfg class Manager: def __init__(self): self.rpc = rpc.RPC(cfg.CONF.ml2_datacom.dm_username, ...
<commit_before>""" Main class from dcclient. Manages XML interaction, as well as switch and creates the actual networks """ import rpc from xml_manager.manager import ManagedXml from oslo.config import cfg class Manager: def __init__(self): self.rpc = rpc.RPC(cfg.CONF.ml2_datacom.dm_username, ...
e98f9fcc8537835b5a00bd0b6a755d7980a197de
template_tests/tests.py
template_tests/tests.py
import re import os from django.test import TestCase from .utils import get_template_dirs re_url = re.compile(r'\shref="(?P<url>(?!https?:|mailto:|\?|{|#)[^"]*)"') class TestTemplates(TestCase): def assertValidURLs(self, filename): with open(filename) as f: urls = [m.group('url') for m in re...
import re import os from django.test import TestCase from django.utils.text import slugify from .utils import get_template_dirs re_url = re.compile(r'\shref="(?P<url>(?!https?:|mailto:|\?|{|#)[^"]*)"') class TestTemplatesMeta(type): def __new__(cls, name, bases, attrs): def generate(template): ...
Use a metaclass instead of dirty dict()-mangling.
Use a metaclass instead of dirty dict()-mangling.
Python
bsd-3-clause
lamby/django-template-tests
import re import os from django.test import TestCase from .utils import get_template_dirs re_url = re.compile(r'\shref="(?P<url>(?!https?:|mailto:|\?|{|#)[^"]*)"') class TestTemplates(TestCase): def assertValidURLs(self, filename): with open(filename) as f: urls = [m.group('url') for m in re...
import re import os from django.test import TestCase from django.utils.text import slugify from .utils import get_template_dirs re_url = re.compile(r'\shref="(?P<url>(?!https?:|mailto:|\?|{|#)[^"]*)"') class TestTemplatesMeta(type): def __new__(cls, name, bases, attrs): def generate(template): ...
<commit_before>import re import os from django.test import TestCase from .utils import get_template_dirs re_url = re.compile(r'\shref="(?P<url>(?!https?:|mailto:|\?|{|#)[^"]*)"') class TestTemplates(TestCase): def assertValidURLs(self, filename): with open(filename) as f: urls = [m.group('ur...
import re import os from django.test import TestCase from django.utils.text import slugify from .utils import get_template_dirs re_url = re.compile(r'\shref="(?P<url>(?!https?:|mailto:|\?|{|#)[^"]*)"') class TestTemplatesMeta(type): def __new__(cls, name, bases, attrs): def generate(template): ...
import re import os from django.test import TestCase from .utils import get_template_dirs re_url = re.compile(r'\shref="(?P<url>(?!https?:|mailto:|\?|{|#)[^"]*)"') class TestTemplates(TestCase): def assertValidURLs(self, filename): with open(filename) as f: urls = [m.group('url') for m in re...
<commit_before>import re import os from django.test import TestCase from .utils import get_template_dirs re_url = re.compile(r'\shref="(?P<url>(?!https?:|mailto:|\?|{|#)[^"]*)"') class TestTemplates(TestCase): def assertValidURLs(self, filename): with open(filename) as f: urls = [m.group('ur...
57560385ef05ba6a2234e43795a037a487f26cfd
djaml/utils.py
djaml/utils.py
import imp from os import listdir from os.path import dirname, splitext from django.template import loaders MODULE_EXTENSIONS = tuple([suffix[0] for suffix in imp.get_suffixes()]) def get_django_template_loaders(): return [(loader.__name__.rsplit('.',1)[1], loader) for loader in get_submodules(l...
import imp from os import listdir from os.path import dirname, splitext from django.template import loaders MODULE_EXTENSIONS = tuple([suffix[0] for suffix in imp.get_suffixes()]) def get_django_template_loaders(): return [(loader.__name__.rsplit('.',1)[1], loader) for loader in get_submodules(l...
Fix submodule attribute check for Django 1.4 compatibility
Fix submodule attribute check for Django 1.4 compatibility
Python
mit
chartjes/djaml
import imp from os import listdir from os.path import dirname, splitext from django.template import loaders MODULE_EXTENSIONS = tuple([suffix[0] for suffix in imp.get_suffixes()]) def get_django_template_loaders(): return [(loader.__name__.rsplit('.',1)[1], loader) for loader in get_submodules(l...
import imp from os import listdir from os.path import dirname, splitext from django.template import loaders MODULE_EXTENSIONS = tuple([suffix[0] for suffix in imp.get_suffixes()]) def get_django_template_loaders(): return [(loader.__name__.rsplit('.',1)[1], loader) for loader in get_submodules(l...
<commit_before>import imp from os import listdir from os.path import dirname, splitext from django.template import loaders MODULE_EXTENSIONS = tuple([suffix[0] for suffix in imp.get_suffixes()]) def get_django_template_loaders(): return [(loader.__name__.rsplit('.',1)[1], loader) for loader in g...
import imp from os import listdir from os.path import dirname, splitext from django.template import loaders MODULE_EXTENSIONS = tuple([suffix[0] for suffix in imp.get_suffixes()]) def get_django_template_loaders(): return [(loader.__name__.rsplit('.',1)[1], loader) for loader in get_submodules(l...
import imp from os import listdir from os.path import dirname, splitext from django.template import loaders MODULE_EXTENSIONS = tuple([suffix[0] for suffix in imp.get_suffixes()]) def get_django_template_loaders(): return [(loader.__name__.rsplit('.',1)[1], loader) for loader in get_submodules(l...
<commit_before>import imp from os import listdir from os.path import dirname, splitext from django.template import loaders MODULE_EXTENSIONS = tuple([suffix[0] for suffix in imp.get_suffixes()]) def get_django_template_loaders(): return [(loader.__name__.rsplit('.',1)[1], loader) for loader in g...
db08b3462fc217cfbf3644051f299ef5bbef3d14
ckanext/stadtzhtheme/tests/test_validation.py
ckanext/stadtzhtheme/tests/test_validation.py
import nose from ckanapi import TestAppCKAN, ValidationError from ckan.tests import helpers, factories eq_ = nose.tools.eq_ assert_true = nose.tools.assert_true class TestValidation(helpers.FunctionalTestBase): def test_invalid_url(self): """Test that an invalid resource url is caught by our validator. ...
import pytest from ckanapi import ValidationError from ckan.tests import helpers, factories from ckantoolkit import config @pytest.mark.ckan_config("ckan.plugins", "stadtzhtheme") @pytest.mark.usefixtures("clean_db", "with_plugins") class TestValidation(object): def test_invalid_url(self): """Test that a...
Update tests to use pytest instead of nose
tests: Update tests to use pytest instead of nose
Python
agpl-3.0
opendatazurich/ckanext-stadtzh-theme,opendatazurich/ckanext-stadtzh-theme,opendatazurich/ckanext-stadtzh-theme
import nose from ckanapi import TestAppCKAN, ValidationError from ckan.tests import helpers, factories eq_ = nose.tools.eq_ assert_true = nose.tools.assert_true class TestValidation(helpers.FunctionalTestBase): def test_invalid_url(self): """Test that an invalid resource url is caught by our validator. ...
import pytest from ckanapi import ValidationError from ckan.tests import helpers, factories from ckantoolkit import config @pytest.mark.ckan_config("ckan.plugins", "stadtzhtheme") @pytest.mark.usefixtures("clean_db", "with_plugins") class TestValidation(object): def test_invalid_url(self): """Test that a...
<commit_before>import nose from ckanapi import TestAppCKAN, ValidationError from ckan.tests import helpers, factories eq_ = nose.tools.eq_ assert_true = nose.tools.assert_true class TestValidation(helpers.FunctionalTestBase): def test_invalid_url(self): """Test that an invalid resource url is caught by ...
import pytest from ckanapi import ValidationError from ckan.tests import helpers, factories from ckantoolkit import config @pytest.mark.ckan_config("ckan.plugins", "stadtzhtheme") @pytest.mark.usefixtures("clean_db", "with_plugins") class TestValidation(object): def test_invalid_url(self): """Test that a...
import nose from ckanapi import TestAppCKAN, ValidationError from ckan.tests import helpers, factories eq_ = nose.tools.eq_ assert_true = nose.tools.assert_true class TestValidation(helpers.FunctionalTestBase): def test_invalid_url(self): """Test that an invalid resource url is caught by our validator. ...
<commit_before>import nose from ckanapi import TestAppCKAN, ValidationError from ckan.tests import helpers, factories eq_ = nose.tools.eq_ assert_true = nose.tools.assert_true class TestValidation(helpers.FunctionalTestBase): def test_invalid_url(self): """Test that an invalid resource url is caught by ...
22992aeeb123b061a9c11d812ac7fad6427453eb
timpani/themes.py
timpani/themes.py
import os import os.path from . import database THEME_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "../themes")) def getCurrentTheme(): databaseConnection = database.ConnectionManager.getConnection("main") query = (databaseConnection.session .query(database.tables.Setting) .filter(database.tab...
import os import os.path from . import database THEME_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "../themes")) def getCurrentTheme(): databaseConnection = database.ConnectionManager.getConnection("main") query = (databaseConnection.session .query(database.tables.Setting) .filter(database.tab...
Add template support to getCurrentTheme
Add template support to getCurrentTheme
Python
mit
ollien/Timpani,ollien/Timpani,ollien/Timpani
import os import os.path from . import database THEME_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "../themes")) def getCurrentTheme(): databaseConnection = database.ConnectionManager.getConnection("main") query = (databaseConnection.session .query(database.tables.Setting) .filter(database.tab...
import os import os.path from . import database THEME_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "../themes")) def getCurrentTheme(): databaseConnection = database.ConnectionManager.getConnection("main") query = (databaseConnection.session .query(database.tables.Setting) .filter(database.tab...
<commit_before>import os import os.path from . import database THEME_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "../themes")) def getCurrentTheme(): databaseConnection = database.ConnectionManager.getConnection("main") query = (databaseConnection.session .query(database.tables.Setting) .filt...
import os import os.path from . import database THEME_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "../themes")) def getCurrentTheme(): databaseConnection = database.ConnectionManager.getConnection("main") query = (databaseConnection.session .query(database.tables.Setting) .filter(database.tab...
import os import os.path from . import database THEME_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "../themes")) def getCurrentTheme(): databaseConnection = database.ConnectionManager.getConnection("main") query = (databaseConnection.session .query(database.tables.Setting) .filter(database.tab...
<commit_before>import os import os.path from . import database THEME_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "../themes")) def getCurrentTheme(): databaseConnection = database.ConnectionManager.getConnection("main") query = (databaseConnection.session .query(database.tables.Setting) .filt...
fa6402472e30f59e67acf45d9faba632a3efc5e8
raiden/constants.py
raiden/constants.py
# -*- coding: utf-8 -*- UINT64_MAX = 2 ** 64 - 1 UINT64_MIN = 0 INT64_MAX = 2 ** 63 - 1 INT64_MIN = -(2 ** 63) UINT256_MAX = 2 ** 256 - 1 ROPSTEN_REGISTRY_ADDRESS = 'bbc60aa23059b039407ac008bd0b7e902890d382' ROPSTEN_DISCOVERY_ADDRESS = '524b7dcacac3055bd42fc03b006e9fdcb607e2be' MINUTE_SEC = 60 MINUTE_MS = 60 * 100...
# -*- coding: utf-8 -*- UINT64_MAX = 2 ** 64 - 1 UINT64_MIN = 0 INT64_MAX = 2 ** 63 - 1 INT64_MIN = -(2 ** 63) UINT256_MAX = 2 ** 256 - 1 # Deployed to Ropsten revival on 2017-06-19 from commit 2677298a69c1b1f35b9ab26beafe457acfdcc0ee ROPSTEN_REGISTRY_ADDRESS = 'aff1f958c69a6820b08a02549ff9041629ae8257' ROPSTEN_DIS...
Update pre-deployed Ropsten contract addresses
Update pre-deployed Ropsten contract addresses
Python
mit
hackaugusto/raiden,tomashaber/raiden,tomashaber/raiden,tomashaber/raiden,tomashaber/raiden,tomashaber/raiden,hackaugusto/raiden
# -*- coding: utf-8 -*- UINT64_MAX = 2 ** 64 - 1 UINT64_MIN = 0 INT64_MAX = 2 ** 63 - 1 INT64_MIN = -(2 ** 63) UINT256_MAX = 2 ** 256 - 1 ROPSTEN_REGISTRY_ADDRESS = 'bbc60aa23059b039407ac008bd0b7e902890d382' ROPSTEN_DISCOVERY_ADDRESS = '524b7dcacac3055bd42fc03b006e9fdcb607e2be' MINUTE_SEC = 60 MINUTE_MS = 60 * 100...
# -*- coding: utf-8 -*- UINT64_MAX = 2 ** 64 - 1 UINT64_MIN = 0 INT64_MAX = 2 ** 63 - 1 INT64_MIN = -(2 ** 63) UINT256_MAX = 2 ** 256 - 1 # Deployed to Ropsten revival on 2017-06-19 from commit 2677298a69c1b1f35b9ab26beafe457acfdcc0ee ROPSTEN_REGISTRY_ADDRESS = 'aff1f958c69a6820b08a02549ff9041629ae8257' ROPSTEN_DIS...
<commit_before># -*- coding: utf-8 -*- UINT64_MAX = 2 ** 64 - 1 UINT64_MIN = 0 INT64_MAX = 2 ** 63 - 1 INT64_MIN = -(2 ** 63) UINT256_MAX = 2 ** 256 - 1 ROPSTEN_REGISTRY_ADDRESS = 'bbc60aa23059b039407ac008bd0b7e902890d382' ROPSTEN_DISCOVERY_ADDRESS = '524b7dcacac3055bd42fc03b006e9fdcb607e2be' MINUTE_SEC = 60 MINUT...
# -*- coding: utf-8 -*- UINT64_MAX = 2 ** 64 - 1 UINT64_MIN = 0 INT64_MAX = 2 ** 63 - 1 INT64_MIN = -(2 ** 63) UINT256_MAX = 2 ** 256 - 1 # Deployed to Ropsten revival on 2017-06-19 from commit 2677298a69c1b1f35b9ab26beafe457acfdcc0ee ROPSTEN_REGISTRY_ADDRESS = 'aff1f958c69a6820b08a02549ff9041629ae8257' ROPSTEN_DIS...
# -*- coding: utf-8 -*- UINT64_MAX = 2 ** 64 - 1 UINT64_MIN = 0 INT64_MAX = 2 ** 63 - 1 INT64_MIN = -(2 ** 63) UINT256_MAX = 2 ** 256 - 1 ROPSTEN_REGISTRY_ADDRESS = 'bbc60aa23059b039407ac008bd0b7e902890d382' ROPSTEN_DISCOVERY_ADDRESS = '524b7dcacac3055bd42fc03b006e9fdcb607e2be' MINUTE_SEC = 60 MINUTE_MS = 60 * 100...
<commit_before># -*- coding: utf-8 -*- UINT64_MAX = 2 ** 64 - 1 UINT64_MIN = 0 INT64_MAX = 2 ** 63 - 1 INT64_MIN = -(2 ** 63) UINT256_MAX = 2 ** 256 - 1 ROPSTEN_REGISTRY_ADDRESS = 'bbc60aa23059b039407ac008bd0b7e902890d382' ROPSTEN_DISCOVERY_ADDRESS = '524b7dcacac3055bd42fc03b006e9fdcb607e2be' MINUTE_SEC = 60 MINUT...
335a33465e197c9a2e52ed9de90546e2ca6173ee
tests/test_websocket_subscriber.py
tests/test_websocket_subscriber.py
"""Tests for the WebSocketSubscriber handlers.""" import json import pytest from tornado.web import Application from tornado.websocket import websocket_connect from tornadose.handlers import WebSocketSubscriber import utilities @pytest.fixture def store(): return utilities.TestStore() @pytest.fixture def app...
"""Tests for the WebSocketSubscriber handlers.""" import json from tornado.ioloop import IOLoop from tornado.web import Application from tornado.websocket import websocket_connect from tornado.testing import AsyncHTTPTestCase, gen_test from tornadose.handlers import WebSocketSubscriber import utilities class WebSo...
Fix test case for WebSocketSubscriber
Fix test case for WebSocketSubscriber Switched to unittest-style testing (pytest is a bit too magical especially with the pytest-tornado extension). I may change all tests later to use unittest.
Python
mit
mivade/tornadose
"""Tests for the WebSocketSubscriber handlers.""" import json import pytest from tornado.web import Application from tornado.websocket import websocket_connect from tornadose.handlers import WebSocketSubscriber import utilities @pytest.fixture def store(): return utilities.TestStore() @pytest.fixture def app...
"""Tests for the WebSocketSubscriber handlers.""" import json from tornado.ioloop import IOLoop from tornado.web import Application from tornado.websocket import websocket_connect from tornado.testing import AsyncHTTPTestCase, gen_test from tornadose.handlers import WebSocketSubscriber import utilities class WebSo...
<commit_before>"""Tests for the WebSocketSubscriber handlers.""" import json import pytest from tornado.web import Application from tornado.websocket import websocket_connect from tornadose.handlers import WebSocketSubscriber import utilities @pytest.fixture def store(): return utilities.TestStore() @pytest....
"""Tests for the WebSocketSubscriber handlers.""" import json from tornado.ioloop import IOLoop from tornado.web import Application from tornado.websocket import websocket_connect from tornado.testing import AsyncHTTPTestCase, gen_test from tornadose.handlers import WebSocketSubscriber import utilities class WebSo...
"""Tests for the WebSocketSubscriber handlers.""" import json import pytest from tornado.web import Application from tornado.websocket import websocket_connect from tornadose.handlers import WebSocketSubscriber import utilities @pytest.fixture def store(): return utilities.TestStore() @pytest.fixture def app...
<commit_before>"""Tests for the WebSocketSubscriber handlers.""" import json import pytest from tornado.web import Application from tornado.websocket import websocket_connect from tornadose.handlers import WebSocketSubscriber import utilities @pytest.fixture def store(): return utilities.TestStore() @pytest....
3d2d07294f7b891b7e716911475333c5e34d5c98
tests/unit/test_raw_generichash.py
tests/unit/test_raw_generichash.py
# Import nacl libs import libnacl # Import python libs import unittest class TestGenericHash(unittest.TestCase): ''' Test sign functions ''' def test_keyless_generichash(self): msg1 = b'Are you suggesting coconuts migrate?' msg2 = b'Not at all, they could be carried.' chash1 =...
# Import nacl libs import libnacl # Import python libs import unittest class TestGenericHash(unittest.TestCase): ''' Test sign functions ''' def test_keyless_generichash(self): msg1 = b'Are you suggesting coconuts migrate?' msg2 = b'Not at all, they could be carried.' chash1 =...
Add tests for keyed hashes
Add tests for keyed hashes
Python
apache-2.0
mindw/libnacl,RaetProtocol/libnacl,cachedout/libnacl,johnttan/libnacl,coinkite/libnacl,saltstack/libnacl
# Import nacl libs import libnacl # Import python libs import unittest class TestGenericHash(unittest.TestCase): ''' Test sign functions ''' def test_keyless_generichash(self): msg1 = b'Are you suggesting coconuts migrate?' msg2 = b'Not at all, they could be carried.' chash1 =...
# Import nacl libs import libnacl # Import python libs import unittest class TestGenericHash(unittest.TestCase): ''' Test sign functions ''' def test_keyless_generichash(self): msg1 = b'Are you suggesting coconuts migrate?' msg2 = b'Not at all, they could be carried.' chash1 =...
<commit_before># Import nacl libs import libnacl # Import python libs import unittest class TestGenericHash(unittest.TestCase): ''' Test sign functions ''' def test_keyless_generichash(self): msg1 = b'Are you suggesting coconuts migrate?' msg2 = b'Not at all, they could be carried.' ...
# Import nacl libs import libnacl # Import python libs import unittest class TestGenericHash(unittest.TestCase): ''' Test sign functions ''' def test_keyless_generichash(self): msg1 = b'Are you suggesting coconuts migrate?' msg2 = b'Not at all, they could be carried.' chash1 =...
# Import nacl libs import libnacl # Import python libs import unittest class TestGenericHash(unittest.TestCase): ''' Test sign functions ''' def test_keyless_generichash(self): msg1 = b'Are you suggesting coconuts migrate?' msg2 = b'Not at all, they could be carried.' chash1 =...
<commit_before># Import nacl libs import libnacl # Import python libs import unittest class TestGenericHash(unittest.TestCase): ''' Test sign functions ''' def test_keyless_generichash(self): msg1 = b'Are you suggesting coconuts migrate?' msg2 = b'Not at all, they could be carried.' ...
44609e0432855506cd977cd39f1a780dfbd9e366
tests/consoles_tests.py
tests/consoles_tests.py
import io import spur from nose.tools import istest, assert_equal from toodlepip.consoles import Console @istest def console_writes_output_to_console(): console, output = _create_local_console() console.run("Action", ["echo", "Go go go!"]) assert b"Go go go!" in output.getvalue() def _create_local_con...
import io import spur from nose.tools import istest, assert_equal from toodlepip.consoles import Console @istest def console_writes_stdout_output_to_console(): console, output = _create_local_console() console.run("Action", ["echo", "Go go go!"]) assert b"Go go go!" in output.getvalue() @istest def co...
Add test for stderr output from console
Add test for stderr output from console
Python
bsd-2-clause
mwilliamson/toodlepip
import io import spur from nose.tools import istest, assert_equal from toodlepip.consoles import Console @istest def console_writes_output_to_console(): console, output = _create_local_console() console.run("Action", ["echo", "Go go go!"]) assert b"Go go go!" in output.getvalue() def _create_local_con...
import io import spur from nose.tools import istest, assert_equal from toodlepip.consoles import Console @istest def console_writes_stdout_output_to_console(): console, output = _create_local_console() console.run("Action", ["echo", "Go go go!"]) assert b"Go go go!" in output.getvalue() @istest def co...
<commit_before>import io import spur from nose.tools import istest, assert_equal from toodlepip.consoles import Console @istest def console_writes_output_to_console(): console, output = _create_local_console() console.run("Action", ["echo", "Go go go!"]) assert b"Go go go!" in output.getvalue() def _c...
import io import spur from nose.tools import istest, assert_equal from toodlepip.consoles import Console @istest def console_writes_stdout_output_to_console(): console, output = _create_local_console() console.run("Action", ["echo", "Go go go!"]) assert b"Go go go!" in output.getvalue() @istest def co...
import io import spur from nose.tools import istest, assert_equal from toodlepip.consoles import Console @istest def console_writes_output_to_console(): console, output = _create_local_console() console.run("Action", ["echo", "Go go go!"]) assert b"Go go go!" in output.getvalue() def _create_local_con...
<commit_before>import io import spur from nose.tools import istest, assert_equal from toodlepip.consoles import Console @istest def console_writes_output_to_console(): console, output = _create_local_console() console.run("Action", ["echo", "Go go go!"]) assert b"Go go go!" in output.getvalue() def _c...
2f9e058b4ef79f6eecb0292642c85a9e3e2376b0
examples/pipes-repl.py
examples/pipes-repl.py
''' Sample REPL code to integrate with Diesel Using InteractiveInterpreter broke block handling (if/def/etc.), but exceptions were handled well and the return value of code was printed. Using exec runs the input in the current context, but exception handling and other features of InteractiveInterpreter are lost. ''' ...
import sys import code import traceback from diesel import Application, Pipe, until QUIT_STR = "quit()\n" DEFAULT_PROMPT = '>>> ' def diesel_repl(): '''Simple REPL for use inside a diesel app''' # Import current_app into locals for use in REPL from diesel.app import current_app print 'Diesel Console'...
Fix REPL and add quit() command
Fix REPL and add quit() command
Python
bsd-3-clause
dieseldev/diesel
''' Sample REPL code to integrate with Diesel Using InteractiveInterpreter broke block handling (if/def/etc.), but exceptions were handled well and the return value of code was printed. Using exec runs the input in the current context, but exception handling and other features of InteractiveInterpreter are lost. ''' ...
import sys import code import traceback from diesel import Application, Pipe, until QUIT_STR = "quit()\n" DEFAULT_PROMPT = '>>> ' def diesel_repl(): '''Simple REPL for use inside a diesel app''' # Import current_app into locals for use in REPL from diesel.app import current_app print 'Diesel Console'...
<commit_before>''' Sample REPL code to integrate with Diesel Using InteractiveInterpreter broke block handling (if/def/etc.), but exceptions were handled well and the return value of code was printed. Using exec runs the input in the current context, but exception handling and other features of InteractiveInterpreter...
import sys import code import traceback from diesel import Application, Pipe, until QUIT_STR = "quit()\n" DEFAULT_PROMPT = '>>> ' def diesel_repl(): '''Simple REPL for use inside a diesel app''' # Import current_app into locals for use in REPL from diesel.app import current_app print 'Diesel Console'...
''' Sample REPL code to integrate with Diesel Using InteractiveInterpreter broke block handling (if/def/etc.), but exceptions were handled well and the return value of code was printed. Using exec runs the input in the current context, but exception handling and other features of InteractiveInterpreter are lost. ''' ...
<commit_before>''' Sample REPL code to integrate with Diesel Using InteractiveInterpreter broke block handling (if/def/etc.), but exceptions were handled well and the return value of code was printed. Using exec runs the input in the current context, but exception handling and other features of InteractiveInterpreter...
a6e1d44039d95f9f3f6ab6c53ffa28c50f3f9af6
bp/bp.py
bp/bp.py
# Python 3.6.1 def get_input(): with open('input.txt', 'r') as f: return f.read().split() def main(): input = get_input() # Code here if __name__ == '__main__': import time start = time.perf_counter() main() print(time.perf_counter() - start)
# Python 3.8.3 def get_input(): with open('input.txt', 'r') as f: return f.read().split() def main(): input = get_input() # Code here if __name__ == '__main__': import time start = time.perf_counter() main() print(time.perf_counter() - start)
Update Python version in template
Update Python version in template I completely forgot about those templates too. I don't even remember what "bp" was supposed to stand for.
Python
mit
foxscotch/advent-of-code,foxscotch/advent-of-code
# Python 3.6.1 def get_input(): with open('input.txt', 'r') as f: return f.read().split() def main(): input = get_input() # Code here if __name__ == '__main__': import time start = time.perf_counter() main() print(time.perf_counter() - start) Update Python version in template I...
# Python 3.8.3 def get_input(): with open('input.txt', 'r') as f: return f.read().split() def main(): input = get_input() # Code here if __name__ == '__main__': import time start = time.perf_counter() main() print(time.perf_counter() - start)
<commit_before># Python 3.6.1 def get_input(): with open('input.txt', 'r') as f: return f.read().split() def main(): input = get_input() # Code here if __name__ == '__main__': import time start = time.perf_counter() main() print(time.perf_counter() - start) <commit_msg>Update Py...
# Python 3.8.3 def get_input(): with open('input.txt', 'r') as f: return f.read().split() def main(): input = get_input() # Code here if __name__ == '__main__': import time start = time.perf_counter() main() print(time.perf_counter() - start)
# Python 3.6.1 def get_input(): with open('input.txt', 'r') as f: return f.read().split() def main(): input = get_input() # Code here if __name__ == '__main__': import time start = time.perf_counter() main() print(time.perf_counter() - start) Update Python version in template I...
<commit_before># Python 3.6.1 def get_input(): with open('input.txt', 'r') as f: return f.read().split() def main(): input = get_input() # Code here if __name__ == '__main__': import time start = time.perf_counter() main() print(time.perf_counter() - start) <commit_msg>Update Py...
85123f01f1e63b4fc7688e13104ee59c6efb263a
proscli/main.py
proscli/main.py
import click import proscli from proscli.utils import default_options def main(): # the program name should always be pros. don't care if it's not... try: cli.main(prog_name='pros') except KeyboardInterrupt: click.echo('Aborted!') pass import prosconductor.providers...
import click import proscli from proscli.utils import default_options def main(): # the program name should always be pros. don't care if it's not... try: cli.main(prog_name='pros') except KeyboardInterrupt: click.echo('Aborted!') pass @click.command('pros', ...
Remove deprecated and broken pros help option
Remove deprecated and broken pros help option
Python
mpl-2.0
purduesigbots/pros-cli,purduesigbots/purdueros-cli
import click import proscli from proscli.utils import default_options def main(): # the program name should always be pros. don't care if it's not... try: cli.main(prog_name='pros') except KeyboardInterrupt: click.echo('Aborted!') pass import prosconductor.providers...
import click import proscli from proscli.utils import default_options def main(): # the program name should always be pros. don't care if it's not... try: cli.main(prog_name='pros') except KeyboardInterrupt: click.echo('Aborted!') pass @click.command('pros', ...
<commit_before>import click import proscli from proscli.utils import default_options def main(): # the program name should always be pros. don't care if it's not... try: cli.main(prog_name='pros') except KeyboardInterrupt: click.echo('Aborted!') pass import proscond...
import click import proscli from proscli.utils import default_options def main(): # the program name should always be pros. don't care if it's not... try: cli.main(prog_name='pros') except KeyboardInterrupt: click.echo('Aborted!') pass @click.command('pros', ...
import click import proscli from proscli.utils import default_options def main(): # the program name should always be pros. don't care if it's not... try: cli.main(prog_name='pros') except KeyboardInterrupt: click.echo('Aborted!') pass import prosconductor.providers...
<commit_before>import click import proscli from proscli.utils import default_options def main(): # the program name should always be pros. don't care if it's not... try: cli.main(prog_name='pros') except KeyboardInterrupt: click.echo('Aborted!') pass import proscond...
ecd3f6df837f38bf78940308088d0760272a0c18
server/world.py
server/world.py
import logging from tile import Tile from mech import Mech, Enemy, Player class World(object): def __init__(self, game): print(game.state) self.generate_tiles(game.state) self.generate_mechs(game.state) def generate_tiles(self, state): """ Generate a tileset from the game st...
import logging from tile import Tile from mech import Mech, Enemy, Player class World(object): def __init__(self, game): print(game.state) self.generate_tiles(game.state) self.generate_mechs(game) def generate_tiles(self, state): """ Generate a tileset from the game state. "...
Use game.queue.is_turn(name) to build player or enemies
Use game.queue.is_turn(name) to build player or enemies
Python
mit
supermitch/mech-ai,supermitch/mech-ai,supermitch/mech-ai
import logging from tile import Tile from mech import Mech, Enemy, Player class World(object): def __init__(self, game): print(game.state) self.generate_tiles(game.state) self.generate_mechs(game.state) def generate_tiles(self, state): """ Generate a tileset from the game st...
import logging from tile import Tile from mech import Mech, Enemy, Player class World(object): def __init__(self, game): print(game.state) self.generate_tiles(game.state) self.generate_mechs(game) def generate_tiles(self, state): """ Generate a tileset from the game state. "...
<commit_before>import logging from tile import Tile from mech import Mech, Enemy, Player class World(object): def __init__(self, game): print(game.state) self.generate_tiles(game.state) self.generate_mechs(game.state) def generate_tiles(self, state): """ Generate a tileset f...
import logging from tile import Tile from mech import Mech, Enemy, Player class World(object): def __init__(self, game): print(game.state) self.generate_tiles(game.state) self.generate_mechs(game) def generate_tiles(self, state): """ Generate a tileset from the game state. "...
import logging from tile import Tile from mech import Mech, Enemy, Player class World(object): def __init__(self, game): print(game.state) self.generate_tiles(game.state) self.generate_mechs(game.state) def generate_tiles(self, state): """ Generate a tileset from the game st...
<commit_before>import logging from tile import Tile from mech import Mech, Enemy, Player class World(object): def __init__(self, game): print(game.state) self.generate_tiles(game.state) self.generate_mechs(game.state) def generate_tiles(self, state): """ Generate a tileset f...
7bc4afdde415ec4176c589fb867ccdee2db5c041
fmn/filters/generic.py
fmn/filters/generic.py
# Generic filters for FMN import fedmsg def user_filter(config, message, fasnick=None, *args, **kw): """ All messages of user Use this filter to filter out messages that are associated with a specified user. """ fasnick = kw.get('fasnick', fasnick) if fasnick: return fasnick in fedms...
# Generic filters for FMN import fedmsg import fmn.lib.pkgdb def user_filter(config, message, fasnick=None, *args, **kw): """ All messages of user Use this filter to filter out messages that are associated with a specified user. """ fasnick = kw.get('fasnick', fasnick) if fasnick: r...
Add first filter relying on pkgdb integration
Add first filter relying on pkgdb integration
Python
lgpl-2.1
jeremycline/fmn,jeremycline/fmn,jeremycline/fmn
# Generic filters for FMN import fedmsg def user_filter(config, message, fasnick=None, *args, **kw): """ All messages of user Use this filter to filter out messages that are associated with a specified user. """ fasnick = kw.get('fasnick', fasnick) if fasnick: return fasnick in fedms...
# Generic filters for FMN import fedmsg import fmn.lib.pkgdb def user_filter(config, message, fasnick=None, *args, **kw): """ All messages of user Use this filter to filter out messages that are associated with a specified user. """ fasnick = kw.get('fasnick', fasnick) if fasnick: r...
<commit_before># Generic filters for FMN import fedmsg def user_filter(config, message, fasnick=None, *args, **kw): """ All messages of user Use this filter to filter out messages that are associated with a specified user. """ fasnick = kw.get('fasnick', fasnick) if fasnick: return f...
# Generic filters for FMN import fedmsg import fmn.lib.pkgdb def user_filter(config, message, fasnick=None, *args, **kw): """ All messages of user Use this filter to filter out messages that are associated with a specified user. """ fasnick = kw.get('fasnick', fasnick) if fasnick: r...
# Generic filters for FMN import fedmsg def user_filter(config, message, fasnick=None, *args, **kw): """ All messages of user Use this filter to filter out messages that are associated with a specified user. """ fasnick = kw.get('fasnick', fasnick) if fasnick: return fasnick in fedms...
<commit_before># Generic filters for FMN import fedmsg def user_filter(config, message, fasnick=None, *args, **kw): """ All messages of user Use this filter to filter out messages that are associated with a specified user. """ fasnick = kw.get('fasnick', fasnick) if fasnick: return f...
8d235a76120aadcd555da3d641f509541f525eb8
csunplugged/utils/retrieve_query_parameter.py
csunplugged/utils/retrieve_query_parameter.py
"""Module for retrieving a GET request query parameter.""" from django.http import Http404 def retrieve_query_parameter(request, parameter, valid_options=None): """Retrieve the query parameter. If the parameter cannot be found, or is not found in the list of valid options, then a 404 error is raised. ...
"""Module for retrieving a GET request query parameter.""" from django.http import Http404 def retrieve_query_parameter(request, parameter, valid_options=None): """Retrieve the query parameter. If the parameter cannot be found, or is not found in the list of valid options, then a 404 error is raised. ...
Add function to get list of parameters
Add function to get list of parameters
Python
mit
uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged
"""Module for retrieving a GET request query parameter.""" from django.http import Http404 def retrieve_query_parameter(request, parameter, valid_options=None): """Retrieve the query parameter. If the parameter cannot be found, or is not found in the list of valid options, then a 404 error is raised. ...
"""Module for retrieving a GET request query parameter.""" from django.http import Http404 def retrieve_query_parameter(request, parameter, valid_options=None): """Retrieve the query parameter. If the parameter cannot be found, or is not found in the list of valid options, then a 404 error is raised. ...
<commit_before>"""Module for retrieving a GET request query parameter.""" from django.http import Http404 def retrieve_query_parameter(request, parameter, valid_options=None): """Retrieve the query parameter. If the parameter cannot be found, or is not found in the list of valid options, then a 404 erro...
"""Module for retrieving a GET request query parameter.""" from django.http import Http404 def retrieve_query_parameter(request, parameter, valid_options=None): """Retrieve the query parameter. If the parameter cannot be found, or is not found in the list of valid options, then a 404 error is raised. ...
"""Module for retrieving a GET request query parameter.""" from django.http import Http404 def retrieve_query_parameter(request, parameter, valid_options=None): """Retrieve the query parameter. If the parameter cannot be found, or is not found in the list of valid options, then a 404 error is raised. ...
<commit_before>"""Module for retrieving a GET request query parameter.""" from django.http import Http404 def retrieve_query_parameter(request, parameter, valid_options=None): """Retrieve the query parameter. If the parameter cannot be found, or is not found in the list of valid options, then a 404 erro...
ce1f62dd809b3bec0abb345464edede6a5701b20
clock.py
clock.py
from __future__ import print_function from apscheduler.schedulers.blocking import BlockingScheduler import logging import subprocess logging.basicConfig() job_defaults = { 'coalesce': False, 'max_instances': 2 } scheduler = BlockingScheduler(job_defaults=job_defaults) @scheduler.scheduled_job('interval', min...
from __future__ import print_function from apscheduler.schedulers.blocking import BlockingScheduler import logging import subprocess logging.basicConfig() job_defaults = { 'coalesce': False, 'max_instances': 2 } scheduler = BlockingScheduler(job_defaults=job_defaults) @scheduler.scheduled_job('interval', min...
Change notifier interval: 20 -> 10
Change notifier interval: 20 -> 10
Python
mit
oinume/lekcije,oinume/lekcije,oinume/lekcije,oinume/lekcije,oinume/lekcije,oinume/lekcije
from __future__ import print_function from apscheduler.schedulers.blocking import BlockingScheduler import logging import subprocess logging.basicConfig() job_defaults = { 'coalesce': False, 'max_instances': 2 } scheduler = BlockingScheduler(job_defaults=job_defaults) @scheduler.scheduled_job('interval', min...
from __future__ import print_function from apscheduler.schedulers.blocking import BlockingScheduler import logging import subprocess logging.basicConfig() job_defaults = { 'coalesce': False, 'max_instances': 2 } scheduler = BlockingScheduler(job_defaults=job_defaults) @scheduler.scheduled_job('interval', min...
<commit_before>from __future__ import print_function from apscheduler.schedulers.blocking import BlockingScheduler import logging import subprocess logging.basicConfig() job_defaults = { 'coalesce': False, 'max_instances': 2 } scheduler = BlockingScheduler(job_defaults=job_defaults) @scheduler.scheduled_job(...
from __future__ import print_function from apscheduler.schedulers.blocking import BlockingScheduler import logging import subprocess logging.basicConfig() job_defaults = { 'coalesce': False, 'max_instances': 2 } scheduler = BlockingScheduler(job_defaults=job_defaults) @scheduler.scheduled_job('interval', min...
from __future__ import print_function from apscheduler.schedulers.blocking import BlockingScheduler import logging import subprocess logging.basicConfig() job_defaults = { 'coalesce': False, 'max_instances': 2 } scheduler = BlockingScheduler(job_defaults=job_defaults) @scheduler.scheduled_job('interval', min...
<commit_before>from __future__ import print_function from apscheduler.schedulers.blocking import BlockingScheduler import logging import subprocess logging.basicConfig() job_defaults = { 'coalesce': False, 'max_instances': 2 } scheduler = BlockingScheduler(job_defaults=job_defaults) @scheduler.scheduled_job(...
d4adacc41858e224a8508a6da7ea77a30d1f8d9a
utils/data_paths.py
utils/data_paths.py
import os ROOT_DIR_PATH = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) DATA_DIR_PATH = os.path.join(ROOT_DIR_PATH, 'data') DATA_MOVIE_USER_DIR_PATH = os.path.join(DATA_DIR_PATH, 'mu') DATA_USER_MOVIE_DIR_PATH = os.path.join(DATA_DIR_PATH, 'um') SUBMISSIONS_DIR_PATH = os.path.join(ROOT_DIR_PATH, 'submi...
import os ROOT_DIR_PATH = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) DATA_DIR_PATH = os.path.join(ROOT_DIR_PATH, 'data') DATA_MOVIE_USER_DIR_PATH = os.path.join(DATA_DIR_PATH, 'mu') DATA_USER_MOVIE_DIR_PATH = os.path.join(DATA_DIR_PATH, 'um') SUBMISSIONS_DIR_PATH = os.path.join(ROOT_DIR_PATH, 'submi...
Remove base/hidden/probe data file paths (data_io isn't writing split data to files)
Remove base/hidden/probe data file paths (data_io isn't writing split data to files)
Python
mit
jvanbrug/netflix,jvanbrug/netflix
import os ROOT_DIR_PATH = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) DATA_DIR_PATH = os.path.join(ROOT_DIR_PATH, 'data') DATA_MOVIE_USER_DIR_PATH = os.path.join(DATA_DIR_PATH, 'mu') DATA_USER_MOVIE_DIR_PATH = os.path.join(DATA_DIR_PATH, 'um') SUBMISSIONS_DIR_PATH = os.path.join(ROOT_DIR_PATH, 'submi...
import os ROOT_DIR_PATH = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) DATA_DIR_PATH = os.path.join(ROOT_DIR_PATH, 'data') DATA_MOVIE_USER_DIR_PATH = os.path.join(DATA_DIR_PATH, 'mu') DATA_USER_MOVIE_DIR_PATH = os.path.join(DATA_DIR_PATH, 'um') SUBMISSIONS_DIR_PATH = os.path.join(ROOT_DIR_PATH, 'submi...
<commit_before>import os ROOT_DIR_PATH = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) DATA_DIR_PATH = os.path.join(ROOT_DIR_PATH, 'data') DATA_MOVIE_USER_DIR_PATH = os.path.join(DATA_DIR_PATH, 'mu') DATA_USER_MOVIE_DIR_PATH = os.path.join(DATA_DIR_PATH, 'um') SUBMISSIONS_DIR_PATH = os.path.join(ROOT_D...
import os ROOT_DIR_PATH = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) DATA_DIR_PATH = os.path.join(ROOT_DIR_PATH, 'data') DATA_MOVIE_USER_DIR_PATH = os.path.join(DATA_DIR_PATH, 'mu') DATA_USER_MOVIE_DIR_PATH = os.path.join(DATA_DIR_PATH, 'um') SUBMISSIONS_DIR_PATH = os.path.join(ROOT_DIR_PATH, 'submi...
import os ROOT_DIR_PATH = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) DATA_DIR_PATH = os.path.join(ROOT_DIR_PATH, 'data') DATA_MOVIE_USER_DIR_PATH = os.path.join(DATA_DIR_PATH, 'mu') DATA_USER_MOVIE_DIR_PATH = os.path.join(DATA_DIR_PATH, 'um') SUBMISSIONS_DIR_PATH = os.path.join(ROOT_DIR_PATH, 'submi...
<commit_before>import os ROOT_DIR_PATH = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) DATA_DIR_PATH = os.path.join(ROOT_DIR_PATH, 'data') DATA_MOVIE_USER_DIR_PATH = os.path.join(DATA_DIR_PATH, 'mu') DATA_USER_MOVIE_DIR_PATH = os.path.join(DATA_DIR_PATH, 'um') SUBMISSIONS_DIR_PATH = os.path.join(ROOT_D...
091c125f42463b372f0c2c99124578eb8fe13150
2019/aoc2019/day08.py
2019/aoc2019/day08.py
from collections import Counter from typing import Iterable, TextIO import numpy # type: ignore def parse_layers(width: int, height: int, data: TextIO) -> Iterable[numpy.array]: chunk_size = width * height content = next(data).strip() for pos in range(0, len(content), chunk_size): yield numpy....
from collections import Counter from typing import Iterable, TextIO import numpy # type: ignore def parse_layers(width: int, height: int, data: TextIO) -> Iterable[numpy.array]: chunk_size = width * height content = next(data).strip() for pos in range(0, len(content), chunk_size): yield numpy....
Fix day 8 to paint front-to-back
Fix day 8 to paint front-to-back
Python
mit
bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adv...
from collections import Counter from typing import Iterable, TextIO import numpy # type: ignore def parse_layers(width: int, height: int, data: TextIO) -> Iterable[numpy.array]: chunk_size = width * height content = next(data).strip() for pos in range(0, len(content), chunk_size): yield numpy....
from collections import Counter from typing import Iterable, TextIO import numpy # type: ignore def parse_layers(width: int, height: int, data: TextIO) -> Iterable[numpy.array]: chunk_size = width * height content = next(data).strip() for pos in range(0, len(content), chunk_size): yield numpy....
<commit_before>from collections import Counter from typing import Iterable, TextIO import numpy # type: ignore def parse_layers(width: int, height: int, data: TextIO) -> Iterable[numpy.array]: chunk_size = width * height content = next(data).strip() for pos in range(0, len(content), chunk_size): ...
from collections import Counter from typing import Iterable, TextIO import numpy # type: ignore def parse_layers(width: int, height: int, data: TextIO) -> Iterable[numpy.array]: chunk_size = width * height content = next(data).strip() for pos in range(0, len(content), chunk_size): yield numpy....
from collections import Counter from typing import Iterable, TextIO import numpy # type: ignore def parse_layers(width: int, height: int, data: TextIO) -> Iterable[numpy.array]: chunk_size = width * height content = next(data).strip() for pos in range(0, len(content), chunk_size): yield numpy....
<commit_before>from collections import Counter from typing import Iterable, TextIO import numpy # type: ignore def parse_layers(width: int, height: int, data: TextIO) -> Iterable[numpy.array]: chunk_size = width * height content = next(data).strip() for pos in range(0, len(content), chunk_size): ...
28ecf02c3d08eae725512e1563cf74f1831bd02d
gears/engines/base.py
gears/engines/base.py
import subprocess from functools import wraps class EngineProcessFailed(Exception): pass class BaseEngine(object): result_mimetype = None @classmethod def as_engine(cls, **initkwargs): @wraps(cls, updated=()) def engine(asset): instance = engine.engine_class(**initkwarg...
import subprocess from functools import wraps class EngineProcessFailed(Exception): pass class BaseEngine(object): result_mimetype = None @classmethod def as_engine(cls, **initkwargs): @wraps(cls, updated=()) def engine(asset): instance = engine.engine_class(**initkwarg...
Fix unicode support in ExecEngine
Fix unicode support in ExecEngine
Python
isc
gears/gears,gears/gears,gears/gears
import subprocess from functools import wraps class EngineProcessFailed(Exception): pass class BaseEngine(object): result_mimetype = None @classmethod def as_engine(cls, **initkwargs): @wraps(cls, updated=()) def engine(asset): instance = engine.engine_class(**initkwarg...
import subprocess from functools import wraps class EngineProcessFailed(Exception): pass class BaseEngine(object): result_mimetype = None @classmethod def as_engine(cls, **initkwargs): @wraps(cls, updated=()) def engine(asset): instance = engine.engine_class(**initkwarg...
<commit_before>import subprocess from functools import wraps class EngineProcessFailed(Exception): pass class BaseEngine(object): result_mimetype = None @classmethod def as_engine(cls, **initkwargs): @wraps(cls, updated=()) def engine(asset): instance = engine.engine_cl...
import subprocess from functools import wraps class EngineProcessFailed(Exception): pass class BaseEngine(object): result_mimetype = None @classmethod def as_engine(cls, **initkwargs): @wraps(cls, updated=()) def engine(asset): instance = engine.engine_class(**initkwarg...
import subprocess from functools import wraps class EngineProcessFailed(Exception): pass class BaseEngine(object): result_mimetype = None @classmethod def as_engine(cls, **initkwargs): @wraps(cls, updated=()) def engine(asset): instance = engine.engine_class(**initkwarg...
<commit_before>import subprocess from functools import wraps class EngineProcessFailed(Exception): pass class BaseEngine(object): result_mimetype = None @classmethod def as_engine(cls, **initkwargs): @wraps(cls, updated=()) def engine(asset): instance = engine.engine_cl...
52610add5ae887dcbc06f1435fdff34f182d78c9
go/campaigns/forms.py
go/campaigns/forms.py
from django import forms class CampaignGeneralForm(forms.Form): TYPE_CHOICES = ( ('', 'Select campaign type'), ('B', 'Bulk Message'), ('C', 'Conversation'), ) name = forms.CharField(label="Campaign name", max_length=100) type = forms.ChoiceField(label="Which kind of campaign ...
from django import forms class CampaignGeneralForm(forms.Form): TYPE_CHOICES = ( ('', 'Select campaign type'), ('B', 'Bulk Message'), ('D', 'Dialogue'), ) name = forms.CharField(label="Campaign name", max_length=100) type = forms.ChoiceField(label="Which kind of campaign woul...
Use dialogue terminology in menu
Use dialogue terminology in menu
Python
bsd-3-clause
praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go
from django import forms class CampaignGeneralForm(forms.Form): TYPE_CHOICES = ( ('', 'Select campaign type'), ('B', 'Bulk Message'), ('C', 'Conversation'), ) name = forms.CharField(label="Campaign name", max_length=100) type = forms.ChoiceField(label="Which kind of campaign ...
from django import forms class CampaignGeneralForm(forms.Form): TYPE_CHOICES = ( ('', 'Select campaign type'), ('B', 'Bulk Message'), ('D', 'Dialogue'), ) name = forms.CharField(label="Campaign name", max_length=100) type = forms.ChoiceField(label="Which kind of campaign woul...
<commit_before>from django import forms class CampaignGeneralForm(forms.Form): TYPE_CHOICES = ( ('', 'Select campaign type'), ('B', 'Bulk Message'), ('C', 'Conversation'), ) name = forms.CharField(label="Campaign name", max_length=100) type = forms.ChoiceField(label="Which ki...
from django import forms class CampaignGeneralForm(forms.Form): TYPE_CHOICES = ( ('', 'Select campaign type'), ('B', 'Bulk Message'), ('D', 'Dialogue'), ) name = forms.CharField(label="Campaign name", max_length=100) type = forms.ChoiceField(label="Which kind of campaign woul...
from django import forms class CampaignGeneralForm(forms.Form): TYPE_CHOICES = ( ('', 'Select campaign type'), ('B', 'Bulk Message'), ('C', 'Conversation'), ) name = forms.CharField(label="Campaign name", max_length=100) type = forms.ChoiceField(label="Which kind of campaign ...
<commit_before>from django import forms class CampaignGeneralForm(forms.Form): TYPE_CHOICES = ( ('', 'Select campaign type'), ('B', 'Bulk Message'), ('C', 'Conversation'), ) name = forms.CharField(label="Campaign name", max_length=100) type = forms.ChoiceField(label="Which ki...
ee2e1727ece6b591b39752a1d3cd6a87d972226d
github3/search/code.py
github3/search/code.py
# -*- coding: utf-8 -*- from github3.models import GitHubCore from github3.repos import Repository class CodeSearchResult(GitHubCore): def __init__(self, data, session=None): super(CodeSearchResult, self).__init__(data, session) self._api = data.get('url') #: Filename the match occurs in ...
# -*- coding: utf-8 -*- from github3.models import GitHubCore from github3.repos import Repository class CodeSearchResult(GitHubCore): def __init__(self, data, session=None): super(CodeSearchResult, self).__init__(data, session) self._api = data.get('url') #: Filename the match occurs in ...
Add a __repr__ for CodeSearchResult
Add a __repr__ for CodeSearchResult
Python
bsd-3-clause
h4ck3rm1k3/github3.py,ueg1990/github3.py,degustaf/github3.py,krxsky/github3.py,sigmavirus24/github3.py,itsmemattchung/github3.py,agamdua/github3.py,wbrefvem/github3.py,jim-minter/github3.py,icio/github3.py,christophelec/github3.py,balloob/github3.py
# -*- coding: utf-8 -*- from github3.models import GitHubCore from github3.repos import Repository class CodeSearchResult(GitHubCore): def __init__(self, data, session=None): super(CodeSearchResult, self).__init__(data, session) self._api = data.get('url') #: Filename the match occurs in ...
# -*- coding: utf-8 -*- from github3.models import GitHubCore from github3.repos import Repository class CodeSearchResult(GitHubCore): def __init__(self, data, session=None): super(CodeSearchResult, self).__init__(data, session) self._api = data.get('url') #: Filename the match occurs in ...
<commit_before># -*- coding: utf-8 -*- from github3.models import GitHubCore from github3.repos import Repository class CodeSearchResult(GitHubCore): def __init__(self, data, session=None): super(CodeSearchResult, self).__init__(data, session) self._api = data.get('url') #: Filename the ma...
# -*- coding: utf-8 -*- from github3.models import GitHubCore from github3.repos import Repository class CodeSearchResult(GitHubCore): def __init__(self, data, session=None): super(CodeSearchResult, self).__init__(data, session) self._api = data.get('url') #: Filename the match occurs in ...
# -*- coding: utf-8 -*- from github3.models import GitHubCore from github3.repos import Repository class CodeSearchResult(GitHubCore): def __init__(self, data, session=None): super(CodeSearchResult, self).__init__(data, session) self._api = data.get('url') #: Filename the match occurs in ...
<commit_before># -*- coding: utf-8 -*- from github3.models import GitHubCore from github3.repos import Repository class CodeSearchResult(GitHubCore): def __init__(self, data, session=None): super(CodeSearchResult, self).__init__(data, session) self._api = data.get('url') #: Filename the ma...
48ab19d9f81fc9973249e600f938586182fe6c7b
shop/rest/auth.py
shop/rest/auth.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.template.loader import select_template from rest_framework.serializers import CharField from rest_auth import serializers from shop import settings as shop_settings class PasswordResetSerializer(serializers.Pa...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.template.loader import select_template from rest_framework.serializers import CharField from rest_auth import serializers from shop import settings as shop_settings class PasswordResetSerializer(serializers.Pa...
Fix a failing test for PasswordResetSerializer
Fix a failing test for PasswordResetSerializer It seems that Django's template API changed. This should adjust to that.
Python
bsd-3-clause
awesto/django-shop,nimbis/django-shop,nimbis/django-shop,khchine5/django-shop,jrief/django-shop,rfleschenberg/django-shop,awesto/django-shop,khchine5/django-shop,divio/django-shop,divio/django-shop,nimbis/django-shop,jrief/django-shop,nimbis/django-shop,rfleschenberg/django-shop,jrief/django-shop,rfleschenberg/django-s...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.template.loader import select_template from rest_framework.serializers import CharField from rest_auth import serializers from shop import settings as shop_settings class PasswordResetSerializer(serializers.Pa...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.template.loader import select_template from rest_framework.serializers import CharField from rest_auth import serializers from shop import settings as shop_settings class PasswordResetSerializer(serializers.Pa...
<commit_before># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.template.loader import select_template from rest_framework.serializers import CharField from rest_auth import serializers from shop import settings as shop_settings class PasswordResetSerializer...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.template.loader import select_template from rest_framework.serializers import CharField from rest_auth import serializers from shop import settings as shop_settings class PasswordResetSerializer(serializers.Pa...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.template.loader import select_template from rest_framework.serializers import CharField from rest_auth import serializers from shop import settings as shop_settings class PasswordResetSerializer(serializers.Pa...
<commit_before># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.template.loader import select_template from rest_framework.serializers import CharField from rest_auth import serializers from shop import settings as shop_settings class PasswordResetSerializer...
54bf7dd89cd4288d869b94123ce45f3c639ea894
website/addons/dropbox/__init__.py
website/addons/dropbox/__init__.py
from . import model from . import routes from . import views MODELS = [model.AddonDropboxUserSettings] # TODO Other models needed? , model.AddonDropboxNodeSettings, model.DropboxGuidFile] USER_SETTINGS_MODEL = model.AddonDropboxNodeSettings #NODE_SETTINGS_MODEL = model.AddonDropboxNodeSettings ROUTES = [routes.setti...
from . import model from . import routes from . import views MODELS = [model.DropboxUserSettings] USER_SETTINGS_MODEL = model.DropboxUserSettings #NODE_SETTINGS_MODEL = model.AddonDropboxNodeSettings ROUTES = [routes.settings_routes, routes.nonapi_routes, routes.api_routes] SHORT_NAME = 'dropbox' FULL_NAME = 'Dropbo...
Fix settings; tests now passing
Fix settings; tests now passing
Python
apache-2.0
rdhyee/osf.io,abought/osf.io,aaxelb/osf.io,billyhunt/osf.io,laurenrevere/osf.io,jnayak1/osf.io,rdhyee/osf.io,monikagrabowska/osf.io,jnayak1/osf.io,felliott/osf.io,lyndsysimon/osf.io,caseyrygt/osf.io,caneruguz/osf.io,jinluyuan/osf.io,baylee-d/osf.io,cslzchen/osf.io,monikagrabowska/osf.io,mattclark/osf.io,brandonPurvis/o...
from . import model from . import routes from . import views MODELS = [model.AddonDropboxUserSettings] # TODO Other models needed? , model.AddonDropboxNodeSettings, model.DropboxGuidFile] USER_SETTINGS_MODEL = model.AddonDropboxNodeSettings #NODE_SETTINGS_MODEL = model.AddonDropboxNodeSettings ROUTES = [routes.setti...
from . import model from . import routes from . import views MODELS = [model.DropboxUserSettings] USER_SETTINGS_MODEL = model.DropboxUserSettings #NODE_SETTINGS_MODEL = model.AddonDropboxNodeSettings ROUTES = [routes.settings_routes, routes.nonapi_routes, routes.api_routes] SHORT_NAME = 'dropbox' FULL_NAME = 'Dropbo...
<commit_before>from . import model from . import routes from . import views MODELS = [model.AddonDropboxUserSettings] # TODO Other models needed? , model.AddonDropboxNodeSettings, model.DropboxGuidFile] USER_SETTINGS_MODEL = model.AddonDropboxNodeSettings #NODE_SETTINGS_MODEL = model.AddonDropboxNodeSettings ROUTES ...
from . import model from . import routes from . import views MODELS = [model.DropboxUserSettings] USER_SETTINGS_MODEL = model.DropboxUserSettings #NODE_SETTINGS_MODEL = model.AddonDropboxNodeSettings ROUTES = [routes.settings_routes, routes.nonapi_routes, routes.api_routes] SHORT_NAME = 'dropbox' FULL_NAME = 'Dropbo...
from . import model from . import routes from . import views MODELS = [model.AddonDropboxUserSettings] # TODO Other models needed? , model.AddonDropboxNodeSettings, model.DropboxGuidFile] USER_SETTINGS_MODEL = model.AddonDropboxNodeSettings #NODE_SETTINGS_MODEL = model.AddonDropboxNodeSettings ROUTES = [routes.setti...
<commit_before>from . import model from . import routes from . import views MODELS = [model.AddonDropboxUserSettings] # TODO Other models needed? , model.AddonDropboxNodeSettings, model.DropboxGuidFile] USER_SETTINGS_MODEL = model.AddonDropboxNodeSettings #NODE_SETTINGS_MODEL = model.AddonDropboxNodeSettings ROUTES ...
a854c1564f581bda5c355d97069d775485a65047
installer/steps/a_setup_virtualenv.py
installer/steps/a_setup_virtualenv.py
import os import re from helper import * import unix_windows section("Preparing virtualenv") # check that virtualenv installed if not executable_exists('virtualenv'): fail("""\ Please install virtualenv! https://github.com/pypa/virtualenv {}""".format(unix_windows.VIRTUALENV_INSTALL_MSG)) # Make sure that no...
import os import re from helper import * import unix_windows section("Preparing virtualenv") # check that virtualenv installed if not executable_exists('virtualenv'): fail("""\ Please install virtualenv! https://github.com/pypa/virtualenv {}""".format(unix_windows.VIRTUALENV_INSTALL_MSG)) # Make sure that no...
Fix python path for windows
Fix python path for windows
Python
mit
appi147/Jarvis,sukeesh/Jarvis,appi147/Jarvis,sukeesh/Jarvis,sukeesh/Jarvis,sukeesh/Jarvis
import os import re from helper import * import unix_windows section("Preparing virtualenv") # check that virtualenv installed if not executable_exists('virtualenv'): fail("""\ Please install virtualenv! https://github.com/pypa/virtualenv {}""".format(unix_windows.VIRTUALENV_INSTALL_MSG)) # Make sure that no...
import os import re from helper import * import unix_windows section("Preparing virtualenv") # check that virtualenv installed if not executable_exists('virtualenv'): fail("""\ Please install virtualenv! https://github.com/pypa/virtualenv {}""".format(unix_windows.VIRTUALENV_INSTALL_MSG)) # Make sure that no...
<commit_before>import os import re from helper import * import unix_windows section("Preparing virtualenv") # check that virtualenv installed if not executable_exists('virtualenv'): fail("""\ Please install virtualenv! https://github.com/pypa/virtualenv {}""".format(unix_windows.VIRTUALENV_INSTALL_MSG)) # Ma...
import os import re from helper import * import unix_windows section("Preparing virtualenv") # check that virtualenv installed if not executable_exists('virtualenv'): fail("""\ Please install virtualenv! https://github.com/pypa/virtualenv {}""".format(unix_windows.VIRTUALENV_INSTALL_MSG)) # Make sure that no...
import os import re from helper import * import unix_windows section("Preparing virtualenv") # check that virtualenv installed if not executable_exists('virtualenv'): fail("""\ Please install virtualenv! https://github.com/pypa/virtualenv {}""".format(unix_windows.VIRTUALENV_INSTALL_MSG)) # Make sure that no...
<commit_before>import os import re from helper import * import unix_windows section("Preparing virtualenv") # check that virtualenv installed if not executable_exists('virtualenv'): fail("""\ Please install virtualenv! https://github.com/pypa/virtualenv {}""".format(unix_windows.VIRTUALENV_INSTALL_MSG)) # Ma...
652bca441489dd49552cbd5945605d51921394f0
snowfloat/settings.py
snowfloat/settings.py
"""Client global settings.""" HOST = 'api.snowfloat.com:443' HTTP_TIMEOUT = 10 HTTP_RETRIES = 3 HTTP_RETRY_INTERVAL = 5 API_KEY = '' API_PRIVATE_KEY = '' try: # pylint: disable=F0401 from settings_prod import * except ImportError: try: # pylint: disable=F0401 from settings_dev import * ...
"""Client global settings.""" import os import ConfigParser HOST = 'api.snowfloat.com:443' HTTP_TIMEOUT = 10 HTTP_RETRIES = 3 HTTP_RETRY_INTERVAL = 5 API_KEY = '' API_PRIVATE_KEY = '' CONFIG = ConfigParser.RawConfigParser() for loc in (os.curdir, os.path.expanduser("~"), "/etc/snowfloat"): try: with open...
Read config file in different locations and set global config variables based on that.
Read config file in different locations and set global config variables based on that.
Python
bsd-3-clause
snowfloat/snowfloat-python,snowfloat/snowfloat-python
"""Client global settings.""" HOST = 'api.snowfloat.com:443' HTTP_TIMEOUT = 10 HTTP_RETRIES = 3 HTTP_RETRY_INTERVAL = 5 API_KEY = '' API_PRIVATE_KEY = '' try: # pylint: disable=F0401 from settings_prod import * except ImportError: try: # pylint: disable=F0401 from settings_dev import * ...
"""Client global settings.""" import os import ConfigParser HOST = 'api.snowfloat.com:443' HTTP_TIMEOUT = 10 HTTP_RETRIES = 3 HTTP_RETRY_INTERVAL = 5 API_KEY = '' API_PRIVATE_KEY = '' CONFIG = ConfigParser.RawConfigParser() for loc in (os.curdir, os.path.expanduser("~"), "/etc/snowfloat"): try: with open...
<commit_before>"""Client global settings.""" HOST = 'api.snowfloat.com:443' HTTP_TIMEOUT = 10 HTTP_RETRIES = 3 HTTP_RETRY_INTERVAL = 5 API_KEY = '' API_PRIVATE_KEY = '' try: # pylint: disable=F0401 from settings_prod import * except ImportError: try: # pylint: disable=F0401 from settings_...
"""Client global settings.""" import os import ConfigParser HOST = 'api.snowfloat.com:443' HTTP_TIMEOUT = 10 HTTP_RETRIES = 3 HTTP_RETRY_INTERVAL = 5 API_KEY = '' API_PRIVATE_KEY = '' CONFIG = ConfigParser.RawConfigParser() for loc in (os.curdir, os.path.expanduser("~"), "/etc/snowfloat"): try: with open...
"""Client global settings.""" HOST = 'api.snowfloat.com:443' HTTP_TIMEOUT = 10 HTTP_RETRIES = 3 HTTP_RETRY_INTERVAL = 5 API_KEY = '' API_PRIVATE_KEY = '' try: # pylint: disable=F0401 from settings_prod import * except ImportError: try: # pylint: disable=F0401 from settings_dev import * ...
<commit_before>"""Client global settings.""" HOST = 'api.snowfloat.com:443' HTTP_TIMEOUT = 10 HTTP_RETRIES = 3 HTTP_RETRY_INTERVAL = 5 API_KEY = '' API_PRIVATE_KEY = '' try: # pylint: disable=F0401 from settings_prod import * except ImportError: try: # pylint: disable=F0401 from settings_...
2fe37e7c46671a2ba9039f20c63930de2aaa0576
src/cutecoin/tools/decorators.py
src/cutecoin/tools/decorators.py
import asyncio import functools import logging def cancel_once_task(object, fn): if getattr(object, "__tasks", None): tasks = getattr(object, "__tasks") if fn.__name__ in tasks and not tasks[fn.__name__].done(): getattr(object, "__tasks")[fn.__name__].cancel() def once_at_a_time(fn):...
import asyncio import functools import logging def cancel_once_task(object, fn): if getattr(object, "__tasks", None): tasks = getattr(object, "__tasks") if fn.__name__ in tasks and not tasks[fn.__name__].done(): getattr(object, "__tasks")[fn.__name__].cancel() def once_at_a_time(fn):...
Fix bug with exception never handled in once_at_a_time coroutines
Fix bug with exception never handled in once_at_a_time coroutines
Python
mit
ucoin-io/cutecoin,ucoin-io/cutecoin,ucoin-io/cutecoin
import asyncio import functools import logging def cancel_once_task(object, fn): if getattr(object, "__tasks", None): tasks = getattr(object, "__tasks") if fn.__name__ in tasks and not tasks[fn.__name__].done(): getattr(object, "__tasks")[fn.__name__].cancel() def once_at_a_time(fn):...
import asyncio import functools import logging def cancel_once_task(object, fn): if getattr(object, "__tasks", None): tasks = getattr(object, "__tasks") if fn.__name__ in tasks and not tasks[fn.__name__].done(): getattr(object, "__tasks")[fn.__name__].cancel() def once_at_a_time(fn):...
<commit_before>import asyncio import functools import logging def cancel_once_task(object, fn): if getattr(object, "__tasks", None): tasks = getattr(object, "__tasks") if fn.__name__ in tasks and not tasks[fn.__name__].done(): getattr(object, "__tasks")[fn.__name__].cancel() def once...
import asyncio import functools import logging def cancel_once_task(object, fn): if getattr(object, "__tasks", None): tasks = getattr(object, "__tasks") if fn.__name__ in tasks and not tasks[fn.__name__].done(): getattr(object, "__tasks")[fn.__name__].cancel() def once_at_a_time(fn):...
import asyncio import functools import logging def cancel_once_task(object, fn): if getattr(object, "__tasks", None): tasks = getattr(object, "__tasks") if fn.__name__ in tasks and not tasks[fn.__name__].done(): getattr(object, "__tasks")[fn.__name__].cancel() def once_at_a_time(fn):...
<commit_before>import asyncio import functools import logging def cancel_once_task(object, fn): if getattr(object, "__tasks", None): tasks = getattr(object, "__tasks") if fn.__name__ in tasks and not tasks[fn.__name__].done(): getattr(object, "__tasks")[fn.__name__].cancel() def once...
dbf147b4842edd96842fa384b594265daf0c555e
byceps/util/system.py
byceps/util/system.py
""" byceps.util.system ~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2019 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ import os import sys CONFIG_VAR_NAME = 'BYCEPS_CONFIG' def get_config_filename_from_env() -> str: """Return the configuration filename set via environment variable. Ra...
""" byceps.util.system ~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2019 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ import os import sys from ..config import ConfigurationError CONFIG_VAR_NAME = 'BYCEPS_CONFIG' def get_config_filename_from_env() -> str: """Return the configuration filen...
Raise `ConfigurationError` instead of `Exception` if environment variable `BYCEPS_CONFIG` is not set
Raise `ConfigurationError` instead of `Exception` if environment variable `BYCEPS_CONFIG` is not set
Python
bsd-3-clause
homeworkprod/byceps,m-ober/byceps,m-ober/byceps,homeworkprod/byceps,m-ober/byceps,homeworkprod/byceps
""" byceps.util.system ~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2019 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ import os import sys CONFIG_VAR_NAME = 'BYCEPS_CONFIG' def get_config_filename_from_env() -> str: """Return the configuration filename set via environment variable. Ra...
""" byceps.util.system ~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2019 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ import os import sys from ..config import ConfigurationError CONFIG_VAR_NAME = 'BYCEPS_CONFIG' def get_config_filename_from_env() -> str: """Return the configuration filen...
<commit_before>""" byceps.util.system ~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2019 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ import os import sys CONFIG_VAR_NAME = 'BYCEPS_CONFIG' def get_config_filename_from_env() -> str: """Return the configuration filename set via environment va...
""" byceps.util.system ~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2019 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ import os import sys from ..config import ConfigurationError CONFIG_VAR_NAME = 'BYCEPS_CONFIG' def get_config_filename_from_env() -> str: """Return the configuration filen...
""" byceps.util.system ~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2019 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ import os import sys CONFIG_VAR_NAME = 'BYCEPS_CONFIG' def get_config_filename_from_env() -> str: """Return the configuration filename set via environment variable. Ra...
<commit_before>""" byceps.util.system ~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2019 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ import os import sys CONFIG_VAR_NAME = 'BYCEPS_CONFIG' def get_config_filename_from_env() -> str: """Return the configuration filename set via environment va...
0f8c4cd71bff68860d0a18f8680eda9a690f0959
sqlstr/exception.py
sqlstr/exception.py
''' Exceptions from sqlstr ------------------------- ''' class sqlstrException(Exception): def __init__(self, message): ''' Instanitates a custom sqlstrException :message str: ''' Exception.__init__(self, message)
''' Exceptions from sqlstr ------------------------- ''' class sqlstrException(Exception): def __init__(self, message): ''' Instanitates a custom sqlstrException message -- string. Message describing the exception. ''' Exception.__init__(self, message)
Update docstring with parameter listing
Update docstring with parameter listing
Python
mit
GochoMugo/sql-string-templating
''' Exceptions from sqlstr ------------------------- ''' class sqlstrException(Exception): def __init__(self, message): ''' Instanitates a custom sqlstrException :message str: ''' Exception.__init__(self, message) Update docstring with parameter listing
''' Exceptions from sqlstr ------------------------- ''' class sqlstrException(Exception): def __init__(self, message): ''' Instanitates a custom sqlstrException message -- string. Message describing the exception. ''' Exception.__init__(self, message)
<commit_before>''' Exceptions from sqlstr ------------------------- ''' class sqlstrException(Exception): def __init__(self, message): ''' Instanitates a custom sqlstrException :message str: ''' Exception.__init__(self, message) <commit_msg>Update docstring with parameter l...
''' Exceptions from sqlstr ------------------------- ''' class sqlstrException(Exception): def __init__(self, message): ''' Instanitates a custom sqlstrException message -- string. Message describing the exception. ''' Exception.__init__(self, message)
''' Exceptions from sqlstr ------------------------- ''' class sqlstrException(Exception): def __init__(self, message): ''' Instanitates a custom sqlstrException :message str: ''' Exception.__init__(self, message) Update docstring with parameter listing''' Exceptions from s...
<commit_before>''' Exceptions from sqlstr ------------------------- ''' class sqlstrException(Exception): def __init__(self, message): ''' Instanitates a custom sqlstrException :message str: ''' Exception.__init__(self, message) <commit_msg>Update docstring with parameter l...
8e5e732ad02f9aa6df7a8963c73c2b0aa753ad0a
src/utils.py
src/utils.py
if 'logger' not in globals(): import logging logger = logging.getLogger('Main') logger.setLevel(logging.DEBUG) logger.propagate = False if not logger.handlers: hdlr = logging.StreamHandler() hdlr.setLevel(logging.DEBUG) formatter = logging.Formatter( # '%(asct...
if 'logger' not in globals(): import logging logger = logging.getLogger('Main') logger.setLevel(logging.DEBUG) logger.propagate = False if not logger.handlers: hdlr = logging.StreamHandler() hdlr.setLevel(logging.DEBUG) formatter = logging.Formatter( # '%(asct...
Reduce function, to stop nested lists
Reduce function, to stop nested lists
Python
mit
Mause/tyrian,Mause/tyrian,Mause/tyrian,Mause/tyrian
if 'logger' not in globals(): import logging logger = logging.getLogger('Main') logger.setLevel(logging.DEBUG) logger.propagate = False if not logger.handlers: hdlr = logging.StreamHandler() hdlr.setLevel(logging.DEBUG) formatter = logging.Formatter( # '%(asct...
if 'logger' not in globals(): import logging logger = logging.getLogger('Main') logger.setLevel(logging.DEBUG) logger.propagate = False if not logger.handlers: hdlr = logging.StreamHandler() hdlr.setLevel(logging.DEBUG) formatter = logging.Formatter( # '%(asct...
<commit_before>if 'logger' not in globals(): import logging logger = logging.getLogger('Main') logger.setLevel(logging.DEBUG) logger.propagate = False if not logger.handlers: hdlr = logging.StreamHandler() hdlr.setLevel(logging.DEBUG) formatter = logging.Formatter( ...
if 'logger' not in globals(): import logging logger = logging.getLogger('Main') logger.setLevel(logging.DEBUG) logger.propagate = False if not logger.handlers: hdlr = logging.StreamHandler() hdlr.setLevel(logging.DEBUG) formatter = logging.Formatter( # '%(asct...
if 'logger' not in globals(): import logging logger = logging.getLogger('Main') logger.setLevel(logging.DEBUG) logger.propagate = False if not logger.handlers: hdlr = logging.StreamHandler() hdlr.setLevel(logging.DEBUG) formatter = logging.Formatter( # '%(asct...
<commit_before>if 'logger' not in globals(): import logging logger = logging.getLogger('Main') logger.setLevel(logging.DEBUG) logger.propagate = False if not logger.handlers: hdlr = logging.StreamHandler() hdlr.setLevel(logging.DEBUG) formatter = logging.Formatter( ...
a0a0d120552eeb304ac4b49648a43be5cf83cdcb
piper/core.py
piper/core.py
class Piper(object): """ The main runner. This class loads the configurations, sets up all other components, and finally executes them in whatever order they are supposed to happen in. """ def __init__(self): pass
import logbook class Piper(object): """ The main pipeline runner. This class loads the configurations, sets up all other components, executes them in whatever order they are supposed to happen in, collects data about the state of the pipeline and persists it, and finally tears down the compon...
Add more skeletonisms and documentation for Piper()
Add more skeletonisms and documentation for Piper()
Python
mit
thiderman/piper
class Piper(object): """ The main runner. This class loads the configurations, sets up all other components, and finally executes them in whatever order they are supposed to happen in. """ def __init__(self): pass Add more skeletonisms and documentation for Piper()
import logbook class Piper(object): """ The main pipeline runner. This class loads the configurations, sets up all other components, executes them in whatever order they are supposed to happen in, collects data about the state of the pipeline and persists it, and finally tears down the compon...
<commit_before>class Piper(object): """ The main runner. This class loads the configurations, sets up all other components, and finally executes them in whatever order they are supposed to happen in. """ def __init__(self): pass <commit_msg>Add more skeletonisms and documentation for ...
import logbook class Piper(object): """ The main pipeline runner. This class loads the configurations, sets up all other components, executes them in whatever order they are supposed to happen in, collects data about the state of the pipeline and persists it, and finally tears down the compon...
class Piper(object): """ The main runner. This class loads the configurations, sets up all other components, and finally executes them in whatever order they are supposed to happen in. """ def __init__(self): pass Add more skeletonisms and documentation for Piper()import logbook cla...
<commit_before>class Piper(object): """ The main runner. This class loads the configurations, sets up all other components, and finally executes them in whatever order they are supposed to happen in. """ def __init__(self): pass <commit_msg>Add more skeletonisms and documentation for ...
0261a0f9a1dde9f9f6167e3630561219e3dca124
statsmodels/datasets/__init__.py
statsmodels/datasets/__init__.py
""" Datasets module """ #__all__ = filter(lambda s:not s.startswith('_'),dir()) import anes96, cancer, committee, ccard, copper, cpunish, elnino, grunfeld, longley, \ macrodata, nile, randhie, scotland, spector, stackloss, star98, \ strikes, sunspots, fair, heart, statecrime
""" Datasets module """ #__all__ = filter(lambda s:not s.startswith('_'),dir()) from . import (anes96, cancer, committee, ccard, copper, cpunish, elnino, grunfeld, longley, macrodata, nile, randhie, scotland, spector, stackloss, star98, strikes, sunspots, fair, heart, statecrime)
Switch to relative imports and fix pep-8
STY: Switch to relative imports and fix pep-8
Python
bsd-3-clause
bsipocz/statsmodels,bsipocz/statsmodels,bsipocz/statsmodels,hlin117/statsmodels,bashtage/statsmodels,nguyentu1602/statsmodels,hlin117/statsmodels,musically-ut/statsmodels,yl565/statsmodels,jstoxrocky/statsmodels,wwf5067/statsmodels,bert9bert/statsmodels,nvoron23/statsmodels,bert9bert/statsmodels,astocko/statsmodels,jse...
""" Datasets module """ #__all__ = filter(lambda s:not s.startswith('_'),dir()) import anes96, cancer, committee, ccard, copper, cpunish, elnino, grunfeld, longley, \ macrodata, nile, randhie, scotland, spector, stackloss, star98, \ strikes, sunspots, fair, heart, statecrime STY: Switch to relative imp...
""" Datasets module """ #__all__ = filter(lambda s:not s.startswith('_'),dir()) from . import (anes96, cancer, committee, ccard, copper, cpunish, elnino, grunfeld, longley, macrodata, nile, randhie, scotland, spector, stackloss, star98, strikes, sunspots, fair, heart, statecrime)
<commit_before>""" Datasets module """ #__all__ = filter(lambda s:not s.startswith('_'),dir()) import anes96, cancer, committee, ccard, copper, cpunish, elnino, grunfeld, longley, \ macrodata, nile, randhie, scotland, spector, stackloss, star98, \ strikes, sunspots, fair, heart, statecrime <commit_msg>...
""" Datasets module """ #__all__ = filter(lambda s:not s.startswith('_'),dir()) from . import (anes96, cancer, committee, ccard, copper, cpunish, elnino, grunfeld, longley, macrodata, nile, randhie, scotland, spector, stackloss, star98, strikes, sunspots, fair, heart, statecrime)
""" Datasets module """ #__all__ = filter(lambda s:not s.startswith('_'),dir()) import anes96, cancer, committee, ccard, copper, cpunish, elnino, grunfeld, longley, \ macrodata, nile, randhie, scotland, spector, stackloss, star98, \ strikes, sunspots, fair, heart, statecrime STY: Switch to relative imp...
<commit_before>""" Datasets module """ #__all__ = filter(lambda s:not s.startswith('_'),dir()) import anes96, cancer, committee, ccard, copper, cpunish, elnino, grunfeld, longley, \ macrodata, nile, randhie, scotland, spector, stackloss, star98, \ strikes, sunspots, fair, heart, statecrime <commit_msg>...
d7945f0394038e9c194a2e41e6da151b679128a3
cs251tk/toolkit/process_student.py
cs251tk/toolkit/process_student.py
from cs251tk.student import remove from cs251tk.student import clone_student from cs251tk.student import stash from cs251tk.student import pull from cs251tk.student import checkout_date from cs251tk.student import record from cs251tk.student import reset from cs251tk.student import analyze def process_student( st...
from cs251tk.student import remove from cs251tk.student import clone_student from cs251tk.student import stash from cs251tk.student import pull from cs251tk.student import checkout_date from cs251tk.student import record from cs251tk.student import reset from cs251tk.student import analyze def process_student( st...
Remove extra newlines added during editing
Remove extra newlines added during editing
Python
mit
StoDevX/cs251-toolkit,StoDevX/cs251-toolkit,StoDevX/cs251-toolkit,StoDevX/cs251-toolkit
from cs251tk.student import remove from cs251tk.student import clone_student from cs251tk.student import stash from cs251tk.student import pull from cs251tk.student import checkout_date from cs251tk.student import record from cs251tk.student import reset from cs251tk.student import analyze def process_student( st...
from cs251tk.student import remove from cs251tk.student import clone_student from cs251tk.student import stash from cs251tk.student import pull from cs251tk.student import checkout_date from cs251tk.student import record from cs251tk.student import reset from cs251tk.student import analyze def process_student( st...
<commit_before>from cs251tk.student import remove from cs251tk.student import clone_student from cs251tk.student import stash from cs251tk.student import pull from cs251tk.student import checkout_date from cs251tk.student import record from cs251tk.student import reset from cs251tk.student import analyze def process_...
from cs251tk.student import remove from cs251tk.student import clone_student from cs251tk.student import stash from cs251tk.student import pull from cs251tk.student import checkout_date from cs251tk.student import record from cs251tk.student import reset from cs251tk.student import analyze def process_student( st...
from cs251tk.student import remove from cs251tk.student import clone_student from cs251tk.student import stash from cs251tk.student import pull from cs251tk.student import checkout_date from cs251tk.student import record from cs251tk.student import reset from cs251tk.student import analyze def process_student( st...
<commit_before>from cs251tk.student import remove from cs251tk.student import clone_student from cs251tk.student import stash from cs251tk.student import pull from cs251tk.student import checkout_date from cs251tk.student import record from cs251tk.student import reset from cs251tk.student import analyze def process_...
105b5c3d8db38be9a12974e7be807c429e8ad9ad
contentcuration/contentcuration/utils/asynccommand.py
contentcuration/contentcuration/utils/asynccommand.py
from abc import abstractmethod from collections import namedtuple from django.core.management.base import BaseCommand from django.core.management.base import CommandError Progress = namedtuple( 'Progress', [ 'progress', 'total', 'fraction', ] ) class TaskCommand(BaseCommand): ...
import logging as logmodule from abc import abstractmethod from django.core.management.base import BaseCommand logmodule.basicConfig() logging = logmodule.getLogger(__name__) class Progress(): """ A Progress contains the progress of the tasks, the total number of expected tasks/data, and the fraction wh...
Define Progress as a Class and add more comments
Define Progress as a Class and add more comments
Python
mit
fle-internal/content-curation,DXCanas/content-curation,fle-internal/content-curation,DXCanas/content-curation,DXCanas/content-curation,fle-internal/content-curation,fle-internal/content-curation,DXCanas/content-curation
from abc import abstractmethod from collections import namedtuple from django.core.management.base import BaseCommand from django.core.management.base import CommandError Progress = namedtuple( 'Progress', [ 'progress', 'total', 'fraction', ] ) class TaskCommand(BaseCommand): ...
import logging as logmodule from abc import abstractmethod from django.core.management.base import BaseCommand logmodule.basicConfig() logging = logmodule.getLogger(__name__) class Progress(): """ A Progress contains the progress of the tasks, the total number of expected tasks/data, and the fraction wh...
<commit_before>from abc import abstractmethod from collections import namedtuple from django.core.management.base import BaseCommand from django.core.management.base import CommandError Progress = namedtuple( 'Progress', [ 'progress', 'total', 'fraction', ] ) class TaskCommand(Ba...
import logging as logmodule from abc import abstractmethod from django.core.management.base import BaseCommand logmodule.basicConfig() logging = logmodule.getLogger(__name__) class Progress(): """ A Progress contains the progress of the tasks, the total number of expected tasks/data, and the fraction wh...
from abc import abstractmethod from collections import namedtuple from django.core.management.base import BaseCommand from django.core.management.base import CommandError Progress = namedtuple( 'Progress', [ 'progress', 'total', 'fraction', ] ) class TaskCommand(BaseCommand): ...
<commit_before>from abc import abstractmethod from collections import namedtuple from django.core.management.base import BaseCommand from django.core.management.base import CommandError Progress = namedtuple( 'Progress', [ 'progress', 'total', 'fraction', ] ) class TaskCommand(Ba...
117d7bd313c62ae8ccf5c0565ab1d0538db5423c
astrobin/settings/components/haystack.py
astrobin/settings/components/haystack.py
HAYSTACK_DEFAULT_OPERATOR = 'AND' HAYSTACK_SEARCH_RESULTS_PER_PAGE = 70 HAYSTACK_CONNECTIONS = { 'default': { 'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine', 'URL': 'http://elasticsearch:9200', 'INDEX_NAME': 'astrobin', 'EXCLUDED_INDEXES': [ ...
HAYSTACK_DEFAULT_OPERATOR = 'AND' HAYSTACK_SEARCH_RESULTS_PER_PAGE = 70 HAYSTACK_CONNECTIONS = { 'default': { 'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine', 'URL': 'http://elasticsearch:9200', 'INDEX_NAME': 'astrobin', 'EXCLUDED_INDEXES': [ ...
Enable real-time celery-based search index
Enable real-time celery-based search index
Python
agpl-3.0
astrobin/astrobin,astrobin/astrobin,astrobin/astrobin,astrobin/astrobin
HAYSTACK_DEFAULT_OPERATOR = 'AND' HAYSTACK_SEARCH_RESULTS_PER_PAGE = 70 HAYSTACK_CONNECTIONS = { 'default': { 'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine', 'URL': 'http://elasticsearch:9200', 'INDEX_NAME': 'astrobin', 'EXCLUDED_INDEXES': [ ...
HAYSTACK_DEFAULT_OPERATOR = 'AND' HAYSTACK_SEARCH_RESULTS_PER_PAGE = 70 HAYSTACK_CONNECTIONS = { 'default': { 'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine', 'URL': 'http://elasticsearch:9200', 'INDEX_NAME': 'astrobin', 'EXCLUDED_INDEXES': [ ...
<commit_before>HAYSTACK_DEFAULT_OPERATOR = 'AND' HAYSTACK_SEARCH_RESULTS_PER_PAGE = 70 HAYSTACK_CONNECTIONS = { 'default': { 'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine', 'URL': 'http://elasticsearch:9200', 'INDEX_NAME': 'astrobin', 'EXCLUDED_INDEXES'...
HAYSTACK_DEFAULT_OPERATOR = 'AND' HAYSTACK_SEARCH_RESULTS_PER_PAGE = 70 HAYSTACK_CONNECTIONS = { 'default': { 'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine', 'URL': 'http://elasticsearch:9200', 'INDEX_NAME': 'astrobin', 'EXCLUDED_INDEXES': [ ...
HAYSTACK_DEFAULT_OPERATOR = 'AND' HAYSTACK_SEARCH_RESULTS_PER_PAGE = 70 HAYSTACK_CONNECTIONS = { 'default': { 'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine', 'URL': 'http://elasticsearch:9200', 'INDEX_NAME': 'astrobin', 'EXCLUDED_INDEXES': [ ...
<commit_before>HAYSTACK_DEFAULT_OPERATOR = 'AND' HAYSTACK_SEARCH_RESULTS_PER_PAGE = 70 HAYSTACK_CONNECTIONS = { 'default': { 'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine', 'URL': 'http://elasticsearch:9200', 'INDEX_NAME': 'astrobin', 'EXCLUDED_INDEXES'...
e26573b37f6cb12817b35d3ac0d19fa301fd1a99
pytest-{{cookiecutter.plugin_name}}/pytest_{{cookiecutter.plugin_name}}.py
pytest-{{cookiecutter.plugin_name}}/pytest_{{cookiecutter.plugin_name}}.py
# -*- coding: utf-8 -*- import pytest def pytest_addoption(parser): group = parser.getgroup('{{cookiecutter.plugin_name}}') group.addoption( '--foo', action='store_const', dest='foo', help='alias for --foo' )
# -*- coding: utf-8 -*- import pytest def pytest_addoption(parser): group = parser.getgroup('{{cookiecutter.plugin_name}}') group.addoption( '--foo', action='store_const', dest='foo', help='alias for --foo' ) @pytest.fixture def bar(request): return request.config.op...
Implement a custom fixture for the plugin
Implement a custom fixture for the plugin
Python
mit
pytest-dev/cookiecutter-pytest-plugin,s0undt3ch/cookiecutter-pytest-plugin,luzfcb/cookiecutter-pytest-plugin
# -*- coding: utf-8 -*- import pytest def pytest_addoption(parser): group = parser.getgroup('{{cookiecutter.plugin_name}}') group.addoption( '--foo', action='store_const', dest='foo', help='alias for --foo' ) Implement a custom fixture for the plugin
# -*- coding: utf-8 -*- import pytest def pytest_addoption(parser): group = parser.getgroup('{{cookiecutter.plugin_name}}') group.addoption( '--foo', action='store_const', dest='foo', help='alias for --foo' ) @pytest.fixture def bar(request): return request.config.op...
<commit_before># -*- coding: utf-8 -*- import pytest def pytest_addoption(parser): group = parser.getgroup('{{cookiecutter.plugin_name}}') group.addoption( '--foo', action='store_const', dest='foo', help='alias for --foo' ) <commit_msg>Implement a custom fixture for the pl...
# -*- coding: utf-8 -*- import pytest def pytest_addoption(parser): group = parser.getgroup('{{cookiecutter.plugin_name}}') group.addoption( '--foo', action='store_const', dest='foo', help='alias for --foo' ) @pytest.fixture def bar(request): return request.config.op...
# -*- coding: utf-8 -*- import pytest def pytest_addoption(parser): group = parser.getgroup('{{cookiecutter.plugin_name}}') group.addoption( '--foo', action='store_const', dest='foo', help='alias for --foo' ) Implement a custom fixture for the plugin# -*- coding: utf-8 -*-...
<commit_before># -*- coding: utf-8 -*- import pytest def pytest_addoption(parser): group = parser.getgroup('{{cookiecutter.plugin_name}}') group.addoption( '--foo', action='store_const', dest='foo', help='alias for --foo' ) <commit_msg>Implement a custom fixture for the pl...
aeebd8a4f2255bff03fbb55f3d7d29d822fbb31b
logaugment/__init__.py
logaugment/__init__.py
import logging class AugmentFilter(logging.Filter): def __init__(self, name='', args=None): super(AugmentFilter, self).__init__(name) self._args = args def filter(self, record): if self._args is not None: data = {} try: if callable(self._args):...
import logging __title__ = 'logaugment' __version__ = '0.0.1' __author__ = 'Simeon Visser' __email__ = '[email protected]' __license__ = 'MIT' __copyright__ = 'Copyright 2014 Simeon Visser' class AugmentFilter(logging.Filter): def __init__(self, name='', args=None): super(AugmentFilter, self).__ini...
Add project details to codebase
Add project details to codebase
Python
mit
svisser/logaugment
import logging class AugmentFilter(logging.Filter): def __init__(self, name='', args=None): super(AugmentFilter, self).__init__(name) self._args = args def filter(self, record): if self._args is not None: data = {} try: if callable(self._args):...
import logging __title__ = 'logaugment' __version__ = '0.0.1' __author__ = 'Simeon Visser' __email__ = '[email protected]' __license__ = 'MIT' __copyright__ = 'Copyright 2014 Simeon Visser' class AugmentFilter(logging.Filter): def __init__(self, name='', args=None): super(AugmentFilter, self).__ini...
<commit_before>import logging class AugmentFilter(logging.Filter): def __init__(self, name='', args=None): super(AugmentFilter, self).__init__(name) self._args = args def filter(self, record): if self._args is not None: data = {} try: if callab...
import logging __title__ = 'logaugment' __version__ = '0.0.1' __author__ = 'Simeon Visser' __email__ = '[email protected]' __license__ = 'MIT' __copyright__ = 'Copyright 2014 Simeon Visser' class AugmentFilter(logging.Filter): def __init__(self, name='', args=None): super(AugmentFilter, self).__ini...
import logging class AugmentFilter(logging.Filter): def __init__(self, name='', args=None): super(AugmentFilter, self).__init__(name) self._args = args def filter(self, record): if self._args is not None: data = {} try: if callable(self._args):...
<commit_before>import logging class AugmentFilter(logging.Filter): def __init__(self, name='', args=None): super(AugmentFilter, self).__init__(name) self._args = args def filter(self, record): if self._args is not None: data = {} try: if callab...
a9accd5460157e323e8514178d3e7bc9d2fa8667
dn1/kolona_vozil_test.py
dn1/kolona_vozil_test.py
__author__ = 'Nino Bašić <[email protected]>' import unittest from jadrolinija import KolonaVozil class KolonaVozilTest(unittest.TestCase): def test_init(self): kv = KolonaVozil(2000) self.assertEqual(kv.max_dolzina, 2000) self.assertEqual(kv.zasedenost, 0) if __name__ == '__mai...
__author__ = 'Nino Bašić <[email protected]>' import unittest from jadrolinija import KolonaVozil, Vozilo class KolonaVozilTest(unittest.TestCase): def test_init(self): kv = KolonaVozil(2000) self.assertEqual(kv.max_dolzina, 2000) self.assertEqual(kv.zasedenost, 0) def test_v...
Update unittests for Task 4
Update unittests for Task 4
Python
mit
nbasic/racunalnistvo-1
__author__ = 'Nino Bašić <[email protected]>' import unittest from jadrolinija import KolonaVozil class KolonaVozilTest(unittest.TestCase): def test_init(self): kv = KolonaVozil(2000) self.assertEqual(kv.max_dolzina, 2000) self.assertEqual(kv.zasedenost, 0) if __name__ == '__mai...
__author__ = 'Nino Bašić <[email protected]>' import unittest from jadrolinija import KolonaVozil, Vozilo class KolonaVozilTest(unittest.TestCase): def test_init(self): kv = KolonaVozil(2000) self.assertEqual(kv.max_dolzina, 2000) self.assertEqual(kv.zasedenost, 0) def test_v...
<commit_before>__author__ = 'Nino Bašić <[email protected]>' import unittest from jadrolinija import KolonaVozil class KolonaVozilTest(unittest.TestCase): def test_init(self): kv = KolonaVozil(2000) self.assertEqual(kv.max_dolzina, 2000) self.assertEqual(kv.zasedenost, 0) if __n...
__author__ = 'Nino Bašić <[email protected]>' import unittest from jadrolinija import KolonaVozil, Vozilo class KolonaVozilTest(unittest.TestCase): def test_init(self): kv = KolonaVozil(2000) self.assertEqual(kv.max_dolzina, 2000) self.assertEqual(kv.zasedenost, 0) def test_v...
__author__ = 'Nino Bašić <[email protected]>' import unittest from jadrolinija import KolonaVozil class KolonaVozilTest(unittest.TestCase): def test_init(self): kv = KolonaVozil(2000) self.assertEqual(kv.max_dolzina, 2000) self.assertEqual(kv.zasedenost, 0) if __name__ == '__mai...
<commit_before>__author__ = 'Nino Bašić <[email protected]>' import unittest from jadrolinija import KolonaVozil class KolonaVozilTest(unittest.TestCase): def test_init(self): kv = KolonaVozil(2000) self.assertEqual(kv.max_dolzina, 2000) self.assertEqual(kv.zasedenost, 0) if __n...
05e651b0e606f216a78c61ccfb441ce7ed41d852
reg/compat.py
reg/compat.py
import sys from types import MethodType # True if we are running on Python 3. PY3 = sys.version_info[0] == 3 if PY3: string_types = (str,) else: # pragma: no cover string_types = (basestring,) # noqa if PY3: def create_method_for_class(callable, type): return MethodType(callable, type) d...
import sys from types import MethodType # True if we are running on Python 3. PY3 = sys.version_info[0] == 3 if PY3: string_types = (str,) else: # pragma: no cover string_types = (basestring,) # noqa if PY3: def create_method_for_class(callable, type): return MethodType(callable, type) d...
Exclude from coverage the code pathways that are specific to Python 2.
Exclude from coverage the code pathways that are specific to Python 2.
Python
bsd-3-clause
morepath/reg,taschini/reg
import sys from types import MethodType # True if we are running on Python 3. PY3 = sys.version_info[0] == 3 if PY3: string_types = (str,) else: # pragma: no cover string_types = (basestring,) # noqa if PY3: def create_method_for_class(callable, type): return MethodType(callable, type) d...
import sys from types import MethodType # True if we are running on Python 3. PY3 = sys.version_info[0] == 3 if PY3: string_types = (str,) else: # pragma: no cover string_types = (basestring,) # noqa if PY3: def create_method_for_class(callable, type): return MethodType(callable, type) d...
<commit_before>import sys from types import MethodType # True if we are running on Python 3. PY3 = sys.version_info[0] == 3 if PY3: string_types = (str,) else: # pragma: no cover string_types = (basestring,) # noqa if PY3: def create_method_for_class(callable, type): return MethodType(callabl...
import sys from types import MethodType # True if we are running on Python 3. PY3 = sys.version_info[0] == 3 if PY3: string_types = (str,) else: # pragma: no cover string_types = (basestring,) # noqa if PY3: def create_method_for_class(callable, type): return MethodType(callable, type) d...
import sys from types import MethodType # True if we are running on Python 3. PY3 = sys.version_info[0] == 3 if PY3: string_types = (str,) else: # pragma: no cover string_types = (basestring,) # noqa if PY3: def create_method_for_class(callable, type): return MethodType(callable, type) d...
<commit_before>import sys from types import MethodType # True if we are running on Python 3. PY3 = sys.version_info[0] == 3 if PY3: string_types = (str,) else: # pragma: no cover string_types = (basestring,) # noqa if PY3: def create_method_for_class(callable, type): return MethodType(callabl...