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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bb80ef40356be4384b0ddf0e4510865d4d33c654 | appengine_config.py | appengine_config.py | """
`appengine_config` gets loaded when starting a new application instance.
"""
import site
import os.path
# add `lib` subdirectory as a site packages directory, so our `main` module can load
# third-party libraries.
site.addsitedir(os.path.join(os.path.dirname(__file__), 'lib'))
| """
`appengine_config` gets loaded when starting a new application instance.
"""
from google.appengine.ext import vendor
vendor.add('lib')
| Use a newer method for specifying the vendored packages directory. | Use a newer method for specifying the vendored packages directory.
| Python | mit | boulder-python/boulderpython.org,boulder-python/boulderpython.org,boulder-python/boulderpython.org,boulder-python/boulderpython.org | """
`appengine_config` gets loaded when starting a new application instance.
"""
import site
import os.path
# add `lib` subdirectory as a site packages directory, so our `main` module can load
# third-party libraries.
site.addsitedir(os.path.join(os.path.dirname(__file__), 'lib'))
Use a newer method for specifying the... | """
`appengine_config` gets loaded when starting a new application instance.
"""
from google.appengine.ext import vendor
vendor.add('lib')
| <commit_before>"""
`appengine_config` gets loaded when starting a new application instance.
"""
import site
import os.path
# add `lib` subdirectory as a site packages directory, so our `main` module can load
# third-party libraries.
site.addsitedir(os.path.join(os.path.dirname(__file__), 'lib'))
<commit_msg>Use a newe... | """
`appengine_config` gets loaded when starting a new application instance.
"""
from google.appengine.ext import vendor
vendor.add('lib')
| """
`appengine_config` gets loaded when starting a new application instance.
"""
import site
import os.path
# add `lib` subdirectory as a site packages directory, so our `main` module can load
# third-party libraries.
site.addsitedir(os.path.join(os.path.dirname(__file__), 'lib'))
Use a newer method for specifying the... | <commit_before>"""
`appengine_config` gets loaded when starting a new application instance.
"""
import site
import os.path
# add `lib` subdirectory as a site packages directory, so our `main` module can load
# third-party libraries.
site.addsitedir(os.path.join(os.path.dirname(__file__), 'lib'))
<commit_msg>Use a newe... |
2c4823d7a1acbfc048e67a58c0cd581c5699129e | biwako/bin/fields/util.py | biwako/bin/fields/util.py | import sys
from .base import Field
class Reserved(Field):
def __init__(self, *args, **kwargs):
super(Reserved, self).__init__(*args, **kwargs)
# Hack to add the reserved field to the class without
# having to explicitly give it a (likely useless) name
frame = sys._getf... | import sys
from .base import Field
class Reserved(Field):
def __init__(self, *args, **kwargs):
super(Reserved, self).__init__(*args, **kwargs)
# Hack to add the reserved field to the class without
# having to explicitly give it a (likely useless) name
frame = sys._getf... | Fix reserved field name setting | Fix reserved field name setting
| Python | bsd-3-clause | gulopine/steel | import sys
from .base import Field
class Reserved(Field):
def __init__(self, *args, **kwargs):
super(Reserved, self).__init__(*args, **kwargs)
# Hack to add the reserved field to the class without
# having to explicitly give it a (likely useless) name
frame = sys._getf... | import sys
from .base import Field
class Reserved(Field):
def __init__(self, *args, **kwargs):
super(Reserved, self).__init__(*args, **kwargs)
# Hack to add the reserved field to the class without
# having to explicitly give it a (likely useless) name
frame = sys._getf... | <commit_before>import sys
from .base import Field
class Reserved(Field):
def __init__(self, *args, **kwargs):
super(Reserved, self).__init__(*args, **kwargs)
# Hack to add the reserved field to the class without
# having to explicitly give it a (likely useless) name
fr... | import sys
from .base import Field
class Reserved(Field):
def __init__(self, *args, **kwargs):
super(Reserved, self).__init__(*args, **kwargs)
# Hack to add the reserved field to the class without
# having to explicitly give it a (likely useless) name
frame = sys._getf... | import sys
from .base import Field
class Reserved(Field):
def __init__(self, *args, **kwargs):
super(Reserved, self).__init__(*args, **kwargs)
# Hack to add the reserved field to the class without
# having to explicitly give it a (likely useless) name
frame = sys._getf... | <commit_before>import sys
from .base import Field
class Reserved(Field):
def __init__(self, *args, **kwargs):
super(Reserved, self).__init__(*args, **kwargs)
# Hack to add the reserved field to the class without
# having to explicitly give it a (likely useless) name
fr... |
3e202c0dd4fa4c99ebee758a13ee5f6e205ef336 | tests/functional/test_front_page.py | tests/functional/test_front_page.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from webpages import *
@pytest.fixture
def page(browser, server_url, access_token):
return FrontPage(browser, server_url, access_token)
class TestFrontPage(object):
def test_should_find_page_div(self... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from webpages import *
@pytest.fixture
def page(browser, server_url, access_token):
return FrontPage(browser, server_url, access_token)
class TestFrontPage(object):
def test_should_find_page_div(self... | Change failed test case for front page to make build pass | Change failed test case for front page to make build pass
| Python | apache-2.0 | eavatar/eavatar-me,eavatar/eavatar-me,eavatar/eavatar-me,eavatar/eavatar-me | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from webpages import *
@pytest.fixture
def page(browser, server_url, access_token):
return FrontPage(browser, server_url, access_token)
class TestFrontPage(object):
def test_should_find_page_div(self... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from webpages import *
@pytest.fixture
def page(browser, server_url, access_token):
return FrontPage(browser, server_url, access_token)
class TestFrontPage(object):
def test_should_find_page_div(self... | <commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from webpages import *
@pytest.fixture
def page(browser, server_url, access_token):
return FrontPage(browser, server_url, access_token)
class TestFrontPage(object):
def test_should_fin... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from webpages import *
@pytest.fixture
def page(browser, server_url, access_token):
return FrontPage(browser, server_url, access_token)
class TestFrontPage(object):
def test_should_find_page_div(self... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from webpages import *
@pytest.fixture
def page(browser, server_url, access_token):
return FrontPage(browser, server_url, access_token)
class TestFrontPage(object):
def test_should_find_page_div(self... | <commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from webpages import *
@pytest.fixture
def page(browser, server_url, access_token):
return FrontPage(browser, server_url, access_token)
class TestFrontPage(object):
def test_should_fin... |
9aacf80789d6d540fe9260ecf22d7d489cd330a0 | bills/urls.py | bills/urls.py | from . import views
from django.conf.urls import url
urlpatterns = [
url(r'^by_topic/(?P<topic_selected>(.*))/$', views.bill_list_by_topic, name='by_topic_selected'),
url(r'^by_topic/', views.bill_list_by_topic, name='by_topic'),
url(r'^by_location/(?P<location_selected>(.*))/', views.bill_list_by_locatio... | from . import views
from django.conf.urls import url
urlpatterns = [
url(r'^by_topic/', views.bill_list_by_topic, name='by_topic'),
url(r'^by_location/', views.bill_list_by_location, name='by_location'),
url(r'^by_legislator/', views.bill_list_by_legislator, name='by_legislator'),
url(r'^current_sessi... | Remove special topics and locations from URLs | Remove special topics and locations from URLs
| Python | mit | jamesturk/tot,jamesturk/tot,jamesturk/tot,jamesturk/tot,jamesturk/tot | from . import views
from django.conf.urls import url
urlpatterns = [
url(r'^by_topic/(?P<topic_selected>(.*))/$', views.bill_list_by_topic, name='by_topic_selected'),
url(r'^by_topic/', views.bill_list_by_topic, name='by_topic'),
url(r'^by_location/(?P<location_selected>(.*))/', views.bill_list_by_locatio... | from . import views
from django.conf.urls import url
urlpatterns = [
url(r'^by_topic/', views.bill_list_by_topic, name='by_topic'),
url(r'^by_location/', views.bill_list_by_location, name='by_location'),
url(r'^by_legislator/', views.bill_list_by_legislator, name='by_legislator'),
url(r'^current_sessi... | <commit_before>from . import views
from django.conf.urls import url
urlpatterns = [
url(r'^by_topic/(?P<topic_selected>(.*))/$', views.bill_list_by_topic, name='by_topic_selected'),
url(r'^by_topic/', views.bill_list_by_topic, name='by_topic'),
url(r'^by_location/(?P<location_selected>(.*))/', views.bill_... | from . import views
from django.conf.urls import url
urlpatterns = [
url(r'^by_topic/', views.bill_list_by_topic, name='by_topic'),
url(r'^by_location/', views.bill_list_by_location, name='by_location'),
url(r'^by_legislator/', views.bill_list_by_legislator, name='by_legislator'),
url(r'^current_sessi... | from . import views
from django.conf.urls import url
urlpatterns = [
url(r'^by_topic/(?P<topic_selected>(.*))/$', views.bill_list_by_topic, name='by_topic_selected'),
url(r'^by_topic/', views.bill_list_by_topic, name='by_topic'),
url(r'^by_location/(?P<location_selected>(.*))/', views.bill_list_by_locatio... | <commit_before>from . import views
from django.conf.urls import url
urlpatterns = [
url(r'^by_topic/(?P<topic_selected>(.*))/$', views.bill_list_by_topic, name='by_topic_selected'),
url(r'^by_topic/', views.bill_list_by_topic, name='by_topic'),
url(r'^by_location/(?P<location_selected>(.*))/', views.bill_... |
9fa95b373c2b43c6e0852aff82ec4c31821a7742 | scss/tests/test_files.py | scss/tests/test_files.py | """Evaluates all the tests that live in `scss/tests/files`.
A test is any file with a `.scss` extension. It'll be compiled, and the output
will be compared to the contents of a file named `foo.css`.
Currently, test files must be nested exactly one directory below `files/`.
This limitation is completely arbitrary.
""... | """Evaluates all the tests that live in `scss/tests/files`.
A test is any file with a `.scss` extension. It'll be compiled, and the output
will be compared to the contents of a file named `foo.css`.
Currently, test files must be nested exactly one directory below `files/`.
This limitation is completely arbitrary.
""... | Add static root path to tests | Add static root path to tests
| Python | mit | Kronuz/pyScss,hashamali/pyScss,cpfair/pyScss,cpfair/pyScss,cpfair/pyScss,Kronuz/pyScss,hashamali/pyScss,hashamali/pyScss,Kronuz/pyScss,Kronuz/pyScss | """Evaluates all the tests that live in `scss/tests/files`.
A test is any file with a `.scss` extension. It'll be compiled, and the output
will be compared to the contents of a file named `foo.css`.
Currently, test files must be nested exactly one directory below `files/`.
This limitation is completely arbitrary.
""... | """Evaluates all the tests that live in `scss/tests/files`.
A test is any file with a `.scss` extension. It'll be compiled, and the output
will be compared to the contents of a file named `foo.css`.
Currently, test files must be nested exactly one directory below `files/`.
This limitation is completely arbitrary.
""... | <commit_before>"""Evaluates all the tests that live in `scss/tests/files`.
A test is any file with a `.scss` extension. It'll be compiled, and the output
will be compared to the contents of a file named `foo.css`.
Currently, test files must be nested exactly one directory below `files/`.
This limitation is completel... | """Evaluates all the tests that live in `scss/tests/files`.
A test is any file with a `.scss` extension. It'll be compiled, and the output
will be compared to the contents of a file named `foo.css`.
Currently, test files must be nested exactly one directory below `files/`.
This limitation is completely arbitrary.
""... | """Evaluates all the tests that live in `scss/tests/files`.
A test is any file with a `.scss` extension. It'll be compiled, and the output
will be compared to the contents of a file named `foo.css`.
Currently, test files must be nested exactly one directory below `files/`.
This limitation is completely arbitrary.
""... | <commit_before>"""Evaluates all the tests that live in `scss/tests/files`.
A test is any file with a `.scss` extension. It'll be compiled, and the output
will be compared to the contents of a file named `foo.css`.
Currently, test files must be nested exactly one directory below `files/`.
This limitation is completel... |
efb59846dfc577eb937cb9adc411a7d3c26dd6d9 | stylo/testing/strategies.py | stylo/testing/strategies.py | """Specific hypothesis strategies that are useful for testing.
It defines the following strategies:
- :code:`dimension`: Represents a size or dimension e.g. for numpy arrays image
sizes etc.
- :code:`real`: Represents a real number in the range +/-1 million
"""
from math import pi
from hypothesis.strategies import... | """Specific hypothesis strategies that are useful for testing.
It defines the following strategies:
- :code:`dimension`: Represents a size or dimension e.g. for numpy arrays image
sizes etc.
- :code:`real`: Represents a real number in the range +/-1 million
"""
from math import pi
from hypothesis.strategies import... | Increase the minimum dimension used in the tests | Increase the minimum dimension used in the tests
| Python | mit | alcarney/stylo,alcarney/stylo | """Specific hypothesis strategies that are useful for testing.
It defines the following strategies:
- :code:`dimension`: Represents a size or dimension e.g. for numpy arrays image
sizes etc.
- :code:`real`: Represents a real number in the range +/-1 million
"""
from math import pi
from hypothesis.strategies import... | """Specific hypothesis strategies that are useful for testing.
It defines the following strategies:
- :code:`dimension`: Represents a size or dimension e.g. for numpy arrays image
sizes etc.
- :code:`real`: Represents a real number in the range +/-1 million
"""
from math import pi
from hypothesis.strategies import... | <commit_before>"""Specific hypothesis strategies that are useful for testing.
It defines the following strategies:
- :code:`dimension`: Represents a size or dimension e.g. for numpy arrays image
sizes etc.
- :code:`real`: Represents a real number in the range +/-1 million
"""
from math import pi
from hypothesis.st... | """Specific hypothesis strategies that are useful for testing.
It defines the following strategies:
- :code:`dimension`: Represents a size or dimension e.g. for numpy arrays image
sizes etc.
- :code:`real`: Represents a real number in the range +/-1 million
"""
from math import pi
from hypothesis.strategies import... | """Specific hypothesis strategies that are useful for testing.
It defines the following strategies:
- :code:`dimension`: Represents a size or dimension e.g. for numpy arrays image
sizes etc.
- :code:`real`: Represents a real number in the range +/-1 million
"""
from math import pi
from hypothesis.strategies import... | <commit_before>"""Specific hypothesis strategies that are useful for testing.
It defines the following strategies:
- :code:`dimension`: Represents a size or dimension e.g. for numpy arrays image
sizes etc.
- :code:`real`: Represents a real number in the range +/-1 million
"""
from math import pi
from hypothesis.st... |
de958b9fc68ad6209749edbfe2bdde0ef68cf3c8 | experiments/middleware.py | experiments/middleware.py | from experiments.utils import participant
class ExperimentsRetentionMiddleware(object):
def process_response(self, request, response):
# We detect widgets by relying on the fact that they are flagged as being embedable, and don't include these in visit tracking
if getattr(response, 'xframe_options... | from experiments.utils import participant
class ExperimentsRetentionMiddleware(object):
def process_response(self, request, response):
# Don't track, failed pages, ajax requests, logged out users or widget impressions.
# We detect widgets by relying on the fact that they are flagged as being embeda... | Revert "tidy up ajax page loads so they count towards experiments" | Revert "tidy up ajax page loads so they count towards experiments"
This reverts commit a37cacb96c4021fcc2f9e23e024d8947bb4e644f.
| Python | mit | mixcloud/django-experiments,bjarnoldus/django-experiments,bjarnoldus/django-experiments,robertobarreda/django-experiments,mixcloud/django-experiments,robertobarreda/django-experiments,squamous/django-experiments,squamous/django-experiments,uhuramedia/django-experiments,mixcloud/django-experiments,bjarnoldus/django-expe... | from experiments.utils import participant
class ExperimentsRetentionMiddleware(object):
def process_response(self, request, response):
# We detect widgets by relying on the fact that they are flagged as being embedable, and don't include these in visit tracking
if getattr(response, 'xframe_options... | from experiments.utils import participant
class ExperimentsRetentionMiddleware(object):
def process_response(self, request, response):
# Don't track, failed pages, ajax requests, logged out users or widget impressions.
# We detect widgets by relying on the fact that they are flagged as being embeda... | <commit_before>from experiments.utils import participant
class ExperimentsRetentionMiddleware(object):
def process_response(self, request, response):
# We detect widgets by relying on the fact that they are flagged as being embedable, and don't include these in visit tracking
if getattr(response, ... | from experiments.utils import participant
class ExperimentsRetentionMiddleware(object):
def process_response(self, request, response):
# Don't track, failed pages, ajax requests, logged out users or widget impressions.
# We detect widgets by relying on the fact that they are flagged as being embeda... | from experiments.utils import participant
class ExperimentsRetentionMiddleware(object):
def process_response(self, request, response):
# We detect widgets by relying on the fact that they are flagged as being embedable, and don't include these in visit tracking
if getattr(response, 'xframe_options... | <commit_before>from experiments.utils import participant
class ExperimentsRetentionMiddleware(object):
def process_response(self, request, response):
# We detect widgets by relying on the fact that they are flagged as being embedable, and don't include these in visit tracking
if getattr(response, ... |
88fc0f980f0efa403ab5ce7d6775bce008b284fc | _setup_database.py | _setup_database.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
from setup.create_teams import migrate_teams
from setup.create_divisions import create_divisions
from setup.create_players import migrate_players
from setup.create_player_seasons import create_player_seasons
from setup.create_player_seasons import create_p... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
from setup.create_teams import migrate_teams
from setup.create_divisions import create_divisions
from setup.create_players import migrate_players
from setup.create_player_seasons import create_player_seasons
from setup.create_player_seasons import create_p... | Add contract retrieval option to database setup script | Add contract retrieval option to database setup script
| Python | mit | leaffan/pynhldb | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
from setup.create_teams import migrate_teams
from setup.create_divisions import create_divisions
from setup.create_players import migrate_players
from setup.create_player_seasons import create_player_seasons
from setup.create_player_seasons import create_p... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
from setup.create_teams import migrate_teams
from setup.create_divisions import create_divisions
from setup.create_players import migrate_players
from setup.create_player_seasons import create_player_seasons
from setup.create_player_seasons import create_p... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
from setup.create_teams import migrate_teams
from setup.create_divisions import create_divisions
from setup.create_players import migrate_players
from setup.create_player_seasons import create_player_seasons
from setup.create_player_seasons ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
from setup.create_teams import migrate_teams
from setup.create_divisions import create_divisions
from setup.create_players import migrate_players
from setup.create_player_seasons import create_player_seasons
from setup.create_player_seasons import create_p... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
from setup.create_teams import migrate_teams
from setup.create_divisions import create_divisions
from setup.create_players import migrate_players
from setup.create_player_seasons import create_player_seasons
from setup.create_player_seasons import create_p... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
from setup.create_teams import migrate_teams
from setup.create_divisions import create_divisions
from setup.create_players import migrate_players
from setup.create_player_seasons import create_player_seasons
from setup.create_player_seasons ... |
7a7d3159f774c29748b8236468dfe31729077d5c | test/test_ev3_legosensor.py | test/test_ev3_legosensor.py | from ev3.ev3dev import LegoSensor
import unittest
from util import get_input
import glob
class TestLegoSensor(unittest.TestCase):
def test_LegoSensor(self):
get_input('Attach a Msensor on port 1 then continue')
d = LegoSensor(port=1)
print(d.mode)
print(d.port)
if (len(glo... | from ev3.ev3dev import LegoSensor
import unittest
from util import get_input
import glob
class TestLegoSensor(unittest.TestCase):
def test_LegoSensor(self):
get_input('Attach a Lego on port 1 then continue')
d = LegoSensor(port=1)
print(d.mode)
print(d.port)
if (len(glob.g... | Fix an typo error in test | Fix an typo error in test
| Python | apache-2.0 | topikachu/python-ev3,topikachu/python-ev3,evz/python-ev3,evz/python-ev3,MaxNoe/python-ev3,MaxNoe/python-ev3 | from ev3.ev3dev import LegoSensor
import unittest
from util import get_input
import glob
class TestLegoSensor(unittest.TestCase):
def test_LegoSensor(self):
get_input('Attach a Msensor on port 1 then continue')
d = LegoSensor(port=1)
print(d.mode)
print(d.port)
if (len(glo... | from ev3.ev3dev import LegoSensor
import unittest
from util import get_input
import glob
class TestLegoSensor(unittest.TestCase):
def test_LegoSensor(self):
get_input('Attach a Lego on port 1 then continue')
d = LegoSensor(port=1)
print(d.mode)
print(d.port)
if (len(glob.g... | <commit_before>from ev3.ev3dev import LegoSensor
import unittest
from util import get_input
import glob
class TestLegoSensor(unittest.TestCase):
def test_LegoSensor(self):
get_input('Attach a Msensor on port 1 then continue')
d = LegoSensor(port=1)
print(d.mode)
print(d.port)
... | from ev3.ev3dev import LegoSensor
import unittest
from util import get_input
import glob
class TestLegoSensor(unittest.TestCase):
def test_LegoSensor(self):
get_input('Attach a Lego on port 1 then continue')
d = LegoSensor(port=1)
print(d.mode)
print(d.port)
if (len(glob.g... | from ev3.ev3dev import LegoSensor
import unittest
from util import get_input
import glob
class TestLegoSensor(unittest.TestCase):
def test_LegoSensor(self):
get_input('Attach a Msensor on port 1 then continue')
d = LegoSensor(port=1)
print(d.mode)
print(d.port)
if (len(glo... | <commit_before>from ev3.ev3dev import LegoSensor
import unittest
from util import get_input
import glob
class TestLegoSensor(unittest.TestCase):
def test_LegoSensor(self):
get_input('Attach a Msensor on port 1 then continue')
d = LegoSensor(port=1)
print(d.mode)
print(d.port)
... |
0dd6ec1c66b0873cc8f508ad4dffc2aa8fa6ad0d | testing/test_need_update.py | testing/test_need_update.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 os
@needinternet
def test_check_vers_update(fixture_update_dir):
package=fixture_update_dir("0.0.1")
launch = Laun... | 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 os
@needinternet
def test_check_vers_update(fixture_update_dir):
package=fixture_update_dir("0.0.1")
launch = Laun... | Make sure .old in need_update is removed properly | Make sure .old in need_update is removed properly
| 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 os
@needinternet
def test_check_vers_update(fixture_update_dir):
package=fixture_update_dir("0.0.1")
launch = Laun... | 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 os
@needinternet
def test_check_vers_update(fixture_update_dir):
package=fixture_update_dir("0.0.1")
launch = Laun... | <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 os
@needinternet
def test_check_vers_update(fixture_update_dir):
package=fixture_update_dir("0.0.1")
... | 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 os
@needinternet
def test_check_vers_update(fixture_update_dir):
package=fixture_update_dir("0.0.1")
launch = Laun... | 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 os
@needinternet
def test_check_vers_update(fixture_update_dir):
package=fixture_update_dir("0.0.1")
launch = Laun... | <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 os
@needinternet
def test_check_vers_update(fixture_update_dir):
package=fixture_update_dir("0.0.1")
... |
e4645dd7ecf97a026ced01535086f8fc9efc8ba3 | src/python/fsqio/pants/buildgen/core/buildgen_base.py | src/python/fsqio/pants/buildgen/core/buildgen_base.py | # coding=utf-8
# Copyright 2016 Foursquare Labs Inc. All Rights Reserved.
from __future__ import (
absolute_import,
division,
generators,
nested_scopes,
print_function,
unicode_literals,
with_statement,
)
from pants.task.task import Task
from pants.util.memo import memoized_property
from fsqio.pants.bu... | # coding=utf-8
# Copyright 2016 Foursquare Labs Inc. All Rights Reserved.
from __future__ import (
absolute_import,
division,
generators,
nested_scopes,
print_function,
unicode_literals,
with_statement,
)
from pants.task.task import Task
from pants.util.memo import memoized_property
from fsqio.pants.bu... | Add task version to BuildgenBase. | Add task version to BuildgenBase.
Debugging a break after a refactor, I wanted to invalidate
just the buildgen caches.
(sapling split of c73dc81f2af0cdc87d21519b032ae3f6213c932c) | Python | apache-2.0 | foursquare/fsqio,foursquare/fsqio,foursquare/fsqio,foursquare/fsqio,foursquare/fsqio | # coding=utf-8
# Copyright 2016 Foursquare Labs Inc. All Rights Reserved.
from __future__ import (
absolute_import,
division,
generators,
nested_scopes,
print_function,
unicode_literals,
with_statement,
)
from pants.task.task import Task
from pants.util.memo import memoized_property
from fsqio.pants.bu... | # coding=utf-8
# Copyright 2016 Foursquare Labs Inc. All Rights Reserved.
from __future__ import (
absolute_import,
division,
generators,
nested_scopes,
print_function,
unicode_literals,
with_statement,
)
from pants.task.task import Task
from pants.util.memo import memoized_property
from fsqio.pants.bu... | <commit_before># coding=utf-8
# Copyright 2016 Foursquare Labs Inc. All Rights Reserved.
from __future__ import (
absolute_import,
division,
generators,
nested_scopes,
print_function,
unicode_literals,
with_statement,
)
from pants.task.task import Task
from pants.util.memo import memoized_property
from... | # coding=utf-8
# Copyright 2016 Foursquare Labs Inc. All Rights Reserved.
from __future__ import (
absolute_import,
division,
generators,
nested_scopes,
print_function,
unicode_literals,
with_statement,
)
from pants.task.task import Task
from pants.util.memo import memoized_property
from fsqio.pants.bu... | # coding=utf-8
# Copyright 2016 Foursquare Labs Inc. All Rights Reserved.
from __future__ import (
absolute_import,
division,
generators,
nested_scopes,
print_function,
unicode_literals,
with_statement,
)
from pants.task.task import Task
from pants.util.memo import memoized_property
from fsqio.pants.bu... | <commit_before># coding=utf-8
# Copyright 2016 Foursquare Labs Inc. All Rights Reserved.
from __future__ import (
absolute_import,
division,
generators,
nested_scopes,
print_function,
unicode_literals,
with_statement,
)
from pants.task.task import Task
from pants.util.memo import memoized_property
from... |
bf1fa1f284860229b1601e10306830cdc6ba2992 | logbot/irc_client.py | logbot/irc_client.py | import irc.client
import os
class IrcClient(object):
def __init__(self, server, port, channel, bot_name, logger):
self.server = server
self.port = port
self.channel = channel
self.bot_name = bot_name
self.logger = logger
def start(self):
self._client = irc.clie... | import irc.client
import os
class IrcClient(object):
def __init__(self, server, port, channel, bot_name, logger):
self.server = server
self.port = port
self.channel = channel
self.bot_name = bot_name
self.logger = logger
def start(self):
self._client = irc.clie... | Remove newline character from disconnect message | Remove newline character from disconnect message
| Python | mit | mlopes/LogBot | import irc.client
import os
class IrcClient(object):
def __init__(self, server, port, channel, bot_name, logger):
self.server = server
self.port = port
self.channel = channel
self.bot_name = bot_name
self.logger = logger
def start(self):
self._client = irc.clie... | import irc.client
import os
class IrcClient(object):
def __init__(self, server, port, channel, bot_name, logger):
self.server = server
self.port = port
self.channel = channel
self.bot_name = bot_name
self.logger = logger
def start(self):
self._client = irc.clie... | <commit_before>import irc.client
import os
class IrcClient(object):
def __init__(self, server, port, channel, bot_name, logger):
self.server = server
self.port = port
self.channel = channel
self.bot_name = bot_name
self.logger = logger
def start(self):
self._cl... | import irc.client
import os
class IrcClient(object):
def __init__(self, server, port, channel, bot_name, logger):
self.server = server
self.port = port
self.channel = channel
self.bot_name = bot_name
self.logger = logger
def start(self):
self._client = irc.clie... | import irc.client
import os
class IrcClient(object):
def __init__(self, server, port, channel, bot_name, logger):
self.server = server
self.port = port
self.channel = channel
self.bot_name = bot_name
self.logger = logger
def start(self):
self._client = irc.clie... | <commit_before>import irc.client
import os
class IrcClient(object):
def __init__(self, server, port, channel, bot_name, logger):
self.server = server
self.port = port
self.channel = channel
self.bot_name = bot_name
self.logger = logger
def start(self):
self._cl... |
4bfa555e7b71e3c5176a39ec8bbe4a2071c09bb3 | blockbuster/bb_logging.py | blockbuster/bb_logging.py | import logging
import logging.handlers
# ######### Set up logging ##########
# log.basicConfig(format="%(asctime)s - %(levelname)s: %(message)s", level=log.DEBUG)
logger = logging.getLogger('bb_log')
logger.setLevel(logging.DEBUG)
# create file handler which logs even debug messages
tfh = logging.handlers.TimedRotat... | import config
import logging
import logging.handlers
# ######### Set up logging ##########
# log.basicConfig(format="%(asctime)s - %(levelname)s: %(message)s", level=log.DEBUG)
logger = logging.getLogger('bb_log')
logger.setLevel(logging.DEBUG)
# create file handler which logs even debug messages
tfh = logging.handl... | Change file logHandler to use configured path for log files | Change file logHandler to use configured path for log files
| Python | mit | mattstibbs/blockbuster-server,mattstibbs/blockbuster-server | import logging
import logging.handlers
# ######### Set up logging ##########
# log.basicConfig(format="%(asctime)s - %(levelname)s: %(message)s", level=log.DEBUG)
logger = logging.getLogger('bb_log')
logger.setLevel(logging.DEBUG)
# create file handler which logs even debug messages
tfh = logging.handlers.TimedRotat... | import config
import logging
import logging.handlers
# ######### Set up logging ##########
# log.basicConfig(format="%(asctime)s - %(levelname)s: %(message)s", level=log.DEBUG)
logger = logging.getLogger('bb_log')
logger.setLevel(logging.DEBUG)
# create file handler which logs even debug messages
tfh = logging.handl... | <commit_before>import logging
import logging.handlers
# ######### Set up logging ##########
# log.basicConfig(format="%(asctime)s - %(levelname)s: %(message)s", level=log.DEBUG)
logger = logging.getLogger('bb_log')
logger.setLevel(logging.DEBUG)
# create file handler which logs even debug messages
tfh = logging.hand... | import config
import logging
import logging.handlers
# ######### Set up logging ##########
# log.basicConfig(format="%(asctime)s - %(levelname)s: %(message)s", level=log.DEBUG)
logger = logging.getLogger('bb_log')
logger.setLevel(logging.DEBUG)
# create file handler which logs even debug messages
tfh = logging.handl... | import logging
import logging.handlers
# ######### Set up logging ##########
# log.basicConfig(format="%(asctime)s - %(levelname)s: %(message)s", level=log.DEBUG)
logger = logging.getLogger('bb_log')
logger.setLevel(logging.DEBUG)
# create file handler which logs even debug messages
tfh = logging.handlers.TimedRotat... | <commit_before>import logging
import logging.handlers
# ######### Set up logging ##########
# log.basicConfig(format="%(asctime)s - %(levelname)s: %(message)s", level=log.DEBUG)
logger = logging.getLogger('bb_log')
logger.setLevel(logging.DEBUG)
# create file handler which logs even debug messages
tfh = logging.hand... |
ebd9842569201ce0e87827c2031c28c51159c472 | tests/test_pathutils.py | tests/test_pathutils.py | from os.path import join
import sublime
import sys
from unittest import TestCase
from unittest.mock import patch
version = sublime.version()
try:
from libsass import pathutils
except ImportError:
from sublime_libsass.libsass import pathutils
class TestPathutils(TestCase):
def test_subpaths(self):
... | from os.path import join
import sublime
import sys
from unittest import TestCase
from unittest.mock import patch
version = sublime.version()
try:
from libsass import pathutils
except ImportError:
from sublime_libsass.libsass import pathutils
class TestPathutils(TestCase):
def test_subpaths(self):
... | Change mocking scope to take effect | Change mocking scope to take effect
| Python | mit | blitzrk/sublime_libsass,blitzrk/sublime_libsass | from os.path import join
import sublime
import sys
from unittest import TestCase
from unittest.mock import patch
version = sublime.version()
try:
from libsass import pathutils
except ImportError:
from sublime_libsass.libsass import pathutils
class TestPathutils(TestCase):
def test_subpaths(self):
... | from os.path import join
import sublime
import sys
from unittest import TestCase
from unittest.mock import patch
version = sublime.version()
try:
from libsass import pathutils
except ImportError:
from sublime_libsass.libsass import pathutils
class TestPathutils(TestCase):
def test_subpaths(self):
... | <commit_before>from os.path import join
import sublime
import sys
from unittest import TestCase
from unittest.mock import patch
version = sublime.version()
try:
from libsass import pathutils
except ImportError:
from sublime_libsass.libsass import pathutils
class TestPathutils(TestCase):
def test_subpath... | from os.path import join
import sublime
import sys
from unittest import TestCase
from unittest.mock import patch
version = sublime.version()
try:
from libsass import pathutils
except ImportError:
from sublime_libsass.libsass import pathutils
class TestPathutils(TestCase):
def test_subpaths(self):
... | from os.path import join
import sublime
import sys
from unittest import TestCase
from unittest.mock import patch
version = sublime.version()
try:
from libsass import pathutils
except ImportError:
from sublime_libsass.libsass import pathutils
class TestPathutils(TestCase):
def test_subpaths(self):
... | <commit_before>from os.path import join
import sublime
import sys
from unittest import TestCase
from unittest.mock import patch
version = sublime.version()
try:
from libsass import pathutils
except ImportError:
from sublime_libsass.libsass import pathutils
class TestPathutils(TestCase):
def test_subpath... |
b11ef81b180cc18acb44988f3e269af6b54f4c89 | timewreport/interval.py | timewreport/interval.py | import dateutil.parser
from datetime import datetime
from dateutil.tz import tz
class TimeWarriorInterval(object):
def __init__(self, start, end, tags):
self.__start = self.__get_local_datetime(start)
self.__end = self.__get_local_datetime(end) if end is not None else None
self.__tags = t... | import dateutil.parser
from datetime import datetime, date
from dateutil.tz import tz
class TimeWarriorInterval(object):
def __init__(self, start, end, tags):
self.__start = self.__get_local_datetime(start)
self.__end = self.__get_local_datetime(end) if end is not None else None
self.__ta... | Make get_date() return date object instead of datetime | Make get_date() return date object instead of datetime
| Python | mit | lauft/timew-report | import dateutil.parser
from datetime import datetime
from dateutil.tz import tz
class TimeWarriorInterval(object):
def __init__(self, start, end, tags):
self.__start = self.__get_local_datetime(start)
self.__end = self.__get_local_datetime(end) if end is not None else None
self.__tags = t... | import dateutil.parser
from datetime import datetime, date
from dateutil.tz import tz
class TimeWarriorInterval(object):
def __init__(self, start, end, tags):
self.__start = self.__get_local_datetime(start)
self.__end = self.__get_local_datetime(end) if end is not None else None
self.__ta... | <commit_before>import dateutil.parser
from datetime import datetime
from dateutil.tz import tz
class TimeWarriorInterval(object):
def __init__(self, start, end, tags):
self.__start = self.__get_local_datetime(start)
self.__end = self.__get_local_datetime(end) if end is not None else None
... | import dateutil.parser
from datetime import datetime, date
from dateutil.tz import tz
class TimeWarriorInterval(object):
def __init__(self, start, end, tags):
self.__start = self.__get_local_datetime(start)
self.__end = self.__get_local_datetime(end) if end is not None else None
self.__ta... | import dateutil.parser
from datetime import datetime
from dateutil.tz import tz
class TimeWarriorInterval(object):
def __init__(self, start, end, tags):
self.__start = self.__get_local_datetime(start)
self.__end = self.__get_local_datetime(end) if end is not None else None
self.__tags = t... | <commit_before>import dateutil.parser
from datetime import datetime
from dateutil.tz import tz
class TimeWarriorInterval(object):
def __init__(self, start, end, tags):
self.__start = self.__get_local_datetime(start)
self.__end = self.__get_local_datetime(end) if end is not None else None
... |
b400be73feba0b571ac6453841426db9a78dfa00 | flowerconfig.py | flowerconfig.py | import os
AMPQ_ADMIN_USERNAME = os.getenv('AMQP_ADMIN_USERNAME', 'guest')
AMPQ_ADMIN_PASSWORD = os.getenv('AMQP_ADMIN_PASSWORD', 'guest')
AMQP_ADMIN_HOST = os.getenv('AMQP_ADMIN_HOST', '172.17.42.1')
AMQP_ADMIN_PORT = int(os.getenv('AMQP_ADMIN_PORT', '15672'))
DEFAULT_BROKER_API = 'http://%s:%s@%s:%d/api/' \
... | import os
AMPQ_ADMIN_USERNAME = os.getenv('AMQP_ADMIN_USERNAME', 'guest')
AMPQ_ADMIN_PASSWORD = os.getenv('AMQP_ADMIN_PASSWORD', 'guest')
AMQP_ADMIN_HOST = os.getenv('AMQP_ADMIN_HOST', '172.17.42.1')
AMQP_ADMIN_PORT = int(os.getenv('AMQP_ADMIN_PORT', '15672'))
DEFAULT_BROKER_API = 'http://%s:%s@%s:%d/api/' \
... | Remove FLOWER_ prefix for non flower based vars | Remove FLOWER_ prefix for non flower based vars | Python | mit | totem/celery-flower-docker,totem/celery-flower-docker | import os
AMPQ_ADMIN_USERNAME = os.getenv('AMQP_ADMIN_USERNAME', 'guest')
AMPQ_ADMIN_PASSWORD = os.getenv('AMQP_ADMIN_PASSWORD', 'guest')
AMQP_ADMIN_HOST = os.getenv('AMQP_ADMIN_HOST', '172.17.42.1')
AMQP_ADMIN_PORT = int(os.getenv('AMQP_ADMIN_PORT', '15672'))
DEFAULT_BROKER_API = 'http://%s:%s@%s:%d/api/' \
... | import os
AMPQ_ADMIN_USERNAME = os.getenv('AMQP_ADMIN_USERNAME', 'guest')
AMPQ_ADMIN_PASSWORD = os.getenv('AMQP_ADMIN_PASSWORD', 'guest')
AMQP_ADMIN_HOST = os.getenv('AMQP_ADMIN_HOST', '172.17.42.1')
AMQP_ADMIN_PORT = int(os.getenv('AMQP_ADMIN_PORT', '15672'))
DEFAULT_BROKER_API = 'http://%s:%s@%s:%d/api/' \
... | <commit_before>import os
AMPQ_ADMIN_USERNAME = os.getenv('AMQP_ADMIN_USERNAME', 'guest')
AMPQ_ADMIN_PASSWORD = os.getenv('AMQP_ADMIN_PASSWORD', 'guest')
AMQP_ADMIN_HOST = os.getenv('AMQP_ADMIN_HOST', '172.17.42.1')
AMQP_ADMIN_PORT = int(os.getenv('AMQP_ADMIN_PORT', '15672'))
DEFAULT_BROKER_API = 'http://%s:%s@%s:%d/a... | import os
AMPQ_ADMIN_USERNAME = os.getenv('AMQP_ADMIN_USERNAME', 'guest')
AMPQ_ADMIN_PASSWORD = os.getenv('AMQP_ADMIN_PASSWORD', 'guest')
AMQP_ADMIN_HOST = os.getenv('AMQP_ADMIN_HOST', '172.17.42.1')
AMQP_ADMIN_PORT = int(os.getenv('AMQP_ADMIN_PORT', '15672'))
DEFAULT_BROKER_API = 'http://%s:%s@%s:%d/api/' \
... | import os
AMPQ_ADMIN_USERNAME = os.getenv('AMQP_ADMIN_USERNAME', 'guest')
AMPQ_ADMIN_PASSWORD = os.getenv('AMQP_ADMIN_PASSWORD', 'guest')
AMQP_ADMIN_HOST = os.getenv('AMQP_ADMIN_HOST', '172.17.42.1')
AMQP_ADMIN_PORT = int(os.getenv('AMQP_ADMIN_PORT', '15672'))
DEFAULT_BROKER_API = 'http://%s:%s@%s:%d/api/' \
... | <commit_before>import os
AMPQ_ADMIN_USERNAME = os.getenv('AMQP_ADMIN_USERNAME', 'guest')
AMPQ_ADMIN_PASSWORD = os.getenv('AMQP_ADMIN_PASSWORD', 'guest')
AMQP_ADMIN_HOST = os.getenv('AMQP_ADMIN_HOST', '172.17.42.1')
AMQP_ADMIN_PORT = int(os.getenv('AMQP_ADMIN_PORT', '15672'))
DEFAULT_BROKER_API = 'http://%s:%s@%s:%d/a... |
423dd5ea414fe1857b44eef00a94f4dbb6d0c798 | import_test_data.py | import_test_data.py | #!/usr/bin/env python
# Script to import some test data into the db. Usually we should get a warning
# due to the bad formatting of the date, which is missing the time zone flag.
# Copy and execute this directly into the django shell.
from sest.models import *
from datetime import datetime
u = User.objects.create(u... | #!/usr/bin/env python
# Script to import some test data into the db. Usually we should get a warning
# due to the bad formatting of the date, which is missing the time zone flag.
# Copy and execute this directly into the django shell.
from sest.models import *
# from datetime import datetime
u = User.objects.create... | Update test data importer script. | Update test data importer script.
| Python | mit | bebosudo/sest,bebosudo/sest,bebosudo/sest | #!/usr/bin/env python
# Script to import some test data into the db. Usually we should get a warning
# due to the bad formatting of the date, which is missing the time zone flag.
# Copy and execute this directly into the django shell.
from sest.models import *
from datetime import datetime
u = User.objects.create(u... | #!/usr/bin/env python
# Script to import some test data into the db. Usually we should get a warning
# due to the bad formatting of the date, which is missing the time zone flag.
# Copy and execute this directly into the django shell.
from sest.models import *
# from datetime import datetime
u = User.objects.create... | <commit_before>#!/usr/bin/env python
# Script to import some test data into the db. Usually we should get a warning
# due to the bad formatting of the date, which is missing the time zone flag.
# Copy and execute this directly into the django shell.
from sest.models import *
from datetime import datetime
u = User.o... | #!/usr/bin/env python
# Script to import some test data into the db. Usually we should get a warning
# due to the bad formatting of the date, which is missing the time zone flag.
# Copy and execute this directly into the django shell.
from sest.models import *
# from datetime import datetime
u = User.objects.create... | #!/usr/bin/env python
# Script to import some test data into the db. Usually we should get a warning
# due to the bad formatting of the date, which is missing the time zone flag.
# Copy and execute this directly into the django shell.
from sest.models import *
from datetime import datetime
u = User.objects.create(u... | <commit_before>#!/usr/bin/env python
# Script to import some test data into the db. Usually we should get a warning
# due to the bad formatting of the date, which is missing the time zone flag.
# Copy and execute this directly into the django shell.
from sest.models import *
from datetime import datetime
u = User.o... |
2eae88ca423a60579e9b8572b0d4bcecbe2d8631 | utils/HTTPResponseParser.py | utils/HTTPResponseParser.py |
# Utility to parse HTTP responses
# http://pythonwise.blogspot.com/2010/02/parse-http-response.html
from StringIO import StringIO
from httplib import HTTPResponse
class FakeSocket(StringIO):
def makefile(self, *args, **kw):
return self
def parse_http_response(sock):
try:
# H4ck to standardi... |
# Utility to parse HTTP responses
# http://pythonwise.blogspot.com/2010/02/parse-http-response.html
from StringIO import StringIO
from httplib import HTTPResponse
class FakeSocket(StringIO):
def makefile(self, *args, **kw):
return self
def parse_http_response(sock):
try:
# H4ck to standardi... | Tweak the hack to fix bug when scanning through a proxy | Tweak the hack to fix bug when scanning through a proxy
| Python | agpl-3.0 | nabla-c0d3/sslyze |
# Utility to parse HTTP responses
# http://pythonwise.blogspot.com/2010/02/parse-http-response.html
from StringIO import StringIO
from httplib import HTTPResponse
class FakeSocket(StringIO):
def makefile(self, *args, **kw):
return self
def parse_http_response(sock):
try:
# H4ck to standardi... |
# Utility to parse HTTP responses
# http://pythonwise.blogspot.com/2010/02/parse-http-response.html
from StringIO import StringIO
from httplib import HTTPResponse
class FakeSocket(StringIO):
def makefile(self, *args, **kw):
return self
def parse_http_response(sock):
try:
# H4ck to standardi... | <commit_before>
# Utility to parse HTTP responses
# http://pythonwise.blogspot.com/2010/02/parse-http-response.html
from StringIO import StringIO
from httplib import HTTPResponse
class FakeSocket(StringIO):
def makefile(self, *args, **kw):
return self
def parse_http_response(sock):
try:
# H4... |
# Utility to parse HTTP responses
# http://pythonwise.blogspot.com/2010/02/parse-http-response.html
from StringIO import StringIO
from httplib import HTTPResponse
class FakeSocket(StringIO):
def makefile(self, *args, **kw):
return self
def parse_http_response(sock):
try:
# H4ck to standardi... |
# Utility to parse HTTP responses
# http://pythonwise.blogspot.com/2010/02/parse-http-response.html
from StringIO import StringIO
from httplib import HTTPResponse
class FakeSocket(StringIO):
def makefile(self, *args, **kw):
return self
def parse_http_response(sock):
try:
# H4ck to standardi... | <commit_before>
# Utility to parse HTTP responses
# http://pythonwise.blogspot.com/2010/02/parse-http-response.html
from StringIO import StringIO
from httplib import HTTPResponse
class FakeSocket(StringIO):
def makefile(self, *args, **kw):
return self
def parse_http_response(sock):
try:
# H4... |
e395d32770c2a4f7a2e4cab98d0a459e690ffeba | zeus/api/schemas/job.py | zeus/api/schemas/job.py | from marshmallow import Schema, fields
from .failurereason import FailureReasonSchema
from .fields import ResultField, StatusField
from .stats import StatsSchema
class JobSchema(Schema):
id = fields.UUID(dump_only=True)
number = fields.Integer(dump_only=True)
created_at = fields.DateTime(attribute="date_... | from marshmallow import Schema, fields
from .failurereason import FailureReasonSchema
from .fields import ResultField, StatusField
from .stats import StatsSchema
class JobSchema(Schema):
id = fields.UUID(dump_only=True)
number = fields.Integer(dump_only=True)
created_at = fields.DateTime(attribute='date_... | Add updated_at to Job schema | feat: Add updated_at to Job schema
| Python | apache-2.0 | getsentry/zeus,getsentry/zeus,getsentry/zeus,getsentry/zeus | from marshmallow import Schema, fields
from .failurereason import FailureReasonSchema
from .fields import ResultField, StatusField
from .stats import StatsSchema
class JobSchema(Schema):
id = fields.UUID(dump_only=True)
number = fields.Integer(dump_only=True)
created_at = fields.DateTime(attribute="date_... | from marshmallow import Schema, fields
from .failurereason import FailureReasonSchema
from .fields import ResultField, StatusField
from .stats import StatsSchema
class JobSchema(Schema):
id = fields.UUID(dump_only=True)
number = fields.Integer(dump_only=True)
created_at = fields.DateTime(attribute='date_... | <commit_before>from marshmallow import Schema, fields
from .failurereason import FailureReasonSchema
from .fields import ResultField, StatusField
from .stats import StatsSchema
class JobSchema(Schema):
id = fields.UUID(dump_only=True)
number = fields.Integer(dump_only=True)
created_at = fields.DateTime(a... | from marshmallow import Schema, fields
from .failurereason import FailureReasonSchema
from .fields import ResultField, StatusField
from .stats import StatsSchema
class JobSchema(Schema):
id = fields.UUID(dump_only=True)
number = fields.Integer(dump_only=True)
created_at = fields.DateTime(attribute='date_... | from marshmallow import Schema, fields
from .failurereason import FailureReasonSchema
from .fields import ResultField, StatusField
from .stats import StatsSchema
class JobSchema(Schema):
id = fields.UUID(dump_only=True)
number = fields.Integer(dump_only=True)
created_at = fields.DateTime(attribute="date_... | <commit_before>from marshmallow import Schema, fields
from .failurereason import FailureReasonSchema
from .fields import ResultField, StatusField
from .stats import StatsSchema
class JobSchema(Schema):
id = fields.UUID(dump_only=True)
number = fields.Integer(dump_only=True)
created_at = fields.DateTime(a... |
ec9e401cd083c095c916055d04fc049a6dbc8ab1 | ui/tcmui/core/management/commands/create_company.py | ui/tcmui/core/management/commands/create_company.py | from django.core.management.base import BaseCommand, CommandError
from ...api import admin
from ...models import Company, CompanyList
from ....users.models import Role, RoleList, PermissionList
DEFAULT_NEW_USER_ROLE_PERMISSIONS = set([
"PERMISSION_COMPANY_INFO_VIEW",
"PERMISSION_PRODUCT_VIEW",
... | from django.core.management.base import BaseCommand, CommandError
from ...api import admin
from ...models import Company, CompanyList
from ....users.models import Role, RoleList, PermissionList
DEFAULT_NEW_USER_ROLE_PERMISSIONS = set([
"PERMISSION_COMPANY_INFO_VIEW",
"PERMISSION_PRODUCT_VIEW",
... | Remove unneeded TEST_RUN_EDIT permission from default new user role. | Remove unneeded TEST_RUN_EDIT permission from default new user role.
| Python | bsd-2-clause | mozilla/moztrap,mozilla/moztrap,mozilla/moztrap,shinglyu/moztrap,mozilla/moztrap,bobsilverberg/moztrap,mccarrmb/moztrap,bobsilverberg/moztrap,shinglyu/moztrap,shinglyu/moztrap,bobsilverberg/moztrap,shinglyu/moztrap,shinglyu/moztrap,bobsilverberg/moztrap,mccarrmb/moztrap,mozilla/moztrap,mccarrmb/moztrap,mccarrmb/moztrap... | from django.core.management.base import BaseCommand, CommandError
from ...api import admin
from ...models import Company, CompanyList
from ....users.models import Role, RoleList, PermissionList
DEFAULT_NEW_USER_ROLE_PERMISSIONS = set([
"PERMISSION_COMPANY_INFO_VIEW",
"PERMISSION_PRODUCT_VIEW",
... | from django.core.management.base import BaseCommand, CommandError
from ...api import admin
from ...models import Company, CompanyList
from ....users.models import Role, RoleList, PermissionList
DEFAULT_NEW_USER_ROLE_PERMISSIONS = set([
"PERMISSION_COMPANY_INFO_VIEW",
"PERMISSION_PRODUCT_VIEW",
... | <commit_before>from django.core.management.base import BaseCommand, CommandError
from ...api import admin
from ...models import Company, CompanyList
from ....users.models import Role, RoleList, PermissionList
DEFAULT_NEW_USER_ROLE_PERMISSIONS = set([
"PERMISSION_COMPANY_INFO_VIEW",
"PERMISSION_PRODUC... | from django.core.management.base import BaseCommand, CommandError
from ...api import admin
from ...models import Company, CompanyList
from ....users.models import Role, RoleList, PermissionList
DEFAULT_NEW_USER_ROLE_PERMISSIONS = set([
"PERMISSION_COMPANY_INFO_VIEW",
"PERMISSION_PRODUCT_VIEW",
... | from django.core.management.base import BaseCommand, CommandError
from ...api import admin
from ...models import Company, CompanyList
from ....users.models import Role, RoleList, PermissionList
DEFAULT_NEW_USER_ROLE_PERMISSIONS = set([
"PERMISSION_COMPANY_INFO_VIEW",
"PERMISSION_PRODUCT_VIEW",
... | <commit_before>from django.core.management.base import BaseCommand, CommandError
from ...api import admin
from ...models import Company, CompanyList
from ....users.models import Role, RoleList, PermissionList
DEFAULT_NEW_USER_ROLE_PERMISSIONS = set([
"PERMISSION_COMPANY_INFO_VIEW",
"PERMISSION_PRODUC... |
ad0e14561a4fe0cfa659bd99678b0d82de892dc5 | helpers/text.py | helpers/text.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unicodedata
from html.parser import HTMLParser
class HTMLStripper(HTMLParser):
def __init__(self):
super(HTMLStripper, self).__init__()
self.reset()
self.fed = []
def handle_starttag(self, tag, attrs):
pass
def handle_endtag(self, tag):
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unicodedata
from html.parser import HTMLParser
class HTMLStripper(HTMLParser):
def __init__(self):
super(HTMLStripper, self).__init__()
self.reset()
self.fed = []
def handle_starttag(self, tag, attrs):
pass
def handle_endtag(self, tag):
... | Add symbols to the list of symbols to replace in the slugify function | Add symbols to the list of symbols to replace in the slugify function
| Python | mit | finnurtorfa/aflafrettir.is,finnurtorfa/aflafrettir.is,finnurtorfa/aflafrettir.is,finnurtorfa/aflafrettir.is | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unicodedata
from html.parser import HTMLParser
class HTMLStripper(HTMLParser):
def __init__(self):
super(HTMLStripper, self).__init__()
self.reset()
self.fed = []
def handle_starttag(self, tag, attrs):
pass
def handle_endtag(self, tag):
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unicodedata
from html.parser import HTMLParser
class HTMLStripper(HTMLParser):
def __init__(self):
super(HTMLStripper, self).__init__()
self.reset()
self.fed = []
def handle_starttag(self, tag, attrs):
pass
def handle_endtag(self, tag):
... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unicodedata
from html.parser import HTMLParser
class HTMLStripper(HTMLParser):
def __init__(self):
super(HTMLStripper, self).__init__()
self.reset()
self.fed = []
def handle_starttag(self, tag, attrs):
pass
def handle_endtag... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unicodedata
from html.parser import HTMLParser
class HTMLStripper(HTMLParser):
def __init__(self):
super(HTMLStripper, self).__init__()
self.reset()
self.fed = []
def handle_starttag(self, tag, attrs):
pass
def handle_endtag(self, tag):
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unicodedata
from html.parser import HTMLParser
class HTMLStripper(HTMLParser):
def __init__(self):
super(HTMLStripper, self).__init__()
self.reset()
self.fed = []
def handle_starttag(self, tag, attrs):
pass
def handle_endtag(self, tag):
... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unicodedata
from html.parser import HTMLParser
class HTMLStripper(HTMLParser):
def __init__(self):
super(HTMLStripper, self).__init__()
self.reset()
self.fed = []
def handle_starttag(self, tag, attrs):
pass
def handle_endtag... |
243cf3c18228b0c50b6b48a69c420922576ed723 | grano/logic/plugins.py | grano/logic/plugins.py | import logging
from grano.model import Entity, Relation, Project, Schema
from grano.logic.entities import _entity_changed
from grano.logic.relations import _relation_changed
from grano.logic.projects import _project_changed
from grano.logic.schemata import _schema_changed
log = logging.getLogger(__name__)
def rebu... | import logging
from grano.model import Entity, Relation, Project
from grano.logic.entities import _entity_changed
from grano.logic.relations import _relation_changed
from grano.logic.projects import _project_changed
from grano.logic.schemata import _schema_changed
log = logging.getLogger(__name__)
def rebuild():
... | Rebuild by project, not by type. | Rebuild by project, not by type. | Python | mit | 4bic-attic/grano,granoproject/grano,CodeForAfrica/grano,4bic/grano | import logging
from grano.model import Entity, Relation, Project, Schema
from grano.logic.entities import _entity_changed
from grano.logic.relations import _relation_changed
from grano.logic.projects import _project_changed
from grano.logic.schemata import _schema_changed
log = logging.getLogger(__name__)
def rebu... | import logging
from grano.model import Entity, Relation, Project
from grano.logic.entities import _entity_changed
from grano.logic.relations import _relation_changed
from grano.logic.projects import _project_changed
from grano.logic.schemata import _schema_changed
log = logging.getLogger(__name__)
def rebuild():
... | <commit_before>import logging
from grano.model import Entity, Relation, Project, Schema
from grano.logic.entities import _entity_changed
from grano.logic.relations import _relation_changed
from grano.logic.projects import _project_changed
from grano.logic.schemata import _schema_changed
log = logging.getLogger(__nam... | import logging
from grano.model import Entity, Relation, Project
from grano.logic.entities import _entity_changed
from grano.logic.relations import _relation_changed
from grano.logic.projects import _project_changed
from grano.logic.schemata import _schema_changed
log = logging.getLogger(__name__)
def rebuild():
... | import logging
from grano.model import Entity, Relation, Project, Schema
from grano.logic.entities import _entity_changed
from grano.logic.relations import _relation_changed
from grano.logic.projects import _project_changed
from grano.logic.schemata import _schema_changed
log = logging.getLogger(__name__)
def rebu... | <commit_before>import logging
from grano.model import Entity, Relation, Project, Schema
from grano.logic.entities import _entity_changed
from grano.logic.relations import _relation_changed
from grano.logic.projects import _project_changed
from grano.logic.schemata import _schema_changed
log = logging.getLogger(__nam... |
486978630261bddf1bccdb7f1817c6aa26f78c57 | docs/conf.py | docs/conf.py | # -*- coding: utf-8 -*-
# Standard Libs
import datetime
import os
import sys
# Add flask_hal to the Path
root = os.path.abspath(
os.path.join(
os.path.dirname(__file__),
'..',
)
)
sys.path.append(os.path.join(root, 'flask_hal'))
# First Party Libs
import flask_hal # noqa
# Project details
... | # -*- coding: utf-8 -*-
# Standard Libs
import datetime
import os
import sys
# Add flask_hal to the Path
root = os.path.abspath(
os.path.join(
os.path.dirname(__file__),
'..',
)
)
sys.path.append(os.path.join(root, 'flask_hal'))
# First Party Libs
import flask_hal # noqa
# Project details
... | Load version from version file | Load version from version file
| Python | unlicense | thisissoon/Flask-HAL,thisissoon/Flask-HAL | # -*- coding: utf-8 -*-
# Standard Libs
import datetime
import os
import sys
# Add flask_hal to the Path
root = os.path.abspath(
os.path.join(
os.path.dirname(__file__),
'..',
)
)
sys.path.append(os.path.join(root, 'flask_hal'))
# First Party Libs
import flask_hal # noqa
# Project details
... | # -*- coding: utf-8 -*-
# Standard Libs
import datetime
import os
import sys
# Add flask_hal to the Path
root = os.path.abspath(
os.path.join(
os.path.dirname(__file__),
'..',
)
)
sys.path.append(os.path.join(root, 'flask_hal'))
# First Party Libs
import flask_hal # noqa
# Project details
... | <commit_before># -*- coding: utf-8 -*-
# Standard Libs
import datetime
import os
import sys
# Add flask_hal to the Path
root = os.path.abspath(
os.path.join(
os.path.dirname(__file__),
'..',
)
)
sys.path.append(os.path.join(root, 'flask_hal'))
# First Party Libs
import flask_hal # noqa
# P... | # -*- coding: utf-8 -*-
# Standard Libs
import datetime
import os
import sys
# Add flask_hal to the Path
root = os.path.abspath(
os.path.join(
os.path.dirname(__file__),
'..',
)
)
sys.path.append(os.path.join(root, 'flask_hal'))
# First Party Libs
import flask_hal # noqa
# Project details
... | # -*- coding: utf-8 -*-
# Standard Libs
import datetime
import os
import sys
# Add flask_hal to the Path
root = os.path.abspath(
os.path.join(
os.path.dirname(__file__),
'..',
)
)
sys.path.append(os.path.join(root, 'flask_hal'))
# First Party Libs
import flask_hal # noqa
# Project details
... | <commit_before># -*- coding: utf-8 -*-
# Standard Libs
import datetime
import os
import sys
# Add flask_hal to the Path
root = os.path.abspath(
os.path.join(
os.path.dirname(__file__),
'..',
)
)
sys.path.append(os.path.join(root, 'flask_hal'))
# First Party Libs
import flask_hal # noqa
# P... |
30a3764b84ec14762ebfb521820d1be9ec765952 | htpcfrontend.py | htpcfrontend.py | from flask import Flask, render_template
from settings import *
import jsonrpclib
app = Flask(__name__)
@app.route('/')
def index():
xbmc = jsonrpclib.Server('http://%s:%s@%s:%s/jsonrpc' % (SERVER['username'], SERVER['password'], SERVER['hostname'], SERVER['port']))
episodes = xbmc.VideoLibrary.GetRecentlyAd... | from flask import Flask, render_template
from settings import *
import jsonrpclib
app = Flask(__name__)
@app.route('/')
def index():
xbmc = jsonrpclib.Server('http://%s:%s@%s:%s/jsonrpc' % (SERVER['username'], SERVER['password'], SERVER['hostname'], SERVER['port']))
episodes = xbmc.VideoLibrary.GetRecentlyAd... | Revert "Revert "retrieve currently playing info (commented out)"" | Revert "Revert "retrieve currently playing info (commented out)""
This reverts commit e14ee15116ee2137d528d298ca38e26e4f02f09f.
| Python | mit | robweber/maraschino,awagnon/maraschino,mrkipling/maraschino,robweber/maraschino,runjmc/maraschino,awagnon/maraschino,awagnon/maraschino,mrkipling/maraschino,insertnamehere1/maraschino,mboeru/maraschino,insertnamehere1/maraschino,robweber/maraschino,insertnamehere1/maraschino,runjmc/maraschino,mboeru/maraschino,runjmc/m... | from flask import Flask, render_template
from settings import *
import jsonrpclib
app = Flask(__name__)
@app.route('/')
def index():
xbmc = jsonrpclib.Server('http://%s:%s@%s:%s/jsonrpc' % (SERVER['username'], SERVER['password'], SERVER['hostname'], SERVER['port']))
episodes = xbmc.VideoLibrary.GetRecentlyAd... | from flask import Flask, render_template
from settings import *
import jsonrpclib
app = Flask(__name__)
@app.route('/')
def index():
xbmc = jsonrpclib.Server('http://%s:%s@%s:%s/jsonrpc' % (SERVER['username'], SERVER['password'], SERVER['hostname'], SERVER['port']))
episodes = xbmc.VideoLibrary.GetRecentlyAd... | <commit_before>from flask import Flask, render_template
from settings import *
import jsonrpclib
app = Flask(__name__)
@app.route('/')
def index():
xbmc = jsonrpclib.Server('http://%s:%s@%s:%s/jsonrpc' % (SERVER['username'], SERVER['password'], SERVER['hostname'], SERVER['port']))
episodes = xbmc.VideoLibrar... | from flask import Flask, render_template
from settings import *
import jsonrpclib
app = Flask(__name__)
@app.route('/')
def index():
xbmc = jsonrpclib.Server('http://%s:%s@%s:%s/jsonrpc' % (SERVER['username'], SERVER['password'], SERVER['hostname'], SERVER['port']))
episodes = xbmc.VideoLibrary.GetRecentlyAd... | from flask import Flask, render_template
from settings import *
import jsonrpclib
app = Flask(__name__)
@app.route('/')
def index():
xbmc = jsonrpclib.Server('http://%s:%s@%s:%s/jsonrpc' % (SERVER['username'], SERVER['password'], SERVER['hostname'], SERVER['port']))
episodes = xbmc.VideoLibrary.GetRecentlyAd... | <commit_before>from flask import Flask, render_template
from settings import *
import jsonrpclib
app = Flask(__name__)
@app.route('/')
def index():
xbmc = jsonrpclib.Server('http://%s:%s@%s:%s/jsonrpc' % (SERVER['username'], SERVER['password'], SERVER['hostname'], SERVER['port']))
episodes = xbmc.VideoLibrar... |
27423205b06b031572b675ee29a487f4b900fe56 | cura_app.py | cura_app.py | #!/usr/bin/env python3
# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
import sys
def exceptHook(type, value, traceback):
import cura.CrashHandler
cura.CrashHandler.show(type, value, traceback)
sys.excepthook = exceptHook
# Workaround for a race condition on ... | #!/usr/bin/env python3
# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
import sys
def exceptHook(hook_type, value, traceback):
import cura.CrashHandler
cura.CrashHandler.show(hook_type, value, traceback)
sys.excepthook = exceptHook
# Workaround for a race con... | Rename type into hook_type "type" itself if a built-in function. Using this name could be unsave. | Rename type into hook_type
"type" itself if a built-in function. Using this name could be unsave.
| Python | agpl-3.0 | hmflash/Cura,Curahelper/Cura,ynotstartups/Wanhao,senttech/Cura,totalretribution/Cura,fieldOfView/Cura,hmflash/Cura,Curahelper/Cura,ynotstartups/Wanhao,totalretribution/Cura,senttech/Cura,fieldOfView/Cura | #!/usr/bin/env python3
# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
import sys
def exceptHook(type, value, traceback):
import cura.CrashHandler
cura.CrashHandler.show(type, value, traceback)
sys.excepthook = exceptHook
# Workaround for a race condition on ... | #!/usr/bin/env python3
# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
import sys
def exceptHook(hook_type, value, traceback):
import cura.CrashHandler
cura.CrashHandler.show(hook_type, value, traceback)
sys.excepthook = exceptHook
# Workaround for a race con... | <commit_before>#!/usr/bin/env python3
# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
import sys
def exceptHook(type, value, traceback):
import cura.CrashHandler
cura.CrashHandler.show(type, value, traceback)
sys.excepthook = exceptHook
# Workaround for a rac... | #!/usr/bin/env python3
# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
import sys
def exceptHook(hook_type, value, traceback):
import cura.CrashHandler
cura.CrashHandler.show(hook_type, value, traceback)
sys.excepthook = exceptHook
# Workaround for a race con... | #!/usr/bin/env python3
# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
import sys
def exceptHook(type, value, traceback):
import cura.CrashHandler
cura.CrashHandler.show(type, value, traceback)
sys.excepthook = exceptHook
# Workaround for a race condition on ... | <commit_before>#!/usr/bin/env python3
# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
import sys
def exceptHook(type, value, traceback):
import cura.CrashHandler
cura.CrashHandler.show(type, value, traceback)
sys.excepthook = exceptHook
# Workaround for a rac... |
03cbb450fa54cf048bea5c4e3c9c0e44ea74131c | search/index_settings.py | search/index_settings.py | INDEX_SETTINGS = {
"settings": {
"analysis": {
"analyzer": {
"default": {
"type": "custom",
"tokenizer": "standard",
"filter": [
"standard",
"lowercase",
... | INDEX_SETTINGS = {
"settings": {
"analysis": {
"analyzer": {
"default": {
"type": "custom",
"tokenizer": "standard",
"filter": [
"standard",
"lowercase",
... | Increase ngram size to four | Increase ngram size to four
| Python | mit | MasterFacilityList/mfl_api,MasterFacilityList/mfl_api,MasterFacilityList/mfl_api,MasterFacilityList/mfl_api,MasterFacilityList/mfl_api | INDEX_SETTINGS = {
"settings": {
"analysis": {
"analyzer": {
"default": {
"type": "custom",
"tokenizer": "standard",
"filter": [
"standard",
"lowercase",
... | INDEX_SETTINGS = {
"settings": {
"analysis": {
"analyzer": {
"default": {
"type": "custom",
"tokenizer": "standard",
"filter": [
"standard",
"lowercase",
... | <commit_before>INDEX_SETTINGS = {
"settings": {
"analysis": {
"analyzer": {
"default": {
"type": "custom",
"tokenizer": "standard",
"filter": [
"standard",
"lowercase",
... | INDEX_SETTINGS = {
"settings": {
"analysis": {
"analyzer": {
"default": {
"type": "custom",
"tokenizer": "standard",
"filter": [
"standard",
"lowercase",
... | INDEX_SETTINGS = {
"settings": {
"analysis": {
"analyzer": {
"default": {
"type": "custom",
"tokenizer": "standard",
"filter": [
"standard",
"lowercase",
... | <commit_before>INDEX_SETTINGS = {
"settings": {
"analysis": {
"analyzer": {
"default": {
"type": "custom",
"tokenizer": "standard",
"filter": [
"standard",
"lowercase",
... |
4d1d2e12d8882084ce8deb80c3b3e162cc71b20b | osmaxx-py/osmaxx/excerptexport/forms/new_excerpt_form.py | osmaxx-py/osmaxx/excerptexport/forms/new_excerpt_form.py | from django import forms
from django.utils.translation import gettext_lazy
class NewExcerptForm(forms.Form):
new_excerpt_name = forms.CharField(label=gettext_lazy('Excerpt name'))
new_excerpt_bounding_box_north = forms.CharField(label=gettext_lazy('North'))
new_excerpt_bounding_box_west = forms.CharField(... | from django import forms
from django.utils.translation import gettext_lazy
class NewExcerptForm(forms.Form):
new_excerpt_name = forms.CharField(label=gettext_lazy('Excerpt name'))
new_excerpt_bounding_box_north = forms.CharField(label=gettext_lazy('North'))
new_excerpt_bounding_box_west = forms.CharField(... | Allow private excerpts (form validation) | Bugfix: Allow private excerpts (form validation)
| Python | mit | geometalab/osmaxx,geometalab/drf-utm-zone-info,geometalab/osmaxx-frontend,geometalab/osmaxx,geometalab/osmaxx,geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/drf-utm-zone-info,geometalab/osmaxx-frontend,geometalab/osmaxx-frontend | from django import forms
from django.utils.translation import gettext_lazy
class NewExcerptForm(forms.Form):
new_excerpt_name = forms.CharField(label=gettext_lazy('Excerpt name'))
new_excerpt_bounding_box_north = forms.CharField(label=gettext_lazy('North'))
new_excerpt_bounding_box_west = forms.CharField(... | from django import forms
from django.utils.translation import gettext_lazy
class NewExcerptForm(forms.Form):
new_excerpt_name = forms.CharField(label=gettext_lazy('Excerpt name'))
new_excerpt_bounding_box_north = forms.CharField(label=gettext_lazy('North'))
new_excerpt_bounding_box_west = forms.CharField(... | <commit_before>from django import forms
from django.utils.translation import gettext_lazy
class NewExcerptForm(forms.Form):
new_excerpt_name = forms.CharField(label=gettext_lazy('Excerpt name'))
new_excerpt_bounding_box_north = forms.CharField(label=gettext_lazy('North'))
new_excerpt_bounding_box_west = f... | from django import forms
from django.utils.translation import gettext_lazy
class NewExcerptForm(forms.Form):
new_excerpt_name = forms.CharField(label=gettext_lazy('Excerpt name'))
new_excerpt_bounding_box_north = forms.CharField(label=gettext_lazy('North'))
new_excerpt_bounding_box_west = forms.CharField(... | from django import forms
from django.utils.translation import gettext_lazy
class NewExcerptForm(forms.Form):
new_excerpt_name = forms.CharField(label=gettext_lazy('Excerpt name'))
new_excerpt_bounding_box_north = forms.CharField(label=gettext_lazy('North'))
new_excerpt_bounding_box_west = forms.CharField(... | <commit_before>from django import forms
from django.utils.translation import gettext_lazy
class NewExcerptForm(forms.Form):
new_excerpt_name = forms.CharField(label=gettext_lazy('Excerpt name'))
new_excerpt_bounding_box_north = forms.CharField(label=gettext_lazy('North'))
new_excerpt_bounding_box_west = f... |
276c3904843417649fe71a81a30ce9b8f29d3d29 | ipywidgets/_version.py | ipywidgets/_version.py | # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
version_info = (6, 0, 0)
__version__ = '.'.join(map(str, version_info))
__frontend_version__ = '~2.1.4'
| # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
version_info = (6, 0, 0)
__version__ = '.'.join(map(str, version_info))
__frontend_version__ = '~2.2.0'
| Update ipywidgets to expect jupyter-js-widgets 2.2.0 | Update ipywidgets to expect jupyter-js-widgets 2.2.0 | Python | bsd-3-clause | ipython/ipywidgets,jupyter-widgets/ipywidgets,ipython/ipywidgets,SylvainCorlay/ipywidgets,ipython/ipywidgets,cornhundred/ipywidgets,ipython/ipywidgets,cornhundred/ipywidgets,cornhundred/ipywidgets,ipython/ipywidgets,jupyter-widgets/ipywidgets,jupyter-widgets/ipywidgets,SylvainCorlay/ipywidgets,SylvainCorlay/ipywidgets,... | # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
version_info = (6, 0, 0)
__version__ = '.'.join(map(str, version_info))
__frontend_version__ = '~2.1.4'
Update ipywidgets to expect jupyter-js-widgets 2.2.0 | # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
version_info = (6, 0, 0)
__version__ = '.'.join(map(str, version_info))
__frontend_version__ = '~2.2.0'
| <commit_before># Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
version_info = (6, 0, 0)
__version__ = '.'.join(map(str, version_info))
__frontend_version__ = '~2.1.4'
<commit_msg>Update ipywidgets to expect jupyter-js-widgets 2.2.0<commit_after> | # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
version_info = (6, 0, 0)
__version__ = '.'.join(map(str, version_info))
__frontend_version__ = '~2.2.0'
| # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
version_info = (6, 0, 0)
__version__ = '.'.join(map(str, version_info))
__frontend_version__ = '~2.1.4'
Update ipywidgets to expect jupyter-js-widgets 2.2.0# Copyright (c) Jupyter Development Team.
# Distributed under ... | <commit_before># Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
version_info = (6, 0, 0)
__version__ = '.'.join(map(str, version_info))
__frontend_version__ = '~2.1.4'
<commit_msg>Update ipywidgets to expect jupyter-js-widgets 2.2.0<commit_after># Copyright (c) Jupyt... |
b4ef31e6fa195480f8de1e516606aa32fecfdd15 | future/builtins/backports/newround.py | future/builtins/backports/newround.py | """
``python-future``: pure Python implementation of Python 3 round().
"""
def newround(number, ndigits=None):
"""
See Python 3 documentation: uses Banker's Rounding.
Delegates to the __round__ method if for some reason this exists.
If not, rounds a number to a given precision in decimal digits (d... | """
``python-future``: pure Python implementation of Python 3 round().
"""
from future.utils import PYPY
def newround(number, ndigits=None):
"""
See Python 3 documentation: uses Banker's Rounding.
Delegates to the __round__ method if for some reason this exists.
If not, rounds a number to a give... | Add workaround for PyPy round() bug with NumPy data types | Add workaround for PyPy round() bug with NumPy data types
| Python | mit | krischer/python-future,QuLogic/python-future,PythonCharmers/python-future,michaelpacer/python-future,QuLogic/python-future,krischer/python-future,michaelpacer/python-future,PythonCharmers/python-future | """
``python-future``: pure Python implementation of Python 3 round().
"""
def newround(number, ndigits=None):
"""
See Python 3 documentation: uses Banker's Rounding.
Delegates to the __round__ method if for some reason this exists.
If not, rounds a number to a given precision in decimal digits (d... | """
``python-future``: pure Python implementation of Python 3 round().
"""
from future.utils import PYPY
def newround(number, ndigits=None):
"""
See Python 3 documentation: uses Banker's Rounding.
Delegates to the __round__ method if for some reason this exists.
If not, rounds a number to a give... | <commit_before>"""
``python-future``: pure Python implementation of Python 3 round().
"""
def newround(number, ndigits=None):
"""
See Python 3 documentation: uses Banker's Rounding.
Delegates to the __round__ method if for some reason this exists.
If not, rounds a number to a given precision in de... | """
``python-future``: pure Python implementation of Python 3 round().
"""
from future.utils import PYPY
def newround(number, ndigits=None):
"""
See Python 3 documentation: uses Banker's Rounding.
Delegates to the __round__ method if for some reason this exists.
If not, rounds a number to a give... | """
``python-future``: pure Python implementation of Python 3 round().
"""
def newround(number, ndigits=None):
"""
See Python 3 documentation: uses Banker's Rounding.
Delegates to the __round__ method if for some reason this exists.
If not, rounds a number to a given precision in decimal digits (d... | <commit_before>"""
``python-future``: pure Python implementation of Python 3 round().
"""
def newround(number, ndigits=None):
"""
See Python 3 documentation: uses Banker's Rounding.
Delegates to the __round__ method if for some reason this exists.
If not, rounds a number to a given precision in de... |
82e0987375ff99e0d94068c1ec6078d3920249f2 | nc/data/__init__.py | nc/data/__init__.py | DEFAULT_URL = "https://s3-us-west-2.amazonaws.com/openpolicingdata/TS_2016_04_13T13.38.34.887.zip" # noqa
| DEFAULT_URL = "https://s3-us-west-2.amazonaws.com/openpolicingdata/TS_2016_06_22T09.52.20.780.zip" # noqa
| Add this fix from the master branch | Add this fix from the master branch
(It was in the import_nc management command file, but newer
code places it here.)
| Python | mit | OpenDataPolicingNC/Traffic-Stops,OpenDataPolicingNC/Traffic-Stops,OpenDataPolicingNC/Traffic-Stops,OpenDataPolicingNC/Traffic-Stops | DEFAULT_URL = "https://s3-us-west-2.amazonaws.com/openpolicingdata/TS_2016_04_13T13.38.34.887.zip" # noqa
Add this fix from the master branch
(It was in the import_nc management command file, but newer
code places it here.) | DEFAULT_URL = "https://s3-us-west-2.amazonaws.com/openpolicingdata/TS_2016_06_22T09.52.20.780.zip" # noqa
| <commit_before>DEFAULT_URL = "https://s3-us-west-2.amazonaws.com/openpolicingdata/TS_2016_04_13T13.38.34.887.zip" # noqa
<commit_msg>Add this fix from the master branch
(It was in the import_nc management command file, but newer
code places it here.)<commit_after> | DEFAULT_URL = "https://s3-us-west-2.amazonaws.com/openpolicingdata/TS_2016_06_22T09.52.20.780.zip" # noqa
| DEFAULT_URL = "https://s3-us-west-2.amazonaws.com/openpolicingdata/TS_2016_04_13T13.38.34.887.zip" # noqa
Add this fix from the master branch
(It was in the import_nc management command file, but newer
code places it here.)DEFAULT_URL = "https://s3-us-west-2.amazonaws.com/openpolicingdata/TS_2016_06_22T09.52.20.780.z... | <commit_before>DEFAULT_URL = "https://s3-us-west-2.amazonaws.com/openpolicingdata/TS_2016_04_13T13.38.34.887.zip" # noqa
<commit_msg>Add this fix from the master branch
(It was in the import_nc management command file, but newer
code places it here.)<commit_after>DEFAULT_URL = "https://s3-us-west-2.amazonaws.com/open... |
7b90d75f260e76baf8b57840d96bb36b62e2c56c | __init__.py | __init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, unicode_literals
import bikeshed
import os
import subprocess
def main():
scriptPath = os.path.dirname(os.path.realpath(__file__))
dataPath = os.path.join(scriptPath, "data")
bikeshed.config.quiet = False
#bikeshed.update.update(path=d... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, unicode_literals
import bikeshed
import os
import subprocess
def main():
scriptPath = os.path.dirname(os.path.realpath(__file__))
dataPath = os.path.join(scriptPath, "data")
bikeshed.config.quiet = False
bikeshed.update.update(path=da... | Update script with proper git-ing. | Update script with proper git-ing.
| Python | mit | tabatkins/bikeshed-data | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, unicode_literals
import bikeshed
import os
import subprocess
def main():
scriptPath = os.path.dirname(os.path.realpath(__file__))
dataPath = os.path.join(scriptPath, "data")
bikeshed.config.quiet = False
#bikeshed.update.update(path=d... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, unicode_literals
import bikeshed
import os
import subprocess
def main():
scriptPath = os.path.dirname(os.path.realpath(__file__))
dataPath = os.path.join(scriptPath, "data")
bikeshed.config.quiet = False
bikeshed.update.update(path=da... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, unicode_literals
import bikeshed
import os
import subprocess
def main():
scriptPath = os.path.dirname(os.path.realpath(__file__))
dataPath = os.path.join(scriptPath, "data")
bikeshed.config.quiet = False
#bikeshed.updat... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, unicode_literals
import bikeshed
import os
import subprocess
def main():
scriptPath = os.path.dirname(os.path.realpath(__file__))
dataPath = os.path.join(scriptPath, "data")
bikeshed.config.quiet = False
bikeshed.update.update(path=da... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, unicode_literals
import bikeshed
import os
import subprocess
def main():
scriptPath = os.path.dirname(os.path.realpath(__file__))
dataPath = os.path.join(scriptPath, "data")
bikeshed.config.quiet = False
#bikeshed.update.update(path=d... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, unicode_literals
import bikeshed
import os
import subprocess
def main():
scriptPath = os.path.dirname(os.path.realpath(__file__))
dataPath = os.path.join(scriptPath, "data")
bikeshed.config.quiet = False
#bikeshed.updat... |
6d2f6df3543bc287e59151e823b7a62c245c27b0 | .gitlab/linters/check-cpp.py | .gitlab/linters/check-cpp.py | #!/usr/bin/env python3
# A linter to warn for ASSERT macros which are separated from their argument
# list by a space, which Clang's CPP barfs on
from linter import run_linters, RegexpLinter
linters = [
RegexpLinter(r'ASSERT\s+\(',
message='CPP macros should not have a space between the macro na... | #!/usr/bin/env python3
# A linter to warn for ASSERT macros which are separated from their argument
# list by a space, which Clang's CPP barfs on
from linter import run_linters, RegexpLinter
linters = [
RegexpLinter(r'WARN\s+\(',
message='CPP macros should not have a space between the macro name... | Check for WARN macro with space separating it from its paren | linters: Check for WARN macro with space separating it from its paren
| Python | bsd-3-clause | sdiehl/ghc,sdiehl/ghc,sdiehl/ghc,sdiehl/ghc,sdiehl/ghc,sdiehl/ghc,sdiehl/ghc | #!/usr/bin/env python3
# A linter to warn for ASSERT macros which are separated from their argument
# list by a space, which Clang's CPP barfs on
from linter import run_linters, RegexpLinter
linters = [
RegexpLinter(r'ASSERT\s+\(',
message='CPP macros should not have a space between the macro na... | #!/usr/bin/env python3
# A linter to warn for ASSERT macros which are separated from their argument
# list by a space, which Clang's CPP barfs on
from linter import run_linters, RegexpLinter
linters = [
RegexpLinter(r'WARN\s+\(',
message='CPP macros should not have a space between the macro name... | <commit_before>#!/usr/bin/env python3
# A linter to warn for ASSERT macros which are separated from their argument
# list by a space, which Clang's CPP barfs on
from linter import run_linters, RegexpLinter
linters = [
RegexpLinter(r'ASSERT\s+\(',
message='CPP macros should not have a space betwe... | #!/usr/bin/env python3
# A linter to warn for ASSERT macros which are separated from their argument
# list by a space, which Clang's CPP barfs on
from linter import run_linters, RegexpLinter
linters = [
RegexpLinter(r'WARN\s+\(',
message='CPP macros should not have a space between the macro name... | #!/usr/bin/env python3
# A linter to warn for ASSERT macros which are separated from their argument
# list by a space, which Clang's CPP barfs on
from linter import run_linters, RegexpLinter
linters = [
RegexpLinter(r'ASSERT\s+\(',
message='CPP macros should not have a space between the macro na... | <commit_before>#!/usr/bin/env python3
# A linter to warn for ASSERT macros which are separated from their argument
# list by a space, which Clang's CPP barfs on
from linter import run_linters, RegexpLinter
linters = [
RegexpLinter(r'ASSERT\s+\(',
message='CPP macros should not have a space betwe... |
ed09a3ded286cc4d5623c17e65b2d40ef55ccee7 | valohai_yaml/parsing.py | valohai_yaml/parsing.py | from typing import IO, Union
from valohai_yaml.objs import Config
from .utils import read_yaml
def parse(yaml: Union[dict, list, bytes, str, IO], validate: bool = True) -> Config:
"""
Parse the given YAML data into a `Config` object, optionally validating it first.
:param yaml: YAML data (either a stri... | from typing import IO, Union
from valohai_yaml.objs import Config
from .utils import read_yaml
def parse(yaml: Union[dict, list, bytes, str, IO], validate: bool = True) -> Config:
"""
Parse the given YAML data into a `Config` object, optionally validating it first.
:param yaml: YAML data (either a stri... | Handle empty YAML files in parse() | Handle empty YAML files in parse()
Refs valohai/valohai-cli#170
| Python | mit | valohai/valohai-yaml | from typing import IO, Union
from valohai_yaml.objs import Config
from .utils import read_yaml
def parse(yaml: Union[dict, list, bytes, str, IO], validate: bool = True) -> Config:
"""
Parse the given YAML data into a `Config` object, optionally validating it first.
:param yaml: YAML data (either a stri... | from typing import IO, Union
from valohai_yaml.objs import Config
from .utils import read_yaml
def parse(yaml: Union[dict, list, bytes, str, IO], validate: bool = True) -> Config:
"""
Parse the given YAML data into a `Config` object, optionally validating it first.
:param yaml: YAML data (either a stri... | <commit_before>from typing import IO, Union
from valohai_yaml.objs import Config
from .utils import read_yaml
def parse(yaml: Union[dict, list, bytes, str, IO], validate: bool = True) -> Config:
"""
Parse the given YAML data into a `Config` object, optionally validating it first.
:param yaml: YAML data... | from typing import IO, Union
from valohai_yaml.objs import Config
from .utils import read_yaml
def parse(yaml: Union[dict, list, bytes, str, IO], validate: bool = True) -> Config:
"""
Parse the given YAML data into a `Config` object, optionally validating it first.
:param yaml: YAML data (either a stri... | from typing import IO, Union
from valohai_yaml.objs import Config
from .utils import read_yaml
def parse(yaml: Union[dict, list, bytes, str, IO], validate: bool = True) -> Config:
"""
Parse the given YAML data into a `Config` object, optionally validating it first.
:param yaml: YAML data (either a stri... | <commit_before>from typing import IO, Union
from valohai_yaml.objs import Config
from .utils import read_yaml
def parse(yaml: Union[dict, list, bytes, str, IO], validate: bool = True) -> Config:
"""
Parse the given YAML data into a `Config` object, optionally validating it first.
:param yaml: YAML data... |
dc6f82bce52419c7c2153a33be15f3d811161d1d | flask_app.py | flask_app.py | from flask import Flask, abort, jsonify
from flask_caching import Cache
from flask_cors import CORS
import main
app = Flask(__name__)
cache = Cache(app, config={'CACHE_TYPE': 'simple'})
cors = CORS(app, resources={r"/*": {"origins": "*"}})
@app.route('/api/')
@cache.cached(timeout=3600)
def nbis_list_entities():
... | from flask import Flask, abort, jsonify
from flask_caching import Cache
from flask_cors import CORS
import main
app = Flask(__name__)
cache = Cache(app, config={'CACHE_TYPE': 'simple'})
cors = CORS(app, resources={r"/*": {"origins": "*"}})
@app.route('/api/')
@cache.cached(timeout=3600)
def list_entities():
ret... | Return a list of identifiers instead of almost all info | Return a list of identifiers instead of almost all info
| Python | bsd-3-clause | talavis/kimenu | from flask import Flask, abort, jsonify
from flask_caching import Cache
from flask_cors import CORS
import main
app = Flask(__name__)
cache = Cache(app, config={'CACHE_TYPE': 'simple'})
cors = CORS(app, resources={r"/*": {"origins": "*"}})
@app.route('/api/')
@cache.cached(timeout=3600)
def nbis_list_entities():
... | from flask import Flask, abort, jsonify
from flask_caching import Cache
from flask_cors import CORS
import main
app = Flask(__name__)
cache = Cache(app, config={'CACHE_TYPE': 'simple'})
cors = CORS(app, resources={r"/*": {"origins": "*"}})
@app.route('/api/')
@cache.cached(timeout=3600)
def list_entities():
ret... | <commit_before>from flask import Flask, abort, jsonify
from flask_caching import Cache
from flask_cors import CORS
import main
app = Flask(__name__)
cache = Cache(app, config={'CACHE_TYPE': 'simple'})
cors = CORS(app, resources={r"/*": {"origins": "*"}})
@app.route('/api/')
@cache.cached(timeout=3600)
def nbis_list... | from flask import Flask, abort, jsonify
from flask_caching import Cache
from flask_cors import CORS
import main
app = Flask(__name__)
cache = Cache(app, config={'CACHE_TYPE': 'simple'})
cors = CORS(app, resources={r"/*": {"origins": "*"}})
@app.route('/api/')
@cache.cached(timeout=3600)
def list_entities():
ret... | from flask import Flask, abort, jsonify
from flask_caching import Cache
from flask_cors import CORS
import main
app = Flask(__name__)
cache = Cache(app, config={'CACHE_TYPE': 'simple'})
cors = CORS(app, resources={r"/*": {"origins": "*"}})
@app.route('/api/')
@cache.cached(timeout=3600)
def nbis_list_entities():
... | <commit_before>from flask import Flask, abort, jsonify
from flask_caching import Cache
from flask_cors import CORS
import main
app = Flask(__name__)
cache = Cache(app, config={'CACHE_TYPE': 'simple'})
cors = CORS(app, resources={r"/*": {"origins": "*"}})
@app.route('/api/')
@cache.cached(timeout=3600)
def nbis_list... |
fef17579a8a084987ea5e413ad512662ab24aa56 | ntm/similarities.py | ntm/similarities.py | import theano
import theano.tensor as T
import numpy as np
def cosine_similarity(x, y, eps=1e-9):
y = y.dimshuffle(1, 0)
z = T.dot(x, y)
z /= x.norm(2) * y.norm(2, axis=0).dimshuffle('x', 0) + eps
return z | import theano
import theano.tensor as T
import numpy as np
def cosine_similarity(x, y, eps=1e-9):
y = y.dimshuffle(1, 0)
z = T.dot(x, y)
z /= T.sqrt(T.sum(x * x) * T.sum(y * y, axis=0).dimshuffle('x', 0) + 1e-6)
return z | Replace T.norm in the cosine similarity | Replace T.norm in the cosine similarity
| Python | mit | snipsco/ntm-lasagne | import theano
import theano.tensor as T
import numpy as np
def cosine_similarity(x, y, eps=1e-9):
y = y.dimshuffle(1, 0)
z = T.dot(x, y)
z /= x.norm(2) * y.norm(2, axis=0).dimshuffle('x', 0) + eps
return zReplace T.norm in the cosine similarity | import theano
import theano.tensor as T
import numpy as np
def cosine_similarity(x, y, eps=1e-9):
y = y.dimshuffle(1, 0)
z = T.dot(x, y)
z /= T.sqrt(T.sum(x * x) * T.sum(y * y, axis=0).dimshuffle('x', 0) + 1e-6)
return z | <commit_before>import theano
import theano.tensor as T
import numpy as np
def cosine_similarity(x, y, eps=1e-9):
y = y.dimshuffle(1, 0)
z = T.dot(x, y)
z /= x.norm(2) * y.norm(2, axis=0).dimshuffle('x', 0) + eps
return z<commit_msg>Replace T.norm in the cosine similarity<commit_after> | import theano
import theano.tensor as T
import numpy as np
def cosine_similarity(x, y, eps=1e-9):
y = y.dimshuffle(1, 0)
z = T.dot(x, y)
z /= T.sqrt(T.sum(x * x) * T.sum(y * y, axis=0).dimshuffle('x', 0) + 1e-6)
return z | import theano
import theano.tensor as T
import numpy as np
def cosine_similarity(x, y, eps=1e-9):
y = y.dimshuffle(1, 0)
z = T.dot(x, y)
z /= x.norm(2) * y.norm(2, axis=0).dimshuffle('x', 0) + eps
return zReplace T.norm in the cosine similarityimport theano
import theano.tensor as T
import numpy as n... | <commit_before>import theano
import theano.tensor as T
import numpy as np
def cosine_similarity(x, y, eps=1e-9):
y = y.dimshuffle(1, 0)
z = T.dot(x, y)
z /= x.norm(2) * y.norm(2, axis=0).dimshuffle('x', 0) + eps
return z<commit_msg>Replace T.norm in the cosine similarity<commit_after>import theano
im... |
980f9abc5b95c9f9ed089b13e9538173bcac0952 | app/user_administration/urls.py | app/user_administration/urls.py | from django.conf.urls import url
from .views import HomePage
urlpatterns = [
url(r'^', HomePage.as_view(), name='HomePage'),
]
| from django.conf.urls import url
from .views import HomePage, LoginPage
from django.contrib.auth.views import logout_then_login
urlpatterns = [
url(r'^$', HomePage.as_view(), name='HomePage'),
url(r'^login/', LoginPage.as_view(), name='LoginPage'),
url(r'^logout/', logout_then_login, name='LoginPage'),
]
| Add Login & Logout Routing | Add Login & Logout Routing
| Python | mit | rexhepberlajolli/RHChallenge,rexhepberlajolli/RHChallenge | from django.conf.urls import url
from .views import HomePage
urlpatterns = [
url(r'^', HomePage.as_view(), name='HomePage'),
]
Add Login & Logout Routing | from django.conf.urls import url
from .views import HomePage, LoginPage
from django.contrib.auth.views import logout_then_login
urlpatterns = [
url(r'^$', HomePage.as_view(), name='HomePage'),
url(r'^login/', LoginPage.as_view(), name='LoginPage'),
url(r'^logout/', logout_then_login, name='LoginPage'),
]
| <commit_before>from django.conf.urls import url
from .views import HomePage
urlpatterns = [
url(r'^', HomePage.as_view(), name='HomePage'),
]
<commit_msg>Add Login & Logout Routing<commit_after> | from django.conf.urls import url
from .views import HomePage, LoginPage
from django.contrib.auth.views import logout_then_login
urlpatterns = [
url(r'^$', HomePage.as_view(), name='HomePage'),
url(r'^login/', LoginPage.as_view(), name='LoginPage'),
url(r'^logout/', logout_then_login, name='LoginPage'),
]
| from django.conf.urls import url
from .views import HomePage
urlpatterns = [
url(r'^', HomePage.as_view(), name='HomePage'),
]
Add Login & Logout Routingfrom django.conf.urls import url
from .views import HomePage, LoginPage
from django.contrib.auth.views import logout_then_login
urlpatterns = [
url(r'^$', Ho... | <commit_before>from django.conf.urls import url
from .views import HomePage
urlpatterns = [
url(r'^', HomePage.as_view(), name='HomePage'),
]
<commit_msg>Add Login & Logout Routing<commit_after>from django.conf.urls import url
from .views import HomePage, LoginPage
from django.contrib.auth.views import logout_then... |
4e95002f010fe7663bf678e5d359c6792bfc284d | fbmsgbot/models/attachment.py | fbmsgbot/models/attachment.py |
class Button(object):
"""Button object, used for creating button messages"""
def __init__(self, type=None, title="", payload=""):
# Type: request param key
valid_types = {
'web_url': 'url',
'postback': 'payload'
}
assert type in valid_types, "Type %s i... |
class Button(object):
"""Button object, used for creating button messages"""
def __init__(self, type=None, title="", payload=""):
# Type: request param key
valid_types = {
'web_url': 'url',
'postback': 'payload'
}
assert type in valid_types, "Type %s i... | Fix bug in Element to allow subclassing | Fix bug in Element to allow subclassing
| Python | mit | ben-cunningham/python-messenger-bot,ben-cunningham/pybot |
class Button(object):
"""Button object, used for creating button messages"""
def __init__(self, type=None, title="", payload=""):
# Type: request param key
valid_types = {
'web_url': 'url',
'postback': 'payload'
}
assert type in valid_types, "Type %s i... |
class Button(object):
"""Button object, used for creating button messages"""
def __init__(self, type=None, title="", payload=""):
# Type: request param key
valid_types = {
'web_url': 'url',
'postback': 'payload'
}
assert type in valid_types, "Type %s i... | <commit_before>
class Button(object):
"""Button object, used for creating button messages"""
def __init__(self, type=None, title="", payload=""):
# Type: request param key
valid_types = {
'web_url': 'url',
'postback': 'payload'
}
assert type in valid_ty... |
class Button(object):
"""Button object, used for creating button messages"""
def __init__(self, type=None, title="", payload=""):
# Type: request param key
valid_types = {
'web_url': 'url',
'postback': 'payload'
}
assert type in valid_types, "Type %s i... |
class Button(object):
"""Button object, used for creating button messages"""
def __init__(self, type=None, title="", payload=""):
# Type: request param key
valid_types = {
'web_url': 'url',
'postback': 'payload'
}
assert type in valid_types, "Type %s i... | <commit_before>
class Button(object):
"""Button object, used for creating button messages"""
def __init__(self, type=None, title="", payload=""):
# Type: request param key
valid_types = {
'web_url': 'url',
'postback': 'payload'
}
assert type in valid_ty... |
54655ff23297b302f12eff9900f8d1c5ce986ab2 | moksha/tests/test_hub.py | moksha/tests/test_hub.py | """Test Moksha's Hub """
from nose.tools import eq_, assert_true
from moksha.hub import MokshaHub
class TestHub:
def setUp(self):
self.hub = MokshaHub()
def tearDown(self):
self.hub.close()
def test_creating_queue(self):
self.hub.create_queue('test')
eq_(len(self.hub.que... | """Test Moksha's Hub """
#from nose.tools import eq_, assert_true
#from moksha.hub import MokshaHub
#
#class TestHub:
#
# def setUp(self):
# self.hub = MokshaHub()
#
# def tearDown(self):
# self.hub.close()
#
# def test_creating_queue(self):
# self.hub.create_queue('test')
# eq_(le... | Comment out some hub tests, as they do not currently work | Comment out some hub tests, as they do not currently work
| Python | apache-2.0 | lmacken/moksha,mokshaproject/moksha,pombredanne/moksha,ralphbean/moksha,mokshaproject/moksha,pombredanne/moksha,pombredanne/moksha,ralphbean/moksha,lmacken/moksha,mokshaproject/moksha,pombredanne/moksha,lmacken/moksha,ralphbean/moksha,mokshaproject/moksha | """Test Moksha's Hub """
from nose.tools import eq_, assert_true
from moksha.hub import MokshaHub
class TestHub:
def setUp(self):
self.hub = MokshaHub()
def tearDown(self):
self.hub.close()
def test_creating_queue(self):
self.hub.create_queue('test')
eq_(len(self.hub.que... | """Test Moksha's Hub """
#from nose.tools import eq_, assert_true
#from moksha.hub import MokshaHub
#
#class TestHub:
#
# def setUp(self):
# self.hub = MokshaHub()
#
# def tearDown(self):
# self.hub.close()
#
# def test_creating_queue(self):
# self.hub.create_queue('test')
# eq_(le... | <commit_before>"""Test Moksha's Hub """
from nose.tools import eq_, assert_true
from moksha.hub import MokshaHub
class TestHub:
def setUp(self):
self.hub = MokshaHub()
def tearDown(self):
self.hub.close()
def test_creating_queue(self):
self.hub.create_queue('test')
eq_(l... | """Test Moksha's Hub """
#from nose.tools import eq_, assert_true
#from moksha.hub import MokshaHub
#
#class TestHub:
#
# def setUp(self):
# self.hub = MokshaHub()
#
# def tearDown(self):
# self.hub.close()
#
# def test_creating_queue(self):
# self.hub.create_queue('test')
# eq_(le... | """Test Moksha's Hub """
from nose.tools import eq_, assert_true
from moksha.hub import MokshaHub
class TestHub:
def setUp(self):
self.hub = MokshaHub()
def tearDown(self):
self.hub.close()
def test_creating_queue(self):
self.hub.create_queue('test')
eq_(len(self.hub.que... | <commit_before>"""Test Moksha's Hub """
from nose.tools import eq_, assert_true
from moksha.hub import MokshaHub
class TestHub:
def setUp(self):
self.hub = MokshaHub()
def tearDown(self):
self.hub.close()
def test_creating_queue(self):
self.hub.create_queue('test')
eq_(l... |
9d7cec35a1771f45d0083a80e2f1823182d8d0b8 | MarkovChainBibleBot/get_bible.py | MarkovChainBibleBot/get_bible.py | import requests
from os import path
project_gutenberg_bible_url = 'http://www.gutenberg.org/cache/epub/10/pg10.txt'
bible_filename = 'bible.txt'
bible_path = path.join('..', 'data', bible_filename)
def bible_text(url=project_gutenberg_bible_url):
"""Get the bible text"""
return requests.get(url).text
def ... | import requests
from os import path, linesep
project_gutenberg_bible_url = 'http://www.gutenberg.org/cache/epub/10/pg10.txt'
bible_filename = 'bible.txt'
bible_path = path.join('..', 'data', bible_filename)
def bible_text(url=project_gutenberg_bible_url):
"""Get the bible text"""
return requests.get(url).te... | Use os independent line seperator | Use os independent line seperator
| Python | mit | salvor7/MarkovChainBibleBot | import requests
from os import path
project_gutenberg_bible_url = 'http://www.gutenberg.org/cache/epub/10/pg10.txt'
bible_filename = 'bible.txt'
bible_path = path.join('..', 'data', bible_filename)
def bible_text(url=project_gutenberg_bible_url):
"""Get the bible text"""
return requests.get(url).text
def ... | import requests
from os import path, linesep
project_gutenberg_bible_url = 'http://www.gutenberg.org/cache/epub/10/pg10.txt'
bible_filename = 'bible.txt'
bible_path = path.join('..', 'data', bible_filename)
def bible_text(url=project_gutenberg_bible_url):
"""Get the bible text"""
return requests.get(url).te... | <commit_before>import requests
from os import path
project_gutenberg_bible_url = 'http://www.gutenberg.org/cache/epub/10/pg10.txt'
bible_filename = 'bible.txt'
bible_path = path.join('..', 'data', bible_filename)
def bible_text(url=project_gutenberg_bible_url):
"""Get the bible text"""
return requests.get(u... | import requests
from os import path, linesep
project_gutenberg_bible_url = 'http://www.gutenberg.org/cache/epub/10/pg10.txt'
bible_filename = 'bible.txt'
bible_path = path.join('..', 'data', bible_filename)
def bible_text(url=project_gutenberg_bible_url):
"""Get the bible text"""
return requests.get(url).te... | import requests
from os import path
project_gutenberg_bible_url = 'http://www.gutenberg.org/cache/epub/10/pg10.txt'
bible_filename = 'bible.txt'
bible_path = path.join('..', 'data', bible_filename)
def bible_text(url=project_gutenberg_bible_url):
"""Get the bible text"""
return requests.get(url).text
def ... | <commit_before>import requests
from os import path
project_gutenberg_bible_url = 'http://www.gutenberg.org/cache/epub/10/pg10.txt'
bible_filename = 'bible.txt'
bible_path = path.join('..', 'data', bible_filename)
def bible_text(url=project_gutenberg_bible_url):
"""Get the bible text"""
return requests.get(u... |
7c1173bb5b6d093b4ff7cc89cbe069e1179f1d96 | IPython/external/appnope/__init__.py | IPython/external/appnope/__init__.py |
try:
from appnope import *
except ImportError:
__version__ = '0.0.5'
import sys
import platform
from distutils.version import LooseVersion as V
if sys.platform != "darwin" or V(platform.mac_ver()[0]) < V("10.9"):
from _dummy import *
else:
from ._nope import *
del sys,... |
try:
from appnope import *
except ImportError:
__version__ = '0.0.5'
import sys
import platform
from distutils.version import LooseVersion as V
if sys.platform != "darwin" or V(platform.mac_ver()[0]) < V("10.9"):
from ._dummy import *
else:
from ._nope import *
del sys... | Fix relative import in appnope | Fix relative import in appnope
Closes gh-6409
| Python | bsd-3-clause | ipython/ipython,ipython/ipython |
try:
from appnope import *
except ImportError:
__version__ = '0.0.5'
import sys
import platform
from distutils.version import LooseVersion as V
if sys.platform != "darwin" or V(platform.mac_ver()[0]) < V("10.9"):
from _dummy import *
else:
from ._nope import *
del sys,... |
try:
from appnope import *
except ImportError:
__version__ = '0.0.5'
import sys
import platform
from distutils.version import LooseVersion as V
if sys.platform != "darwin" or V(platform.mac_ver()[0]) < V("10.9"):
from ._dummy import *
else:
from ._nope import *
del sys... | <commit_before>
try:
from appnope import *
except ImportError:
__version__ = '0.0.5'
import sys
import platform
from distutils.version import LooseVersion as V
if sys.platform != "darwin" or V(platform.mac_ver()[0]) < V("10.9"):
from _dummy import *
else:
from ._nope import ... |
try:
from appnope import *
except ImportError:
__version__ = '0.0.5'
import sys
import platform
from distutils.version import LooseVersion as V
if sys.platform != "darwin" or V(platform.mac_ver()[0]) < V("10.9"):
from ._dummy import *
else:
from ._nope import *
del sys... |
try:
from appnope import *
except ImportError:
__version__ = '0.0.5'
import sys
import platform
from distutils.version import LooseVersion as V
if sys.platform != "darwin" or V(platform.mac_ver()[0]) < V("10.9"):
from _dummy import *
else:
from ._nope import *
del sys,... | <commit_before>
try:
from appnope import *
except ImportError:
__version__ = '0.0.5'
import sys
import platform
from distutils.version import LooseVersion as V
if sys.platform != "darwin" or V(platform.mac_ver()[0]) < V("10.9"):
from _dummy import *
else:
from ._nope import ... |
822175a40c7a811331593069766c75e9ee0b0c25 | py/vtdb/__init__.py | py/vtdb/__init__.py | # Copyright 2012, Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can
# be found in the LICENSE file.
# PEP 249 complient db api for Vitess
apilevel = '2.0'
# Threads may not share the module because multi_client is not thread safe.
threadsafety = 0
paramstyle = 'nam... | # Copyright 2012, Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can
# be found in the LICENSE file.
# PEP 249 complient db api for Vitess
apilevel = '2.0'
# Threads may not share the module because multi_client is not thread safe.
threadsafety = 0
paramstyle = 'nam... | Make sure vtgatev2.VTGateConnection is registered. | Make sure vtgatev2.VTGateConnection is registered.
| Python | apache-2.0 | tinyspeck/vitess,AndyDiamondstein/vitess,mattharden/vitess,enisoc/vitess,mahak/vitess,enisoc/vitess,rnavarro/vitess,erzel/vitess,mapbased/vitess,mattharden/vitess,davygeek/vitess,guokeno0/vitess,enisoc/vitess,pivanof/vitess,aaijazi/vitess,aaijazi/vitess,dcadevil/vitess,mahak/vitess,mapbased/vitess,davygeek/vitess,tjyan... | # Copyright 2012, Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can
# be found in the LICENSE file.
# PEP 249 complient db api for Vitess
apilevel = '2.0'
# Threads may not share the module because multi_client is not thread safe.
threadsafety = 0
paramstyle = 'nam... | # Copyright 2012, Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can
# be found in the LICENSE file.
# PEP 249 complient db api for Vitess
apilevel = '2.0'
# Threads may not share the module because multi_client is not thread safe.
threadsafety = 0
paramstyle = 'nam... | <commit_before># Copyright 2012, Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can
# be found in the LICENSE file.
# PEP 249 complient db api for Vitess
apilevel = '2.0'
# Threads may not share the module because multi_client is not thread safe.
threadsafety = 0
pa... | # Copyright 2012, Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can
# be found in the LICENSE file.
# PEP 249 complient db api for Vitess
apilevel = '2.0'
# Threads may not share the module because multi_client is not thread safe.
threadsafety = 0
paramstyle = 'nam... | # Copyright 2012, Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can
# be found in the LICENSE file.
# PEP 249 complient db api for Vitess
apilevel = '2.0'
# Threads may not share the module because multi_client is not thread safe.
threadsafety = 0
paramstyle = 'nam... | <commit_before># Copyright 2012, Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can
# be found in the LICENSE file.
# PEP 249 complient db api for Vitess
apilevel = '2.0'
# Threads may not share the module because multi_client is not thread safe.
threadsafety = 0
pa... |
85214e015d4e9acc74e11e206cc753cd33d1a2e0 | webserver.py | webserver.py | """
This module is responsible for handling web requests using Flask.
Requests are of the form (start, end) in unix time and are passed on to the db
manager, which then returns the appropriate data to be sent back as JSON.
"""
#TODO: turn this into a daemon
from flask import Flask, request
import json
import db
imp... | """
This module is responsible for handling web requests using Flask.
Requests are of the form (start, end) in unix time and are passed on to the db
manager, which then returns the appropriate data to be sent back as JSON.
"""
#TODO: turn this into a daemon
from flask import Flask, request
import json
import db
imp... | Return result as json, not properly formatted as of yet. | Return result as json, not properly formatted as of yet.
| Python | mit | mgunyho/kiltiskahvi | """
This module is responsible for handling web requests using Flask.
Requests are of the form (start, end) in unix time and are passed on to the db
manager, which then returns the appropriate data to be sent back as JSON.
"""
#TODO: turn this into a daemon
from flask import Flask, request
import json
import db
imp... | """
This module is responsible for handling web requests using Flask.
Requests are of the form (start, end) in unix time and are passed on to the db
manager, which then returns the appropriate data to be sent back as JSON.
"""
#TODO: turn this into a daemon
from flask import Flask, request
import json
import db
imp... | <commit_before>"""
This module is responsible for handling web requests using Flask.
Requests are of the form (start, end) in unix time and are passed on to the db
manager, which then returns the appropriate data to be sent back as JSON.
"""
#TODO: turn this into a daemon
from flask import Flask, request
import jso... | """
This module is responsible for handling web requests using Flask.
Requests are of the form (start, end) in unix time and are passed on to the db
manager, which then returns the appropriate data to be sent back as JSON.
"""
#TODO: turn this into a daemon
from flask import Flask, request
import json
import db
imp... | """
This module is responsible for handling web requests using Flask.
Requests are of the form (start, end) in unix time and are passed on to the db
manager, which then returns the appropriate data to be sent back as JSON.
"""
#TODO: turn this into a daemon
from flask import Flask, request
import json
import db
imp... | <commit_before>"""
This module is responsible for handling web requests using Flask.
Requests are of the form (start, end) in unix time and are passed on to the db
manager, which then returns the appropriate data to be sent back as JSON.
"""
#TODO: turn this into a daemon
from flask import Flask, request
import jso... |
c3d22dd13bf56e65452e2e7d634c527d66e2a3b4 | pyptools/objects.py | pyptools/objects.py | class Parser(object):
"""Base class for all parsers to inheret with common interface"""
def iterparse(self, iterator, **kwargs):
"""
Parses a iterator/generator. Must be implemented by each parser.
:param value: Iterable containing data
:return: yeilds parsed data... | class Parser(object):
"""Base class for all parsers to inheret with common interface"""
def iterparse(self, iterator, **kwargs):
"""
Parses a iterator/generator. Must be implemented by each parser.
:param value: Iterable containing data
:return: yeilds parsed data... | Fix a bug where splitlines was called twice for parse_file | Fix a bug where splitlines was called twice for parse_file
| Python | mit | tandreas/pyptools | class Parser(object):
"""Base class for all parsers to inheret with common interface"""
def iterparse(self, iterator, **kwargs):
"""
Parses a iterator/generator. Must be implemented by each parser.
:param value: Iterable containing data
:return: yeilds parsed data... | class Parser(object):
"""Base class for all parsers to inheret with common interface"""
def iterparse(self, iterator, **kwargs):
"""
Parses a iterator/generator. Must be implemented by each parser.
:param value: Iterable containing data
:return: yeilds parsed data... | <commit_before>class Parser(object):
"""Base class for all parsers to inheret with common interface"""
def iterparse(self, iterator, **kwargs):
"""
Parses a iterator/generator. Must be implemented by each parser.
:param value: Iterable containing data
:return: yei... | class Parser(object):
"""Base class for all parsers to inheret with common interface"""
def iterparse(self, iterator, **kwargs):
"""
Parses a iterator/generator. Must be implemented by each parser.
:param value: Iterable containing data
:return: yeilds parsed data... | class Parser(object):
"""Base class for all parsers to inheret with common interface"""
def iterparse(self, iterator, **kwargs):
"""
Parses a iterator/generator. Must be implemented by each parser.
:param value: Iterable containing data
:return: yeilds parsed data... | <commit_before>class Parser(object):
"""Base class for all parsers to inheret with common interface"""
def iterparse(self, iterator, **kwargs):
"""
Parses a iterator/generator. Must be implemented by each parser.
:param value: Iterable containing data
:return: yei... |
4987b2e5a2d5ee208a274702f6b88a9021149c86 | tests/blueprints/user_message/test_address_formatting.py | tests/blueprints/user_message/test_address_formatting.py | """
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from unittest.mock import patch
import pytest
from byceps.services.user_message import service as user_message_service
from tests.conftest import database_recreated
from tests.helpers import app_context, create_brand... | """
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from unittest.mock import patch
import pytest
from byceps.services.user_message import service as user_message_service
from tests.conftest import database_recreated
from tests.helpers import app_context, create_brand... | Speed up user message address formatting test | Speed up user message address formatting test
The common set-up is moved to the fixture, then the fixture's scope is
widened so that it is used for all test cases in the module, avoiding
duplicate work.
| Python | bsd-3-clause | m-ober/byceps,homeworkprod/byceps,m-ober/byceps,homeworkprod/byceps,homeworkprod/byceps,m-ober/byceps | """
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from unittest.mock import patch
import pytest
from byceps.services.user_message import service as user_message_service
from tests.conftest import database_recreated
from tests.helpers import app_context, create_brand... | """
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from unittest.mock import patch
import pytest
from byceps.services.user_message import service as user_message_service
from tests.conftest import database_recreated
from tests.helpers import app_context, create_brand... | <commit_before>"""
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from unittest.mock import patch
import pytest
from byceps.services.user_message import service as user_message_service
from tests.conftest import database_recreated
from tests.helpers import app_contex... | """
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from unittest.mock import patch
import pytest
from byceps.services.user_message import service as user_message_service
from tests.conftest import database_recreated
from tests.helpers import app_context, create_brand... | """
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from unittest.mock import patch
import pytest
from byceps.services.user_message import service as user_message_service
from tests.conftest import database_recreated
from tests.helpers import app_context, create_brand... | <commit_before>"""
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from unittest.mock import patch
import pytest
from byceps.services.user_message import service as user_message_service
from tests.conftest import database_recreated
from tests.helpers import app_contex... |
d3fd59325f592bd3409d8466ba288e0c377c7440 | mklocale/cmd.py | mklocale/cmd.py | import argparse
import logging
import yaml
from mklocale import transifex
from mklocale.cats import merge_by_language, write_catalog
from mklocale.utils import listify
log = logging.getLogger("mklocale")
def cmdline(argv):
logging.basicConfig(level=logging.INFO)
ap = argparse.ArgumentParser()
ap.add_ar... | import argparse
import hashlib
import logging
import os
import yaml
from mklocale import transifex
from mklocale.cats import merge_by_language, write_catalog
from mklocale.utils import listify
log = logging.getLogger("mklocale")
def cmdline(argv):
logging.basicConfig(level=logging.INFO)
ap = argparse.Argum... | Add optional use of requests_cache | Add optional use of requests_cache
| Python | mit | akx/mklocale | import argparse
import logging
import yaml
from mklocale import transifex
from mklocale.cats import merge_by_language, write_catalog
from mklocale.utils import listify
log = logging.getLogger("mklocale")
def cmdline(argv):
logging.basicConfig(level=logging.INFO)
ap = argparse.ArgumentParser()
ap.add_ar... | import argparse
import hashlib
import logging
import os
import yaml
from mklocale import transifex
from mklocale.cats import merge_by_language, write_catalog
from mklocale.utils import listify
log = logging.getLogger("mklocale")
def cmdline(argv):
logging.basicConfig(level=logging.INFO)
ap = argparse.Argum... | <commit_before>import argparse
import logging
import yaml
from mklocale import transifex
from mklocale.cats import merge_by_language, write_catalog
from mklocale.utils import listify
log = logging.getLogger("mklocale")
def cmdline(argv):
logging.basicConfig(level=logging.INFO)
ap = argparse.ArgumentParser(... | import argparse
import hashlib
import logging
import os
import yaml
from mklocale import transifex
from mklocale.cats import merge_by_language, write_catalog
from mklocale.utils import listify
log = logging.getLogger("mklocale")
def cmdline(argv):
logging.basicConfig(level=logging.INFO)
ap = argparse.Argum... | import argparse
import logging
import yaml
from mklocale import transifex
from mklocale.cats import merge_by_language, write_catalog
from mklocale.utils import listify
log = logging.getLogger("mklocale")
def cmdline(argv):
logging.basicConfig(level=logging.INFO)
ap = argparse.ArgumentParser()
ap.add_ar... | <commit_before>import argparse
import logging
import yaml
from mklocale import transifex
from mklocale.cats import merge_by_language, write_catalog
from mklocale.utils import listify
log = logging.getLogger("mklocale")
def cmdline(argv):
logging.basicConfig(level=logging.INFO)
ap = argparse.ArgumentParser(... |
7c2ec2e873fd8eb7bf1537d04c454a00ca2b40f9 | conftest.py | conftest.py | # -*- coding: utf-8 -*-
import pytest
try:
# TODO: this file is read/executed even when called from ``readthedocsinc``,
# so it's overriding the options that we are defining in the ``conftest.py``
# from the corporate site. We need to find a better way to avoid this.
import readthedocsinc
PYTEST_OP... | # -*- coding: utf-8 -*-
import pytest
try:
# TODO: this file is read/executed even when called from ``readthedocsinc``,
# so it's overriding the options that we are defining in the ``conftest.py``
# from the corporate site. We need to find a better way to avoid this.
import readthedocsinc
PYTEST_OP... | Extend pytest's `markexpr` conf in case it already exists | Extend pytest's `markexpr` conf in case it already exists
| Python | mit | rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org | # -*- coding: utf-8 -*-
import pytest
try:
# TODO: this file is read/executed even when called from ``readthedocsinc``,
# so it's overriding the options that we are defining in the ``conftest.py``
# from the corporate site. We need to find a better way to avoid this.
import readthedocsinc
PYTEST_OP... | # -*- coding: utf-8 -*-
import pytest
try:
# TODO: this file is read/executed even when called from ``readthedocsinc``,
# so it's overriding the options that we are defining in the ``conftest.py``
# from the corporate site. We need to find a better way to avoid this.
import readthedocsinc
PYTEST_OP... | <commit_before># -*- coding: utf-8 -*-
import pytest
try:
# TODO: this file is read/executed even when called from ``readthedocsinc``,
# so it's overriding the options that we are defining in the ``conftest.py``
# from the corporate site. We need to find a better way to avoid this.
import readthedocsin... | # -*- coding: utf-8 -*-
import pytest
try:
# TODO: this file is read/executed even when called from ``readthedocsinc``,
# so it's overriding the options that we are defining in the ``conftest.py``
# from the corporate site. We need to find a better way to avoid this.
import readthedocsinc
PYTEST_OP... | # -*- coding: utf-8 -*-
import pytest
try:
# TODO: this file is read/executed even when called from ``readthedocsinc``,
# so it's overriding the options that we are defining in the ``conftest.py``
# from the corporate site. We need to find a better way to avoid this.
import readthedocsinc
PYTEST_OP... | <commit_before># -*- coding: utf-8 -*-
import pytest
try:
# TODO: this file is read/executed even when called from ``readthedocsinc``,
# so it's overriding the options that we are defining in the ``conftest.py``
# from the corporate site. We need to find a better way to avoid this.
import readthedocsin... |
142addc801051c688252944a37081010e0f5d58f | api/base/settings/__init__.py | api/base/settings/__init__.py | # -*- coding: utf-8 -*-
'''Consolidates settings from defaults.py and local.py.
::
>>> from api.base import settings
>>> settings.API_BASE
'v2/'
'''
from .defaults import * # noqa
try:
from .local import * # noqa
except ImportError as error:
raise ImportError("No api/base/settings/local.py setti... | # -*- coding: utf-8 -*-
'''Consolidates settings from defaults.py and local.py.
::
>>> from api.base import settings
>>> settings.API_BASE
'v2/'
'''
from .defaults import * # noqa
try:
from .local import * # noqa
except ImportError as error:
raise ImportWarning("No api/base/settings/local.py set... | Change import error to a warning | Change import error to a warning
| Python | apache-2.0 | emetsger/osf.io,haoyuchen1992/osf.io,Johnetordoff/osf.io,mluo613/osf.io,RomanZWang/osf.io,arpitar/osf.io,cslzchen/osf.io,samanehsan/osf.io,felliott/osf.io,CenterForOpenScience/osf.io,brianjgeiger/osf.io,aaxelb/osf.io,KAsante95/osf.io,cldershem/osf.io,njantrania/osf.io,caseyrygt/osf.io,adlius/osf.io,leb2dg/osf.io,crcres... | # -*- coding: utf-8 -*-
'''Consolidates settings from defaults.py and local.py.
::
>>> from api.base import settings
>>> settings.API_BASE
'v2/'
'''
from .defaults import * # noqa
try:
from .local import * # noqa
except ImportError as error:
raise ImportError("No api/base/settings/local.py setti... | # -*- coding: utf-8 -*-
'''Consolidates settings from defaults.py and local.py.
::
>>> from api.base import settings
>>> settings.API_BASE
'v2/'
'''
from .defaults import * # noqa
try:
from .local import * # noqa
except ImportError as error:
raise ImportWarning("No api/base/settings/local.py set... | <commit_before># -*- coding: utf-8 -*-
'''Consolidates settings from defaults.py and local.py.
::
>>> from api.base import settings
>>> settings.API_BASE
'v2/'
'''
from .defaults import * # noqa
try:
from .local import * # noqa
except ImportError as error:
raise ImportError("No api/base/settings... | # -*- coding: utf-8 -*-
'''Consolidates settings from defaults.py and local.py.
::
>>> from api.base import settings
>>> settings.API_BASE
'v2/'
'''
from .defaults import * # noqa
try:
from .local import * # noqa
except ImportError as error:
raise ImportWarning("No api/base/settings/local.py set... | # -*- coding: utf-8 -*-
'''Consolidates settings from defaults.py and local.py.
::
>>> from api.base import settings
>>> settings.API_BASE
'v2/'
'''
from .defaults import * # noqa
try:
from .local import * # noqa
except ImportError as error:
raise ImportError("No api/base/settings/local.py setti... | <commit_before># -*- coding: utf-8 -*-
'''Consolidates settings from defaults.py and local.py.
::
>>> from api.base import settings
>>> settings.API_BASE
'v2/'
'''
from .defaults import * # noqa
try:
from .local import * # noqa
except ImportError as error:
raise ImportError("No api/base/settings... |
c71e494af9c861e0a5ddfff0f18d0dfe5c6a45e4 | derrida/__init__.py | derrida/__init__.py | __version_info__ = (1, 2, 4, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the template environm... | __version_info__ = (1, 3, 0, 'dev')
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the template environ... | Set develop version to 1.3.0-dev | Set develop version to 1.3.0-dev
| Python | apache-2.0 | Princeton-CDH/derrida-django,Princeton-CDH/derrida-django,Princeton-CDH/derrida-django,Princeton-CDH/derrida-django | __version_info__ = (1, 2, 4, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the template environm... | __version_info__ = (1, 3, 0, 'dev')
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the template environ... | <commit_before>__version_info__ = (1, 2, 4, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the te... | __version_info__ = (1, 3, 0, 'dev')
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the template environ... | __version_info__ = (1, 2, 4, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the template environm... | <commit_before>__version_info__ = (1, 2, 4, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the te... |
803e128b8e151c061f75051b5a4386d4c624ba56 | core/settings-wni-Windows_NT.py | core/settings-wni-Windows_NT.py | #!/usr/bin/python2
from __future__ import absolute_import
from qubes.storage.wni import QubesWniVmStorage
def apply(system_path, vm_files, defaults):
system_path['qubes_base_dir'] = 'c:\\qubes'
system_path['config_template_pv'] = 'c:/program files/Invisible Things Lab/Qubes/vm-template.xml'
system_path['... | #!/usr/bin/python2
from __future__ import absolute_import
from qubes.storage.wni import QubesWniVmStorage
def apply(system_path, vm_files, defaults):
system_path['qubes_base_dir'] = 'c:\\qubes'
system_path['config_template_pv'] = 'c:/program files/Invisible Things Lab/Qubes/vm-template.xml'
system_path['... | Add qrexec-client path to WNI settings | wni: Add qrexec-client path to WNI settings
| Python | lgpl-2.1 | marmarek/qubes-core-admin,QubesOS/qubes-core-admin,QubesOS/qubes-core-admin,woju/qubes-core-admin,marmarek/qubes-core-admin,QubesOS/qubes-core-admin,woju/qubes-core-admin,woju/qubes-core-admin,woju/qubes-core-admin,marmarek/qubes-core-admin | #!/usr/bin/python2
from __future__ import absolute_import
from qubes.storage.wni import QubesWniVmStorage
def apply(system_path, vm_files, defaults):
system_path['qubes_base_dir'] = 'c:\\qubes'
system_path['config_template_pv'] = 'c:/program files/Invisible Things Lab/Qubes/vm-template.xml'
system_path['... | #!/usr/bin/python2
from __future__ import absolute_import
from qubes.storage.wni import QubesWniVmStorage
def apply(system_path, vm_files, defaults):
system_path['qubes_base_dir'] = 'c:\\qubes'
system_path['config_template_pv'] = 'c:/program files/Invisible Things Lab/Qubes/vm-template.xml'
system_path['... | <commit_before>#!/usr/bin/python2
from __future__ import absolute_import
from qubes.storage.wni import QubesWniVmStorage
def apply(system_path, vm_files, defaults):
system_path['qubes_base_dir'] = 'c:\\qubes'
system_path['config_template_pv'] = 'c:/program files/Invisible Things Lab/Qubes/vm-template.xml'
... | #!/usr/bin/python2
from __future__ import absolute_import
from qubes.storage.wni import QubesWniVmStorage
def apply(system_path, vm_files, defaults):
system_path['qubes_base_dir'] = 'c:\\qubes'
system_path['config_template_pv'] = 'c:/program files/Invisible Things Lab/Qubes/vm-template.xml'
system_path['... | #!/usr/bin/python2
from __future__ import absolute_import
from qubes.storage.wni import QubesWniVmStorage
def apply(system_path, vm_files, defaults):
system_path['qubes_base_dir'] = 'c:\\qubes'
system_path['config_template_pv'] = 'c:/program files/Invisible Things Lab/Qubes/vm-template.xml'
system_path['... | <commit_before>#!/usr/bin/python2
from __future__ import absolute_import
from qubes.storage.wni import QubesWniVmStorage
def apply(system_path, vm_files, defaults):
system_path['qubes_base_dir'] = 'c:\\qubes'
system_path['config_template_pv'] = 'c:/program files/Invisible Things Lab/Qubes/vm-template.xml'
... |
8598cd0dd4938a2c5d46c350445e5c36c7792a30 | leapp/utils/workarounds/mp.py | leapp/utils/workarounds/mp.py | import os
import multiprocessing.util
def apply_workaround():
# Implements:
# https://github.com/python/cpython/commit/e8a57b98ec8f2b161d4ad68ecc1433c9e3caad57
#
# Detection of fix: os imported to compare pids, before the fix os has not
# been imported
if getattr(multiprocessing.util, 'os', No... | import os
import multiprocessing.util
def apply_workaround():
# Implements:
# https://github.com/python/cpython/commit/e8a57b98ec8f2b161d4ad68ecc1433c9e3caad57
#
# Detection of fix: os imported to compare pids, before the fix os has not
# been imported
if getattr(multiprocessing.util, 'os', No... | Disable pylint signature-differs in md.py | Disable pylint signature-differs in md.py
| Python | lgpl-2.1 | leapp-to/prototype,leapp-to/prototype,leapp-to/prototype,leapp-to/prototype | import os
import multiprocessing.util
def apply_workaround():
# Implements:
# https://github.com/python/cpython/commit/e8a57b98ec8f2b161d4ad68ecc1433c9e3caad57
#
# Detection of fix: os imported to compare pids, before the fix os has not
# been imported
if getattr(multiprocessing.util, 'os', No... | import os
import multiprocessing.util
def apply_workaround():
# Implements:
# https://github.com/python/cpython/commit/e8a57b98ec8f2b161d4ad68ecc1433c9e3caad57
#
# Detection of fix: os imported to compare pids, before the fix os has not
# been imported
if getattr(multiprocessing.util, 'os', No... | <commit_before>import os
import multiprocessing.util
def apply_workaround():
# Implements:
# https://github.com/python/cpython/commit/e8a57b98ec8f2b161d4ad68ecc1433c9e3caad57
#
# Detection of fix: os imported to compare pids, before the fix os has not
# been imported
if getattr(multiprocessing... | import os
import multiprocessing.util
def apply_workaround():
# Implements:
# https://github.com/python/cpython/commit/e8a57b98ec8f2b161d4ad68ecc1433c9e3caad57
#
# Detection of fix: os imported to compare pids, before the fix os has not
# been imported
if getattr(multiprocessing.util, 'os', No... | import os
import multiprocessing.util
def apply_workaround():
# Implements:
# https://github.com/python/cpython/commit/e8a57b98ec8f2b161d4ad68ecc1433c9e3caad57
#
# Detection of fix: os imported to compare pids, before the fix os has not
# been imported
if getattr(multiprocessing.util, 'os', No... | <commit_before>import os
import multiprocessing.util
def apply_workaround():
# Implements:
# https://github.com/python/cpython/commit/e8a57b98ec8f2b161d4ad68ecc1433c9e3caad57
#
# Detection of fix: os imported to compare pids, before the fix os has not
# been imported
if getattr(multiprocessing... |
d373404a496713596bed91f62082c5a01b1891fb | ydf/cli.py | ydf/cli.py | """
ydf/cli
~~~~~~~
Defines the command-line interface.
"""
import click
import sys
from ydf import templating, yaml_ext
@click.command('ydf')
@click.argument('yaml',
type=click.File('r'))
@click.option('-v', '--variables',
type=click.Path(dir_okay=False),
he... | """
ydf/cli
~~~~~~~
Defines the command-line interface.
"""
import click
import sys
from ydf import templating, yaml_ext
@click.command('ydf')
@click.argument('yaml',
type=click.Path(dir_okay=False))
@click.option('-v', '--variables',
type=click.Path(dir_okay=False),
... | Switch yaml CLI argument from file to file path. | Switch yaml CLI argument from file to file path.
| Python | apache-2.0 | ahawker/ydf | """
ydf/cli
~~~~~~~
Defines the command-line interface.
"""
import click
import sys
from ydf import templating, yaml_ext
@click.command('ydf')
@click.argument('yaml',
type=click.File('r'))
@click.option('-v', '--variables',
type=click.Path(dir_okay=False),
he... | """
ydf/cli
~~~~~~~
Defines the command-line interface.
"""
import click
import sys
from ydf import templating, yaml_ext
@click.command('ydf')
@click.argument('yaml',
type=click.Path(dir_okay=False))
@click.option('-v', '--variables',
type=click.Path(dir_okay=False),
... | <commit_before>"""
ydf/cli
~~~~~~~
Defines the command-line interface.
"""
import click
import sys
from ydf import templating, yaml_ext
@click.command('ydf')
@click.argument('yaml',
type=click.File('r'))
@click.option('-v', '--variables',
type=click.Path(dir_okay=False),
... | """
ydf/cli
~~~~~~~
Defines the command-line interface.
"""
import click
import sys
from ydf import templating, yaml_ext
@click.command('ydf')
@click.argument('yaml',
type=click.Path(dir_okay=False))
@click.option('-v', '--variables',
type=click.Path(dir_okay=False),
... | """
ydf/cli
~~~~~~~
Defines the command-line interface.
"""
import click
import sys
from ydf import templating, yaml_ext
@click.command('ydf')
@click.argument('yaml',
type=click.File('r'))
@click.option('-v', '--variables',
type=click.Path(dir_okay=False),
he... | <commit_before>"""
ydf/cli
~~~~~~~
Defines the command-line interface.
"""
import click
import sys
from ydf import templating, yaml_ext
@click.command('ydf')
@click.argument('yaml',
type=click.File('r'))
@click.option('-v', '--variables',
type=click.Path(dir_okay=False),
... |
913d7f39bdbce53e64ea306b7bd2d95ffa0e0adb | lambdawebhook/hook.py | lambdawebhook/hook.py | #!/usr/bin/env python
import os
import sys
import hashlib
# Add the lib directory to the path for Lambda to load our libs
sys.path.append(os.path.join(os.path.dirname(__file__), 'lib'))
import requests # NOQA
import hmac # NOQA
def verify_signature(secret, signature, payload):
computed_hash = hmac.new(str(secr... | #!/usr/bin/env python
import os
import sys
import hashlib
import hmac
# Add the lib directory to the path for Lambda to load our libs
sys.path.append(os.path.join(os.path.dirname(__file__), 'lib'))
import requests # NOQA
def verify_signature(secret, signature, payload):
computed_hash = hmac.new(str(secret), pay... | Clean up order of imports | Clean up order of imports
| Python | bsd-3-clause | pristineio/lambda-webhook | #!/usr/bin/env python
import os
import sys
import hashlib
# Add the lib directory to the path for Lambda to load our libs
sys.path.append(os.path.join(os.path.dirname(__file__), 'lib'))
import requests # NOQA
import hmac # NOQA
def verify_signature(secret, signature, payload):
computed_hash = hmac.new(str(secr... | #!/usr/bin/env python
import os
import sys
import hashlib
import hmac
# Add the lib directory to the path for Lambda to load our libs
sys.path.append(os.path.join(os.path.dirname(__file__), 'lib'))
import requests # NOQA
def verify_signature(secret, signature, payload):
computed_hash = hmac.new(str(secret), pay... | <commit_before>#!/usr/bin/env python
import os
import sys
import hashlib
# Add the lib directory to the path for Lambda to load our libs
sys.path.append(os.path.join(os.path.dirname(__file__), 'lib'))
import requests # NOQA
import hmac # NOQA
def verify_signature(secret, signature, payload):
computed_hash = hm... | #!/usr/bin/env python
import os
import sys
import hashlib
import hmac
# Add the lib directory to the path for Lambda to load our libs
sys.path.append(os.path.join(os.path.dirname(__file__), 'lib'))
import requests # NOQA
def verify_signature(secret, signature, payload):
computed_hash = hmac.new(str(secret), pay... | #!/usr/bin/env python
import os
import sys
import hashlib
# Add the lib directory to the path for Lambda to load our libs
sys.path.append(os.path.join(os.path.dirname(__file__), 'lib'))
import requests # NOQA
import hmac # NOQA
def verify_signature(secret, signature, payload):
computed_hash = hmac.new(str(secr... | <commit_before>#!/usr/bin/env python
import os
import sys
import hashlib
# Add the lib directory to the path for Lambda to load our libs
sys.path.append(os.path.join(os.path.dirname(__file__), 'lib'))
import requests # NOQA
import hmac # NOQA
def verify_signature(secret, signature, payload):
computed_hash = hm... |
8ad5ff34a91cd103534b7b936e023462a08683fc | interface/backend/static/tests.py | interface/backend/static/tests.py | from django.test import TestCase
from django.urls import reverse
class SmokeTest(TestCase):
def test_landing(self):
url = reverse('static:open-image')
resp = self.client.get(url)
self.assertContains(resp, 'Concept to Clinic')
self.assertEqual(resp.status_code, 200)
| from django.test import TestCase
from django.urls import reverse
class SmokeTest(TestCase):
def test_landing(self):
url = reverse('static:home')
resp = self.client.get(url)
self.assertContains(resp, 'Concept to Clinic')
self.assertEqual(resp.status_code, 200)
| Fix broken URL reverse, introduced in 933649f | Fix broken URL reverse, introduced in 933649f
| Python | mit | vessemer/concept-to-clinic,antonow/concept-to-clinic,antonow/concept-to-clinic,vessemer/concept-to-clinic,antonow/concept-to-clinic,vessemer/concept-to-clinic,antonow/concept-to-clinic,vessemer/concept-to-clinic | from django.test import TestCase
from django.urls import reverse
class SmokeTest(TestCase):
def test_landing(self):
url = reverse('static:open-image')
resp = self.client.get(url)
self.assertContains(resp, 'Concept to Clinic')
self.assertEqual(resp.status_code, 200)
Fix broken URL r... | from django.test import TestCase
from django.urls import reverse
class SmokeTest(TestCase):
def test_landing(self):
url = reverse('static:home')
resp = self.client.get(url)
self.assertContains(resp, 'Concept to Clinic')
self.assertEqual(resp.status_code, 200)
| <commit_before>from django.test import TestCase
from django.urls import reverse
class SmokeTest(TestCase):
def test_landing(self):
url = reverse('static:open-image')
resp = self.client.get(url)
self.assertContains(resp, 'Concept to Clinic')
self.assertEqual(resp.status_code, 200)
<... | from django.test import TestCase
from django.urls import reverse
class SmokeTest(TestCase):
def test_landing(self):
url = reverse('static:home')
resp = self.client.get(url)
self.assertContains(resp, 'Concept to Clinic')
self.assertEqual(resp.status_code, 200)
| from django.test import TestCase
from django.urls import reverse
class SmokeTest(TestCase):
def test_landing(self):
url = reverse('static:open-image')
resp = self.client.get(url)
self.assertContains(resp, 'Concept to Clinic')
self.assertEqual(resp.status_code, 200)
Fix broken URL r... | <commit_before>from django.test import TestCase
from django.urls import reverse
class SmokeTest(TestCase):
def test_landing(self):
url = reverse('static:open-image')
resp = self.client.get(url)
self.assertContains(resp, 'Concept to Clinic')
self.assertEqual(resp.status_code, 200)
<... |
76da7e8bcee5cb91723ebe47006b1e3c20e7cc60 | services/httplib.py | services/httplib.py | from __future__ import absolute_import
from . import HttpService
from . import Response
from httplib import HTTPConnection
from httplib import HTTPException
from httplib import HTTPSConnection
from socket import timeout, error
import time
class HttpLibHttpService(HttpService):
"""
HttpService using python bat... | from __future__ import absolute_import
from . import HttpService
from . import Response
from httplib import HTTPConnection
from httplib import HTTPException
from httplib import HTTPSConnection
from socket import timeout, error
import time
class HttpLibHttpService(HttpService):
"""
HttpService using python bat... | Make HttpLibHttpService compatible with Exception (no kwarg). | Make HttpLibHttpService compatible with Exception (no kwarg).
| Python | bsd-2-clause | storecast/holon | from __future__ import absolute_import
from . import HttpService
from . import Response
from httplib import HTTPConnection
from httplib import HTTPException
from httplib import HTTPSConnection
from socket import timeout, error
import time
class HttpLibHttpService(HttpService):
"""
HttpService using python bat... | from __future__ import absolute_import
from . import HttpService
from . import Response
from httplib import HTTPConnection
from httplib import HTTPException
from httplib import HTTPSConnection
from socket import timeout, error
import time
class HttpLibHttpService(HttpService):
"""
HttpService using python bat... | <commit_before>from __future__ import absolute_import
from . import HttpService
from . import Response
from httplib import HTTPConnection
from httplib import HTTPException
from httplib import HTTPSConnection
from socket import timeout, error
import time
class HttpLibHttpService(HttpService):
"""
HttpService u... | from __future__ import absolute_import
from . import HttpService
from . import Response
from httplib import HTTPConnection
from httplib import HTTPException
from httplib import HTTPSConnection
from socket import timeout, error
import time
class HttpLibHttpService(HttpService):
"""
HttpService using python bat... | from __future__ import absolute_import
from . import HttpService
from . import Response
from httplib import HTTPConnection
from httplib import HTTPException
from httplib import HTTPSConnection
from socket import timeout, error
import time
class HttpLibHttpService(HttpService):
"""
HttpService using python bat... | <commit_before>from __future__ import absolute_import
from . import HttpService
from . import Response
from httplib import HTTPConnection
from httplib import HTTPException
from httplib import HTTPSConnection
from socket import timeout, error
import time
class HttpLibHttpService(HttpService):
"""
HttpService u... |
fdd87814f68810a390c50f7bf2a08359430722fa | conda_build/main_index.py | conda_build/main_index.py | from __future__ import absolute_import, division, print_function
import argparse
import os
from locale import getpreferredencoding
from os.path import abspath
from conda.compat import PY3
from conda_build.index import update_index
def main():
p = argparse.ArgumentParser(
description="Update package ind... | from __future__ import absolute_import, division, print_function
import os
from locale import getpreferredencoding
from os.path import abspath
from conda.compat import PY3
from conda.cli.conda_argparse import ArgumentParser
from conda_build.index import update_index
def main():
p = ArgumentParser(
desc... | Update command docs for conda index | Update command docs for conda index
| Python | bsd-3-clause | frol/conda-build,rmcgibbo/conda-build,shastings517/conda-build,mwcraig/conda-build,mwcraig/conda-build,dan-blanchard/conda-build,mwcraig/conda-build,dan-blanchard/conda-build,sandhujasmine/conda-build,frol/conda-build,rmcgibbo/conda-build,ilastik/conda-build,dan-blanchard/conda-build,shastings517/conda-build,frol/conda... | from __future__ import absolute_import, division, print_function
import argparse
import os
from locale import getpreferredencoding
from os.path import abspath
from conda.compat import PY3
from conda_build.index import update_index
def main():
p = argparse.ArgumentParser(
description="Update package ind... | from __future__ import absolute_import, division, print_function
import os
from locale import getpreferredencoding
from os.path import abspath
from conda.compat import PY3
from conda.cli.conda_argparse import ArgumentParser
from conda_build.index import update_index
def main():
p = ArgumentParser(
desc... | <commit_before>from __future__ import absolute_import, division, print_function
import argparse
import os
from locale import getpreferredencoding
from os.path import abspath
from conda.compat import PY3
from conda_build.index import update_index
def main():
p = argparse.ArgumentParser(
description="Upd... | from __future__ import absolute_import, division, print_function
import os
from locale import getpreferredencoding
from os.path import abspath
from conda.compat import PY3
from conda.cli.conda_argparse import ArgumentParser
from conda_build.index import update_index
def main():
p = ArgumentParser(
desc... | from __future__ import absolute_import, division, print_function
import argparse
import os
from locale import getpreferredencoding
from os.path import abspath
from conda.compat import PY3
from conda_build.index import update_index
def main():
p = argparse.ArgumentParser(
description="Update package ind... | <commit_before>from __future__ import absolute_import, division, print_function
import argparse
import os
from locale import getpreferredencoding
from os.path import abspath
from conda.compat import PY3
from conda_build.index import update_index
def main():
p = argparse.ArgumentParser(
description="Upd... |
6f557ed73372aa5823393a53b079bf4cec7511b8 | docker/ssladapter/ssladapter.py | docker/ssladapter/ssladapter.py | """ Resolves OpenSSL issues in some servers:
https://lukasa.co.uk/2013/01/Choosing_SSL_Version_In_Requests/
https://github.com/kennethreitz/requests/pull/799
"""
from distutils.version import StrictVersion
from requests.adapters import HTTPAdapter
try:
from requests.packages.urllib3.poolmanager import P... | """ Resolves OpenSSL issues in some servers:
https://lukasa.co.uk/2013/01/Choosing_SSL_Version_In_Requests/
https://github.com/kennethreitz/requests/pull/799
"""
from distutils.version import StrictVersion
from requests.adapters import HTTPAdapter
try:
import requests.packages.urllib3 as urllib3
except ... | Fix some urllib3 import issues | Fix some urllib3 import issues
| Python | apache-2.0 | runcom/docker-py,kaiyou/docker-py,TomasTomecek/docker-py,vpetersson/docker-py,dimaspivak/docker-py,paulbellamy/docker-py,ClusterHQ/docker-py,terminalmage/docker-py,ticosax/docker-py,kaiyou/docker-py,dimaspivak/docker-py,auready/docker-py,dnephin/docker-py,docker/docker-py,docker/docker-py,mrfuxi/docker-py,bboreham/dock... | """ Resolves OpenSSL issues in some servers:
https://lukasa.co.uk/2013/01/Choosing_SSL_Version_In_Requests/
https://github.com/kennethreitz/requests/pull/799
"""
from distutils.version import StrictVersion
from requests.adapters import HTTPAdapter
try:
from requests.packages.urllib3.poolmanager import P... | """ Resolves OpenSSL issues in some servers:
https://lukasa.co.uk/2013/01/Choosing_SSL_Version_In_Requests/
https://github.com/kennethreitz/requests/pull/799
"""
from distutils.version import StrictVersion
from requests.adapters import HTTPAdapter
try:
import requests.packages.urllib3 as urllib3
except ... | <commit_before>""" Resolves OpenSSL issues in some servers:
https://lukasa.co.uk/2013/01/Choosing_SSL_Version_In_Requests/
https://github.com/kennethreitz/requests/pull/799
"""
from distutils.version import StrictVersion
from requests.adapters import HTTPAdapter
try:
from requests.packages.urllib3.poolm... | """ Resolves OpenSSL issues in some servers:
https://lukasa.co.uk/2013/01/Choosing_SSL_Version_In_Requests/
https://github.com/kennethreitz/requests/pull/799
"""
from distutils.version import StrictVersion
from requests.adapters import HTTPAdapter
try:
import requests.packages.urllib3 as urllib3
except ... | """ Resolves OpenSSL issues in some servers:
https://lukasa.co.uk/2013/01/Choosing_SSL_Version_In_Requests/
https://github.com/kennethreitz/requests/pull/799
"""
from distutils.version import StrictVersion
from requests.adapters import HTTPAdapter
try:
from requests.packages.urllib3.poolmanager import P... | <commit_before>""" Resolves OpenSSL issues in some servers:
https://lukasa.co.uk/2013/01/Choosing_SSL_Version_In_Requests/
https://github.com/kennethreitz/requests/pull/799
"""
from distutils.version import StrictVersion
from requests.adapters import HTTPAdapter
try:
from requests.packages.urllib3.poolm... |
bf91b77db4327c698b7ed6fe5d0790aea3799e3c | dsub/_dsub_version.py | dsub/_dsub_version.py | # Copyright 2017 Google Inc. All Rights Reserved.
#
# 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 2017 Google Inc. All Rights Reserved.
#
# 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... | Update dsub version to 0.4.3 | Update dsub version to 0.4.3
PiperOrigin-RevId: 343898649
| Python | apache-2.0 | DataBiosphere/dsub,DataBiosphere/dsub | # Copyright 2017 Google Inc. All Rights Reserved.
#
# 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 2017 Google Inc. All Rights Reserved.
#
# 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 2017 Google Inc. All Rights Reserved.
#
# 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 2017 Google Inc. All Rights Reserved.
#
# 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 2017 Google Inc. All Rights Reserved.
#
# 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 2017 Google Inc. All Rights Reserved.
#
# 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... |
d58a85b922d2159b16bc16be46b5c09175567ece | dockci/migrations/0002.py | dockci/migrations/0002.py | """
Migrate config to docker hosts list
"""
import os
import yaml
filename = os.path.join('data', 'configs.yaml')
with open(filename) as handle:
data = yaml.load(handle)
host = data.pop('docker_host')
data['docker_hosts'] = [host]
with open(filename, 'w') as handle:
yaml.dump(data, handle, default_flow_styl... | """
Migrate config to docker hosts list
"""
import os
import sys
import yaml
filename = os.path.join('data', 'configs.yaml')
try:
with open(filename) as handle:
data = yaml.load(handle)
except FileNotFoundError:
# This is fine; will fail for new installs
sys.exit(0)
host = data.pop('docker_host')... | Handle no config.yaml in migrations | Handle no config.yaml in migrations
| Python | isc | RickyCook/DockCI,RickyCook/DockCI,RickyCook/DockCI,sprucedev/DockCI,sprucedev/DockCI,sprucedev/DockCI,sprucedev/DockCI-Agent,sprucedev/DockCI,RickyCook/DockCI,sprucedev/DockCI-Agent | """
Migrate config to docker hosts list
"""
import os
import yaml
filename = os.path.join('data', 'configs.yaml')
with open(filename) as handle:
data = yaml.load(handle)
host = data.pop('docker_host')
data['docker_hosts'] = [host]
with open(filename, 'w') as handle:
yaml.dump(data, handle, default_flow_styl... | """
Migrate config to docker hosts list
"""
import os
import sys
import yaml
filename = os.path.join('data', 'configs.yaml')
try:
with open(filename) as handle:
data = yaml.load(handle)
except FileNotFoundError:
# This is fine; will fail for new installs
sys.exit(0)
host = data.pop('docker_host')... | <commit_before>"""
Migrate config to docker hosts list
"""
import os
import yaml
filename = os.path.join('data', 'configs.yaml')
with open(filename) as handle:
data = yaml.load(handle)
host = data.pop('docker_host')
data['docker_hosts'] = [host]
with open(filename, 'w') as handle:
yaml.dump(data, handle, de... | """
Migrate config to docker hosts list
"""
import os
import sys
import yaml
filename = os.path.join('data', 'configs.yaml')
try:
with open(filename) as handle:
data = yaml.load(handle)
except FileNotFoundError:
# This is fine; will fail for new installs
sys.exit(0)
host = data.pop('docker_host')... | """
Migrate config to docker hosts list
"""
import os
import yaml
filename = os.path.join('data', 'configs.yaml')
with open(filename) as handle:
data = yaml.load(handle)
host = data.pop('docker_host')
data['docker_hosts'] = [host]
with open(filename, 'w') as handle:
yaml.dump(data, handle, default_flow_styl... | <commit_before>"""
Migrate config to docker hosts list
"""
import os
import yaml
filename = os.path.join('data', 'configs.yaml')
with open(filename) as handle:
data = yaml.load(handle)
host = data.pop('docker_host')
data['docker_hosts'] = [host]
with open(filename, 'w') as handle:
yaml.dump(data, handle, de... |
b56320247044e1a3187d59b003e1fd5c9e4d49cd | cq/utils.py | cq/utils.py | import time
from contextlib import contextmanager
import six
import inspect
import importlib
import logging
from redis.exceptions import RedisError
from django_redis import get_redis_connection
logger = logging.getLogger('cq')
def to_import_string(func):
if inspect.isfunction(func) or inspect.isbuiltin(func):
... | import time
from contextlib import contextmanager
import six
import inspect
import importlib
import logging
from redis.exceptions import RedisError
from django_redis import get_redis_connection
logger = logging.getLogger('cq')
def to_import_string(func):
if inspect.isfunction(func) or inspect.isbuiltin(func):
... | Remove a logging call, not needed anymore. | Remove a logging call, not needed anymore.
| Python | bsd-3-clause | furious-luke/django-cq | import time
from contextlib import contextmanager
import six
import inspect
import importlib
import logging
from redis.exceptions import RedisError
from django_redis import get_redis_connection
logger = logging.getLogger('cq')
def to_import_string(func):
if inspect.isfunction(func) or inspect.isbuiltin(func):
... | import time
from contextlib import contextmanager
import six
import inspect
import importlib
import logging
from redis.exceptions import RedisError
from django_redis import get_redis_connection
logger = logging.getLogger('cq')
def to_import_string(func):
if inspect.isfunction(func) or inspect.isbuiltin(func):
... | <commit_before>import time
from contextlib import contextmanager
import six
import inspect
import importlib
import logging
from redis.exceptions import RedisError
from django_redis import get_redis_connection
logger = logging.getLogger('cq')
def to_import_string(func):
if inspect.isfunction(func) or inspect.is... | import time
from contextlib import contextmanager
import six
import inspect
import importlib
import logging
from redis.exceptions import RedisError
from django_redis import get_redis_connection
logger = logging.getLogger('cq')
def to_import_string(func):
if inspect.isfunction(func) or inspect.isbuiltin(func):
... | import time
from contextlib import contextmanager
import six
import inspect
import importlib
import logging
from redis.exceptions import RedisError
from django_redis import get_redis_connection
logger = logging.getLogger('cq')
def to_import_string(func):
if inspect.isfunction(func) or inspect.isbuiltin(func):
... | <commit_before>import time
from contextlib import contextmanager
import six
import inspect
import importlib
import logging
from redis.exceptions import RedisError
from django_redis import get_redis_connection
logger = logging.getLogger('cq')
def to_import_string(func):
if inspect.isfunction(func) or inspect.is... |
3e4360e831d98dadca3f9346f324f3d17769257f | alg_selection_sort.py | alg_selection_sort.py | from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
def selection_sort(a_list):
"""Selection Sort algortihm.
Time complexity: O(n^2).
"""
for max_slot in reversed(range(len(a_list))):
select_slot = 0
for slot in range(1, max_slo... | from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
def selection_sort(ls):
"""Selection Sort algortihm.
Time complexity: O(n^2).
Space complexity: O(1).
"""
# Start from the last elemenet reversely: len(ls) - 1, ..., 0.
for i_max in re... | Refactor selection sort w/ adding comments | Refactor selection sort w/ adding comments
| Python | bsd-2-clause | bowen0701/algorithms_data_structures | from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
def selection_sort(a_list):
"""Selection Sort algortihm.
Time complexity: O(n^2).
"""
for max_slot in reversed(range(len(a_list))):
select_slot = 0
for slot in range(1, max_slo... | from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
def selection_sort(ls):
"""Selection Sort algortihm.
Time complexity: O(n^2).
Space complexity: O(1).
"""
# Start from the last elemenet reversely: len(ls) - 1, ..., 0.
for i_max in re... | <commit_before>from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
def selection_sort(a_list):
"""Selection Sort algortihm.
Time complexity: O(n^2).
"""
for max_slot in reversed(range(len(a_list))):
select_slot = 0
for slot in r... | from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
def selection_sort(ls):
"""Selection Sort algortihm.
Time complexity: O(n^2).
Space complexity: O(1).
"""
# Start from the last elemenet reversely: len(ls) - 1, ..., 0.
for i_max in re... | from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
def selection_sort(a_list):
"""Selection Sort algortihm.
Time complexity: O(n^2).
"""
for max_slot in reversed(range(len(a_list))):
select_slot = 0
for slot in range(1, max_slo... | <commit_before>from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
def selection_sort(a_list):
"""Selection Sort algortihm.
Time complexity: O(n^2).
"""
for max_slot in reversed(range(len(a_list))):
select_slot = 0
for slot in r... |
2555988a8eaf8e5620a8bf964092f23d1e309e91 | examples/traffic_light.py | examples/traffic_light.py | import statemachine as fsm
class TrafficLight(fsm.Machine):
initial_state = 'red'
count = 0
@fsm.after_transition('red', 'green')
def chime(self):
print 'GO GO GO'
self.count += 1
@fsm.after_transition('*', 'red')
def apply_brakes(self):
self.stopped = True
@fsm.... | from __future__ import print_function
import statemachine as fsm
class TrafficLight(fsm.Machine):
initial_state = 'red'
count = 0
@fsm.after_transition('red', 'green')
def chime(self):
print('GO GO GO')
self.count += 1
@fsm.after_transition('*', 'red')
def apply_brakes(self):
... | Use the print function for python 3 support | Use the print function for python 3 support
| Python | mit | kyleconroy/statemachine | import statemachine as fsm
class TrafficLight(fsm.Machine):
initial_state = 'red'
count = 0
@fsm.after_transition('red', 'green')
def chime(self):
print 'GO GO GO'
self.count += 1
@fsm.after_transition('*', 'red')
def apply_brakes(self):
self.stopped = True
@fsm.... | from __future__ import print_function
import statemachine as fsm
class TrafficLight(fsm.Machine):
initial_state = 'red'
count = 0
@fsm.after_transition('red', 'green')
def chime(self):
print('GO GO GO')
self.count += 1
@fsm.after_transition('*', 'red')
def apply_brakes(self):
... | <commit_before>import statemachine as fsm
class TrafficLight(fsm.Machine):
initial_state = 'red'
count = 0
@fsm.after_transition('red', 'green')
def chime(self):
print 'GO GO GO'
self.count += 1
@fsm.after_transition('*', 'red')
def apply_brakes(self):
self.stopped = ... | from __future__ import print_function
import statemachine as fsm
class TrafficLight(fsm.Machine):
initial_state = 'red'
count = 0
@fsm.after_transition('red', 'green')
def chime(self):
print('GO GO GO')
self.count += 1
@fsm.after_transition('*', 'red')
def apply_brakes(self):
... | import statemachine as fsm
class TrafficLight(fsm.Machine):
initial_state = 'red'
count = 0
@fsm.after_transition('red', 'green')
def chime(self):
print 'GO GO GO'
self.count += 1
@fsm.after_transition('*', 'red')
def apply_brakes(self):
self.stopped = True
@fsm.... | <commit_before>import statemachine as fsm
class TrafficLight(fsm.Machine):
initial_state = 'red'
count = 0
@fsm.after_transition('red', 'green')
def chime(self):
print 'GO GO GO'
self.count += 1
@fsm.after_transition('*', 'red')
def apply_brakes(self):
self.stopped = ... |
e6723a804803457f635307bd0de66175f00c8c0e | day1/part2.py | day1/part2.py | x = y = direction = 0
moves = open('input.txt', 'r').readline().strip().split(', ')
visited = set()
for move in moves:
if move[0] == 'L':
if direction == 0:
direction = 3
else:
direction -= 1
elif move[0] == 'R':
if direction == 3:
direction = 0
else:
direction += 1
dist = int(''.join(move[1:])... | x = y = direction = 0
moves = open('input.txt', 'r').readline().strip().split(', ')
visited = set((0, 0))
for move in moves:
if move[0] == 'L':
if direction == 0:
direction = 3
else:
direction -= 1
elif move[0] == 'R':
if direction == 3:
direction = 0
else:
direction += 1
dist = int(''.join(mov... | Add starting position to the list of visited locations | Add starting position to the list of visited locations
| Python | unlicense | ultramega/adventofcode2016 | x = y = direction = 0
moves = open('input.txt', 'r').readline().strip().split(', ')
visited = set()
for move in moves:
if move[0] == 'L':
if direction == 0:
direction = 3
else:
direction -= 1
elif move[0] == 'R':
if direction == 3:
direction = 0
else:
direction += 1
dist = int(''.join(move[1:])... | x = y = direction = 0
moves = open('input.txt', 'r').readline().strip().split(', ')
visited = set((0, 0))
for move in moves:
if move[0] == 'L':
if direction == 0:
direction = 3
else:
direction -= 1
elif move[0] == 'R':
if direction == 3:
direction = 0
else:
direction += 1
dist = int(''.join(mov... | <commit_before>x = y = direction = 0
moves = open('input.txt', 'r').readline().strip().split(', ')
visited = set()
for move in moves:
if move[0] == 'L':
if direction == 0:
direction = 3
else:
direction -= 1
elif move[0] == 'R':
if direction == 3:
direction = 0
else:
direction += 1
dist = int(''... | x = y = direction = 0
moves = open('input.txt', 'r').readline().strip().split(', ')
visited = set((0, 0))
for move in moves:
if move[0] == 'L':
if direction == 0:
direction = 3
else:
direction -= 1
elif move[0] == 'R':
if direction == 3:
direction = 0
else:
direction += 1
dist = int(''.join(mov... | x = y = direction = 0
moves = open('input.txt', 'r').readline().strip().split(', ')
visited = set()
for move in moves:
if move[0] == 'L':
if direction == 0:
direction = 3
else:
direction -= 1
elif move[0] == 'R':
if direction == 3:
direction = 0
else:
direction += 1
dist = int(''.join(move[1:])... | <commit_before>x = y = direction = 0
moves = open('input.txt', 'r').readline().strip().split(', ')
visited = set()
for move in moves:
if move[0] == 'L':
if direction == 0:
direction = 3
else:
direction -= 1
elif move[0] == 'R':
if direction == 3:
direction = 0
else:
direction += 1
dist = int(''... |
8ada9ee4b394119a73de8d85a9db2be9df547aae | lib/pegasus/python/Pegasus/cli/startup-validation.py | lib/pegasus/python/Pegasus/cli/startup-validation.py | #!/usr/bin/python3
import sys
if not sys.version_info >= (3, 5):
sys.stderr.write('Pegasus requires Python 3.5 or above\n')
sys.exit(1)
try:
import yaml
except:
sys.stderr.write('Pegasus requires the Python3 YAML module to be installed\n')
sys.exit(1)
try:
import OpenSSL
except:
sys.stde... | #!/usr/bin/python3
import sys
if not sys.version_info >= (3, 5):
sys.stderr.write("Pegasus requires Python 3.5 or above\n")
sys.exit(1)
try:
import yaml
except:
sys.stderr.write("Pegasus requires the Python3 YAML module to be installed\n")
sys.exit(1)
| Remove check for pyOpenSSL as it is only needed in pegasus-service to use ssl certs. | Remove check for pyOpenSSL as it is only needed in pegasus-service to use ssl certs.
| Python | apache-2.0 | pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus | #!/usr/bin/python3
import sys
if not sys.version_info >= (3, 5):
sys.stderr.write('Pegasus requires Python 3.5 or above\n')
sys.exit(1)
try:
import yaml
except:
sys.stderr.write('Pegasus requires the Python3 YAML module to be installed\n')
sys.exit(1)
try:
import OpenSSL
except:
sys.stde... | #!/usr/bin/python3
import sys
if not sys.version_info >= (3, 5):
sys.stderr.write("Pegasus requires Python 3.5 or above\n")
sys.exit(1)
try:
import yaml
except:
sys.stderr.write("Pegasus requires the Python3 YAML module to be installed\n")
sys.exit(1)
| <commit_before>#!/usr/bin/python3
import sys
if not sys.version_info >= (3, 5):
sys.stderr.write('Pegasus requires Python 3.5 or above\n')
sys.exit(1)
try:
import yaml
except:
sys.stderr.write('Pegasus requires the Python3 YAML module to be installed\n')
sys.exit(1)
try:
import OpenSSL
excep... | #!/usr/bin/python3
import sys
if not sys.version_info >= (3, 5):
sys.stderr.write("Pegasus requires Python 3.5 or above\n")
sys.exit(1)
try:
import yaml
except:
sys.stderr.write("Pegasus requires the Python3 YAML module to be installed\n")
sys.exit(1)
| #!/usr/bin/python3
import sys
if not sys.version_info >= (3, 5):
sys.stderr.write('Pegasus requires Python 3.5 or above\n')
sys.exit(1)
try:
import yaml
except:
sys.stderr.write('Pegasus requires the Python3 YAML module to be installed\n')
sys.exit(1)
try:
import OpenSSL
except:
sys.stde... | <commit_before>#!/usr/bin/python3
import sys
if not sys.version_info >= (3, 5):
sys.stderr.write('Pegasus requires Python 3.5 or above\n')
sys.exit(1)
try:
import yaml
except:
sys.stderr.write('Pegasus requires the Python3 YAML module to be installed\n')
sys.exit(1)
try:
import OpenSSL
excep... |
c00f0f2c0f89b1596c73cb671ef7127ecf56150f | features/steps/sensors.py | features/steps/sensors.py | from behave import given, when, then
from mock import patch, call
from tinkerforge.ip_connection import IPConnection
from pytoon.models import Electricity, db
from pytoon.connection import BrickConnection
@given('we connect to the master brick')
@patch('pytoon.connection.IPConnection')
def step_impl(context, mock_cla... | from behave import given, when, then
from mock import patch, call
from tinkerforge.ip_connection import IPConnection
from pytoon.models import Electricity, db
from pytoon.connection import BrickConnection
@given('we connect to the master brick')
@patch('pytoon.connection.IPConnection')
def step_impl(context, mock_cla... | Create database if it doesn't exist | Create database if it doesn't exist
| Python | bsd-3-clause | marcoplaisier/pytoon,marcofinalist/pytoon,marcoplaisier/pytoon,marcofinalist/pytoon | from behave import given, when, then
from mock import patch, call
from tinkerforge.ip_connection import IPConnection
from pytoon.models import Electricity, db
from pytoon.connection import BrickConnection
@given('we connect to the master brick')
@patch('pytoon.connection.IPConnection')
def step_impl(context, mock_cla... | from behave import given, when, then
from mock import patch, call
from tinkerforge.ip_connection import IPConnection
from pytoon.models import Electricity, db
from pytoon.connection import BrickConnection
@given('we connect to the master brick')
@patch('pytoon.connection.IPConnection')
def step_impl(context, mock_cla... | <commit_before>from behave import given, when, then
from mock import patch, call
from tinkerforge.ip_connection import IPConnection
from pytoon.models import Electricity, db
from pytoon.connection import BrickConnection
@given('we connect to the master brick')
@patch('pytoon.connection.IPConnection')
def step_impl(co... | from behave import given, when, then
from mock import patch, call
from tinkerforge.ip_connection import IPConnection
from pytoon.models import Electricity, db
from pytoon.connection import BrickConnection
@given('we connect to the master brick')
@patch('pytoon.connection.IPConnection')
def step_impl(context, mock_cla... | from behave import given, when, then
from mock import patch, call
from tinkerforge.ip_connection import IPConnection
from pytoon.models import Electricity, db
from pytoon.connection import BrickConnection
@given('we connect to the master brick')
@patch('pytoon.connection.IPConnection')
def step_impl(context, mock_cla... | <commit_before>from behave import given, when, then
from mock import patch, call
from tinkerforge.ip_connection import IPConnection
from pytoon.models import Electricity, db
from pytoon.connection import BrickConnection
@given('we connect to the master brick')
@patch('pytoon.connection.IPConnection')
def step_impl(co... |
ef8a6616876ee044d07cf8f30b51af0cbb2bc7e4 | geozones/factories.py | geozones/factories.py | # coding: utf-8
import factory
import random
from .models import Location, Region
class RegionFactory(factory.Factory):
FACTORY_FOR = Region
name = factory.Sequence(lambda n: "Region_%s" % n)
cityId = factory.SubFactory(CityFactory)
slug = factory.LazyAttribute(lambda a: a.name.lower())
zoomLvl... | # coding: utf-8
import factory
import random
from .models import Location, Region
class RegionFactory(factory.Factory):
FACTORY_FOR = Region
name = factory.Sequence(lambda n: "Region_%s" % n)
slug = factory.LazyAttribute(lambda a: a.name.lower())
latitude = random.uniform(-90.0, 90.0)
longtitud... | Fix region factory to reflect region model | Fix region factory to reflect region model
| Python | mit | sarutobi/Rynda,sarutobi/Rynda,sarutobi/ritmserdtsa,sarutobi/flowofkindness,sarutobi/ritmserdtsa,sarutobi/Rynda,sarutobi/Rynda,sarutobi/flowofkindness,sarutobi/flowofkindness,sarutobi/flowofkindness,sarutobi/ritmserdtsa,sarutobi/ritmserdtsa | # coding: utf-8
import factory
import random
from .models import Location, Region
class RegionFactory(factory.Factory):
FACTORY_FOR = Region
name = factory.Sequence(lambda n: "Region_%s" % n)
cityId = factory.SubFactory(CityFactory)
slug = factory.LazyAttribute(lambda a: a.name.lower())
zoomLvl... | # coding: utf-8
import factory
import random
from .models import Location, Region
class RegionFactory(factory.Factory):
FACTORY_FOR = Region
name = factory.Sequence(lambda n: "Region_%s" % n)
slug = factory.LazyAttribute(lambda a: a.name.lower())
latitude = random.uniform(-90.0, 90.0)
longtitud... | <commit_before># coding: utf-8
import factory
import random
from .models import Location, Region
class RegionFactory(factory.Factory):
FACTORY_FOR = Region
name = factory.Sequence(lambda n: "Region_%s" % n)
cityId = factory.SubFactory(CityFactory)
slug = factory.LazyAttribute(lambda a: a.name.lower... | # coding: utf-8
import factory
import random
from .models import Location, Region
class RegionFactory(factory.Factory):
FACTORY_FOR = Region
name = factory.Sequence(lambda n: "Region_%s" % n)
slug = factory.LazyAttribute(lambda a: a.name.lower())
latitude = random.uniform(-90.0, 90.0)
longtitud... | # coding: utf-8
import factory
import random
from .models import Location, Region
class RegionFactory(factory.Factory):
FACTORY_FOR = Region
name = factory.Sequence(lambda n: "Region_%s" % n)
cityId = factory.SubFactory(CityFactory)
slug = factory.LazyAttribute(lambda a: a.name.lower())
zoomLvl... | <commit_before># coding: utf-8
import factory
import random
from .models import Location, Region
class RegionFactory(factory.Factory):
FACTORY_FOR = Region
name = factory.Sequence(lambda n: "Region_%s" % n)
cityId = factory.SubFactory(CityFactory)
slug = factory.LazyAttribute(lambda a: a.name.lower... |
03a95c87dde1a5b20658b3b61b4c4abc070e3bf3 | flowtype/commands/base.py | flowtype/commands/base.py | import abc
import sublime
import sublime_plugin
from ..helpers import is_js_source
class BaseCommand(sublime_plugin.TextCommand, metaclass=abc.ABCMeta):
"""Common properties and methods for children commands."""
def get_content(self):
"""Return file content."""
return self.view.substr(subli... | import sublime
import sublime_plugin
from ..helpers import is_js_source
class BaseCommand(sublime_plugin.TextCommand):
"""Common properties and methods for children commands."""
def get_content(self):
"""Return file content."""
return self.view.substr(sublime.Region(0, self.view.size()))
... | Fix travis by removing abc metaclass. | Fix travis by removing abc metaclass.
| Python | mit | Pegase745/sublime-flowtype | import abc
import sublime
import sublime_plugin
from ..helpers import is_js_source
class BaseCommand(sublime_plugin.TextCommand, metaclass=abc.ABCMeta):
"""Common properties and methods for children commands."""
def get_content(self):
"""Return file content."""
return self.view.substr(subli... | import sublime
import sublime_plugin
from ..helpers import is_js_source
class BaseCommand(sublime_plugin.TextCommand):
"""Common properties and methods for children commands."""
def get_content(self):
"""Return file content."""
return self.view.substr(sublime.Region(0, self.view.size()))
... | <commit_before>import abc
import sublime
import sublime_plugin
from ..helpers import is_js_source
class BaseCommand(sublime_plugin.TextCommand, metaclass=abc.ABCMeta):
"""Common properties and methods for children commands."""
def get_content(self):
"""Return file content."""
return self.vi... | import sublime
import sublime_plugin
from ..helpers import is_js_source
class BaseCommand(sublime_plugin.TextCommand):
"""Common properties and methods for children commands."""
def get_content(self):
"""Return file content."""
return self.view.substr(sublime.Region(0, self.view.size()))
... | import abc
import sublime
import sublime_plugin
from ..helpers import is_js_source
class BaseCommand(sublime_plugin.TextCommand, metaclass=abc.ABCMeta):
"""Common properties and methods for children commands."""
def get_content(self):
"""Return file content."""
return self.view.substr(subli... | <commit_before>import abc
import sublime
import sublime_plugin
from ..helpers import is_js_source
class BaseCommand(sublime_plugin.TextCommand, metaclass=abc.ABCMeta):
"""Common properties and methods for children commands."""
def get_content(self):
"""Return file content."""
return self.vi... |
c8962d382f52b172ebc3a0d562597936dcf902ba | fmn/web/default_config.py | fmn/web/default_config.py | SECRET_KEY = 'changeme please'
# TODO -- May I set this to true?
FAS_OPENID_CHECK_CERT = False
#ADMIN_GROUPS = ['sysadmin-web']
FMN_FEDORA_OPENID = 'https://id.fedoraproject.org'
| SECRET_KEY = 'changeme please'
# TODO -- May I set this to true?
FAS_OPENID_CHECK_CERT = False
#ADMIN_GROUPS = ['sysadmin-web']
FMN_FEDORA_OPENID = 'https://id.fedoraproject.org'
FMN_ALLOW_FAS_OPENID = True
FMN_ALLOW_GOOGLE_OPENID = True
FMN_ALLOW_YAHOO_OPENID = True
FMN_ALLOW_GENERIC_OPENID = True
| Add configuration keys to allow turning on/off easy access to openid servers | Add configuration keys to allow turning on/off easy access to openid servers | Python | lgpl-2.1 | jeremycline/fmn,jeremycline/fmn,jeremycline/fmn | SECRET_KEY = 'changeme please'
# TODO -- May I set this to true?
FAS_OPENID_CHECK_CERT = False
#ADMIN_GROUPS = ['sysadmin-web']
FMN_FEDORA_OPENID = 'https://id.fedoraproject.org'
Add configuration keys to allow turning on/off easy access to openid servers | SECRET_KEY = 'changeme please'
# TODO -- May I set this to true?
FAS_OPENID_CHECK_CERT = False
#ADMIN_GROUPS = ['sysadmin-web']
FMN_FEDORA_OPENID = 'https://id.fedoraproject.org'
FMN_ALLOW_FAS_OPENID = True
FMN_ALLOW_GOOGLE_OPENID = True
FMN_ALLOW_YAHOO_OPENID = True
FMN_ALLOW_GENERIC_OPENID = True
| <commit_before>SECRET_KEY = 'changeme please'
# TODO -- May I set this to true?
FAS_OPENID_CHECK_CERT = False
#ADMIN_GROUPS = ['sysadmin-web']
FMN_FEDORA_OPENID = 'https://id.fedoraproject.org'
<commit_msg>Add configuration keys to allow turning on/off easy access to openid servers<commit_after> | SECRET_KEY = 'changeme please'
# TODO -- May I set this to true?
FAS_OPENID_CHECK_CERT = False
#ADMIN_GROUPS = ['sysadmin-web']
FMN_FEDORA_OPENID = 'https://id.fedoraproject.org'
FMN_ALLOW_FAS_OPENID = True
FMN_ALLOW_GOOGLE_OPENID = True
FMN_ALLOW_YAHOO_OPENID = True
FMN_ALLOW_GENERIC_OPENID = True
| SECRET_KEY = 'changeme please'
# TODO -- May I set this to true?
FAS_OPENID_CHECK_CERT = False
#ADMIN_GROUPS = ['sysadmin-web']
FMN_FEDORA_OPENID = 'https://id.fedoraproject.org'
Add configuration keys to allow turning on/off easy access to openid serversSECRET_KEY = 'changeme please'
# TODO -- May I set this to tr... | <commit_before>SECRET_KEY = 'changeme please'
# TODO -- May I set this to true?
FAS_OPENID_CHECK_CERT = False
#ADMIN_GROUPS = ['sysadmin-web']
FMN_FEDORA_OPENID = 'https://id.fedoraproject.org'
<commit_msg>Add configuration keys to allow turning on/off easy access to openid servers<commit_after>SECRET_KEY = 'changem... |
c99ad137bd2251584d8529e3b7d06aea2ca25967 | app/logger.py | app/logger.py | import logging
from configs import EnjoliverConfig
formatter = logging.Formatter('\r%(levelname)-7s %(module)-13s %(funcName)s %(message)s')
consoleHandler = logging.StreamHandler()
consoleHandler.setLevel(logging.INFO)
consoleHandler.setFormatter(formatter)
ec = EnjoliverConfig()
def get_logger(name):
logger ... | import logging
from configs import EnjoliverConfig
formatter = logging.Formatter('\r%(levelname)-7s %(module)-13s %(funcName)s %(message)s')
ec = EnjoliverConfig()
def get_logger(name):
logger = logging.getLogger(name)
console_handler = logging.StreamHandler()
console_handler.setFormatter(formatter)
... | Fix the handler for the log level | Fix the handler for the log level
| Python | mit | nyodas/enjoliver,JulienBalestra/enjoliver,JulienBalestra/enjoliver,JulienBalestra/enjoliver,nyodas/enjoliver,kirek007/enjoliver,JulienBalestra/enjoliver,nyodas/enjoliver,nyodas/enjoliver,kirek007/enjoliver,nyodas/enjoliver,kirek007/enjoliver,kirek007/enjoliver,JulienBalestra/enjoliver,kirek007/enjoliver | import logging
from configs import EnjoliverConfig
formatter = logging.Formatter('\r%(levelname)-7s %(module)-13s %(funcName)s %(message)s')
consoleHandler = logging.StreamHandler()
consoleHandler.setLevel(logging.INFO)
consoleHandler.setFormatter(formatter)
ec = EnjoliverConfig()
def get_logger(name):
logger ... | import logging
from configs import EnjoliverConfig
formatter = logging.Formatter('\r%(levelname)-7s %(module)-13s %(funcName)s %(message)s')
ec = EnjoliverConfig()
def get_logger(name):
logger = logging.getLogger(name)
console_handler = logging.StreamHandler()
console_handler.setFormatter(formatter)
... | <commit_before>import logging
from configs import EnjoliverConfig
formatter = logging.Formatter('\r%(levelname)-7s %(module)-13s %(funcName)s %(message)s')
consoleHandler = logging.StreamHandler()
consoleHandler.setLevel(logging.INFO)
consoleHandler.setFormatter(formatter)
ec = EnjoliverConfig()
def get_logger(nam... | import logging
from configs import EnjoliverConfig
formatter = logging.Formatter('\r%(levelname)-7s %(module)-13s %(funcName)s %(message)s')
ec = EnjoliverConfig()
def get_logger(name):
logger = logging.getLogger(name)
console_handler = logging.StreamHandler()
console_handler.setFormatter(formatter)
... | import logging
from configs import EnjoliverConfig
formatter = logging.Formatter('\r%(levelname)-7s %(module)-13s %(funcName)s %(message)s')
consoleHandler = logging.StreamHandler()
consoleHandler.setLevel(logging.INFO)
consoleHandler.setFormatter(formatter)
ec = EnjoliverConfig()
def get_logger(name):
logger ... | <commit_before>import logging
from configs import EnjoliverConfig
formatter = logging.Formatter('\r%(levelname)-7s %(module)-13s %(funcName)s %(message)s')
consoleHandler = logging.StreamHandler()
consoleHandler.setLevel(logging.INFO)
consoleHandler.setFormatter(formatter)
ec = EnjoliverConfig()
def get_logger(nam... |
93c978ba422b26971180a4277a0b69e82848ee78 | src/yunohost/data_migrations/0009_migrate_to_apps_json.py | src/yunohost/data_migrations/0009_migrate_to_apps_json.py | from moulinette.utils.log import getActionLogger
from yunohost.app import app_fetchlist, app_removelist, _read_appslist_list
from yunohost.tools import Migration
logger = getActionLogger('yunohost.migration')
class MyMigration(Migration):
"Migrate from official.json to apps.json"
def migrate(self):
... | import os
from moulinette.utils.log import getActionLogger
from yunohost.app import app_fetchlist, app_removelist, _read_appslist_list, APPSLISTS_JSON
from yunohost.tools import Migration
logger = getActionLogger('yunohost.migration')
BASE_CONF_PATH = '/home/yunohost.conf'
BACKUP_CONF_DIR = os.path.join(BASE_CONF_PA... | Backup / restore original appslist to handle backward case properly | Backup / restore original appslist to handle backward case properly
| Python | agpl-3.0 | YunoHost/moulinette-yunohost,YunoHost/yunohost,YunoHost/yunohost,YunoHost/moulinette-yunohost,YunoHost/moulinette-yunohost,YunoHost/moulinette-yunohost,YunoHost/moulinette-yunohost,YunoHost/yunohost,YunoHost/yunohost | from moulinette.utils.log import getActionLogger
from yunohost.app import app_fetchlist, app_removelist, _read_appslist_list
from yunohost.tools import Migration
logger = getActionLogger('yunohost.migration')
class MyMigration(Migration):
"Migrate from official.json to apps.json"
def migrate(self):
... | import os
from moulinette.utils.log import getActionLogger
from yunohost.app import app_fetchlist, app_removelist, _read_appslist_list, APPSLISTS_JSON
from yunohost.tools import Migration
logger = getActionLogger('yunohost.migration')
BASE_CONF_PATH = '/home/yunohost.conf'
BACKUP_CONF_DIR = os.path.join(BASE_CONF_PA... | <commit_before>from moulinette.utils.log import getActionLogger
from yunohost.app import app_fetchlist, app_removelist, _read_appslist_list
from yunohost.tools import Migration
logger = getActionLogger('yunohost.migration')
class MyMigration(Migration):
"Migrate from official.json to apps.json"
def migrate(... | import os
from moulinette.utils.log import getActionLogger
from yunohost.app import app_fetchlist, app_removelist, _read_appslist_list, APPSLISTS_JSON
from yunohost.tools import Migration
logger = getActionLogger('yunohost.migration')
BASE_CONF_PATH = '/home/yunohost.conf'
BACKUP_CONF_DIR = os.path.join(BASE_CONF_PA... | from moulinette.utils.log import getActionLogger
from yunohost.app import app_fetchlist, app_removelist, _read_appslist_list
from yunohost.tools import Migration
logger = getActionLogger('yunohost.migration')
class MyMigration(Migration):
"Migrate from official.json to apps.json"
def migrate(self):
... | <commit_before>from moulinette.utils.log import getActionLogger
from yunohost.app import app_fetchlist, app_removelist, _read_appslist_list
from yunohost.tools import Migration
logger = getActionLogger('yunohost.migration')
class MyMigration(Migration):
"Migrate from official.json to apps.json"
def migrate(... |
b4f2d120c600cbbd3696766473e6cd18cb597728 | src/evesrp/util/models.py | src/evesrp/util/models.py | from __future__ import absolute_import
from __future__ import unicode_literals
import datetime as dt
from sqlalchemy.types import DateTime
from sqlalchemy.ext.declarative import declared_attr
from .datetime import DateTime
from .datetime import utc
from .. import db
class AutoID(object):
"""Mixin adding a primary... | from __future__ import absolute_import
from __future__ import unicode_literals
import datetime as dt
from sqlalchemy.types import DateTime
from sqlalchemy.ext.declarative import declared_attr
from .datetime import DateTime
from .datetime import utc
from .. import db
class AutoID(object):
"""Mixin adding a primary... | Fix typo in getting superclass of AutoID | Fix typo in getting superclass of AutoID | Python | bsd-2-clause | paxswill/evesrp,paxswill/evesrp,paxswill/evesrp | from __future__ import absolute_import
from __future__ import unicode_literals
import datetime as dt
from sqlalchemy.types import DateTime
from sqlalchemy.ext.declarative import declared_attr
from .datetime import DateTime
from .datetime import utc
from .. import db
class AutoID(object):
"""Mixin adding a primary... | from __future__ import absolute_import
from __future__ import unicode_literals
import datetime as dt
from sqlalchemy.types import DateTime
from sqlalchemy.ext.declarative import declared_attr
from .datetime import DateTime
from .datetime import utc
from .. import db
class AutoID(object):
"""Mixin adding a primary... | <commit_before>from __future__ import absolute_import
from __future__ import unicode_literals
import datetime as dt
from sqlalchemy.types import DateTime
from sqlalchemy.ext.declarative import declared_attr
from .datetime import DateTime
from .datetime import utc
from .. import db
class AutoID(object):
"""Mixin a... | from __future__ import absolute_import
from __future__ import unicode_literals
import datetime as dt
from sqlalchemy.types import DateTime
from sqlalchemy.ext.declarative import declared_attr
from .datetime import DateTime
from .datetime import utc
from .. import db
class AutoID(object):
"""Mixin adding a primary... | from __future__ import absolute_import
from __future__ import unicode_literals
import datetime as dt
from sqlalchemy.types import DateTime
from sqlalchemy.ext.declarative import declared_attr
from .datetime import DateTime
from .datetime import utc
from .. import db
class AutoID(object):
"""Mixin adding a primary... | <commit_before>from __future__ import absolute_import
from __future__ import unicode_literals
import datetime as dt
from sqlalchemy.types import DateTime
from sqlalchemy.ext.declarative import declared_attr
from .datetime import DateTime
from .datetime import utc
from .. import db
class AutoID(object):
"""Mixin a... |
92ecaea827da56a15297ffc240312b1767ebb845 | ibmcnx/doc/DataSources.py | ibmcnx/doc/DataSources.py | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: [email protected]
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: [email protected]
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | Create documentation of DataSource Settings | 8: Create documentation of DataSource Settings
Task-Url: http://github.com/stoeps13/ibmcnx2/issues/issue/8 | Python | apache-2.0 | stoeps13/ibmcnx2,stoeps13/ibmcnx2 | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: [email protected]
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: [email protected]
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | <commit_before>######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: [email protected]
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Co... | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: [email protected]
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: [email protected]
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | <commit_before>######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: [email protected]
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Co... |
b2e1fd5727eed1818d0ddc3c29a1cf9f7e38d024 | wger/exercises/management/commands/submitted-exercises.py | wger/exercises/management/commands/submitted-exercises.py | # -*- coding: utf-8 *-*
# This file is part of wger Workout Manager.
#
# wger Workout Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any ... | # -*- coding: utf-8 *-*
# This file is part of wger Workout Manager.
#
# wger Workout Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any ... | Fix management command for submitted exercises | Fix management command for submitted exercises
| Python | agpl-3.0 | DeveloperMal/wger,kjagoo/wger_stark,rolandgeider/wger,rolandgeider/wger,DeveloperMal/wger,petervanderdoes/wger,kjagoo/wger_stark,wger-project/wger,wger-project/wger,petervanderdoes/wger,wger-project/wger,kjagoo/wger_stark,rolandgeider/wger,rolandgeider/wger,petervanderdoes/wger,DeveloperMal/wger,DeveloperMal/wger,wger-... | # -*- coding: utf-8 *-*
# This file is part of wger Workout Manager.
#
# wger Workout Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any ... | # -*- coding: utf-8 *-*
# This file is part of wger Workout Manager.
#
# wger Workout Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any ... | <commit_before># -*- coding: utf-8 *-*
# This file is part of wger Workout Manager.
#
# wger Workout Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at yo... | # -*- coding: utf-8 *-*
# This file is part of wger Workout Manager.
#
# wger Workout Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any ... | # -*- coding: utf-8 *-*
# This file is part of wger Workout Manager.
#
# wger Workout Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any ... | <commit_before># -*- coding: utf-8 *-*
# This file is part of wger Workout Manager.
#
# wger Workout Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at yo... |
1004cc88032e816116bd46f2eb66e4b89f3f766f | tests/test_web_caller.py | tests/test_web_caller.py | from unittest import TestCase
from mock import NonCallableMock, patch
from modules.web_caller import get_google, GOOGLE_URL
class TestWebCaller(TestCase):
"""
Tests for the `web_caller` module.
"""
@patch('modules.web_caller.requests.get')
def test_get_google(self, get):
"""
Call... | from unittest import TestCase
from requests.exceptions import ConnectionError
from mock import NonCallableMock, patch
from modules.web_caller import get_google, GOOGLE_URL
MOCK_GOOGLE_URL = 'http://not-going-to-work!!!'
class TestWebCaller(TestCase):
"""
Tests for the `web_caller` module.
"""
@patc... | Add test examples to assert against exceptions | Add test examples to assert against exceptions
| Python | mit | tkh/test-examples,tkh/test-examples | from unittest import TestCase
from mock import NonCallableMock, patch
from modules.web_caller import get_google, GOOGLE_URL
class TestWebCaller(TestCase):
"""
Tests for the `web_caller` module.
"""
@patch('modules.web_caller.requests.get')
def test_get_google(self, get):
"""
Call... | from unittest import TestCase
from requests.exceptions import ConnectionError
from mock import NonCallableMock, patch
from modules.web_caller import get_google, GOOGLE_URL
MOCK_GOOGLE_URL = 'http://not-going-to-work!!!'
class TestWebCaller(TestCase):
"""
Tests for the `web_caller` module.
"""
@patc... | <commit_before>from unittest import TestCase
from mock import NonCallableMock, patch
from modules.web_caller import get_google, GOOGLE_URL
class TestWebCaller(TestCase):
"""
Tests for the `web_caller` module.
"""
@patch('modules.web_caller.requests.get')
def test_get_google(self, get):
"... | from unittest import TestCase
from requests.exceptions import ConnectionError
from mock import NonCallableMock, patch
from modules.web_caller import get_google, GOOGLE_URL
MOCK_GOOGLE_URL = 'http://not-going-to-work!!!'
class TestWebCaller(TestCase):
"""
Tests for the `web_caller` module.
"""
@patc... | from unittest import TestCase
from mock import NonCallableMock, patch
from modules.web_caller import get_google, GOOGLE_URL
class TestWebCaller(TestCase):
"""
Tests for the `web_caller` module.
"""
@patch('modules.web_caller.requests.get')
def test_get_google(self, get):
"""
Call... | <commit_before>from unittest import TestCase
from mock import NonCallableMock, patch
from modules.web_caller import get_google, GOOGLE_URL
class TestWebCaller(TestCase):
"""
Tests for the `web_caller` module.
"""
@patch('modules.web_caller.requests.get')
def test_get_google(self, get):
"... |
e82045217fa262fbfe30563fef9945a67024d27f | project/creditor/management/commands/addrecurring.py | project/creditor/management/commands/addrecurring.py | # -*- coding: utf-8 -*-
from creditor.models import RecurringTransaction
from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
help = 'Gets all RecurringTransactions and runs conditional_add_transaction()'
def handle(self, *args, **options):
for t in RecurringT... | # -*- coding: utf-8 -*-
import datetime
import itertools
import dateutil.parser
from creditor.models import RecurringTransaction
from django.core.management.base import BaseCommand, CommandError
from django.utils import timezone
from asylum.utils import datetime_proxy, months
class Command(BaseCommand):
help = ... | Add "since" parameter to this command | Add "since" parameter to this command
Fixes #25
| Python | mit | HelsinkiHacklab/asylum,hacklab-fi/asylum,rambo/asylum,rambo/asylum,HelsinkiHacklab/asylum,jautero/asylum,hacklab-fi/asylum,HelsinkiHacklab/asylum,rambo/asylum,HelsinkiHacklab/asylum,jautero/asylum,jautero/asylum,jautero/asylum,hacklab-fi/asylum,hacklab-fi/asylum,rambo/asylum | # -*- coding: utf-8 -*-
from creditor.models import RecurringTransaction
from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
help = 'Gets all RecurringTransactions and runs conditional_add_transaction()'
def handle(self, *args, **options):
for t in RecurringT... | # -*- coding: utf-8 -*-
import datetime
import itertools
import dateutil.parser
from creditor.models import RecurringTransaction
from django.core.management.base import BaseCommand, CommandError
from django.utils import timezone
from asylum.utils import datetime_proxy, months
class Command(BaseCommand):
help = ... | <commit_before># -*- coding: utf-8 -*-
from creditor.models import RecurringTransaction
from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
help = 'Gets all RecurringTransactions and runs conditional_add_transaction()'
def handle(self, *args, **options):
for ... | # -*- coding: utf-8 -*-
import datetime
import itertools
import dateutil.parser
from creditor.models import RecurringTransaction
from django.core.management.base import BaseCommand, CommandError
from django.utils import timezone
from asylum.utils import datetime_proxy, months
class Command(BaseCommand):
help = ... | # -*- coding: utf-8 -*-
from creditor.models import RecurringTransaction
from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
help = 'Gets all RecurringTransactions and runs conditional_add_transaction()'
def handle(self, *args, **options):
for t in RecurringT... | <commit_before># -*- coding: utf-8 -*-
from creditor.models import RecurringTransaction
from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
help = 'Gets all RecurringTransactions and runs conditional_add_transaction()'
def handle(self, *args, **options):
for ... |
a9fb3353c32a9b53b8e58912a98cf61176a57f04 | test/test_molecule.py | test/test_molecule.py | import pytest
import os
import shutil
from subprocess import call
from cookiecutter.main import cookiecutter
playbook_setup_commands = ['pip install -r https://raw.githubusercontent.com/nephelaiio/ansible-role-requirements/master/requirements.txt']
playbook_setup_success = 0
playbook_test_command = "molecule test"
pl... | import pytest
import os
import shutil
from subprocess import call
from cookiecutter.main import cookiecutter
playbook_setup_commands = ['pip install -r https://raw.githubusercontent.com/nephelaiio/ansible-role-requirements/molecule3/requirements.txt']
playbook_setup_success = 0
playbook_test_command = "molecule test"... | Update tests for molecule 3 compatibility | Update tests for molecule 3 compatibility
| Python | mit | nephelaiio/cookiecutter-ansible-role | import pytest
import os
import shutil
from subprocess import call
from cookiecutter.main import cookiecutter
playbook_setup_commands = ['pip install -r https://raw.githubusercontent.com/nephelaiio/ansible-role-requirements/master/requirements.txt']
playbook_setup_success = 0
playbook_test_command = "molecule test"
pl... | import pytest
import os
import shutil
from subprocess import call
from cookiecutter.main import cookiecutter
playbook_setup_commands = ['pip install -r https://raw.githubusercontent.com/nephelaiio/ansible-role-requirements/molecule3/requirements.txt']
playbook_setup_success = 0
playbook_test_command = "molecule test"... | <commit_before>import pytest
import os
import shutil
from subprocess import call
from cookiecutter.main import cookiecutter
playbook_setup_commands = ['pip install -r https://raw.githubusercontent.com/nephelaiio/ansible-role-requirements/master/requirements.txt']
playbook_setup_success = 0
playbook_test_command = "mo... | import pytest
import os
import shutil
from subprocess import call
from cookiecutter.main import cookiecutter
playbook_setup_commands = ['pip install -r https://raw.githubusercontent.com/nephelaiio/ansible-role-requirements/molecule3/requirements.txt']
playbook_setup_success = 0
playbook_test_command = "molecule test"... | import pytest
import os
import shutil
from subprocess import call
from cookiecutter.main import cookiecutter
playbook_setup_commands = ['pip install -r https://raw.githubusercontent.com/nephelaiio/ansible-role-requirements/master/requirements.txt']
playbook_setup_success = 0
playbook_test_command = "molecule test"
pl... | <commit_before>import pytest
import os
import shutil
from subprocess import call
from cookiecutter.main import cookiecutter
playbook_setup_commands = ['pip install -r https://raw.githubusercontent.com/nephelaiio/ansible-role-requirements/master/requirements.txt']
playbook_setup_success = 0
playbook_test_command = "mo... |
ade2562d3ba731aed66542c00f4465b698d0a999 | grammpy/Rules/__init__.py | grammpy/Rules/__init__.py | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 16.08.2017 19:28
:Licence GNUv3
Part of grammpy
"""
from .RuleChainable import RuleConnectable
from .Rule import Rule
| #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 16.08.2017 19:28
:Licence GNUv3
Part of grammpy
"""
from .RuleConnectable import RuleConnectable
from .Rule import Rule
| FIX import of RuleConnectable instead of RuleChainable | FIX import of RuleConnectable instead of RuleChainable
| Python | mit | PatrikValkovic/grammpy | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 16.08.2017 19:28
:Licence GNUv3
Part of grammpy
"""
from .RuleChainable import RuleConnectable
from .Rule import Rule
FIX import of RuleConnectable instead of RuleChainable | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 16.08.2017 19:28
:Licence GNUv3
Part of grammpy
"""
from .RuleConnectable import RuleConnectable
from .Rule import Rule
| <commit_before>#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 16.08.2017 19:28
:Licence GNUv3
Part of grammpy
"""
from .RuleChainable import RuleConnectable
from .Rule import Rule
<commit_msg>FIX import of RuleConnectable instead of RuleChainable<commit_after> | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 16.08.2017 19:28
:Licence GNUv3
Part of grammpy
"""
from .RuleConnectable import RuleConnectable
from .Rule import Rule
| #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 16.08.2017 19:28
:Licence GNUv3
Part of grammpy
"""
from .RuleChainable import RuleConnectable
from .Rule import Rule
FIX import of RuleConnectable instead of RuleChainable#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 16.08.2017 19:28
:Licence G... | <commit_before>#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 16.08.2017 19:28
:Licence GNUv3
Part of grammpy
"""
from .RuleChainable import RuleConnectable
from .Rule import Rule
<commit_msg>FIX import of RuleConnectable instead of RuleChainable<commit_after>#!/usr/bin/env python
"""
:Author Patrik Valk... |
8fbb173a11bee6eb7178b8276a594af4d3473442 | python/setup.py | python/setup.py | from distutils.core import setup
setup(
name = 'fancypants',
version = '1.1',
py_modules = ['fancypants'],
url = 'http://netcetera.org/',
author = 'Simon Whitaker',
author_email = '[email protected]',
description = 'A collection of data vis... | from distutils.core import setup
setup(
name = 'fancypants',
version = '1.2',
py_modules = ['fancypants'],
url = 'http://netcetera.org/',
author = 'Simon Whitaker',
author_email = '[email protected]',
description = 'A collection of data vis... | Increment version number to 1.2 | Increment version number to 1.2
| Python | unlicense | simonwhitaker/fancypants,simonwhitaker/fancypants | from distutils.core import setup
setup(
name = 'fancypants',
version = '1.1',
py_modules = ['fancypants'],
url = 'http://netcetera.org/',
author = 'Simon Whitaker',
author_email = '[email protected]',
description = 'A collection of data vis... | from distutils.core import setup
setup(
name = 'fancypants',
version = '1.2',
py_modules = ['fancypants'],
url = 'http://netcetera.org/',
author = 'Simon Whitaker',
author_email = '[email protected]',
description = 'A collection of data vis... | <commit_before>from distutils.core import setup
setup(
name = 'fancypants',
version = '1.1',
py_modules = ['fancypants'],
url = 'http://netcetera.org/',
author = 'Simon Whitaker',
author_email = '[email protected]',
description = 'A collect... | from distutils.core import setup
setup(
name = 'fancypants',
version = '1.2',
py_modules = ['fancypants'],
url = 'http://netcetera.org/',
author = 'Simon Whitaker',
author_email = '[email protected]',
description = 'A collection of data vis... | from distutils.core import setup
setup(
name = 'fancypants',
version = '1.1',
py_modules = ['fancypants'],
url = 'http://netcetera.org/',
author = 'Simon Whitaker',
author_email = '[email protected]',
description = 'A collection of data vis... | <commit_before>from distutils.core import setup
setup(
name = 'fancypants',
version = '1.1',
py_modules = ['fancypants'],
url = 'http://netcetera.org/',
author = 'Simon Whitaker',
author_email = '[email protected]',
description = 'A collect... |
8f7640fd5a145dba724974ca5a46f73b9c991c45 | cloud_notes/templatetags/markdown_filters.py | cloud_notes/templatetags/markdown_filters.py | from django import template
import markdown as md
import bleach
register = template.Library()
def markdown(value):
"""convert to markdown"""
return md.markdown(bleach.clean(value))
register.filter('markdown', markdown) | from django import template
import markdown as md
import bleach
import copy
register = template.Library()
def markdown(value):
"""convert to markdown"""
allowed_tags = bleach.ALLOWED_TAGS + ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6']
return bleach.clean(md.markdown(value), tags = allowed_tags)
register... | Fix blockquote missing from markdown filter | Fix blockquote missing from markdown filter
| Python | apache-2.0 | kiwiheretic/logos-v2,kiwiheretic/logos-v2,kiwiheretic/logos-v2,kiwiheretic/logos-v2 | from django import template
import markdown as md
import bleach
register = template.Library()
def markdown(value):
"""convert to markdown"""
return md.markdown(bleach.clean(value))
register.filter('markdown', markdown)Fix blockquote missing from markdown filter | from django import template
import markdown as md
import bleach
import copy
register = template.Library()
def markdown(value):
"""convert to markdown"""
allowed_tags = bleach.ALLOWED_TAGS + ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6']
return bleach.clean(md.markdown(value), tags = allowed_tags)
register... | <commit_before>from django import template
import markdown as md
import bleach
register = template.Library()
def markdown(value):
"""convert to markdown"""
return md.markdown(bleach.clean(value))
register.filter('markdown', markdown)<commit_msg>Fix blockquote missing from markdown filter<commit_after> | from django import template
import markdown as md
import bleach
import copy
register = template.Library()
def markdown(value):
"""convert to markdown"""
allowed_tags = bleach.ALLOWED_TAGS + ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6']
return bleach.clean(md.markdown(value), tags = allowed_tags)
register... | from django import template
import markdown as md
import bleach
register = template.Library()
def markdown(value):
"""convert to markdown"""
return md.markdown(bleach.clean(value))
register.filter('markdown', markdown)Fix blockquote missing from markdown filterfrom django import template
import markdown ... | <commit_before>from django import template
import markdown as md
import bleach
register = template.Library()
def markdown(value):
"""convert to markdown"""
return md.markdown(bleach.clean(value))
register.filter('markdown', markdown)<commit_msg>Fix blockquote missing from markdown filter<commit_after>fro... |
ec1f7db3f1bd637807b4b9d69a0b702af36fbef1 | morenines/ignores.py | morenines/ignores.py | import os
from fnmatch import fnmatchcase
import click
class Ignores(object):
@classmethod
def read(cls, path):
ignores = cls()
if path:
with click.open_file(path, 'r') as stream:
ignores.patterns = [line.strip() for line in stream]
return ignores
... | import os
from fnmatch import fnmatchcase
import click
from morenines.util import find_file
class Ignores(object):
@classmethod
def read(cls, path):
if not path:
path = find_file('.mnignore')
ignores = cls()
if path:
with click.open_file(path, 'r') as stream:... | Make Ignores try to find '.mnignore' | Make Ignores try to find '.mnignore'
If it doesn't find it, that's okay, and no action is required.
| Python | mit | mcgid/morenines,mcgid/morenines | import os
from fnmatch import fnmatchcase
import click
class Ignores(object):
@classmethod
def read(cls, path):
ignores = cls()
if path:
with click.open_file(path, 'r') as stream:
ignores.patterns = [line.strip() for line in stream]
return ignores
... | import os
from fnmatch import fnmatchcase
import click
from morenines.util import find_file
class Ignores(object):
@classmethod
def read(cls, path):
if not path:
path = find_file('.mnignore')
ignores = cls()
if path:
with click.open_file(path, 'r') as stream:... | <commit_before>import os
from fnmatch import fnmatchcase
import click
class Ignores(object):
@classmethod
def read(cls, path):
ignores = cls()
if path:
with click.open_file(path, 'r') as stream:
ignores.patterns = [line.strip() for line in stream]
return ig... | import os
from fnmatch import fnmatchcase
import click
from morenines.util import find_file
class Ignores(object):
@classmethod
def read(cls, path):
if not path:
path = find_file('.mnignore')
ignores = cls()
if path:
with click.open_file(path, 'r') as stream:... | import os
from fnmatch import fnmatchcase
import click
class Ignores(object):
@classmethod
def read(cls, path):
ignores = cls()
if path:
with click.open_file(path, 'r') as stream:
ignores.patterns = [line.strip() for line in stream]
return ignores
... | <commit_before>import os
from fnmatch import fnmatchcase
import click
class Ignores(object):
@classmethod
def read(cls, path):
ignores = cls()
if path:
with click.open_file(path, 'r') as stream:
ignores.patterns = [line.strip() for line in stream]
return ig... |
9a81879bd4eb01be5ed74acfdaf22acb635a9817 | pikalang/__init__.py | pikalang/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""pikalang module.
A brainfuck derivative based off the vocabulary of Pikachu from Pokemon.
Copyright (c) 2019 Blake Grotewold
"""
import sys
import os
from pikalang.interpreter import PikalangProgram
def load_source(file):
if os.path.isfile(file):
if os.p... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""pikalang module.
A brainfuck derivative based off the vocabulary of Pikachu from Pokemon.
Copyright (c) 2019 Blake Grotewold
"""
from __future__ import print_function
import sys
import os
from pikalang.interpreter import PikalangProgram
def load_source(file):
i... | Add proper printing for py2 | Add proper printing for py2
| Python | mit | groteworld/pikalang,grotewold/pikalang | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""pikalang module.
A brainfuck derivative based off the vocabulary of Pikachu from Pokemon.
Copyright (c) 2019 Blake Grotewold
"""
import sys
import os
from pikalang.interpreter import PikalangProgram
def load_source(file):
if os.path.isfile(file):
if os.p... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""pikalang module.
A brainfuck derivative based off the vocabulary of Pikachu from Pokemon.
Copyright (c) 2019 Blake Grotewold
"""
from __future__ import print_function
import sys
import os
from pikalang.interpreter import PikalangProgram
def load_source(file):
i... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""pikalang module.
A brainfuck derivative based off the vocabulary of Pikachu from Pokemon.
Copyright (c) 2019 Blake Grotewold
"""
import sys
import os
from pikalang.interpreter import PikalangProgram
def load_source(file):
if os.path.isfile(file):
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""pikalang module.
A brainfuck derivative based off the vocabulary of Pikachu from Pokemon.
Copyright (c) 2019 Blake Grotewold
"""
from __future__ import print_function
import sys
import os
from pikalang.interpreter import PikalangProgram
def load_source(file):
i... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""pikalang module.
A brainfuck derivative based off the vocabulary of Pikachu from Pokemon.
Copyright (c) 2019 Blake Grotewold
"""
import sys
import os
from pikalang.interpreter import PikalangProgram
def load_source(file):
if os.path.isfile(file):
if os.p... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""pikalang module.
A brainfuck derivative based off the vocabulary of Pikachu from Pokemon.
Copyright (c) 2019 Blake Grotewold
"""
import sys
import os
from pikalang.interpreter import PikalangProgram
def load_source(file):
if os.path.isfile(file):
... |
07ae9397835bc064d0119d2f35b2c1255597ea63 | dipy/io/tests/test_utils.py | dipy/io/tests/test_utils.py |
from dipy.io.utils import decfa
from nibabel import Nifti1Image
import numpy as np
def test_decfa():
data_orig = np.zeros((4, 4, 4, 3))
data_orig[0, 0, 0] = np.array([1, 0, 0])
img_orig = Nifti1Image(data_orig, np.eye(4))
img_new = decfa(img_orig)
data_new = img_new.get_data()
assert data_new[... | from dipy.io.utils import decfa
from nibabel import Nifti1Image
import numpy as np
def test_decfa():
data_orig = np.zeros((4, 4, 4, 3))
data_orig[0, 0, 0] = np.array([1, 0, 0])
img_orig = Nifti1Image(data_orig, np.eye(4))
img_new = decfa(img_orig)
data_new = img_new.get_data()
assert data_new[0... | Test properly, including the dtype. | TST: Test properly, including the dtype.
| Python | bsd-3-clause | FrancoisRheaultUS/dipy,FrancoisRheaultUS/dipy |
from dipy.io.utils import decfa
from nibabel import Nifti1Image
import numpy as np
def test_decfa():
data_orig = np.zeros((4, 4, 4, 3))
data_orig[0, 0, 0] = np.array([1, 0, 0])
img_orig = Nifti1Image(data_orig, np.eye(4))
img_new = decfa(img_orig)
data_new = img_new.get_data()
assert data_new[... | from dipy.io.utils import decfa
from nibabel import Nifti1Image
import numpy as np
def test_decfa():
data_orig = np.zeros((4, 4, 4, 3))
data_orig[0, 0, 0] = np.array([1, 0, 0])
img_orig = Nifti1Image(data_orig, np.eye(4))
img_new = decfa(img_orig)
data_new = img_new.get_data()
assert data_new[0... | <commit_before>
from dipy.io.utils import decfa
from nibabel import Nifti1Image
import numpy as np
def test_decfa():
data_orig = np.zeros((4, 4, 4, 3))
data_orig[0, 0, 0] = np.array([1, 0, 0])
img_orig = Nifti1Image(data_orig, np.eye(4))
img_new = decfa(img_orig)
data_new = img_new.get_data()
a... | from dipy.io.utils import decfa
from nibabel import Nifti1Image
import numpy as np
def test_decfa():
data_orig = np.zeros((4, 4, 4, 3))
data_orig[0, 0, 0] = np.array([1, 0, 0])
img_orig = Nifti1Image(data_orig, np.eye(4))
img_new = decfa(img_orig)
data_new = img_new.get_data()
assert data_new[0... |
from dipy.io.utils import decfa
from nibabel import Nifti1Image
import numpy as np
def test_decfa():
data_orig = np.zeros((4, 4, 4, 3))
data_orig[0, 0, 0] = np.array([1, 0, 0])
img_orig = Nifti1Image(data_orig, np.eye(4))
img_new = decfa(img_orig)
data_new = img_new.get_data()
assert data_new[... | <commit_before>
from dipy.io.utils import decfa
from nibabel import Nifti1Image
import numpy as np
def test_decfa():
data_orig = np.zeros((4, 4, 4, 3))
data_orig[0, 0, 0] = np.array([1, 0, 0])
img_orig = Nifti1Image(data_orig, np.eye(4))
img_new = decfa(img_orig)
data_new = img_new.get_data()
a... |
9258d026f7782084cd75b78e13872bc6b3f65c8d | keras/dtensor/__init__.py | keras/dtensor/__init__.py | # Copyright 2022 The TensorFlow Authors. All Rights Reserved.
#
# 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 applica... | # Copyright 2022 The TensorFlow Authors. All Rights Reserved.
#
# 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 applica... | Enable the keras dtensor API in OSS. | Enable the keras dtensor API in OSS.
PiperOrigin-RevId: 438858608
| Python | apache-2.0 | keras-team/keras,keras-team/keras | # Copyright 2022 The TensorFlow Authors. All Rights Reserved.
#
# 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 applica... | # Copyright 2022 The TensorFlow Authors. All Rights Reserved.
#
# 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 applica... | <commit_before># Copyright 2022 The TensorFlow Authors. All Rights Reserved.
#
# 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 requ... | # Copyright 2022 The TensorFlow Authors. All Rights Reserved.
#
# 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 applica... | # Copyright 2022 The TensorFlow Authors. All Rights Reserved.
#
# 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 applica... | <commit_before># Copyright 2022 The TensorFlow Authors. All Rights Reserved.
#
# 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 requ... |
093127f85f6d8f3f0ef669abfc0ba7cc9778fbe5 | chef/data_bag.py | chef/data_bag.py | import abc
import collections
from chef.base import ChefObject, ChefQuery, ChefObjectMeta
class DataBagMeta(ChefObjectMeta, abc.ABCMeta):
"""A metaclass to allow DataBag to use multiple inheritance."""
class DataBag(ChefObject, ChefQuery):
__metaclass__ = DataBagMeta
url = '/data'
def _popu... | import abc
import collections
from chef.base import ChefObject, ChefQuery, ChefObjectMeta
class DataBagMeta(ChefObjectMeta, abc.ABCMeta):
"""A metaclass to allow DataBag to use multiple inheritance."""
class DataBag(ChefObject, ChefQuery):
__metaclass__ = DataBagMeta
url = '/data'
def _populate(se... | Handle both possible JSON formats for data bag items. | Handle both possible JSON formats for data bag items.
This won't work if there is an actual data bag
item key called 'json_class', but that would be silly. | Python | apache-2.0 | dipakvwarade/pychef,coderanger/pychef,Scalr/pychef,coderanger/pychef,jarosser06/pychef,dipakvwarade/pychef,cread/pychef,Scalr/pychef,jarosser06/pychef,cread/pychef | import abc
import collections
from chef.base import ChefObject, ChefQuery, ChefObjectMeta
class DataBagMeta(ChefObjectMeta, abc.ABCMeta):
"""A metaclass to allow DataBag to use multiple inheritance."""
class DataBag(ChefObject, ChefQuery):
__metaclass__ = DataBagMeta
url = '/data'
def _popu... | import abc
import collections
from chef.base import ChefObject, ChefQuery, ChefObjectMeta
class DataBagMeta(ChefObjectMeta, abc.ABCMeta):
"""A metaclass to allow DataBag to use multiple inheritance."""
class DataBag(ChefObject, ChefQuery):
__metaclass__ = DataBagMeta
url = '/data'
def _populate(se... | <commit_before>import abc
import collections
from chef.base import ChefObject, ChefQuery, ChefObjectMeta
class DataBagMeta(ChefObjectMeta, abc.ABCMeta):
"""A metaclass to allow DataBag to use multiple inheritance."""
class DataBag(ChefObject, ChefQuery):
__metaclass__ = DataBagMeta
url = '/data'
... | import abc
import collections
from chef.base import ChefObject, ChefQuery, ChefObjectMeta
class DataBagMeta(ChefObjectMeta, abc.ABCMeta):
"""A metaclass to allow DataBag to use multiple inheritance."""
class DataBag(ChefObject, ChefQuery):
__metaclass__ = DataBagMeta
url = '/data'
def _populate(se... | import abc
import collections
from chef.base import ChefObject, ChefQuery, ChefObjectMeta
class DataBagMeta(ChefObjectMeta, abc.ABCMeta):
"""A metaclass to allow DataBag to use multiple inheritance."""
class DataBag(ChefObject, ChefQuery):
__metaclass__ = DataBagMeta
url = '/data'
def _popu... | <commit_before>import abc
import collections
from chef.base import ChefObject, ChefQuery, ChefObjectMeta
class DataBagMeta(ChefObjectMeta, abc.ABCMeta):
"""A metaclass to allow DataBag to use multiple inheritance."""
class DataBag(ChefObject, ChefQuery):
__metaclass__ = DataBagMeta
url = '/data'
... |
3fec3b367eb406b53238832cf5531901455f7907 | lit/lit/LitFormats.py | lit/lit/LitFormats.py | from TestFormats import GoogleTest, ShTest, TclTest
from TestFormats import SyntaxCheckTest, OneCommandPerFileTest
| from TestFormats import GoogleTest, ShTest, TclTest
from TestFormats import SyntaxCheckTest, OneCommandPerFileTest
| Test commit (removed extra blank line) | Test commit (removed extra blank line)
git-svn-id: a4a6f32337ebd29ad4763b423022f00f68d1c7b7@98988 91177308-0d34-0410-b5e6-96231b3b80d8
| Python | bsd-3-clause | lodyagin/bare_cxx,lodyagin/bare_cxx,lodyagin/bare_cxx,lodyagin/bare_cxx,lodyagin/bare_cxx | from TestFormats import GoogleTest, ShTest, TclTest
from TestFormats import SyntaxCheckTest, OneCommandPerFileTest
Test commit (removed extra blank line)
git-svn-id: a4a6f32337ebd29ad4763b423022f00f68d1c7b7@98988 91177308-0d34-0410-b5e6-96231b3b80d8 | from TestFormats import GoogleTest, ShTest, TclTest
from TestFormats import SyntaxCheckTest, OneCommandPerFileTest
| <commit_before>from TestFormats import GoogleTest, ShTest, TclTest
from TestFormats import SyntaxCheckTest, OneCommandPerFileTest
<commit_msg>Test commit (removed extra blank line)
git-svn-id: a4a6f32337ebd29ad4763b423022f00f68d1c7b7@98988 91177308-0d34-0410-b5e6-96231b3b80d8<commit_after> | from TestFormats import GoogleTest, ShTest, TclTest
from TestFormats import SyntaxCheckTest, OneCommandPerFileTest
| from TestFormats import GoogleTest, ShTest, TclTest
from TestFormats import SyntaxCheckTest, OneCommandPerFileTest
Test commit (removed extra blank line)
git-svn-id: a4a6f32337ebd29ad4763b423022f00f68d1c7b7@98988 91177308-0d34-0410-b5e6-96231b3b80d8from TestFormats import GoogleTest, ShTest, TclTest
from TestFormats ... | <commit_before>from TestFormats import GoogleTest, ShTest, TclTest
from TestFormats import SyntaxCheckTest, OneCommandPerFileTest
<commit_msg>Test commit (removed extra blank line)
git-svn-id: a4a6f32337ebd29ad4763b423022f00f68d1c7b7@98988 91177308-0d34-0410-b5e6-96231b3b80d8<commit_after>from TestFormats import Goog... |
a273342b6e89709fc838dfd6abcee0a525272cea | management/admin.py | management/admin.py | from django.contrib import admin
from django.contrib.contenttypes.admin import GenericTabularInline
from .models import (Location, Permanence, Equipment, Lending, Position,
MembershipType, Membership, PublicFile, PublicImage,
ProtectedFile, ProtectedImage, AdminFile, AdminImage)
... | from django.contrib import admin
from django.contrib.contenttypes.admin import GenericTabularInline
from .models import (Location, Permanence, Equipment, Lending, Position,
MembershipType, Membership, PublicFile, PublicImage,
ProtectedFile, ProtectedImage, AdminFile, AdminImage)
... | Add ProtectedFile, ProtectedImage, AdminFile and AdminImage. | Add ProtectedFile, ProtectedImage, AdminFile and AdminImage.
| Python | mit | QSchulz/sportassociation,QSchulz/sportassociation,QSchulz/sportassociation | from django.contrib import admin
from django.contrib.contenttypes.admin import GenericTabularInline
from .models import (Location, Permanence, Equipment, Lending, Position,
MembershipType, Membership, PublicFile, PublicImage,
ProtectedFile, ProtectedImage, AdminFile, AdminImage)
... | from django.contrib import admin
from django.contrib.contenttypes.admin import GenericTabularInline
from .models import (Location, Permanence, Equipment, Lending, Position,
MembershipType, Membership, PublicFile, PublicImage,
ProtectedFile, ProtectedImage, AdminFile, AdminImage)
... | <commit_before>from django.contrib import admin
from django.contrib.contenttypes.admin import GenericTabularInline
from .models import (Location, Permanence, Equipment, Lending, Position,
MembershipType, Membership, PublicFile, PublicImage,
ProtectedFile, ProtectedImage, AdminFil... | from django.contrib import admin
from django.contrib.contenttypes.admin import GenericTabularInline
from .models import (Location, Permanence, Equipment, Lending, Position,
MembershipType, Membership, PublicFile, PublicImage,
ProtectedFile, ProtectedImage, AdminFile, AdminImage)
... | from django.contrib import admin
from django.contrib.contenttypes.admin import GenericTabularInline
from .models import (Location, Permanence, Equipment, Lending, Position,
MembershipType, Membership, PublicFile, PublicImage,
ProtectedFile, ProtectedImage, AdminFile, AdminImage)
... | <commit_before>from django.contrib import admin
from django.contrib.contenttypes.admin import GenericTabularInline
from .models import (Location, Permanence, Equipment, Lending, Position,
MembershipType, Membership, PublicFile, PublicImage,
ProtectedFile, ProtectedImage, AdminFil... |
e118ee78b534a83b33f91b27cfc1f75d64e8e924 | test_utils/testmaker/base_serializer.py | test_utils/testmaker/base_serializer.py | import cPickle as pickle
import logging
import time
ser = logging.getLogger('testserializer')
class Serializer(object):
"""A pluggable Serializer class"""
name = "default"
def __init__(self, name='default'):
"""Constructor"""
self.data = {}
self.name = name
def save_request(... | import cPickle as pickle
import logging
import time
class Serializer(object):
"""A pluggable Serializer class"""
name = "default"
def __init__(self, name='default'):
"""Constructor"""
self.ser = logging.getLogger('testserializer')
self.data = {}
self.name = name
def ... | Move serializer into the class so it can be subclassed. | Move serializer into the class so it can be subclassed. | Python | mit | frac/django-test-utils,acdha/django-test-utils,ericholscher/django-test-utils,frac/django-test-utils,ericholscher/django-test-utils,acdha/django-test-utils | import cPickle as pickle
import logging
import time
ser = logging.getLogger('testserializer')
class Serializer(object):
"""A pluggable Serializer class"""
name = "default"
def __init__(self, name='default'):
"""Constructor"""
self.data = {}
self.name = name
def save_request(... | import cPickle as pickle
import logging
import time
class Serializer(object):
"""A pluggable Serializer class"""
name = "default"
def __init__(self, name='default'):
"""Constructor"""
self.ser = logging.getLogger('testserializer')
self.data = {}
self.name = name
def ... | <commit_before>import cPickle as pickle
import logging
import time
ser = logging.getLogger('testserializer')
class Serializer(object):
"""A pluggable Serializer class"""
name = "default"
def __init__(self, name='default'):
"""Constructor"""
self.data = {}
self.name = name
de... | import cPickle as pickle
import logging
import time
class Serializer(object):
"""A pluggable Serializer class"""
name = "default"
def __init__(self, name='default'):
"""Constructor"""
self.ser = logging.getLogger('testserializer')
self.data = {}
self.name = name
def ... | import cPickle as pickle
import logging
import time
ser = logging.getLogger('testserializer')
class Serializer(object):
"""A pluggable Serializer class"""
name = "default"
def __init__(self, name='default'):
"""Constructor"""
self.data = {}
self.name = name
def save_request(... | <commit_before>import cPickle as pickle
import logging
import time
ser = logging.getLogger('testserializer')
class Serializer(object):
"""A pluggable Serializer class"""
name = "default"
def __init__(self, name='default'):
"""Constructor"""
self.data = {}
self.name = name
de... |
b3935065232a97b7eb65c38e5c7bc60570467c71 | news/urls.py | news/urls.py | from django.conf.urls import url
from . import views
app_name = 'news'
urlpatterns = [
url(r'^$', views.IndexView.as_view(), name='index'),
url(r'^(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/(?P<slug>[-\w]+)/$',
views.ArticleView.as_view(), name='article'),
]
| from django.urls import include, path
from . import views
app_name = 'news'
urlpatterns = [
path('', views.IndexView.as_view(), name='index'),
path('<int:year>/<int:month>/<int:day>/<slug:slug>/', views.ArticleView.as_view(), name='article'),
]
| Move news urlpatterns to Django 2.0 preferred method | Move news urlpatterns to Django 2.0 preferred method
| Python | mit | evanepio/dotmanca,evanepio/dotmanca,evanepio/dotmanca | from django.conf.urls import url
from . import views
app_name = 'news'
urlpatterns = [
url(r'^$', views.IndexView.as_view(), name='index'),
url(r'^(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/(?P<slug>[-\w]+)/$',
views.ArticleView.as_view(), name='article'),
]
Move news urlpatterns to Django 2.0 pr... | from django.urls import include, path
from . import views
app_name = 'news'
urlpatterns = [
path('', views.IndexView.as_view(), name='index'),
path('<int:year>/<int:month>/<int:day>/<slug:slug>/', views.ArticleView.as_view(), name='article'),
]
| <commit_before>from django.conf.urls import url
from . import views
app_name = 'news'
urlpatterns = [
url(r'^$', views.IndexView.as_view(), name='index'),
url(r'^(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/(?P<slug>[-\w]+)/$',
views.ArticleView.as_view(), name='article'),
]
<commit_msg>Move news u... | from django.urls import include, path
from . import views
app_name = 'news'
urlpatterns = [
path('', views.IndexView.as_view(), name='index'),
path('<int:year>/<int:month>/<int:day>/<slug:slug>/', views.ArticleView.as_view(), name='article'),
]
| from django.conf.urls import url
from . import views
app_name = 'news'
urlpatterns = [
url(r'^$', views.IndexView.as_view(), name='index'),
url(r'^(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/(?P<slug>[-\w]+)/$',
views.ArticleView.as_view(), name='article'),
]
Move news urlpatterns to Django 2.0 pr... | <commit_before>from django.conf.urls import url
from . import views
app_name = 'news'
urlpatterns = [
url(r'^$', views.IndexView.as_view(), name='index'),
url(r'^(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/(?P<slug>[-\w]+)/$',
views.ArticleView.as_view(), name='article'),
]
<commit_msg>Move news u... |
910d9e724e1e80d967853b21f553d753c70fefc0 | noah/noah.py | noah/noah.py | import json
import random
class Noah(object):
def __init__(self, dictionary_file):
self.dictionary = json.load(dictionary_file)
def list(self):
return '\n'.join([entry['word'] for entry in self.dictionary])
def define(self, word):
entry = next((x for x in self.dictionary if x['wor... | import json
import random
import pprint
class Noah(object):
def __init__(self, dictionary_file):
self.dictionary = json.load(dictionary_file)
def list(self):
return '\n'.join([entry['word'] for entry in self.dictionary])
def define(self, word):
return self.output(filter(lambda x: ... | Define returns all entries for given query. | Define returns all entries for given query.
| Python | mit | maxdeviant/noah | import json
import random
class Noah(object):
def __init__(self, dictionary_file):
self.dictionary = json.load(dictionary_file)
def list(self):
return '\n'.join([entry['word'] for entry in self.dictionary])
def define(self, word):
entry = next((x for x in self.dictionary if x['wor... | import json
import random
import pprint
class Noah(object):
def __init__(self, dictionary_file):
self.dictionary = json.load(dictionary_file)
def list(self):
return '\n'.join([entry['word'] for entry in self.dictionary])
def define(self, word):
return self.output(filter(lambda x: ... | <commit_before>import json
import random
class Noah(object):
def __init__(self, dictionary_file):
self.dictionary = json.load(dictionary_file)
def list(self):
return '\n'.join([entry['word'] for entry in self.dictionary])
def define(self, word):
entry = next((x for x in self.dicti... | import json
import random
import pprint
class Noah(object):
def __init__(self, dictionary_file):
self.dictionary = json.load(dictionary_file)
def list(self):
return '\n'.join([entry['word'] for entry in self.dictionary])
def define(self, word):
return self.output(filter(lambda x: ... | import json
import random
class Noah(object):
def __init__(self, dictionary_file):
self.dictionary = json.load(dictionary_file)
def list(self):
return '\n'.join([entry['word'] for entry in self.dictionary])
def define(self, word):
entry = next((x for x in self.dictionary if x['wor... | <commit_before>import json
import random
class Noah(object):
def __init__(self, dictionary_file):
self.dictionary = json.load(dictionary_file)
def list(self):
return '\n'.join([entry['word'] for entry in self.dictionary])
def define(self, word):
entry = next((x for x in self.dicti... |
418e1e0ba2dcedd20966eea76699eb754eef53b4 | node/sort.py | node/sort.py | #!/usr/bin/env python
from nodes import Node
class Sort(Node):
char = "S"
args = 1
results = 1
@Node.test_func([[2,3,4,1]], [[1,2,3,4]])
@Node.test_func(["test"], ["estt"])
def func(self, a: Node.indexable):
"""sorted(a) - returns the same type as given"""
if isinstance(a,... | #!/usr/bin/env python
from nodes import Node
class Sort(Node):
char = "S"
args = 1
results = 1
@Node.test_func([[2,3,4,1]], [[1,2,3,4]])
@Node.test_func(["test"], ["estt"])
def func(self, a: Node.indexable):
"""sorted(a) - returns the same type as given"""
if isinstance(a,... | Change 1 based range so it counts up to n | Change 1 based range so it counts up to n
| Python | mit | muddyfish/PYKE,muddyfish/PYKE | #!/usr/bin/env python
from nodes import Node
class Sort(Node):
char = "S"
args = 1
results = 1
@Node.test_func([[2,3,4,1]], [[1,2,3,4]])
@Node.test_func(["test"], ["estt"])
def func(self, a: Node.indexable):
"""sorted(a) - returns the same type as given"""
if isinstance(a,... | #!/usr/bin/env python
from nodes import Node
class Sort(Node):
char = "S"
args = 1
results = 1
@Node.test_func([[2,3,4,1]], [[1,2,3,4]])
@Node.test_func(["test"], ["estt"])
def func(self, a: Node.indexable):
"""sorted(a) - returns the same type as given"""
if isinstance(a,... | <commit_before>#!/usr/bin/env python
from nodes import Node
class Sort(Node):
char = "S"
args = 1
results = 1
@Node.test_func([[2,3,4,1]], [[1,2,3,4]])
@Node.test_func(["test"], ["estt"])
def func(self, a: Node.indexable):
"""sorted(a) - returns the same type as given"""
i... | #!/usr/bin/env python
from nodes import Node
class Sort(Node):
char = "S"
args = 1
results = 1
@Node.test_func([[2,3,4,1]], [[1,2,3,4]])
@Node.test_func(["test"], ["estt"])
def func(self, a: Node.indexable):
"""sorted(a) - returns the same type as given"""
if isinstance(a,... | #!/usr/bin/env python
from nodes import Node
class Sort(Node):
char = "S"
args = 1
results = 1
@Node.test_func([[2,3,4,1]], [[1,2,3,4]])
@Node.test_func(["test"], ["estt"])
def func(self, a: Node.indexable):
"""sorted(a) - returns the same type as given"""
if isinstance(a,... | <commit_before>#!/usr/bin/env python
from nodes import Node
class Sort(Node):
char = "S"
args = 1
results = 1
@Node.test_func([[2,3,4,1]], [[1,2,3,4]])
@Node.test_func(["test"], ["estt"])
def func(self, a: Node.indexable):
"""sorted(a) - returns the same type as given"""
i... |
c246f0e9add0a5b6d7fce9b9e2107671440b5f90 | mica/starcheck/tests/make_database.py | mica/starcheck/tests/make_database.py | import os
import tempfile
from Chandra.Time import DateTime
from Ska.Shell import bash
import mica.common
# Override MICA_ARCHIVE with a temporary directory
TESTDIR = tempfile.mkdtemp()
mica.common.MICA_ARCHIVE = TESTDIR
# import mica.starcheck.starcheck after setting MICA_ARCHIVE
import mica.starcheck.process
# Just... | import os
import tempfile
from Chandra.Time import DateTime
from Ska.Shell import bash
import mica.common
# Override MICA_ARCHIVE with a temporary directory
TESTDIR = tempfile.mkdtemp()
mica.common.MICA_ARCHIVE = TESTDIR
# import mica.starcheck.starcheck after setting MICA_ARCHIVE
import mica.starcheck.process
# Just... | Update test script to use a provided start time | Update test script to use a provided start time
| Python | bsd-3-clause | sot/mica,sot/mica | import os
import tempfile
from Chandra.Time import DateTime
from Ska.Shell import bash
import mica.common
# Override MICA_ARCHIVE with a temporary directory
TESTDIR = tempfile.mkdtemp()
mica.common.MICA_ARCHIVE = TESTDIR
# import mica.starcheck.starcheck after setting MICA_ARCHIVE
import mica.starcheck.process
# Just... | import os
import tempfile
from Chandra.Time import DateTime
from Ska.Shell import bash
import mica.common
# Override MICA_ARCHIVE with a temporary directory
TESTDIR = tempfile.mkdtemp()
mica.common.MICA_ARCHIVE = TESTDIR
# import mica.starcheck.starcheck after setting MICA_ARCHIVE
import mica.starcheck.process
# Just... | <commit_before>import os
import tempfile
from Chandra.Time import DateTime
from Ska.Shell import bash
import mica.common
# Override MICA_ARCHIVE with a temporary directory
TESTDIR = tempfile.mkdtemp()
mica.common.MICA_ARCHIVE = TESTDIR
# import mica.starcheck.starcheck after setting MICA_ARCHIVE
import mica.starcheck.... | import os
import tempfile
from Chandra.Time import DateTime
from Ska.Shell import bash
import mica.common
# Override MICA_ARCHIVE with a temporary directory
TESTDIR = tempfile.mkdtemp()
mica.common.MICA_ARCHIVE = TESTDIR
# import mica.starcheck.starcheck after setting MICA_ARCHIVE
import mica.starcheck.process
# Just... | import os
import tempfile
from Chandra.Time import DateTime
from Ska.Shell import bash
import mica.common
# Override MICA_ARCHIVE with a temporary directory
TESTDIR = tempfile.mkdtemp()
mica.common.MICA_ARCHIVE = TESTDIR
# import mica.starcheck.starcheck after setting MICA_ARCHIVE
import mica.starcheck.process
# Just... | <commit_before>import os
import tempfile
from Chandra.Time import DateTime
from Ska.Shell import bash
import mica.common
# Override MICA_ARCHIVE with a temporary directory
TESTDIR = tempfile.mkdtemp()
mica.common.MICA_ARCHIVE = TESTDIR
# import mica.starcheck.starcheck after setting MICA_ARCHIVE
import mica.starcheck.... |
2fd5f0656434340763cc51c47238d4a40e61789b | modernrpc/__init__.py | modernrpc/__init__.py | # coding: utf-8
from packaging.version import Version
import django
# Set default_app_config only with Django up to 3.1. This prevents a Warning on newer releases
# See https://docs.djangoproject.com/fr/3.2/releases/3.2/#automatic-appconfig-discovery
if Version(django.get_version()) < Version("3.2"):
default_app_c... | # coding: utf-8
from distutils.version import StrictVersion
import django
# distutils.version, overridden by setuptools._distutils.version in recent python releases, is deprecated
# and will be removed in Python 3.12. We will probably drop Django < 3.2 until then, so this should be fine
if StrictVersion(django.get_ve... | Remove unwanted dependency to 'packaging' | Remove unwanted dependency to 'packaging' | Python | mit | alorence/django-modern-rpc,alorence/django-modern-rpc | # coding: utf-8
from packaging.version import Version
import django
# Set default_app_config only with Django up to 3.1. This prevents a Warning on newer releases
# See https://docs.djangoproject.com/fr/3.2/releases/3.2/#automatic-appconfig-discovery
if Version(django.get_version()) < Version("3.2"):
default_app_c... | # coding: utf-8
from distutils.version import StrictVersion
import django
# distutils.version, overridden by setuptools._distutils.version in recent python releases, is deprecated
# and will be removed in Python 3.12. We will probably drop Django < 3.2 until then, so this should be fine
if StrictVersion(django.get_ve... | <commit_before># coding: utf-8
from packaging.version import Version
import django
# Set default_app_config only with Django up to 3.1. This prevents a Warning on newer releases
# See https://docs.djangoproject.com/fr/3.2/releases/3.2/#automatic-appconfig-discovery
if Version(django.get_version()) < Version("3.2"):
... | # coding: utf-8
from distutils.version import StrictVersion
import django
# distutils.version, overridden by setuptools._distutils.version in recent python releases, is deprecated
# and will be removed in Python 3.12. We will probably drop Django < 3.2 until then, so this should be fine
if StrictVersion(django.get_ve... | # coding: utf-8
from packaging.version import Version
import django
# Set default_app_config only with Django up to 3.1. This prevents a Warning on newer releases
# See https://docs.djangoproject.com/fr/3.2/releases/3.2/#automatic-appconfig-discovery
if Version(django.get_version()) < Version("3.2"):
default_app_c... | <commit_before># coding: utf-8
from packaging.version import Version
import django
# Set default_app_config only with Django up to 3.1. This prevents a Warning on newer releases
# See https://docs.djangoproject.com/fr/3.2/releases/3.2/#automatic-appconfig-discovery
if Version(django.get_version()) < Version("3.2"):
... |
1f76df1fe6b77850f8741b2f52b2509ce204f93f | stats-to-datadog.py | stats-to-datadog.py | import urllib2
import json
import sys
from statsd import statsd
statsd.connect('localhost', 8125)
topology = sys.argv[1]
state = urllib2.urlopen(
"http://localhost:9000/api/status?toporoot={}&topic={}".format(
sys.argv[2], sys.argv[3]
)
).read()
data = json.loads(state)
amount = 0
for looplord in d... | import urllib2
import json
import sys
from statsd import statsd
statsd.connect('localhost', 8125)
topology = sys.argv[1]
toporoot = sys.argv[2]
topic = sys.argv[3]
state = urllib2.urlopen(
"http://localhost:9000/api/status?toporoot={}&topic={}".format(
toporoot, topic
)
).read()
data = json.loads(st... | Add stats for each partition. | Add stats for each partition.
| Python | mit | evertrue/capillary,evertrue/capillary,evertrue/capillary,keenlabs/capillary,evertrue/capillary,keenlabs/capillary,keenlabs/capillary | import urllib2
import json
import sys
from statsd import statsd
statsd.connect('localhost', 8125)
topology = sys.argv[1]
state = urllib2.urlopen(
"http://localhost:9000/api/status?toporoot={}&topic={}".format(
sys.argv[2], sys.argv[3]
)
).read()
data = json.loads(state)
amount = 0
for looplord in d... | import urllib2
import json
import sys
from statsd import statsd
statsd.connect('localhost', 8125)
topology = sys.argv[1]
toporoot = sys.argv[2]
topic = sys.argv[3]
state = urllib2.urlopen(
"http://localhost:9000/api/status?toporoot={}&topic={}".format(
toporoot, topic
)
).read()
data = json.loads(st... | <commit_before>import urllib2
import json
import sys
from statsd import statsd
statsd.connect('localhost', 8125)
topology = sys.argv[1]
state = urllib2.urlopen(
"http://localhost:9000/api/status?toporoot={}&topic={}".format(
sys.argv[2], sys.argv[3]
)
).read()
data = json.loads(state)
amount = 0
fo... | import urllib2
import json
import sys
from statsd import statsd
statsd.connect('localhost', 8125)
topology = sys.argv[1]
toporoot = sys.argv[2]
topic = sys.argv[3]
state = urllib2.urlopen(
"http://localhost:9000/api/status?toporoot={}&topic={}".format(
toporoot, topic
)
).read()
data = json.loads(st... | import urllib2
import json
import sys
from statsd import statsd
statsd.connect('localhost', 8125)
topology = sys.argv[1]
state = urllib2.urlopen(
"http://localhost:9000/api/status?toporoot={}&topic={}".format(
sys.argv[2], sys.argv[3]
)
).read()
data = json.loads(state)
amount = 0
for looplord in d... | <commit_before>import urllib2
import json
import sys
from statsd import statsd
statsd.connect('localhost', 8125)
topology = sys.argv[1]
state = urllib2.urlopen(
"http://localhost:9000/api/status?toporoot={}&topic={}".format(
sys.argv[2], sys.argv[3]
)
).read()
data = json.loads(state)
amount = 0
fo... |
6a8f39104a1a7722ee0a0a2437256dd3c123ab18 | src/newt/db/tests/base.py | src/newt/db/tests/base.py | import gc
import sys
PYPY = hasattr(sys, 'pypy_version_info')
from .. import pg_connection
class DBSetup(object):
maxDiff = None
@property
def dsn(self):
return 'postgresql://localhost/' + self.dbname
def setUp(self, call_super=True):
self.dbname = self.__class__.__name__.lower() + ... | import gc
import sys
import unittest
PYPY = hasattr(sys, 'pypy_version_info')
from .. import pg_connection
from .._util import closing
class DBSetup(object):
maxDiff = None
@property
def dsn(self):
return 'postgresql://localhost/' + self.dbname
def setUp(self, call_super=True):
sel... | Make it easier to clean up tests by closing db sessions | Make it easier to clean up tests by closing db sessions
Also added a convenience test base class
| Python | mit | newtdb/db | import gc
import sys
PYPY = hasattr(sys, 'pypy_version_info')
from .. import pg_connection
class DBSetup(object):
maxDiff = None
@property
def dsn(self):
return 'postgresql://localhost/' + self.dbname
def setUp(self, call_super=True):
self.dbname = self.__class__.__name__.lower() + ... | import gc
import sys
import unittest
PYPY = hasattr(sys, 'pypy_version_info')
from .. import pg_connection
from .._util import closing
class DBSetup(object):
maxDiff = None
@property
def dsn(self):
return 'postgresql://localhost/' + self.dbname
def setUp(self, call_super=True):
sel... | <commit_before>import gc
import sys
PYPY = hasattr(sys, 'pypy_version_info')
from .. import pg_connection
class DBSetup(object):
maxDiff = None
@property
def dsn(self):
return 'postgresql://localhost/' + self.dbname
def setUp(self, call_super=True):
self.dbname = self.__class__.__na... | import gc
import sys
import unittest
PYPY = hasattr(sys, 'pypy_version_info')
from .. import pg_connection
from .._util import closing
class DBSetup(object):
maxDiff = None
@property
def dsn(self):
return 'postgresql://localhost/' + self.dbname
def setUp(self, call_super=True):
sel... | import gc
import sys
PYPY = hasattr(sys, 'pypy_version_info')
from .. import pg_connection
class DBSetup(object):
maxDiff = None
@property
def dsn(self):
return 'postgresql://localhost/' + self.dbname
def setUp(self, call_super=True):
self.dbname = self.__class__.__name__.lower() + ... | <commit_before>import gc
import sys
PYPY = hasattr(sys, 'pypy_version_info')
from .. import pg_connection
class DBSetup(object):
maxDiff = None
@property
def dsn(self):
return 'postgresql://localhost/' + self.dbname
def setUp(self, call_super=True):
self.dbname = self.__class__.__na... |
c6b82ffcef179cd9c51f6a98124ea80dbd9d60fd | pylua/interpreter.py | pylua/interpreter.py | from pylua.objspace import ObjectSpace
from pylua.luaframe import LuaBuiltinFrame, SReturnValue
from pylua.helpers import debug_print
from pylua.bytecode import Constant
def m_print(arg):
print(arg)
class Interpreter(object):
def __init__(self, flags, frames):
self.flags = flags
self.frames = ... | from pylua.objspace import ObjectSpace
from pylua.luaframe import LuaBuiltinFrame, SReturnValue
from pylua.helpers import debug_print
from pylua.bytecode import Constant
"""
prints arg to std out
"""
def m_print(arg):
print(arg)
class Interpreter(object):
def __init__(self, flags, frames):
self.flags ... | Add a comment for my print hack | Add a comment for my print hack
| Python | bsd-3-clause | fhahn/luna,fhahn/luna | from pylua.objspace import ObjectSpace
from pylua.luaframe import LuaBuiltinFrame, SReturnValue
from pylua.helpers import debug_print
from pylua.bytecode import Constant
def m_print(arg):
print(arg)
class Interpreter(object):
def __init__(self, flags, frames):
self.flags = flags
self.frames = ... | from pylua.objspace import ObjectSpace
from pylua.luaframe import LuaBuiltinFrame, SReturnValue
from pylua.helpers import debug_print
from pylua.bytecode import Constant
"""
prints arg to std out
"""
def m_print(arg):
print(arg)
class Interpreter(object):
def __init__(self, flags, frames):
self.flags ... | <commit_before>from pylua.objspace import ObjectSpace
from pylua.luaframe import LuaBuiltinFrame, SReturnValue
from pylua.helpers import debug_print
from pylua.bytecode import Constant
def m_print(arg):
print(arg)
class Interpreter(object):
def __init__(self, flags, frames):
self.flags = flags
... | from pylua.objspace import ObjectSpace
from pylua.luaframe import LuaBuiltinFrame, SReturnValue
from pylua.helpers import debug_print
from pylua.bytecode import Constant
"""
prints arg to std out
"""
def m_print(arg):
print(arg)
class Interpreter(object):
def __init__(self, flags, frames):
self.flags ... | from pylua.objspace import ObjectSpace
from pylua.luaframe import LuaBuiltinFrame, SReturnValue
from pylua.helpers import debug_print
from pylua.bytecode import Constant
def m_print(arg):
print(arg)
class Interpreter(object):
def __init__(self, flags, frames):
self.flags = flags
self.frames = ... | <commit_before>from pylua.objspace import ObjectSpace
from pylua.luaframe import LuaBuiltinFrame, SReturnValue
from pylua.helpers import debug_print
from pylua.bytecode import Constant
def m_print(arg):
print(arg)
class Interpreter(object):
def __init__(self, flags, frames):
self.flags = flags
... |
0128ca2edb48cb58c8a68b4b6e9a8eaeba53518c | python/play/dwalk.py | python/play/dwalk.py | #! /usr/bin/env python
"""dwalk: walk a directory tree, printing entries hierarchically
+ top
| > file
| > file
| + dir
| | > file
| | > file
| | + dir
| | | > file
| | + dir
| | | > file
| | | > file
| + dir
| | + dir
| | | > file"""
import os
import sys
def dwalk(path, hea... | #! /usr/bin/env python
# vim: set sw=4 ai et sm:
"""dwalk: walk a directory tree, printing entries hierarchically
+ top
| > file
| > file
| + dir
| | > file
| | > file
| | + dir
| | | > file
| | + dir
| | | > file
| | | > file
| + dir
| | + dir
| | | > file"""
import os
impo... | Convert tabs to spaces, and set up vim modeline to expand tabs going forward. | Convert tabs to spaces, and set up vim modeline to expand tabs going forward.
| Python | bsd-2-clause | tedzo/python_play | #! /usr/bin/env python
"""dwalk: walk a directory tree, printing entries hierarchically
+ top
| > file
| > file
| + dir
| | > file
| | > file
| | + dir
| | | > file
| | + dir
| | | > file
| | | > file
| + dir
| | + dir
| | | > file"""
import os
import sys
def dwalk(path, hea... | #! /usr/bin/env python
# vim: set sw=4 ai et sm:
"""dwalk: walk a directory tree, printing entries hierarchically
+ top
| > file
| > file
| + dir
| | > file
| | > file
| | + dir
| | | > file
| | + dir
| | | > file
| | | > file
| + dir
| | + dir
| | | > file"""
import os
impo... | <commit_before>#! /usr/bin/env python
"""dwalk: walk a directory tree, printing entries hierarchically
+ top
| > file
| > file
| + dir
| | > file
| | > file
| | + dir
| | | > file
| | + dir
| | | > file
| | | > file
| + dir
| | + dir
| | | > file"""
import os
import sys
def ... | #! /usr/bin/env python
# vim: set sw=4 ai et sm:
"""dwalk: walk a directory tree, printing entries hierarchically
+ top
| > file
| > file
| + dir
| | > file
| | > file
| | + dir
| | | > file
| | + dir
| | | > file
| | | > file
| + dir
| | + dir
| | | > file"""
import os
impo... | #! /usr/bin/env python
"""dwalk: walk a directory tree, printing entries hierarchically
+ top
| > file
| > file
| + dir
| | > file
| | > file
| | + dir
| | | > file
| | + dir
| | | > file
| | | > file
| + dir
| | + dir
| | | > file"""
import os
import sys
def dwalk(path, hea... | <commit_before>#! /usr/bin/env python
"""dwalk: walk a directory tree, printing entries hierarchically
+ top
| > file
| > file
| + dir
| | > file
| | > file
| | + dir
| | | > file
| | + dir
| | | > file
| | | > file
| + dir
| | + dir
| | | > file"""
import os
import sys
def ... |
f1be3f0920bbd270a5906364e77182b67ae4c354 | rejected/__init__.py | rejected/__init__.py | """
Rejected is a Python RabbitMQ Consumer Framework and Controller Daemon
"""
__author__ = 'Gavin M. Roy <[email protected]>'
__since__ = "2009-09-10"
__version__ = "3.7.0"
from consumer import Consumer
from consumer import PublishingConsumer
from consumer import SmartConsumer
from consumer import SmartPublishingC... | """
Rejected is a Python RabbitMQ Consumer Framework and Controller Daemon
"""
__author__ = 'Gavin M. Roy <[email protected]>'
__since__ = "2009-09-10"
__version__ = "3.7.0"
import logging
try:
# not available in python 2.6
from logging import NullHandler
except ImportError:
class NullHandler(logging.H... | Include a NullHandler to avoid logging warnings | Include a NullHandler to avoid logging warnings
| Python | bsd-3-clause | gmr/rejected,gmr/rejected | """
Rejected is a Python RabbitMQ Consumer Framework and Controller Daemon
"""
__author__ = 'Gavin M. Roy <[email protected]>'
__since__ = "2009-09-10"
__version__ = "3.7.0"
from consumer import Consumer
from consumer import PublishingConsumer
from consumer import SmartConsumer
from consumer import SmartPublishingC... | """
Rejected is a Python RabbitMQ Consumer Framework and Controller Daemon
"""
__author__ = 'Gavin M. Roy <[email protected]>'
__since__ = "2009-09-10"
__version__ = "3.7.0"
import logging
try:
# not available in python 2.6
from logging import NullHandler
except ImportError:
class NullHandler(logging.H... | <commit_before>"""
Rejected is a Python RabbitMQ Consumer Framework and Controller Daemon
"""
__author__ = 'Gavin M. Roy <[email protected]>'
__since__ = "2009-09-10"
__version__ = "3.7.0"
from consumer import Consumer
from consumer import PublishingConsumer
from consumer import SmartConsumer
from consumer import S... | """
Rejected is a Python RabbitMQ Consumer Framework and Controller Daemon
"""
__author__ = 'Gavin M. Roy <[email protected]>'
__since__ = "2009-09-10"
__version__ = "3.7.0"
import logging
try:
# not available in python 2.6
from logging import NullHandler
except ImportError:
class NullHandler(logging.H... | """
Rejected is a Python RabbitMQ Consumer Framework and Controller Daemon
"""
__author__ = 'Gavin M. Roy <[email protected]>'
__since__ = "2009-09-10"
__version__ = "3.7.0"
from consumer import Consumer
from consumer import PublishingConsumer
from consumer import SmartConsumer
from consumer import SmartPublishingC... | <commit_before>"""
Rejected is a Python RabbitMQ Consumer Framework and Controller Daemon
"""
__author__ = 'Gavin M. Roy <[email protected]>'
__since__ = "2009-09-10"
__version__ = "3.7.0"
from consumer import Consumer
from consumer import PublishingConsumer
from consumer import SmartConsumer
from consumer import S... |
6e425ca6dfeb668b0cb85dd54e83e3296aec970f | logTemps.py | logTemps.py | ######################################################
# logs time, fahrenheit and humidity every 5 minutes
#
######################################################
import time
import HTU21DF
import logging
logging.basicConfig(filename='sampleDay.log',level=logging.DEBUG,format='%(asctime)s\t%(message)s',datefmt='%Y-%... | ######################################################
# logs time, fahrenheit and humidity every 5 minutes
#
######################################################
import time
import HTU21DF
import logging
logging.basicConfig(filename='var/log/temperature/temp-humidity.log',level=logging.DEBUG,format='%(asctime)s\t%(... | Update to new log location | Update to new log location
| Python | mit | khuisman/project-cool-attic | ######################################################
# logs time, fahrenheit and humidity every 5 minutes
#
######################################################
import time
import HTU21DF
import logging
logging.basicConfig(filename='sampleDay.log',level=logging.DEBUG,format='%(asctime)s\t%(message)s',datefmt='%Y-%... | ######################################################
# logs time, fahrenheit and humidity every 5 minutes
#
######################################################
import time
import HTU21DF
import logging
logging.basicConfig(filename='var/log/temperature/temp-humidity.log',level=logging.DEBUG,format='%(asctime)s\t%(... | <commit_before>######################################################
# logs time, fahrenheit and humidity every 5 minutes
#
######################################################
import time
import HTU21DF
import logging
logging.basicConfig(filename='sampleDay.log',level=logging.DEBUG,format='%(asctime)s\t%(message)s... | ######################################################
# logs time, fahrenheit and humidity every 5 minutes
#
######################################################
import time
import HTU21DF
import logging
logging.basicConfig(filename='var/log/temperature/temp-humidity.log',level=logging.DEBUG,format='%(asctime)s\t%(... | ######################################################
# logs time, fahrenheit and humidity every 5 minutes
#
######################################################
import time
import HTU21DF
import logging
logging.basicConfig(filename='sampleDay.log',level=logging.DEBUG,format='%(asctime)s\t%(message)s',datefmt='%Y-%... | <commit_before>######################################################
# logs time, fahrenheit and humidity every 5 minutes
#
######################################################
import time
import HTU21DF
import logging
logging.basicConfig(filename='sampleDay.log',level=logging.DEBUG,format='%(asctime)s\t%(message)s... |
85de2a0bb8727583fef61fdadcca6bb3e649a454 | apps/addons/api/views.py | apps/addons/api/views.py | from rest_framework import generics, serializers
from rest_framework.response import Response
from waffle.decorators import waffle_switch
import amo
from addons.models import Addon
class AddonSerializer(serializers.ModelSerializer):
addon_type = serializers.SerializerMethodField('get_addon_type')
descriptio... | from rest_framework import generics, serializers
from rest_framework.response import Response
from waffle.decorators import waffle_switch
import amo
from addons.models import Addon
class AddonSerializer(serializers.ModelSerializer):
addon_type = serializers.SerializerMethodField('get_addon_type')
descriptio... | Set CORS header for add-on search API | Set CORS header for add-on search API
| Python | bsd-3-clause | eviljeff/olympia,harry-7/addons-server,mozilla/olympia,Prashant-Surya/addons-server,mozilla/addons-server,atiqueahmedziad/addons-server,mozilla/olympia,harikishen/addons-server,mozilla/addons-server,bqbn/addons-server,mstriemer/olympia,jpetto/olympia,Prashant-Surya/addons-server,psiinon/addons-server,mozilla/addons-ser... | from rest_framework import generics, serializers
from rest_framework.response import Response
from waffle.decorators import waffle_switch
import amo
from addons.models import Addon
class AddonSerializer(serializers.ModelSerializer):
addon_type = serializers.SerializerMethodField('get_addon_type')
descriptio... | from rest_framework import generics, serializers
from rest_framework.response import Response
from waffle.decorators import waffle_switch
import amo
from addons.models import Addon
class AddonSerializer(serializers.ModelSerializer):
addon_type = serializers.SerializerMethodField('get_addon_type')
descriptio... | <commit_before>from rest_framework import generics, serializers
from rest_framework.response import Response
from waffle.decorators import waffle_switch
import amo
from addons.models import Addon
class AddonSerializer(serializers.ModelSerializer):
addon_type = serializers.SerializerMethodField('get_addon_type')... | from rest_framework import generics, serializers
from rest_framework.response import Response
from waffle.decorators import waffle_switch
import amo
from addons.models import Addon
class AddonSerializer(serializers.ModelSerializer):
addon_type = serializers.SerializerMethodField('get_addon_type')
descriptio... | from rest_framework import generics, serializers
from rest_framework.response import Response
from waffle.decorators import waffle_switch
import amo
from addons.models import Addon
class AddonSerializer(serializers.ModelSerializer):
addon_type = serializers.SerializerMethodField('get_addon_type')
descriptio... | <commit_before>from rest_framework import generics, serializers
from rest_framework.response import Response
from waffle.decorators import waffle_switch
import amo
from addons.models import Addon
class AddonSerializer(serializers.ModelSerializer):
addon_type = serializers.SerializerMethodField('get_addon_type')... |
6ba1d1805a65ff7e07b795ed7b54fc3375a1e3e4 | main_AWS.py | main_AWS.py | def process_single_user(username, password):
try:
lingo = duolingo.Duolingo(username, password)
except ValueError:
raise Exception("Username Invalid")
print("Trying to Buy Streak Freeze for " + username)
if(lingo.buy_streak_freeze()):
print("Bought streak freeze for " + username... | def process_single_user(username, password):
import duolingo
try:
lingo = duolingo.Duolingo(username, password)
except ValueError:
raise Exception("Username Invalid")
stuff_to_purchase = ['streak_freeze', 'rupee_wager']
for item in stuff_to_purchase:
try:
print(... | UPdate to duolingo for the API | UPdate to duolingo for the API
| Python | mit | alexsanjoseph/duolingo-save-streak,alexsanjoseph/duolingo-save-streak | def process_single_user(username, password):
try:
lingo = duolingo.Duolingo(username, password)
except ValueError:
raise Exception("Username Invalid")
print("Trying to Buy Streak Freeze for " + username)
if(lingo.buy_streak_freeze()):
print("Bought streak freeze for " + username... | def process_single_user(username, password):
import duolingo
try:
lingo = duolingo.Duolingo(username, password)
except ValueError:
raise Exception("Username Invalid")
stuff_to_purchase = ['streak_freeze', 'rupee_wager']
for item in stuff_to_purchase:
try:
print(... | <commit_before>def process_single_user(username, password):
try:
lingo = duolingo.Duolingo(username, password)
except ValueError:
raise Exception("Username Invalid")
print("Trying to Buy Streak Freeze for " + username)
if(lingo.buy_streak_freeze()):
print("Bought streak freeze f... | def process_single_user(username, password):
import duolingo
try:
lingo = duolingo.Duolingo(username, password)
except ValueError:
raise Exception("Username Invalid")
stuff_to_purchase = ['streak_freeze', 'rupee_wager']
for item in stuff_to_purchase:
try:
print(... | def process_single_user(username, password):
try:
lingo = duolingo.Duolingo(username, password)
except ValueError:
raise Exception("Username Invalid")
print("Trying to Buy Streak Freeze for " + username)
if(lingo.buy_streak_freeze()):
print("Bought streak freeze for " + username... | <commit_before>def process_single_user(username, password):
try:
lingo = duolingo.Duolingo(username, password)
except ValueError:
raise Exception("Username Invalid")
print("Trying to Buy Streak Freeze for " + username)
if(lingo.buy_streak_freeze()):
print("Bought streak freeze f... |
fa36fc3301e7db47d72d0cd7c47bddf30cd7719d | 06_test/unit_test_func.py | 06_test/unit_test_func.py | #/usr/bin/env python
import unittest
from my_calc import my_add
class test_func(unittest.TestCase):
def test_my_add(self):
res = my_add(1, 2)
self.assertEqual(res, 3)
if __name__ == "__main__":
unittest.main()
| #/usr/bin/env python
import unittest
from my_calc import my_add
class test_func(unittest.TestCase):
def test_my_add(self):
print("Test begin")
res = my_add(1, 2)
self.assertEqual(res, 3)
def setUp(self):
print("Setup")
def tearDown(self):
print("Tear down")
if __na... | Test unit test constructor and destructor | Test unit test constructor and destructor
| Python | bsd-2-clause | zzz0072/Python_Exercises,zzz0072/Python_Exercises | #/usr/bin/env python
import unittest
from my_calc import my_add
class test_func(unittest.TestCase):
def test_my_add(self):
res = my_add(1, 2)
self.assertEqual(res, 3)
if __name__ == "__main__":
unittest.main()
Test unit test constructor and destructor | #/usr/bin/env python
import unittest
from my_calc import my_add
class test_func(unittest.TestCase):
def test_my_add(self):
print("Test begin")
res = my_add(1, 2)
self.assertEqual(res, 3)
def setUp(self):
print("Setup")
def tearDown(self):
print("Tear down")
if __na... | <commit_before>#/usr/bin/env python
import unittest
from my_calc import my_add
class test_func(unittest.TestCase):
def test_my_add(self):
res = my_add(1, 2)
self.assertEqual(res, 3)
if __name__ == "__main__":
unittest.main()
<commit_msg>Test unit test constructor and destructor<commit_after> | #/usr/bin/env python
import unittest
from my_calc import my_add
class test_func(unittest.TestCase):
def test_my_add(self):
print("Test begin")
res = my_add(1, 2)
self.assertEqual(res, 3)
def setUp(self):
print("Setup")
def tearDown(self):
print("Tear down")
if __na... | #/usr/bin/env python
import unittest
from my_calc import my_add
class test_func(unittest.TestCase):
def test_my_add(self):
res = my_add(1, 2)
self.assertEqual(res, 3)
if __name__ == "__main__":
unittest.main()
Test unit test constructor and destructor#/usr/bin/env python
import unittest
from m... | <commit_before>#/usr/bin/env python
import unittest
from my_calc import my_add
class test_func(unittest.TestCase):
def test_my_add(self):
res = my_add(1, 2)
self.assertEqual(res, 3)
if __name__ == "__main__":
unittest.main()
<commit_msg>Test unit test constructor and destructor<commit_after>#/... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.