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
45313f2313e5b5a4636469b4b82a02a8e62fc1f1
helper.py
helper.py
class Filters(): """ Get a datetime instance object or a int() Epoch timestamp and return a pretty string like 'an hour ago', 'Yesterday', '3 month ago', 'just now' etc. """ def prettify_time(self, time=False): if time == None: return time from datetime import datetime now = datetime.now() if type(ti...
Add the method to prettify the time displayed.
Add the method to prettify the time displayed.
Python
mit
yiyangyi/cc98-tornado
Add the method to prettify the time displayed.
class Filters(): """ Get a datetime instance object or a int() Epoch timestamp and return a pretty string like 'an hour ago', 'Yesterday', '3 month ago', 'just now' etc. """ def prettify_time(self, time=False): if time == None: return time from datetime import datetime now = datetime.now() if type(ti...
<commit_before><commit_msg>Add the method to prettify the time displayed.<commit_after>
class Filters(): """ Get a datetime instance object or a int() Epoch timestamp and return a pretty string like 'an hour ago', 'Yesterday', '3 month ago', 'just now' etc. """ def prettify_time(self, time=False): if time == None: return time from datetime import datetime now = datetime.now() if type(ti...
Add the method to prettify the time displayed.class Filters(): """ Get a datetime instance object or a int() Epoch timestamp and return a pretty string like 'an hour ago', 'Yesterday', '3 month ago', 'just now' etc. """ def prettify_time(self, time=False): if time == None: return time from datetime import...
<commit_before><commit_msg>Add the method to prettify the time displayed.<commit_after>class Filters(): """ Get a datetime instance object or a int() Epoch timestamp and return a pretty string like 'an hour ago', 'Yesterday', '3 month ago', 'just now' etc. """ def prettify_time(self, time=False): if time == Non...
e69c9db3efc5f71a5852a28ea77a215d083a6b64
server/inventory/views.py
server/inventory/views.py
from django.shortcuts import render from django.core import serializers from inventory.models import Item from decimal import Decimal import json from django.utils import simplejson # Create your views here. from django.http import HttpResponse from inventory.models import Item def index(request): if request.meth...
from django.shortcuts import render from django.core import serializers from inventory.models import Item from decimal import Decimal import json from django.utils import simplejson # Create your views here. from django.http import HttpResponse from inventory.models import Item def index(request): if request.meth...
Add the 401 Unauthorized when no username is detected, thus no user is logged in. This is the most basic form of permissions, where any user can log in and do anything.
Add the 401 Unauthorized when no username is detected, thus no user is logged in. This is the most basic form of permissions, where any user can log in and do anything.
Python
agpl-3.0
TomDataworks/angular-inventory,TomDataworks/angular-inventory
from django.shortcuts import render from django.core import serializers from inventory.models import Item from decimal import Decimal import json from django.utils import simplejson # Create your views here. from django.http import HttpResponse from inventory.models import Item def index(request): if request.meth...
from django.shortcuts import render from django.core import serializers from inventory.models import Item from decimal import Decimal import json from django.utils import simplejson # Create your views here. from django.http import HttpResponse from inventory.models import Item def index(request): if request.meth...
<commit_before>from django.shortcuts import render from django.core import serializers from inventory.models import Item from decimal import Decimal import json from django.utils import simplejson # Create your views here. from django.http import HttpResponse from inventory.models import Item def index(request): ...
from django.shortcuts import render from django.core import serializers from inventory.models import Item from decimal import Decimal import json from django.utils import simplejson # Create your views here. from django.http import HttpResponse from inventory.models import Item def index(request): if request.meth...
from django.shortcuts import render from django.core import serializers from inventory.models import Item from decimal import Decimal import json from django.utils import simplejson # Create your views here. from django.http import HttpResponse from inventory.models import Item def index(request): if request.meth...
<commit_before>from django.shortcuts import render from django.core import serializers from inventory.models import Item from decimal import Decimal import json from django.utils import simplejson # Create your views here. from django.http import HttpResponse from inventory.models import Item def index(request): ...
876c9b81a295c30a644bfe3e8efa5f0d644b9b67
app/soc/modules/gsoc/logic/program.py
app/soc/modules/gsoc/logic/program.py
# Copyright 2012 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
# Copyright 2012 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
Fix a leftover "gci" documentation note to correctly refer to Summer of Code.
Fix a leftover "gci" documentation note to correctly refer to Summer of Code. This fixes issue 1790, and thanks to Piyush Bansal for reporting the error and directing its fix.
Python
apache-2.0
rhyolight/nupic.son,rhyolight/nupic.son,rhyolight/nupic.son
# Copyright 2012 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
# Copyright 2012 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
<commit_before># Copyright 2012 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
# Copyright 2012 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
# Copyright 2012 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
<commit_before># Copyright 2012 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
428b4b0025dd7bb0edf5d3df8c32703d96ab577b
src/shared/unit_orders.py
src/shared/unit_orders.py
class UnitOrders(object): def __init__(self): self.orders = {} def giveOrders(self, unit, orders): if orders is not None and not isinstance(orders, list): orders = list(orders) self.orders[unit] = orders def getNextOrder(self, unit): try: return self...
class UnitOrders(object): def __init__(self): self.orders = {} def giveOrders(self, unit, orders): if orders is not None and not isinstance(orders, list): orders = list(orders) self.orders[unit] = orders def getNextOrder(self, unit): try: orders = se...
Check for None before indexing.
Check for None before indexing.
Python
mit
CheeseLord/warts,CheeseLord/warts
class UnitOrders(object): def __init__(self): self.orders = {} def giveOrders(self, unit, orders): if orders is not None and not isinstance(orders, list): orders = list(orders) self.orders[unit] = orders def getNextOrder(self, unit): try: return self...
class UnitOrders(object): def __init__(self): self.orders = {} def giveOrders(self, unit, orders): if orders is not None and not isinstance(orders, list): orders = list(orders) self.orders[unit] = orders def getNextOrder(self, unit): try: orders = se...
<commit_before>class UnitOrders(object): def __init__(self): self.orders = {} def giveOrders(self, unit, orders): if orders is not None and not isinstance(orders, list): orders = list(orders) self.orders[unit] = orders def getNextOrder(self, unit): try: ...
class UnitOrders(object): def __init__(self): self.orders = {} def giveOrders(self, unit, orders): if orders is not None and not isinstance(orders, list): orders = list(orders) self.orders[unit] = orders def getNextOrder(self, unit): try: orders = se...
class UnitOrders(object): def __init__(self): self.orders = {} def giveOrders(self, unit, orders): if orders is not None and not isinstance(orders, list): orders = list(orders) self.orders[unit] = orders def getNextOrder(self, unit): try: return self...
<commit_before>class UnitOrders(object): def __init__(self): self.orders = {} def giveOrders(self, unit, orders): if orders is not None and not isinstance(orders, list): orders = list(orders) self.orders[unit] = orders def getNextOrder(self, unit): try: ...
74b03f3d47011bad6129f8ccfe466a4b28d2338a
troposphere/workspaces.py
troposphere/workspaces.py
# Copyright (c) 2015, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. from . import AWSObject from .validators import boolean class Workspace(AWSObject): resource_type = "AWS::WorkSpaces::Workspace" props = { 'BundleId': (basestring, True), 'DirectoryI...
# Copyright (c) 2015, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. from . import AWSObject, AWSProperty, Tags from .validators import boolean, integer class WorkspaceProperties(AWSProperty): props = { 'ComputeTypeName': (basestring, False), 'RootVolumeSi...
Add Tags and WorkspaceProperties to WorkSpaces::Workspace
Add Tags and WorkspaceProperties to WorkSpaces::Workspace
Python
bsd-2-clause
johnctitus/troposphere,cloudtools/troposphere,johnctitus/troposphere,pas256/troposphere,pas256/troposphere,cloudtools/troposphere,ikben/troposphere,ikben/troposphere
# Copyright (c) 2015, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. from . import AWSObject from .validators import boolean class Workspace(AWSObject): resource_type = "AWS::WorkSpaces::Workspace" props = { 'BundleId': (basestring, True), 'DirectoryI...
# Copyright (c) 2015, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. from . import AWSObject, AWSProperty, Tags from .validators import boolean, integer class WorkspaceProperties(AWSProperty): props = { 'ComputeTypeName': (basestring, False), 'RootVolumeSi...
<commit_before># Copyright (c) 2015, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. from . import AWSObject from .validators import boolean class Workspace(AWSObject): resource_type = "AWS::WorkSpaces::Workspace" props = { 'BundleId': (basestring, True), ...
# Copyright (c) 2015, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. from . import AWSObject, AWSProperty, Tags from .validators import boolean, integer class WorkspaceProperties(AWSProperty): props = { 'ComputeTypeName': (basestring, False), 'RootVolumeSi...
# Copyright (c) 2015, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. from . import AWSObject from .validators import boolean class Workspace(AWSObject): resource_type = "AWS::WorkSpaces::Workspace" props = { 'BundleId': (basestring, True), 'DirectoryI...
<commit_before># Copyright (c) 2015, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. from . import AWSObject from .validators import boolean class Workspace(AWSObject): resource_type = "AWS::WorkSpaces::Workspace" props = { 'BundleId': (basestring, True), ...
0218edee60a56996d97fbaa7e35f0c695bf5e3a9
src/hpp/utils.py
src/hpp/utils.py
# Copyright (c) 2020, CNRS # Authors: Guilhem Saurel <guilhem.saurel@laas.fr> import os import subprocess import time import hpp.corbaserver try: from subprocess import DEVNULL, run except ImportError: # Python2 fallback DEVNULL = os.open(os.devnull, os.O_RDWR) def run(*args): subprocess.Popen(*...
# Copyright (c) 2020, CNRS # Authors: Guilhem Saurel <guilhem.saurel@laas.fr> import os import subprocess import time import hpp.corbaserver try: from subprocess import DEVNULL, run except ImportError: # Python2 fallback DEVNULL = os.open(os.devnull, os.O_RDWR) def run(*args): subprocess.Popen(*...
Add sleep after shutting down hppcorbaserver in ServerManager
Add sleep after shutting down hppcorbaserver in ServerManager Co-authored-by: Joseph Mirabel <c794dc978753694c40f4d5fd4b8c12595a76e068@gmail.com>
Python
bsd-2-clause
humanoid-path-planner/hpp-corbaserver,humanoid-path-planner/hpp-corbaserver
# Copyright (c) 2020, CNRS # Authors: Guilhem Saurel <guilhem.saurel@laas.fr> import os import subprocess import time import hpp.corbaserver try: from subprocess import DEVNULL, run except ImportError: # Python2 fallback DEVNULL = os.open(os.devnull, os.O_RDWR) def run(*args): subprocess.Popen(*...
# Copyright (c) 2020, CNRS # Authors: Guilhem Saurel <guilhem.saurel@laas.fr> import os import subprocess import time import hpp.corbaserver try: from subprocess import DEVNULL, run except ImportError: # Python2 fallback DEVNULL = os.open(os.devnull, os.O_RDWR) def run(*args): subprocess.Popen(*...
<commit_before># Copyright (c) 2020, CNRS # Authors: Guilhem Saurel <guilhem.saurel@laas.fr> import os import subprocess import time import hpp.corbaserver try: from subprocess import DEVNULL, run except ImportError: # Python2 fallback DEVNULL = os.open(os.devnull, os.O_RDWR) def run(*args): sub...
# Copyright (c) 2020, CNRS # Authors: Guilhem Saurel <guilhem.saurel@laas.fr> import os import subprocess import time import hpp.corbaserver try: from subprocess import DEVNULL, run except ImportError: # Python2 fallback DEVNULL = os.open(os.devnull, os.O_RDWR) def run(*args): subprocess.Popen(*...
# Copyright (c) 2020, CNRS # Authors: Guilhem Saurel <guilhem.saurel@laas.fr> import os import subprocess import time import hpp.corbaserver try: from subprocess import DEVNULL, run except ImportError: # Python2 fallback DEVNULL = os.open(os.devnull, os.O_RDWR) def run(*args): subprocess.Popen(*...
<commit_before># Copyright (c) 2020, CNRS # Authors: Guilhem Saurel <guilhem.saurel@laas.fr> import os import subprocess import time import hpp.corbaserver try: from subprocess import DEVNULL, run except ImportError: # Python2 fallback DEVNULL = os.open(os.devnull, os.O_RDWR) def run(*args): sub...
cfa3851b83e8c13ed1bb553eced344d162c05dfb
singleuser/user-config.py
singleuser/user-config.py
import os mylang = 'test' family = 'wikipedia' custom_path = os.path.expanduser('~/user-config.py') if os.path.exists(custom_path): with open(custom_path, 'r') as f: variables = globals() # Do not pass in variables we do not want users to change for var in ['usernames', 'sysopnames']: ...
import os mylang = 'test' family = 'wikipedia' custom_path = os.path.expanduser('~/user-config.py') if os.path.exists(custom_path): with open(custom_path, 'r') as f: exec(compile(f.read(), custom_path, 'exec'), globals()) del f # Clean up temp variables, since pwb issues a warning otherwise # to hel...
Revert "Do not allow easy setting of username to something else"
Revert "Do not allow easy setting of username to something else" This removes the usernames completely, making it fail when we try to set it later. This reverts commit b49967ad58c520279a244a15ed81bca5453b923e.
Python
mit
yuvipanda/paws,yuvipanda/paws
import os mylang = 'test' family = 'wikipedia' custom_path = os.path.expanduser('~/user-config.py') if os.path.exists(custom_path): with open(custom_path, 'r') as f: variables = globals() # Do not pass in variables we do not want users to change for var in ['usernames', 'sysopnames']: ...
import os mylang = 'test' family = 'wikipedia' custom_path = os.path.expanduser('~/user-config.py') if os.path.exists(custom_path): with open(custom_path, 'r') as f: exec(compile(f.read(), custom_path, 'exec'), globals()) del f # Clean up temp variables, since pwb issues a warning otherwise # to hel...
<commit_before>import os mylang = 'test' family = 'wikipedia' custom_path = os.path.expanduser('~/user-config.py') if os.path.exists(custom_path): with open(custom_path, 'r') as f: variables = globals() # Do not pass in variables we do not want users to change for var in ['usernames', 'sy...
import os mylang = 'test' family = 'wikipedia' custom_path = os.path.expanduser('~/user-config.py') if os.path.exists(custom_path): with open(custom_path, 'r') as f: exec(compile(f.read(), custom_path, 'exec'), globals()) del f # Clean up temp variables, since pwb issues a warning otherwise # to hel...
import os mylang = 'test' family = 'wikipedia' custom_path = os.path.expanduser('~/user-config.py') if os.path.exists(custom_path): with open(custom_path, 'r') as f: variables = globals() # Do not pass in variables we do not want users to change for var in ['usernames', 'sysopnames']: ...
<commit_before>import os mylang = 'test' family = 'wikipedia' custom_path = os.path.expanduser('~/user-config.py') if os.path.exists(custom_path): with open(custom_path, 'r') as f: variables = globals() # Do not pass in variables we do not want users to change for var in ['usernames', 'sy...
9031514ee6618646a35c4ad5910c9d3d5a92520e
tests/system/conftest.py
tests/system/conftest.py
import pytest import socket import struct from threading import Thread from server import app @pytest.fixture(autouse=True, scope="module") def server(request): t = Thread(target=app.serve_forever) t.start() def fin(): app.shutdown() app.server_close() t.join() request.addfi...
import pytest import socket import struct from threading import Thread from .server import app @pytest.fixture(autouse=True, scope="module") def server(request): t = Thread(target=app.serve_forever) t.start() def fin(): app.shutdown() app.server_close() t.join() request.addf...
Fix import error in test suite so tests pass in Python 3.3+.
Fix import error in test suite so tests pass in Python 3.3+.
Python
mpl-2.0
AdvancedClimateSystems/python-modbus,AdvancedClimateSystems/uModbus
import pytest import socket import struct from threading import Thread from server import app @pytest.fixture(autouse=True, scope="module") def server(request): t = Thread(target=app.serve_forever) t.start() def fin(): app.shutdown() app.server_close() t.join() request.addfi...
import pytest import socket import struct from threading import Thread from .server import app @pytest.fixture(autouse=True, scope="module") def server(request): t = Thread(target=app.serve_forever) t.start() def fin(): app.shutdown() app.server_close() t.join() request.addf...
<commit_before>import pytest import socket import struct from threading import Thread from server import app @pytest.fixture(autouse=True, scope="module") def server(request): t = Thread(target=app.serve_forever) t.start() def fin(): app.shutdown() app.server_close() t.join() ...
import pytest import socket import struct from threading import Thread from .server import app @pytest.fixture(autouse=True, scope="module") def server(request): t = Thread(target=app.serve_forever) t.start() def fin(): app.shutdown() app.server_close() t.join() request.addf...
import pytest import socket import struct from threading import Thread from server import app @pytest.fixture(autouse=True, scope="module") def server(request): t = Thread(target=app.serve_forever) t.start() def fin(): app.shutdown() app.server_close() t.join() request.addfi...
<commit_before>import pytest import socket import struct from threading import Thread from server import app @pytest.fixture(autouse=True, scope="module") def server(request): t = Thread(target=app.serve_forever) t.start() def fin(): app.shutdown() app.server_close() t.join() ...
91d613ace34bf8f50a86ec3464612af561d398c4
tests/test_boto_store.py
tests/test_boto_store.py
#!/usr/bin/env python import os from tempdir import TempDir import pytest boto = pytest.importorskip('boto') from simplekv.net.botostore import BotoStore from basic_store import BasicStore from url_store import UrlStore from bucket_manager import boto_credentials, boto_bucket @pytest.fixture(params=boto_credentia...
#!/usr/bin/env python import os from tempdir import TempDir import pytest boto = pytest.importorskip('boto') from simplekv.net.botostore import BotoStore from basic_store import BasicStore from url_store import UrlStore from bucket_manager import boto_credentials, boto_bucket @pytest.fixture(params=boto_credentia...
Fix another boto /dev/null testing error.
Fix another boto /dev/null testing error.
Python
mit
karteek/simplekv,fmarczin/simplekv,fmarczin/simplekv,mbr/simplekv,mbr/simplekv,karteek/simplekv
#!/usr/bin/env python import os from tempdir import TempDir import pytest boto = pytest.importorskip('boto') from simplekv.net.botostore import BotoStore from basic_store import BasicStore from url_store import UrlStore from bucket_manager import boto_credentials, boto_bucket @pytest.fixture(params=boto_credentia...
#!/usr/bin/env python import os from tempdir import TempDir import pytest boto = pytest.importorskip('boto') from simplekv.net.botostore import BotoStore from basic_store import BasicStore from url_store import UrlStore from bucket_manager import boto_credentials, boto_bucket @pytest.fixture(params=boto_credentia...
<commit_before>#!/usr/bin/env python import os from tempdir import TempDir import pytest boto = pytest.importorskip('boto') from simplekv.net.botostore import BotoStore from basic_store import BasicStore from url_store import UrlStore from bucket_manager import boto_credentials, boto_bucket @pytest.fixture(params...
#!/usr/bin/env python import os from tempdir import TempDir import pytest boto = pytest.importorskip('boto') from simplekv.net.botostore import BotoStore from basic_store import BasicStore from url_store import UrlStore from bucket_manager import boto_credentials, boto_bucket @pytest.fixture(params=boto_credentia...
#!/usr/bin/env python import os from tempdir import TempDir import pytest boto = pytest.importorskip('boto') from simplekv.net.botostore import BotoStore from basic_store import BasicStore from url_store import UrlStore from bucket_manager import boto_credentials, boto_bucket @pytest.fixture(params=boto_credentia...
<commit_before>#!/usr/bin/env python import os from tempdir import TempDir import pytest boto = pytest.importorskip('boto') from simplekv.net.botostore import BotoStore from basic_store import BasicStore from url_store import UrlStore from bucket_manager import boto_credentials, boto_bucket @pytest.fixture(params...
05b54e3ac66da81733e8bb04eb949dec4e6be904
lamana/lt_exceptions.py
lamana/lt_exceptions.py
# ----------------------------------------------------------------------------- '''General classes for a custom exceptions.''' class Error(Exception): pass class FormatError(Error): '''Associate with geo_string formatting.''' pass class InvalidError(Error): '''Associate with invalid, impossible ge...
# ----------------------------------------------------------------------------- '''General classes for a custom exceptions.''' class Error(Exception): pass class FormatError(Error): '''Associated with geo_string formatting.''' pass #class ValidationError(Error): # '''Associate with invalid, impossi...
Add and deprecate custom expections
Add and deprecate custom expections
Python
bsd-3-clause
par2/lamana
# ----------------------------------------------------------------------------- '''General classes for a custom exceptions.''' class Error(Exception): pass class FormatError(Error): '''Associate with geo_string formatting.''' pass class InvalidError(Error): '''Associate with invalid, impossible ge...
# ----------------------------------------------------------------------------- '''General classes for a custom exceptions.''' class Error(Exception): pass class FormatError(Error): '''Associated with geo_string formatting.''' pass #class ValidationError(Error): # '''Associate with invalid, impossi...
<commit_before># ----------------------------------------------------------------------------- '''General classes for a custom exceptions.''' class Error(Exception): pass class FormatError(Error): '''Associate with geo_string formatting.''' pass class InvalidError(Error): '''Associate with invalid...
# ----------------------------------------------------------------------------- '''General classes for a custom exceptions.''' class Error(Exception): pass class FormatError(Error): '''Associated with geo_string formatting.''' pass #class ValidationError(Error): # '''Associate with invalid, impossi...
# ----------------------------------------------------------------------------- '''General classes for a custom exceptions.''' class Error(Exception): pass class FormatError(Error): '''Associate with geo_string formatting.''' pass class InvalidError(Error): '''Associate with invalid, impossible ge...
<commit_before># ----------------------------------------------------------------------------- '''General classes for a custom exceptions.''' class Error(Exception): pass class FormatError(Error): '''Associate with geo_string formatting.''' pass class InvalidError(Error): '''Associate with invalid...
b180c7e3907df74252ee3270468a768036dc4467
tests/test_timeseries.py
tests/test_timeseries.py
import unittest from datetime import datetime, timedelta import sys sys.path.append(r"..") from daymetpy import download_Daymet class TimeseriesTest(unittest.TestCase): def setUp(self): pass def test_ornl_df(self): ornl_lat, ornl_long = 35.9313167, -84.3104124 df = down...
import unittest from datetime import datetime, timedelta import sys sys.path.append(r"../..") from daymetpy import daymet_timeseries class TimeseriesTest(unittest.TestCase): def setUp(self): pass def test_ornl_df(self): ornl_lat, ornl_long = 35.9313167, -84.3104124 df =...
Update test to new package structure
Update test to new package structure
Python
agpl-3.0
khufkens/daymetpy
import unittest from datetime import datetime, timedelta import sys sys.path.append(r"..") from daymetpy import download_Daymet class TimeseriesTest(unittest.TestCase): def setUp(self): pass def test_ornl_df(self): ornl_lat, ornl_long = 35.9313167, -84.3104124 df = down...
import unittest from datetime import datetime, timedelta import sys sys.path.append(r"../..") from daymetpy import daymet_timeseries class TimeseriesTest(unittest.TestCase): def setUp(self): pass def test_ornl_df(self): ornl_lat, ornl_long = 35.9313167, -84.3104124 df =...
<commit_before>import unittest from datetime import datetime, timedelta import sys sys.path.append(r"..") from daymetpy import download_Daymet class TimeseriesTest(unittest.TestCase): def setUp(self): pass def test_ornl_df(self): ornl_lat, ornl_long = 35.9313167, -84.3104124 ...
import unittest from datetime import datetime, timedelta import sys sys.path.append(r"../..") from daymetpy import daymet_timeseries class TimeseriesTest(unittest.TestCase): def setUp(self): pass def test_ornl_df(self): ornl_lat, ornl_long = 35.9313167, -84.3104124 df =...
import unittest from datetime import datetime, timedelta import sys sys.path.append(r"..") from daymetpy import download_Daymet class TimeseriesTest(unittest.TestCase): def setUp(self): pass def test_ornl_df(self): ornl_lat, ornl_long = 35.9313167, -84.3104124 df = down...
<commit_before>import unittest from datetime import datetime, timedelta import sys sys.path.append(r"..") from daymetpy import download_Daymet class TimeseriesTest(unittest.TestCase): def setUp(self): pass def test_ornl_df(self): ornl_lat, ornl_long = 35.9313167, -84.3104124 ...
5d0be01926950fe4d693adec824aaed8495f3f65
rnacentral/rnacentral/local_settings_default.py
rnacentral/rnacentral/local_settings_default.py
""" Copyright [2009-2014] EMBL-European Bioinformatics Institute Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
""" Copyright [2009-2014] EMBL-European Bioinformatics Institute Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
Set a maximum database connection age, works in django >= 1.6
Set a maximum database connection age, works in django >= 1.6
Python
apache-2.0
RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode
""" Copyright [2009-2014] EMBL-European Bioinformatics Institute Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
""" Copyright [2009-2014] EMBL-European Bioinformatics Institute Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
<commit_before>""" Copyright [2009-2014] EMBL-European Bioinformatics Institute Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by appl...
""" Copyright [2009-2014] EMBL-European Bioinformatics Institute Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
""" Copyright [2009-2014] EMBL-European Bioinformatics Institute Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
<commit_before>""" Copyright [2009-2014] EMBL-European Bioinformatics Institute Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by appl...
2feda27b60874de513224256c553dfee32e1a982
tests/lexer/test_lexer.py
tests/lexer/test_lexer.py
import pytest from tests.infrastructure.test_utils import lexer_single from thinglang.lexer.tokens.indent import LexicalIndent from thinglang.lexer.values.identifier import Identifier from thinglang.lexer.values.inline_text import InlineString UNTERMINATED_GROUPS = 'hello"', '"hello', 'hello`', '`hello', '"hello`', '...
import pytest from tests.infrastructure.test_utils import lexer_single from thinglang.lexer.operators.comparison import LexicalEquals from thinglang.lexer.tokens.indent import LexicalIndent from thinglang.lexer.values.identifier import Identifier from thinglang.lexer.values.inline_text import InlineString UNTERMINATE...
Add test for string escaping
Add test for string escaping
Python
mit
ytanay/thinglang,ytanay/thinglang,ytanay/thinglang,ytanay/thinglang
import pytest from tests.infrastructure.test_utils import lexer_single from thinglang.lexer.tokens.indent import LexicalIndent from thinglang.lexer.values.identifier import Identifier from thinglang.lexer.values.inline_text import InlineString UNTERMINATED_GROUPS = 'hello"', '"hello', 'hello`', '`hello', '"hello`', '...
import pytest from tests.infrastructure.test_utils import lexer_single from thinglang.lexer.operators.comparison import LexicalEquals from thinglang.lexer.tokens.indent import LexicalIndent from thinglang.lexer.values.identifier import Identifier from thinglang.lexer.values.inline_text import InlineString UNTERMINATE...
<commit_before>import pytest from tests.infrastructure.test_utils import lexer_single from thinglang.lexer.tokens.indent import LexicalIndent from thinglang.lexer.values.identifier import Identifier from thinglang.lexer.values.inline_text import InlineString UNTERMINATED_GROUPS = 'hello"', '"hello', 'hello`', '`hello...
import pytest from tests.infrastructure.test_utils import lexer_single from thinglang.lexer.operators.comparison import LexicalEquals from thinglang.lexer.tokens.indent import LexicalIndent from thinglang.lexer.values.identifier import Identifier from thinglang.lexer.values.inline_text import InlineString UNTERMINATE...
import pytest from tests.infrastructure.test_utils import lexer_single from thinglang.lexer.tokens.indent import LexicalIndent from thinglang.lexer.values.identifier import Identifier from thinglang.lexer.values.inline_text import InlineString UNTERMINATED_GROUPS = 'hello"', '"hello', 'hello`', '`hello', '"hello`', '...
<commit_before>import pytest from tests.infrastructure.test_utils import lexer_single from thinglang.lexer.tokens.indent import LexicalIndent from thinglang.lexer.values.identifier import Identifier from thinglang.lexer.values.inline_text import InlineString UNTERMINATED_GROUPS = 'hello"', '"hello', 'hello`', '`hello...
08d42200150f60e7d629911ee96a12021ae99206
build_yaml_macros.py
build_yaml_macros.py
import sublime import sublime_plugin import os from os import path from .src.build import build_yaml_macros class BuildYamlMacrosCommand(sublime_plugin.WindowCommand): def run(self, working_dir=None): if working_dir: os.chdir(working_dir) view = self.window.active_view(); sou...
import sublime import sublime_plugin import os from os import path from .src.build import build_yaml_macros class BuildYamlMacrosCommand(sublime_plugin.WindowCommand): def run(self, working_dir=None): if working_dir: os.chdir(working_dir) view = self.window.active_view(); sou...
Use with context manager to handle file access
Use with context manager to handle file access Currently, after the build completes the output file is not closed, and so it remains locked and is unable to be edited by other processes.
Python
mit
Thom1729/YAML-Macros
import sublime import sublime_plugin import os from os import path from .src.build import build_yaml_macros class BuildYamlMacrosCommand(sublime_plugin.WindowCommand): def run(self, working_dir=None): if working_dir: os.chdir(working_dir) view = self.window.active_view(); sou...
import sublime import sublime_plugin import os from os import path from .src.build import build_yaml_macros class BuildYamlMacrosCommand(sublime_plugin.WindowCommand): def run(self, working_dir=None): if working_dir: os.chdir(working_dir) view = self.window.active_view(); sou...
<commit_before>import sublime import sublime_plugin import os from os import path from .src.build import build_yaml_macros class BuildYamlMacrosCommand(sublime_plugin.WindowCommand): def run(self, working_dir=None): if working_dir: os.chdir(working_dir) view = self.window.active_view...
import sublime import sublime_plugin import os from os import path from .src.build import build_yaml_macros class BuildYamlMacrosCommand(sublime_plugin.WindowCommand): def run(self, working_dir=None): if working_dir: os.chdir(working_dir) view = self.window.active_view(); sou...
import sublime import sublime_plugin import os from os import path from .src.build import build_yaml_macros class BuildYamlMacrosCommand(sublime_plugin.WindowCommand): def run(self, working_dir=None): if working_dir: os.chdir(working_dir) view = self.window.active_view(); sou...
<commit_before>import sublime import sublime_plugin import os from os import path from .src.build import build_yaml_macros class BuildYamlMacrosCommand(sublime_plugin.WindowCommand): def run(self, working_dir=None): if working_dir: os.chdir(working_dir) view = self.window.active_view...
9a8544eaccde1420e6cbac7b4c5115155d6402f3
django_docutils/__about__.py
django_docutils/__about__.py
__title__ = 'django-docutils' __package_name__ = 'django_docutils' __description__ = 'Documentation Utilities (Docutils, reStructuredText) for django.' __version__ = '0.4.0' __author__ = 'Tony Narlock' __email__ = 'tony@git-pull.com' __license__ = 'BSD' __copyright__ = 'Copyright 2013-2015 Tony Narlock'
__title__ = 'django-docutils' __package_name__ = 'django_docutils' __description__ = 'Documentation Utilities (Docutils, reStructuredText) for django.' __version__ = '0.4.0' __author__ = 'Tony Narlock' __github__ = 'https://github.com/tony/django-docutils' __pypi__ = 'https://pypi.org/project/django-docutils/' __email_...
Add github + pypi to metadata
Add github + pypi to metadata
Python
mit
tony/django-docutils,tony/django-docutils
__title__ = 'django-docutils' __package_name__ = 'django_docutils' __description__ = 'Documentation Utilities (Docutils, reStructuredText) for django.' __version__ = '0.4.0' __author__ = 'Tony Narlock' __email__ = 'tony@git-pull.com' __license__ = 'BSD' __copyright__ = 'Copyright 2013-2015 Tony Narlock' Add github + py...
__title__ = 'django-docutils' __package_name__ = 'django_docutils' __description__ = 'Documentation Utilities (Docutils, reStructuredText) for django.' __version__ = '0.4.0' __author__ = 'Tony Narlock' __github__ = 'https://github.com/tony/django-docutils' __pypi__ = 'https://pypi.org/project/django-docutils/' __email_...
<commit_before>__title__ = 'django-docutils' __package_name__ = 'django_docutils' __description__ = 'Documentation Utilities (Docutils, reStructuredText) for django.' __version__ = '0.4.0' __author__ = 'Tony Narlock' __email__ = 'tony@git-pull.com' __license__ = 'BSD' __copyright__ = 'Copyright 2013-2015 Tony Narlock' ...
__title__ = 'django-docutils' __package_name__ = 'django_docutils' __description__ = 'Documentation Utilities (Docutils, reStructuredText) for django.' __version__ = '0.4.0' __author__ = 'Tony Narlock' __github__ = 'https://github.com/tony/django-docutils' __pypi__ = 'https://pypi.org/project/django-docutils/' __email_...
__title__ = 'django-docutils' __package_name__ = 'django_docutils' __description__ = 'Documentation Utilities (Docutils, reStructuredText) for django.' __version__ = '0.4.0' __author__ = 'Tony Narlock' __email__ = 'tony@git-pull.com' __license__ = 'BSD' __copyright__ = 'Copyright 2013-2015 Tony Narlock' Add github + py...
<commit_before>__title__ = 'django-docutils' __package_name__ = 'django_docutils' __description__ = 'Documentation Utilities (Docutils, reStructuredText) for django.' __version__ = '0.4.0' __author__ = 'Tony Narlock' __email__ = 'tony@git-pull.com' __license__ = 'BSD' __copyright__ = 'Copyright 2013-2015 Tony Narlock' ...
145749cc7ee4c67a494f0287850597740b7f002a
modules/module_karma.py
modules/module_karma.py
import re import sqlite3 def do_karma(bot, user, channel, karma): if karma[1] == '++': k = 1 else: k = -1 conn = sqlite3.connect('karma.db') c = conn.cursor() t = (karma[0],) c.execute('select * from karma where word=?', t) res = c.fetchone() if res != None: u ...
import re import sqlite3 def do_karma(bot, user, channel, karma): if karma[1] == '++': k = 1 else: k = -1 conn = sqlite3.connect('karma.db') c = conn.cursor() t = (karma[0],) c.execute('select * from karma where word=?', t) res = c.fetchone() if res != None: u ...
Add .tolower() when adding to DB to avoid potential issues
Add .tolower() when adding to DB to avoid potential issues
Python
bsd-3-clause
nigeljonez/newpyfibot
import re import sqlite3 def do_karma(bot, user, channel, karma): if karma[1] == '++': k = 1 else: k = -1 conn = sqlite3.connect('karma.db') c = conn.cursor() t = (karma[0],) c.execute('select * from karma where word=?', t) res = c.fetchone() if res != None: u ...
import re import sqlite3 def do_karma(bot, user, channel, karma): if karma[1] == '++': k = 1 else: k = -1 conn = sqlite3.connect('karma.db') c = conn.cursor() t = (karma[0],) c.execute('select * from karma where word=?', t) res = c.fetchone() if res != None: u ...
<commit_before>import re import sqlite3 def do_karma(bot, user, channel, karma): if karma[1] == '++': k = 1 else: k = -1 conn = sqlite3.connect('karma.db') c = conn.cursor() t = (karma[0],) c.execute('select * from karma where word=?', t) res = c.fetchone() if res != N...
import re import sqlite3 def do_karma(bot, user, channel, karma): if karma[1] == '++': k = 1 else: k = -1 conn = sqlite3.connect('karma.db') c = conn.cursor() t = (karma[0],) c.execute('select * from karma where word=?', t) res = c.fetchone() if res != None: u ...
import re import sqlite3 def do_karma(bot, user, channel, karma): if karma[1] == '++': k = 1 else: k = -1 conn = sqlite3.connect('karma.db') c = conn.cursor() t = (karma[0],) c.execute('select * from karma where word=?', t) res = c.fetchone() if res != None: u ...
<commit_before>import re import sqlite3 def do_karma(bot, user, channel, karma): if karma[1] == '++': k = 1 else: k = -1 conn = sqlite3.connect('karma.db') c = conn.cursor() t = (karma[0],) c.execute('select * from karma where word=?', t) res = c.fetchone() if res != N...
c491759a0f71479b4faa68a747ff149b78b109e0
tests/test_observatory.py
tests/test_observatory.py
""" test_heavy.py BlimPy """ from blimpy.ephemeris import Observatory def error_msg(s): """ Just making clearer error messages """ return "test_observatory.py: " + s def test_observatory_construction(): """ Constructor test """ obs = Observatory(telescope_id=0) assert obs.get_telescope_name() !=...
""" test_heavy.py BlimPy """ from blimpy.ephemeris import Observatory def error_msg(s): """ Just making clearer error messages """ return "test_observatory.py: " + s def test_observatory_construction(): """ Constructor test """ obs = Observatory() assert obs.get_telescope_name() != "Fake", error...
Increase test coverage for ephemris
Increase test coverage for ephemris
Python
bsd-3-clause
UCBerkeleySETI/blimpy,UCBerkeleySETI/blimpy
""" test_heavy.py BlimPy """ from blimpy.ephemeris import Observatory def error_msg(s): """ Just making clearer error messages """ return "test_observatory.py: " + s def test_observatory_construction(): """ Constructor test """ obs = Observatory(telescope_id=0) assert obs.get_telescope_name() !=...
""" test_heavy.py BlimPy """ from blimpy.ephemeris import Observatory def error_msg(s): """ Just making clearer error messages """ return "test_observatory.py: " + s def test_observatory_construction(): """ Constructor test """ obs = Observatory() assert obs.get_telescope_name() != "Fake", error...
<commit_before>""" test_heavy.py BlimPy """ from blimpy.ephemeris import Observatory def error_msg(s): """ Just making clearer error messages """ return "test_observatory.py: " + s def test_observatory_construction(): """ Constructor test """ obs = Observatory(telescope_id=0) assert obs.get_tele...
""" test_heavy.py BlimPy """ from blimpy.ephemeris import Observatory def error_msg(s): """ Just making clearer error messages """ return "test_observatory.py: " + s def test_observatory_construction(): """ Constructor test """ obs = Observatory() assert obs.get_telescope_name() != "Fake", error...
""" test_heavy.py BlimPy """ from blimpy.ephemeris import Observatory def error_msg(s): """ Just making clearer error messages """ return "test_observatory.py: " + s def test_observatory_construction(): """ Constructor test """ obs = Observatory(telescope_id=0) assert obs.get_telescope_name() !=...
<commit_before>""" test_heavy.py BlimPy """ from blimpy.ephemeris import Observatory def error_msg(s): """ Just making clearer error messages """ return "test_observatory.py: " + s def test_observatory_construction(): """ Constructor test """ obs = Observatory(telescope_id=0) assert obs.get_tele...
5683aa0d2674214050ed1ea97e528ba39e39b126
cosmos/cli.py
cosmos/cli.py
import os import json import click from cosmos import Data def validate_filename(ctx, param, value): if not os.path.exists(value): print('No such directory: {}'.format(value)) ctx.exit() ext = os.path.splitext(value)[1] if ext not in ['.json', '.geojson']: raise click.BadParamete...
import os import json import click from cosmos import Data def validate_filename(ctx, param, value): if os.path.dirname(value) and not os.path.isdir(os.path.dirname(value)): print('No such directory: {}'.format(value)) ctx.exit() ext = os.path.splitext(value)[1] if ext not in ['.json', '...
Fix for checking directory and short params.
Fix for checking directory and short params.
Python
mit
astrosat/cOSMos
import os import json import click from cosmos import Data def validate_filename(ctx, param, value): if not os.path.exists(value): print('No such directory: {}'.format(value)) ctx.exit() ext = os.path.splitext(value)[1] if ext not in ['.json', '.geojson']: raise click.BadParamete...
import os import json import click from cosmos import Data def validate_filename(ctx, param, value): if os.path.dirname(value) and not os.path.isdir(os.path.dirname(value)): print('No such directory: {}'.format(value)) ctx.exit() ext = os.path.splitext(value)[1] if ext not in ['.json', '...
<commit_before>import os import json import click from cosmos import Data def validate_filename(ctx, param, value): if not os.path.exists(value): print('No such directory: {}'.format(value)) ctx.exit() ext = os.path.splitext(value)[1] if ext not in ['.json', '.geojson']: raise cl...
import os import json import click from cosmos import Data def validate_filename(ctx, param, value): if os.path.dirname(value) and not os.path.isdir(os.path.dirname(value)): print('No such directory: {}'.format(value)) ctx.exit() ext = os.path.splitext(value)[1] if ext not in ['.json', '...
import os import json import click from cosmos import Data def validate_filename(ctx, param, value): if not os.path.exists(value): print('No such directory: {}'.format(value)) ctx.exit() ext = os.path.splitext(value)[1] if ext not in ['.json', '.geojson']: raise click.BadParamete...
<commit_before>import os import json import click from cosmos import Data def validate_filename(ctx, param, value): if not os.path.exists(value): print('No such directory: {}'.format(value)) ctx.exit() ext = os.path.splitext(value)[1] if ext not in ['.json', '.geojson']: raise cl...
e4fe21b1e1366a1676d2129575ee7c19f6fc6547
models.py
models.py
class Color(object): def __init__(self, r, g, b): self.r = r self.g = g self.b = b class Line(object): def __init__(self, name, api_code, bg_color, fg_color): self.name = name self.api_code = api_code self.bg_color = bg_color self.fg_color = fg_color ...
class Color(object): def __init__(self, r, g, b): self.r = r self.g = g self.b = b def __repr__(self): return '%s,%s,%s' % (self.r, self.g, self.b) __unicode__ = __repr__ class Line(object): def __init__(self, name, api_code, bg_color, fg_color): self.name = na...
Add string representation for colors
Add string representation for colors
Python
mit
kirberich/tube_status
class Color(object): def __init__(self, r, g, b): self.r = r self.g = g self.b = b class Line(object): def __init__(self, name, api_code, bg_color, fg_color): self.name = name self.api_code = api_code self.bg_color = bg_color self.fg_color = fg_color ...
class Color(object): def __init__(self, r, g, b): self.r = r self.g = g self.b = b def __repr__(self): return '%s,%s,%s' % (self.r, self.g, self.b) __unicode__ = __repr__ class Line(object): def __init__(self, name, api_code, bg_color, fg_color): self.name = na...
<commit_before>class Color(object): def __init__(self, r, g, b): self.r = r self.g = g self.b = b class Line(object): def __init__(self, name, api_code, bg_color, fg_color): self.name = name self.api_code = api_code self.bg_color = bg_color self.fg_color...
class Color(object): def __init__(self, r, g, b): self.r = r self.g = g self.b = b def __repr__(self): return '%s,%s,%s' % (self.r, self.g, self.b) __unicode__ = __repr__ class Line(object): def __init__(self, name, api_code, bg_color, fg_color): self.name = na...
class Color(object): def __init__(self, r, g, b): self.r = r self.g = g self.b = b class Line(object): def __init__(self, name, api_code, bg_color, fg_color): self.name = name self.api_code = api_code self.bg_color = bg_color self.fg_color = fg_color ...
<commit_before>class Color(object): def __init__(self, r, g, b): self.r = r self.g = g self.b = b class Line(object): def __init__(self, name, api_code, bg_color, fg_color): self.name = name self.api_code = api_code self.bg_color = bg_color self.fg_color...
e87e5b2fb0947d280c38a46f6f6e94808be9fa7a
txircd/modules/cmode_p.py
txircd/modules/cmode_p.py
from txircd.modbase import Mode class PrivateMode(Mode): def listOutput(self, command, data): if command != "LIST": return data cdata = data["cdata"] if "p" in cdata["channel"].mode and cdata["channel"].name not in data["user"].channels: cdata["name"] = "*" ...
from txircd.modbase import Mode class PrivateMode(Mode): def listOutput(self, command, data): if command != "LIST": return data if "cdata" not in data: return data cdata = data["cdata"] if "p" in cdata["channel"].mode and cdata["channel"].name not in data["us...
Fix LIST crashing on certain input
Fix LIST crashing on certain input
Python
bsd-3-clause
Heufneutje/txircd,ElementalAlchemist/txircd,DesertBus/txircd
from txircd.modbase import Mode class PrivateMode(Mode): def listOutput(self, command, data): if command != "LIST": return data cdata = data["cdata"] if "p" in cdata["channel"].mode and cdata["channel"].name not in data["user"].channels: cdata["name"] = "*" ...
from txircd.modbase import Mode class PrivateMode(Mode): def listOutput(self, command, data): if command != "LIST": return data if "cdata" not in data: return data cdata = data["cdata"] if "p" in cdata["channel"].mode and cdata["channel"].name not in data["us...
<commit_before>from txircd.modbase import Mode class PrivateMode(Mode): def listOutput(self, command, data): if command != "LIST": return data cdata = data["cdata"] if "p" in cdata["channel"].mode and cdata["channel"].name not in data["user"].channels: cdata["name"] ...
from txircd.modbase import Mode class PrivateMode(Mode): def listOutput(self, command, data): if command != "LIST": return data if "cdata" not in data: return data cdata = data["cdata"] if "p" in cdata["channel"].mode and cdata["channel"].name not in data["us...
from txircd.modbase import Mode class PrivateMode(Mode): def listOutput(self, command, data): if command != "LIST": return data cdata = data["cdata"] if "p" in cdata["channel"].mode and cdata["channel"].name not in data["user"].channels: cdata["name"] = "*" ...
<commit_before>from txircd.modbase import Mode class PrivateMode(Mode): def listOutput(self, command, data): if command != "LIST": return data cdata = data["cdata"] if "p" in cdata["channel"].mode and cdata["channel"].name not in data["user"].channels: cdata["name"] ...
d2da0b71c36f32305ef55e2cbbf2041eb7b06cf6
Project/tools/lib.py
Project/tools/lib.py
# # lib.py: utility functions for the Motebopok handlers # """This file takes the difficulties out of working with directories, and it also reduces clutter in at least one program.""" import os def newer(file1, file2): file1_creation = os.stat(file1).st_mtime file2_creation = os.stat(file2).st_mtime retur...
# # lib.py: utility functions for the Motebopok handlers # """This file takes the difficulties out of working with directories, and it also reduces clutter in at least one program.""" import os def newer(file1, file2): file1_modification = os.stat(file1).st_mtime file2_modification = os.stat(file2).st_mtime ...
Use modification, not creation times to determine relative newness.
Use modification, not creation times to determine relative newness.
Python
mit
holdenweb/nbtools,holdenweb/nbtools
# # lib.py: utility functions for the Motebopok handlers # """This file takes the difficulties out of working with directories, and it also reduces clutter in at least one program.""" import os def newer(file1, file2): file1_creation = os.stat(file1).st_mtime file2_creation = os.stat(file2).st_mtime retur...
# # lib.py: utility functions for the Motebopok handlers # """This file takes the difficulties out of working with directories, and it also reduces clutter in at least one program.""" import os def newer(file1, file2): file1_modification = os.stat(file1).st_mtime file2_modification = os.stat(file2).st_mtime ...
<commit_before># # lib.py: utility functions for the Motebopok handlers # """This file takes the difficulties out of working with directories, and it also reduces clutter in at least one program.""" import os def newer(file1, file2): file1_creation = os.stat(file1).st_mtime file2_creation = os.stat(file2).st_...
# # lib.py: utility functions for the Motebopok handlers # """This file takes the difficulties out of working with directories, and it also reduces clutter in at least one program.""" import os def newer(file1, file2): file1_modification = os.stat(file1).st_mtime file2_modification = os.stat(file2).st_mtime ...
# # lib.py: utility functions for the Motebopok handlers # """This file takes the difficulties out of working with directories, and it also reduces clutter in at least one program.""" import os def newer(file1, file2): file1_creation = os.stat(file1).st_mtime file2_creation = os.stat(file2).st_mtime retur...
<commit_before># # lib.py: utility functions for the Motebopok handlers # """This file takes the difficulties out of working with directories, and it also reduces clutter in at least one program.""" import os def newer(file1, file2): file1_creation = os.stat(file1).st_mtime file2_creation = os.stat(file2).st_...
87b051a4d97f54af16c37c118be654243c8b36cd
application.py
application.py
from paste.deploy import loadapp from waitress import serve from opreturnninja.config import config if __name__ == "__main__": app = loadapp('config:production.ini', relative_to='.') serve(app, host='0.0.0.0', port=config.PORT)
from paste.deploy import loadapp from waitress import serve from opreturnninja.config import config if __name__ == "__main__": print("Loading application.py") app = loadapp('config:production.ini', relative_to='.') serve(app, host='0.0.0.0', port=config.PORT)
Add a print statement; heroku not building :/
Add a print statement; heroku not building :/
Python
mit
XertroV/opreturn-ninja,XertroV/opreturn-ninja,XertroV/opreturn-ninja
from paste.deploy import loadapp from waitress import serve from opreturnninja.config import config if __name__ == "__main__": app = loadapp('config:production.ini', relative_to='.') serve(app, host='0.0.0.0', port=config.PORT) Add a print statement; heroku not building :/
from paste.deploy import loadapp from waitress import serve from opreturnninja.config import config if __name__ == "__main__": print("Loading application.py") app = loadapp('config:production.ini', relative_to='.') serve(app, host='0.0.0.0', port=config.PORT)
<commit_before>from paste.deploy import loadapp from waitress import serve from opreturnninja.config import config if __name__ == "__main__": app = loadapp('config:production.ini', relative_to='.') serve(app, host='0.0.0.0', port=config.PORT) <commit_msg>Add a print statement; heroku not building :/<commit_af...
from paste.deploy import loadapp from waitress import serve from opreturnninja.config import config if __name__ == "__main__": print("Loading application.py") app = loadapp('config:production.ini', relative_to='.') serve(app, host='0.0.0.0', port=config.PORT)
from paste.deploy import loadapp from waitress import serve from opreturnninja.config import config if __name__ == "__main__": app = loadapp('config:production.ini', relative_to='.') serve(app, host='0.0.0.0', port=config.PORT) Add a print statement; heroku not building :/from paste.deploy import loadapp from...
<commit_before>from paste.deploy import loadapp from waitress import serve from opreturnninja.config import config if __name__ == "__main__": app = loadapp('config:production.ini', relative_to='.') serve(app, host='0.0.0.0', port=config.PORT) <commit_msg>Add a print statement; heroku not building :/<commit_af...
89d6c81529d1f0f467a098934a670c57e463188f
cmcb/reddit.py
cmcb/reddit.py
import asyncio import functools import praw class AsyncRateRedditAPI: def __init__(self, client_id, client_secret, user_agent, username, password, loop=None): self._reddit = praw.Reddit( client_id=client_id, client_secret=client_secret, user_agent=user_agent, username...
import praw class AsyncRateRedditAPI: def __init__(self, client_id, client_secret, user_agent, username, password): self._reddit = praw.Reddit( client_id=client_id, client_secret=client_secret, user_agent=user_agent, username=username, password=password) async def...
Revert Reddit api to its synchonous state
Revert Reddit api to its synchonous state
Python
mit
festinuz/cmcb,festinuz/cmcb
import asyncio import functools import praw class AsyncRateRedditAPI: def __init__(self, client_id, client_secret, user_agent, username, password, loop=None): self._reddit = praw.Reddit( client_id=client_id, client_secret=client_secret, user_agent=user_agent, username...
import praw class AsyncRateRedditAPI: def __init__(self, client_id, client_secret, user_agent, username, password): self._reddit = praw.Reddit( client_id=client_id, client_secret=client_secret, user_agent=user_agent, username=username, password=password) async def...
<commit_before>import asyncio import functools import praw class AsyncRateRedditAPI: def __init__(self, client_id, client_secret, user_agent, username, password, loop=None): self._reddit = praw.Reddit( client_id=client_id, client_secret=client_secret, user_agent=user_...
import praw class AsyncRateRedditAPI: def __init__(self, client_id, client_secret, user_agent, username, password): self._reddit = praw.Reddit( client_id=client_id, client_secret=client_secret, user_agent=user_agent, username=username, password=password) async def...
import asyncio import functools import praw class AsyncRateRedditAPI: def __init__(self, client_id, client_secret, user_agent, username, password, loop=None): self._reddit = praw.Reddit( client_id=client_id, client_secret=client_secret, user_agent=user_agent, username...
<commit_before>import asyncio import functools import praw class AsyncRateRedditAPI: def __init__(self, client_id, client_secret, user_agent, username, password, loop=None): self._reddit = praw.Reddit( client_id=client_id, client_secret=client_secret, user_agent=user_...
c6d949cbb32e095e5859aa22d11aa1566f5bc63f
website/util/mimetype.py
website/util/mimetype.py
import os import mimetypes HERE = os.path.dirname(os.path.abspath(__file__)) MIMEMAP = os.path.join(HERE, 'mime.types') def get_mimetype(path, data=None): mimetypes.init([MIMEMAP]) mimetype, _ = mimetypes.guess_type(path) if mimetype is None and data is not None: try: import magic ...
import os import mimetypes HERE = os.path.dirname(os.path.abspath(__file__)) MIMEMAP = os.path.join(HERE, 'mime.types') def get_mimetype(path, file_contents=None): mimetypes.init([MIMEMAP]) mimetype, _ = mimetypes.guess_type(path) if mimetype is None and file_contents is not None: try: ...
Make better name for argument.
Make better name for argument.
Python
apache-2.0
mfraezz/osf.io,saradbowman/osf.io,danielneis/osf.io,reinaH/osf.io,amyshi188/osf.io,GageGaskins/osf.io,wearpants/osf.io,KAsante95/osf.io,billyhunt/osf.io,petermalcolm/osf.io,danielneis/osf.io,cldershem/osf.io,samanehsan/osf.io,abought/osf.io,GaryKriebel/osf.io,CenterForOpenScience/osf.io,erinspace/osf.io,dplorimer/osf,a...
import os import mimetypes HERE = os.path.dirname(os.path.abspath(__file__)) MIMEMAP = os.path.join(HERE, 'mime.types') def get_mimetype(path, data=None): mimetypes.init([MIMEMAP]) mimetype, _ = mimetypes.guess_type(path) if mimetype is None and data is not None: try: import magic ...
import os import mimetypes HERE = os.path.dirname(os.path.abspath(__file__)) MIMEMAP = os.path.join(HERE, 'mime.types') def get_mimetype(path, file_contents=None): mimetypes.init([MIMEMAP]) mimetype, _ = mimetypes.guess_type(path) if mimetype is None and file_contents is not None: try: ...
<commit_before>import os import mimetypes HERE = os.path.dirname(os.path.abspath(__file__)) MIMEMAP = os.path.join(HERE, 'mime.types') def get_mimetype(path, data=None): mimetypes.init([MIMEMAP]) mimetype, _ = mimetypes.guess_type(path) if mimetype is None and data is not None: try: ...
import os import mimetypes HERE = os.path.dirname(os.path.abspath(__file__)) MIMEMAP = os.path.join(HERE, 'mime.types') def get_mimetype(path, file_contents=None): mimetypes.init([MIMEMAP]) mimetype, _ = mimetypes.guess_type(path) if mimetype is None and file_contents is not None: try: ...
import os import mimetypes HERE = os.path.dirname(os.path.abspath(__file__)) MIMEMAP = os.path.join(HERE, 'mime.types') def get_mimetype(path, data=None): mimetypes.init([MIMEMAP]) mimetype, _ = mimetypes.guess_type(path) if mimetype is None and data is not None: try: import magic ...
<commit_before>import os import mimetypes HERE = os.path.dirname(os.path.abspath(__file__)) MIMEMAP = os.path.join(HERE, 'mime.types') def get_mimetype(path, data=None): mimetypes.init([MIMEMAP]) mimetype, _ = mimetypes.guess_type(path) if mimetype is None and data is not None: try: ...
b8c2376368290fa4fef103ba86d4f2ed164a3b7d
numscons/checkers/__init__.py
numscons/checkers/__init__.py
from blas_lapack_checkers import CheckCLAPACK, CheckCBLAS, CheckF77BLAS, CheckF77LAPACK from fft_checkers import CheckFFT from simple_check import NumpyCheckLibAndHeader from perflib import * from fortran import * from perflib_info import write_info import blas_lapack_checkers import fft_checkers import perflib imp...
from numscons.checkers.new.netlib_checkers import \ CheckCblas as CheckCBLAS, \ CheckF77Blas as CheckF77BLAS, \ CheckF77Lapack as CheckF77LAPACK from numscons.checkers.new.common import \ get_perflib_implementation from numscons.checkers.new.common import \ write_configuration_re...
Use the new framework for checkers.
Use the new framework for checkers.
Python
bsd-3-clause
cournape/numscons,cournape/numscons,cournape/numscons
from blas_lapack_checkers import CheckCLAPACK, CheckCBLAS, CheckF77BLAS, CheckF77LAPACK from fft_checkers import CheckFFT from simple_check import NumpyCheckLibAndHeader from perflib import * from fortran import * from perflib_info import write_info import blas_lapack_checkers import fft_checkers import perflib imp...
from numscons.checkers.new.netlib_checkers import \ CheckCblas as CheckCBLAS, \ CheckF77Blas as CheckF77BLAS, \ CheckF77Lapack as CheckF77LAPACK from numscons.checkers.new.common import \ get_perflib_implementation from numscons.checkers.new.common import \ write_configuration_re...
<commit_before>from blas_lapack_checkers import CheckCLAPACK, CheckCBLAS, CheckF77BLAS, CheckF77LAPACK from fft_checkers import CheckFFT from simple_check import NumpyCheckLibAndHeader from perflib import * from fortran import * from perflib_info import write_info import blas_lapack_checkers import fft_checkers imp...
from numscons.checkers.new.netlib_checkers import \ CheckCblas as CheckCBLAS, \ CheckF77Blas as CheckF77BLAS, \ CheckF77Lapack as CheckF77LAPACK from numscons.checkers.new.common import \ get_perflib_implementation from numscons.checkers.new.common import \ write_configuration_re...
from blas_lapack_checkers import CheckCLAPACK, CheckCBLAS, CheckF77BLAS, CheckF77LAPACK from fft_checkers import CheckFFT from simple_check import NumpyCheckLibAndHeader from perflib import * from fortran import * from perflib_info import write_info import blas_lapack_checkers import fft_checkers import perflib imp...
<commit_before>from blas_lapack_checkers import CheckCLAPACK, CheckCBLAS, CheckF77BLAS, CheckF77LAPACK from fft_checkers import CheckFFT from simple_check import NumpyCheckLibAndHeader from perflib import * from fortran import * from perflib_info import write_info import blas_lapack_checkers import fft_checkers imp...
f200d98547baef9ac2faa90d72857ffa0e64c721
IPython/nbconvert/exporters/python.py
IPython/nbconvert/exporters/python.py
"""Python script Exporter class""" #----------------------------------------------------------------------------- # Copyright (c) 2013, the IPython Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. #----------...
"""Python script Exporter class""" #----------------------------------------------------------------------------- # Copyright (c) 2013, the IPython Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. #----------...
Add MIME types to nbconvert exporters
Add MIME types to nbconvert exporters
Python
bsd-3-clause
cornhundred/ipywidgets,jupyter-widgets/ipywidgets,cornhundred/ipywidgets,SylvainCorlay/ipywidgets,SylvainCorlay/ipywidgets,cornhundred/ipywidgets,jupyter-widgets/ipywidgets,ipython/ipywidgets,ipython/ipywidgets,ipython/ipywidgets,jupyter-widgets/ipywidgets,ipython/ipywidgets,SylvainCorlay/ipywidgets,cornhundred/ipywidg...
"""Python script Exporter class""" #----------------------------------------------------------------------------- # Copyright (c) 2013, the IPython Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. #----------...
"""Python script Exporter class""" #----------------------------------------------------------------------------- # Copyright (c) 2013, the IPython Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. #----------...
<commit_before>"""Python script Exporter class""" #----------------------------------------------------------------------------- # Copyright (c) 2013, the IPython Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this softwa...
"""Python script Exporter class""" #----------------------------------------------------------------------------- # Copyright (c) 2013, the IPython Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. #----------...
"""Python script Exporter class""" #----------------------------------------------------------------------------- # Copyright (c) 2013, the IPython Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. #----------...
<commit_before>"""Python script Exporter class""" #----------------------------------------------------------------------------- # Copyright (c) 2013, the IPython Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this softwa...
fda1b41890ea338e992ddd8a23d9c6a497990ea2
fabfile/eg.py
fabfile/eg.py
# coding: utf-8 from __future__ import unicode_literals, print_function from fabric.api import task, local, run, lcd, cd, env, shell_env from fabtools.python import virtualenv from _util import PWD, VENV_DIR @task def mnist(): with virtualenv(VENV_DIR), lcd(PWD), shell_env(PYTHONPATH=PWD): local('python...
# coding: utf-8 from __future__ import unicode_literals, print_function from fabric.api import task, local, run, lcd, cd, env, shell_env from fabtools.python import virtualenv from _util import PWD, VENV_DIR @task def mnist(): with virtualenv(VENV_DIR), lcd(PWD), shell_env(PYTHONPATH=PWD): local('python...
Add fabric task for Quora example
Add fabric task for Quora example
Python
mit
spacy-io/thinc,explosion/thinc,explosion/thinc,spacy-io/thinc,spacy-io/thinc,explosion/thinc,explosion/thinc
# coding: utf-8 from __future__ import unicode_literals, print_function from fabric.api import task, local, run, lcd, cd, env, shell_env from fabtools.python import virtualenv from _util import PWD, VENV_DIR @task def mnist(): with virtualenv(VENV_DIR), lcd(PWD), shell_env(PYTHONPATH=PWD): local('python...
# coding: utf-8 from __future__ import unicode_literals, print_function from fabric.api import task, local, run, lcd, cd, env, shell_env from fabtools.python import virtualenv from _util import PWD, VENV_DIR @task def mnist(): with virtualenv(VENV_DIR), lcd(PWD), shell_env(PYTHONPATH=PWD): local('python...
<commit_before># coding: utf-8 from __future__ import unicode_literals, print_function from fabric.api import task, local, run, lcd, cd, env, shell_env from fabtools.python import virtualenv from _util import PWD, VENV_DIR @task def mnist(): with virtualenv(VENV_DIR), lcd(PWD), shell_env(PYTHONPATH=PWD): ...
# coding: utf-8 from __future__ import unicode_literals, print_function from fabric.api import task, local, run, lcd, cd, env, shell_env from fabtools.python import virtualenv from _util import PWD, VENV_DIR @task def mnist(): with virtualenv(VENV_DIR), lcd(PWD), shell_env(PYTHONPATH=PWD): local('python...
# coding: utf-8 from __future__ import unicode_literals, print_function from fabric.api import task, local, run, lcd, cd, env, shell_env from fabtools.python import virtualenv from _util import PWD, VENV_DIR @task def mnist(): with virtualenv(VENV_DIR), lcd(PWD), shell_env(PYTHONPATH=PWD): local('python...
<commit_before># coding: utf-8 from __future__ import unicode_literals, print_function from fabric.api import task, local, run, lcd, cd, env, shell_env from fabtools.python import virtualenv from _util import PWD, VENV_DIR @task def mnist(): with virtualenv(VENV_DIR), lcd(PWD), shell_env(PYTHONPATH=PWD): ...
01662f2b2fdcc4ce1ee7e4a5480fbde8acaac5fd
ddcz/tests/test_integration/test_user.py
ddcz/tests/test_integration/test_user.py
from django.test import Client, TestCase from django.urls import reverse from django.contrib.auth.models import User from ddcz.models import UserProfile class PasswordResetTestCase(TestCase): fixtures = ['pages'] def setUp(self): super().setUp() self.client = Client() self.valid_pas...
from django.test import Client, TestCase from django.urls import reverse from django.contrib.auth.models import User from ddcz.models import UserProfile class PasswordResetTestCase(TestCase): fixtures = ['pages'] def setUp(self): super().setUp() self.client = Client() self.valid_pas...
Fix new expectations of the password reset
fix: Fix new expectations of the password reset
Python
mit
dracidoupe/graveyard,dracidoupe/graveyard,dracidoupe/graveyard,dracidoupe/graveyard
from django.test import Client, TestCase from django.urls import reverse from django.contrib.auth.models import User from ddcz.models import UserProfile class PasswordResetTestCase(TestCase): fixtures = ['pages'] def setUp(self): super().setUp() self.client = Client() self.valid_pas...
from django.test import Client, TestCase from django.urls import reverse from django.contrib.auth.models import User from ddcz.models import UserProfile class PasswordResetTestCase(TestCase): fixtures = ['pages'] def setUp(self): super().setUp() self.client = Client() self.valid_pas...
<commit_before>from django.test import Client, TestCase from django.urls import reverse from django.contrib.auth.models import User from ddcz.models import UserProfile class PasswordResetTestCase(TestCase): fixtures = ['pages'] def setUp(self): super().setUp() self.client = Client() ...
from django.test import Client, TestCase from django.urls import reverse from django.contrib.auth.models import User from ddcz.models import UserProfile class PasswordResetTestCase(TestCase): fixtures = ['pages'] def setUp(self): super().setUp() self.client = Client() self.valid_pas...
from django.test import Client, TestCase from django.urls import reverse from django.contrib.auth.models import User from ddcz.models import UserProfile class PasswordResetTestCase(TestCase): fixtures = ['pages'] def setUp(self): super().setUp() self.client = Client() self.valid_pas...
<commit_before>from django.test import Client, TestCase from django.urls import reverse from django.contrib.auth.models import User from ddcz.models import UserProfile class PasswordResetTestCase(TestCase): fixtures = ['pages'] def setUp(self): super().setUp() self.client = Client() ...
c604ace9394cdc1c0c0a3002cbb3d90dd64695f3
examples/mnist-classifier.py
examples/mnist-classifier.py
#!/usr/bin/env python import cPickle import gzip import logging import os import sys import tempfile import urllib import lmj.tnn logging.basicConfig( stream=sys.stdout, format='%(levelname).1s %(asctime)s %(message)s', level=logging.INFO) URL = 'http://www.iro.umontreal.ca/~lisa/deep/data/mnist/mnist.p...
#!/usr/bin/env python import cPickle import gzip import logging import os import sys import tempfile import urllib import lmj.tnn logging.basicConfig( stream=sys.stdout, format='%(levelname).1s %(asctime)s %(message)s', level=logging.INFO) URL = 'http://www.iro.umontreal.ca/~lisa/deep/data/mnist/mnist.p...
Save mnist classifier model in a file named with the network topology.
Save mnist classifier model in a file named with the network topology.
Python
mit
lmjohns3/theanets,chrinide/theanets,devdoer/theanets
#!/usr/bin/env python import cPickle import gzip import logging import os import sys import tempfile import urllib import lmj.tnn logging.basicConfig( stream=sys.stdout, format='%(levelname).1s %(asctime)s %(message)s', level=logging.INFO) URL = 'http://www.iro.umontreal.ca/~lisa/deep/data/mnist/mnist.p...
#!/usr/bin/env python import cPickle import gzip import logging import os import sys import tempfile import urllib import lmj.tnn logging.basicConfig( stream=sys.stdout, format='%(levelname).1s %(asctime)s %(message)s', level=logging.INFO) URL = 'http://www.iro.umontreal.ca/~lisa/deep/data/mnist/mnist.p...
<commit_before>#!/usr/bin/env python import cPickle import gzip import logging import os import sys import tempfile import urllib import lmj.tnn logging.basicConfig( stream=sys.stdout, format='%(levelname).1s %(asctime)s %(message)s', level=logging.INFO) URL = 'http://www.iro.umontreal.ca/~lisa/deep/dat...
#!/usr/bin/env python import cPickle import gzip import logging import os import sys import tempfile import urllib import lmj.tnn logging.basicConfig( stream=sys.stdout, format='%(levelname).1s %(asctime)s %(message)s', level=logging.INFO) URL = 'http://www.iro.umontreal.ca/~lisa/deep/data/mnist/mnist.p...
#!/usr/bin/env python import cPickle import gzip import logging import os import sys import tempfile import urllib import lmj.tnn logging.basicConfig( stream=sys.stdout, format='%(levelname).1s %(asctime)s %(message)s', level=logging.INFO) URL = 'http://www.iro.umontreal.ca/~lisa/deep/data/mnist/mnist.p...
<commit_before>#!/usr/bin/env python import cPickle import gzip import logging import os import sys import tempfile import urllib import lmj.tnn logging.basicConfig( stream=sys.stdout, format='%(levelname).1s %(asctime)s %(message)s', level=logging.INFO) URL = 'http://www.iro.umontreal.ca/~lisa/deep/dat...
e5083fd56caa271afbdbad1c59009f7e1ea465b3
content/app.py
content/app.py
from flask import Flask from .extensions import envcfg, apierrors, applogging from .blueprints.status import blueprint as status_bp from .blueprints.content import blueprint as content_bp from .blueprints.swagger import blueprint as swagger_bp def create_app(): app = Flask('content') app.config.from_object('...
from flask import Flask, jsonify from botocore.exceptions import ClientError from .extensions import envcfg, apierrors, applogging from .blueprints.status import blueprint as status_bp from .blueprints.content import blueprint as content_bp from .blueprints.swagger import blueprint as swagger_bp def create_app(): ...
Return 404 when no content found.
Return 404 when no content found.
Python
bsd-3-clause
Zipmatch/zipmatch-content,Zipmatch/zipmatch-content
from flask import Flask from .extensions import envcfg, apierrors, applogging from .blueprints.status import blueprint as status_bp from .blueprints.content import blueprint as content_bp from .blueprints.swagger import blueprint as swagger_bp def create_app(): app = Flask('content') app.config.from_object('...
from flask import Flask, jsonify from botocore.exceptions import ClientError from .extensions import envcfg, apierrors, applogging from .blueprints.status import blueprint as status_bp from .blueprints.content import blueprint as content_bp from .blueprints.swagger import blueprint as swagger_bp def create_app(): ...
<commit_before>from flask import Flask from .extensions import envcfg, apierrors, applogging from .blueprints.status import blueprint as status_bp from .blueprints.content import blueprint as content_bp from .blueprints.swagger import blueprint as swagger_bp def create_app(): app = Flask('content') app.confi...
from flask import Flask, jsonify from botocore.exceptions import ClientError from .extensions import envcfg, apierrors, applogging from .blueprints.status import blueprint as status_bp from .blueprints.content import blueprint as content_bp from .blueprints.swagger import blueprint as swagger_bp def create_app(): ...
from flask import Flask from .extensions import envcfg, apierrors, applogging from .blueprints.status import blueprint as status_bp from .blueprints.content import blueprint as content_bp from .blueprints.swagger import blueprint as swagger_bp def create_app(): app = Flask('content') app.config.from_object('...
<commit_before>from flask import Flask from .extensions import envcfg, apierrors, applogging from .blueprints.status import blueprint as status_bp from .blueprints.content import blueprint as content_bp from .blueprints.swagger import blueprint as swagger_bp def create_app(): app = Flask('content') app.confi...
1b455898665ceedec330dea68e53ece4719b2898
cumulusci/utils/yaml/cumulusci_yml.py
cumulusci/utils/yaml/cumulusci_yml.py
from typing import IO, Text from re import compile, MULTILINE from logging import getLogger from io import StringIO import yaml NBSP = "\u00A0" pattern = compile(r"^\s*[\u00A0]+\s*", MULTILINE) logger = getLogger(__name__) def _replace_nbsp(origdata): counter = 0 def _replacer_func(matchobj): non...
from typing import IO, Text import re from logging import getLogger from io import StringIO import yaml NBSP = "\u00A0" pattern = re.compile(r"^\s*[\u00A0]+\s*", re.MULTILINE) logger = getLogger(__name__) def _replace_nbsp(origdata): counter = 0 def _replacer_func(matchobj): nonlocal counter ...
Improve error message and imports
Improve error message and imports
Python
bsd-3-clause
SalesforceFoundation/CumulusCI,SalesforceFoundation/CumulusCI
from typing import IO, Text from re import compile, MULTILINE from logging import getLogger from io import StringIO import yaml NBSP = "\u00A0" pattern = compile(r"^\s*[\u00A0]+\s*", MULTILINE) logger = getLogger(__name__) def _replace_nbsp(origdata): counter = 0 def _replacer_func(matchobj): non...
from typing import IO, Text import re from logging import getLogger from io import StringIO import yaml NBSP = "\u00A0" pattern = re.compile(r"^\s*[\u00A0]+\s*", re.MULTILINE) logger = getLogger(__name__) def _replace_nbsp(origdata): counter = 0 def _replacer_func(matchobj): nonlocal counter ...
<commit_before>from typing import IO, Text from re import compile, MULTILINE from logging import getLogger from io import StringIO import yaml NBSP = "\u00A0" pattern = compile(r"^\s*[\u00A0]+\s*", MULTILINE) logger = getLogger(__name__) def _replace_nbsp(origdata): counter = 0 def _replacer_func(matchob...
from typing import IO, Text import re from logging import getLogger from io import StringIO import yaml NBSP = "\u00A0" pattern = re.compile(r"^\s*[\u00A0]+\s*", re.MULTILINE) logger = getLogger(__name__) def _replace_nbsp(origdata): counter = 0 def _replacer_func(matchobj): nonlocal counter ...
from typing import IO, Text from re import compile, MULTILINE from logging import getLogger from io import StringIO import yaml NBSP = "\u00A0" pattern = compile(r"^\s*[\u00A0]+\s*", MULTILINE) logger = getLogger(__name__) def _replace_nbsp(origdata): counter = 0 def _replacer_func(matchobj): non...
<commit_before>from typing import IO, Text from re import compile, MULTILINE from logging import getLogger from io import StringIO import yaml NBSP = "\u00A0" pattern = compile(r"^\s*[\u00A0]+\s*", MULTILINE) logger = getLogger(__name__) def _replace_nbsp(origdata): counter = 0 def _replacer_func(matchob...
3d00536041d52900a4ace5304b5b07eba4c11efb
wmt/flask/names/models.py
wmt/flask/names/models.py
#from flask_security import UserMixin, RoleMixin from standard_names import StandardName from ..core import db class Name(db.Model): __tablename__ = 'names' __bind_key__ = 'names' id = db.Column(db.Integer, primary_key=True) name = db.Column(db.Text) def __init__(self, name): self.name =...
from flask import url_for from standard_names import StandardName from ..core import db, JsonMixin class NameJsonSerializer(JsonMixin): __public_fields__ = set(['href', 'id', 'name', 'object', 'quantity', 'operators']) class Name(NameJsonSerializer, db.Model): __tablename__ = '...
Use the JsonMixin for the names model.
Use the JsonMixin for the names model.
Python
mit
mcflugen/wmt-rest,mcflugen/wmt-rest
#from flask_security import UserMixin, RoleMixin from standard_names import StandardName from ..core import db class Name(db.Model): __tablename__ = 'names' __bind_key__ = 'names' id = db.Column(db.Integer, primary_key=True) name = db.Column(db.Text) def __init__(self, name): self.name =...
from flask import url_for from standard_names import StandardName from ..core import db, JsonMixin class NameJsonSerializer(JsonMixin): __public_fields__ = set(['href', 'id', 'name', 'object', 'quantity', 'operators']) class Name(NameJsonSerializer, db.Model): __tablename__ = '...
<commit_before>#from flask_security import UserMixin, RoleMixin from standard_names import StandardName from ..core import db class Name(db.Model): __tablename__ = 'names' __bind_key__ = 'names' id = db.Column(db.Integer, primary_key=True) name = db.Column(db.Text) def __init__(self, name): ...
from flask import url_for from standard_names import StandardName from ..core import db, JsonMixin class NameJsonSerializer(JsonMixin): __public_fields__ = set(['href', 'id', 'name', 'object', 'quantity', 'operators']) class Name(NameJsonSerializer, db.Model): __tablename__ = '...
#from flask_security import UserMixin, RoleMixin from standard_names import StandardName from ..core import db class Name(db.Model): __tablename__ = 'names' __bind_key__ = 'names' id = db.Column(db.Integer, primary_key=True) name = db.Column(db.Text) def __init__(self, name): self.name =...
<commit_before>#from flask_security import UserMixin, RoleMixin from standard_names import StandardName from ..core import db class Name(db.Model): __tablename__ = 'names' __bind_key__ = 'names' id = db.Column(db.Integer, primary_key=True) name = db.Column(db.Text) def __init__(self, name): ...
2fac490ed8926bf04e396ded35340f880e9c49b6
wikilink/db/connection.py
wikilink/db/connection.py
from sqlalchemy import create_engine from sqlalchemy_utils import functions from sqlalchemy.orm import sessionmaker from .base import Base class Connection: def __init__(self, db, name, password, ip, port): if db == "postgresql": connection = "postgresql+psycopg2://" + name + ":" + password + "@" + ip + ...
from sqlalchemy import create_engine from sqlalchemy_utils import functions from sqlalchemy.orm import sessionmaker from .base import Base class Connection: def __init__(self, db, name, password, ip, port): if db == "postgresql": connection = "postgresql+psycopg2://" + name + ":" + password + "@" + ip + ...
Add exception for wrong type of db
Add exception for wrong type of db
Python
apache-2.0
tranlyvu/findLink,tranlyvu/find-link
from sqlalchemy import create_engine from sqlalchemy_utils import functions from sqlalchemy.orm import sessionmaker from .base import Base class Connection: def __init__(self, db, name, password, ip, port): if db == "postgresql": connection = "postgresql+psycopg2://" + name + ":" + password + "@" + ip + ...
from sqlalchemy import create_engine from sqlalchemy_utils import functions from sqlalchemy.orm import sessionmaker from .base import Base class Connection: def __init__(self, db, name, password, ip, port): if db == "postgresql": connection = "postgresql+psycopg2://" + name + ":" + password + "@" + ip + ...
<commit_before>from sqlalchemy import create_engine from sqlalchemy_utils import functions from sqlalchemy.orm import sessionmaker from .base import Base class Connection: def __init__(self, db, name, password, ip, port): if db == "postgresql": connection = "postgresql+psycopg2://" + name + ":" + passwor...
from sqlalchemy import create_engine from sqlalchemy_utils import functions from sqlalchemy.orm import sessionmaker from .base import Base class Connection: def __init__(self, db, name, password, ip, port): if db == "postgresql": connection = "postgresql+psycopg2://" + name + ":" + password + "@" + ip + ...
from sqlalchemy import create_engine from sqlalchemy_utils import functions from sqlalchemy.orm import sessionmaker from .base import Base class Connection: def __init__(self, db, name, password, ip, port): if db == "postgresql": connection = "postgresql+psycopg2://" + name + ":" + password + "@" + ip + ...
<commit_before>from sqlalchemy import create_engine from sqlalchemy_utils import functions from sqlalchemy.orm import sessionmaker from .base import Base class Connection: def __init__(self, db, name, password, ip, port): if db == "postgresql": connection = "postgresql+psycopg2://" + name + ":" + passwor...
d404b91cc7af75c343c78fe44273a8cff8aa5663
feincms/module/page/admin.py
feincms/module/page/admin.py
# ------------------------------------------------------------------------ # coding=utf-8 # ------------------------------------------------------------------------ from __future__ import absolute_import from django.conf import settings from django.contrib import admin from django.core.exceptions import ImproperlyCon...
# ------------------------------------------------------------------------ # coding=utf-8 # ------------------------------------------------------------------------ from __future__ import absolute_import from django.conf import settings from django.contrib import admin from django.core.exceptions import ImproperlyCon...
Add a note concerning FEINCMS_USE_PAGE_ADMIN
Add a note concerning FEINCMS_USE_PAGE_ADMIN
Python
bsd-3-clause
joshuajonah/feincms,matthiask/feincms2-content,feincms/feincms,nickburlett/feincms,nickburlett/feincms,feincms/feincms,matthiask/django-content-editor,matthiask/django-content-editor,matthiask/django-content-editor,michaelkuty/feincms,feincms/feincms,michaelkuty/feincms,matthiask/feincms2-content,nickburlett/feincms,mj...
# ------------------------------------------------------------------------ # coding=utf-8 # ------------------------------------------------------------------------ from __future__ import absolute_import from django.conf import settings from django.contrib import admin from django.core.exceptions import ImproperlyCon...
# ------------------------------------------------------------------------ # coding=utf-8 # ------------------------------------------------------------------------ from __future__ import absolute_import from django.conf import settings from django.contrib import admin from django.core.exceptions import ImproperlyCon...
<commit_before># ------------------------------------------------------------------------ # coding=utf-8 # ------------------------------------------------------------------------ from __future__ import absolute_import from django.conf import settings from django.contrib import admin from django.core.exceptions impor...
# ------------------------------------------------------------------------ # coding=utf-8 # ------------------------------------------------------------------------ from __future__ import absolute_import from django.conf import settings from django.contrib import admin from django.core.exceptions import ImproperlyCon...
# ------------------------------------------------------------------------ # coding=utf-8 # ------------------------------------------------------------------------ from __future__ import absolute_import from django.conf import settings from django.contrib import admin from django.core.exceptions import ImproperlyCon...
<commit_before># ------------------------------------------------------------------------ # coding=utf-8 # ------------------------------------------------------------------------ from __future__ import absolute_import from django.conf import settings from django.contrib import admin from django.core.exceptions impor...
a8599728ea4b306776b4ba8aa92e333671571e4d
tensorflow_text/python/keras/layers/__init__.py
tensorflow_text/python/keras/layers/__init__.py
# coding=utf-8 # Copyright 2021 TF.Text Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
# coding=utf-8 # Copyright 2021 TF.Text Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
Add missing symbols for tokenization layers
Add missing symbols for tokenization layers Tokenization layers are now exposed by adding them to the list of allowed symbols. Cheers
Python
apache-2.0
tensorflow/text,tensorflow/text,tensorflow/text
# coding=utf-8 # Copyright 2021 TF.Text Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
# coding=utf-8 # Copyright 2021 TF.Text Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
<commit_before># coding=utf-8 # Copyright 2021 TF.Text Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
# coding=utf-8 # Copyright 2021 TF.Text Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
# coding=utf-8 # Copyright 2021 TF.Text Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
<commit_before># coding=utf-8 # Copyright 2021 TF.Text Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
d9dce6f97019d688750c8143777d2c9e2acd4170
qtpy/QtOpenGLWidgets.py
qtpy/QtOpenGLWidgets.py
# ----------------------------------------------------------------------------- # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------------------------------------------- """Provides QtOpenGLWidgets cla...
# ----------------------------------------------------------------------------- # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------------------------------------------- """Provides QtOpenGLWidgets cla...
Fix wrong module name in error message
Fix wrong module name in error message
Python
mit
spyder-ide/qtpy
# ----------------------------------------------------------------------------- # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------------------------------------------- """Provides QtOpenGLWidgets cla...
# ----------------------------------------------------------------------------- # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------------------------------------------- """Provides QtOpenGLWidgets cla...
<commit_before># ----------------------------------------------------------------------------- # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------------------------------------------- """Provides QtOp...
# ----------------------------------------------------------------------------- # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------------------------------------------- """Provides QtOpenGLWidgets cla...
# ----------------------------------------------------------------------------- # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------------------------------------------- """Provides QtOpenGLWidgets cla...
<commit_before># ----------------------------------------------------------------------------- # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------------------------------------------- """Provides QtOp...
2021cdbe3304c91af03d9664e05c9bbc1a197f4d
python/ql/test/experimental/library-tests/frameworks/yaml/Decoding.py
python/ql/test/experimental/library-tests/frameworks/yaml/Decoding.py
import yaml from yaml import SafeLoader yaml.load(payload) # $decodeInput=payload decodeOutput=Attribute() decodeFormat=YAML decodeMayExecuteInput yaml.load(payload, Loader=SafeLoader) # $decodeInput=payload decodeOutput=Attribute() decodeFormat=YAML yaml.load(payload, Loader=yaml.BaseLoader) # $decodeInput=payload...
import yaml from yaml import SafeLoader yaml.load(payload) # $decodeInput=payload decodeOutput=Attribute() decodeFormat=YAML decodeMayExecuteInput yaml.load(payload, SafeLoader) # $ decodeInput=payload decodeOutput=Attribute() decodeFormat=YAML SPURIOUS: decodeMayExecuteInput yaml.load(payload, Loader=SafeLoader) #...
Add tests for more yaml loading functions
Python: Add tests for more yaml loading functions
Python
mit
github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql
import yaml from yaml import SafeLoader yaml.load(payload) # $decodeInput=payload decodeOutput=Attribute() decodeFormat=YAML decodeMayExecuteInput yaml.load(payload, Loader=SafeLoader) # $decodeInput=payload decodeOutput=Attribute() decodeFormat=YAML yaml.load(payload, Loader=yaml.BaseLoader) # $decodeInput=payload...
import yaml from yaml import SafeLoader yaml.load(payload) # $decodeInput=payload decodeOutput=Attribute() decodeFormat=YAML decodeMayExecuteInput yaml.load(payload, SafeLoader) # $ decodeInput=payload decodeOutput=Attribute() decodeFormat=YAML SPURIOUS: decodeMayExecuteInput yaml.load(payload, Loader=SafeLoader) #...
<commit_before>import yaml from yaml import SafeLoader yaml.load(payload) # $decodeInput=payload decodeOutput=Attribute() decodeFormat=YAML decodeMayExecuteInput yaml.load(payload, Loader=SafeLoader) # $decodeInput=payload decodeOutput=Attribute() decodeFormat=YAML yaml.load(payload, Loader=yaml.BaseLoader) # $deco...
import yaml from yaml import SafeLoader yaml.load(payload) # $decodeInput=payload decodeOutput=Attribute() decodeFormat=YAML decodeMayExecuteInput yaml.load(payload, SafeLoader) # $ decodeInput=payload decodeOutput=Attribute() decodeFormat=YAML SPURIOUS: decodeMayExecuteInput yaml.load(payload, Loader=SafeLoader) #...
import yaml from yaml import SafeLoader yaml.load(payload) # $decodeInput=payload decodeOutput=Attribute() decodeFormat=YAML decodeMayExecuteInput yaml.load(payload, Loader=SafeLoader) # $decodeInput=payload decodeOutput=Attribute() decodeFormat=YAML yaml.load(payload, Loader=yaml.BaseLoader) # $decodeInput=payload...
<commit_before>import yaml from yaml import SafeLoader yaml.load(payload) # $decodeInput=payload decodeOutput=Attribute() decodeFormat=YAML decodeMayExecuteInput yaml.load(payload, Loader=SafeLoader) # $decodeInput=payload decodeOutput=Attribute() decodeFormat=YAML yaml.load(payload, Loader=yaml.BaseLoader) # $deco...
b535dcc490f56a54b92443172ad0b5828bc5a540
rpcd/playbooks/roles/horizon_extensions/templates/_50_rackspace.py
rpcd/playbooks/roles/horizon_extensions/templates/_50_rackspace.py
DASHBOARD = 'rackspace' ADD_INSTALLED_APPS = [ 'rackspace', ] # If set to True, this dashboard will not be added to the settings. DISABLED = False
DASHBOARD = 'rackspace' ADD_INSTALLED_APPS = [ 'rackspace', ] ADD_ANGULAR_MODULES = ['horizon.dashboard.rackspace'] # If set to True, this dashboard will not be added to the settings. DISABLED = False
Fix enabled file installed from horizon-extensions
Fix enabled file installed from horizon-extensions Add the angularjs module containing the Rackspace Solutions panel code to the Horizon application so it works. Requires accompanying patch https://github.com/rcbops/horizon-extensions/pull/7 for the panel to work with this change. closes 891
Python
apache-2.0
cfarquhar/rpc-openstack,galstrom21/rpc-openstack,mancdaz/rpc-openstack,sigmavirus24/rpc-openstack,cloudnull/rpc-openstack,major/rpc-openstack,darrenchan/rpc-openstack,cfarquhar/rpc-openstack,mancdaz/rpc-openstack,git-harry/rpc-openstack,darrenchan/rpc-openstack,xeregin/rpc-openstack,prometheanfire/rpc-openstack,robb-ro...
DASHBOARD = 'rackspace' ADD_INSTALLED_APPS = [ 'rackspace', ] # If set to True, this dashboard will not be added to the settings. DISABLED = False Fix enabled file installed from horizon-extensions Add the angularjs module containing the Rackspace Solutions panel code to the Horizon application so it works. Req...
DASHBOARD = 'rackspace' ADD_INSTALLED_APPS = [ 'rackspace', ] ADD_ANGULAR_MODULES = ['horizon.dashboard.rackspace'] # If set to True, this dashboard will not be added to the settings. DISABLED = False
<commit_before>DASHBOARD = 'rackspace' ADD_INSTALLED_APPS = [ 'rackspace', ] # If set to True, this dashboard will not be added to the settings. DISABLED = False <commit_msg>Fix enabled file installed from horizon-extensions Add the angularjs module containing the Rackspace Solutions panel code to the Horizon ap...
DASHBOARD = 'rackspace' ADD_INSTALLED_APPS = [ 'rackspace', ] ADD_ANGULAR_MODULES = ['horizon.dashboard.rackspace'] # If set to True, this dashboard will not be added to the settings. DISABLED = False
DASHBOARD = 'rackspace' ADD_INSTALLED_APPS = [ 'rackspace', ] # If set to True, this dashboard will not be added to the settings. DISABLED = False Fix enabled file installed from horizon-extensions Add the angularjs module containing the Rackspace Solutions panel code to the Horizon application so it works. Req...
<commit_before>DASHBOARD = 'rackspace' ADD_INSTALLED_APPS = [ 'rackspace', ] # If set to True, this dashboard will not be added to the settings. DISABLED = False <commit_msg>Fix enabled file installed from horizon-extensions Add the angularjs module containing the Rackspace Solutions panel code to the Horizon ap...
436bc4a7c35f6832e25cdf427f71acc0f2d8e54f
dadd/master/utils.py
dadd/master/utils.py
import os import requests import yaml def get_session(): sess = requests.Session() # Unused currently # sess.auth = (app.config['USERNAME'], app.config['PASSWORD']) sess.headers = {'content-type': 'application/json'} return sess def update_config(app): if 'DEBUG' in os.environ: app....
import os import requests import yaml def get_session(): sess = requests.Session() # Unused currently # sess.auth = (app.config['USERNAME'], app.config['PASSWORD']) sess.headers = {'content-type': 'application/json'} return sess def update_config(app): if 'HOST' in os.environ: app.c...
Add the host and port from the env to the config.
Add the host and port from the env to the config.
Python
bsd-3-clause
ionrock/dadd,ionrock/dadd,ionrock/dadd,ionrock/dadd
import os import requests import yaml def get_session(): sess = requests.Session() # Unused currently # sess.auth = (app.config['USERNAME'], app.config['PASSWORD']) sess.headers = {'content-type': 'application/json'} return sess def update_config(app): if 'DEBUG' in os.environ: app....
import os import requests import yaml def get_session(): sess = requests.Session() # Unused currently # sess.auth = (app.config['USERNAME'], app.config['PASSWORD']) sess.headers = {'content-type': 'application/json'} return sess def update_config(app): if 'HOST' in os.environ: app.c...
<commit_before>import os import requests import yaml def get_session(): sess = requests.Session() # Unused currently # sess.auth = (app.config['USERNAME'], app.config['PASSWORD']) sess.headers = {'content-type': 'application/json'} return sess def update_config(app): if 'DEBUG' in os.enviro...
import os import requests import yaml def get_session(): sess = requests.Session() # Unused currently # sess.auth = (app.config['USERNAME'], app.config['PASSWORD']) sess.headers = {'content-type': 'application/json'} return sess def update_config(app): if 'HOST' in os.environ: app.c...
import os import requests import yaml def get_session(): sess = requests.Session() # Unused currently # sess.auth = (app.config['USERNAME'], app.config['PASSWORD']) sess.headers = {'content-type': 'application/json'} return sess def update_config(app): if 'DEBUG' in os.environ: app....
<commit_before>import os import requests import yaml def get_session(): sess = requests.Session() # Unused currently # sess.auth = (app.config['USERNAME'], app.config['PASSWORD']) sess.headers = {'content-type': 'application/json'} return sess def update_config(app): if 'DEBUG' in os.enviro...
3d5eaf13597bd7cab5dc09e1030b803701f0872f
genda/genders/models.py
genda/genders/models.py
from django.db import models from django.conf import settings class Gender(models.Model): name = models.CharField(max_length=20) def __str__(self): return self.name __repr__ = __str__ class UserToPronoun(models.Model): email_hash = models.CharField(max_length=32) user = models.ForeignK...
from django.db import models from django.conf import settings class Gender(models.Model): name = models.CharField(max_length=20) def __str__(self): return self.name __repr__ = lambda self: '<{}>'.format(self.__str__()) class UserToPronoun(models.Model): email_hash = models.CharField(max_le...
Correct __str__ & __repr__ implementations
Correct __str__ & __repr__ implementations
Python
mit
Mause/Genda,Mause/Genda
from django.db import models from django.conf import settings class Gender(models.Model): name = models.CharField(max_length=20) def __str__(self): return self.name __repr__ = __str__ class UserToPronoun(models.Model): email_hash = models.CharField(max_length=32) user = models.ForeignK...
from django.db import models from django.conf import settings class Gender(models.Model): name = models.CharField(max_length=20) def __str__(self): return self.name __repr__ = lambda self: '<{}>'.format(self.__str__()) class UserToPronoun(models.Model): email_hash = models.CharField(max_le...
<commit_before>from django.db import models from django.conf import settings class Gender(models.Model): name = models.CharField(max_length=20) def __str__(self): return self.name __repr__ = __str__ class UserToPronoun(models.Model): email_hash = models.CharField(max_length=32) user = ...
from django.db import models from django.conf import settings class Gender(models.Model): name = models.CharField(max_length=20) def __str__(self): return self.name __repr__ = lambda self: '<{}>'.format(self.__str__()) class UserToPronoun(models.Model): email_hash = models.CharField(max_le...
from django.db import models from django.conf import settings class Gender(models.Model): name = models.CharField(max_length=20) def __str__(self): return self.name __repr__ = __str__ class UserToPronoun(models.Model): email_hash = models.CharField(max_length=32) user = models.ForeignK...
<commit_before>from django.db import models from django.conf import settings class Gender(models.Model): name = models.CharField(max_length=20) def __str__(self): return self.name __repr__ = __str__ class UserToPronoun(models.Model): email_hash = models.CharField(max_length=32) user = ...
4c0ba059c49ead3394ccff0351841ab50b15b712
app/settings/prod.py
app/settings/prod.py
import dj_database_url from .default import * DEBUG = False SECRET_KEY = os.getenv('DJANGO_SECRET_KEY', None) ALLOWED_HOSTS = ['agendaodonto.herokuapp.com'] DATABASES = {'default': dj_database_url.config()} CORS_ORIGIN_WHITELIST = ( 'https://agendaodonto.com', 'https://backend.agendaodonto.com', ) DJOSER[...
import dj_database_url from .default import * DEBUG = False SECRET_KEY = os.getenv('DJANGO_SECRET_KEY', None) ALLOWED_HOSTS = ['agendaodonto.herokuapp.com'] DATABASES = {'default': dj_database_url.config()} CORS_ORIGIN_WHITELIST = ( 'agendaodonto.com', 'backend.agendaodonto.com', ) DJOSER['DOMAIN'] = 'age...
Remove the scheme from the domain
fix: Remove the scheme from the domain
Python
agpl-3.0
agendaodonto/server,agendaodonto/server
import dj_database_url from .default import * DEBUG = False SECRET_KEY = os.getenv('DJANGO_SECRET_KEY', None) ALLOWED_HOSTS = ['agendaodonto.herokuapp.com'] DATABASES = {'default': dj_database_url.config()} CORS_ORIGIN_WHITELIST = ( 'https://agendaodonto.com', 'https://backend.agendaodonto.com', ) DJOSER[...
import dj_database_url from .default import * DEBUG = False SECRET_KEY = os.getenv('DJANGO_SECRET_KEY', None) ALLOWED_HOSTS = ['agendaodonto.herokuapp.com'] DATABASES = {'default': dj_database_url.config()} CORS_ORIGIN_WHITELIST = ( 'agendaodonto.com', 'backend.agendaodonto.com', ) DJOSER['DOMAIN'] = 'age...
<commit_before>import dj_database_url from .default import * DEBUG = False SECRET_KEY = os.getenv('DJANGO_SECRET_KEY', None) ALLOWED_HOSTS = ['agendaodonto.herokuapp.com'] DATABASES = {'default': dj_database_url.config()} CORS_ORIGIN_WHITELIST = ( 'https://agendaodonto.com', 'https://backend.agendaodonto.c...
import dj_database_url from .default import * DEBUG = False SECRET_KEY = os.getenv('DJANGO_SECRET_KEY', None) ALLOWED_HOSTS = ['agendaodonto.herokuapp.com'] DATABASES = {'default': dj_database_url.config()} CORS_ORIGIN_WHITELIST = ( 'agendaodonto.com', 'backend.agendaodonto.com', ) DJOSER['DOMAIN'] = 'age...
import dj_database_url from .default import * DEBUG = False SECRET_KEY = os.getenv('DJANGO_SECRET_KEY', None) ALLOWED_HOSTS = ['agendaodonto.herokuapp.com'] DATABASES = {'default': dj_database_url.config()} CORS_ORIGIN_WHITELIST = ( 'https://agendaodonto.com', 'https://backend.agendaodonto.com', ) DJOSER[...
<commit_before>import dj_database_url from .default import * DEBUG = False SECRET_KEY = os.getenv('DJANGO_SECRET_KEY', None) ALLOWED_HOSTS = ['agendaodonto.herokuapp.com'] DATABASES = {'default': dj_database_url.config()} CORS_ORIGIN_WHITELIST = ( 'https://agendaodonto.com', 'https://backend.agendaodonto.c...
5354a39d62edc12cd5dbea6b1912bf6bdf846999
test_migrations/migrate_test/app/models.py
test_migrations/migrate_test/app/models.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models # from modeltrans.fields import TranslationField class Category(models.Model): name = models.CharField(max_length=255) # i18n = TranslationField(fields=('name', )) class Meta: verbose_name_plural = 'cat...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models # from modeltrans.fields import TranslationField class Category(models.Model): name = models.CharField(max_length=255) # i18n = TranslationField(fields=('name', ), virtual_fields=False) class Meta: verb...
Disable adding virtual fields during migration
Disable adding virtual fields during migration
Python
bsd-3-clause
zostera/django-modeltrans,zostera/django-modeltrans
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models # from modeltrans.fields import TranslationField class Category(models.Model): name = models.CharField(max_length=255) # i18n = TranslationField(fields=('name', )) class Meta: verbose_name_plural = 'cat...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models # from modeltrans.fields import TranslationField class Category(models.Model): name = models.CharField(max_length=255) # i18n = TranslationField(fields=('name', ), virtual_fields=False) class Meta: verb...
<commit_before># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models # from modeltrans.fields import TranslationField class Category(models.Model): name = models.CharField(max_length=255) # i18n = TranslationField(fields=('name', )) class Meta: verbose_nam...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models # from modeltrans.fields import TranslationField class Category(models.Model): name = models.CharField(max_length=255) # i18n = TranslationField(fields=('name', ), virtual_fields=False) class Meta: verb...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models # from modeltrans.fields import TranslationField class Category(models.Model): name = models.CharField(max_length=255) # i18n = TranslationField(fields=('name', )) class Meta: verbose_name_plural = 'cat...
<commit_before># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models # from modeltrans.fields import TranslationField class Category(models.Model): name = models.CharField(max_length=255) # i18n = TranslationField(fields=('name', )) class Meta: verbose_nam...
c7514e73eff70514659db9ff27aaccf50e99c4c5
account_wallet/models/account_move.py
account_wallet/models/account_move.py
# © 2015 Laetitia Gangloff, Acsone SA/NV (http://www.acsone.eu) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import api, fields, models class AccountInvoice(models.Model): _inherit = "account.move" account_wallet_type_id = fields.Many2one( comodel_name='account.wal...
# © 2015 Laetitia Gangloff, Acsone SA/NV (http://www.acsone.eu) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import api, fields, models class AccountMove(models.Model): _inherit = "account.move" account_wallet_type_id = fields.Many2one( comodel_name='account.wallet...
Remove former methods as models have been merged
[14.0][IMP] account_wallet: Remove former methods as models have been merged
Python
agpl-3.0
acsone/acsone-addons,acsone/acsone-addons,acsone/acsone-addons
# © 2015 Laetitia Gangloff, Acsone SA/NV (http://www.acsone.eu) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import api, fields, models class AccountInvoice(models.Model): _inherit = "account.move" account_wallet_type_id = fields.Many2one( comodel_name='account.wal...
# © 2015 Laetitia Gangloff, Acsone SA/NV (http://www.acsone.eu) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import api, fields, models class AccountMove(models.Model): _inherit = "account.move" account_wallet_type_id = fields.Many2one( comodel_name='account.wallet...
<commit_before># © 2015 Laetitia Gangloff, Acsone SA/NV (http://www.acsone.eu) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import api, fields, models class AccountInvoice(models.Model): _inherit = "account.move" account_wallet_type_id = fields.Many2one( comodel_na...
# © 2015 Laetitia Gangloff, Acsone SA/NV (http://www.acsone.eu) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import api, fields, models class AccountMove(models.Model): _inherit = "account.move" account_wallet_type_id = fields.Many2one( comodel_name='account.wallet...
# © 2015 Laetitia Gangloff, Acsone SA/NV (http://www.acsone.eu) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import api, fields, models class AccountInvoice(models.Model): _inherit = "account.move" account_wallet_type_id = fields.Many2one( comodel_name='account.wal...
<commit_before># © 2015 Laetitia Gangloff, Acsone SA/NV (http://www.acsone.eu) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import api, fields, models class AccountInvoice(models.Model): _inherit = "account.move" account_wallet_type_id = fields.Many2one( comodel_na...
a3bf9240424700f21b1e89b4663ca4e5c12d78ef
django_yadt/utils.py
django_yadt/utils.py
from django.db import models from django.core.management.base import CommandError def get_variant(app_label, model_name, field_name, variant_name): model = models.get_model(app_label, model_name) if model is None: raise CommandError("%s.%s is not a valid model name" % ( app_label, ...
import os from django.db import models from django.core.management.base import CommandError from .fields import IMAGE_VARIANTS def get_variant(app_label, model_name, field_name, variant_name): model = models.get_model(app_label, model_name) if model is None: raise CommandError("%s.%s is not a valid ...
Add a utility for local installations to use the fallback mechanism too.
Add a utility for local installations to use the fallback mechanism too. Signed-off-by: Chris Lamb <711c73f64afdce07b7e38039a96d2224209e9a6c@thread.com>
Python
bsd-3-clause
lamby/django-yadt,thread/django-yadt
from django.db import models from django.core.management.base import CommandError def get_variant(app_label, model_name, field_name, variant_name): model = models.get_model(app_label, model_name) if model is None: raise CommandError("%s.%s is not a valid model name" % ( app_label, ...
import os from django.db import models from django.core.management.base import CommandError from .fields import IMAGE_VARIANTS def get_variant(app_label, model_name, field_name, variant_name): model = models.get_model(app_label, model_name) if model is None: raise CommandError("%s.%s is not a valid ...
<commit_before>from django.db import models from django.core.management.base import CommandError def get_variant(app_label, model_name, field_name, variant_name): model = models.get_model(app_label, model_name) if model is None: raise CommandError("%s.%s is not a valid model name" % ( app_...
import os from django.db import models from django.core.management.base import CommandError from .fields import IMAGE_VARIANTS def get_variant(app_label, model_name, field_name, variant_name): model = models.get_model(app_label, model_name) if model is None: raise CommandError("%s.%s is not a valid ...
from django.db import models from django.core.management.base import CommandError def get_variant(app_label, model_name, field_name, variant_name): model = models.get_model(app_label, model_name) if model is None: raise CommandError("%s.%s is not a valid model name" % ( app_label, ...
<commit_before>from django.db import models from django.core.management.base import CommandError def get_variant(app_label, model_name, field_name, variant_name): model = models.get_model(app_label, model_name) if model is None: raise CommandError("%s.%s is not a valid model name" % ( app_...
b16bd59125fc5a800f5806f713fda3da4446d73c
pokemongo_bot/cell_workers/utils.py
pokemongo_bot/cell_workers/utils.py
# -*- coding: utf-8 -*- import struct from math import cos, asin, sqrt def distance(lat1, lon1, lat2, lon2): p = 0.017453292519943295 a = 0.5 - cos((lat2 - lat1) * p)/2 + cos(lat1 * p) * cos(lat2 * p) * (1 - cos((lon2 - lon1) * p)) / 2 return 12742 * asin(sqrt(a)) * 1000 def i2f(int): return struct.u...
# -*- coding: utf-8 -*- import struct from math import cos, asin, sqrt def distance(lat1, lon1, lat2, lon2): p = 0.017453292519943295 a = 0.5 - cos((lat2 - lat1) * p)/2 + cos(lat1 * p) * cos(lat2 * p) * (1 - cos((lon2 - lon1) * p)) / 2 return 12742 * asin(sqrt(a)) * 1000 def i2f(int): return struct.u...
Fix encoding error when printing messages
Fix encoding error when printing messages Some messages that will be printed will contain utf-8 chars, e.g. Pokestops in European locations.
Python
mit
joergpatz/PokemonGo-Bot,dtee/PokemonGo-Bot,lythien/pokemongo,codybaldwin/PokemonGo-Bot,dhluong90/PokemonGo-Bot,dtee/PokemonGo-Bot,Gobberwart/PokemonGo-Bot,tibotic/simple-pokemongo-bot,yahwes/PokemonGo-Bot,Gobberwart/PokemonGo-Bot,Gobberwart/PokemonGo-Bot,halsafar/PokemonGo-Bot,bbiiggppiigg/PokemonGo-Bot,heihachi/Pokemo...
# -*- coding: utf-8 -*- import struct from math import cos, asin, sqrt def distance(lat1, lon1, lat2, lon2): p = 0.017453292519943295 a = 0.5 - cos((lat2 - lat1) * p)/2 + cos(lat1 * p) * cos(lat2 * p) * (1 - cos((lon2 - lon1) * p)) / 2 return 12742 * asin(sqrt(a)) * 1000 def i2f(int): return struct.u...
# -*- coding: utf-8 -*- import struct from math import cos, asin, sqrt def distance(lat1, lon1, lat2, lon2): p = 0.017453292519943295 a = 0.5 - cos((lat2 - lat1) * p)/2 + cos(lat1 * p) * cos(lat2 * p) * (1 - cos((lon2 - lon1) * p)) / 2 return 12742 * asin(sqrt(a)) * 1000 def i2f(int): return struct.u...
<commit_before># -*- coding: utf-8 -*- import struct from math import cos, asin, sqrt def distance(lat1, lon1, lat2, lon2): p = 0.017453292519943295 a = 0.5 - cos((lat2 - lat1) * p)/2 + cos(lat1 * p) * cos(lat2 * p) * (1 - cos((lon2 - lon1) * p)) / 2 return 12742 * asin(sqrt(a)) * 1000 def i2f(int): ...
# -*- coding: utf-8 -*- import struct from math import cos, asin, sqrt def distance(lat1, lon1, lat2, lon2): p = 0.017453292519943295 a = 0.5 - cos((lat2 - lat1) * p)/2 + cos(lat1 * p) * cos(lat2 * p) * (1 - cos((lon2 - lon1) * p)) / 2 return 12742 * asin(sqrt(a)) * 1000 def i2f(int): return struct.u...
# -*- coding: utf-8 -*- import struct from math import cos, asin, sqrt def distance(lat1, lon1, lat2, lon2): p = 0.017453292519943295 a = 0.5 - cos((lat2 - lat1) * p)/2 + cos(lat1 * p) * cos(lat2 * p) * (1 - cos((lon2 - lon1) * p)) / 2 return 12742 * asin(sqrt(a)) * 1000 def i2f(int): return struct.u...
<commit_before># -*- coding: utf-8 -*- import struct from math import cos, asin, sqrt def distance(lat1, lon1, lat2, lon2): p = 0.017453292519943295 a = 0.5 - cos((lat2 - lat1) * p)/2 + cos(lat1 * p) * cos(lat2 * p) * (1 - cos((lon2 - lon1) * p)) / 2 return 12742 * asin(sqrt(a)) * 1000 def i2f(int): ...
a1f93a76782b0bf406a16d36f0f60aea8b855566
cogs/points.py
cogs/points.py
from discord.ext import commands from utils import * import discord import asyncio import sqlite3 from member import Member class Points: def __init__(self,bot): self.bot = bot #Test method to populate an array from discord -Infinite @commands.command() @commands.has_role('Leadership') @...
from discord.ext import commands from utils import * import discord import asyncio import sqlite3 from member import Member class Points: def __init__(self,bot): self.bot = bot #Test method to populate an array from discord -Infinite @commands.command() @commands.has_role('Leadership') @...
Fix getmembers command to get role instead of top role.
Fix getmembers command to get role instead of top role.
Python
agpl-3.0
freiheit/Bay-Oh-Woolph,dark-echo/Bay-Oh-Woolph
from discord.ext import commands from utils import * import discord import asyncio import sqlite3 from member import Member class Points: def __init__(self,bot): self.bot = bot #Test method to populate an array from discord -Infinite @commands.command() @commands.has_role('Leadership') @...
from discord.ext import commands from utils import * import discord import asyncio import sqlite3 from member import Member class Points: def __init__(self,bot): self.bot = bot #Test method to populate an array from discord -Infinite @commands.command() @commands.has_role('Leadership') @...
<commit_before>from discord.ext import commands from utils import * import discord import asyncio import sqlite3 from member import Member class Points: def __init__(self,bot): self.bot = bot #Test method to populate an array from discord -Infinite @commands.command() @commands.has_role('Le...
from discord.ext import commands from utils import * import discord import asyncio import sqlite3 from member import Member class Points: def __init__(self,bot): self.bot = bot #Test method to populate an array from discord -Infinite @commands.command() @commands.has_role('Leadership') @...
from discord.ext import commands from utils import * import discord import asyncio import sqlite3 from member import Member class Points: def __init__(self,bot): self.bot = bot #Test method to populate an array from discord -Infinite @commands.command() @commands.has_role('Leadership') @...
<commit_before>from discord.ext import commands from utils import * import discord import asyncio import sqlite3 from member import Member class Points: def __init__(self,bot): self.bot = bot #Test method to populate an array from discord -Infinite @commands.command() @commands.has_role('Le...
8603d5e83f1eeac84990cb5353b166dd35fa8140
cyder/base/eav/forms.py
cyder/base/eav/forms.py
from django import forms from django.core.exceptions import ValidationError from cyder.base.eav.models import Attribute class AttributeFormField(forms.CharField): def to_python(self, value): try: return Attribute.objects.get( name=value) except Attribute.DoesNotExist: ...
from django import forms from django.core.exceptions import ValidationError from cyder.base.eav.models import Attribute class AttributeFormField(forms.CharField): def to_python(self, value): try: return Attribute.objects.get( name=value) except Attribute.DoesNotExist: ...
Fix EAV creation form; fix form error bug
Fix EAV creation form; fix form error bug
Python
bsd-3-clause
drkitty/cyder,OSU-Net/cyder,OSU-Net/cyder,zeeman/cyder,akeym/cyder,OSU-Net/cyder,akeym/cyder,zeeman/cyder,zeeman/cyder,murrown/cyder,murrown/cyder,OSU-Net/cyder,drkitty/cyder,murrown/cyder,zeeman/cyder,drkitty/cyder,murrown/cyder,akeym/cyder,akeym/cyder,drkitty/cyder
from django import forms from django.core.exceptions import ValidationError from cyder.base.eav.models import Attribute class AttributeFormField(forms.CharField): def to_python(self, value): try: return Attribute.objects.get( name=value) except Attribute.DoesNotExist: ...
from django import forms from django.core.exceptions import ValidationError from cyder.base.eav.models import Attribute class AttributeFormField(forms.CharField): def to_python(self, value): try: return Attribute.objects.get( name=value) except Attribute.DoesNotExist: ...
<commit_before>from django import forms from django.core.exceptions import ValidationError from cyder.base.eav.models import Attribute class AttributeFormField(forms.CharField): def to_python(self, value): try: return Attribute.objects.get( name=value) except Attribute...
from django import forms from django.core.exceptions import ValidationError from cyder.base.eav.models import Attribute class AttributeFormField(forms.CharField): def to_python(self, value): try: return Attribute.objects.get( name=value) except Attribute.DoesNotExist: ...
from django import forms from django.core.exceptions import ValidationError from cyder.base.eav.models import Attribute class AttributeFormField(forms.CharField): def to_python(self, value): try: return Attribute.objects.get( name=value) except Attribute.DoesNotExist: ...
<commit_before>from django import forms from django.core.exceptions import ValidationError from cyder.base.eav.models import Attribute class AttributeFormField(forms.CharField): def to_python(self, value): try: return Attribute.objects.get( name=value) except Attribute...
b4c7a8d35d94f767154da44509a77010b585fe13
daiquiri/query/views.py
daiquiri/query/views.py
from django.views.generic import TemplateView from daiquiri.core.views import ModelPermissionMixin, AnonymousAccessMixin from daiquiri.core.utils import get_model_field_meta from .models import QueryJob, Example class QueryView(AnonymousAccessMixin, TemplateView): template_name = 'query/query.html' anonymou...
from django.contrib.auth.mixins import LoginRequiredMixin from django.views.generic import TemplateView from daiquiri.core.views import ModelPermissionMixin, AnonymousAccessMixin from daiquiri.core.utils import get_model_field_meta from .models import QueryJob, Example class QueryView(AnonymousAccessMixin, Template...
Disable jobs overview for anonymous users
Disable jobs overview for anonymous users
Python
apache-2.0
aipescience/django-daiquiri,aipescience/django-daiquiri,aipescience/django-daiquiri
from django.views.generic import TemplateView from daiquiri.core.views import ModelPermissionMixin, AnonymousAccessMixin from daiquiri.core.utils import get_model_field_meta from .models import QueryJob, Example class QueryView(AnonymousAccessMixin, TemplateView): template_name = 'query/query.html' anonymou...
from django.contrib.auth.mixins import LoginRequiredMixin from django.views.generic import TemplateView from daiquiri.core.views import ModelPermissionMixin, AnonymousAccessMixin from daiquiri.core.utils import get_model_field_meta from .models import QueryJob, Example class QueryView(AnonymousAccessMixin, Template...
<commit_before>from django.views.generic import TemplateView from daiquiri.core.views import ModelPermissionMixin, AnonymousAccessMixin from daiquiri.core.utils import get_model_field_meta from .models import QueryJob, Example class QueryView(AnonymousAccessMixin, TemplateView): template_name = 'query/query.htm...
from django.contrib.auth.mixins import LoginRequiredMixin from django.views.generic import TemplateView from daiquiri.core.views import ModelPermissionMixin, AnonymousAccessMixin from daiquiri.core.utils import get_model_field_meta from .models import QueryJob, Example class QueryView(AnonymousAccessMixin, Template...
from django.views.generic import TemplateView from daiquiri.core.views import ModelPermissionMixin, AnonymousAccessMixin from daiquiri.core.utils import get_model_field_meta from .models import QueryJob, Example class QueryView(AnonymousAccessMixin, TemplateView): template_name = 'query/query.html' anonymou...
<commit_before>from django.views.generic import TemplateView from daiquiri.core.views import ModelPermissionMixin, AnonymousAccessMixin from daiquiri.core.utils import get_model_field_meta from .models import QueryJob, Example class QueryView(AnonymousAccessMixin, TemplateView): template_name = 'query/query.htm...
d2eae3e1d5041d5dcd967375cfe3a57079f97c22
builder/destroyer.py
builder/destroyer.py
import yaml from builder import utils def bind_subparser(subparsers): parser_destroy = subparsers.add_parser('destroy') parser_destroy.set_defaults(func=destroy) return parser_destroy def destroy(args, cloud, tracker): """Destroy a previously built environment.""" created_servers = set() al...
import yaml from builder import utils def bind_subparser(subparsers): parser_destroy = subparsers.add_parser('destroy') parser_destroy.set_defaults(func=destroy) return parser_destroy def destroy(args, cloud, tracker): """Destroy a previously built environment.""" created_servers = set() al...
Use attr access vs key
Use attr access vs key
Python
apache-2.0
harlowja/multi-devstack,harlowja/multi-devstack
import yaml from builder import utils def bind_subparser(subparsers): parser_destroy = subparsers.add_parser('destroy') parser_destroy.set_defaults(func=destroy) return parser_destroy def destroy(args, cloud, tracker): """Destroy a previously built environment.""" created_servers = set() al...
import yaml from builder import utils def bind_subparser(subparsers): parser_destroy = subparsers.add_parser('destroy') parser_destroy.set_defaults(func=destroy) return parser_destroy def destroy(args, cloud, tracker): """Destroy a previously built environment.""" created_servers = set() al...
<commit_before>import yaml from builder import utils def bind_subparser(subparsers): parser_destroy = subparsers.add_parser('destroy') parser_destroy.set_defaults(func=destroy) return parser_destroy def destroy(args, cloud, tracker): """Destroy a previously built environment.""" created_servers...
import yaml from builder import utils def bind_subparser(subparsers): parser_destroy = subparsers.add_parser('destroy') parser_destroy.set_defaults(func=destroy) return parser_destroy def destroy(args, cloud, tracker): """Destroy a previously built environment.""" created_servers = set() al...
import yaml from builder import utils def bind_subparser(subparsers): parser_destroy = subparsers.add_parser('destroy') parser_destroy.set_defaults(func=destroy) return parser_destroy def destroy(args, cloud, tracker): """Destroy a previously built environment.""" created_servers = set() al...
<commit_before>import yaml from builder import utils def bind_subparser(subparsers): parser_destroy = subparsers.add_parser('destroy') parser_destroy.set_defaults(func=destroy) return parser_destroy def destroy(args, cloud, tracker): """Destroy a previously built environment.""" created_servers...
e4b1b8346834ad1ea8a176184a5b6443a2a91099
ddsc_incron/settings.py
ddsc_incron/settings.py
# Note that logging to a single file from multiple processes is NOT supported. # See: http://docs.python.org/2/howto/logging-cookbook.html # #logging-to-a-single-file-from-multiple-processes # This very much applies to ddsc-incron! # TODO: Consider ConcurrentLogHandler on pypi when this bug is solved? # https://bugzil...
from __future__ import absolute_import from ddsc_incron.celery import celery # Note that logging to a single file from multiple processes is NOT supported. # See: http://docs.python.org/2/howto/logging-cookbook.html # #logging-to-a-single-file-from-multiple-processes # This very much applies to ddsc-incron! # TODO: ...
Add handler for logging to RabbitMQ
Add handler for logging to RabbitMQ
Python
mit
ddsc/ddsc-incron
# Note that logging to a single file from multiple processes is NOT supported. # See: http://docs.python.org/2/howto/logging-cookbook.html # #logging-to-a-single-file-from-multiple-processes # This very much applies to ddsc-incron! # TODO: Consider ConcurrentLogHandler on pypi when this bug is solved? # https://bugzil...
from __future__ import absolute_import from ddsc_incron.celery import celery # Note that logging to a single file from multiple processes is NOT supported. # See: http://docs.python.org/2/howto/logging-cookbook.html # #logging-to-a-single-file-from-multiple-processes # This very much applies to ddsc-incron! # TODO: ...
<commit_before># Note that logging to a single file from multiple processes is NOT supported. # See: http://docs.python.org/2/howto/logging-cookbook.html # #logging-to-a-single-file-from-multiple-processes # This very much applies to ddsc-incron! # TODO: Consider ConcurrentLogHandler on pypi when this bug is solved? #...
from __future__ import absolute_import from ddsc_incron.celery import celery # Note that logging to a single file from multiple processes is NOT supported. # See: http://docs.python.org/2/howto/logging-cookbook.html # #logging-to-a-single-file-from-multiple-processes # This very much applies to ddsc-incron! # TODO: ...
# Note that logging to a single file from multiple processes is NOT supported. # See: http://docs.python.org/2/howto/logging-cookbook.html # #logging-to-a-single-file-from-multiple-processes # This very much applies to ddsc-incron! # TODO: Consider ConcurrentLogHandler on pypi when this bug is solved? # https://bugzil...
<commit_before># Note that logging to a single file from multiple processes is NOT supported. # See: http://docs.python.org/2/howto/logging-cookbook.html # #logging-to-a-single-file-from-multiple-processes # This very much applies to ddsc-incron! # TODO: Consider ConcurrentLogHandler on pypi when this bug is solved? #...
170d08442aeabaa5f8e2fb1fef14f9e6464eeeab
core/parser.py
core/parser.py
class Parser(object): """ Parser class definition. Takes care of parsing the fail2ban log, either in "all" mode or "realtime". """ def __init__(self, config, mode=None): """ Inits the object by registering the configuration object """ self.config = config if...
class Parser(object): """ Parser class definition. Takes care of parsing the fail2ban log, either in "all" mode or "realtime". """ def __init__(self, config, mode=None): """ Inits the object by registering the configuration object """ self.config = config if...
Add : implemented parsing method.
Add : implemented parsing method.
Python
mit
nocternology/fail2dash,nocternology/fail2dash
class Parser(object): """ Parser class definition. Takes care of parsing the fail2ban log, either in "all" mode or "realtime". """ def __init__(self, config, mode=None): """ Inits the object by registering the configuration object """ self.config = config if...
class Parser(object): """ Parser class definition. Takes care of parsing the fail2ban log, either in "all" mode or "realtime". """ def __init__(self, config, mode=None): """ Inits the object by registering the configuration object """ self.config = config if...
<commit_before>class Parser(object): """ Parser class definition. Takes care of parsing the fail2ban log, either in "all" mode or "realtime". """ def __init__(self, config, mode=None): """ Inits the object by registering the configuration object """ self.config = co...
class Parser(object): """ Parser class definition. Takes care of parsing the fail2ban log, either in "all" mode or "realtime". """ def __init__(self, config, mode=None): """ Inits the object by registering the configuration object """ self.config = config if...
class Parser(object): """ Parser class definition. Takes care of parsing the fail2ban log, either in "all" mode or "realtime". """ def __init__(self, config, mode=None): """ Inits the object by registering the configuration object """ self.config = config if...
<commit_before>class Parser(object): """ Parser class definition. Takes care of parsing the fail2ban log, either in "all" mode or "realtime". """ def __init__(self, config, mode=None): """ Inits the object by registering the configuration object """ self.config = co...
c72fee131a1fd3e657ea73ae98da1f5b4b021995
books/CrackingCodesWithPython/Chapter20/vigenereDictionaryHacker.py
books/CrackingCodesWithPython/Chapter20/vigenereDictionaryHacker.py
# Vigenere Cipher Dictionary Hacker # https://www.nostarch.com/crackingcodes/ (BSD Licensed) import detectEnglish, vigenereCipher, pyperclip def main(): ciphertext = """Tzx isnz eccjxkg nfq lol mys bbqq I lxcz.""" hackedMessage = hackVigenereDictionary(ciphertext) if hackedMessage != None: print(...
# Vigenère Cipher Dictionary Hacker # https://www.nostarch.com/crackingcodes/ (BSD Licensed) import detectEnglish, vigenereCipher, pyperclip def main(): ciphertext = """Tzx isnz eccjxkg nfq lol mys bbqq I lxcz.""" hackedMessage = hackVigenereDictionary(ciphertext) if hackedMessage != None: print(...
Update vigenereDicitonaryHacker: added è character
Update vigenereDicitonaryHacker: added è character
Python
mit
JoseALermaIII/python-tutorials,JoseALermaIII/python-tutorials
# Vigenere Cipher Dictionary Hacker # https://www.nostarch.com/crackingcodes/ (BSD Licensed) import detectEnglish, vigenereCipher, pyperclip def main(): ciphertext = """Tzx isnz eccjxkg nfq lol mys bbqq I lxcz.""" hackedMessage = hackVigenereDictionary(ciphertext) if hackedMessage != None: print(...
# Vigenère Cipher Dictionary Hacker # https://www.nostarch.com/crackingcodes/ (BSD Licensed) import detectEnglish, vigenereCipher, pyperclip def main(): ciphertext = """Tzx isnz eccjxkg nfq lol mys bbqq I lxcz.""" hackedMessage = hackVigenereDictionary(ciphertext) if hackedMessage != None: print(...
<commit_before># Vigenere Cipher Dictionary Hacker # https://www.nostarch.com/crackingcodes/ (BSD Licensed) import detectEnglish, vigenereCipher, pyperclip def main(): ciphertext = """Tzx isnz eccjxkg nfq lol mys bbqq I lxcz.""" hackedMessage = hackVigenereDictionary(ciphertext) if hackedMessage != None:...
# Vigenère Cipher Dictionary Hacker # https://www.nostarch.com/crackingcodes/ (BSD Licensed) import detectEnglish, vigenereCipher, pyperclip def main(): ciphertext = """Tzx isnz eccjxkg nfq lol mys bbqq I lxcz.""" hackedMessage = hackVigenereDictionary(ciphertext) if hackedMessage != None: print(...
# Vigenere Cipher Dictionary Hacker # https://www.nostarch.com/crackingcodes/ (BSD Licensed) import detectEnglish, vigenereCipher, pyperclip def main(): ciphertext = """Tzx isnz eccjxkg nfq lol mys bbqq I lxcz.""" hackedMessage = hackVigenereDictionary(ciphertext) if hackedMessage != None: print(...
<commit_before># Vigenere Cipher Dictionary Hacker # https://www.nostarch.com/crackingcodes/ (BSD Licensed) import detectEnglish, vigenereCipher, pyperclip def main(): ciphertext = """Tzx isnz eccjxkg nfq lol mys bbqq I lxcz.""" hackedMessage = hackVigenereDictionary(ciphertext) if hackedMessage != None:...
c6c06ab8197bfe3f007bab231536656abfcf0954
docs/conf.py
docs/conf.py
# -*- coding: utf-8 -*- import os import sphinx_rtd_theme import sys REPO_DIR = os.path.dirname(os.path.dirname(__file__)) sys.path.append(REPO_DIR) project = 'Ichnaea' copyright = '2013-2019, Mozilla' # The short X.Y version. version = '2.0' # The full version, including alpha/beta/rc tags. release = '2.0' auto...
# -*- coding: utf-8 -*- import os import sphinx_rtd_theme import sys from unittest import mock # Add repository root so we can import ichnaea things REPO_DIR = os.path.dirname(os.path.dirname(__file__)) sys.path.append(REPO_DIR) # Fake the shapely module so things will import sys.modules['shapely'] = mock.MagicMoc...
Add mock for shapely module
Add mock for shapely module Adding a mock for the shapely module allows ReadTheDocs to build the docs even though Shapely isn't installed.
Python
apache-2.0
mozilla/ichnaea,mozilla/ichnaea,mozilla/ichnaea,mozilla/ichnaea
# -*- coding: utf-8 -*- import os import sphinx_rtd_theme import sys REPO_DIR = os.path.dirname(os.path.dirname(__file__)) sys.path.append(REPO_DIR) project = 'Ichnaea' copyright = '2013-2019, Mozilla' # The short X.Y version. version = '2.0' # The full version, including alpha/beta/rc tags. release = '2.0' auto...
# -*- coding: utf-8 -*- import os import sphinx_rtd_theme import sys from unittest import mock # Add repository root so we can import ichnaea things REPO_DIR = os.path.dirname(os.path.dirname(__file__)) sys.path.append(REPO_DIR) # Fake the shapely module so things will import sys.modules['shapely'] = mock.MagicMoc...
<commit_before># -*- coding: utf-8 -*- import os import sphinx_rtd_theme import sys REPO_DIR = os.path.dirname(os.path.dirname(__file__)) sys.path.append(REPO_DIR) project = 'Ichnaea' copyright = '2013-2019, Mozilla' # The short X.Y version. version = '2.0' # The full version, including alpha/beta/rc tags. releas...
# -*- coding: utf-8 -*- import os import sphinx_rtd_theme import sys from unittest import mock # Add repository root so we can import ichnaea things REPO_DIR = os.path.dirname(os.path.dirname(__file__)) sys.path.append(REPO_DIR) # Fake the shapely module so things will import sys.modules['shapely'] = mock.MagicMoc...
# -*- coding: utf-8 -*- import os import sphinx_rtd_theme import sys REPO_DIR = os.path.dirname(os.path.dirname(__file__)) sys.path.append(REPO_DIR) project = 'Ichnaea' copyright = '2013-2019, Mozilla' # The short X.Y version. version = '2.0' # The full version, including alpha/beta/rc tags. release = '2.0' auto...
<commit_before># -*- coding: utf-8 -*- import os import sphinx_rtd_theme import sys REPO_DIR = os.path.dirname(os.path.dirname(__file__)) sys.path.append(REPO_DIR) project = 'Ichnaea' copyright = '2013-2019, Mozilla' # The short X.Y version. version = '2.0' # The full version, including alpha/beta/rc tags. releas...
c6447310063a1521d83a4f7fd0b4bc548d54835b
test/test_get_new.py
test/test_get_new.py
from __future__ import absolute_import, print_function from ..pyautoupdate.launcher import Launcher from .pytest_skipif import needinternet from .pytest_makevers import fixture_update_dir import pytest import os @pytest.mark.trylast @needinternet def test_check_vers_update(fixture_update_dir): package=fixture_u...
from __future__ import absolute_import, print_function from ..pyautoupdate.launcher import Launcher from .pytest_skipif import needinternet from .pytest_makevers import fixture_update_dir import pytest import os import sys @pytest.fixture("function") def create_zip(request): def teardown(): if os.path.i...
Add create_zip fixture to get_new test to cover more branches
Add create_zip fixture to get_new test to cover more branches
Python
lgpl-2.1
rlee287/pyautoupdate,rlee287/pyautoupdate
from __future__ import absolute_import, print_function from ..pyautoupdate.launcher import Launcher from .pytest_skipif import needinternet from .pytest_makevers import fixture_update_dir import pytest import os @pytest.mark.trylast @needinternet def test_check_vers_update(fixture_update_dir): package=fixture_u...
from __future__ import absolute_import, print_function from ..pyautoupdate.launcher import Launcher from .pytest_skipif import needinternet from .pytest_makevers import fixture_update_dir import pytest import os import sys @pytest.fixture("function") def create_zip(request): def teardown(): if os.path.i...
<commit_before>from __future__ import absolute_import, print_function from ..pyautoupdate.launcher import Launcher from .pytest_skipif import needinternet from .pytest_makevers import fixture_update_dir import pytest import os @pytest.mark.trylast @needinternet def test_check_vers_update(fixture_update_dir): pa...
from __future__ import absolute_import, print_function from ..pyautoupdate.launcher import Launcher from .pytest_skipif import needinternet from .pytest_makevers import fixture_update_dir import pytest import os import sys @pytest.fixture("function") def create_zip(request): def teardown(): if os.path.i...
from __future__ import absolute_import, print_function from ..pyautoupdate.launcher import Launcher from .pytest_skipif import needinternet from .pytest_makevers import fixture_update_dir import pytest import os @pytest.mark.trylast @needinternet def test_check_vers_update(fixture_update_dir): package=fixture_u...
<commit_before>from __future__ import absolute_import, print_function from ..pyautoupdate.launcher import Launcher from .pytest_skipif import needinternet from .pytest_makevers import fixture_update_dir import pytest import os @pytest.mark.trylast @needinternet def test_check_vers_update(fixture_update_dir): pa...
81246153033d38132903759cb7e33cf86c26a548
tests/test_attime.py
tests/test_attime.py
import datetime import time from graphite_api.render.attime import parseATTime from . import TestCase class AtTestCase(TestCase): def test_parse(self): for value in [ str(int(time.time())), '20140319', '20130319+1y', '20130319+1mon', '20130319+...
import datetime import time from graphite_api.render.attime import parseATTime from . import TestCase class AtTestCase(TestCase): def test_parse(self): for value in [ str(int(time.time())), '20140319', '20130319+1y', '20130319+1mon', '20130319+...
Make sure HH:MM values are allowed
Make sure HH:MM values are allowed
Python
apache-2.0
michaelrice/graphite-api,alphapigger/graphite-api,Knewton/graphite-api,vladimir-smirnov-sociomantic/graphite-api,hubrick/graphite-api,GeorgeJahad/graphite-api,absalon-james/graphite-api,raintank/graphite-api,winguru/graphite-api,DaveBlooman/graphite-api,absalon-james/graphite-api,alphapigger/graphite-api,raintank/graph...
import datetime import time from graphite_api.render.attime import parseATTime from . import TestCase class AtTestCase(TestCase): def test_parse(self): for value in [ str(int(time.time())), '20140319', '20130319+1y', '20130319+1mon', '20130319+...
import datetime import time from graphite_api.render.attime import parseATTime from . import TestCase class AtTestCase(TestCase): def test_parse(self): for value in [ str(int(time.time())), '20140319', '20130319+1y', '20130319+1mon', '20130319+...
<commit_before>import datetime import time from graphite_api.render.attime import parseATTime from . import TestCase class AtTestCase(TestCase): def test_parse(self): for value in [ str(int(time.time())), '20140319', '20130319+1y', '20130319+1mon', ...
import datetime import time from graphite_api.render.attime import parseATTime from . import TestCase class AtTestCase(TestCase): def test_parse(self): for value in [ str(int(time.time())), '20140319', '20130319+1y', '20130319+1mon', '20130319+...
import datetime import time from graphite_api.render.attime import parseATTime from . import TestCase class AtTestCase(TestCase): def test_parse(self): for value in [ str(int(time.time())), '20140319', '20130319+1y', '20130319+1mon', '20130319+...
<commit_before>import datetime import time from graphite_api.render.attime import parseATTime from . import TestCase class AtTestCase(TestCase): def test_parse(self): for value in [ str(int(time.time())), '20140319', '20130319+1y', '20130319+1mon', ...
21d45e38d07a413aeeb19e10a68e540d1f6d5851
core/forms.py
core/forms.py
# -*- encoding: UTF-8 -*- from core import settings as stCore from django import forms from django.conf import settings as st from django.contrib.flatpages.admin import FlatpageForm from django.contrib.sites.models import Site from django.forms.widgets import HiddenInput, MultipleHiddenInput class PageForm(FlatpageF...
# -*- encoding: UTF-8 -*- from core import settings as stCore from django import forms from django.conf import settings as st from flatpages_i18n.forms import FlatpageForm from django.contrib.sites.models import Site from django.forms.widgets import HiddenInput, MultipleHiddenInput class PageForm(FlatpageForm): ...
Remove last references to flatpage so it doesnt show up on admin page
Remove last references to flatpage so it doesnt show up on admin page
Python
agpl-3.0
tic-ull/portal-del-investigador,tic-ull/portal-del-investigador,tic-ull/portal-del-investigador,tic-ull/portal-del-investigador
# -*- encoding: UTF-8 -*- from core import settings as stCore from django import forms from django.conf import settings as st from django.contrib.flatpages.admin import FlatpageForm from django.contrib.sites.models import Site from django.forms.widgets import HiddenInput, MultipleHiddenInput class PageForm(FlatpageF...
# -*- encoding: UTF-8 -*- from core import settings as stCore from django import forms from django.conf import settings as st from flatpages_i18n.forms import FlatpageForm from django.contrib.sites.models import Site from django.forms.widgets import HiddenInput, MultipleHiddenInput class PageForm(FlatpageForm): ...
<commit_before># -*- encoding: UTF-8 -*- from core import settings as stCore from django import forms from django.conf import settings as st from django.contrib.flatpages.admin import FlatpageForm from django.contrib.sites.models import Site from django.forms.widgets import HiddenInput, MultipleHiddenInput class Pag...
# -*- encoding: UTF-8 -*- from core import settings as stCore from django import forms from django.conf import settings as st from flatpages_i18n.forms import FlatpageForm from django.contrib.sites.models import Site from django.forms.widgets import HiddenInput, MultipleHiddenInput class PageForm(FlatpageForm): ...
# -*- encoding: UTF-8 -*- from core import settings as stCore from django import forms from django.conf import settings as st from django.contrib.flatpages.admin import FlatpageForm from django.contrib.sites.models import Site from django.forms.widgets import HiddenInput, MultipleHiddenInput class PageForm(FlatpageF...
<commit_before># -*- encoding: UTF-8 -*- from core import settings as stCore from django import forms from django.conf import settings as st from django.contrib.flatpages.admin import FlatpageForm from django.contrib.sites.models import Site from django.forms.widgets import HiddenInput, MultipleHiddenInput class Pag...
ac0f0780beb61cab95809b2e0d02e5dab481e225
py/valid-parenthesis-string.py
py/valid-parenthesis-string.py
from collections import Counter class Solution(object): def dfs(self, s, pos, stack): if stack + self.min_possible_opening[-1] - self.min_possible_opening[pos] > self.max_possible_closing[-1] - self.max_possible_closing[pos]: return False if stack + self.max_possible_opening[-1] - self.m...
class Solution(object): def checkValidString(self, s): """ :type s: str :rtype: bool """ lowest, highest = 0, 0 for c in s: if c == '(': lowest += 1 highest += 1 elif c == ')': if lowest > 0: ...
Add py solution for 678. Valid Parenthesis String
Add py solution for 678. Valid Parenthesis String 678. Valid Parenthesis String: https://leetcode.com/problems/valid-parenthesis-string/ Approach2: Maintain the lowest/highest possible stack size and check if one of them is invalid O(n) time, O(1) size
Python
apache-2.0
ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode
from collections import Counter class Solution(object): def dfs(self, s, pos, stack): if stack + self.min_possible_opening[-1] - self.min_possible_opening[pos] > self.max_possible_closing[-1] - self.max_possible_closing[pos]: return False if stack + self.max_possible_opening[-1] - self.m...
class Solution(object): def checkValidString(self, s): """ :type s: str :rtype: bool """ lowest, highest = 0, 0 for c in s: if c == '(': lowest += 1 highest += 1 elif c == ')': if lowest > 0: ...
<commit_before>from collections import Counter class Solution(object): def dfs(self, s, pos, stack): if stack + self.min_possible_opening[-1] - self.min_possible_opening[pos] > self.max_possible_closing[-1] - self.max_possible_closing[pos]: return False if stack + self.max_possible_openi...
class Solution(object): def checkValidString(self, s): """ :type s: str :rtype: bool """ lowest, highest = 0, 0 for c in s: if c == '(': lowest += 1 highest += 1 elif c == ')': if lowest > 0: ...
from collections import Counter class Solution(object): def dfs(self, s, pos, stack): if stack + self.min_possible_opening[-1] - self.min_possible_opening[pos] > self.max_possible_closing[-1] - self.max_possible_closing[pos]: return False if stack + self.max_possible_opening[-1] - self.m...
<commit_before>from collections import Counter class Solution(object): def dfs(self, s, pos, stack): if stack + self.min_possible_opening[-1] - self.min_possible_opening[pos] > self.max_possible_closing[-1] - self.max_possible_closing[pos]: return False if stack + self.max_possible_openi...
9c982053f4d9c9696214d7c20ab32204d27e4a94
django/__init__.py
django/__init__.py
VERSION = (1, 6, 0, 'beta', 4) def get_version(*args, **kwargs): # Don't litter django/__init__.py with all the get_version stuff. # Only import if it's actually called. from django.utils.version import get_version return get_version(*args, **kwargs)
VERSION = (1, 6, 0, 'rc', 1) def get_version(*args, **kwargs): # Don't litter django/__init__.py with all the get_version stuff. # Only import if it's actually called. from django.utils.version import get_version return get_version(*args, **kwargs)
Bump version number for 1.6 release candidate.
[1.6.x] Bump version number for 1.6 release candidate.
Python
bsd-3-clause
dex4er/django,dex4er/django,django-nonrel/django,felixjimenez/django,django-nonrel/django,dex4er/django,felixjimenez/django,django-nonrel/django,django-nonrel/django,redhat-openstack/django,redhat-openstack/django,redhat-openstack/django,felixjimenez/django,redhat-openstack/django,felixjimenez/django
VERSION = (1, 6, 0, 'beta', 4) def get_version(*args, **kwargs): # Don't litter django/__init__.py with all the get_version stuff. # Only import if it's actually called. from django.utils.version import get_version return get_version(*args, **kwargs) [1.6.x] Bump version number for 1.6 release candidat...
VERSION = (1, 6, 0, 'rc', 1) def get_version(*args, **kwargs): # Don't litter django/__init__.py with all the get_version stuff. # Only import if it's actually called. from django.utils.version import get_version return get_version(*args, **kwargs)
<commit_before>VERSION = (1, 6, 0, 'beta', 4) def get_version(*args, **kwargs): # Don't litter django/__init__.py with all the get_version stuff. # Only import if it's actually called. from django.utils.version import get_version return get_version(*args, **kwargs) <commit_msg>[1.6.x] Bump version numb...
VERSION = (1, 6, 0, 'rc', 1) def get_version(*args, **kwargs): # Don't litter django/__init__.py with all the get_version stuff. # Only import if it's actually called. from django.utils.version import get_version return get_version(*args, **kwargs)
VERSION = (1, 6, 0, 'beta', 4) def get_version(*args, **kwargs): # Don't litter django/__init__.py with all the get_version stuff. # Only import if it's actually called. from django.utils.version import get_version return get_version(*args, **kwargs) [1.6.x] Bump version number for 1.6 release candidat...
<commit_before>VERSION = (1, 6, 0, 'beta', 4) def get_version(*args, **kwargs): # Don't litter django/__init__.py with all the get_version stuff. # Only import if it's actually called. from django.utils.version import get_version return get_version(*args, **kwargs) <commit_msg>[1.6.x] Bump version numb...
32637c1e9a37dc416df802805420d38f9af18d79
django_lightweight_queue/management/commands/queue_configuration.py
django_lightweight_queue/management/commands/queue_configuration.py
from django.core.management.base import BaseCommand from ... import app_settings from ...utils import get_backend, load_extra_config from ...cron_scheduler import get_cron_config class Command(BaseCommand): def add_arguments(self, parser): parser.add_argument('--config', action='store', default=None, ...
from django.core.management.base import BaseCommand from ... import app_settings from ...utils import get_backend, load_extra_config from ...cron_scheduler import get_cron_config class Command(BaseCommand): def add_arguments(self, parser): parser.add_argument('--config', action='store', default=None, ...
Print the discovered queues in alphabetical order for convenience
Print the discovered queues in alphabetical order for convenience
Python
bsd-3-clause
thread/django-lightweight-queue,thread/django-lightweight-queue
from django.core.management.base import BaseCommand from ... import app_settings from ...utils import get_backend, load_extra_config from ...cron_scheduler import get_cron_config class Command(BaseCommand): def add_arguments(self, parser): parser.add_argument('--config', action='store', default=None, ...
from django.core.management.base import BaseCommand from ... import app_settings from ...utils import get_backend, load_extra_config from ...cron_scheduler import get_cron_config class Command(BaseCommand): def add_arguments(self, parser): parser.add_argument('--config', action='store', default=None, ...
<commit_before>from django.core.management.base import BaseCommand from ... import app_settings from ...utils import get_backend, load_extra_config from ...cron_scheduler import get_cron_config class Command(BaseCommand): def add_arguments(self, parser): parser.add_argument('--config', action='store', de...
from django.core.management.base import BaseCommand from ... import app_settings from ...utils import get_backend, load_extra_config from ...cron_scheduler import get_cron_config class Command(BaseCommand): def add_arguments(self, parser): parser.add_argument('--config', action='store', default=None, ...
from django.core.management.base import BaseCommand from ... import app_settings from ...utils import get_backend, load_extra_config from ...cron_scheduler import get_cron_config class Command(BaseCommand): def add_arguments(self, parser): parser.add_argument('--config', action='store', default=None, ...
<commit_before>from django.core.management.base import BaseCommand from ... import app_settings from ...utils import get_backend, load_extra_config from ...cron_scheduler import get_cron_config class Command(BaseCommand): def add_arguments(self, parser): parser.add_argument('--config', action='store', de...
e1e7b72685df12d1d7d782e03878253663a4c790
mysite/scripts/remove_numbers_from_locations.py
mysite/scripts/remove_numbers_from_locations.py
import re import mysite Person = mysite.profile.models.Person people_with_weird_locations = Person.objects.filter(location_display_name__regex=', [0-9][0-9],') for p in people_with_weird_locations: location_pieces = re.split(r', \d\d', p.location_display_name) unweirded_location = "".join(location_pieces) ...
import re import mysite Person = mysite.profile.models.Person people_with_weird_locations = Person.objects.filter(location_display_name__regex=', [0-9][0-9],') for p in people_with_weird_locations: location_pieces = re.split(r', \d\d,', p.location_display_name) unweirded_location = ",".join(location_pieces) ...
Fix script that removes numerals from people's locations.
Fix script that removes numerals from people's locations.
Python
agpl-3.0
campbe13/openhatch,heeraj123/oh-mainline,moijes12/oh-mainline,ojengwa/oh-mainline,Changaco/oh-mainline,vipul-sharma20/oh-mainline,campbe13/openhatch,SnappleCap/oh-mainline,SnappleCap/oh-mainline,waseem18/oh-mainline,eeshangarg/oh-mainline,moijes12/oh-mainline,waseem18/oh-mainline,sudheesh001/oh-mainline,onceuponatimefo...
import re import mysite Person = mysite.profile.models.Person people_with_weird_locations = Person.objects.filter(location_display_name__regex=', [0-9][0-9],') for p in people_with_weird_locations: location_pieces = re.split(r', \d\d', p.location_display_name) unweirded_location = "".join(location_pieces) ...
import re import mysite Person = mysite.profile.models.Person people_with_weird_locations = Person.objects.filter(location_display_name__regex=', [0-9][0-9],') for p in people_with_weird_locations: location_pieces = re.split(r', \d\d,', p.location_display_name) unweirded_location = ",".join(location_pieces) ...
<commit_before>import re import mysite Person = mysite.profile.models.Person people_with_weird_locations = Person.objects.filter(location_display_name__regex=', [0-9][0-9],') for p in people_with_weird_locations: location_pieces = re.split(r', \d\d', p.location_display_name) unweirded_location = "".join(locat...
import re import mysite Person = mysite.profile.models.Person people_with_weird_locations = Person.objects.filter(location_display_name__regex=', [0-9][0-9],') for p in people_with_weird_locations: location_pieces = re.split(r', \d\d,', p.location_display_name) unweirded_location = ",".join(location_pieces) ...
import re import mysite Person = mysite.profile.models.Person people_with_weird_locations = Person.objects.filter(location_display_name__regex=', [0-9][0-9],') for p in people_with_weird_locations: location_pieces = re.split(r', \d\d', p.location_display_name) unweirded_location = "".join(location_pieces) ...
<commit_before>import re import mysite Person = mysite.profile.models.Person people_with_weird_locations = Person.objects.filter(location_display_name__regex=', [0-9][0-9],') for p in people_with_weird_locations: location_pieces = re.split(r', \d\d', p.location_display_name) unweirded_location = "".join(locat...
b23c843fda57e0ffa56aaf430d9a590e2ed0ec9a
ch06/extract_airlines.py
ch06/extract_airlines.py
# Load the on-time parquet file on_time_dataframe = spark.read.parquet('data/on_time_performance.parquet') # The first step is easily expressed as SQL: get all unique tail numbers for each airline on_time_dataframe.registerTempTable("on_time_performance") carrier_airplane = spark.sql( "SELECT DISTINCT Carrier, TailN...
# Load the on-time parquet file on_time_dataframe = spark.read.parquet('data/on_time_performance.parquet') # The first step is easily expressed as SQL: get all unique tail numbers for each airline on_time_dataframe.registerTempTable("on_time_performance") carrier_airplane = spark.sql( "SELECT DISTINCT Carrier, TailN...
Check variable for None value before null string when filtering tail numbers
Check variable for None value before null string when filtering tail numbers
Python
mit
rjurney/Agile_Data_Code_2,naoyak/Agile_Data_Code_2,rjurney/Agile_Data_Code_2,naoyak/Agile_Data_Code_2,rjurney/Agile_Data_Code_2,naoyak/Agile_Data_Code_2,rjurney/Agile_Data_Code_2,naoyak/Agile_Data_Code_2
# Load the on-time parquet file on_time_dataframe = spark.read.parquet('data/on_time_performance.parquet') # The first step is easily expressed as SQL: get all unique tail numbers for each airline on_time_dataframe.registerTempTable("on_time_performance") carrier_airplane = spark.sql( "SELECT DISTINCT Carrier, TailN...
# Load the on-time parquet file on_time_dataframe = spark.read.parquet('data/on_time_performance.parquet') # The first step is easily expressed as SQL: get all unique tail numbers for each airline on_time_dataframe.registerTempTable("on_time_performance") carrier_airplane = spark.sql( "SELECT DISTINCT Carrier, TailN...
<commit_before># Load the on-time parquet file on_time_dataframe = spark.read.parquet('data/on_time_performance.parquet') # The first step is easily expressed as SQL: get all unique tail numbers for each airline on_time_dataframe.registerTempTable("on_time_performance") carrier_airplane = spark.sql( "SELECT DISTINCT...
# Load the on-time parquet file on_time_dataframe = spark.read.parquet('data/on_time_performance.parquet') # The first step is easily expressed as SQL: get all unique tail numbers for each airline on_time_dataframe.registerTempTable("on_time_performance") carrier_airplane = spark.sql( "SELECT DISTINCT Carrier, TailN...
# Load the on-time parquet file on_time_dataframe = spark.read.parquet('data/on_time_performance.parquet') # The first step is easily expressed as SQL: get all unique tail numbers for each airline on_time_dataframe.registerTempTable("on_time_performance") carrier_airplane = spark.sql( "SELECT DISTINCT Carrier, TailN...
<commit_before># Load the on-time parquet file on_time_dataframe = spark.read.parquet('data/on_time_performance.parquet') # The first step is easily expressed as SQL: get all unique tail numbers for each airline on_time_dataframe.registerTempTable("on_time_performance") carrier_airplane = spark.sql( "SELECT DISTINCT...
dbc09d03f62bf2d5ee1661492a4c20a7942f81a9
tests/basics/list_slice.py
tests/basics/list_slice.py
# test slices; only 2 argument version supported by Micro Python at the moment x = list(range(10)) a = 2 b = 4 c = 3 print(x[:]) print(x[::]) #print(x[::c]) print(x[:b]) print(x[:b:]) #print(x[:b:c]) print(x[a]) print(x[a:]) print(x[a::]) #print(x[a::c]) print(x[a:b]) print(x[a:b:]) #print(x[a:b:c]) # these should not...
# test list slices, getting values x = list(range(10)) a = 2 b = 4 c = 3 print(x[:]) print(x[::]) print(x[::c]) print(x[:b]) print(x[:b:]) print(x[:b:c]) print(x[a]) print(x[a:]) print(x[a::]) print(x[a::c]) print(x[a:b]) print(x[a:b:]) print(x[a:b:c]) # these should not raise IndexError print([][1:]) print([][-1:]) ...
Enable tests for list slice getting with 3rd arg.
tests/basics: Enable tests for list slice getting with 3rd arg. Also add a test to check case when 3rd arg is 0.
Python
mit
tuc-osg/micropython,mhoffma/micropython,trezor/micropython,blazewicz/micropython,AriZuu/micropython,kerneltask/micropython,swegener/micropython,MrSurly/micropython,mhoffma/micropython,hiway/micropython,alex-robbins/micropython,henriknelson/micropython,tuc-osg/micropython,adafruit/micropython,selste/micropython,ryannath...
# test slices; only 2 argument version supported by Micro Python at the moment x = list(range(10)) a = 2 b = 4 c = 3 print(x[:]) print(x[::]) #print(x[::c]) print(x[:b]) print(x[:b:]) #print(x[:b:c]) print(x[a]) print(x[a:]) print(x[a::]) #print(x[a::c]) print(x[a:b]) print(x[a:b:]) #print(x[a:b:c]) # these should not...
# test list slices, getting values x = list(range(10)) a = 2 b = 4 c = 3 print(x[:]) print(x[::]) print(x[::c]) print(x[:b]) print(x[:b:]) print(x[:b:c]) print(x[a]) print(x[a:]) print(x[a::]) print(x[a::c]) print(x[a:b]) print(x[a:b:]) print(x[a:b:c]) # these should not raise IndexError print([][1:]) print([][-1:]) ...
<commit_before># test slices; only 2 argument version supported by Micro Python at the moment x = list(range(10)) a = 2 b = 4 c = 3 print(x[:]) print(x[::]) #print(x[::c]) print(x[:b]) print(x[:b:]) #print(x[:b:c]) print(x[a]) print(x[a:]) print(x[a::]) #print(x[a::c]) print(x[a:b]) print(x[a:b:]) #print(x[a:b:c]) # t...
# test list slices, getting values x = list(range(10)) a = 2 b = 4 c = 3 print(x[:]) print(x[::]) print(x[::c]) print(x[:b]) print(x[:b:]) print(x[:b:c]) print(x[a]) print(x[a:]) print(x[a::]) print(x[a::c]) print(x[a:b]) print(x[a:b:]) print(x[a:b:c]) # these should not raise IndexError print([][1:]) print([][-1:]) ...
# test slices; only 2 argument version supported by Micro Python at the moment x = list(range(10)) a = 2 b = 4 c = 3 print(x[:]) print(x[::]) #print(x[::c]) print(x[:b]) print(x[:b:]) #print(x[:b:c]) print(x[a]) print(x[a:]) print(x[a::]) #print(x[a::c]) print(x[a:b]) print(x[a:b:]) #print(x[a:b:c]) # these should not...
<commit_before># test slices; only 2 argument version supported by Micro Python at the moment x = list(range(10)) a = 2 b = 4 c = 3 print(x[:]) print(x[::]) #print(x[::c]) print(x[:b]) print(x[:b:]) #print(x[:b:c]) print(x[a]) print(x[a:]) print(x[a::]) #print(x[a::c]) print(x[a:b]) print(x[a:b:]) #print(x[a:b:c]) # t...
351c05b6e474b266a7594a775cb48cd7cfe0b833
shapely/linref.py
shapely/linref.py
"""Linear referencing """ from shapely.topology import Delegating class LinearRefBase(Delegating): def _validate_line(self, ob): super(LinearRefBase, self)._validate(ob) try: assert ob.geom_type in ['LineString', 'MultiLineString'] except AssertionError: raise Type...
"""Linear referencing """ from shapely.topology import Delegating class LinearRefBase(Delegating): def _validate_line(self, ob): super(LinearRefBase, self)._validate(ob) if not ob.geom_type in ['LinearRing', 'LineString', 'MultiLineString']: raise TypeError("Only linear types support ...
Allow linear referencing on rings.
Allow linear referencing on rings. Closes #286. Eliminating the assert is good for optimization reasons, too.
Python
bsd-3-clause
abali96/Shapely,mouadino/Shapely,mindw/shapely,abali96/Shapely,jdmcbr/Shapely,jdmcbr/Shapely,mindw/shapely,mouadino/Shapely
"""Linear referencing """ from shapely.topology import Delegating class LinearRefBase(Delegating): def _validate_line(self, ob): super(LinearRefBase, self)._validate(ob) try: assert ob.geom_type in ['LineString', 'MultiLineString'] except AssertionError: raise Type...
"""Linear referencing """ from shapely.topology import Delegating class LinearRefBase(Delegating): def _validate_line(self, ob): super(LinearRefBase, self)._validate(ob) if not ob.geom_type in ['LinearRing', 'LineString', 'MultiLineString']: raise TypeError("Only linear types support ...
<commit_before>"""Linear referencing """ from shapely.topology import Delegating class LinearRefBase(Delegating): def _validate_line(self, ob): super(LinearRefBase, self)._validate(ob) try: assert ob.geom_type in ['LineString', 'MultiLineString'] except AssertionError: ...
"""Linear referencing """ from shapely.topology import Delegating class LinearRefBase(Delegating): def _validate_line(self, ob): super(LinearRefBase, self)._validate(ob) if not ob.geom_type in ['LinearRing', 'LineString', 'MultiLineString']: raise TypeError("Only linear types support ...
"""Linear referencing """ from shapely.topology import Delegating class LinearRefBase(Delegating): def _validate_line(self, ob): super(LinearRefBase, self)._validate(ob) try: assert ob.geom_type in ['LineString', 'MultiLineString'] except AssertionError: raise Type...
<commit_before>"""Linear referencing """ from shapely.topology import Delegating class LinearRefBase(Delegating): def _validate_line(self, ob): super(LinearRefBase, self)._validate(ob) try: assert ob.geom_type in ['LineString', 'MultiLineString'] except AssertionError: ...
9818fb927bcc096fbb6a3b075be867a5709c3d0f
simpy/__init__.py
simpy/__init__.py
# encoding: utf-8 """ With SimPy, simulating is fun again! """ from pkgutil import extend_path __path__ = extend_path(__path__, __name__) from simpy.core import Simulation, Interrupt, Failure __all__ = ['Simulation', 'Interrupt', 'Failure', 'test'] __version__ = '3.0a1' def test(): """Runs SimPy’s test suite ...
# encoding: utf-8 """ With SimPy, simulating is fun again! """ from pkgutil import extend_path __path__ = extend_path(__path__, __name__) from simpy.core import Simulation, Process, Interrupt, Failure __all__ = ['Simulation', 'Interrupt', 'Failure', 'test'] __version__ = '3.0a1' def test(): """Runs SimPy’s te...
Add Process to the simpy namespace.
Add Process to the simpy namespace.
Python
mit
Uzere/uSim
# encoding: utf-8 """ With SimPy, simulating is fun again! """ from pkgutil import extend_path __path__ = extend_path(__path__, __name__) from simpy.core import Simulation, Interrupt, Failure __all__ = ['Simulation', 'Interrupt', 'Failure', 'test'] __version__ = '3.0a1' def test(): """Runs SimPy’s test suite ...
# encoding: utf-8 """ With SimPy, simulating is fun again! """ from pkgutil import extend_path __path__ = extend_path(__path__, __name__) from simpy.core import Simulation, Process, Interrupt, Failure __all__ = ['Simulation', 'Interrupt', 'Failure', 'test'] __version__ = '3.0a1' def test(): """Runs SimPy’s te...
<commit_before># encoding: utf-8 """ With SimPy, simulating is fun again! """ from pkgutil import extend_path __path__ = extend_path(__path__, __name__) from simpy.core import Simulation, Interrupt, Failure __all__ = ['Simulation', 'Interrupt', 'Failure', 'test'] __version__ = '3.0a1' def test(): """Runs SimP...
# encoding: utf-8 """ With SimPy, simulating is fun again! """ from pkgutil import extend_path __path__ = extend_path(__path__, __name__) from simpy.core import Simulation, Process, Interrupt, Failure __all__ = ['Simulation', 'Interrupt', 'Failure', 'test'] __version__ = '3.0a1' def test(): """Runs SimPy’s te...
# encoding: utf-8 """ With SimPy, simulating is fun again! """ from pkgutil import extend_path __path__ = extend_path(__path__, __name__) from simpy.core import Simulation, Interrupt, Failure __all__ = ['Simulation', 'Interrupt', 'Failure', 'test'] __version__ = '3.0a1' def test(): """Runs SimPy’s test suite ...
<commit_before># encoding: utf-8 """ With SimPy, simulating is fun again! """ from pkgutil import extend_path __path__ = extend_path(__path__, __name__) from simpy.core import Simulation, Interrupt, Failure __all__ = ['Simulation', 'Interrupt', 'Failure', 'test'] __version__ = '3.0a1' def test(): """Runs SimP...
6f6e16cfabb7c3ff3f634718b16f87bd7705d284
tests/v7/test_item_list.py
tests/v7/test_item_list.py
from .context import tohu from tohu.v7.item_list import ItemList def test_item_list(): values = [11, 55, 22, 66, 33] item_list = ItemList(values) assert item_list.items == values assert item_list == values assert len(item_list) == 5 assert item_list[3] == 66 assert [x for x in item_list] =...
from .context import tohu from tohu.v7.item_list import ItemList def test_item_list(): values = [11, 55, 22, 66, 33] item_list = ItemList(values) assert item_list.items == values assert item_list == values assert len(item_list) == 5 assert item_list[3] == 66 assert [x for x in item_list] =...
Add a couple more test cases for item list
Add a couple more test cases for item list
Python
mit
maxalbert/tohu
from .context import tohu from tohu.v7.item_list import ItemList def test_item_list(): values = [11, 55, 22, 66, 33] item_list = ItemList(values) assert item_list.items == values assert item_list == values assert len(item_list) == 5 assert item_list[3] == 66 assert [x for x in item_list] =...
from .context import tohu from tohu.v7.item_list import ItemList def test_item_list(): values = [11, 55, 22, 66, 33] item_list = ItemList(values) assert item_list.items == values assert item_list == values assert len(item_list) == 5 assert item_list[3] == 66 assert [x for x in item_list] =...
<commit_before>from .context import tohu from tohu.v7.item_list import ItemList def test_item_list(): values = [11, 55, 22, 66, 33] item_list = ItemList(values) assert item_list.items == values assert item_list == values assert len(item_list) == 5 assert item_list[3] == 66 assert [x for x ...
from .context import tohu from tohu.v7.item_list import ItemList def test_item_list(): values = [11, 55, 22, 66, 33] item_list = ItemList(values) assert item_list.items == values assert item_list == values assert len(item_list) == 5 assert item_list[3] == 66 assert [x for x in item_list] =...
from .context import tohu from tohu.v7.item_list import ItemList def test_item_list(): values = [11, 55, 22, 66, 33] item_list = ItemList(values) assert item_list.items == values assert item_list == values assert len(item_list) == 5 assert item_list[3] == 66 assert [x for x in item_list] =...
<commit_before>from .context import tohu from tohu.v7.item_list import ItemList def test_item_list(): values = [11, 55, 22, 66, 33] item_list = ItemList(values) assert item_list.items == values assert item_list == values assert len(item_list) == 5 assert item_list[3] == 66 assert [x for x ...
70b037496140dd2e9e6d71508835390f0c85bc02
skltn/metadata.py
skltn/metadata.py
# -*- coding: utf-8 -*- """Project metadata Information describing the project. """ # The package name, which is also the "UNIX name" for the project. package = 'my_module' project = "My Awesome Module" project_no_spaces = project.replace(' ', '') version = '0.1.0' description = 'It does cool things' authors = ['John...
# -*- coding: utf-8 -*- """Project metadata Information describing the project. """ import subprocess def get_author_detail(arg='name'): p = subprocess.Popen(['git', 'config', 'user.{}'.format(arg)], stdout=subprocess.PIPE) try: out, _ = p.communicate() except: ou...
Change year to 2016, try to guess author details from git config
Change year to 2016, try to guess author details from git config
Python
mit
ksonj/skltn
# -*- coding: utf-8 -*- """Project metadata Information describing the project. """ # The package name, which is also the "UNIX name" for the project. package = 'my_module' project = "My Awesome Module" project_no_spaces = project.replace(' ', '') version = '0.1.0' description = 'It does cool things' authors = ['John...
# -*- coding: utf-8 -*- """Project metadata Information describing the project. """ import subprocess def get_author_detail(arg='name'): p = subprocess.Popen(['git', 'config', 'user.{}'.format(arg)], stdout=subprocess.PIPE) try: out, _ = p.communicate() except: ou...
<commit_before># -*- coding: utf-8 -*- """Project metadata Information describing the project. """ # The package name, which is also the "UNIX name" for the project. package = 'my_module' project = "My Awesome Module" project_no_spaces = project.replace(' ', '') version = '0.1.0' description = 'It does cool things' a...
# -*- coding: utf-8 -*- """Project metadata Information describing the project. """ import subprocess def get_author_detail(arg='name'): p = subprocess.Popen(['git', 'config', 'user.{}'.format(arg)], stdout=subprocess.PIPE) try: out, _ = p.communicate() except: ou...
# -*- coding: utf-8 -*- """Project metadata Information describing the project. """ # The package name, which is also the "UNIX name" for the project. package = 'my_module' project = "My Awesome Module" project_no_spaces = project.replace(' ', '') version = '0.1.0' description = 'It does cool things' authors = ['John...
<commit_before># -*- coding: utf-8 -*- """Project metadata Information describing the project. """ # The package name, which is also the "UNIX name" for the project. package = 'my_module' project = "My Awesome Module" project_no_spaces = project.replace(' ', '') version = '0.1.0' description = 'It does cool things' a...
f9012b88f60f8e4ac96cb55aea763edc74ad586e
shell/view/BuddyIcon.py
shell/view/BuddyIcon.py
from sugar.canvas.MenuIcon import MenuIcon from view.BuddyMenu import BuddyMenu class BuddyIcon(MenuIcon): def __init__(self, shell, menu_shell, friend): MenuIcon.__init__(self, menu_shell, icon_name='stock-buddy', color=friend.get_color(), size=96) self._shell = shell self._friend = friend def set_p...
from sugar.canvas.MenuIcon import MenuIcon from view.BuddyMenu import BuddyMenu class BuddyIcon(MenuIcon): def __init__(self, shell, menu_shell, friend): MenuIcon.__init__(self, menu_shell, icon_name='stock-buddy', color=friend.get_color(), size=96) self._shell = shell self._friend = friend def set_p...
Move remove code down to fix undefined var error
Move remove code down to fix undefined var error
Python
lgpl-2.1
samdroid-apps/sugar-toolkit-gtk3,tchx84/debian-pkg-sugar-toolkit-gtk3,gusDuarte/sugar-toolkit-gtk3,tchx84/debian-pkg-sugar-toolkit,samdroid-apps/sugar-toolkit-gtk3,godiard/sugar-toolkit-gtk3,i5o/sugar-toolkit-gtk3,tchx84/debian-pkg-sugar-toolkit,godiard/sugar-toolkit-gtk3,Daksh/sugar-toolkit-gtk3,manuq/sugar-toolkit-gt...
from sugar.canvas.MenuIcon import MenuIcon from view.BuddyMenu import BuddyMenu class BuddyIcon(MenuIcon): def __init__(self, shell, menu_shell, friend): MenuIcon.__init__(self, menu_shell, icon_name='stock-buddy', color=friend.get_color(), size=96) self._shell = shell self._friend = friend def set_p...
from sugar.canvas.MenuIcon import MenuIcon from view.BuddyMenu import BuddyMenu class BuddyIcon(MenuIcon): def __init__(self, shell, menu_shell, friend): MenuIcon.__init__(self, menu_shell, icon_name='stock-buddy', color=friend.get_color(), size=96) self._shell = shell self._friend = friend def set_p...
<commit_before>from sugar.canvas.MenuIcon import MenuIcon from view.BuddyMenu import BuddyMenu class BuddyIcon(MenuIcon): def __init__(self, shell, menu_shell, friend): MenuIcon.__init__(self, menu_shell, icon_name='stock-buddy', color=friend.get_color(), size=96) self._shell = shell self._friend = fri...
from sugar.canvas.MenuIcon import MenuIcon from view.BuddyMenu import BuddyMenu class BuddyIcon(MenuIcon): def __init__(self, shell, menu_shell, friend): MenuIcon.__init__(self, menu_shell, icon_name='stock-buddy', color=friend.get_color(), size=96) self._shell = shell self._friend = friend def set_p...
from sugar.canvas.MenuIcon import MenuIcon from view.BuddyMenu import BuddyMenu class BuddyIcon(MenuIcon): def __init__(self, shell, menu_shell, friend): MenuIcon.__init__(self, menu_shell, icon_name='stock-buddy', color=friend.get_color(), size=96) self._shell = shell self._friend = friend def set_p...
<commit_before>from sugar.canvas.MenuIcon import MenuIcon from view.BuddyMenu import BuddyMenu class BuddyIcon(MenuIcon): def __init__(self, shell, menu_shell, friend): MenuIcon.__init__(self, menu_shell, icon_name='stock-buddy', color=friend.get_color(), size=96) self._shell = shell self._friend = fri...
de0bbf978695d206189ee4effb124234968525cb
django_afip/views.py
django_afip/views.py
from django.http import HttpResponse from django.utils.translation import ugettext as _ from django.views.generic import View from .pdf import generate_receipt_pdf class ReceiptHTMLView(View): def get(self, request, pk): return HttpResponse( generate_receipt_pdf(pk, request, True), )...
from django.http import HttpResponse from django.utils.translation import ugettext as _ from django.views.generic import View from .pdf import generate_receipt_pdf class ReceiptHTMLView(View): """Renders a receipt as HTML.""" def get(self, request, pk): return HttpResponse( generate_recei...
Add a view to display PDF receipts
Add a view to display PDF receipts Fixes #23 Closes !7 Closes !8
Python
isc
hobarrera/django-afip,hobarrera/django-afip
from django.http import HttpResponse from django.utils.translation import ugettext as _ from django.views.generic import View from .pdf import generate_receipt_pdf class ReceiptHTMLView(View): def get(self, request, pk): return HttpResponse( generate_receipt_pdf(pk, request, True), )...
from django.http import HttpResponse from django.utils.translation import ugettext as _ from django.views.generic import View from .pdf import generate_receipt_pdf class ReceiptHTMLView(View): """Renders a receipt as HTML.""" def get(self, request, pk): return HttpResponse( generate_recei...
<commit_before>from django.http import HttpResponse from django.utils.translation import ugettext as _ from django.views.generic import View from .pdf import generate_receipt_pdf class ReceiptHTMLView(View): def get(self, request, pk): return HttpResponse( generate_receipt_pdf(pk, request, T...
from django.http import HttpResponse from django.utils.translation import ugettext as _ from django.views.generic import View from .pdf import generate_receipt_pdf class ReceiptHTMLView(View): """Renders a receipt as HTML.""" def get(self, request, pk): return HttpResponse( generate_recei...
from django.http import HttpResponse from django.utils.translation import ugettext as _ from django.views.generic import View from .pdf import generate_receipt_pdf class ReceiptHTMLView(View): def get(self, request, pk): return HttpResponse( generate_receipt_pdf(pk, request, True), )...
<commit_before>from django.http import HttpResponse from django.utils.translation import ugettext as _ from django.views.generic import View from .pdf import generate_receipt_pdf class ReceiptHTMLView(View): def get(self, request, pk): return HttpResponse( generate_receipt_pdf(pk, request, T...
03d8a4e20ee4b6fd49495b7b047ea78d0b9a5bb4
dmoj/graders/base.py
dmoj/graders/base.py
class BaseGrader(object): def __init__(self, judge, problem, language, source): self.source = source self.language = language self.problem = problem self.judge = judge self.binary = self._generate_binary() self._terminate_grading = False self._current_proc = N...
class BaseGrader(object): def __init__(self, judge, problem, language, source): if isinstance(source, unicode): source = source.encode('utf-8') self.source = source self.language = language self.problem = problem self.judge = judge self.binary = self._gene...
Make source utf-8 encoded bytes.
Make source utf-8 encoded bytes.
Python
agpl-3.0
DMOJ/judge,DMOJ/judge,DMOJ/judge
class BaseGrader(object): def __init__(self, judge, problem, language, source): self.source = source self.language = language self.problem = problem self.judge = judge self.binary = self._generate_binary() self._terminate_grading = False self._current_proc = N...
class BaseGrader(object): def __init__(self, judge, problem, language, source): if isinstance(source, unicode): source = source.encode('utf-8') self.source = source self.language = language self.problem = problem self.judge = judge self.binary = self._gene...
<commit_before>class BaseGrader(object): def __init__(self, judge, problem, language, source): self.source = source self.language = language self.problem = problem self.judge = judge self.binary = self._generate_binary() self._terminate_grading = False self._c...
class BaseGrader(object): def __init__(self, judge, problem, language, source): if isinstance(source, unicode): source = source.encode('utf-8') self.source = source self.language = language self.problem = problem self.judge = judge self.binary = self._gene...
class BaseGrader(object): def __init__(self, judge, problem, language, source): self.source = source self.language = language self.problem = problem self.judge = judge self.binary = self._generate_binary() self._terminate_grading = False self._current_proc = N...
<commit_before>class BaseGrader(object): def __init__(self, judge, problem, language, source): self.source = source self.language = language self.problem = problem self.judge = judge self.binary = self._generate_binary() self._terminate_grading = False self._c...
a773d29d7bce78abea28209e53909ab52eee36a9
routes.py
routes.py
from flask import Flask, render_template from setup_cardsets import CardOperations co = CardOperations() app = Flask(__name__) @app.route('/') def home(): return render_template('home.html') @app.route('/rules') def rules(): return render_template('rules.html') @app.route('/setup') def setup(): return render_t...
from flask import Flask, render_template, redirect from setup_cardsets import CardOperations co = CardOperations() app = Flask(__name__) @app.route('/') def home(): return render_template('home.html') @app.route('/rules') def rules(): return render_template('rules.html') @app.route('/setup') def setup(): retur...
Use flask's redirect() method to go to result link
Use flask's redirect() method to go to result link
Python
mit
AlexMathew/tcg-ui
from flask import Flask, render_template from setup_cardsets import CardOperations co = CardOperations() app = Flask(__name__) @app.route('/') def home(): return render_template('home.html') @app.route('/rules') def rules(): return render_template('rules.html') @app.route('/setup') def setup(): return render_t...
from flask import Flask, render_template, redirect from setup_cardsets import CardOperations co = CardOperations() app = Flask(__name__) @app.route('/') def home(): return render_template('home.html') @app.route('/rules') def rules(): return render_template('rules.html') @app.route('/setup') def setup(): retur...
<commit_before>from flask import Flask, render_template from setup_cardsets import CardOperations co = CardOperations() app = Flask(__name__) @app.route('/') def home(): return render_template('home.html') @app.route('/rules') def rules(): return render_template('rules.html') @app.route('/setup') def setup(): ...
from flask import Flask, render_template, redirect from setup_cardsets import CardOperations co = CardOperations() app = Flask(__name__) @app.route('/') def home(): return render_template('home.html') @app.route('/rules') def rules(): return render_template('rules.html') @app.route('/setup') def setup(): retur...
from flask import Flask, render_template from setup_cardsets import CardOperations co = CardOperations() app = Flask(__name__) @app.route('/') def home(): return render_template('home.html') @app.route('/rules') def rules(): return render_template('rules.html') @app.route('/setup') def setup(): return render_t...
<commit_before>from flask import Flask, render_template from setup_cardsets import CardOperations co = CardOperations() app = Flask(__name__) @app.route('/') def home(): return render_template('home.html') @app.route('/rules') def rules(): return render_template('rules.html') @app.route('/setup') def setup(): ...
e14b3fad26dce8dad3ca97c06e624f1d6b0764f9
mqueue/__init__.py
mqueue/__init__.py
__version__ = '0.5.5' default_app_config = 'mqueue.apps.MqueueConfig'
__version__ = '0.5.5' default_app_config = 'mqueue.apps.MqueueConfig' import sys reload(sys) sys.setdefaultencoding("utf-8")
Set default encoding to fix unicode errors
Set default encoding to fix unicode errors
Python
mit
synw/django-mqueue,synw/django-mqueue,synw/django-mqueue
__version__ = '0.5.5' default_app_config = 'mqueue.apps.MqueueConfig' Set default encoding to fix unicode errors
__version__ = '0.5.5' default_app_config = 'mqueue.apps.MqueueConfig' import sys reload(sys) sys.setdefaultencoding("utf-8")
<commit_before>__version__ = '0.5.5' default_app_config = 'mqueue.apps.MqueueConfig' <commit_msg>Set default encoding to fix unicode errors<commit_after>
__version__ = '0.5.5' default_app_config = 'mqueue.apps.MqueueConfig' import sys reload(sys) sys.setdefaultencoding("utf-8")
__version__ = '0.5.5' default_app_config = 'mqueue.apps.MqueueConfig' Set default encoding to fix unicode errors__version__ = '0.5.5' default_app_config = 'mqueue.apps.MqueueConfig' import sys reload(sys) sys.setdefaultencoding("utf-8")
<commit_before>__version__ = '0.5.5' default_app_config = 'mqueue.apps.MqueueConfig' <commit_msg>Set default encoding to fix unicode errors<commit_after>__version__ = '0.5.5' default_app_config = 'mqueue.apps.MqueueConfig' import sys reload(sys) sys.setdefaultencoding("utf-8")
50836f606c5bdb9aa4472d109f0dc40e2f0f8dc6
examples/apc2016/download_dataset.py
examples/apc2016/download_dataset.py
#!/usr/bin/env python import os.path as osp import chainer import fcn.data import fcn.util def main(): dataset_dir = chainer.dataset.get_dataset_directory('apc2016') path = osp.join(dataset_dir, 'APC2016rbo.tgz') fcn.data.cached_download( url='https://drive.google.com/uc?id=0B9P1L--7Wd2vSV9oL...
#!/usr/bin/env python import os.path as osp import chainer import fcn def main(): dataset_dir = chainer.dataset.get_dataset_directory('apc2016') path = osp.join(dataset_dir, 'APC2016rbo.tgz') fcn.data.cached_download( url='https://drive.google.com/uc?id=0B9P1L--7Wd2vSV9oLTd1U2I3TDg', p...
Fix for renamed module util -> utils
Fix for renamed module util -> utils
Python
mit
wkentaro/fcn
#!/usr/bin/env python import os.path as osp import chainer import fcn.data import fcn.util def main(): dataset_dir = chainer.dataset.get_dataset_directory('apc2016') path = osp.join(dataset_dir, 'APC2016rbo.tgz') fcn.data.cached_download( url='https://drive.google.com/uc?id=0B9P1L--7Wd2vSV9oL...
#!/usr/bin/env python import os.path as osp import chainer import fcn def main(): dataset_dir = chainer.dataset.get_dataset_directory('apc2016') path = osp.join(dataset_dir, 'APC2016rbo.tgz') fcn.data.cached_download( url='https://drive.google.com/uc?id=0B9P1L--7Wd2vSV9oLTd1U2I3TDg', p...
<commit_before>#!/usr/bin/env python import os.path as osp import chainer import fcn.data import fcn.util def main(): dataset_dir = chainer.dataset.get_dataset_directory('apc2016') path = osp.join(dataset_dir, 'APC2016rbo.tgz') fcn.data.cached_download( url='https://drive.google.com/uc?id=0B9...
#!/usr/bin/env python import os.path as osp import chainer import fcn def main(): dataset_dir = chainer.dataset.get_dataset_directory('apc2016') path = osp.join(dataset_dir, 'APC2016rbo.tgz') fcn.data.cached_download( url='https://drive.google.com/uc?id=0B9P1L--7Wd2vSV9oLTd1U2I3TDg', p...
#!/usr/bin/env python import os.path as osp import chainer import fcn.data import fcn.util def main(): dataset_dir = chainer.dataset.get_dataset_directory('apc2016') path = osp.join(dataset_dir, 'APC2016rbo.tgz') fcn.data.cached_download( url='https://drive.google.com/uc?id=0B9P1L--7Wd2vSV9oL...
<commit_before>#!/usr/bin/env python import os.path as osp import chainer import fcn.data import fcn.util def main(): dataset_dir = chainer.dataset.get_dataset_directory('apc2016') path = osp.join(dataset_dir, 'APC2016rbo.tgz') fcn.data.cached_download( url='https://drive.google.com/uc?id=0B9...
3caab02c5e0ca0ebc57f57c77ed550b7e3fc55d2
analyze.py
analyze.py
import os import pickle import numpy as np import matplotlib.pyplot as plt from datetime import datetime def load_data(data_path): '''Return dictionary `data` from string `data_path` ''' os.path.join(data_path, '1.dat') data = pickle.load(open(data_path, 'rb')) return data def get_baseline(data...
import os import pickle import numpy as np import matplotlib.pyplot as plt from glob import glob from datetime import datetime def load_data(data_path): '''Return dictionary `data` from string `data_path` ''' os.path.join(data_path, '1.dat') data = pickle.load(open(data_path, 'rb')) return data ...
Add helper functions for loading data
Add helper functions for loading data
Python
mit
JustinShenk/sensei
import os import pickle import numpy as np import matplotlib.pyplot as plt from datetime import datetime def load_data(data_path): '''Return dictionary `data` from string `data_path` ''' os.path.join(data_path, '1.dat') data = pickle.load(open(data_path, 'rb')) return data def get_baseline(data...
import os import pickle import numpy as np import matplotlib.pyplot as plt from glob import glob from datetime import datetime def load_data(data_path): '''Return dictionary `data` from string `data_path` ''' os.path.join(data_path, '1.dat') data = pickle.load(open(data_path, 'rb')) return data ...
<commit_before>import os import pickle import numpy as np import matplotlib.pyplot as plt from datetime import datetime def load_data(data_path): '''Return dictionary `data` from string `data_path` ''' os.path.join(data_path, '1.dat') data = pickle.load(open(data_path, 'rb')) return data def ge...
import os import pickle import numpy as np import matplotlib.pyplot as plt from glob import glob from datetime import datetime def load_data(data_path): '''Return dictionary `data` from string `data_path` ''' os.path.join(data_path, '1.dat') data = pickle.load(open(data_path, 'rb')) return data ...
import os import pickle import numpy as np import matplotlib.pyplot as plt from datetime import datetime def load_data(data_path): '''Return dictionary `data` from string `data_path` ''' os.path.join(data_path, '1.dat') data = pickle.load(open(data_path, 'rb')) return data def get_baseline(data...
<commit_before>import os import pickle import numpy as np import matplotlib.pyplot as plt from datetime import datetime def load_data(data_path): '''Return dictionary `data` from string `data_path` ''' os.path.join(data_path, '1.dat') data = pickle.load(open(data_path, 'rb')) return data def ge...
46a5a9b073a5d170133400a3f8b84d2fa8ee24bb
salt/states/pagerduty_user.py
salt/states/pagerduty_user.py
# -*- coding: utf-8 -*- ''' Manage PagerDuty users. Example: .. code-block:: yaml ensure bruce test user 1: pagerduty.user_present: - name: 'Bruce TestUser1' - email: bruce+test1@lyft.com - requester_id: P1GV5NT ''' def __virtual__(): ''' Only load if th...
# -*- coding: utf-8 -*- ''' Manage PagerDuty users. Example: .. code-block:: yaml ensure bruce test user 1: pagerduty.user_present: - name: 'Bruce TestUser1' - email: bruce+test1@lyft.com - requester_id: P1GV5NT ''' def __virtual__(): ''' Only load if th...
Fix typo an suppored -> supported
Fix typo an suppored -> supported
Python
apache-2.0
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
# -*- coding: utf-8 -*- ''' Manage PagerDuty users. Example: .. code-block:: yaml ensure bruce test user 1: pagerduty.user_present: - name: 'Bruce TestUser1' - email: bruce+test1@lyft.com - requester_id: P1GV5NT ''' def __virtual__(): ''' Only load if th...
# -*- coding: utf-8 -*- ''' Manage PagerDuty users. Example: .. code-block:: yaml ensure bruce test user 1: pagerduty.user_present: - name: 'Bruce TestUser1' - email: bruce+test1@lyft.com - requester_id: P1GV5NT ''' def __virtual__(): ''' Only load if th...
<commit_before># -*- coding: utf-8 -*- ''' Manage PagerDuty users. Example: .. code-block:: yaml ensure bruce test user 1: pagerduty.user_present: - name: 'Bruce TestUser1' - email: bruce+test1@lyft.com - requester_id: P1GV5NT ''' def __virtual__(): ''' ...
# -*- coding: utf-8 -*- ''' Manage PagerDuty users. Example: .. code-block:: yaml ensure bruce test user 1: pagerduty.user_present: - name: 'Bruce TestUser1' - email: bruce+test1@lyft.com - requester_id: P1GV5NT ''' def __virtual__(): ''' Only load if th...
# -*- coding: utf-8 -*- ''' Manage PagerDuty users. Example: .. code-block:: yaml ensure bruce test user 1: pagerduty.user_present: - name: 'Bruce TestUser1' - email: bruce+test1@lyft.com - requester_id: P1GV5NT ''' def __virtual__(): ''' Only load if th...
<commit_before># -*- coding: utf-8 -*- ''' Manage PagerDuty users. Example: .. code-block:: yaml ensure bruce test user 1: pagerduty.user_present: - name: 'Bruce TestUser1' - email: bruce+test1@lyft.com - requester_id: P1GV5NT ''' def __virtual__(): ''' ...
e340d8f3c36a026fb3b3f13d8f47dc9dc1b325ef
gears/views.py
gears/views.py
import mimetypes import posixpath import urllib from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.contrib.staticfiles.views import serve as staticfiles_serve from django.http import HttpResponse from .asset_attributes import AssetAttributes from .assets import Asset,...
import mimetypes import posixpath import urllib from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.contrib.staticfiles.views import serve as staticfiles_serve from django.http import HttpResponse from .asset_attributes import AssetAttributes from .assets import Asset,...
Move some code from serve view to build_asset function
Move some code from serve view to build_asset function
Python
isc
gears/django-gears,juliomenendez/django-gears,gears/django-gears,juliomenendez/django-gears,juliomenendez/django-gears,wiserthanever/django-gears,juliomenendez/django-gears,gears/django-gears,wiserthanever/django-gears,wiserthanever/django-gears,wiserthanever/django-gears
import mimetypes import posixpath import urllib from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.contrib.staticfiles.views import serve as staticfiles_serve from django.http import HttpResponse from .asset_attributes import AssetAttributes from .assets import Asset,...
import mimetypes import posixpath import urllib from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.contrib.staticfiles.views import serve as staticfiles_serve from django.http import HttpResponse from .asset_attributes import AssetAttributes from .assets import Asset,...
<commit_before>import mimetypes import posixpath import urllib from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.contrib.staticfiles.views import serve as staticfiles_serve from django.http import HttpResponse from .asset_attributes import AssetAttributes from .asset...
import mimetypes import posixpath import urllib from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.contrib.staticfiles.views import serve as staticfiles_serve from django.http import HttpResponse from .asset_attributes import AssetAttributes from .assets import Asset,...
import mimetypes import posixpath import urllib from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.contrib.staticfiles.views import serve as staticfiles_serve from django.http import HttpResponse from .asset_attributes import AssetAttributes from .assets import Asset,...
<commit_before>import mimetypes import posixpath import urllib from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.contrib.staticfiles.views import serve as staticfiles_serve from django.http import HttpResponse from .asset_attributes import AssetAttributes from .asset...
82457741a352602f6ef946e387070c77eb50781c
examples/macallan.py
examples/macallan.py
# -*- coding: utf-8 -*- from malt import Malt, Response, json from wsgiref.simple_server import make_server app = Malt() @app.get('/') def hello(request): return Response(request.url + '\n') @app.post('/users') def hello(request): return Response('Creating new user\n') @app.get('/tasks') def hello(reque...
# -*- coding: utf-8 -*- from malt import Malt, Response, json from wsgiref.simple_server import make_server app = Malt() @app.get('/') def hello(request): return Response(request.url + '\n') @app.post('/users') def hello(request): return Response('Creating new user\n') @app.get('/tasks') def hello(reque...
Print a serving message in the example app
Print a serving message in the example app
Python
mit
nickfrostatx/malt
# -*- coding: utf-8 -*- from malt import Malt, Response, json from wsgiref.simple_server import make_server app = Malt() @app.get('/') def hello(request): return Response(request.url + '\n') @app.post('/users') def hello(request): return Response('Creating new user\n') @app.get('/tasks') def hello(reque...
# -*- coding: utf-8 -*- from malt import Malt, Response, json from wsgiref.simple_server import make_server app = Malt() @app.get('/') def hello(request): return Response(request.url + '\n') @app.post('/users') def hello(request): return Response('Creating new user\n') @app.get('/tasks') def hello(reque...
<commit_before># -*- coding: utf-8 -*- from malt import Malt, Response, json from wsgiref.simple_server import make_server app = Malt() @app.get('/') def hello(request): return Response(request.url + '\n') @app.post('/users') def hello(request): return Response('Creating new user\n') @app.get('/tasks') ...
# -*- coding: utf-8 -*- from malt import Malt, Response, json from wsgiref.simple_server import make_server app = Malt() @app.get('/') def hello(request): return Response(request.url + '\n') @app.post('/users') def hello(request): return Response('Creating new user\n') @app.get('/tasks') def hello(reque...
# -*- coding: utf-8 -*- from malt import Malt, Response, json from wsgiref.simple_server import make_server app = Malt() @app.get('/') def hello(request): return Response(request.url + '\n') @app.post('/users') def hello(request): return Response('Creating new user\n') @app.get('/tasks') def hello(reque...
<commit_before># -*- coding: utf-8 -*- from malt import Malt, Response, json from wsgiref.simple_server import make_server app = Malt() @app.get('/') def hello(request): return Response(request.url + '\n') @app.post('/users') def hello(request): return Response('Creating new user\n') @app.get('/tasks') ...
a091db3e5d51da339ab3853f9188495a23410598
examples/settings.py
examples/settings.py
import os PROJECT_DIR = os.path.dirname(os.path.abspath(__file__)) SCREENSHOT_PATH = None OPENGL = { "version": (3, 3), } WINDOW = { "class": "demosys.context.pyqt.Window", "size": (1920, 1080), "aspect_ratio": 16 / 9, "fullscreen": False, "resizable": False, "title": "Examples", "vsy...
import os PROJECT_DIR = os.path.dirname(os.path.abspath(__file__)) SCREENSHOT_PATH = None OPENGL = { "version": (3, 3), } WINDOW = { "class": "demosys.context.pyqt.Window", "size": (1280, 720), "aspect_ratio": 16 / 9, "fullscreen": False, "resizable": False, "title": "Examples", "vsyn...
Reduce default resoution for example project
Reduce default resoution for example project
Python
isc
Contraz/demosys-py
import os PROJECT_DIR = os.path.dirname(os.path.abspath(__file__)) SCREENSHOT_PATH = None OPENGL = { "version": (3, 3), } WINDOW = { "class": "demosys.context.pyqt.Window", "size": (1920, 1080), "aspect_ratio": 16 / 9, "fullscreen": False, "resizable": False, "title": "Examples", "vsy...
import os PROJECT_DIR = os.path.dirname(os.path.abspath(__file__)) SCREENSHOT_PATH = None OPENGL = { "version": (3, 3), } WINDOW = { "class": "demosys.context.pyqt.Window", "size": (1280, 720), "aspect_ratio": 16 / 9, "fullscreen": False, "resizable": False, "title": "Examples", "vsyn...
<commit_before>import os PROJECT_DIR = os.path.dirname(os.path.abspath(__file__)) SCREENSHOT_PATH = None OPENGL = { "version": (3, 3), } WINDOW = { "class": "demosys.context.pyqt.Window", "size": (1920, 1080), "aspect_ratio": 16 / 9, "fullscreen": False, "resizable": False, "title": "Exam...
import os PROJECT_DIR = os.path.dirname(os.path.abspath(__file__)) SCREENSHOT_PATH = None OPENGL = { "version": (3, 3), } WINDOW = { "class": "demosys.context.pyqt.Window", "size": (1280, 720), "aspect_ratio": 16 / 9, "fullscreen": False, "resizable": False, "title": "Examples", "vsyn...
import os PROJECT_DIR = os.path.dirname(os.path.abspath(__file__)) SCREENSHOT_PATH = None OPENGL = { "version": (3, 3), } WINDOW = { "class": "demosys.context.pyqt.Window", "size": (1920, 1080), "aspect_ratio": 16 / 9, "fullscreen": False, "resizable": False, "title": "Examples", "vsy...
<commit_before>import os PROJECT_DIR = os.path.dirname(os.path.abspath(__file__)) SCREENSHOT_PATH = None OPENGL = { "version": (3, 3), } WINDOW = { "class": "demosys.context.pyqt.Window", "size": (1920, 1080), "aspect_ratio": 16 / 9, "fullscreen": False, "resizable": False, "title": "Exam...
a3d65892ef572b115de919f62929e093dfb27400
examples/json_editor.py
examples/json_editor.py
""" This is a very basic usage example of the JSONCodeEdit. The interface is minimalist, it will open a test file. You can open other documents by pressing Ctrl+O """ import logging import os import sys from pyqode.qt import QtWidgets from pyqode.json.widgets import JSONCodeEdit class Window(QtWidgets.QMainWindow): ...
""" This is a very basic usage example of the JSONCodeEdit. The interface is minimalist, it will open a test file. You can open other documents by pressing Ctrl+O """ import logging import os import random import sys from pyqode.qt import QtWidgets from pyqode.core import api, modes from pyqode.json.widgets import JSO...
Make example use random color scheme
Make example use random color scheme
Python
mit
pyQode/pyqode.json,pyQode/pyqode.json
""" This is a very basic usage example of the JSONCodeEdit. The interface is minimalist, it will open a test file. You can open other documents by pressing Ctrl+O """ import logging import os import sys from pyqode.qt import QtWidgets from pyqode.json.widgets import JSONCodeEdit class Window(QtWidgets.QMainWindow): ...
""" This is a very basic usage example of the JSONCodeEdit. The interface is minimalist, it will open a test file. You can open other documents by pressing Ctrl+O """ import logging import os import random import sys from pyqode.qt import QtWidgets from pyqode.core import api, modes from pyqode.json.widgets import JSO...
<commit_before>""" This is a very basic usage example of the JSONCodeEdit. The interface is minimalist, it will open a test file. You can open other documents by pressing Ctrl+O """ import logging import os import sys from pyqode.qt import QtWidgets from pyqode.json.widgets import JSONCodeEdit class Window(QtWidgets...
""" This is a very basic usage example of the JSONCodeEdit. The interface is minimalist, it will open a test file. You can open other documents by pressing Ctrl+O """ import logging import os import random import sys from pyqode.qt import QtWidgets from pyqode.core import api, modes from pyqode.json.widgets import JSO...
""" This is a very basic usage example of the JSONCodeEdit. The interface is minimalist, it will open a test file. You can open other documents by pressing Ctrl+O """ import logging import os import sys from pyqode.qt import QtWidgets from pyqode.json.widgets import JSONCodeEdit class Window(QtWidgets.QMainWindow): ...
<commit_before>""" This is a very basic usage example of the JSONCodeEdit. The interface is minimalist, it will open a test file. You can open other documents by pressing Ctrl+O """ import logging import os import sys from pyqode.qt import QtWidgets from pyqode.json.widgets import JSONCodeEdit class Window(QtWidgets...
7d10c18c1feb0c61aee9d3a44c3a7fa24e4e3c25
code_snippets/guides-agentchecks-methods.py
code_snippets/guides-agentchecks-methods.py
self.gauge( ... ) # Sample a gauge metric self.increment( ... ) # Increment a counter metric self.decrement( ... ) # Decrement a counter metric self.histogram( ... ) # Sample a histogram metric self.rate( ... ) # Sample a point, with the rate calculated at the end of the check self.count( ... ) # Sample a raw coun...
self.gauge( ... ) # Sample a gauge metric self.increment( ... ) # Increment a counter metric self.decrement( ... ) # Decrement a counter metric self.histogram( ... ) # Sample a histogram metric self.rate( ... ) # Sample a point, with the rate calculated at the end of the check
Revert "Document AgentCheck count and monotonic_count methods"
Revert "Document AgentCheck count and monotonic_count methods" This reverts commit e731c3a4a8590f5cddd23fd2f9af265749f08a38.
Python
bsd-3-clause
inokappa/documentation,macobo/documentation,inokappa/documentation,jhotta/documentation,jhotta/documentation,jhotta/documentation,macobo/documentation,macobo/documentation,inokappa/documentation,jhotta/documentation,jhotta/documentation,jhotta/documentation,inokappa/documentation,inokappa/documentation,macobo/documenta...
self.gauge( ... ) # Sample a gauge metric self.increment( ... ) # Increment a counter metric self.decrement( ... ) # Decrement a counter metric self.histogram( ... ) # Sample a histogram metric self.rate( ... ) # Sample a point, with the rate calculated at the end of the check self.count( ... ) # Sample a raw coun...
self.gauge( ... ) # Sample a gauge metric self.increment( ... ) # Increment a counter metric self.decrement( ... ) # Decrement a counter metric self.histogram( ... ) # Sample a histogram metric self.rate( ... ) # Sample a point, with the rate calculated at the end of the check
<commit_before>self.gauge( ... ) # Sample a gauge metric self.increment( ... ) # Increment a counter metric self.decrement( ... ) # Decrement a counter metric self.histogram( ... ) # Sample a histogram metric self.rate( ... ) # Sample a point, with the rate calculated at the end of the check self.count( ... ) # Sa...
self.gauge( ... ) # Sample a gauge metric self.increment( ... ) # Increment a counter metric self.decrement( ... ) # Decrement a counter metric self.histogram( ... ) # Sample a histogram metric self.rate( ... ) # Sample a point, with the rate calculated at the end of the check
self.gauge( ... ) # Sample a gauge metric self.increment( ... ) # Increment a counter metric self.decrement( ... ) # Decrement a counter metric self.histogram( ... ) # Sample a histogram metric self.rate( ... ) # Sample a point, with the rate calculated at the end of the check self.count( ... ) # Sample a raw coun...
<commit_before>self.gauge( ... ) # Sample a gauge metric self.increment( ... ) # Increment a counter metric self.decrement( ... ) # Decrement a counter metric self.histogram( ... ) # Sample a histogram metric self.rate( ... ) # Sample a point, with the rate calculated at the end of the check self.count( ... ) # Sa...
57a61538aecb9e102ee9e2e1365e80e3dbc8ed4f
adhocracy4/modules/apps.py
adhocracy4/modules/apps.py
from django.apps import AppConfig class ModuleConfig(AppConfig): name = 'adhocracy4.modules' label = 'a4modules'
from django.apps import AppConfig class ModulesConfig(AppConfig): name = 'adhocracy4.modules' label = 'a4modules'
Fix plural in modules app config
Fix plural in modules app config
Python
agpl-3.0
liqd/adhocracy4,liqd/adhocracy4,liqd/adhocracy4,liqd/adhocracy4
from django.apps import AppConfig class ModuleConfig(AppConfig): name = 'adhocracy4.modules' label = 'a4modules' Fix plural in modules app config
from django.apps import AppConfig class ModulesConfig(AppConfig): name = 'adhocracy4.modules' label = 'a4modules'
<commit_before>from django.apps import AppConfig class ModuleConfig(AppConfig): name = 'adhocracy4.modules' label = 'a4modules' <commit_msg>Fix plural in modules app config<commit_after>
from django.apps import AppConfig class ModulesConfig(AppConfig): name = 'adhocracy4.modules' label = 'a4modules'
from django.apps import AppConfig class ModuleConfig(AppConfig): name = 'adhocracy4.modules' label = 'a4modules' Fix plural in modules app configfrom django.apps import AppConfig class ModulesConfig(AppConfig): name = 'adhocracy4.modules' label = 'a4modules'
<commit_before>from django.apps import AppConfig class ModuleConfig(AppConfig): name = 'adhocracy4.modules' label = 'a4modules' <commit_msg>Fix plural in modules app config<commit_after>from django.apps import AppConfig class ModulesConfig(AppConfig): name = 'adhocracy4.modules' label = 'a4modules'
1706fd54e50c6e4a67c84ceaa17708ca9346efe8
qipipe/__init__.py
qipipe/__init__.py
"""The top-level Quantitative Imaging Pipeline module.""" __version__ = '4.5.3' """ The one-based major.minor.patch version. The version numbering scheme loosely follows http://semver.org/. The major version is incremented when there is an incompatible public API change. The minor version is incremented when there is ...
"""The top-level Quantitative Imaging Pipeline module.""" __version__ = '4.5.3' """ The one-based major.minor.patch version. The version numbering scheme loosely follows http://semver.org/. The major version is incremented when a significant feature set is introduced. The minor version is incremented when there is a f...
Modify the version numbering guideline.
Modify the version numbering guideline.
Python
bsd-2-clause
ohsu-qin/qipipe
"""The top-level Quantitative Imaging Pipeline module.""" __version__ = '4.5.3' """ The one-based major.minor.patch version. The version numbering scheme loosely follows http://semver.org/. The major version is incremented when there is an incompatible public API change. The minor version is incremented when there is ...
"""The top-level Quantitative Imaging Pipeline module.""" __version__ = '4.5.3' """ The one-based major.minor.patch version. The version numbering scheme loosely follows http://semver.org/. The major version is incremented when a significant feature set is introduced. The minor version is incremented when there is a f...
<commit_before>"""The top-level Quantitative Imaging Pipeline module.""" __version__ = '4.5.3' """ The one-based major.minor.patch version. The version numbering scheme loosely follows http://semver.org/. The major version is incremented when there is an incompatible public API change. The minor version is incremented...
"""The top-level Quantitative Imaging Pipeline module.""" __version__ = '4.5.3' """ The one-based major.minor.patch version. The version numbering scheme loosely follows http://semver.org/. The major version is incremented when a significant feature set is introduced. The minor version is incremented when there is a f...
"""The top-level Quantitative Imaging Pipeline module.""" __version__ = '4.5.3' """ The one-based major.minor.patch version. The version numbering scheme loosely follows http://semver.org/. The major version is incremented when there is an incompatible public API change. The minor version is incremented when there is ...
<commit_before>"""The top-level Quantitative Imaging Pipeline module.""" __version__ = '4.5.3' """ The one-based major.minor.patch version. The version numbering scheme loosely follows http://semver.org/. The major version is incremented when there is an incompatible public API change. The minor version is incremented...
6dd43f5fcd6af5582423af5a34a5fcf273026f1b
sirius/TI_V00/record_names.py
sirius/TI_V00/record_names.py
import sirius def get_record_names(family_name = None): """Return a dictionary of record names for given subsystem each entry is another dictionary of model families whose values are the indices in the pyaccel model of the magnets that belong to the family. The magnet models ca be segmented, in wh...
import sirius def get_record_names(family_name = None): """Return a dictionary of record names for given subsystem each entry is another dictionary of model families whose values are the indices in the pyaccel model of the magnets that belong to the family. The magnet models ca be segmented, in wh...
Change names of timing pvs
Change names of timing pvs
Python
mit
lnls-fac/sirius
import sirius def get_record_names(family_name = None): """Return a dictionary of record names for given subsystem each entry is another dictionary of model families whose values are the indices in the pyaccel model of the magnets that belong to the family. The magnet models ca be segmented, in wh...
import sirius def get_record_names(family_name = None): """Return a dictionary of record names for given subsystem each entry is another dictionary of model families whose values are the indices in the pyaccel model of the magnets that belong to the family. The magnet models ca be segmented, in wh...
<commit_before> import sirius def get_record_names(family_name = None): """Return a dictionary of record names for given subsystem each entry is another dictionary of model families whose values are the indices in the pyaccel model of the magnets that belong to the family. The magnet models ca be segme...
import sirius def get_record_names(family_name = None): """Return a dictionary of record names for given subsystem each entry is another dictionary of model families whose values are the indices in the pyaccel model of the magnets that belong to the family. The magnet models ca be segmented, in wh...
import sirius def get_record_names(family_name = None): """Return a dictionary of record names for given subsystem each entry is another dictionary of model families whose values are the indices in the pyaccel model of the magnets that belong to the family. The magnet models ca be segmented, in wh...
<commit_before> import sirius def get_record_names(family_name = None): """Return a dictionary of record names for given subsystem each entry is another dictionary of model families whose values are the indices in the pyaccel model of the magnets that belong to the family. The magnet models ca be segme...
d6c59f9f76b41945fb363f94d65956fbf1a18dac
tests/python_tests/test_routines.py
tests/python_tests/test_routines.py
# TODO(niboshi): Currently this file is just a placeholder for future migration of routine tests from test_array.py. # In order to do that, we need to somehow share check logics/test parameters with test_array.py.
# TODO(niboshi): Currently this file is just a placeholder for future migration of routine tests from test_array.py. # In order to do that, we need to somehow share check logics/test parameters with test_array.py. def test_dummy(): pass
Add dummy test for flake8
Add dummy test for flake8
Python
mit
hvy/chainer,niboshi/chainer,chainer/chainer,ktnyt/chainer,wkentaro/chainer,tkerola/chainer,wkentaro/chainer,pfnet/chainer,niboshi/chainer,jnishi/chainer,hvy/chainer,okuta/chainer,keisuke-umezawa/chainer,chainer/chainer,ktnyt/chainer,okuta/chainer,wkentaro/chainer,keisuke-umezawa/chainer,jnishi/chainer,niboshi/chainer,c...
# TODO(niboshi): Currently this file is just a placeholder for future migration of routine tests from test_array.py. # In order to do that, we need to somehow share check logics/test parameters with test_array.py. Add dummy test for flake8
# TODO(niboshi): Currently this file is just a placeholder for future migration of routine tests from test_array.py. # In order to do that, we need to somehow share check logics/test parameters with test_array.py. def test_dummy(): pass
<commit_before># TODO(niboshi): Currently this file is just a placeholder for future migration of routine tests from test_array.py. # In order to do that, we need to somehow share check logics/test parameters with test_array.py. <commit_msg>Add dummy test for flake8<commit_after>
# TODO(niboshi): Currently this file is just a placeholder for future migration of routine tests from test_array.py. # In order to do that, we need to somehow share check logics/test parameters with test_array.py. def test_dummy(): pass
# TODO(niboshi): Currently this file is just a placeholder for future migration of routine tests from test_array.py. # In order to do that, we need to somehow share check logics/test parameters with test_array.py. Add dummy test for flake8# TODO(niboshi): Currently this file is just a placeholder for future migration...
<commit_before># TODO(niboshi): Currently this file is just a placeholder for future migration of routine tests from test_array.py. # In order to do that, we need to somehow share check logics/test parameters with test_array.py. <commit_msg>Add dummy test for flake8<commit_after># TODO(niboshi): Currently this file i...
d207bf14b30636959e09659607bddcf4e349852b
django_migration_linter/sql_analyser/__init__.py
django_migration_linter/sql_analyser/__init__.py
from .analyser import analyse_sql_statements # noqa from .base import BaseAnalyser # noqa from .mysql import MySqlAnalyser # noqa from .postgresql import PostgresqlAnalyser # noqa from .sqlite import SqliteAnalyser # noqa
from .base import BaseAnalyser # noqa from .mysql import MySqlAnalyser # noqa from .postgresql import PostgresqlAnalyser # noqa from .sqlite import SqliteAnalyser # noqa from .analyser import analyse_sql_statements # noqa isort:skip
Fix import order which was important
Fix import order which was important
Python
apache-2.0
3YOURMIND/django-migration-linter
from .analyser import analyse_sql_statements # noqa from .base import BaseAnalyser # noqa from .mysql import MySqlAnalyser # noqa from .postgresql import PostgresqlAnalyser # noqa from .sqlite import SqliteAnalyser # noqa Fix import order which was important
from .base import BaseAnalyser # noqa from .mysql import MySqlAnalyser # noqa from .postgresql import PostgresqlAnalyser # noqa from .sqlite import SqliteAnalyser # noqa from .analyser import analyse_sql_statements # noqa isort:skip
<commit_before>from .analyser import analyse_sql_statements # noqa from .base import BaseAnalyser # noqa from .mysql import MySqlAnalyser # noqa from .postgresql import PostgresqlAnalyser # noqa from .sqlite import SqliteAnalyser # noqa <commit_msg>Fix import order which was important<commit_after>
from .base import BaseAnalyser # noqa from .mysql import MySqlAnalyser # noqa from .postgresql import PostgresqlAnalyser # noqa from .sqlite import SqliteAnalyser # noqa from .analyser import analyse_sql_statements # noqa isort:skip
from .analyser import analyse_sql_statements # noqa from .base import BaseAnalyser # noqa from .mysql import MySqlAnalyser # noqa from .postgresql import PostgresqlAnalyser # noqa from .sqlite import SqliteAnalyser # noqa Fix import order which was importantfrom .base import BaseAnalyser # noqa from .mysql import...
<commit_before>from .analyser import analyse_sql_statements # noqa from .base import BaseAnalyser # noqa from .mysql import MySqlAnalyser # noqa from .postgresql import PostgresqlAnalyser # noqa from .sqlite import SqliteAnalyser # noqa <commit_msg>Fix import order which was important<commit_after>from .base impor...
5f113ffd768431991f87cea1f5f804a25a1777d3
frappe/patches/v13_0/replace_old_data_import.py
frappe/patches/v13_0/replace_old_data_import.py
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe def execute(): frappe.db.sql( """INSERT INTO `tabData Import Legacy` SELECT * FROM `tabData Import`""" ) frappe.db.commit() frappe.db.sql("DROP TABLE IF EXIS...
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe def execute(): frappe.rename_doc('DocType', 'Data Import', 'Data Import Legacy') frappe.db.commit() frappe.db.sql("DROP TABLE IF EXISTS `tabData Import`") frap...
Use rename doc instead of manually moving the data
fix: Use rename doc instead of manually moving the data
Python
mit
StrellaGroup/frappe,saurabh6790/frappe,mhbu50/frappe,yashodhank/frappe,frappe/frappe,yashodhank/frappe,almeidapaulopt/frappe,yashodhank/frappe,frappe/frappe,mhbu50/frappe,almeidapaulopt/frappe,adityahase/frappe,saurabh6790/frappe,frappe/frappe,adityahase/frappe,mhbu50/frappe,adityahase/frappe,almeidapaulopt/frappe,yash...
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe def execute(): frappe.db.sql( """INSERT INTO `tabData Import Legacy` SELECT * FROM `tabData Import`""" ) frappe.db.commit() frappe.db.sql("DROP TABLE IF EXIS...
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe def execute(): frappe.rename_doc('DocType', 'Data Import', 'Data Import Legacy') frappe.db.commit() frappe.db.sql("DROP TABLE IF EXISTS `tabData Import`") frap...
<commit_before># Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe def execute(): frappe.db.sql( """INSERT INTO `tabData Import Legacy` SELECT * FROM `tabData Import`""" ) frappe.db.commit() frappe.db.sql("DRO...
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe def execute(): frappe.rename_doc('DocType', 'Data Import', 'Data Import Legacy') frappe.db.commit() frappe.db.sql("DROP TABLE IF EXISTS `tabData Import`") frap...
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe def execute(): frappe.db.sql( """INSERT INTO `tabData Import Legacy` SELECT * FROM `tabData Import`""" ) frappe.db.commit() frappe.db.sql("DROP TABLE IF EXIS...
<commit_before># Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe def execute(): frappe.db.sql( """INSERT INTO `tabData Import Legacy` SELECT * FROM `tabData Import`""" ) frappe.db.commit() frappe.db.sql("DRO...
216294a0ea36c2fbabb43c31ce4fde3a9eee4bf3
anchor/models.py
anchor/models.py
# Copyright 2014 Dave Kludt # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
# Copyright 2014 Dave Kludt # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
Update model for CBS host and volume information
Update model for CBS host and volume information
Python
apache-2.0
oldarmyc/anchor,oldarmyc/anchor,oldarmyc/anchor
# Copyright 2014 Dave Kludt # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
# Copyright 2014 Dave Kludt # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
<commit_before># Copyright 2014 Dave Kludt # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
# Copyright 2014 Dave Kludt # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
# Copyright 2014 Dave Kludt # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
<commit_before># Copyright 2014 Dave Kludt # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
115071fc5a8a631addb762e34f0af07e755dad1b
hopsutil/tensorboard.py
hopsutil/tensorboard.py
""" Utility functions to retrieve information about available services and setting up security for the Hops platform. These utils facilitates development by hiding complexity for programs interacting with Hops services. """ import socket import subprocess import os import pydoop.hdfs as pyhdfs def register(logdir): ...
""" Utility functions to retrieve information about available services and setting up security for the Hops platform. These utils facilitates development by hiding complexity for programs interacting with Hops services. """ import socket import subprocess import os import pydoop.hdfs as pyhdfs def register(logdir): ...
Use hostname instead of ip
Use hostname instead of ip
Python
apache-2.0
hopshadoop/hops-util-py,hopshadoop/hops-util-py
""" Utility functions to retrieve information about available services and setting up security for the Hops platform. These utils facilitates development by hiding complexity for programs interacting with Hops services. """ import socket import subprocess import os import pydoop.hdfs as pyhdfs def register(logdir): ...
""" Utility functions to retrieve information about available services and setting up security for the Hops platform. These utils facilitates development by hiding complexity for programs interacting with Hops services. """ import socket import subprocess import os import pydoop.hdfs as pyhdfs def register(logdir): ...
<commit_before>""" Utility functions to retrieve information about available services and setting up security for the Hops platform. These utils facilitates development by hiding complexity for programs interacting with Hops services. """ import socket import subprocess import os import pydoop.hdfs as pyhdfs def reg...
""" Utility functions to retrieve information about available services and setting up security for the Hops platform. These utils facilitates development by hiding complexity for programs interacting with Hops services. """ import socket import subprocess import os import pydoop.hdfs as pyhdfs def register(logdir): ...
""" Utility functions to retrieve information about available services and setting up security for the Hops platform. These utils facilitates development by hiding complexity for programs interacting with Hops services. """ import socket import subprocess import os import pydoop.hdfs as pyhdfs def register(logdir): ...
<commit_before>""" Utility functions to retrieve information about available services and setting up security for the Hops platform. These utils facilitates development by hiding complexity for programs interacting with Hops services. """ import socket import subprocess import os import pydoop.hdfs as pyhdfs def reg...
31fb8b576edda4d88685fd45537f68d3f067ae7b
source/cytoplasm/errors.py
source/cytoplasm/errors.py
class ControllerError(StandardError): pass class InterpreterError(StandardError): pass
class CytoplasmError(Exception): pass class ControllerError(CytoplasmError): pass class InterpreterError(CytoplasmError): pass
Use Exception instead of StandardError
Use Exception instead of StandardError Python 3 doesn't have StandardError...
Python
mit
startling/cytoplasm
class ControllerError(StandardError): pass class InterpreterError(StandardError): pass Use Exception instead of StandardError Python 3 doesn't have StandardError...
class CytoplasmError(Exception): pass class ControllerError(CytoplasmError): pass class InterpreterError(CytoplasmError): pass
<commit_before>class ControllerError(StandardError): pass class InterpreterError(StandardError): pass <commit_msg>Use Exception instead of StandardError Python 3 doesn't have StandardError...<commit_after>
class CytoplasmError(Exception): pass class ControllerError(CytoplasmError): pass class InterpreterError(CytoplasmError): pass
class ControllerError(StandardError): pass class InterpreterError(StandardError): pass Use Exception instead of StandardError Python 3 doesn't have StandardError...class CytoplasmError(Exception): pass class ControllerError(CytoplasmError): pass class InterpreterError(CytoplasmError): pass
<commit_before>class ControllerError(StandardError): pass class InterpreterError(StandardError): pass <commit_msg>Use Exception instead of StandardError Python 3 doesn't have StandardError...<commit_after>class CytoplasmError(Exception): pass class ControllerError(CytoplasmError): pass class InterpreterError(Cytoplasm...
a85c21dc324750c3fa7e96d2d0baf3c45657201e
sconsole/static.py
sconsole/static.py
''' Holds static data components, like the palette ''' def msg(msg, logfile='console_log.txt'): ''' Send a message to a logfile, defaults to console_log.txt. This is useful to replace a print statement since curses does put a bit of a damper on this ''' with open(logfile, 'a+') as fp_: ...
''' Holds static data components, like the palette ''' import pprint def tree_seed(): return {'jids': [ {'_|-76789876543456787654': [{'localhost': {'return': True}}, {'otherhost': {'return': True}}],}, {'_|-7678987654345678765...
Add convenience function to load in some test data
Add convenience function to load in some test data
Python
apache-2.0
saltstack/salt-console
''' Holds static data components, like the palette ''' def msg(msg, logfile='console_log.txt'): ''' Send a message to a logfile, defaults to console_log.txt. This is useful to replace a print statement since curses does put a bit of a damper on this ''' with open(logfile, 'a+') as fp_: ...
''' Holds static data components, like the palette ''' import pprint def tree_seed(): return {'jids': [ {'_|-76789876543456787654': [{'localhost': {'return': True}}, {'otherhost': {'return': True}}],}, {'_|-7678987654345678765...
<commit_before>''' Holds static data components, like the palette ''' def msg(msg, logfile='console_log.txt'): ''' Send a message to a logfile, defaults to console_log.txt. This is useful to replace a print statement since curses does put a bit of a damper on this ''' with open(logfile, 'a+') a...
''' Holds static data components, like the palette ''' import pprint def tree_seed(): return {'jids': [ {'_|-76789876543456787654': [{'localhost': {'return': True}}, {'otherhost': {'return': True}}],}, {'_|-7678987654345678765...
''' Holds static data components, like the palette ''' def msg(msg, logfile='console_log.txt'): ''' Send a message to a logfile, defaults to console_log.txt. This is useful to replace a print statement since curses does put a bit of a damper on this ''' with open(logfile, 'a+') as fp_: ...
<commit_before>''' Holds static data components, like the palette ''' def msg(msg, logfile='console_log.txt'): ''' Send a message to a logfile, defaults to console_log.txt. This is useful to replace a print statement since curses does put a bit of a damper on this ''' with open(logfile, 'a+') a...
401e60837c13af5a350b1487225a296c2e803069
Lib/test/test_dumbdbm.py
Lib/test/test_dumbdbm.py
#! /usr/bin/env python """Test script for the dumbdbm module Original by Roger E. Masse """ # XXX This test is a disgrace. It doesn't test that it works. import dumbdbm as dbm from dumbdbm import error from test_support import verbose filename = '/tmp/delete_me' d = dbm.open(filename, 'c') d['a'] = 'b' d['12345...
#! /usr/bin/env python """Test script for the dumbdbm module Original by Roger E. Masse """ # XXX This test is a disgrace. It doesn't test that it works. import dumbdbm as dbm from dumbdbm import error from test_support import verbose, TESTFN as filename d = dbm.open(filename, 'c') d['a'] = 'b' d['12345678910'] ...
Use a saner test filename, to work on Windows.
Use a saner test filename, to work on Windows.
Python
mit
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
#! /usr/bin/env python """Test script for the dumbdbm module Original by Roger E. Masse """ # XXX This test is a disgrace. It doesn't test that it works. import dumbdbm as dbm from dumbdbm import error from test_support import verbose filename = '/tmp/delete_me' d = dbm.open(filename, 'c') d['a'] = 'b' d['12345...
#! /usr/bin/env python """Test script for the dumbdbm module Original by Roger E. Masse """ # XXX This test is a disgrace. It doesn't test that it works. import dumbdbm as dbm from dumbdbm import error from test_support import verbose, TESTFN as filename d = dbm.open(filename, 'c') d['a'] = 'b' d['12345678910'] ...
<commit_before>#! /usr/bin/env python """Test script for the dumbdbm module Original by Roger E. Masse """ # XXX This test is a disgrace. It doesn't test that it works. import dumbdbm as dbm from dumbdbm import error from test_support import verbose filename = '/tmp/delete_me' d = dbm.open(filename, 'c') d['a']...
#! /usr/bin/env python """Test script for the dumbdbm module Original by Roger E. Masse """ # XXX This test is a disgrace. It doesn't test that it works. import dumbdbm as dbm from dumbdbm import error from test_support import verbose, TESTFN as filename d = dbm.open(filename, 'c') d['a'] = 'b' d['12345678910'] ...
#! /usr/bin/env python """Test script for the dumbdbm module Original by Roger E. Masse """ # XXX This test is a disgrace. It doesn't test that it works. import dumbdbm as dbm from dumbdbm import error from test_support import verbose filename = '/tmp/delete_me' d = dbm.open(filename, 'c') d['a'] = 'b' d['12345...
<commit_before>#! /usr/bin/env python """Test script for the dumbdbm module Original by Roger E. Masse """ # XXX This test is a disgrace. It doesn't test that it works. import dumbdbm as dbm from dumbdbm import error from test_support import verbose filename = '/tmp/delete_me' d = dbm.open(filename, 'c') d['a']...
37ade5f4ce1feb44cdb7f8de1e373f5085c77a40
socrates.py
socrates.py
from socrates.main import main from socrates.bootstrap import run from optparse import OptionParser parser = OptionParser() parser.add_option('-i', '--init', action='store_true', help='Some help') parser.add_option('-g', '--generate', action='store_true', help='Some help') options, args = parser.parse_args() if opt...
from socrates.main import main from socrates.bootstrap import run from optparse import OptionParser parser = OptionParser() parser.add_option('-i', '--init', action='store_true', help='Some help') parser.add_option('-g', '--generate', action='store_true', help='Some help') parser.add_option('-r', '--run', action='sto...
Add simple server for testing purposes.
Add simple server for testing purposes.
Python
bsd-3-clause
thurloat/socrates,thurloat/socrates
from socrates.main import main from socrates.bootstrap import run from optparse import OptionParser parser = OptionParser() parser.add_option('-i', '--init', action='store_true', help='Some help') parser.add_option('-g', '--generate', action='store_true', help='Some help') options, args = parser.parse_args() if opt...
from socrates.main import main from socrates.bootstrap import run from optparse import OptionParser parser = OptionParser() parser.add_option('-i', '--init', action='store_true', help='Some help') parser.add_option('-g', '--generate', action='store_true', help='Some help') parser.add_option('-r', '--run', action='sto...
<commit_before>from socrates.main import main from socrates.bootstrap import run from optparse import OptionParser parser = OptionParser() parser.add_option('-i', '--init', action='store_true', help='Some help') parser.add_option('-g', '--generate', action='store_true', help='Some help') options, args = parser.parse...
from socrates.main import main from socrates.bootstrap import run from optparse import OptionParser parser = OptionParser() parser.add_option('-i', '--init', action='store_true', help='Some help') parser.add_option('-g', '--generate', action='store_true', help='Some help') parser.add_option('-r', '--run', action='sto...
from socrates.main import main from socrates.bootstrap import run from optparse import OptionParser parser = OptionParser() parser.add_option('-i', '--init', action='store_true', help='Some help') parser.add_option('-g', '--generate', action='store_true', help='Some help') options, args = parser.parse_args() if opt...
<commit_before>from socrates.main import main from socrates.bootstrap import run from optparse import OptionParser parser = OptionParser() parser.add_option('-i', '--init', action='store_true', help='Some help') parser.add_option('-g', '--generate', action='store_true', help='Some help') options, args = parser.parse...
cf245e71e770d21db8a48a74f8833d1099157e73
txircd/modules/ircv3/multiprefix.py
txircd/modules/ircv3/multiprefix.py
from twisted.plugin import IPlugin from txircd.module_interface import IModuleData, ModuleData from zope.interface import implements class MultiPrefix(ModuleData): implements(IPlugin, IModuleData) name = "MultiPrefix" def actions(self): return [ ("channelstatuses", 2, self.allStatuses), ("capabilit...
from twisted.plugin import IPlugin from txircd.module_interface import IModuleData, ModuleData from zope.interface import implements class MultiPrefix(ModuleData): implements(IPlugin, IModuleData) name = "MultiPrefix" def actions(self): return [ ("channelstatuses", 2, self.allStatuses), ("capabilit...
Reduce undoings of multi-prefix on users
Reduce undoings of multi-prefix on users
Python
bsd-3-clause
ElementalAlchemist/txircd,Heufneutje/txircd
from twisted.plugin import IPlugin from txircd.module_interface import IModuleData, ModuleData from zope.interface import implements class MultiPrefix(ModuleData): implements(IPlugin, IModuleData) name = "MultiPrefix" def actions(self): return [ ("channelstatuses", 2, self.allStatuses), ("capabilit...
from twisted.plugin import IPlugin from txircd.module_interface import IModuleData, ModuleData from zope.interface import implements class MultiPrefix(ModuleData): implements(IPlugin, IModuleData) name = "MultiPrefix" def actions(self): return [ ("channelstatuses", 2, self.allStatuses), ("capabilit...
<commit_before>from twisted.plugin import IPlugin from txircd.module_interface import IModuleData, ModuleData from zope.interface import implements class MultiPrefix(ModuleData): implements(IPlugin, IModuleData) name = "MultiPrefix" def actions(self): return [ ("channelstatuses", 2, self.allStatuses), ...
from twisted.plugin import IPlugin from txircd.module_interface import IModuleData, ModuleData from zope.interface import implements class MultiPrefix(ModuleData): implements(IPlugin, IModuleData) name = "MultiPrefix" def actions(self): return [ ("channelstatuses", 2, self.allStatuses), ("capabilit...
from twisted.plugin import IPlugin from txircd.module_interface import IModuleData, ModuleData from zope.interface import implements class MultiPrefix(ModuleData): implements(IPlugin, IModuleData) name = "MultiPrefix" def actions(self): return [ ("channelstatuses", 2, self.allStatuses), ("capabilit...
<commit_before>from twisted.plugin import IPlugin from txircd.module_interface import IModuleData, ModuleData from zope.interface import implements class MultiPrefix(ModuleData): implements(IPlugin, IModuleData) name = "MultiPrefix" def actions(self): return [ ("channelstatuses", 2, self.allStatuses), ...
1400a71d9827d76f14e70d4e8310dd20b9b47af4
life/life.py
life/life.py
import sys, random, time boardSize = (10,10) while True: foo, bar, baz, globals()['board'] = None if globals().get('board') is None else [ ( [sys.stdout.write('X' if cell else ' ') for cell in row], sys.stdout.write('\n') ) for row in board ], time.sleep(1), sys.stdout.writ...
import sys, random, time boardSize = (10,10) while True: foo, bar, baz, globals()['board'] = None if globals().get('board') is None else [ ( [sys.stdout.write('X' if cell else ' ') for cell in row], sys.stdout.write('\n') ) for row in board ], time.sleep(1), sys.stdout.writ...
Make separator line match width of board
Make separator line match width of board
Python
bsd-2-clause
bladams/golf
import sys, random, time boardSize = (10,10) while True: foo, bar, baz, globals()['board'] = None if globals().get('board') is None else [ ( [sys.stdout.write('X' if cell else ' ') for cell in row], sys.stdout.write('\n') ) for row in board ], time.sleep(1), sys.stdout.writ...
import sys, random, time boardSize = (10,10) while True: foo, bar, baz, globals()['board'] = None if globals().get('board') is None else [ ( [sys.stdout.write('X' if cell else ' ') for cell in row], sys.stdout.write('\n') ) for row in board ], time.sleep(1), sys.stdout.writ...
<commit_before>import sys, random, time boardSize = (10,10) while True: foo, bar, baz, globals()['board'] = None if globals().get('board') is None else [ ( [sys.stdout.write('X' if cell else ' ') for cell in row], sys.stdout.write('\n') ) for row in board ], time.sleep(1), ...
import sys, random, time boardSize = (10,10) while True: foo, bar, baz, globals()['board'] = None if globals().get('board') is None else [ ( [sys.stdout.write('X' if cell else ' ') for cell in row], sys.stdout.write('\n') ) for row in board ], time.sleep(1), sys.stdout.writ...
import sys, random, time boardSize = (10,10) while True: foo, bar, baz, globals()['board'] = None if globals().get('board') is None else [ ( [sys.stdout.write('X' if cell else ' ') for cell in row], sys.stdout.write('\n') ) for row in board ], time.sleep(1), sys.stdout.writ...
<commit_before>import sys, random, time boardSize = (10,10) while True: foo, bar, baz, globals()['board'] = None if globals().get('board') is None else [ ( [sys.stdout.write('X' if cell else ' ') for cell in row], sys.stdout.write('\n') ) for row in board ], time.sleep(1), ...
12f835d9060decfc675c81f7a1499b373b78f4cc
TrevorNet/tests/test_idx.py
TrevorNet/tests/test_idx.py
from .. import idx import os def test__count_dimensions(): yield check__count_dimensions, 9, 0 yield check__count_dimensions, [1, 2], 1 yield check__count_dimensions, [[1, 2], [3, 6, 2]], 2 yield check__count_dimensions, [[[1,2], [2]]], 3 def check__count_dimensions(lst, i): assert idx._count_dime...
from .. import idx import os def test__count_dimensions(): yield check__count_dimensions, 9, 0 yield check__count_dimensions, [1, 2], 1 yield check__count_dimensions, [[1, 2], [3, 6, 2]], 2 yield check__count_dimensions, [[[1,2], [2]]], 3 def check__count_dimensions(lst, i): assert idx._count_dime...
Fix issue where idx test uses wrong bytes object
Fix issue where idx test uses wrong bytes object Forgot to include the sizes of each dimension
Python
mit
tmerr/trevornet
from .. import idx import os def test__count_dimensions(): yield check__count_dimensions, 9, 0 yield check__count_dimensions, [1, 2], 1 yield check__count_dimensions, [[1, 2], [3, 6, 2]], 2 yield check__count_dimensions, [[[1,2], [2]]], 3 def check__count_dimensions(lst, i): assert idx._count_dime...
from .. import idx import os def test__count_dimensions(): yield check__count_dimensions, 9, 0 yield check__count_dimensions, [1, 2], 1 yield check__count_dimensions, [[1, 2], [3, 6, 2]], 2 yield check__count_dimensions, [[[1,2], [2]]], 3 def check__count_dimensions(lst, i): assert idx._count_dime...
<commit_before>from .. import idx import os def test__count_dimensions(): yield check__count_dimensions, 9, 0 yield check__count_dimensions, [1, 2], 1 yield check__count_dimensions, [[1, 2], [3, 6, 2]], 2 yield check__count_dimensions, [[[1,2], [2]]], 3 def check__count_dimensions(lst, i): assert ...
from .. import idx import os def test__count_dimensions(): yield check__count_dimensions, 9, 0 yield check__count_dimensions, [1, 2], 1 yield check__count_dimensions, [[1, 2], [3, 6, 2]], 2 yield check__count_dimensions, [[[1,2], [2]]], 3 def check__count_dimensions(lst, i): assert idx._count_dime...
from .. import idx import os def test__count_dimensions(): yield check__count_dimensions, 9, 0 yield check__count_dimensions, [1, 2], 1 yield check__count_dimensions, [[1, 2], [3, 6, 2]], 2 yield check__count_dimensions, [[[1,2], [2]]], 3 def check__count_dimensions(lst, i): assert idx._count_dime...
<commit_before>from .. import idx import os def test__count_dimensions(): yield check__count_dimensions, 9, 0 yield check__count_dimensions, [1, 2], 1 yield check__count_dimensions, [[1, 2], [3, 6, 2]], 2 yield check__count_dimensions, [[[1,2], [2]]], 3 def check__count_dimensions(lst, i): assert ...
f590080fc4d431b333f73ad548a50bc24d4fcf5b
fuzzer/main.py
fuzzer/main.py
import generator from ctypes import CDLL import numpy as np # Initializes the harness and sets it up for work harness = CDLL("harness/harness.so") while True: t = generator.generate() harness.register_testcase(t) try: exec(t, {'np':np}) except: # If the exec fails, then we should not s...
import generator from ctypes import CDLL import numpy as np # Initializes the harness and sets it up for work harness = CDLL("harness/harness.so") while True: t = generator.generate() harness.register_testcase(bytes(t, 'ascii')) try: exec(t, {'np':np}) except: # If the exec fails, then...
Send char string instead of widechar string
Send char string instead of widechar string
Python
apache-2.0
jaybosamiya/fuzzing-numpy,jaybosamiya/fuzzing-numpy,jaybosamiya/fuzzing-numpy
import generator from ctypes import CDLL import numpy as np # Initializes the harness and sets it up for work harness = CDLL("harness/harness.so") while True: t = generator.generate() harness.register_testcase(t) try: exec(t, {'np':np}) except: # If the exec fails, then we should not s...
import generator from ctypes import CDLL import numpy as np # Initializes the harness and sets it up for work harness = CDLL("harness/harness.so") while True: t = generator.generate() harness.register_testcase(bytes(t, 'ascii')) try: exec(t, {'np':np}) except: # If the exec fails, then...
<commit_before>import generator from ctypes import CDLL import numpy as np # Initializes the harness and sets it up for work harness = CDLL("harness/harness.so") while True: t = generator.generate() harness.register_testcase(t) try: exec(t, {'np':np}) except: # If the exec fails, then ...
import generator from ctypes import CDLL import numpy as np # Initializes the harness and sets it up for work harness = CDLL("harness/harness.so") while True: t = generator.generate() harness.register_testcase(bytes(t, 'ascii')) try: exec(t, {'np':np}) except: # If the exec fails, then...
import generator from ctypes import CDLL import numpy as np # Initializes the harness and sets it up for work harness = CDLL("harness/harness.so") while True: t = generator.generate() harness.register_testcase(t) try: exec(t, {'np':np}) except: # If the exec fails, then we should not s...
<commit_before>import generator from ctypes import CDLL import numpy as np # Initializes the harness and sets it up for work harness = CDLL("harness/harness.so") while True: t = generator.generate() harness.register_testcase(t) try: exec(t, {'np':np}) except: # If the exec fails, then ...
bc22dbd750228c546bdf47b26957154448bb2c5b
atrium/api/bleachconfig.py
atrium/api/bleachconfig.py
import bleach ALLOWED_TAGS = bleach.ALLOWED_TAGS + [ 'div', 'span', 's', 'u', 'img' ] ALLOWED_STYLES = bleach.ALLOWED_STYLES + [ 'font-weight', 'font-family', 'font-size' ] ALLOWED_ATTRIBUTES = bleach.ALLOWED_ATTRIBUTES ALLOWED_ATTRIBUTES['*'] = ['style']
import bleach ALLOWED_TAGS = bleach.ALLOWED_TAGS + [ 'div', 'span', 's', 'u', 'img', 'br' ] ALLOWED_STYLES = bleach.ALLOWED_STYLES + [ 'font-weight', 'font-family', 'font-size' ] ALLOWED_ATTRIBUTES = bleach.ALLOWED_ATTRIBUTES ALLOWED_ATTRIBUTES['*'] = ['style']
Add line break to allowed HTML tags
Add line break to allowed HTML tags
Python
apache-2.0
hugoatease/atrium,hugoatease/atrium,hugoatease/atrium
import bleach ALLOWED_TAGS = bleach.ALLOWED_TAGS + [ 'div', 'span', 's', 'u', 'img' ] ALLOWED_STYLES = bleach.ALLOWED_STYLES + [ 'font-weight', 'font-family', 'font-size' ] ALLOWED_ATTRIBUTES = bleach.ALLOWED_ATTRIBUTES ALLOWED_ATTRIBUTES['*'] = ['style']Add line break to allowed HTML tags
import bleach ALLOWED_TAGS = bleach.ALLOWED_TAGS + [ 'div', 'span', 's', 'u', 'img', 'br' ] ALLOWED_STYLES = bleach.ALLOWED_STYLES + [ 'font-weight', 'font-family', 'font-size' ] ALLOWED_ATTRIBUTES = bleach.ALLOWED_ATTRIBUTES ALLOWED_ATTRIBUTES['*'] = ['style']
<commit_before>import bleach ALLOWED_TAGS = bleach.ALLOWED_TAGS + [ 'div', 'span', 's', 'u', 'img' ] ALLOWED_STYLES = bleach.ALLOWED_STYLES + [ 'font-weight', 'font-family', 'font-size' ] ALLOWED_ATTRIBUTES = bleach.ALLOWED_ATTRIBUTES ALLOWED_ATTRIBUTES['*'] = ['style']<commit_msg>Add line break to allowed H...
import bleach ALLOWED_TAGS = bleach.ALLOWED_TAGS + [ 'div', 'span', 's', 'u', 'img', 'br' ] ALLOWED_STYLES = bleach.ALLOWED_STYLES + [ 'font-weight', 'font-family', 'font-size' ] ALLOWED_ATTRIBUTES = bleach.ALLOWED_ATTRIBUTES ALLOWED_ATTRIBUTES['*'] = ['style']
import bleach ALLOWED_TAGS = bleach.ALLOWED_TAGS + [ 'div', 'span', 's', 'u', 'img' ] ALLOWED_STYLES = bleach.ALLOWED_STYLES + [ 'font-weight', 'font-family', 'font-size' ] ALLOWED_ATTRIBUTES = bleach.ALLOWED_ATTRIBUTES ALLOWED_ATTRIBUTES['*'] = ['style']Add line break to allowed HTML tagsimport bleach ALLO...
<commit_before>import bleach ALLOWED_TAGS = bleach.ALLOWED_TAGS + [ 'div', 'span', 's', 'u', 'img' ] ALLOWED_STYLES = bleach.ALLOWED_STYLES + [ 'font-weight', 'font-family', 'font-size' ] ALLOWED_ATTRIBUTES = bleach.ALLOWED_ATTRIBUTES ALLOWED_ATTRIBUTES['*'] = ['style']<commit_msg>Add line break to allowed H...
627729380b8fbd6d1b4e4eec0362418dbf698d55
libs/qpanel/upgrader.py
libs/qpanel/upgrader.py
# -*- coding: utf-8 -*- # # Copyright (C) 2015-2016 Rodrigo Ramírez Norambuena <a@rodrigoramirez.com> # from urllib2 import Request, urlopen from distutils.version import LooseVersion BRANCH = 'stable' REPO = 'git@github.com:roramirez/qpanel.git' URL_STABLE_VERSION = 'https://raw.githubusercontent.com/roramirez/qpan...
# -*- coding: utf-8 -*- # # Copyright (C) 2015-2016 Rodrigo Ramírez Norambuena <a@rodrigoramirez.com> # from urllib2 import Request, urlopen from distutils.version import LooseVersion BRANCH = 'stable' REPO = 'git@github.com:roramirez/qpanel.git' URL_STABLE_VERSION = 'https://rodrigoramirez.com/qpanel/version/' + BR...
Change url to get stable version number
Change url to get stable version number
Python
mit
roramirez/qpanel,roramirez/qpanel,skazancev/qpanel,skazancev/qpanel,skazancev/qpanel,roramirez/qpanel,roramirez/qpanel,skazancev/qpanel
# -*- coding: utf-8 -*- # # Copyright (C) 2015-2016 Rodrigo Ramírez Norambuena <a@rodrigoramirez.com> # from urllib2 import Request, urlopen from distutils.version import LooseVersion BRANCH = 'stable' REPO = 'git@github.com:roramirez/qpanel.git' URL_STABLE_VERSION = 'https://raw.githubusercontent.com/roramirez/qpan...
# -*- coding: utf-8 -*- # # Copyright (C) 2015-2016 Rodrigo Ramírez Norambuena <a@rodrigoramirez.com> # from urllib2 import Request, urlopen from distutils.version import LooseVersion BRANCH = 'stable' REPO = 'git@github.com:roramirez/qpanel.git' URL_STABLE_VERSION = 'https://rodrigoramirez.com/qpanel/version/' + BR...
<commit_before># -*- coding: utf-8 -*- # # Copyright (C) 2015-2016 Rodrigo Ramírez Norambuena <a@rodrigoramirez.com> # from urllib2 import Request, urlopen from distutils.version import LooseVersion BRANCH = 'stable' REPO = 'git@github.com:roramirez/qpanel.git' URL_STABLE_VERSION = 'https://raw.githubusercontent.com...
# -*- coding: utf-8 -*- # # Copyright (C) 2015-2016 Rodrigo Ramírez Norambuena <a@rodrigoramirez.com> # from urllib2 import Request, urlopen from distutils.version import LooseVersion BRANCH = 'stable' REPO = 'git@github.com:roramirez/qpanel.git' URL_STABLE_VERSION = 'https://rodrigoramirez.com/qpanel/version/' + BR...
# -*- coding: utf-8 -*- # # Copyright (C) 2015-2016 Rodrigo Ramírez Norambuena <a@rodrigoramirez.com> # from urllib2 import Request, urlopen from distutils.version import LooseVersion BRANCH = 'stable' REPO = 'git@github.com:roramirez/qpanel.git' URL_STABLE_VERSION = 'https://raw.githubusercontent.com/roramirez/qpan...
<commit_before># -*- coding: utf-8 -*- # # Copyright (C) 2015-2016 Rodrigo Ramírez Norambuena <a@rodrigoramirez.com> # from urllib2 import Request, urlopen from distutils.version import LooseVersion BRANCH = 'stable' REPO = 'git@github.com:roramirez/qpanel.git' URL_STABLE_VERSION = 'https://raw.githubusercontent.com...
798a716cb6c3acd6e636d3b9cab755950ead5539
Seeder/voting/signals.py
Seeder/voting/signals.py
# pylint: disable=W0613 from django.dispatch import receiver from django.db.models.signals import post_save from voting import constants from source.models import Source from voting.models import VotingRound from source import constants as source_constants from contracts.models import Contract @receiver(signal=post_...
# pylint: disable=W0613 from django.dispatch import receiver from django.db.models.signals import post_save from voting import constants from source.models import Source from voting.models import VotingRound from source import constants as source_constants from contracts.models import Contract @receiver(signal=post_...
Fix process_voting_round to reflect contract model
Fix process_voting_round to reflect contract model
Python
mit
WebArchivCZ/Seeder,WebArchivCZ/Seeder,WebArchivCZ/Seeder,WebArchivCZ/Seeder,WebArchivCZ/Seeder
# pylint: disable=W0613 from django.dispatch import receiver from django.db.models.signals import post_save from voting import constants from source.models import Source from voting.models import VotingRound from source import constants as source_constants from contracts.models import Contract @receiver(signal=post_...
# pylint: disable=W0613 from django.dispatch import receiver from django.db.models.signals import post_save from voting import constants from source.models import Source from voting.models import VotingRound from source import constants as source_constants from contracts.models import Contract @receiver(signal=post_...
<commit_before># pylint: disable=W0613 from django.dispatch import receiver from django.db.models.signals import post_save from voting import constants from source.models import Source from voting.models import VotingRound from source import constants as source_constants from contracts.models import Contract @receiv...
# pylint: disable=W0613 from django.dispatch import receiver from django.db.models.signals import post_save from voting import constants from source.models import Source from voting.models import VotingRound from source import constants as source_constants from contracts.models import Contract @receiver(signal=post_...
# pylint: disable=W0613 from django.dispatch import receiver from django.db.models.signals import post_save from voting import constants from source.models import Source from voting.models import VotingRound from source import constants as source_constants from contracts.models import Contract @receiver(signal=post_...
<commit_before># pylint: disable=W0613 from django.dispatch import receiver from django.db.models.signals import post_save from voting import constants from source.models import Source from voting.models import VotingRound from source import constants as source_constants from contracts.models import Contract @receiv...
856207c8399d94e99a6f2ffb1e10befecb6150cf
src/generate-jobs/calculate_quad_key.py
src/generate-jobs/calculate_quad_key.py
#!/usr/bin/env python """Calculate QuadKey for TSV file and append it as column Usage: calculate_quad_key.py <list_file> calculate_quad_key.py (-h | --help) calculate_quad_key.py --version Options: -h --help Show this screen. --version Show version. """ import system im...
#!/usr/bin/env python """Calculate QuadKey for TSV file and append it as column Usage: calculate_quad_key.py <list_file> calculate_quad_key.py (-h | --help) calculate_quad_key.py --version Options: -h --help Show this screen. --version Show version. """ import sys impor...
Fix line endings in CSV and stdout typo
Fix line endings in CSV and stdout typo
Python
mit
geometalab/osm2vectortiles,geometalab/osm2vectortiles,osm2vectortiles/osm2vectortiles,osm2vectortiles/osm2vectortiles
#!/usr/bin/env python """Calculate QuadKey for TSV file and append it as column Usage: calculate_quad_key.py <list_file> calculate_quad_key.py (-h | --help) calculate_quad_key.py --version Options: -h --help Show this screen. --version Show version. """ import system im...
#!/usr/bin/env python """Calculate QuadKey for TSV file and append it as column Usage: calculate_quad_key.py <list_file> calculate_quad_key.py (-h | --help) calculate_quad_key.py --version Options: -h --help Show this screen. --version Show version. """ import sys impor...
<commit_before>#!/usr/bin/env python """Calculate QuadKey for TSV file and append it as column Usage: calculate_quad_key.py <list_file> calculate_quad_key.py (-h | --help) calculate_quad_key.py --version Options: -h --help Show this screen. --version Show version. """ i...
#!/usr/bin/env python """Calculate QuadKey for TSV file and append it as column Usage: calculate_quad_key.py <list_file> calculate_quad_key.py (-h | --help) calculate_quad_key.py --version Options: -h --help Show this screen. --version Show version. """ import sys impor...
#!/usr/bin/env python """Calculate QuadKey for TSV file and append it as column Usage: calculate_quad_key.py <list_file> calculate_quad_key.py (-h | --help) calculate_quad_key.py --version Options: -h --help Show this screen. --version Show version. """ import system im...
<commit_before>#!/usr/bin/env python """Calculate QuadKey for TSV file and append it as column Usage: calculate_quad_key.py <list_file> calculate_quad_key.py (-h | --help) calculate_quad_key.py --version Options: -h --help Show this screen. --version Show version. """ i...
74ce850d7db766328e2931f5a8119b7e2e5b1ded
examples/basic_example.py
examples/basic_example.py
#!/usr/bin/env python ''' A simple script using sparqllib and rdflib to retrieve a JSON representation of some information about Barack Obama from dbpedia. ''' from sparqllib import Query from rdflib import BNode, Literal from rdflib.namespace import FOAF from pprint import pprint if __name__ == "__main__": # co...
#!/usr/bin/env python ''' A simple script using sparqllib and rdflib to retrieve a JSON representation of some information about Barack Obama from dbpedia. ''' from sparqllib import Query from rdflib import BNode, Literal from rdflib.namespace import FOAF from pprint import pprint def main(): # construct the que...
Switch to main method in examples
Switch to main method in examples
Python
mit
ALSchwalm/sparqllib
#!/usr/bin/env python ''' A simple script using sparqllib and rdflib to retrieve a JSON representation of some information about Barack Obama from dbpedia. ''' from sparqllib import Query from rdflib import BNode, Literal from rdflib.namespace import FOAF from pprint import pprint if __name__ == "__main__": # co...
#!/usr/bin/env python ''' A simple script using sparqllib and rdflib to retrieve a JSON representation of some information about Barack Obama from dbpedia. ''' from sparqllib import Query from rdflib import BNode, Literal from rdflib.namespace import FOAF from pprint import pprint def main(): # construct the que...
<commit_before>#!/usr/bin/env python ''' A simple script using sparqllib and rdflib to retrieve a JSON representation of some information about Barack Obama from dbpedia. ''' from sparqllib import Query from rdflib import BNode, Literal from rdflib.namespace import FOAF from pprint import pprint if __name__ == "__ma...
#!/usr/bin/env python ''' A simple script using sparqllib and rdflib to retrieve a JSON representation of some information about Barack Obama from dbpedia. ''' from sparqllib import Query from rdflib import BNode, Literal from rdflib.namespace import FOAF from pprint import pprint def main(): # construct the que...
#!/usr/bin/env python ''' A simple script using sparqllib and rdflib to retrieve a JSON representation of some information about Barack Obama from dbpedia. ''' from sparqllib import Query from rdflib import BNode, Literal from rdflib.namespace import FOAF from pprint import pprint if __name__ == "__main__": # co...
<commit_before>#!/usr/bin/env python ''' A simple script using sparqllib and rdflib to retrieve a JSON representation of some information about Barack Obama from dbpedia. ''' from sparqllib import Query from rdflib import BNode, Literal from rdflib.namespace import FOAF from pprint import pprint if __name__ == "__ma...