commit stringlengths 40 40 | old_file stringlengths 4 150 | new_file stringlengths 4 150 | old_contents stringlengths 0 3.26k | new_contents stringlengths 1 4.43k | subject stringlengths 15 501 | message stringlengths 15 4.06k | lang stringclasses 4
values | license stringclasses 13
values | repos stringlengths 5 91.5k | diff stringlengths 0 4.35k |
|---|---|---|---|---|---|---|---|---|---|---|
b4e3461277669bf42225d278d491b7c714968491 | vm_server/test/execute_macro/code/execute.py | vm_server/test/execute_macro/code/execute.py | #!/usr/bin/python
"""Program to execute a VBA macro in MS Excel
"""
import os
import shutil
import win32com.client
import pythoncom
import repackage
repackage.up()
def execute_macro():
"""Execute VBA macro in MS Excel
"""
pythoncom.CoInitialize()
current_path = os.path.dirname(os.getcwd())
path_to_file = cu... | #!/usr/bin/python
"""Program to execute a VBA macro in MS Excel
"""
import os
import shutil
import win32com.client
import pythoncom
def execute_macro():
"""Execute VBA macro in MS Excel
"""
pythoncom.CoInitialize()
current_path = os.path.dirname(os.getcwd())
path_to_file = ".\\data\\excelsheet.xlsm"
if os... | Modify excel screenshot test so that it works with the new directory structure | Modify excel screenshot test so that it works with the new directory structure
| Python | apache-2.0 | googleinterns/automated-windows-vms,googleinterns/automated-windows-vms | ---
+++
@@ -5,8 +5,6 @@
import shutil
import win32com.client
import pythoncom
-import repackage
-repackage.up()
def execute_macro():
@@ -14,7 +12,7 @@
"""
pythoncom.CoInitialize()
current_path = os.path.dirname(os.getcwd())
- path_to_file = current_path + "\\action\\data\\excelsheet.xlsm"
+ path_to... |
c242ad95221c9c5b2f76795abd7dcbad5145cb2a | datagrid_gtk3/tests/utils/test_transformations.py | datagrid_gtk3/tests/utils/test_transformations.py | """Data transformation utilities test cases."""
import unittest
from datagrid_gtk3.utils.transformations import degree_decimal_str_transform
class DegreeDecimalStrTransformTest(unittest.TestCase):
"""Degree decimal string transformation test case."""
def test_no_basestring(self):
"""AssertionError... | """Data transformation utilities test cases."""
import unittest
from datagrid_gtk3.utils.transformations import degree_decimal_str_transform
class DegreeDecimalStrTransformTest(unittest.TestCase):
"""Degree decimal string transformation test case."""
def test_no_basestring(self):
"""AssertionError... | Add more test cases to verify transformer behavior | Add more test cases to verify transformer behavior
| Python | mit | nowsecure/datagrid-gtk3,jcollado/datagrid-gtk3 | ---
+++
@@ -33,6 +33,14 @@
'12.345678',
)
self.assertEqual(
+ degree_decimal_str_transform('1234567'),
+ '1.234567',
+ )
+ self.assertEqual(
degree_decimal_str_transform('123456'),
'0.123456',
)
+ self.assertE... |
5d6a96acd8018bc0c4ecbb684d6ebc17752c2796 | website_parameterized_snippet/__openerp__.py | website_parameterized_snippet/__openerp__.py | # -*- coding: utf-8 -*-
# © 2016 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Parameterize snippets",
"version": "8.0.1.0.0",
"author": "Therp BV,"
"Acsone SA/NV,"
"Odoo Community Association (OCA)",
"license": "AG... | # -*- coding: utf-8 -*-
# © 2016 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Parameterize snippets",
"version": "8.0.1.0.0",
"author": "Therp BV,"
"Acsone SA/NV,"
"Odoo Community Association (OCA).",
"license": "A... | Add dependency to website (not necessary before inheriting website.qweb.field.html, but makes sense anyway. | Add dependency to website (not necessary before inheriting website.qweb.field.html, but makes sense anyway.
| Python | agpl-3.0 | brain-tec/website,open-synergy/website,gfcapalbo/website,LasLabs/website,acsone/website,LasLabs/website,gfcapalbo/website,acsone/website,brain-tec/website,gfcapalbo/website,acsone/website,acsone/website,open-synergy/website,open-synergy/website,brain-tec/website,LasLabs/website,open-synergy/website,brain-tec/website,La... | ---
+++
@@ -6,8 +6,9 @@
"version": "8.0.1.0.0",
"author": "Therp BV,"
"Acsone SA/NV,"
- "Odoo Community Association (OCA)",
+ "Odoo Community Association (OCA).",
"license": "AGPL-3",
+ "depends": ['website'],
"category": "Website",
"installable": T... |
0d6d645f500f78f290d20f54cd94ca8614b1803a | server/dummy/dummy_server.py | server/dummy/dummy_server.py | #!/usr/bin/env python
import BaseHTTPServer
ServerClass = BaseHTTPServer.HTTPServer
RequestHandlerClass = BaseHTTPServer.BaseHTTPRequestHandler
SERVER_NAME = ''
SERVER_PORT = 9000
class JsonPostResponder(RequestHandlerClass):
def do_POST(self):
print '\n---> dummy server: got post!'
print 'comma... | #!/usr/bin/env python
import BaseHTTPServer
ServerClass = BaseHTTPServer.HTTPServer
RequestHandlerClass = BaseHTTPServer.BaseHTTPRequestHandler
SERVER_NAME = ''
SERVER_PORT = 9000
class JsonPostResponder(RequestHandlerClass):
def do_POST(self):
print '\n---> dummy server: got post!'
print 'comma... | Use ServerClass definition for server creation | Use ServerClass definition for server creation
| Python | mit | jonspeicher/Puddle,jonspeicher/Puddle,jonspeicher/Puddle | ---
+++
@@ -23,5 +23,5 @@
self.end_headers()
server_address = (SERVER_NAME, SERVER_PORT)
-httpd = BaseHTTPServer.HTTPServer(server_address, JsonPostResponder)
+httpd = ServerClass(server_address, JsonPostResponder)
httpd.serve_forever() |
e70780358dd5cf64ee51b590be1b69dc25a214fb | cla_backend/apps/cla_eventlog/management/commands/find_and_delete_old_cases.py | cla_backend/apps/cla_eventlog/management/commands/find_and_delete_old_cases.py | from django.core.management.base import BaseCommand
from dateutil.relativedelta import relativedelta
from legalaid.models import Case
from cla_butler.tasks import DeleteOldData
class FindAndDeleteCasesUsingCreationTime(DeleteOldData):
def get_eligible_cases(self):
self._setup()
two_years = self.n... | from django.core.management.base import BaseCommand
from dateutil.relativedelta import relativedelta
from legalaid.models import Case
from cla_butler.tasks import DeleteOldData
class FindAndDeleteCasesUsingCreationTime(DeleteOldData):
def get_eligible_cases(self):
self._setup()
two_years = self.n... | Make delete command message more meaningful | Make delete command message more meaningful | Python | mit | ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend | ---
+++
@@ -22,7 +22,7 @@
instance = FindAndDeleteCasesUsingCreationTime()
cases = instance.get_eligible_cases()
if len(args) == 0:
- print(cases.count())
+ print("Number of cases to be deleted: " + str(cases.count()))
elif args[0] == "test_find":
... |
8683e4317875d99281b79904efc81af8b15614e6 | pycon/sponsorship/managers.py | pycon/sponsorship/managers.py | from django.db import models
class SponsorManager(models.Manager):
def active(self):
return self.get_query_set().filter(active=True).order_by("level")
def with_weblogo(self):
queryset = self.raw("""
SELECT DISTINCT
"sponsorship_sponsor"."id",
"sponsorship_spon... | from django.db import models
class SponsorManager(models.Manager):
def active(self):
return self.get_queryset().filter(active=True).order_by("level")
def with_weblogo(self):
queryset = self.raw("""
SELECT DISTINCT
"sponsorship_sponsor"."id",
"sponsorship_spons... | Fix one more get_query_set to get_queryset | Fix one more get_query_set to get_queryset
| Python | bsd-3-clause | PyCon/pycon,njl/pycon,njl/pycon,PyCon/pycon,njl/pycon,Diwahars/pycon,Diwahars/pycon,Diwahars/pycon,njl/pycon,PyCon/pycon,Diwahars/pycon,PyCon/pycon | ---
+++
@@ -4,7 +4,7 @@
class SponsorManager(models.Manager):
def active(self):
- return self.get_query_set().filter(active=True).order_by("level")
+ return self.get_queryset().filter(active=True).order_by("level")
def with_weblogo(self):
queryset = self.raw(""" |
e8d56e5c47b370d1e4fcc3ccf575580d35a22dc8 | tx_salaries/management/commands/import_salary_data.py | tx_salaries/management/commands/import_salary_data.py | from os.path import basename
import sys
from django.core.management.base import BaseCommand
from ...utils import to_db, transformer
# TODO: Display help if unable to transform a file
# TODO: Switch to logging rather than direct output
class Command(BaseCommand):
def handle(self, *args, **kwargs):
verbos... | from os.path import basename
import sys
from django.core.management.base import BaseCommand
from ...utils import to_db, transformer
# TODO: Display help if unable to transform a file
# TODO: Switch to logging rather than direct output
class Command(BaseCommand):
def handle(self, *args, **kwargs):
verbos... | Add a newline between files | Add a newline between files
| Python | apache-2.0 | texastribune/tx_salaries,texastribune/tx_salaries | ---
+++
@@ -28,3 +28,7 @@
if verbosity >= 2:
sys.stdout.write('.')
sys.stdout.flush()
+
+ if verbosity >= 2:
+ sys.stdout.write('\n')
+ sys.stdout.flush() |
f4d66a5820582c995f1d31fe6a2442fc42d71077 | saulify/scrapers/newspaper.py | saulify/scrapers/newspaper.py | from __future__ import absolute_import
from flask import Markup
from newspaper import Article
from xml.etree import ElementTree
import markdown2
import html2text
def clean_content(url_to_clean):
article = Article(url_to_clean)
article.download()
article.parse()
html_string = ElementTree.tostring(a... | from __future__ import absolute_import
from flask import Markup
from newspaper import Article
from xml.etree import ElementTree
import markdown2
import html2text
def clean_content(url_to_clean):
""" Parse an article at a given url using newspaper.
Args:
url (str): Url where the article is found.
... | Split `clean_content` into component functions | Split `clean_content` into component functions
Provides ability to use newspaper to parse articles whose source has
already been downloaded.
| Python | agpl-3.0 | asm-products/saulify-web,asm-products/saulify-web,asm-products/saulify-web | ---
+++
@@ -9,10 +9,53 @@
def clean_content(url_to_clean):
+ """ Parse an article at a given url using newspaper.
+
+ Args:
+ url (str): Url where the article is found.
+
+ Returns:
+ Dictionary providing cleaned article and extracted content
+ (see `construct_result`).
+ """
... |
b0de066ebaf81745878c1c4d3adf803445a0cfc5 | scrapi/processing/postgres.py | scrapi/processing/postgres.py | from __future__ import absolute_import
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.api.settings")
# import django
import logging
from scrapi import events
from scrapi.processing.base import BaseProcessor
from api.webview.models import Document
# django.setup()
logger = logging.getLogger(__name_... | from __future__ import absolute_import
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.api.settings")
import logging
from scrapi import events
from scrapi.processing.base import BaseProcessor
from api.webview.models import Document
logger = logging.getLogger(__name__)
class PostgresProcessor(BaseP... | Fix document query for existing documents | Fix document query for existing documents
| Python | apache-2.0 | fabianvf/scrapi,CenterForOpenScience/scrapi,fabianvf/scrapi,CenterForOpenScience/scrapi,mehanig/scrapi,felliott/scrapi,felliott/scrapi,erinspace/scrapi,erinspace/scrapi,mehanig/scrapi | ---
+++
@@ -3,15 +3,12 @@
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.api.settings")
-# import django
import logging
from scrapi import events
from scrapi.processing.base import BaseProcessor
from api.webview.models import Document
-
-# django.setup()
logger = logging.getLogger(__nam... |
412dc6e29e47148758382646dd65e0a9c5ff4505 | pymanopt/tools/autodiff/__init__.py | pymanopt/tools/autodiff/__init__.py | class Function(object):
def __init__(self, function, arg, backend):
self._function = function
self._arg = arg
self._backend = backend
self._verify_backend()
self._compile()
def _verify_backend(self):
if not self._backend.is_available():
raise ValueEr... | from ._callable import CallableBackend
from ._autograd import AutogradBackend
from ._pytorch import PyTorchBackend
from ._theano import TheanoBackend
from ._tensorflow import TensorflowBackend
class Function(object):
def __init__(self, function, arg, backend):
self._function = function
self._arg =... | Revert "autodiff: remove unused imports" | Revert "autodiff: remove unused imports"
This reverts commit d0ad4944671d94673d0051bd8faf4f3cf5d93ca9.
| Python | bsd-3-clause | pymanopt/pymanopt,pymanopt/pymanopt,nkoep/pymanopt,nkoep/pymanopt,nkoep/pymanopt | ---
+++
@@ -1,3 +1,10 @@
+from ._callable import CallableBackend
+from ._autograd import AutogradBackend
+from ._pytorch import PyTorchBackend
+from ._theano import TheanoBackend
+from ._tensorflow import TensorflowBackend
+
+
class Function(object):
def __init__(self, function, arg, backend):
self._fu... |
b16474b4523e8e804f28188ba74c992896748efe | broctl/Napatech.py | broctl/Napatech.py | import BroControl.plugin
import BroControl.config
class Napatech(BroControl.plugin.Plugin):
def __init__(self):
super(Napatech, self).__init__(apiversion=1)
def name(self):
return 'napatech'
def pluginVersion(self):
return 1
def init(self):
# Use this plugin only... | import BroControl.plugin
import BroControl.config
class Napatech(BroControl.plugin.Plugin):
def __init__(self):
super(Napatech, self).__init__(apiversion=1)
def name(self):
return 'napatech'
def pluginVersion(self):
return 1
def init(self):
# Use this plugin only... | Fix minor bug in broctl plugin. | Fix minor bug in broctl plugin.
| Python | bsd-3-clause | hosom/bro-napatech,hosom/bro-napatech | ---
+++
@@ -31,6 +31,7 @@
def broctl_config(self):
+ script = ''
script += '# Settings for configuring Napatech interractions'
script += '\nredef Napatech::dedupe_lru_size = {0};'.format(self.getOption('dedupe_lru_size'))
script += '\nredef Napatech::host_buffer_allowance = ... |
7c894c716cb712bbcb137df3a5df5548bdca9d93 | wafer/sponsors/migrations/0005_sponsorshippackage_symbol.py | wafer/sponsors/migrations/0005_sponsorshippackage_symbol.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sponsors', '0004_auto_20160813_1328'),
]
operations = [
migrations.AddField(
model_name='sponsorshippackage',
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sponsors', '0004_auto_20160813_1328'),
]
operations = [
migrations.AddField(
model_name='sponsorshippackage',
... | Update the migration to changed text | Update the migration to changed text
| Python | isc | CTPUG/wafer,CTPUG/wafer,CTPUG/wafer,CTPUG/wafer | ---
+++
@@ -14,6 +14,6 @@
migrations.AddField(
model_name='sponsorshippackage',
name='symbol',
- field=models.CharField(help_text='Optional symbol to display next to sponsors backing at this level sponsors list', max_length=1, blank=True),
+ field=models.CharFi... |
3b366b32afedfd4bdae45ed5811d37679b3def0b | skyfield/tests/test_trigonometry.py | skyfield/tests/test_trigonometry.py | from skyfield.trigonometry import position_angle_of
from skyfield.units import Angle
def test_position_angle():
a = Angle(degrees=0), Angle(degrees=0)
b = Angle(degrees=1), Angle(degrees=1)
assert str(position_angle_of(a, b)) == '315deg 00\' 15.7"'
| from skyfield.api import Angle, Topos, load, load_file
from skyfield.trigonometry import position_angle_of
def test_position_angle():
a = Angle(degrees=0), Angle(degrees=0)
b = Angle(degrees=1), Angle(degrees=1)
assert str(position_angle_of(a, b)) == '315deg 00\' 15.7"'
def test_position_angle_against_nas... | Add test of Position Angle from NASA HORIZONS | Add test of Position Angle from NASA HORIZONS
| Python | mit | skyfielders/python-skyfield,skyfielders/python-skyfield | ---
+++
@@ -1,7 +1,27 @@
+from skyfield.api import Angle, Topos, load, load_file
from skyfield.trigonometry import position_angle_of
-from skyfield.units import Angle
def test_position_angle():
a = Angle(degrees=0), Angle(degrees=0)
b = Angle(degrees=1), Angle(degrees=1)
assert str(position_angle_o... |
216216df9e3b42766a755f63519c84fda2fcebe0 | amy/workshops/migrations/0221_workshoprequest_rq_jobs.py | amy/workshops/migrations/0221_workshoprequest_rq_jobs.py | # Generated by Django 2.2.13 on 2020-10-25 18:35
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('workshops', '0220_event_public_status'),
]
operations = [
migrations.AddField(
model_name='workshoprequest',
name='... | # Generated by Django 2.2.13 on 2020-10-25 18:35
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('workshops', '0221_auto_20201025_1113'),
]
operations = [
migrations.AddField(
model_name='workshoprequest',
name='r... | Fix migrations conflict after rebase | Fix migrations conflict after rebase
| Python | mit | swcarpentry/amy,pbanaszkiewicz/amy,pbanaszkiewicz/amy,pbanaszkiewicz/amy,swcarpentry/amy,swcarpentry/amy | ---
+++
@@ -6,7 +6,7 @@
class Migration(migrations.Migration):
dependencies = [
- ('workshops', '0220_event_public_status'),
+ ('workshops', '0221_auto_20201025_1113'),
]
operations = [ |
fda634ca2457716c33842cd0d285c20a0478601a | bugle_project/configs/development/settings.py | bugle_project/configs/development/settings.py | from bugle_project.configs.settings import *
FAYE_URL = None
DATABASE_ENGINE = 'postgresql_psycopg2'
DATABASE_NAME = 'bugle'
DATABASE_USER = 'bugle'
| from bugle_project.configs.settings import *
FAYE_ENABLED = False
FAYE_URL = None
DATABASE_ENGINE = 'postgresql_psycopg2'
DATABASE_NAME = 'bugle'
DATABASE_USER = 'bugle'
| Disable Faye on development, for now. | Disable Faye on development, for now.
| Python | bsd-2-clause | devfort/bugle,devfort/bugle,devfort/bugle | ---
+++
@@ -1,5 +1,6 @@
from bugle_project.configs.settings import *
+FAYE_ENABLED = False
FAYE_URL = None
DATABASE_ENGINE = 'postgresql_psycopg2' |
536283e3dbbe6b549778d286401e08c6abeadff5 | dashboard/views.py | dashboard/views.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.mixins import (LoginRequiredMixin,
PermissionRequiredMixin)
from django.urls import reverse
from django.views.generic.base import TemplateView, RedirectView
from django.views.generic.detail ... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.mixins import (LoginRequiredMixin,
PermissionRequiredMixin)
from django.urls import reverse
from django.views.generic.base import TemplateView, RedirectView
from django.views.generic.detail ... | Handle dashboard redirect when there are no Child objects. | Handle dashboard redirect when there are no Child objects.
| Python | bsd-2-clause | cdubz/babybuddy,cdubz/babybuddy,cdubz/babybuddy | ---
+++
@@ -13,7 +13,11 @@
class DashboardRedirect(LoginRequiredMixin, RedirectView):
# Show the overall dashboard or a child dashboard if one Child instance.
def get(self, request, *args, **kwargs):
- if Child.objects.count() == 1:
+ children = Child.objects.count()
+ if children == 0... |
226143945b3de994c68ef0b705eadfca330d9141 | setup.py | setup.py | from setuptools import setup, find_packages
import cplcom
setup(
name='CPLCom',
version=cplcom.__version__,
packages=find_packages(),
package_data={'cplcom': ['../media/*', '*.kv']},
install_requires=['moa', 'kivy'],
author='Matthew Einhorn',
author_email='moiein2000@gmail.com',
licens... | from setuptools import setup, find_packages
import cplcom
setup(
name='CPLCom',
version=cplcom.__version__,
packages=find_packages(),
package_data={'cplcom': ['../media/*', '/*.kv']},
install_requires=['moa', 'kivy'],
author='Matthew Einhorn',
author_email='moiein2000@gmail.com',
licen... | Include kv files in package. | Include kv files in package.
| Python | mit | matham/cplcom | ---
+++
@@ -6,7 +6,7 @@
name='CPLCom',
version=cplcom.__version__,
packages=find_packages(),
- package_data={'cplcom': ['../media/*', '*.kv']},
+ package_data={'cplcom': ['../media/*', '/*.kv']},
install_requires=['moa', 'kivy'],
author='Matthew Einhorn',
author_email='moiein2000@g... |
38a0328aaf6599412e56f4dec97d8ee9cef6e16c | setup.py | setup.py | # -*- coding: utf8 -*-
import os
from setuptools import setup, find_packages
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'
setup(
name="django-basis",
version='0.1.9',
url='http://github.com/frecar/django-basis',
author='Fredrik Nygård Carlsen',
author_email='me@frecar.no',
descripti... | # -*- coding: utf8 -*-
import os
from setuptools import setup, find_packages
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'
setup(
name="django-basis",
version='0.2.0',
url='http://github.com/frecar/django-basis',
author='Fredrik Nygård Carlsen',
author_email='me@frecar.no',
descripti... | Set upgrade to version 0.2.0 | Set upgrade to version 0.2.0
| Python | mit | frecar/django-basis | ---
+++
@@ -6,7 +6,7 @@
setup(
name="django-basis",
- version='0.1.9',
+ version='0.2.0',
url='http://github.com/frecar/django-basis',
author='Fredrik Nygård Carlsen',
author_email='me@frecar.no', |
10cd8149fe3eb911791c2188ffcafae5b66bfd21 | setup.py | setup.py | from setuptools import find_packages, setup
NAME = 'kaggle_tools'
VERSION = '0.0.1'
AUTHOR = 'Yassine Alouini'
DESCRIPTION = """This is a suite of tools to help you participate in various
Kaggle competitions"""
setup(
name=NAME,
version=VERSION,
packages=find_packages(),
# Some metadata
author=AU... | from setuptools import find_packages, setup
NAME = 'kaggle_tools'
VERSION = '0.0.1'
AUTHOR = 'Yassine Alouini'
DESCRIPTION = """This is a suite of tools to help you participate in various
Kaggle competitions"""
EMAIL = "yassinealouini@outlook.com"
URL = ""
setup(
name=NAME,
version=VERSION,
packages=find_... | Add missing required metadata for registering | Add missing required metadata for registering
| Python | mit | yassineAlouini/kaggle-tools,yassineAlouini/kaggle-tools | ---
+++
@@ -5,7 +5,8 @@
AUTHOR = 'Yassine Alouini'
DESCRIPTION = """This is a suite of tools to help you participate in various
Kaggle competitions"""
-
+EMAIL = "yassinealouini@outlook.com"
+URL = ""
setup(
name=NAME,
@@ -13,7 +14,9 @@
packages=find_packages(),
# Some metadata
author=AUTHOR... |
957b5045e5c1d2c3d2f3b27074341cb8c5fb6128 | setup.py | setup.py | import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
config = {
'name': 'clouseau',
'description': 'A silly git repo inspector',
'long_description': None ,
# Needs to be restructed text
# os.path.join(os.path.dirname(__f... | import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
config = {
'name': 'clouseau',
'description': 'A silly git repo inspector',
'long_description': None ,
# Needs to be restructed text
# os.path.join(os.path.dirname(__f... | Include subdirectories in pip install | Include subdirectories in pip install
| Python | cc0-1.0 | marcesher/clouseau,contolini/clouseau,contolini/clouseau,willbarton/clouseau,marcesher/clouseau,marcesher/clouseau,contolini/clouseau,willbarton/clouseau,willbarton/clouseau | ---
+++
@@ -12,7 +12,7 @@
# Needs to be restructed text
# os.path.join(os.path.dirname(__file__), 'README.md').read()
-
+
'author': 'bill shelton',
'url': 'https://github.com/cfpb/clouseau',
'download_url': 'http://tbd.com',
@@ -20,9 +20,10 @@
'version': '0.2.0',
'inst... |
d7f07474326610bd6a01ac63157125b0ac43d450 | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from setuptools import setup
from github_backup import __version__
def open_file(fname):
return open(os.path.join(os.path.dirname(__file__), fname))
setup(
name='github-backup',
version=__version__,
author='Jose Diaz-Gonzalez',
author_emai... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from setuptools import setup
from github_backup import __version__
def open_file(fname):
return open(os.path.join(os.path.dirname(__file__), fname))
setup(
name='github-backup',
version=__version__,
author='Jose Diaz-Gonzalez',
author_emai... | Remove support for python 2.7 in package classifiers | Remove support for python 2.7 in package classifiers
| Python | mit | josegonzalez/python-github-backup,josegonzalez/python-github-backup | ---
+++
@@ -23,7 +23,6 @@
'Development Status :: 5 - Production/Stable',
'Topic :: System :: Archiving :: Backup',
'License :: OSI Approved :: MIT License',
- 'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.5',
'Programming Language :: ... |
5b3a21390f5edf501aa47db921422d3198719099 | setup.py | setup.py | #!/usr/bin/env python
import os
from setuptools import setup, find_packages
def long_description():
"""
Build the long description from a README file located in the same directory
as this module.
"""
base_path = os.path.dirname(os.path.realpath(__file__))
readme = open(os.path.join(base_path, ... | #!/usr/bin/env python
import os
from setuptools import setup, find_packages
def long_description():
"""
Build the long description from a README file located in the same directory
as this module.
"""
base_path = os.path.dirname(os.path.realpath(__file__))
readme = open(os.path.join(base_path, ... | Mark version as 2.0 beta for now | Mark version as 2.0 beta for now
| Python | mit | SmileyChris/django-countries,basichash/django-countries,rahimnathwani/django-countries,maximzxc/django-countries,jrfernandes/django-countries,pimlie/django-countries,velfimov/django-countries,schinckel/django-countries,fladi/django-countries | ---
+++
@@ -18,7 +18,7 @@
setup(
name='django-countries',
- version='2.0',
+ version='2.0b',
description='Provides a country field for Django models.',
long_description=long_description(),
author='Chris Beaven', |
88bf4171ff58bcf35eab39efe78d7007e380f133 | setup.py | setup.py | try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup
setup(name='parcels',
version='0.0.1',
description="""Framework for Lagrangian tracking of virtual
ocean particles in the petascale age.""",
author="Imperial College London",
use_... | """Install Parcels and dependencies."""
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup
setup(name='parcels',
version='0.0.1',
description="""Framework for Lagrangian tracking of virtual
ocean particles in the petascale age.""",
aut... | Include examples and scripts and comply with PEP8 | Include examples and scripts and comply with PEP8
| Python | mit | OceanPARCELS/parcels,OceanPARCELS/parcels | ---
+++
@@ -1,3 +1,5 @@
+"""Install Parcels and dependencies."""
+
try:
from setuptools import setup, find_packages
except ImportError:
@@ -10,6 +12,6 @@
author="Imperial College London",
use_scm_version=True,
setup_requires=['setuptools_scm'],
- packages=find_packages(exclude=['docs'... |
315933e24a19e01875fa7fcf182b5db905d5eff1 | setup.py | setup.py | from setuptools import setup
setup(name='exponent_server_sdk',
version='0.0.1',
description='Exponent Server SDK for Python',
url='https://github.com/exponentjs/exponent-server-sdk-python',
author='Exponent Team',
author_email='exponent.team@gmail.com',
license='MIT',
install_requires=[
... | from setuptools import setup
setup(name='exponent_server_sdk',
version='0.0.1',
description='Exponent Server SDK for Python',
url='https://github.com/exponent/exponent-server-sdk-python',
author='Exponent Team',
author_email='exponent.team@gmail.com',
license='MIT',
install_requires=[
... | Rename exponentjs references in our libraries | Rename exponentjs references in our libraries
fbshipit-source-id: 21072ac
| Python | mit | exponentjs/exponent-server-sdk-python | ---
+++
@@ -3,7 +3,7 @@
setup(name='exponent_server_sdk',
version='0.0.1',
description='Exponent Server SDK for Python',
- url='https://github.com/exponentjs/exponent-server-sdk-python',
+ url='https://github.com/exponent/exponent-server-sdk-python',
author='Exponent Team',
author_email='ex... |
ca2195fd99dc02e3e3d64b85003fcf27ddf4e897 | setup.py | setup.py | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
install_requires = (
)
description = "An archive for Connexions documents."
setup(
name='cnx-archive',
version='0.1',
author='Connexions team',
author_email='info@cnx.org',
url="https://github.com/connexions/cnx-archive",
... | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
install_requires = (
'PasteDeploy',
'psycopg2',
)
description = "An archive for Connexions documents."
setup(
name='cnx-archive',
version='0.1',
author='Connexions team',
author_email='info@cnx.org',
url="https://git... | Add dependencies, psycopg2 for Postgres integration and PasteDeploy for configuration file support. | Add dependencies, psycopg2 for Postgres integration and PasteDeploy for configuration file support.
| Python | agpl-3.0 | Connexions/cnx-archive,Connexions/cnx-archive | ---
+++
@@ -3,6 +3,8 @@
install_requires = (
+ 'PasteDeploy',
+ 'psycopg2',
)
description = "An archive for Connexions documents."
|
355d71bb600df850b3914772d0dca9e0a68e64c8 | setup.py | setup.py | #!/usr/bin/env python
from distutils.core import setup
setup(name="django-sanitizer",
version="0.3",
description="Django template filter application for sanitizing user submitted HTML",
author="Calvin Spealman",
url="http://github.com/caktus/django-sanitizer",
packages=['sanitizer', 'sa... | #!/usr/bin/env python
from distutils.core import setup
setup(name="django-sanitizer",
version="0.4",
description="Django template filter application for sanitizing user submitted HTML",
author="Caktus Consulting Group",
maintainer="Calvin Spealman",
maintainer_email="calvin@caktusgroup.... | Make caktus the owner, listing myself as a maintainer. | Make caktus the owner, listing myself as a maintainer.
| Python | bsd-3-clause | caktus/django-sanitizer | ---
+++
@@ -4,9 +4,11 @@
setup(name="django-sanitizer",
- version="0.3",
+ version="0.4",
description="Django template filter application for sanitizing user submitted HTML",
- author="Calvin Spealman",
+ author="Caktus Consulting Group",
+ maintainer="Calvin Spealman",
+ mai... |
51f36e512b30ef19f0ee213995be9865d5123f6e | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name = "django-report-builder",
version = "2.0.2",
author = "David Burke",
author_email = "david@burkesoftware.com",
description = ("Query and Report builder for Django ORM"),
license = "BSD",
keywords = "django report",
url = "https://... | from setuptools import setup, find_packages
setup(
name = "django-report-builder",
version = "2.0.2",
author = "David Burke",
author_email = "david@burkesoftware.com",
description = ("Query and Report builder for Django ORM"),
license = "BSD",
keywords = "django report",
url = "https://... | Remove south from test requirements | Remove south from test requirements
| Python | bsd-3-clause | altanawealth/django-report-builder,AbhiAgarwal/django-report-builder,BrendanBerkley/django-report-builder,AbhiAgarwal/django-report-builder,BrendanBerkley/django-report-builder,BrendanBerkley/django-report-builder,altanawealth/django-report-builder,AbhiAgarwal/django-report-builder,altanawealth/django-report-builder | ---
+++
@@ -14,7 +14,6 @@
test_suite='setuptest.setuptest.SetupTestSuite',
tests_require=(
'django-setuptest',
- 'south',
'argparse',
),
classifiers=[ |
4cfd8159ad33c88ef66837ed4bcb6d5c927d2d2c | setup.py | setup.py | import os.path
from ez_setup import use_setuptools
use_setuptools(min_version='0.6')
from setuptools import setup, find_packages
# read README as the long description
readme = 'README' if os.path.exists('README') else 'README.md'
with open(readme, 'r') as f:
long_description = f.read()
setup(
name='spandex'... | import os.path
from ez_setup import use_setuptools
use_setuptools(min_version='0.6')
from setuptools import setup, find_packages
# read README as the long description
readme = 'README' if os.path.exists('README') else 'README.md'
with open(readme, 'r') as f:
long_description = f.read()
setup(
name='spandex'... | Add six package version specifier | Add six package version specifier
| Python | bsd-3-clause | UDST/spandex,SANDAG/spandex | ---
+++
@@ -28,7 +28,7 @@
'GeoAlchemy2>=0.2.1', # Bug fix for schemas other than public.
'pandas>=0.13.1',
'psycopg2>=2.5', # connection and cursor context managers.
- 'six',
+ 'six>=1.4', # Mapping for urllib.
'SQLAlchemy>=0.8' # GeoAlchemy2 suppor... |
21cd0c4358cf97896af03ea05a2f1ee68ef06669 | setup.py | setup.py | import sys
from setuptools import setup, find_packages
from django_summernote import version, PROJECT
MODULE_NAME = 'django_summernote'
PACKAGE_DATA = list()
CLASSIFIERS = [
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
... | import sys
from setuptools import setup, find_packages
from django_summernote import version, PROJECT
MODULE_NAME = 'django_summernote'
PACKAGE_DATA = list()
CLASSIFIERS = [
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
... | Add extra_require for development deps | Add extra_require for development deps
| Python | mit | summernote/django-summernote,summernote/django-summernote,summernote/django-summernote | ---
+++
@@ -38,4 +38,11 @@
classifiers=CLASSIFIERS,
install_requires=['django', 'bleach'],
+ extras_require={
+ 'dev': [
+ 'django-dummy-plug',
+ 'pytest',
+ 'pytest-django',
+ ]
+ },
) |
de1c551641216157da11039c2a732785b4bf9ce7 | setup.py | setup.py | from setuptools import setup
with open('README.md') as f:
description = f.read()
from beewarn import VERSION
setup(name='beewarn',
version=VERSION,
description='Utility for warning about bees',
author='Alistair Lynn',
author_email='arplynn@gmail.com',
license='MIT',
long_descr... | from setuptools import setup
from beewarn import VERSION
setup(name='beewarn',
version=VERSION,
description='Utility for warning about bees',
author='Alistair Lynn',
author_email='arplynn@gmail.com',
license='MIT',
url='https://github.com/prophile/beewarn',
zip_safe=True,
... | Remove the README.md loading step | Remove the README.md loading step
| Python | mit | prophile/beewarn | ---
+++
@@ -1,7 +1,4 @@
from setuptools import setup
-
-with open('README.md') as f:
- description = f.read()
from beewarn import VERSION
@@ -11,7 +8,6 @@
author='Alistair Lynn',
author_email='arplynn@gmail.com',
license='MIT',
- long_description=description,
url='https://git... |
89bb9c31e0e35f4d5bdacca094581ff8bcc213d2 | setup.py | setup.py | from setuptools import setup
try:
import pypandoc
long_description = pypandoc.convert('README.md', 'rst')
except(IOError, ImportError):
long_description = open('README.md').read()
setup(
name='dacite',
version='0.0.14',
description='Simple creation of data classes from dictionaries.',
lon... | from setuptools import setup
setup(
name='dacite',
version='0.0.15',
description='Simple creation of data classes from dictionaries.',
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
author='Konrad Hałas',
author_email='halas.konrad@gmail.com',
... | Use Markdown description instead of pandoc conversion hack. Bump version. | Use Markdown description instead of pandoc conversion hack. Bump version.
| Python | mit | konradhalas/dacite | ---
+++
@@ -1,17 +1,11 @@
from setuptools import setup
-
-try:
- import pypandoc
-
- long_description = pypandoc.convert('README.md', 'rst')
-except(IOError, ImportError):
- long_description = open('README.md').read()
setup(
name='dacite',
- version='0.0.14',
+ version='0.0.15',
descripti... |
b1563fb01ece4b4c01641b01ab33fd5993d4f16a | setup.py | setup.py | #!/usr/bin/env python
# Copyright 2009, 2012 Dietrich Epp <depp@zdome.net>
# See LICENSE.txt for details.
from distutils.core import setup
setup(name='IdioTest',
version='0.1',
description='Idiotic testing framework',
author='Dietrich Epp',
author_email='depp@zdome.net',
packages=['idiotes... | #!/usr/bin/env python
# Copyright 2009, 2012 Dietrich Epp <depp@zdome.net>
# See LICENSE.txt for details.
from distutils.core import setup
setup(name='IdioTest',
version='0.1',
description='Simple testing framework',
author='Dietrich Epp',
author_email='depp@zdome.net',
packages=['idiotest... | Scrub references to "Idiotic" testing framework | Scrub references to "Idiotic" testing framework
| Python | bsd-2-clause | depp/idiotest,depp/idiotest | ---
+++
@@ -4,7 +4,7 @@
from distutils.core import setup
setup(name='IdioTest',
version='0.1',
- description='Idiotic testing framework',
+ description='Simple testing framework',
author='Dietrich Epp',
author_email='depp@zdome.net',
packages=['idiotest']) |
55fced15a69c07dc2b5fea9b25f244a0d1fa88c8 | setup.py | setup.py | # -*- coding: utf-8 -*-
#
# setup.py
# colorific
#
"""
Package information for colorific.
"""
import os
from setuptools import setup
readme = os.path.join(os.path.dirname(__file__), 'README.md')
setup(
name='colorific',
version='0.2.0',
description='Automatic color palette detection',
long_descrip... | # -*- coding: utf-8 -*-
#
# setup.py
# colorific
#
"""
Package information for colorific.
"""
import os
from setuptools import setup
readme = os.path.join(os.path.dirname(__file__), 'README.md')
setup(
name='colorific',
version='0.2.0',
description='Automatic color palette detection',
long_descrip... | Update repo URL to github. | Update repo URL to github.
| Python | isc | 99designs/colorific | ---
+++
@@ -20,7 +20,7 @@
long_description=open(readme).read(),
author='Lars Yencken',
author_email='lars@yencken.org',
- url='http://bitbucket.org/larsyencken/palette-detect',
+ url='http://github.com/99designs/colorific',
py_modules=['colorific'],
install_requires=[
'PIL>... |
96fd8b71fd425d251e9cc07e8cc65b4fc040d857 | samples/nanomsg/hello_world.py | samples/nanomsg/hello_world.py | import os.path
import shutil
import tempfile
import threading
import sys
import nanomsg as nn
def ping(url, event):
with nn.Socket(protocol=nn.Protocol.NN_PUSH) as sock, sock.connect(url):
event.wait()
sock.send(b'Hello, World!')
def pong(url, event):
with nn.Socket(protocol=nn.Protocol.NN_... | import threading
import sys
import nanomsg as nn
def ping(url, barrier):
with nn.Socket(protocol=nn.Protocol.NN_PUSH) as sock, sock.connect(url):
sock.send(b'Hello, World!')
# Shutdown the endpoint after the other side ack'ed; otherwise
# the message could be lost.
barrier.wait()
... | Fix message lost issue in samples | Fix message lost issue in samples
| Python | mit | clchiou/garage,clchiou/garage,clchiou/garage,clchiou/garage | ---
+++
@@ -1,41 +1,36 @@
-import os.path
-import shutil
-import tempfile
import threading
import sys
import nanomsg as nn
-def ping(url, event):
+def ping(url, barrier):
with nn.Socket(protocol=nn.Protocol.NN_PUSH) as sock, sock.connect(url):
- event.wait()
sock.send(b'Hello, World!')
+... |
c464887817334cd1dbc3c4587f185ec7ea598fda | setup.py | setup.py | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from codecs import open # To use a consistent encoding
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the relevant file
with open(path.join(here, 'README.txt'), encoding='utf-8') as f:
long_descri... | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import os
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
def read(fname):... | Enable versioning using Git tags, rendering of README in markdown syntax and limit depenencies by version. | Enable versioning using Git tags, rendering of README in markdown syntax and limit depenencies by version.
| Python | mit | agrav/freesif | ---
+++
@@ -1,33 +1,41 @@
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
-from codecs import open # To use a consistent encoding
-from os import path
+import os
-here = path.abspath(path.dirname(__file__))
-# Get the long description from the relevant file
-with open(path.join(here, 'READM... |
77f8e99ca67489caa75aceb76f79fd5a5d32ded8 | setup.py | setup.py | from distutils.core import setup
import re
def get_version():
init_py = open('pykka/__init__.py').read()
metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", init_py))
return metadata['version']
setup(
name='Pykka',
version=get_version(),
author='Stein Magnus Jodal',
author_email='stei... | from distutils.core import setup
import re
def get_version():
init_py = open('pykka/__init__.py').read()
metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", init_py))
return metadata['version']
setup(
name='Pykka',
version=get_version(),
author='Stein Magnus Jodal',
author_email='stei... | Add more Python version/implementation classifiers | pypi: Add more Python version/implementation classifiers
| Python | apache-2.0 | jodal/pykka,tamland/pykka,tempbottle/pykka | ---
+++
@@ -22,9 +22,14 @@
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
+ 'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language... |
a0c5589060725004b6baadaa32cc0d23d157bacf | setup.py | setup.py | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='7.0.2',
packages=['todoist', 'todoist.managers'],
author='Doist Team'... | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='7.0.3',
packages=['todoist', 'todoist.managers'],
author='Doist Team'... | Update the PyPI version to 7.0.3. | Update the PyPI version to 7.0.3.
| Python | mit | Doist/todoist-python | ---
+++
@@ -10,7 +10,7 @@
setup(
name='todoist-python',
- version='7.0.2',
+ version='7.0.3',
packages=['todoist', 'todoist.managers'],
author='Doist Team',
author_email='info@todoist.com', |
1c15f3f6aeed2384353c3e1efc5bcf7551b88850 | setup.py | setup.py | from distutils.core import setup
import gutter
setup(
name = u'gutter',
version = gutter.__version__,
author = gutter.__author__,
author_email = u'william@subtlecoolness.com',
url = u'https://gutter.readthedocs.org/',
description = u'Rainwave client framework',
packages = [u'gutter'],
... | from distutils.core import setup
import gutter
setup(
name = u'gutter',
version = gutter.__version__,
author = gutter.__author__,
author_email = u'william@subtlecoolness.com',
url = u'https://gutter.readthedocs.org/',
description = u'Rainwave client framework',
packages = ['gutter'],
c... | Package name must be string, not Unicode | Package name must be string, not Unicode
| Python | mit | williamjacksn/python-rainwave-client | ---
+++
@@ -9,7 +9,7 @@
author_email = u'william@subtlecoolness.com',
url = u'https://gutter.readthedocs.org/',
description = u'Rainwave client framework',
- packages = [u'gutter'],
+ packages = ['gutter'],
classifiers = [
u'Development Status :: 3 - Alpha',
u'Intended Audi... |
8e3abcd310b7e932d769f05fa0a7135cc1a53b76 | setup.py | setup.py | from cx_Freeze import setup, Executable
# Dependencies are automatically detected, but it might need
# fine tuning.
build_exe_options = {
"excludes": [
"numpy"
],
"bin_includes": [
"libcrypto.so.1.0.0",
"libssl.so.1.0.0"
],
"packages": [
"_cffi_backend",
"app... | from cx_Freeze import setup, Executable
# Dependencies are automatically detected, but it might need
# fine tuning.
build_exe_options = {
"bin_includes": [
"libcrypto.so.1.0.0",
"libssl.so.1.0.0"
],
"includes": [
"numpy",
"numpy.core._methods",
"numpy.lib",
"... | Include missing numpy modules in build | Include missing numpy modules in build
| Python | mit | igboyes/virtool,virtool/virtool,igboyes/virtool,virtool/virtool | ---
+++
@@ -3,12 +3,15 @@
# Dependencies are automatically detected, but it might need
# fine tuning.
build_exe_options = {
- "excludes": [
- "numpy"
- ],
"bin_includes": [
"libcrypto.so.1.0.0",
"libssl.so.1.0.0"
+ ],
+ "includes": [
+ "numpy",
+ "numpy.core.... |
f9094d47d138ecd7ece6e921b9a10a7c79eed629 | setup.py | setup.py | from setuptools import setup
setup(
name='cmsplugin-biography',
version='0.0.1',
packages='cmsplugin_biography',
install_requires=[
'django-cms',
'djangocms-text-ckeditor==1.0.9',
'easy-thumbnails==1.2',
],
author='Kevin Richardson',
author_email='kevin@magically.us... | from setuptools import setup
setup(
name='cmsplugin-biography',
version='0.0.1',
packages=['cmsplugin_biography', ],
install_requires=[
'django-cms',
'djangocms-text-ckeditor==1.0.9',
'easy-thumbnails==1.2',
],
author='Kevin Richardson',
author_email='kevin@magicall... | Convert `packages` to a list | Convert `packages` to a list
| Python | mit | kfr2/cmsplugin-biography | ---
+++
@@ -4,7 +4,7 @@
setup(
name='cmsplugin-biography',
version='0.0.1',
- packages='cmsplugin_biography',
+ packages=['cmsplugin_biography', ],
install_requires=[
'django-cms',
'djangocms-text-ckeditor==1.0.9', |
15299d7f15a1aa9523c491190880e1aad84cae07 | setup.py | setup.py | from setuptools import setup
setup(
name = 'brunnhilde',
version = '1.5.4',
url = 'https://github.com/timothyryanwalsh/brunnhilde',
author = 'Tim Walsh',
author_email = 'timothyryanwalsh@gmail.com',
py_modules = ['brunnhilde'],
scripts = ['brunnhilde.py'],
description = 'A Siegfried-bas... | from setuptools import setup
setup(
name = 'brunnhilde',
version = '1.6.0',
url = 'https://github.com/timothyryanwalsh/brunnhilde',
author = 'Tim Walsh',
author_email = 'timothyryanwalsh@gmail.com',
py_modules = ['brunnhilde'],
scripts = ['brunnhilde.py'],
description = 'A Siegfried-bas... | Update for 1.6.0 - TODO: Add Windows | Update for 1.6.0 - TODO: Add Windows | Python | mit | timothyryanwalsh/brunnhilde | ---
+++
@@ -2,7 +2,7 @@
setup(
name = 'brunnhilde',
- version = '1.5.4',
+ version = '1.6.0',
url = 'https://github.com/timothyryanwalsh/brunnhilde',
author = 'Tim Walsh',
author_email = 'timothyryanwalsh@gmail.com', |
8e502a8041aed0758093c306c012d34e37e62309 | setup.py | setup.py | import os, sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
def main():
setup(
name='stcrestclient',
version= '1.0.2',
author='Andrew Gillis',
author_email='andrew.gillis@spirent.com',
url='https://github.com/ajgillis/py-stc... | import os, sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
def main():
setup(
name='stcrestclient',
version= '1.0.2',
author='Andrew Gillis',
author_email='andrew.gillis@spirent.com',
url='https://github.com/ajgillis/py-stc... | Change long description to URL. | Change long description to URL.
| Python | mit | Spirent/py-stcrestclient | ---
+++
@@ -13,7 +13,7 @@
author_email='andrew.gillis@spirent.com',
url='https://github.com/ajgillis/py-stcrestclient',
description='stcrestclient: Client modules for STC ReST API',
- long_description = open('README.md').read(),
+ long_description = 'See https://github.com/ajg... |
ac111399e390a5f62b35467b9cf5b9af613317b2 | setup.py | setup.py | from setuptools import setup
from setuptools import find_packages
setup(name='DSPP-Keras',
version='0.0.3',
description='Integration of DSPP database with Keral Machine Learning Library',
author='Jan Domanski',
author_email='jan@peptone.io',
url='https://github.com/PeptoneInc/dspp-keras',... | from setuptools import setup
from setuptools import find_packages
setup(name='DSPP-Keras',
version='0.0.3',
description='Integration of Database of structural propensities of proteins (dSPP) with Keras Machine Learning Library',
author='Jan Domanski',
author_email='jan@peptone.io',
url='h... | Change title and fix spelling for pip package | Change title and fix spelling for pip package
| Python | agpl-3.0 | PeptoneInc/dspp-keras | ---
+++
@@ -3,7 +3,7 @@
setup(name='DSPP-Keras',
version='0.0.3',
- description='Integration of DSPP database with Keral Machine Learning Library',
+ description='Integration of Database of structural propensities of proteins (dSPP) with Keras Machine Learning Library',
author='Jan Domanski... |
e14071cb1bb6a331b6d2a32c65c8a71aa7d85e04 | setup.py | setup.py | #!/usr/bin/env python
from distutils.core import setup
try:
long_description = open('README.md', 'r').read()
except:
long_description = ''
setup(
name='samp-client',
version='2.0.2',
packages=['samp_client'],
url='https://github.com/mick88/samp-client',
license='MIT',
author='Michal Dab... | #!/usr/bin/env python
from distutils.core import setup
try:
long_description = open('README.md', 'r').read()
except:
long_description = ''
setup(
name='samp-client',
version='2.0.2',
packages=['samp_client'],
url='https://github.com/mick88/samp-client',
license='MIT',
author='Michal Dab... | Install future as a dependency | Install future as a dependency
| Python | mit | mick88/samp-client | ---
+++
@@ -13,7 +13,7 @@
license='MIT',
author='Michal Dabski',
author_email='contact@michaldabski.com',
- requires=['future'],
+ install_requires=['future'],
description='SA-MP API client for python supporting both query and RCON APIs',
long_description=long_description,
) |
7081e163f9e9c4c11d5a52d2dce6d1ef308bc0ab | setup.py | setup.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from setuptools import setup
setup(
name='rna',
version='0.0.1',
description='',
... | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from setuptools import setup
setup(
name='rna',
version='0.0.1',
description='',
... | Include management commands when installed. | Include management commands when installed. | Python | mpl-2.0 | sylvestre/rna,sylvestre/rna,sylvestre/rna,mozilla/rna,jgmize/rna,jgmize/rna,mozilla/rna,mozilla/rna,jgmize/rna | ---
+++
@@ -15,7 +15,7 @@
#url='',
#license='',
packages=[
- 'rna', 'rna.migrations'],
+ 'rna', 'rna.migrations', 'rna.management.commands'],
install_requires=[
'South',
'Django>=1.4.9', |
7e7b71cc9ea8f79b81ef60d0303e59ad77389c06 | setup.py | setup.py | # I prefer Markdown to reStructuredText. PyPi does not. This allows people to
# install and not get any errors.
try:
import pypandoc
long_description = pypandoc.convert('README.md', 'rst')
except (IOError, ImportError):
long_description = (
"Tavi (as in `Rikki Tikki Tavi "
"<http://en.wikipe... | # I prefer Markdown to reStructuredText. PyPi does not. This allows people to
# install and not get any errors.
try:
import pypandoc
long_description = pypandoc.convert('README.md', 'rst')
except (IOError, ImportError):
long_description = (
"Tavi (as in `Rikki Tikki Tavi "
"<http://en.wikipe... | Update project URL to point to GitHub. | Update project URL to point to GitHub.
| Python | mit | bnadlerjr/tavi | ---
+++
@@ -22,7 +22,7 @@
author='Bob Nadler Jr.',
author_email='bnadlerjr@gmail.com',
packages=['tavi', 'tavi.test'],
- url='http://pypi.python.org/pypi/Tavi/',
+ url='https://github.com/bnadlerjr/tavi',
license='LICENSE.txt',
description='Super thin Mongo object mapper for Python.',
... |
1fdb94783831bdd8e0608dc95a008f9344753a58 | setup.py | setup.py | """
Flask-Babel
-----------
Adds i18n/l10n support to Flask applications with the help of the
`Babel`_ library.
Links
`````
* `documentation <http://packages.python.org/Flask-Babel>`_
* `development version
<http://github.com/mitsuhiko/flask-babel/zipball/master#egg=Flask-Babel-dev>`_
.. _Babel: http://babel.edge... | from setuptools import setup
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='Flask-Babel',
version='0.12.0',
url='http://github.com/python-babel/flask-babel',
... | Switch to using README.md for project description on pypi. | Switch to using README.md for project description on pypi.
| Python | bsd-3-clause | mitsuhiko/flask-babel,mitsuhiko/flask-babel | ---
+++
@@ -1,21 +1,9 @@
-"""
-Flask-Babel
------------
+from setuptools import setup
-Adds i18n/l10n support to Flask applications with the help of the
-`Babel`_ library.
-
-Links
-`````
-
-* `documentation <http://packages.python.org/Flask-Babel>`_
-* `development version
- <http://github.com/mitsuhiko/flask-bab... |
6c001251a4df02aa011187bf1444c94ffc4f92db | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import os
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='zorg',
version='0.0.4',
url='https://github.com/zorg/zorg',
description='Python framework for robot... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import os
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='zorg',
version='0.0.5',
url='https://github.com/zorg/zorg',
description='Python framework for robot... | Update release version to 0.0.5 | Update release version to 0.0.5
| Python | mit | zorg-framework/zorg,zorg/zorg | ---
+++
@@ -10,7 +10,7 @@
setup(
name='zorg',
- version='0.0.4',
+ version='0.0.5',
url='https://github.com/zorg/zorg',
description='Python framework for robotics and physical computing.',
long_description=read('README.rst'), |
4c90264d744b177aabcaa1cecba4fe17e30cf308 | corehq/apps/accounting/migrations/0026_auto_20180508_1956.py | corehq/apps/accounting/migrations/0026_auto_20180508_1956.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-05-08 19:56
from __future__ import unicode_literals
from __future__ import absolute_import
from django.db import migrations
from corehq.sql_db.operations import HqRunPython
def _convert_emailed_to_array_field(apps, schema_editor):
BillingRecord = apps... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-05-08 19:56
from __future__ import unicode_literals
from __future__ import absolute_import
from django.db import migrations
from corehq.sql_db.operations import HqRunPython
def noop(*args, **kwargs):
pass
def _convert_emailed_to_array_field(apps, sc... | Add noop to migration file | Add noop to migration file
| Python | bsd-3-clause | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | ---
+++
@@ -7,9 +7,12 @@
from corehq.sql_db.operations import HqRunPython
+def noop(*args, **kwargs):
+ pass
+
+
def _convert_emailed_to_array_field(apps, schema_editor):
BillingRecord = apps.get_model('accounting', 'BillingRecord')
-
for record in BillingRecord.objects.all():
if record.em... |
a0ab64fe0582f6001e39b942bcb1b120e068432d | setup.py | setup.py | import os
from setuptools import setup, find_packages
def listify(filename):
return filter(None, open(filename, 'r').readlines())
def read_file(filename):
filepath = os.path.join(os.path.dirname(__file__), filename)
return open(filepath, 'r').read()
setup(
name="python-smpp",
version="0.1.7a",
... | import os
from setuptools import setup, find_packages
def listify(filename):
filepath = os.path.join(os.path.dirname(__file__), filename)
return filter(None, open(filepath, 'r').readlines())
def read_file(filename):
filepath = os.path.join(os.path.dirname(__file__), filename)
return open(filepath, '... | Use full file path for getting list of requirements (thanks @hodgestar) | Use full file path for getting list of requirements (thanks @hodgestar)
| Python | bsd-3-clause | praekelt/python-smpp,praekelt/python-smpp | ---
+++
@@ -3,7 +3,8 @@
def listify(filename):
- return filter(None, open(filename, 'r').readlines())
+ filepath = os.path.join(os.path.dirname(__file__), filename)
+ return filter(None, open(filepath, 'r').readlines())
def read_file(filename): |
30fcfb5fec7933d69d9117be6219945406012ef5 | setup.py | setup.py | from setuptools import setup
description = 'New testament greek app for django.'
long_desc = open('README.rst').read()
setup(
name='django-greekapp',
version='0.0.1',
url='https://github.com/honza/greekapp',
install_requires=['django', 'redis'],
description=description,
long_description=long_d... | from setuptools import setup
description = 'New testament greek app for django.'
long_desc = open('README.rst').read()
setup(
name='django-greekapp',
version='0.0.1',
url='https://github.com/honza/greekapp',
install_requires=['django', 'redis'],
description=description,
long_description=long_d... | Include nt.db with package data. | Include nt.db with package data.
| Python | bsd-2-clause | honza/greekapp,honza/greekapp,honza/greekapp | ---
+++
@@ -19,7 +19,8 @@
'greekapp': [
'templates/greekapp/index.html',
'static/greekapp.min.js',
- 'static/greekapp.css'
+ 'static/greekapp.css',
+ 'managements/commands/nt.db'
]
}
) |
a7f17a7fa3761126d6edb890f3420556f663b4c0 | setup.py | setup.py | import ez_setup
ez_setup.use_setuptools()
from setuptools import setup, find_packages
setup(
name = "mobile-city-history",
version = "1.0.0b2",
author = "Jan-Christopher Pien",
author_email = "jan_christopher.pien@fokus.fraunhofer.de",
url = "http://www.foo.bar",
license = "MIT",
descripti... | import ez_setup
ez_setup.use_setuptools()
from setuptools import setup, find_packages
setup(
name = "mobile-city-history",
version = "1.0.0b2",
author = "Jan-Christopher Pien",
author_email = "jan_christopher.pien@fokus.fraunhofer.de",
url = "http://www.foo.bar",
license = "MIT",
descripti... | Add specific version of rest framework | Add specific version of rest framework
| Python | mit | fraunhoferfokus/mobile-city-memory,fraunhoferfokus/mobile-city-memory,jessepeng/coburg-city-memory,jessepeng/coburg-city-memory | ---
+++
@@ -20,7 +20,7 @@
"django >= 1.6",
"jsonpickle >= 0.7.0",
"django-apptemplates",
- "djangorestframework",
+ "djangorestframework = 2.3",
"schedule",
"django-cache-machine >= 0.8",
], |
14bf00afda2fc052dec0ae1655ba6a14073761cd | data/data.py | data/data.py | from __future__ import print_function, division
import hashlib
import os
import json
d = json.load(open("data/hashList.txt"))
def generate_file_md5(filename, blocksize=2**20):
m = hashlib.md5()
with open(filename, "rb") as f:
while True:
buf = f.read(blocksize)
if not buf:
... | from __future__ import print_function, division
import hashlib
import os
import json
d = json.load(open("./hashList.txt"))
def generate_file_md5(filename, blocksize=2**20):
m = hashlib.md5()
with open(filename, "rb") as f:
while True:
buf = f.read(blocksize)
if not buf:
... | Change path name to './' | Change path name to './'
| Python | bsd-3-clause | berkeley-stat159/project-theta | ---
+++
@@ -5,7 +5,7 @@
import json
-d = json.load(open("data/hashList.txt"))
+d = json.load(open("./hashList.txt"))
def generate_file_md5(filename, blocksize=2**20): |
73007bf3b2764c464dd475fa62d8c2651efe20eb | setup.py | setup.py | import os
from setuptools import setup
readme_path = os.path.join(os.path.dirname(
os.path.abspath(__file__)),
'README.rst',
)
long_description = open(readme_path).read()
version_path = os.path.join(os.path.dirname(
os.path.abspath(__file__)),
'VERSION',
)
version = open(version_path).read()
setup(
name='fl... | import os
from setuptools import setup
readme_path = os.path.join(os.path.dirname(
os.path.abspath(__file__)),
'README.rst',
)
long_description = open(readme_path).read()
version_path = os.path.join(os.path.dirname(
os.path.abspath(__file__)),
'VERSION',
)
version = open(version_path).read()
requires = ['ld... | Fix for when using python3.5. Don't install enum34 if enum already exists (python35) | Fix for when using python3.5. Don't install enum34 if enum already exists (python35)
| Python | mit | mwielgoszewski/flask-ldap3-login,nickw444/flask-ldap3-login | ---
+++
@@ -12,6 +12,14 @@
)
version = open(version_path).read()
+
+
+requires = ['ldap3' ,'Flask', 'Flask-wtf']
+try:
+ import enum
+except Exception as e:
+ requires.append('enum34')
+
setup(
name='flask-ldap3-login',
version=version,
@@ -22,12 +30,7 @@
long_description=long_description,
url='htt... |
c53f03c738ad6357ccd87a506cbc05bc1e2a8474 | views.py | views.py | from django.http import HttpResponse
from django.shortcuts import render_to_response
from store.models import FandomHierarchy
def frontpage(request, filter):
return render_to_response('index.html', {'filter': filter, 'nodes': FandomHierarchy.objects.all()})
| from django.http import HttpResponse
from django.shortcuts import render_to_response
from store.models import FandomHierarchy
def frontpage(request, filter=None):
return render_to_response('index.html', {'filter': filter, 'nodes': FandomHierarchy.objects.all()})
| Add default value for filter so things don't break | Add default value for filter so things don't break
| Python | bsd-3-clause | willmurnane/store | ---
+++
@@ -2,5 +2,5 @@
from django.shortcuts import render_to_response
from store.models import FandomHierarchy
-def frontpage(request, filter):
+def frontpage(request, filter=None):
return render_to_response('index.html', {'filter': filter, 'nodes': FandomHierarchy.objects.all()}) |
7ac1d811b4f9e56d3dbcab99862c92b2dd6376d7 | webapp-django/crashstats/dataservice/models.py | webapp-django/crashstats/dataservice/models.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from django.conf import settings
from configman import configuration, ConfigFileFutureProxy, Namespace
from socorro.app.... | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from django.conf import settings
from configman import configuration, ConfigFileFutureProxy, Namespace
from socorro.app.... | Change SERVICE_LIST to a tuple | Change SERVICE_LIST to a tuple
| Python | mpl-2.0 | mozilla/socorro,luser/socorro,cliqz/socorro,twobraids/socorro,cliqz/socorro,adngdb/socorro,mozilla/socorro,mozilla/socorro,pcabido/socorro,Tayamarn/socorro,twobraids/socorro,yglazko/socorro,AdrianGaudebert/socorro,luser/socorro,linearregression/socorro,lonnen/socorro,KaiRo-at/socorro,Tayamarn/socorro,linearregression/s... | ---
+++
@@ -10,7 +10,7 @@
classes_in_namespaces_converter,
)
-SERVICES_LIST = ('socorro.external.postgresql.bugs_service.Bugs')
+SERVICES_LIST = ('socorro.external.postgresql.bugs_service.Bugs',)
# Allow configman to dynamically load the configuration and classes
# for our API dataservice objects
@@ -18,7... |
49f1715067df0208c79a1af2e73d6aa314b96bef | django_su/utils.py | django_su/utils.py | # -*- coding: utf-8 -*-
import warnings
import collections
from django.conf import settings
from django.utils.module_loading import import_string
def su_login_callback(user):
if hasattr(settings, 'SU_LOGIN'):
warnings.warn(
"SU_LOGIN is deprecated, use SU_LOGIN_CALLBACK",
Depreca... | # -*- coding: utf-8 -*-
import warnings
from collections.abc import Callable
from django.conf import settings
from django.utils.module_loading import import_string
def su_login_callback(user):
if hasattr(settings, 'SU_LOGIN'):
warnings.warn(
"SU_LOGIN is deprecated, use SU_LOGIN_CALLBACK",
... | Update collections.Callable typecheck to collections.abc.Callable | Update collections.Callable typecheck to collections.abc.Callable
| Python | mit | adamcharnock/django-su,PetrDlouhy/django-su,PetrDlouhy/django-su,adamcharnock/django-su | ---
+++
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
import warnings
-import collections
+from collections.abc import Callable
from django.conf import settings
from django.utils.module_loading import import_string
@@ -16,7 +16,7 @@
func = getattr(settings, 'SU_LOGIN_CALLBACK', None)
if func is not None... |
a45c79b10ef5ca6eb4b4e792f2229b2f9b0a7bbf | thinglang/foundation/definitions.py | thinglang/foundation/definitions.py | import itertools
from thinglang.lexer.values.identifier import Identifier
"""
The internal ordering of core types used by the compiler and runtime
"""
INTERNAL_TYPE_COUNTER = itertools.count(1)
# TODO: map dynamically at runtime
INTERNAL_TYPE_ORDERING = {
Identifier("text"): next(INTERNAL_TYPE_COUNTER),
Id... | import glob
import os
from thinglang.lexer.values.identifier import Identifier
"""
The internal ordering of core types used by the compiler and runtime
"""
CURRENT_PATH = os.path.dirname(os.path.abspath(__file__))
SOURCE_PATTERN = os.path.join(CURRENT_PATH, 'source/**/*.thing')
def list_types():
for path in ... | Remove manual INTERNAL_TYPE_ORDERING map in favor of explicit import tables | Remove manual INTERNAL_TYPE_ORDERING map in favor of explicit import tables
| Python | mit | ytanay/thinglang,ytanay/thinglang,ytanay/thinglang,ytanay/thinglang | ---
+++
@@ -1,4 +1,6 @@
-import itertools
+import glob
+
+import os
from thinglang.lexer.values.identifier import Identifier
@@ -6,20 +8,19 @@
The internal ordering of core types used by the compiler and runtime
"""
-INTERNAL_TYPE_COUNTER = itertools.count(1)
+CURRENT_PATH = os.path.dirname(os.path.abspath(_... |
3b2fae7875d89adb8537b75c7e9b48a8663a9d4f | src/rnaseq_lib/web/synapse.py | src/rnaseq_lib/web/synapse.py | import os
from synapseclient import Synapse, File
expression = 'syn11311347'
metadata = 'syn11311931'
def upload_file(file_path, login, parent, description=None):
"""
Uploads file to Synapse. Password must be stored in environment variable SYNAPSE_PASS
:param str file_path: Path to file
:param str ... | import os
from synapseclient import Synapse, File
expression = 'syn11311347'
metadata = 'syn11311931'
def upload_file(file_path, login, parent, description=None):
"""
Uploads file to Synapse. Password must be stored in environment variable SYNAPSE_PASS
:param str file_path: Path to file
:param str ... | Add download and login functions | Add download and login functions
| Python | mit | jvivian/rnaseq-lib,jvivian/rnaseq-lib | ---
+++
@@ -15,12 +15,34 @@
:param str parent: Parent Synapse ID (example: syn12312415) where file will be placed
:param str description: Optional description to add
"""
-
description = '' if None else description
f = File(file_path, description=description, parent=parent)
+ syn = _syn_l... |
b7335f5c011d9fad3570a097fb1165cc6fbd3cef | src/python/grpcio_tests/tests/unit/_logging_test.py | src/python/grpcio_tests/tests/unit/_logging_test.py | # Copyright 2018 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | # Copyright 2018 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | Add test for 'No handlers could be found' problem | Add test for 'No handlers could be found' problem
| Python | apache-2.0 | mehrdada/grpc,sreecha/grpc,stanley-cheung/grpc,vjpai/grpc,mehrdada/grpc,muxi/grpc,pszemus/grpc,stanley-cheung/grpc,jtattermusch/grpc,donnadionne/grpc,grpc/grpc,mehrdada/grpc,pszemus/grpc,ctiller/grpc,nicolasnoble/grpc,firebase/grpc,donnadionne/grpc,ctiller/grpc,jtattermusch/grpc,donnadionne/grpc,vjpai/grpc,muxi/grpc,do... | ---
+++
@@ -15,15 +15,28 @@
import unittest
import six
+from six.moves import reload_module
+import logging
import grpc
-import logging
-
+import functools
+import sys
class LoggingTest(unittest.TestCase):
def test_logger_not_occupied(self):
self.assertEqual(0, len(logging.getLogger().handlers... |
8fc504113e12649067fb2bdcc239f8f2260ad4b8 | tests/test_quality/test_restoringbeam.py | tests/test_quality/test_restoringbeam.py | import os
import unittest2 as unittest
from tkp.quality.restoringbeam import beam_invalid
from tkp.testutil.decorators import requires_data
from tkp import accessors
from tkp.testutil.data import DATAPATH
fits_file = os.path.join(DATAPATH,
'quality/noise/bad/home-pcarrol-msss-3C196a-analysis-band6.corr.fits')
... | import os
import unittest2 as unittest
from tkp.quality.restoringbeam import beam_invalid
from tkp.testutil.decorators import requires_data
from tkp import accessors
from tkp.testutil.data import DATAPATH
fits_file = os.path.join(DATAPATH,
'quality/noise/bad/home-pcarrol-msss-3C196a-analysis-band6.corr.fits')
... | Test for infinite beam QC | Test for infinite beam QC
| Python | bsd-2-clause | transientskp/tkp,mkuiack/tkp,mkuiack/tkp,transientskp/tkp,bartscheers/tkp,bartscheers/tkp | ---
+++
@@ -26,6 +26,10 @@
#fwhm = tkp.lofar.beam.fwhm(wavelength, d)
#fov = tkp.lofar.beam.fov(fwhm)
+ def test_infinite(self):
+ smaj, smin, theta = float('inf'), float('inf'), float('inf')
+ self.assertTrue(beam_invalid(smaj, smin, theta))
+
if __name__ == '__main__':
u... |
62d9fdfe0ad3fc37286aa19a87e2890aaf90f639 | tasks/check_rd2_enablement.py | tasks/check_rd2_enablement.py | import simple_salesforce
from cumulusci.tasks.salesforce import BaseSalesforceApiTask
class is_rd2_enabled(BaseSalesforceApiTask):
def _run_task(self):
try:
settings = self.sf.query(
"SELECT IsRecurringDonations2Enabled__c "
"FROM npe03__Recurring_Donations_Setti... | import simple_salesforce
from cumulusci.tasks.salesforce import BaseSalesforceApiTask
class is_rd2_enabled(BaseSalesforceApiTask):
def _run_task(self):
try:
settings = self.sf.query(
"SELECT IsRecurringDonations2Enabled__c "
"FROM npe03__Recurring_Donations_Setti... | Correct bug in preflight check | Correct bug in preflight check
| Python | bsd-3-clause | SalesforceFoundation/Cumulus,SalesforceFoundation/Cumulus,SalesforceFoundation/Cumulus,SalesforceFoundation/Cumulus | ---
+++
@@ -18,5 +18,6 @@
if settings.get("records"):
if settings["records"][0]["IsRecurringDonations2Enabled__c"]:
self.return_values = True
+ return
self.return_values = False |
7cbd21a050a9e94d0f8f1f5c3ce4f81c812e279c | trump/templating/tests/test_templates.py | trump/templating/tests/test_templates.py |
from ..templates import QuandlFT
class TestTemplates(object):
def test_quandl_ft(self):
ftemp = QuandlFT("xxx", trim_start="yyyy-mm-dd", authtoken="yyy")
assert ftemp.sourcing == {'authtoken': 'yyy',
'trim_start': 'yyyy-mm-dd',
'... |
from ..templates import QuandlFT, QuandlSecureFT, GoogleFinanceFT
class TestTemplates(object):
def test_quandl_ft(self):
ftemp = QuandlFT("xxx", trim_start="yyyy-mm-dd", authtoken="yyy")
assert ftemp.sourcing == {'authtoken': 'yyy',
'trim_start': 'yyyy-mm-dd',
... | Add two tests for templates | Add two tests for templates | Python | bsd-3-clause | Equitable/trump,Asiant/trump,jnmclarty/trump | ---
+++
@@ -1,5 +1,5 @@
-from ..templates import QuandlFT
+from ..templates import QuandlFT, QuandlSecureFT, GoogleFinanceFT
class TestTemplates(object):
@@ -8,3 +8,19 @@
assert ftemp.sourcing == {'authtoken': 'yyy',
'trim_start': 'yyyy-mm-dd',
... |
ea17a76c4ada65dac9e909b930c938a24ddb99b2 | tests/formatter/test_csver.py | tests/formatter/test_csver.py | import unittest, argparse
from echolalia.formatter.csver import Formatter
class CsverTestCase(unittest.TestCase):
def setUp(self):
self.parser = argparse.ArgumentParser()
self.data = [{'char': chr(i), 'order': i - 96} for i in xrange(97, 100)]
self.formatter = Formatter()
def test_add_args(self):
... | import unittest, argparse
from echolalia.formatter.csver import Formatter
class CsverTestCase(unittest.TestCase):
def setUp(self):
self.parser = argparse.ArgumentParser()
self.data = [{'char': chr(i), 'order': i - 96} for i in xrange(97, 100)]
self.formatter = Formatter()
def test_add_args(self):
... | Fix no header test for csv formatter | Fix no header test for csv formatter
| Python | mit | eiri/echolalia-prototype | ---
+++
@@ -21,6 +21,7 @@
args = new_parser.parse_args([])
result = self.formatter.marshall(args, self.data)
expect = "a,1\r\nb,2\r\nc,3\r\n"
+ self.assertEqual(result, expect)
def test_marshall_with_header(self):
new_parser = self.formatter.add_args(self.parser) |
1bb03750b997a152a9360be613a15057e59b8a17 | beyonic/__init__.py | beyonic/__init__.py | # Beyonic API Python bindings
#default values if any
DEFAULT_ENDPOINT_BASE = 'https://app.beyonic.com/api/'
#config
api_key = None
api_endpoint_base = None
api_version = None
verify_ssl_certs = True #set to False if you want to bypass SSL checks(mostly useful while testing it on local env).
from beyonic... | # Beyonic API Python bindings
#default values if any
DEFAULT_ENDPOINT_BASE = 'https://app.beyonic.com/api/'
#config
api_key = None
api_endpoint_base = None
api_version = None
verify_ssl_certs = True #set to False if you want to bypass SSL checks(mostly useful while testing it on local env).
from beyonic... | Fix accounts api wrapper import error | Fix accounts api wrapper import error
| Python | mit | beyonic/beyonic-python,beyonic/beyonic-python,beyonic/beyonic-python | ---
+++
@@ -14,4 +14,4 @@
from beyonic.apis.webhook import Webhook
from beyonic.apis.collection import Collection
from beyonic.apis.collectionrequest import CollectionRequest
-from beyonic.apis.accounts import Account
+from beyonic.apis.account import Account |
3a5432e14c18852758afdf92b913c93906808e3e | cinder/db/sqlalchemy/migrate_repo/versions/115_add_shared_targets_to_volumes.py | cinder/db/sqlalchemy/migrate_repo/versions/115_add_shared_targets_to_volumes.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | Add 'shared_targets' only when it doesn't exist | Add 'shared_targets' only when it doesn't exist
Add existence check before actually create it.
Change-Id: I96946f736d7263f80f7ad24f8cbbc9a09eb3cc63
| Python | apache-2.0 | phenoxim/cinder,Datera/cinder,mahak/cinder,openstack/cinder,j-griffith/cinder,openstack/cinder,mahak/cinder,j-griffith/cinder,Datera/cinder,phenoxim/cinder | ---
+++
@@ -21,7 +21,5 @@
# NOTE(jdg): We use a default of True because it's harmless for a device
# that does NOT use shared_targets to be treated as if it does
- shared_targets = Column('shared_targets',
- Boolean,
- default=True)
- volumes.cr... |
052042e2f48b7936a6057c18a128f497d5e5b1a4 | folium/__init__.py | folium/__init__.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
__version__ = '0.2.0.dev'
from folium.folium import Map, initialize_notebook
| # -*- coding: utf-8 -*-
from __future__ import absolute_import
__version__ = '0.2.0.dev'
from folium.folium import Map, initialize_notebook, CircleMarker
from folium.map import FeatureGroup, FitBounds,Icon, LayerControl, Marker, Popup, TileLayer
from folium.features import (ClickForMarker, ColorScale, CustomIcon, D... | Make features accessible from root | Make features accessible from root
| Python | mit | QuLogic/folium,talespaiva/folium,andrewgiessel/folium,themiurgo/folium,shankari/folium,python-visualization/folium,talespaiva/folium,QuLogic/folium,BibMartin/folium,ocefpaf/folium,themiurgo/folium,talespaiva/folium,andrewgiessel/folium,BibMartin/folium,ocefpaf/folium,python-visualization/folium,shankari/folium,shankari... | ---
+++
@@ -3,4 +3,10 @@
__version__ = '0.2.0.dev'
-from folium.folium import Map, initialize_notebook
+from folium.folium import Map, initialize_notebook, CircleMarker
+
+from folium.map import FeatureGroup, FitBounds,Icon, LayerControl, Marker, Popup, TileLayer
+
+from folium.features import (ClickForMarker, C... |
6e764429961831632d6245f5587250b4772b1474 | gaphas/picklers.py | gaphas/picklers.py | """
Some extra picklers needed to gracefully dump and load a canvas.
"""
from future import standard_library
standard_library.install_aliases()
import copyreg
# Allow instancemethod to be pickled:
import types
def construct_instancemethod(funcname, self, clazz):
func = getattr(clazz, funcname)
return type... | """
Some extra picklers needed to gracefully dump and load a canvas.
"""
from future import standard_library
standard_library.install_aliases()
import copyreg
# Allow instancemethod to be pickled:
import types
def construct_instancemethod(funcname, self, clazz):
func = getattr(clazz, funcname)
return type... | Fix MethodType only takes two parameters | Fix MethodType only takes two parameters
Signed-off-by: Dan Yeaw <2591e5f46f28d303f9dc027d475a5c60d8dea17a@yeaw.me>
| Python | lgpl-2.1 | amolenaar/gaphas | ---
+++
@@ -14,7 +14,7 @@
def construct_instancemethod(funcname, self, clazz):
func = getattr(clazz, funcname)
- return types.MethodType(func, self, clazz)
+ return types.MethodType(func, self)
def reduce_instancemethod(im): |
bb6f4302937e477f23c4de0d6a265d1d6f8985a0 | geometry_export.py | geometry_export.py | print "Loading ", __name__
import geometry, from_poser, to_lux
reload(geometry)
reload(from_poser)
reload(to_lux)
import from_poser, to_lux
class GeometryExporter(object):
def __init__(self, subject, convert_material = None,
write_mesh_parameters = None, options = {}):
geom = from_poser... | print "Loading ", __name__
import geometry, from_poser, to_lux
reload(geometry)
reload(from_poser)
reload(to_lux)
import from_poser, to_lux
def get_materials(geometry, convert = None):
f = convert or (lambda mat, k: ' NamedMaterial "%s/%s"' % (k, mat.Name()))
return [f(mat, geometry.material_key) for mat in ... | Split off two functions from GeometryExporter.__init__ | Split off two functions from GeometryExporter.__init__
| Python | mit | odf/pydough | ---
+++
@@ -5,6 +5,19 @@
reload(from_poser)
reload(to_lux)
import from_poser, to_lux
+
+
+def get_materials(geometry, convert = None):
+ f = convert or (lambda mat, k: ' NamedMaterial "%s/%s"' % (k, mat.Name()))
+ return [f(mat, geometry.material_key) for mat in geometry.materials]
+
+
+def preprocess(geomet... |
77b1f64633d2b70e4e4fc490916e2a9ccae7228f | gignore/__init__.py | gignore/__init__.py | __version__ = (2014, 10, 0)
def get_version():
"""
:rtype: str
"""
return '.'.join(str(i) for i in __version__)
class Gignore(object):
BASE_URL = 'https://raw.githubusercontent.com/github/gitignore/master/'
name = None
file_content = None
def get_base_url(self):
"""
... | __version__ = (2014, 10, 0)
def get_version():
"""
:rtype: str
"""
return '.'.join(str(i) for i in __version__)
class Gignore(object):
BASE_URL = 'https://raw.githubusercontent.com/github/gitignore/master/'
name = None
file_content = None
valid = True
def get_base_url(self):
... | Add valid attribute with setter/getter | Add valid attribute with setter/getter
| Python | bsd-3-clause | Alir3z4/python-gignore | ---
+++
@@ -12,6 +12,7 @@
BASE_URL = 'https://raw.githubusercontent.com/github/gitignore/master/'
name = None
file_content = None
+ valid = True
def get_base_url(self):
"""
@@ -42,3 +43,15 @@
:rtype: str
"""
return self.file_content
+
+ def is_valid(self... |
883df49451aaa41ca5e20d1af799af2642615d5a | nineml/examples/AL/demos/demo1b_load_save_izekevich.py | nineml/examples/AL/demos/demo1b_load_save_izekevich.py | import nineml
from nineml.abstraction_layer.testing_utils import RecordValue, TestableComponent
from nineml.abstraction_layer import ComponentClass
from nineml.abstraction_layer.testing_utils import std_pynn_simulation
# Load the Component:
iz_file = '../../../../../../catalog/sample_xml_files/PostTF_izhikevich.xml'
i... | import nineml
from nineml.abstraction_layer.testing_utils import RecordValue, TestableComponent
from nineml.abstraction_layer import ComponentClass
from nineml.abstraction_layer.testing_utils import std_pynn_simulation
# Load the Component:
iz_file = '../../../../../../catalog/sample_xml_files/PostTF_izhikevich.xml'
i... | Fix to finding paths in nineml2nmodl | Fix to finding paths in nineml2nmodl
git-svn-id: c3c03ae8de67eddb7d242ee89b936c58f5138363@496 e4a6332b-da94-4e19-b8c2-16eed22ecab5
| Python | bsd-3-clause | INCF/lib9ML | ---
+++
@@ -28,7 +28,7 @@
'b': 0.2,
'c': -65,
'd': 8,
- 'iinj_constant': 5.0,
+ 'iinj_constant': 50.0,
})
res = std_pynn_simulation( test_component = iz, |
0986bbba02a4bb4d2c13835dd91281cce3bb5f10 | alembic/versions/174eb928136a_gdpr_restrict_processing.py | alembic/versions/174eb928136a_gdpr_restrict_processing.py | """GDPR restrict processing
Revision ID: 174eb928136a
Revises: d5b07c8f0893
Create Date: 2018-05-14 11:21:55.138387
"""
# revision identifiers, used by Alembic.
revision = '174eb928136a'
down_revision = 'd5b07c8f0893'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('user', sa.Colum... | """GDPR restrict processing
Revision ID: 174eb928136a
Revises: d5b07c8f0893
Create Date: 2018-05-14 11:21:55.138387
"""
# revision identifiers, used by Alembic.
revision = '174eb928136a'
down_revision = 'd5b07c8f0893'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('user', sa.Colum... | Set default to False, and update existing users. | Set default to False, and update existing users.
| Python | agpl-3.0 | Scifabric/pybossa,PyBossa/pybossa,Scifabric/pybossa,PyBossa/pybossa | ---
+++
@@ -15,7 +15,9 @@
def upgrade():
- op.add_column('user', sa.Column('restrict', sa.Boolean))
+ op.add_column('user', sa.Column('restrict', sa.Boolean, default=False))
+ sql = 'update "user" set restrict=false'
+ op.execute(sql)
def downgrade(): |
0e7a7f960ff970262ffbe1569dc3437dcae2599c | app/main/helpers/presenters.py | app/main/helpers/presenters.py | import re
class Presenters(object):
def __init__(self):
return None
def present(self, value, question_content):
if "type" in question_content:
field_type = question_content["type"]
else:
return value
if hasattr(self, "_" + field_type):
ret... | import re
class Presenters(object):
def __init__(self):
return None
def present(self, value, question_content):
if "type" in question_content:
field_type = question_content["type"]
else:
return value
if hasattr(self, "_" + field_type):
ret... | Fix the thing that @quis broke. | Fix the thing that @quis broke.
| Python | mit | mtekel/digitalmarketplace-admin-frontend,mtekel/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace-admin-frontend,mtekel/digitalmarketplace-admin-frontend,mtekel/digitalmarketplace... | ---
+++
@@ -18,7 +18,7 @@
return value
def _service_id(self, value):
- if re.findall("[a-zA-Z]", value):
+ if re.findall("[a-zA-Z]", str(value)):
return [value]
else:
return re.findall("....", str(value)) |
75d435e55e42fefe1c28095dadb9abb56284c1fb | marked/__init__.py | marked/__init__.py | import markgen
from bs4 import BeautifulSoup
TAGS = {
'p': 'paragraph',
'div': 'paragraph',
'a': 'link',
'strong': 'emphasis',
'em': 'emphasis',
'b': 'emphasis',
'i': 'emphasis',
'u': 'emphasis',
'img': 'image',
'image': 'image',
'blockquote': 'quote',
'pre': 'pre',
... | import markgen
from bs4 import BeautifulSoup
TAGS = {
'p': 'paragraph',
'div': 'paragraph',
'a': 'link',
'strong': 'emphasis',
'em': 'emphasis',
'b': 'emphasis',
'i': 'emphasis',
'u': 'emphasis',
'img': 'image',
'image': 'image',
'blockquote': 'quote',
'pre': 'pre',
... | Use .string so we keep within BS parse tree | Use .string so we keep within BS parse tree
| Python | bsd-3-clause | 1stvamp/marked | ---
+++
@@ -39,11 +39,11 @@
for c in contents:
if hasattr(c, 'contents'):
- c = _iterate_over_contents(c.contents)
+ c.string = _iterate_over_contents(c.contents)
if c.name in TAGS:
wrap = getattr(markgen, TAGS[c.name])
- c = wrap(c)
+ ... |
6d964e5ce83b8f07de64ef8ed5b531271725d9c4 | peering/management/commands/deploy_configurations.py | peering/management/commands/deploy_configurations.py | from __future__ import unicode_literals
import logging
from django.core.management.base import BaseCommand
from peering.models import InternetExchange
class Command(BaseCommand):
help = ('Deploy configurations each IX having a router and a configuration'
' template attached.')
logger = logging.... | from __future__ import unicode_literals
import logging
from django.core.management.base import BaseCommand
from peering.models import InternetExchange
class Command(BaseCommand):
help = ('Deploy configurations each IX having a router and a configuration'
' template attached.')
logger = logging.... | Check for router platform in auto-deploy script. | Check for router platform in auto-deploy script.
| Python | apache-2.0 | respawner/peering-manager,respawner/peering-manager,respawner/peering-manager,respawner/peering-manager | ---
+++
@@ -16,7 +16,9 @@
self.logger.info('Deploying configurations...')
for ix in InternetExchange.objects.all():
- if ix.configuration_template and ix.router:
+ # Only deploy config if there are at least a configuration
+ # template, a router and a platform for ... |
681f322c4cc57f9fdac1efb59f431360c209232d | backdrop/collector/__init__.py | backdrop/collector/__init__.py | # Namespace package: https://docs.python.org/2/library/pkgutil.html
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
__VERSION__ = "1.0.0"
__AUTHOR__ = "GDS Developers"
__AUTHOR_EMAIL__ = ""
| # Namespace package: https://docs.python.org/2/library/pkgutil.html
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
__VERSION__ = "2.0.1"
__AUTHOR__ = "GDS Developers"
__AUTHOR_EMAIL__ = ""
| Make version number match the latest tag | Make version number match the latest tag
We have a 2.0.0 tag in github which points to code where the version
claims to be 1.0.0:
https://github.com/alphagov/backdrop-collector/blob/2.0.0/backdrop/collector/__init__.py
We definitely have code which specifies 2.0.0 as its dependency.
Upversion to 2.0.1 so we can mak... | Python | mit | gds-attic/backdrop-collector,gds-attic/backdrop-collector | ---
+++
@@ -2,6 +2,6 @@
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
-__VERSION__ = "1.0.0"
+__VERSION__ = "2.0.1"
__AUTHOR__ = "GDS Developers"
__AUTHOR_EMAIL__ = "" |
8ef3e88c99602dbdac8fca1b223c7bab8308d820 | backend/backend/serializers.py | backend/backend/serializers.py | from rest_framework import serializers
from .models import Animal
class AnimalSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Animal
fields = ('id', 'name', 'dob', 'active', 'own') | from rest_framework import serializers
from .models import Animal
class AnimalSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Animal
fields = ('id', 'name', 'dob', 'gender', 'active', 'own', 'father', 'mother') | Add parents and gender to the list of values in serializer | Add parents and gender to the list of values in serializer
| Python | apache-2.0 | mmlado/animal_pairing,mmlado/animal_pairing | ---
+++
@@ -4,4 +4,4 @@
class AnimalSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Animal
- fields = ('id', 'name', 'dob', 'active', 'own')
+ fields = ('id', 'name', 'dob', 'gender', 'active', 'own', 'father', 'mother') |
c5635d1146fc2c0ff284c41d4b2d1132b25ae270 | composer/workflows/use_local_deps.py | composer/workflows/use_local_deps.py | # Copyright 2018 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | # Copyright 2018 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Use absolute / implicit relative imports for local deps | Use absolute / implicit relative imports for local deps
Since Composer is Python 2.7 only for now, this sample can use implicit
relative imports. Airflow doesn't seem to support explicit relative
imports when I try to run the use_local_deps.py file in Composer.
Aside: Airflow is using the imp.load_source method to lo... | Python | apache-2.0 | GoogleCloudPlatform/python-docs-samples,GoogleCloudPlatform/python-docs-samples,GoogleCloudPlatform/python-docs-samples,GoogleCloudPlatform/python-docs-samples | ---
+++
@@ -20,7 +20,7 @@
from airflow.operators import bash_operator
# [START composer_dag_local_deps]
-from .dependencies import coin_module
+from dependencies import coin_module
# [END composer_dag_local_deps]
default_args = { |
4d7f94e7ee5b2ffdfe58b353688ae5bfc280332c | boris/reporting/management.py | boris/reporting/management.py | '''
Created on 3.12.2011
@author: xaralis
'''
from os.path import dirname, join
from django.db import models, connection
from boris import reporting
from boris.reporting import models as reporting_app
def install_views(app, created_models, verbosity, **kwargs):
if verbosity >= 1:
print "Installing repor... | from os.path import dirname, join
from django.db import connection
from south.signals import post_migrate
from boris import reporting
from boris.reporting import models as reporting_app
def install_views(app, **kwargs):
print "Installing reporting views ..."
cursor = connection.cursor()
sql_file = open(j... | Install views on post_migrate rather than post_syncdb. | Install views on post_migrate rather than post_syncdb.
| Python | mit | fragaria/BorIS,fragaria/BorIS,fragaria/BorIS | ---
+++
@@ -1,21 +1,18 @@
-'''
-Created on 3.12.2011
-
-@author: xaralis
-'''
from os.path import dirname, join
-from django.db import models, connection
+from django.db import connection
+from south.signals import post_migrate
from boris import reporting
from boris.reporting import models as reporting_app
-... |
c6ba057d2e8a1b75edb49ce3c007676f4fe46a16 | tv-script-generation/helper.py | tv-script-generation/helper.py | import os
import pickle
def load_data(path):
"""
Load Dataset from File
"""
input_file = os.path.join(path)
with open(input_file, "r") as f:
data = f.read()
return data
def preprocess_and_save_data(dataset_path, token_lookup, create_lookup_tables):
"""
Preprocess Text Data
... | import os
import pickle
def load_data(path):
"""
Load Dataset from File
"""
input_file = os.path.join(path)
with open(input_file, "r") as f:
data = f.read()
return data
def preprocess_and_save_data(dataset_path, token_lookup, create_lookup_tables):
"""
Preprocess Text Data
... | Remove copyright notice during preprocessing | Remove copyright notice during preprocessing
| Python | mit | spencer2211/deep-learning | ---
+++
@@ -18,6 +18,9 @@
Preprocess Text Data
"""
text = load_data(dataset_path)
+
+ # Ignore notice, since we don't use it for analysing the data
+ text = text[81:]
token_dict = token_lookup()
for key, token in token_dict.items(): |
0983361e6fba5812416d8fb5b695f6b3034bc927 | registration/management/commands/cleanupregistration.py | registration/management/commands/cleanupregistration.py | """
A management command which deletes expired accounts (e.g.,
accounts which signed up but never activated) from the database.
Calls ``RegistrationProfile.objects.delete_expired_users()``, which
contains the actual logic for determining which accounts are deleted.
"""
from django.core.management.base import NoArgsC... | """
A management command which deletes expired accounts (e.g.,
accounts which signed up but never activated) from the database.
Calls ``RegistrationProfile.objects.delete_expired_users()``, which
contains the actual logic for determining which accounts are deleted.
"""
from django.core.management.base import BaseCom... | Fix deprecated class NoArgsCommand class. | Fix deprecated class NoArgsCommand class.
Solve the warning RemovedInDjango110Warning: NoArgsCommand class is deprecated and will be removed in Django 1.10. Use BaseCommand instead, which takes no arguments by default.
| Python | bsd-3-clause | sergafts/django-registration,timgraham/django-registration,sergafts/django-registration,pando85/django-registration,pando85/django-registration,allo-/django-registration,allo-/django-registration,timgraham/django-registration | ---
+++
@@ -7,13 +7,13 @@
"""
-from django.core.management.base import NoArgsCommand
+from django.core.management.base import BaseCommand
from ...models import RegistrationProfile
-class Command(NoArgsCommand):
+class Command(BaseCommand):
help = "Delete expired user registrations from the database"
... |
da66b82b4a5d5c0b0bb716b05a8bfd2dae5e2f4c | ookoobah/glutil.py | ookoobah/glutil.py | from contextlib import contextmanager
from pyglet.gl import *
def ptr(*args):
return (GLfloat * len(args))(*args)
@contextmanager
def gl_disable(*bits):
glPushAttrib(GL_ENABLE_BIT)
map(glDisable, bits)
yield
glPopAttrib(GL_ENABLE_BIT)
@contextmanager
def gl_ortho(window):
# clobbers current... | from contextlib import contextmanager
from pyglet.gl import *
__all__ = [
'ptr',
'gl_disable',
'gl_ortho',
]
def ptr(*args):
return (GLfloat * len(args))(*args)
@contextmanager
def gl_disable(*bits):
glPushAttrib(GL_ENABLE_BIT)
map(glDisable, bits)
yield
glPopAttrib(GL_ENABLE_BIT)
... | Fix pyglet breackage by controlling exports. | Fix pyglet breackage by controlling exports.
| Python | mit | vickenty/ookoobah,vickenty/ookoobah,vickenty/ookoobah,vickenty/ookoobah,vickenty/ookoobah | ---
+++
@@ -1,5 +1,11 @@
from contextlib import contextmanager
from pyglet.gl import *
+
+__all__ = [
+ 'ptr',
+ 'gl_disable',
+ 'gl_ortho',
+]
def ptr(*args):
return (GLfloat * len(args))(*args) |
04c8a36c5713e4279f8bf52fa45cdb03de721dbb | example/deploy.py | example/deploy.py | from pyinfra import inventory, state
from pyinfra_docker import deploy_docker
from pyinfra_etcd import deploy_etcd
from pyinfra_kubernetes import deploy_kubernetes_master, deploy_kubernetes_node
SUDO = True
FAIL_PERCENT = 0
def get_etcd_nodes():
return [
'http://{0}:2379'.format(
etcd_node.f... | from pyinfra import inventory, state
from pyinfra_docker import deploy_docker
from pyinfra_etcd import deploy_etcd
from pyinfra_kubernetes import deploy_kubernetes_master, deploy_kubernetes_node
SUDO = True
FAIL_PERCENT = 0
def get_etcd_nodes():
return [
'http://{0}:2379'.format(
etcd_node.f... | Use Docker config pointing at the correct interface/subnect for networking. | Use Docker config pointing at the correct interface/subnect for networking.
| Python | mit | EDITD/pyinfra-kubernetes,EDITD/pyinfra-kubernetes | ---
+++
@@ -31,7 +31,10 @@
# Install/configure the nodes
with state.limit('kubernetes_nodes'):
# Install Docker
- deploy_docker()
+ deploy_docker(config={
+ # Make Docker use the Vagrant provided interface which has it's own /24
+ 'bip': '{{ host.fact.network_devices[host.data.network_inter... |
4714f803b22eda26eb2fc867c1d9e2c7230bdd11 | pythonforandroid/recipes/pysdl2/__init__.py | pythonforandroid/recipes/pysdl2/__init__.py |
from pythonforandroid.recipe import PythonRecipe
class PySDL2Recipe(PythonRecipe):
version = '0.9.3'
url = 'https://bitbucket.org/marcusva/py-sdl2/downloads/PySDL2-{version}.tar.gz'
depends = ['sdl2']
recipe = PySDL2Recipe()
|
from pythonforandroid.recipe import PythonRecipe
class PySDL2Recipe(PythonRecipe):
version = '0.9.6'
url = 'https://files.pythonhosted.org/packages/source/P/PySDL2/PySDL2-{version}.tar.gz'
depends = ['sdl2']
recipe = PySDL2Recipe()
| Fix outdated PySDL2 version and non-PyPI install source | Fix outdated PySDL2 version and non-PyPI install source
| Python | mit | kronenpj/python-for-android,rnixx/python-for-android,germn/python-for-android,PKRoma/python-for-android,germn/python-for-android,kivy/python-for-android,rnixx/python-for-android,rnixx/python-for-android,rnixx/python-for-android,PKRoma/python-for-android,kivy/python-for-android,germn/python-for-android,kronenpj/python-f... | ---
+++
@@ -3,8 +3,8 @@
class PySDL2Recipe(PythonRecipe):
- version = '0.9.3'
- url = 'https://bitbucket.org/marcusva/py-sdl2/downloads/PySDL2-{version}.tar.gz'
+ version = '0.9.6'
+ url = 'https://files.pythonhosted.org/packages/source/P/PySDL2/PySDL2-{version}.tar.gz'
depends = ['sdl2']
|
32cc988e81bbbecf09f7e7a801e92c6cfc281e75 | docs/autogen_config.py | docs/autogen_config.py | #!/usr/bin/env python
from os.path import join, dirname, abspath
from IPython.terminal.ipapp import TerminalIPythonApp
from ipykernel.kernelapp import IPKernelApp
here = abspath(dirname(__file__))
options = join(here, 'source', 'config', 'options')
generated = join(options, 'generated.rst')
def write_doc(name, titl... | #!/usr/bin/env python
from os.path import join, dirname, abspath
from IPython.terminal.ipapp import TerminalIPythonApp
from ipykernel.kernelapp import IPKernelApp
here = abspath(dirname(__file__))
options = join(here, 'source', 'config', 'options')
def write_doc(name, title, app, preamble=None):
filename = '%s.... | Remove generation of unnecessary generated.rst file | Remove generation of unnecessary generated.rst file
| Python | bsd-3-clause | ipython/ipython,ipython/ipython | ---
+++
@@ -7,7 +7,6 @@
here = abspath(dirname(__file__))
options = join(here, 'source', 'config', 'options')
-generated = join(options, 'generated.rst')
def write_doc(name, title, app, preamble=None):
filename = '%s.rst' % name
@@ -18,18 +17,12 @@
if preamble is not None:
f.write(pr... |
03caca6932384f08b06bbe5cb3ddc316b7ebf560 | manila_ui/local/local_settings.d/_90_manila_shares.py | manila_ui/local/local_settings.d/_90_manila_shares.py | # Copyright 2016 Red Hat Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | # Copyright 2016 Red Hat Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | Add example of logging setting for Manila | Add example of logging setting for Manila
This change demonstrates how we can define logging setting specific to
manila-ui, so that operators can easily understand how to customize
logging level and so on.
Change-Id: Ia8505d988ed75e0358452b5b3c2889b364680f22
| Python | apache-2.0 | openstack/manila-ui,openstack/manila-ui,openstack/manila-ui | ---
+++
@@ -12,6 +12,15 @@
# License for the specific language governing permissions and limitations
# under the License.
+# Sample
+# settings.LOGGING['loggers'].update({
+# 'manilaclient': {
+# 'handlers': ['console'],
+# 'level': 'DEBUG',
+# 'propagate': False,
+# }
+# })
+
# T... |
b43b555a7803c6afd50fe5992f455cc5d1ad5d86 | stonemason/service/tileserver/health/views.py | stonemason/service/tileserver/health/views.py | # -*- encoding: utf-8 -*-
__author__ = 'ray'
__date__ = '3/2/15'
from flask import make_response
def health_check():
"""Return a dummy response"""
response = make_response()
response.headers['Content-Type'] = 'text/plain'
response.headers['Cache-Control'] = 'public, max-age=0'
return response
| # -*- encoding: utf-8 -*-
__author__ = 'ray'
__date__ = '3/2/15'
from flask import make_response
import stonemason
import sys
import platform
VERSION_STRING = '''stonemason:%s
Python: %s
Platform: %s''' % (stonemason.__version__,
sys.version,
platform.version())
del stonemason, sys, platform
d... | Return sys/platform version in tileserver health check | FEATURE: Return sys/platform version in tileserver health check
| Python | mit | Kotaimen/stonemason,Kotaimen/stonemason | ---
+++
@@ -5,11 +5,25 @@
from flask import make_response
+import stonemason
+import sys
+import platform
+
+VERSION_STRING = '''stonemason:%s
+
+Python: %s
+
+Platform: %s''' % (stonemason.__version__,
+ sys.version,
+ platform.version())
+
+del stonemason, sys, platform
def health_check():
... |
a2871c774dd793f5264c1c530a36b10824c435db | cryptography/bindings/openssl/__init__.py | cryptography/bindings/openssl/__init__.py | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | Make api poitn to the right object | Make api poitn to the right object
| Python | bsd-3-clause | Lukasa/cryptography,dstufft/cryptography,bwhmather/cryptography,skeuomorf/cryptography,Ayrx/cryptography,bwhmather/cryptography,bwhmather/cryptography,dstufft/cryptography,Lukasa/cryptography,skeuomorf/cryptography,Ayrx/cryptography,Lukasa/cryptography,Ayrx/cryptography,kimvais/cryptography,dstufft/cryptography,dstufft... | ---
+++
@@ -11,7 +11,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from cryptography.bindings.openssl import api
+from cryptography.bindings.openssl.api import api
__all__ = ["api"] |
de6ac0596b58fac2efc547fe6f81a48f4a06f527 | tests/grammar_creation_test/TerminalAdding.py | tests/grammar_creation_test/TerminalAdding.py | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import TestCase, main
from grammpy import *
class TerminalAddingTest(TestCase):
pass
if __name__ == '__main__':
main() | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import TestCase, main
from grammpy import *
class TerminalAddingTest(TestCase):
def test_shouldAddOneTerminal(self):
g = Grammar(terminals=['asdf'])
self.assertTrue(g.have... | Add tests of terminal adding when grammar is create | Add tests of terminal adding when grammar is create
| Python | mit | PatrikValkovic/grammpy | ---
+++
@@ -12,7 +12,17 @@
class TerminalAddingTest(TestCase):
- pass
+ def test_shouldAddOneTerminal(self):
+ g = Grammar(terminals=['asdf'])
+ self.assertTrue(g.have_term('asdf'))
+ self.assertFalse(g.have_term('a'))
+
+ def test_shouldAddMoreTerminals(self):
+ g = Grammar(... |
3081fcd1e37520f504804a3efae62c33d3371a21 | temba/msgs/migrations/0034_move_recording_domains.py | temba/msgs/migrations/0034_move_recording_domains.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('msgs', '0033_exportmessagestask_uuid'),
]
def move_recording_domains(apps, schema_editor):
M... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('msgs', '0033_exportmessagestask_uuid'),
]
def move_recording_domains(apps, schema_editor):
M... | Tweak to migration so it is a bit faster for future migraters | Tweak to migration so it is a bit faster for future migraters
| Python | agpl-3.0 | tsotetsi/textily-web,tsotetsi/textily-web,pulilab/rapidpro,praekelt/rapidpro,ewheeler/rapidpro,reyrodrigues/EU-SMS,reyrodrigues/EU-SMS,ewheeler/rapidpro,reyrodrigues/EU-SMS,tsotetsi/textily-web,tsotetsi/textily-web,pulilab/rapidpro,praekelt/rapidpro,tsotetsi/textily-web,praekelt/rapidpro,pulilab/rapidpro,ewheeler/rapid... | ---
+++
@@ -22,7 +22,7 @@
# our new domain is more specific
new_bucket_domain = 'https://' + settings.AWS_BUCKET_DOMAIN
- for msg in Msg.objects.filter(msg_type='V').exclude(recording_url=None):
+ for msg in Msg.objects.filter(direction='I', msg_type='V').exclude(recording_url=None):... |
7755dda1449f6264d7d7fe57dc776c731ab22d84 | src/satosa/micro_services/processors/scope_processor.py | src/satosa/micro_services/processors/scope_processor.py | from ..attribute_processor import AttributeProcessorError
from .base_processor import BaseProcessor
CONFIG_KEY_SCOPE = 'scope'
CONFIG_DEFAULT_SCOPE = ''
class ScopeProcessor(BaseProcessor):
def process(self, internal_data, attribute, **kwargs):
scope = kwargs.get(CONFIG_KEY_SCOPE, CONFIG_DEFAULT_SCOPE)
... | from ..attribute_processor import AttributeProcessorError
from .base_processor import BaseProcessor
CONFIG_KEY_SCOPE = 'scope'
CONFIG_DEFAULT_SCOPE = ''
class ScopeProcessor(BaseProcessor):
def process(self, internal_data, attribute, **kwargs):
scope = kwargs.get(CONFIG_KEY_SCOPE, CONFIG_DEFAULT_SCOPE)
... | Allow scope processor to handle multivalued attributes | Allow scope processor to handle multivalued attributes
| Python | apache-2.0 | its-dirg/SATOSA,irtnog/SATOSA,SUNET/SATOSA,SUNET/SATOSA,irtnog/SATOSA | ---
+++
@@ -13,5 +13,11 @@
raise AttributeProcessorError("No scope set.")
attributes = internal_data.attributes
- value = attributes.get(attribute, [None])[0]
- attributes[attribute][0] = value + '@' + scope
+ values = attributes.get(attribute, [])
+ if not isinstan... |
adf3a500e8ab8115520daa16bc008faeec7cfca9 | gitfs/views/view.py | gitfs/views/view.py | import os
from abc import ABCMeta, abstractmethod
from gitfs import FuseMethodNotImplemented
from gitfs.filesystems.passthrough import PassthroughFuse
class View(PassthroughFuse):
__metaclass__ = ABCMeta
def __init__(self, *args, **kwargs):
self.args = args
for attr in kwargs:
s... | import os
from abc import ABCMeta, abstractmethod
from gitfs import FuseMethodNotImplemented
class View(object):
__metaclass__ = ABCMeta
def __init__(self, *args, **kwargs):
self.args = args
for attr in kwargs:
setattr(self, attr, kwargs[attr])
def getxattr(self, path, name... | Make View inherit from objects instead of PassthroughFuse | Make View inherit from objects instead of PassthroughFuse
| Python | apache-2.0 | PressLabs/gitfs,PressLabs/gitfs,rowhit/gitfs,bussiere/gitfs,ksmaheshkumar/gitfs | ---
+++
@@ -2,9 +2,8 @@
from abc import ABCMeta, abstractmethod
from gitfs import FuseMethodNotImplemented
-from gitfs.filesystems.passthrough import PassthroughFuse
-class View(PassthroughFuse):
+class View(object):
__metaclass__ = ABCMeta
def __init__(self, *args, **kwargs):
@@ -13,7 +12,6 @@
... |
ee28fdc66fbb0f91821ff18ff219791bf5de8f4d | corehq/apps/fixtures/tasks.py | corehq/apps/fixtures/tasks.py | from __future__ import absolute_import
from __future__ import unicode_literals
from corehq.apps.fixtures.upload import upload_fixture_file
from soil import DownloadBase
from celery.task import task
@task(serializer='pickle')
def fixture_upload_async(domain, download_id, replace):
task = fixture_upload_async
D... | from __future__ import absolute_import, unicode_literals
from celery.task import task
from soil import DownloadBase
from corehq.apps.fixtures.upload import upload_fixture_file
@task
def fixture_upload_async(domain, download_id, replace):
task = fixture_upload_async
DownloadBase.set_progress(task, 0, 100)
... | Change fixture upload task to json serializer | Change fixture upload task to json serializer
| Python | bsd-3-clause | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | ---
+++
@@ -1,11 +1,13 @@
-from __future__ import absolute_import
-from __future__ import unicode_literals
-from corehq.apps.fixtures.upload import upload_fixture_file
-from soil import DownloadBase
+from __future__ import absolute_import, unicode_literals
+
from celery.task import task
+from soil import DownloadB... |
621858406aaa4d7deb9d8ec6b96459a6a7d25285 | masters/master.chromium.webkit/master_gatekeeper_cfg.py | masters/master.chromium.webkit/master_gatekeeper_cfg.py | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from master import gatekeeper
from master import master_utils
# This is the list of the builder categories and the corresponding critical
# steps. If on... | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from master import gatekeeper
from master import master_utils
# This is the list of the builder categories and the corresponding critical
# steps. If on... | Change runhooks failures on WebKit XP to not close the chromium.webkit tree. | Change runhooks failures on WebKit XP to not close the chromium.webkit tree.
Since the failures are usually the bot's fault, not the patch's.
R=maruel@chromium.org, iannucci@chromium.org, ojan@chromium.org
BUG=262577
Review URL: https://chromiumcodereview.appspot.com/19477003
git-svn-id: 239fca9b83025a0b6f823aeeca0... | Python | bsd-3-clause | eunchong/build,eunchong/build,eunchong/build,eunchong/build | ---
+++
@@ -15,6 +15,7 @@
}
exclusions = {
+ 'WebKit XP': ['runhooks'], # crbug.com/262577
}
forgiving_steps = ['update_scripts', 'update', 'gclient_revert'] |
57024104a5951d62ff8a87a281a6d232583dabed | python/new_year_chaos.py | python/new_year_chaos.py | #!/bin/python3
import math
import os
import random
import re
import sys
# Complete the minimumBribes function below.
def minimumBribes(finalLine):
if invalid(finalLine):
return "Too chaotic"
return bubbleSort(finalLine)
def invalid(finalLine):
return any(didBribeMoreThanTwoPeople(person, index) for index... | #!/bin/python3
import math
import os
import random
import re
import sys
# Complete the minimumBribes function below.
def minimumBribes(finalLine):
if invalid(finalLine):
return "Too chaotic"
return bubbleSort(finalLine)
def invalid(finalLine):
return any(didBribeMoreThanTwoPeople(person, index) for index... | Improve efficiency of new year chaos | Improve efficiency of new year chaos
| Python | mit | rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank | ---
+++
@@ -20,13 +20,18 @@
def bubbleSort(line):
swaps = 0
- numberOfPeople = len(line)
+ swappedInCurrentPass = False
- for person in range(numberOfPeople):
- for i in range(0, numberOfPeople - person - 1):
+ for person in range(len(line)):
+ for i in range(0, len(line) - 1):
... |
d28eba4f9a62ca96bbfe5069f43864a6a71bea71 | examples/advanced/extend_python.py | examples/advanced/extend_python.py | """
Extend the Python Grammar
==============================
This example demonstrates how to use the `%extend` statement,
to add new syntax to the example Python grammar.
"""
from lark.lark import Lark
from python_parser import PythonIndenter
GRAMMAR = r"""
%import .python3 (compound_stmt, single_input, file_input... | """
Extend the Python Grammar
==============================
This example demonstrates how to use the `%extend` statement,
to add new syntax to the example Python grammar.
"""
from lark.lark import Lark
from python_parser import PythonIndenter
GRAMMAR = r"""
%import .python3 (compound_stmt, single_input, file_input... | Fix typos in comment of example code | Fix typos in comment of example code
| Python | mit | lark-parser/lark | ---
+++
@@ -39,7 +39,7 @@
""", start='file_input')
-# Remove the 'python3__' prefix that was add to the implicitely imported rules.
+# Remove the 'python3__' prefix that was added to the implicitly imported rules.
for t in tree.iter_subtrees():
t.data = t.data.rsplit('__', 1)[-1]
|
51b28e286bc7f8f272a1f45b47d246976b65ddda | go/apps/rapidsms/tests/test_definition.py | go/apps/rapidsms/tests/test_definition.py | from vumi.tests.helpers import VumiTestCase
from go.apps.rapidsms.definition import ConversationDefinition
class TestConversationDefinition(VumiTestCase):
def test_conversation_type(self):
conv_def = ConversationDefinition()
self.assertEqual(conv_def.conversation_type, "rapidsms")
| Add test for conversation definition. | Add test for conversation definition.
| Python | bsd-3-clause | praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go | ---
+++
@@ -0,0 +1,9 @@
+from vumi.tests.helpers import VumiTestCase
+
+from go.apps.rapidsms.definition import ConversationDefinition
+
+
+class TestConversationDefinition(VumiTestCase):
+ def test_conversation_type(self):
+ conv_def = ConversationDefinition()
+ self.assertEqual(conv_def.conversatio... | |
d90edf3b4d8fa714e7e24acbc22fb35bc828911d | services/controllers/interpolator.py | services/controllers/interpolator.py | class Interpolator:
def __init__(self):
self.data = []
def addIndexValue(self, index, value):
self.data.append((index, value))
def valueAtIndex(self, target_index):
if target_index < self.data[0][0]:
return None
elif self.data[-1][0] < target_index:
... | class Interpolator:
def __init__(self):
self.data = []
def addIndexValue(self, index, value):
self.data.append((index, value))
def valueAtIndex(self, target_index):
if target_index < self.data[0][0]:
return None
elif self.data[-1][0] < target_index:
... | Add ability to convert to/from an array | Add ability to convert to/from an array
This is needed as an easy way to serialize an interpolator for sending/receiving over HTTP
| Python | bsd-3-clause | gizmo-cda/g2x-submarine-v2,gizmo-cda/g2x-submarine-v2,gizmo-cda/g2x-submarine-v2,gizmo-cda/g2x-submarine-v2 | ---
+++
@@ -1,4 +1,5 @@
class Interpolator:
+
def __init__(self):
self.data = []
@@ -30,6 +31,20 @@
return start[1] + value_delta * percent
+ def to_array(self):
+ result = []
+
+ for (index, value) in self.data:
+ result.append(index)
+ result.... |
3deffc39e1a489255272c35f7171b7e85942b108 | shipyard/shipyard/host/node/build.py | shipyard/shipyard/host/node/build.py | """Host-only environment for Node.js."""
from pathlib import Path
from foreman import define_parameter, decorate_rule
from shipyard import install_packages
(define_parameter('npm_prefix')
.with_doc("""Location host-only npm.""")
.with_type(Path)
.with_derive(lambda ps: ps['//base:build'] / 'host/npm-host')
)
@... | """Host-only environment for Node.js."""
from pathlib import Path
from foreman import define_parameter, decorate_rule
from shipyard import (
ensure_file,
execute,
install_packages,
)
(define_parameter('npm_prefix')
.with_doc("""Location host-only npm.""")
.with_type(Path)
.with_derive(lambda ps: ps['... | Fix node/nodejs name conflict on Ubuntu systems | Fix node/nodejs name conflict on Ubuntu systems
| Python | mit | clchiou/garage,clchiou/garage,clchiou/garage,clchiou/garage | ---
+++
@@ -3,7 +3,11 @@
from pathlib import Path
from foreman import define_parameter, decorate_rule
-from shipyard import install_packages
+from shipyard import (
+ ensure_file,
+ execute,
+ install_packages,
+)
(define_parameter('npm_prefix')
@@ -16,7 +20,11 @@
@decorate_rule('//base:build')
de... |
df8618c185108aa71e42da7d9569e16fb350b4c0 | hackeriet/doorcontrold/__init__.py | hackeriet/doorcontrold/__init__.py | #!/usr/bin/env python
from hackeriet.mqtt import MQTT
from hackeriet.door import Doors
import threading, os, logging
logging.basicConfig(level=logging.INFO, format='%(asctime)-15s %(message)s')
piface = False
# Determine if piface is used on the Pi
if "PIFACE" in os.environ:
piface = True
logging.info('Using pif... | #!/usr/bin/env python
from hackeriet.mqtt import MQTT
from hackeriet.door import Doors
import threading, os, logging
logging.basicConfig(level=logging.INFO, format='%(asctime)-15s %(message)s')
piface = False
# Determine if piface is used on the Pi
if "PIFACE" in os.environ:
piface = True
logging.info('Using pif... | Fix incompatibilities with latest paho lib | Fix incompatibilities with latest paho lib
| Python | apache-2.0 | hackeriet/pyhackeriet,hackeriet/pyhackeriet,hackeriet/nfcd,hackeriet/nfcd,hackeriet/pyhackeriet,hackeriet/nfcd | ---
+++
@@ -19,18 +19,16 @@
timeout = int(os.getenv("DOOR_TIMEOUT", 2))
door = Doors(piface=piface,pin=gpio_pin,timeout=timeout)
-mqtt = MQTT()
+
+def on_message(mosq, obj, msg):
+ door.open()
+ logging.info('Door opened: %s' % msg.payload
door_name = os.getenv("DOOR_NAME", 'hackeriet')
door_topic = "hacker... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.