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 |
|---|---|---|---|---|---|---|---|---|---|---|
483800541ee66de006392c361e06177bc9db4784 | kboard/board/urls.py | kboard/board/urls.py | # Created by JHJ on 2016. 10. 5.
from django.conf.urls import url
from . import views
app_name = 'board'
urlpatterns = [
url(r'^$', views.board_list, name='board_list'),
url(r'^(?P<board_slug>[-a-z]+)/$', views.post_list, name='post_list'),
url(r'^(?P<board_slug>[-a-z]+)/new/$', views.new_post, name='new... | # Created by JHJ on 2016. 10. 5.
from django.conf.urls import url
from django.conf import settings
from django.conf.urls.static import static
from . import views
app_name = 'board'
urlpatterns = [
url(r'^$', views.board_list, name='board_list'),
url(r'^(?P<board_slug>[-a-z]+)/$', views.post_list, name='post_... | Set url to serve uploaded file during development | Set url to serve uploaded file during development
| Python | mit | guswnsxodlf/k-board,kboard/kboard,cjh5414/kboard,kboard/kboard,hyesun03/k-board,hyesun03/k-board,hyesun03/k-board,guswnsxodlf/k-board,cjh5414/kboard,darjeeling/k-board,cjh5414/kboard,kboard/kboard,guswnsxodlf/k-board | ---
+++
@@ -1,6 +1,8 @@
# Created by JHJ on 2016. 10. 5.
from django.conf.urls import url
+from django.conf import settings
+from django.conf.urls.static import static
from . import views
@@ -15,4 +17,4 @@
url(r'^(?P<post_id>\d+)/$', views.view_post, name='view_post'),
url(r'^(?P<post_id>\d+)/comme... |
e09214068a12768e9aafd04363d353359ca7e1f3 | src/actions/actions/timetracking/__init__.py | src/actions/actions/timetracking/__init__.py | #!/usr/bin/python
######################################################################
# Cloud Routes Bridge
# -------------------------------------------------------------------
# Actions Module
######################################################################
import stathat
import time
import syslog
def acti... | #!/usr/bin/python
######################################################################
# Cloud Routes Bridge
# -------------------------------------------------------------------
# Actions Module
######################################################################
import stathat
import time
def action(**kwargs):
... | Convert reactions syslog to logger: timetracking | Convert reactions syslog to logger: timetracking
| Python | unknown | dethos/cloudroutes-service,asm-products/cloudroutes-service,rbramwell/runbook,codecakes/cloudroutes-service,codecakes/cloudroutes-service,asm-products/cloudroutes-service,madflojo/cloudroutes-service,Runbook/runbook,codecakes/cloudroutes-service,asm-products/cloudroutes-service,codecakes/cloudroutes-service,madflojo/cl... | ---
+++
@@ -7,15 +7,15 @@
import stathat
import time
-import syslog
def action(**kwargs):
''' This method is called to action a reaction '''
- updateStathat(kwargs['jdata'])
+ logger = kwargs['logger']
+ updateStathat(kwargs['jdata'], logger)
return True
-def updateStathat(jdata):
+def u... |
e399c0b1988ed8b2981ddc684a0a3652a73ea31e | pavelib/utils/test/utils.py | pavelib/utils/test/utils.py | """
Helper functions for test tasks
"""
from paver.easy import sh, task
from pavelib.utils.envs import Env
__test__ = False # do not collect
@task
def clean_test_files():
"""
Clean fixture files used by tests and .pyc files
"""
sh("git clean -fqdx test_root/logs test_root/data test_root/staticfiles ... | """
Helper functions for test tasks
"""
from paver.easy import sh, task
from pavelib.utils.envs import Env
__test__ = False # do not collect
@task
def clean_test_files():
"""
Clean fixture files used by tests and .pyc files
"""
sh("git clean -fqdx test_root/logs test_root/data test_root/staticfiles ... | Clean out the mako temp dirs before running tests | Clean out the mako temp dirs before running tests
| Python | agpl-3.0 | zofuthan/edx-platform,eemirtekin/edx-platform,TeachAtTUM/edx-platform,synergeticsedx/deployment-wipro,doismellburning/edx-platform,OmarIthawi/edx-platform,jolyonb/edx-platform,appliedx/edx-platform,philanthropy-u/edx-platform,msegado/edx-platform,pepeportela/edx-platform,JCBarahona/edX,lduarte1991/edx-platform,jamesblu... | ---
+++
@@ -15,6 +15,7 @@
sh("git clean -fqdx test_root/logs test_root/data test_root/staticfiles test_root/uploads")
sh("find . -type f -name \"*.pyc\" -delete")
sh("rm -rf test_root/log/auto_screenshots/*")
+ sh("rm -rf /tmp/mako_[cl]ms")
def clean_dir(directory): |
f931a434839222bb00282a432d6d6a0c2c52eb7d | numpy/array_api/_typing.py | numpy/array_api/_typing.py | """
This file defines the types for type annotations.
These names aren't part of the module namespace, but they are used in the
annotations in the function signatures. The functions in the module are only
valid for inputs that match the given type annotations.
"""
__all__ = [
"Array",
"Device",
"Dtype",
... | """
This file defines the types for type annotations.
These names aren't part of the module namespace, but they are used in the
annotations in the function signatures. The functions in the module are only
valid for inputs that match the given type annotations.
"""
from __future__ import annotations
__all__ = [
"... | Replace `NestedSequence` with a proper nested sequence protocol | ENH: Replace `NestedSequence` with a proper nested sequence protocol
| Python | bsd-3-clause | numpy/numpy,endolith/numpy,charris/numpy,rgommers/numpy,numpy/numpy,jakirkham/numpy,seberg/numpy,mattip/numpy,jakirkham/numpy,endolith/numpy,rgommers/numpy,mattip/numpy,mattip/numpy,seberg/numpy,pdebuyl/numpy,pdebuyl/numpy,endolith/numpy,endolith/numpy,mattip/numpy,jakirkham/numpy,charris/numpy,seberg/numpy,mhvk/numpy,... | ---
+++
@@ -5,6 +5,8 @@
annotations in the function signatures. The functions in the module are only
valid for inputs that match the given type annotations.
"""
+
+from __future__ import annotations
__all__ = [
"Array",
@@ -16,7 +18,16 @@
]
import sys
-from typing import Any, Literal, Sequence, Type, U... |
718a04f14f3ede084a2d9391e187b4d943463c6f | yanico/session/__init__.py | yanico/session/__init__.py | """Handle nicovideo.jp user_session."""
# Copyright 2015-2016 Masayuki Yamamoto
#
# 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
#
# Un... | """Handle nicovideo.jp user_session."""
# Copyright 2015-2016 Masayuki Yamamoto
#
# 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
#
# Un... | Fix a typo of class docstring | Fix a typo of class docstring
| Python | apache-2.0 | ma8ma/yanico | ---
+++
@@ -15,4 +15,4 @@
class UserSessionNotFoundError(Exception):
- """Firefox profile exists, buf user_session is not found."""
+ """Profile exists, but user_session is not found.""" |
889eed552f4e17797764a9d9a2da6bbaa6d5dd33 | admin_panel/views.py | admin_panel/views.py | from django.views import View
from django.views.generic import TemplateView
from django.contrib import auth
from django.contrib import messages
from django import http
class LoginView(TemplateView):
template_name = "admin/login.html"
def post(self, request):
username = request.POST['username']
... | from django.views import View
from django.views.generic import TemplateView
from django.contrib import auth
from django.contrib import messages
from django import http
from django.urls import reverse
class LoginView(TemplateView):
template_name = "admin/login.html"
def post(self, request):
username =... | Use django reverse function to obtain url instead of hard-coding | Use django reverse function to obtain url instead of hard-coding
| Python | mpl-2.0 | Apo11onian/Apollo-Blog,Apo11onian/Apollo-Blog,Apo11onian/Apollo-Blog | ---
+++
@@ -3,6 +3,7 @@
from django.contrib import auth
from django.contrib import messages
from django import http
+from django.urls import reverse
class LoginView(TemplateView):
@@ -23,7 +24,7 @@
if "next" in request.GET:
return request.GET['next']
else:
- return "/... |
bb732b97536bd1bec605c96440ce1f18d5edb59a | features/steps/install_steps.py | features/steps/install_steps.py | from behave import given
from captainhook.checkers.utils import bash
@given('I have installed captainhook')
def step_impl(context):
bash('captainhook')
| from behave import given
from captainhook.checkers.utils import bash
@given('I have installed captainhook')
def step_impl(context):
bash('captainhook install')
| Fix behave tests to use install command. | Fix behave tests to use install command.
| Python | bsd-3-clause | Friz-zy/captainhook,alexcouper/captainhook,pczerkas/captainhook | ---
+++
@@ -5,4 +5,4 @@
@given('I have installed captainhook')
def step_impl(context):
- bash('captainhook')
+ bash('captainhook install') |
0f35ed05d335e7c126675bc913b72aac3ac916df | project/apps/api/signals.py | project/apps/api/signals.py | from django.db.models.signals import (
post_save,
)
from django.dispatch import receiver
from rest_framework.authtoken.models import Token
from django.conf import settings
from .models import (
Contest,
)
@receiver(post_save, sender=settings.AUTH_USER_MODEL)
def user_post_save(sender, instance=None, creat... | from django.db.models.signals import (
post_save,
)
from django.dispatch import receiver
from rest_framework.authtoken.models import Token
from django.conf import settings
from .models import (
Contest,
)
@receiver(post_save, sender=settings.AUTH_USER_MODEL)
def user_post_save(sender, instance=None, creat... | Add check for fixture loading | Add check for fixture loading
| Python | bsd-2-clause | barberscore/barberscore-api,dbinetti/barberscore-django,dbinetti/barberscore,barberscore/barberscore-api,dbinetti/barberscore,barberscore/barberscore-api,dbinetti/barberscore-django,barberscore/barberscore-api | ---
+++
@@ -20,7 +20,8 @@
@receiver(post_save, sender=Contest)
-def contest_post_save(sender, instance=None, created=False, **kwargs):
- if created:
- instance.build()
- instance.save()
+def contest_post_save(sender, instance=None, created=False, raw=False, **kwargs):
+ if not raw:
+ i... |
f277007e46b7c6d8c978011d7356b7527ba91133 | axes/utils.py | axes/utils.py | from axes.models import AccessAttempt
def reset(ip=None, username=None):
"""Reset records that match ip or username, and
return the count of removed attempts.
"""
count = 0
attempts = AccessAttempt.objects.all()
if ip:
attempts = attempts.filter(ip_address=ip)
if username:
... | from django.core.cache import cache
from axes.models import AccessAttempt
def reset(ip=None, username=None):
"""Reset records that match ip or username, and
return the count of removed attempts.
"""
count = 0
attempts = AccessAttempt.objects.all()
if ip:
attempts = attempts.filter(ip... | Delete cache key in reset command line | Delete cache key in reset command line
| Python | mit | jazzband/django-axes,django-pci/django-axes | ---
+++
@@ -1,3 +1,5 @@
+from django.core.cache import cache
+
from axes.models import AccessAttempt
@@ -15,8 +17,13 @@
if attempts:
count = attempts.count()
+ from axes.decorators import get_cache_key
+ for attempt in attempts:
+ cache_hash_key = get_cache_key(attempt)
+... |
a3c131776678b8e91e1179cd0f3c3b4b3fbbf6fb | openid_provider/tests/test_code_flow.py | openid_provider/tests/test_code_flow.py | from django.core.urlresolvers import reverse
from django.test import RequestFactory
from django.test import TestCase
from openid_provider.tests.utils import *
from openid_provider.views import *
class CodeFlowTestCase(TestCase):
def setUp(self):
self.factory = RequestFactory()
self.user = create_... | from django.core.urlresolvers import reverse
from django.test import RequestFactory
from django.test import TestCase
from openid_provider.tests.utils import *
from openid_provider.views import *
import urllib
class CodeFlowTestCase(TestCase):
def setUp(self):
self.factory = RequestFactory()
self.... | Add another test for Code Flow. | Add another test for Code Flow.
| Python | mit | wayward710/django-oidc-provider,bunnyinc/django-oidc-provider,wayward710/django-oidc-provider,juanifioren/django-oidc-provider,ByteInternet/django-oidc-provider,wojtek-fliposports/django-oidc-provider,ByteInternet/django-oidc-provider,django-py/django-openid-provider,torreco/django-oidc-provider,django-py/django-openid... | ---
+++
@@ -3,6 +3,7 @@
from django.test import TestCase
from openid_provider.tests.utils import *
from openid_provider.views import *
+import urllib
class CodeFlowTestCase(TestCase):
@@ -27,3 +28,28 @@
self.assertEqual(response.status_code, 200)
self.assertEqual(bool(response.content), Tr... |
15c0ecf0e8ecd71017d8a1f2414204944b134fbd | lib/jasy/__init__.py | lib/jasy/__init__.py | #
# Jasy - JavaScript Tooling Refined
# Copyright 2010 Sebastian Werner
#
#
# Configure logging
#
import logging
logging.basicConfig(filename="log.txt", level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s")
# Define a Handler which writes INFO messages or higher to the sys.stderr
console = logging... | #
# Jasy - JavaScript Tooling Refined
# Copyright 2010 Sebastian Werner
#
#
# Configure logging
#
import logging
logging.basicConfig(filename="log.txt", level=logging.DEBUG, format="%(asctime)s - %(levelname)s - %(message)s")
# Define a Handler which writes INFO messages or higher to the sys.stderr
console = loggin... | Enable debug level for log file | Enable debug level for log file
| Python | mit | sebastian-software/jasy,zynga/jasy,sebastian-software/jasy,zynga/jasy | ---
+++
@@ -9,7 +9,7 @@
import logging
-logging.basicConfig(filename="log.txt", level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s")
+logging.basicConfig(filename="log.txt", level=logging.DEBUG, format="%(asctime)s - %(levelname)s - %(message)s")
# Define a Handler which writes INFO message... |
aaaaa179f43b720d207377cf17dcd6cec0c19321 | falcom/tree/mutable_tree.py | falcom/tree/mutable_tree.py | # Copyright (c) 2017 The Regents of the University of Michigan.
# All Rights Reserved. Licensed according to the terms of the Revised
# BSD License. See LICENSE.txt for details.
class MutableTree:
def __init__ (self, value = None):
self.child = None
self.children = [ ]
self.value = value
... | # Copyright (c) 2017 The Regents of the University of Michigan.
# All Rights Reserved. Licensed according to the terms of the Revised
# BSD License. See LICENSE.txt for details.
class MutableTree:
def __init__ (self, value = None):
self.child = None
self.children = [ ]
self.value = value
... | Add children to debug str | Add children to debug str
| Python | bsd-3-clause | mlibrary/image-conversion-and-validation,mlibrary/image-conversion-and-validation | ---
+++
@@ -50,4 +50,4 @@
if self.value is not None:
debug += " " + repr(self.value)
- return "<{}>".format(debug)
+ return "<{} {}>".format(debug, repr(self.children)) |
4a38d0df3d72494e2a96ac776f13ce685b537561 | lokar/bib.py | lokar/bib.py | # coding=utf-8
from __future__ import unicode_literals
from io import BytesIO
from .marc import Record
from .util import etree, parse_xml, show_diff
class Bib(object):
""" An Alma Bib record """
def __init__(self, alma, xml):
self.alma = alma
self.orig_xml = xml.encode('utf-8')
sel... | # coding=utf-8
from __future__ import unicode_literals
from io import BytesIO
from .marc import Record
from .util import etree, parse_xml, show_diff
class Bib(object):
""" An Alma Bib record """
def __init__(self, alma, xml):
self.alma = alma
self.orig_xml = xml
self.init(xml)
... | Fix diffing on Py3 by comparing unicode strings | Fix diffing on Py3 by comparing unicode strings
| Python | agpl-3.0 | scriptotek/almar,scriptotek/lokar | ---
+++
@@ -13,7 +13,7 @@
def __init__(self, alma, xml):
self.alma = alma
- self.orig_xml = xml.encode('utf-8')
+ self.orig_xml = xml
self.init(xml)
def init(self, xml):
@@ -25,15 +25,15 @@
def save(self, diff=False, dry_run=False):
# Save record back to Alm... |
f4eff6d839d05731a6e29d3e769363e981a32739 | test/run.py | test/run.py | #!/bin/env python2.7
import argparse
import os
parser = argparse.ArgumentParser(description="Run unit tests")
parser.add_argument("-g", "--gui", help="start in GUI mode",
action="store_true")
parser.add_argument("-t", "--test", help="run only selected test(s)",
action="append")... | #!/bin/env python2.7
import argparse
import os
parser = argparse.ArgumentParser(description="Run unit tests")
parser.add_argument("-g", "--gui", help="start in GUI mode",
action="store_true")
parser.add_argument("-t", "--test", help="run only selected test(s)",
action="append")... | Add ability to select UVM version in unit tests | Add ability to select UVM version in unit tests
| Python | apache-2.0 | tudortimi/vgm_svunit_utils,tudortimi/vgm_svunit_utils | ---
+++
@@ -8,6 +8,8 @@
action="store_true")
parser.add_argument("-t", "--test", help="run only selected test(s)",
action="append")
+parser.add_argument("--uvm-version", help="run with selected UVM version (only supported for ius and xcelium",
+ choices=['... |
842441bebc328329caef0a7e7aae6d8594318097 | tests/test_error_handling.py | tests/test_error_handling.py | import unittest
from flask import Flask
from flask_selfdoc import Autodoc
class TestErrorHandling(unittest.TestCase):
def test_app_not_initialized(self):
app = Flask(__name__)
autodoc = Autodoc()
with app.app_context():
self.assertRaises(RuntimeError, lambda: autodoc.html())
| import unittest
from flask import Flask
from flask_selfdoc import Autodoc
class TestErrorHandling(unittest.TestCase):
def test_app_not_initialized(self):
app = Flask(__name__)
autodoc = Autodoc()
with app.app_context():
self.assertRaises(RuntimeError, lambda: autodoc.html())
... | Add a test that these calls dont fail. | Add a test that these calls dont fail.
| Python | mit | jwg4/flask-autodoc,jwg4/flask-autodoc | ---
+++
@@ -10,3 +10,16 @@
autodoc = Autodoc()
with app.app_context():
self.assertRaises(RuntimeError, lambda: autodoc.html())
+
+ def test_app_initialized_by_ctor(self):
+ app = Flask(__name__)
+ autodoc = Autodoc(app)
+ with app.app_context():
+ auto... |
1312dc95d9c25897c11c8e818edcb9cd2b6a32f7 | ecommerce/extensions/app.py | ecommerce/extensions/app.py | from oscar import app
class EdxShop(app.Shop):
# URLs are only visible to users with staff permissions
default_permissions = 'is_staff'
application = EdxShop()
| from oscar import app
from oscar.core.application import Application
class EdxShop(app.Shop):
# URLs are only visible to users with staff permissions
default_permissions = 'is_staff'
# Override core app instances with blank application instances to exclude their URLs.
promotions_app = Application()
... | Move the security fix into Eucalyptus | Move the security fix into Eucalyptus
| Python | agpl-3.0 | mferenca/HMS-ecommerce,mferenca/HMS-ecommerce,mferenca/HMS-ecommerce | ---
+++
@@ -1,9 +1,16 @@
from oscar import app
+from oscar.core.application import Application
class EdxShop(app.Shop):
# URLs are only visible to users with staff permissions
default_permissions = 'is_staff'
+ # Override core app instances with blank application instances to exclude their URLs.
... |
286422d95355fc55c1745731732d763ca1bdb7e5 | shap/__init__.py | shap/__init__.py | # flake8: noqa
__version__ = '0.28.5k'
from .explainers.kernel import KernelExplainer, kmeans
from .explainers.sampling import SamplingExplainer
from .explainers.tree import TreeExplainer, Tree
from .explainers.deep import DeepExplainer
from .explainers.gradient import GradientExplainer
from .explainers.linear import... | # flake8: noqa
__version__ = '0.28.6'
from .explainers.kernel import KernelExplainer, kmeans
from .explainers.sampling import SamplingExplainer
from .explainers.tree import TreeExplainer, Tree
from .explainers.deep import DeepExplainer
from .explainers.gradient import GradientExplainer
from .explainers.linear import ... | Tag new version with bug fixes. | Tag new version with bug fixes.
| Python | mit | slundberg/shap,slundberg/shap,slundberg/shap,slundberg/shap | ---
+++
@@ -1,6 +1,6 @@
# flake8: noqa
-__version__ = '0.28.5k'
+__version__ = '0.28.6'
from .explainers.kernel import KernelExplainer, kmeans
from .explainers.sampling import SamplingExplainer |
1f8895c4e2f9189032383771d322afdbfdac5e37 | pathvalidate/variable/_elasticsearch.py | pathvalidate/variable/_elasticsearch.py | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import, unicode_literals
import re
from ._base import VarNameSanitizer
class ElasticsearchIndexNameSanitizer(VarNameSanitizer):
__RE_INVALID_INDEX_NAME = re.compile("[" + re.escape('\\/*?... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import, unicode_literals
import re
from ._base import VarNameSanitizer
class ElasticsearchIndexNameSanitizer(VarNameSanitizer):
__RE_INVALID_INDEX_NAME = re.compile("[" + re.escape('\\/*?... | Change to avoid "DeprecationWarning: invalid escape sequence" | Change to avoid "DeprecationWarning: invalid escape sequence"
| Python | mit | thombashi/pathvalidate | ---
+++
@@ -13,7 +13,7 @@
class ElasticsearchIndexNameSanitizer(VarNameSanitizer):
- __RE_INVALID_INDEX_NAME = re.compile("[" + re.escape('\\/*?"<>|,"') + "\s]+")
+ __RE_INVALID_INDEX_NAME = re.compile("[" + re.escape('\\/*?"<>|,"') + r"\s]+")
__RE_INVALID_INDEX_NAME_HEAD = re.compile("^[_]+")
... |
1958165c7bf3b9fa45972658b980cefe6a742164 | myhpom/validators.py | myhpom/validators.py | import re
from django.core.exceptions import ValidationError
from django.core.validators import EmailValidator, RegexValidator
from django.contrib.auth.models import User
# First Name, Last Name: At least one alphanumeric character.
name_validator = RegexValidator(
regex=r'\w',
flags=re.U,
message='Please ... | import re
from django.core.exceptions import ValidationError
from django.core.validators import EmailValidator, RegexValidator
# First Name, Last Name: At least one alphanumeric character.
name_validator = RegexValidator(
regex=r'\w',
flags=re.U,
message='Please enter your name'
)
# Email: valid email add... | Revert "[mh-14] "This import is ultimately just from django.contrib.auth.models import User - using that directly would probably address whatever circular import required that this import get put here, and make it clearer which model User is."-Dane" | Revert "[mh-14] "This import is ultimately just from django.contrib.auth.models import User - using that directly would probably address whatever circular import required that this import get put here, and make it clearer which model User is."-Dane"
This reverts commit 7350c56339acaef416d03b6d7ae0e818ab8db182.
| Python | bsd-3-clause | ResearchSoftwareInstitute/MyHPOM,ResearchSoftwareInstitute/MyHPOM,ResearchSoftwareInstitute/MyHPOM,ResearchSoftwareInstitute/MyHPOM,ResearchSoftwareInstitute/MyHPOM | ---
+++
@@ -1,7 +1,6 @@
import re
from django.core.exceptions import ValidationError
from django.core.validators import EmailValidator, RegexValidator
-from django.contrib.auth.models import User
# First Name, Last Name: At least one alphanumeric character.
name_validator = RegexValidator(
@@ -15,6 +14,7 @@
... |
906950ec1bd1f5d0980116d10344f9f1b7d844ed | Importacions_F1_Q1/Fact_impF1_eliminar_Ja_existeix.py | Importacions_F1_Q1/Fact_impF1_eliminar_Ja_existeix.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from ooop import OOOP
import configdb
O = OOOP(**configdb.ooop)
imp_obj = O.GiscedataFacturacioImportacioLinia
imp_del_ids = imp_obj.search([('state','=','erroni'),('info','like',"Aquest fitxer XML ja s'ha processat en els següents IDs")])
#imp_del_ids += imp_obj.search(... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from ooop import OOOP
import configdb
O = OOOP(**configdb.ooop)
imp_obj = O.GiscedataFacturacioImportacioLinia
imp_del_ids = imp_obj.search([('state','=','erroni'),('info','like',"Aquest fitxer XML ja s'ha processat en els següents IDs")])
imp_del_ids = imp_obj.search([(... | Kill "Ja existeix una factura amb el mateix.." too | Kill "Ja existeix una factura amb el mateix.." too
| Python | agpl-3.0 | Som-Energia/invoice-janitor | ---
+++
@@ -8,6 +8,7 @@
imp_obj = O.GiscedataFacturacioImportacioLinia
imp_del_ids = imp_obj.search([('state','=','erroni'),('info','like',"Aquest fitxer XML ja s'ha processat en els següents IDs")])
+imp_del_ids = imp_obj.search([('state','=','erroni'),('info','like',"Ja existeix una factura amb el mateix origen... |
cca5b6355a376cb1f51a45a3fac5ca5e4b96f5c7 | pyflation/configuration.py | pyflation/configuration.py | """Configuration file for harness.py
Author: Ian Huston
For license and copyright information see LICENSE.txt which was distributed with this file.
"""
import logging
##################################################
# debug logging control
# 0 for off, 1 for on
##################################################
_... | """Configuration file for harness.py
Author: Ian Huston
For license and copyright information see LICENSE.txt which was distributed with this file.
The main configuration options are for logging. By changing _debug to 1 (default
is 0) much more debugging information will be added to the log files.
The overall loggin... | Add some explanation of logging options. | Add some explanation of logging options.
| Python | bsd-3-clause | ihuston/pyflation,ihuston/pyflation | ---
+++
@@ -3,6 +3,10 @@
Author: Ian Huston
For license and copyright information see LICENSE.txt which was distributed with this file.
+The main configuration options are for logging. By changing _debug to 1 (default
+is 0) much more debugging information will be added to the log files.
+The overall logging lev... |
1f112cb553b0170eb948cfb53883913dc2f3b0b3 | index.py | index.py | from gevent import monkey
monkey.patch_all()
import time
from threading import Thread
import settings
import requests
from flask import Flask
from flask.ext.socketio import SocketIO, emit
app = Flask(__name__)
app.config.from_object('settings')
app.debug = True
if not app.debug:
import logging
file_handler =... | from gevent import monkey
monkey.patch_all()
import time
from threading import Thread
import settings
import requests
from flask import Flask
from flask.ext.socketio import SocketIO, emit
app = Flask(__name__)
app.config.from_object('settings')
app.debug = True
if not app.debug:
import logging
file_handler =... | Remove manual emit on status | Remove manual emit on status
| Python | mit | Storj/metadisk-websockets | ---
+++
@@ -32,10 +32,6 @@
time.sleep(5)
socketio.emit('status', StorjAPI.getNodeStatus(), namespace='/metadisk')
-@socketio.on('status')
-def node_status():
- socketio.emit('status', StorjAPI.getNodeStatus())
-
@socketio.on('connect', namespace='/metadisk')
def metadisk_connect():
global thre... |
2e99893065abef2f751e3fb5f19a59bfee79a756 | language_model_transcription.py | language_model_transcription.py | import metasentence
import language_model
import standard_kaldi
import diff_align
import json
import os
import sys
vocab = metasentence.load_vocabulary('PROTO_LANGDIR/graphdir/words.txt')
def lm_transcribe(audio_f, text_f):
ms = metasentence.MetaSentence(open(text_f).read(), vocab)
model_dir = language_mo... | import metasentence
import language_model
import standard_kaldi
import diff_align
import json
import os
import sys
vocab = metasentence.load_vocabulary('PROTO_LANGDIR/graphdir/words.txt')
def lm_transcribe(audio_f, text_f):
ms = metasentence.MetaSentence(open(text_f).read(), vocab)
model_dir = language_mo... | Use argparse for main python entrypoint args. | Use argparse for main python entrypoint args.
Will make it easier to add proto_langdir as a flag argument in a future commit.
| Python | mit | lowerquality/gentle,lowerquality/gentle,lowerquality/gentle,lowerquality/gentle | ---
+++
@@ -27,10 +27,19 @@
return ret
if __name__=='__main__':
- AUDIO_FILE = sys.argv[1]
- TEXT_FILE = sys.argv[2]
- OUTPUT_FILE = sys.argv[3]
+ import argparse
- ret = lm_transcribe(AUDIO_FILE, TEXT_FILE)
- json.dump(ret, open(OUTPUT_FILE, 'w'), indent=2)
+ parser = argparse.Argument... |
de15315b95f70e56d424d54637e3ac0d615ea0f0 | proto/ho.py | proto/ho.py | from board import Board, BoardCanvas
b = Board(19, 19)
c = BoardCanvas(b)
| #!/usr/bin/env python
import platform
import subprocess
import sys
from copy import deepcopy
from board import Board, BoardCanvas
def clear():
subprocess.check_call('cls' if platform.system() == 'Windows' else 'clear', shell=True)
class _Getch:
"""
Gets a single character from standard input. Does no... | Add game loop to prototype | Add game loop to prototype
| Python | mit | davesque/go.py | ---
+++
@@ -1,5 +1,121 @@
+#!/usr/bin/env python
+
+import platform
+import subprocess
+import sys
+from copy import deepcopy
+
from board import Board, BoardCanvas
-b = Board(19, 19)
-c = BoardCanvas(b)
+def clear():
+ subprocess.check_call('cls' if platform.system() == 'Windows' else 'clear', shell=True)
+
... |
038b56134017b6b3e4ea44d1b7197bc5168868d3 | safeopt/__init__.py | safeopt/__init__.py | """
The `safeopt` package provides...
Main classes
============
.. autosummary::
SafeOpt
SafeOptSwarm
Utilities
=========
.. autosummary::
sample_gp_function
linearly_spaced_combinations
plot_2d_gp
plot_3d_gp
plot_contour_gp
"""
from __future__ import absolute_import
from .utilities import *
fr... | """
The `safeopt` package provides...
Main classes
============
These classes provide the main functionality for Safe Bayesian optimization.
.. autosummary::
SafeOpt
SafeOptSwarm
Utilities
=========
The following are utilities to make testing and working with the library more pleasant.
.. autosummary::
s... | Add short comment to docs | Add short comment to docs
| Python | mit | befelix/SafeOpt,befelix/SafeOpt | ---
+++
@@ -3,12 +3,18 @@
Main classes
============
+
+These classes provide the main functionality for Safe Bayesian optimization.
+
.. autosummary::
SafeOpt
SafeOptSwarm
Utilities
=========
+
+The following are utilities to make testing and working with the library more pleasant.
+
.. autosummary:... |
d295575284e712a755d3891806a7e40b65377a69 | music_essentials/chord.py | music_essentials/chord.py | class Chord(object):
# TODO: doctring
def __init__(self, root_note):
# TODO: doctring
# TODO: validation
self.notes = [root_note]
def root(self):
# TODO: doctring
# TODO: tests
return self.notes[0]
def add_note(self, new_note):
# TODO: docstr... | class Chord(object):
# TODO: doctring
def __init__(self, root_note):
# TODO: doctring
# TODO: validation
self.notes = [root_note]
def root(self):
# TODO: doctring
# TODO: tests
return self.notes[0]
def add_note(self, new_note):
# TODO: docstr... | Add __str__ method for Chord class. | Add __str__ method for Chord class.
Signed-off-by: Charlotte Pierce <351429ca27f6e4bff2dbb77adb5046c88cd12fae@malformed-bits.com>
| Python | mit | charlottepierce/music_essentials | ---
+++
@@ -23,3 +23,12 @@
return
self.notes.append(new_note)
+
+ def __str__(self):
+ # TODO: docstring
+ out = ''
+ for n in self.notes:
+ out += n.__str__() + '+'
+ out = out [:-1]
+
+ return out |
0d50f6663bbc7f366c9db6a9aeef5feb0f4cb5f2 | src/ExampleNets/readAllFields.py | src/ExampleNets/readAllFields.py | import glob
import os
import SCIRunPythonAPI; from SCIRunPythonAPI import *
def allFields(path):
names = []
for dirname, dirnames, filenames in os.walk(path):
for filename in filenames:
if filename.endswith("fld"):
names.append(os.path.join(dirname, filename))
return names
dir = r"E:\scirun\trunk_ref\SCI... | import glob
import os
import time
import SCIRunPythonAPI; from SCIRunPythonAPI import *
def allFields(path):
names = []
for dirname, dirnames, filenames in os.walk(path):
for filename in filenames:
if filename.endswith("fld"):
names.append(os.path.join(dirname, filename))
return names
def printList(list,... | Update script to print all field types to a file | Update script to print all field types to a file
| Python | mit | moritzdannhauer/SCIRunGUIPrototype,jessdtate/SCIRun,jessdtate/SCIRun,jessdtate/SCIRun,jcollfont/SCIRun,jcollfont/SCIRun,ajanson/SCIRun,jessdtate/SCIRun,ajanson/SCIRun,moritzdannhauer/SCIRunGUIPrototype,collint8/SCIRun,moritzdannhauer/SCIRunGUIPrototype,moritzdannhauer/SCIRunGUIPrototype,ajanson/SCIRun,jessdtate/SCIRun,... | ---
+++
@@ -1,5 +1,6 @@
import glob
import os
+import time
import SCIRunPythonAPI; from SCIRunPythonAPI import *
def allFields(path):
@@ -10,11 +11,28 @@
names.append(os.path.join(dirname, filename))
return names
+def printList(list, name):
+ thefile = open(name, 'w')
+ for f,v in list:
+ thefile.wri... |
b1bd07038b0c6a6d801e686372996b3478c71af9 | iss/management/commands/upsert_iss_organizations.py | iss/management/commands/upsert_iss_organizations.py | #!/usr/bin/env python
"""Upserts Organization records with data from Salesforce Accounts.
"""
import logging
import os
from django.core.management.base import BaseCommand
import iss.salesforce
import iss.utils
logger = logging.getLogger(os.path.basename(__file__))
class Command(BaseCommand):
def add_argument... | #!/usr/bin/env python
"""Upserts Organization records with data from Salesforce Accounts.
"""
import logging
import os
from django.core.management.base import BaseCommand
import iss.models
import iss.salesforce
import iss.utils
logger = logging.getLogger(os.path.basename(__file__))
class Command(BaseCommand):
... | Add --include-aashe-in-website flag to org upsert | Add --include-aashe-in-website flag to org upsert
| Python | mit | AASHE/iss | ---
+++
@@ -6,6 +6,7 @@
from django.core.management.base import BaseCommand
+import iss.models
import iss.salesforce
import iss.utils
@@ -22,16 +23,33 @@
metavar='n-days',
default=7,
help='upsert organizations for accounts modified within n-days')
+ parser.add_ar... |
ed45688c062aed44836fe902bb61bf858ed4b4bf | sale_require_ref/__openerp__.py | sale_require_ref/__openerp__.py | # -*- coding: utf-8 -*-
{
'name': 'Sale Order Require Contract on Confirmation',
'version': '1.0',
'category': 'Projects & Services',
'sequence': 14,
'summary': '',
'description': """
Sale Order Require Contract on Confirmation
===========================================
""",
'author': ... | # -*- coding: utf-8 -*-
{
'name': 'Sale Order Require Contract on Confirmation',
'version': '1.0',
'category': 'Projects & Services',
'sequence': 14,
'summary': '',
'description': """
Sale Order Require Contract on Confirmation
===========================================
""",
'author': ... | FIX mae sale require fe uninstallable | FIX mae sale require fe uninstallable
| Python | agpl-3.0 | ingadhoc/account-analytic,ingadhoc/sale,ingadhoc/account-invoicing,bmya/odoo-addons,ingadhoc/stock,ingadhoc/product,dvitme/odoo-addons,maljac/odoo-addons,adhoc-dev/account-financial-tools,ingadhoc/sale,HBEE/odoo-addons,ClearCorp/account-financial-tools,sysadminmatmoz/ingadhoc,jorsea/odoo-addons,jorsea/odoo-addons,sysad... | ---
+++
@@ -22,7 +22,7 @@
],
'test': [
],
- 'installable': True,
+ 'installable': False,
'auto_install': False,
'application': False,
} |
07f531c7e3bbc0149fad4cfda75d8803cbc48e1d | smserver/chatplugin.py | smserver/chatplugin.py | #!/usr/bin/env python3
# -*- coding: utf8 -*-
"""
This module add the class needed for creating custom chat command
:Example:
Here's a simple ChatPlugin which will send a HelloWorld on use
``
ChatHelloWorld(ChatPlugin):
helper = "Display Hello World"
cimmand
def __call__... | #!/usr/bin/env python3
# -*- coding: utf8 -*-
"""
This module add the class needed for creating custom chat command
:Example:
Here's a simple ChatPlugin which will send a HelloWorld on use
``
ChatHelloWorld(ChatPlugin):
helper = "Display Hello World"
command = "hello"
de... | Correct chat plugin example in docsctring | Correct chat plugin example in docsctring
| Python | mit | ningirsu/stepmania-server,Nickito12/stepmania-server,ningirsu/stepmania-server,Nickito12/stepmania-server | ---
+++
@@ -11,7 +11,7 @@
``
ChatHelloWorld(ChatPlugin):
helper = "Display Hello World"
- cimmand
+ command = "hello"
def __call__(self, serv, message):
serv.send_message("Hello world", to="me") |
83292a4b6f6bec00b20c623fa6f44e15aa82cd2a | runtests.py | runtests.py | #!/usr/bin/env python
import sys
from os.path import dirname, abspath
import django
from django.conf import settings
if len(sys.argv) > 1 and 'postgres' in sys.argv:
sys.argv.remove('postgres')
db_engine = 'django.db.backends.postgresql_psycopg2'
db_name = 'test_main'
else:
db_engine = 'django.db.bac... | #!/usr/bin/env python
import sys
from os.path import dirname, abspath
import django
from django.conf import settings
if len(sys.argv) > 1 and 'postgres' in sys.argv:
sys.argv.remove('postgres')
db_engine = 'django.db.backends.postgresql_psycopg2'
db_name = 'test_main'
else:
db_engine = 'django.db.bac... | Fix "AppRegistryNotReady: Models aren't loaded yet" | Fix "AppRegistryNotReady: Models aren't loaded yet"
| Python | mit | coleifer/django-generic-m2m,coleifer/django-generic-m2m,coleifer/django-generic-m2m | ---
+++
@@ -22,10 +22,12 @@
'genericm2m',
'genericm2m.genericm2m_tests',
],
+ MIDDLEWARE_CLASSES = (),
)
from django.test.utils import get_runner
+django.setup()
def runtests(*test_args):
if not test_args: |
e77042c914b9725da0fef7e56ede12635c1a876b | s3s3/api.py | s3s3/api.py | """
The API for s3s3.
"""
import tempfile
from boto.s3.connection import S3Connection
def create_connection(connection_args):
connection_args = connection_args.copy()
connection_args.pop('bucket_name')
return S3Connection(**connection_args)
def upload(source_key, dest_keys):
"""
`source_key` Th... | """
The API for s3s3.
"""
import tempfile
from boto.s3.connection import S3Connection
def create_connection(connection_args):
connection_args = connection_args.copy()
connection_args.pop('bucket_name')
return S3Connection(**connection_args)
def upload(source_key, dest_keys):
"""
`source_key` Th... | Fix typo. dest_key => dest_keys. | Fix typo. dest_key => dest_keys.
modified: s3s3/api.py
| Python | mit | lsst-sqre/s3s3,lsst-sqre/s3-glacier | ---
+++
@@ -15,11 +15,12 @@
def upload(source_key, dest_keys):
"""
`source_key` The source boto s3 key.
- `dest_keys` The destination boto s3 keys.
+ `dest_keys` A list of the destination boto s3 keys.
"""
# Use the same name if no destination key is passed.
- if not dest_key:
- d... |
ada7e2d2b98664fd6c481c4279677a4292e5bfef | openedx/features/idea/api_views.py | openedx/features/idea/api_views.py | from django.http import JsonResponse
from django.shortcuts import get_object_or_404
from rest_framework import status
from rest_framework.authentication import SessionAuthentication, BasicAuthentication
from rest_framework.permissions import IsAuthenticated
from rest_framework.views import APIView
from openedx.feature... | from django.http import JsonResponse
from django.shortcuts import get_object_or_404
from edx_rest_framework_extensions.auth.session.authentication import SessionAuthenticationAllowInactiveUser
from rest_framework import status
from rest_framework.permissions import IsAuthenticated
from rest_framework.views import APIVi... | Change authentication classes to cater inactive users | [LP-1965] Change authentication classes to cater inactive users
| Python | agpl-3.0 | philanthropy-u/edx-platform,philanthropy-u/edx-platform,philanthropy-u/edx-platform,philanthropy-u/edx-platform | ---
+++
@@ -1,7 +1,7 @@
from django.http import JsonResponse
from django.shortcuts import get_object_or_404
+from edx_rest_framework_extensions.auth.session.authentication import SessionAuthenticationAllowInactiveUser
from rest_framework import status
-from rest_framework.authentication import SessionAuthenticatio... |
d6782066e3ed3f00e3c8dcffe2ffd0b9bad18d17 | slave/skia_slave_scripts/render_pdfs.py | slave/skia_slave_scripts/render_pdfs.py | #!/usr/bin/env python
# Copyright (c) 2013 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.
""" Run the Skia render_pdfs executable. """
from build_step import BuildStep, BuildStepWarning
import sys
class RenderPdfs(Bu... | #!/usr/bin/env python
# Copyright (c) 2013 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.
""" Run the Skia render_pdfs executable. """
from build_step import BuildStep
import sys
class RenderPdfs(BuildStep):
def _R... | Revert "Skip RenderPdfs until the crash is fixed" | Revert "Skip RenderPdfs until the crash is fixed"
This reverts commit fd03af0fbcb5f1b3656bcc78d934c560816d6810.
https://codereview.chromium.org/15002002/ fixes the crash.
R=borenet@google.com
Review URL: https://codereview.chromium.org/14577010
git-svn-id: 32fc27f4dcfb6c0385cd9719852b95fe6680452d@9019 2bbb7eff-a52... | Python | bsd-3-clause | Tiger66639/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,Tiger66639/skia-buildbot,Tiger66639/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbo... | ---
+++
@@ -7,15 +7,13 @@
""" Run the Skia render_pdfs executable. """
-from build_step import BuildStep, BuildStepWarning
+from build_step import BuildStep
import sys
class RenderPdfs(BuildStep):
def _Run(self):
- # Skip this step for now, since the new SKPs are causing it to crash.
- raise Build... |
bf91e50b02ff8ef89e660e3c853cc2f30646f32d | bash_runner/tasks.py | bash_runner/tasks.py | """
Cloudify plugin for running a simple bash script.
Operations:
start: Run a script
"""
from celery import task
from cosmo.events import send_event as send_riemann_event
from cloudify.utils import get_local_ip
get_ip = get_local_ip
send_event = send_riemann_event
@task
def start(__cloudify_id, port=8080, **... | """
Cloudify plugin for running a simple bash script.
Operations:
start: Run a script
"""
from celery import task
from cosmo.events import send_event as send_riemann_event
from cloudify.utils import get_local_ip
get_ip = get_local_ip
send_event = send_riemann_event
@task
def start(__cloudify_id, port=8080, **... | Change the status string in riemann | Change the status string in riemann
| Python | apache-2.0 | rantav/cosmo-plugin-bash-runner | ---
+++
@@ -18,4 +18,4 @@
def start(__cloudify_id, port=8080, **kwargs):
with open('/home/ubuntu/hello', 'w') as f:
print >> f, 'HELLO BASH! %s' % port
- send_event(__cloudify_id, get_ip(), "hello_bash status", "state", "running")
+ send_event(__cloudify_id, get_ip(), "bash_runner status", "state", "runnin... |
c568cf4b1be5e38b92f7d3a9131e67ff9eff764e | lib/ctf_gameserver/lib/helper.py | lib/ctf_gameserver/lib/helper.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
def convert_arg_line_to_args(arg_line):
"""argparse helper for splitting input from config
Allows comment lines in configfiles and allows both argument and
value on the same line
"""
if arg_line.strip().startswith('#'):
return []
else:
... | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import shlex
def convert_arg_line_to_args(arg_line):
"""argparse helper for splitting input from config
Allows comment lines in configfiles and allows both argument and
value on the same line
"""
return shlex.split(arg_line, comments=True)
| Improve config argument splitting to allow quoted spaces | Improve config argument splitting to allow quoted spaces
| Python | isc | fausecteam/ctf-gameserver,fausecteam/ctf-gameserver,fausecteam/ctf-gameserver,fausecteam/ctf-gameserver,fausecteam/ctf-gameserver | ---
+++
@@ -1,5 +1,7 @@
#!/usr/bin/python3
# -*- coding: utf-8 -*-
+
+import shlex
def convert_arg_line_to_args(arg_line):
"""argparse helper for splitting input from config
@@ -7,7 +9,4 @@
Allows comment lines in configfiles and allows both argument and
value on the same line
"""
- if arg... |
a234b8dfc45d9e08a452ccc4f275283eb1eb5485 | dataactbroker/scripts/loadFSRS.py | dataactbroker/scripts/loadFSRS.py | import logging
import sys
from dataactcore.models.baseInterface import databaseSession
from dataactbroker.fsrs import (
configValid, fetchAndReplaceBatch, GRANT, PROCUREMENT)
logger = logging.getLogger(__name__)
if __name__ == '__main__':
logging.basicConfig(level=logging.INFO)
with databaseSession() a... | import logging
import sys
from dataactcore.interfaces.db import databaseSession
from dataactbroker.fsrs import (
configValid, fetchAndReplaceBatch, GRANT, PROCUREMENT)
logger = logging.getLogger(__name__)
if __name__ == '__main__':
logging.basicConfig(level=logging.INFO)
with databaseSession() as sess:... | Switch to using dbSession in db.py instead of baseInterface.py | Switch to using dbSession in db.py instead of baseInterface.py
This is another file that should have been included in PR #272,
where we transitioned all existing non-Flask db access to a
db connection using the new contextmanager. Originally missed
this one because it *is* using a contextmanager, but it's using
one in... | Python | cc0-1.0 | fedspendingtransparency/data-act-broker-backend,chambers-brian/SIG_Digital-Strategy_SI_ODP_Backend,fedspendingtransparency/data-act-broker-backend,chambers-brian/SIG_Digital-Strategy_SI_ODP_Backend | ---
+++
@@ -1,7 +1,7 @@
import logging
import sys
-from dataactcore.models.baseInterface import databaseSession
+from dataactcore.interfaces.db import databaseSession
from dataactbroker.fsrs import (
configValid, fetchAndReplaceBatch, GRANT, PROCUREMENT)
|
0022726e9f2d122ff84eb19ed2807649ab96f931 | deployment/cfn/utils/constants.py | deployment/cfn/utils/constants.py | EC2_INSTANCE_TYPES = [
't2.micro',
't2.small',
't2.medium',
't2.large'
]
RDS_INSTANCE_TYPES = [
'db.t2.micro',
'db.t2.small',
'db.t2.medium',
'db.t2.large'
]
ALLOW_ALL_CIDR = '0.0.0.0/0'
VPC_CIDR = '10.0.0.0/16'
HTTP = 80
HTTPS = 443
POSTGRESQL = 5432
SSH = 22
AMAZON_ACCOUNT_ID = 'am... | EC2_INSTANCE_TYPES = [
't2.micro',
't2.small',
't2.medium',
't2.large',
'm3.medium'
]
RDS_INSTANCE_TYPES = [
'db.t2.micro',
'db.t2.small',
'db.t2.medium',
'db.t2.large'
]
ALLOW_ALL_CIDR = '0.0.0.0/0'
VPC_CIDR = '10.0.0.0/16'
HTTP = 80
HTTPS = 443
POSTGRESQL = 5432
SSH = 22
AMAZON... | Add m3.medium to EC2 instance types | Add m3.medium to EC2 instance types
This is the lowest `m3` family instance type with ephemeral storage. | Python | apache-2.0 | azavea/raster-foundry,aaronxsu/raster-foundry,kdeloach/raster-foundry,kdeloach/raster-foundry,azavea/raster-foundry,azavea/raster-foundry,aaronxsu/raster-foundry,azavea/raster-foundry,kdeloach/raster-foundry,raster-foundry/raster-foundry,azavea/raster-foundry,raster-foundry/raster-foundry,kdeloach/raster-foundry,kdeloa... | ---
+++
@@ -2,7 +2,8 @@
't2.micro',
't2.small',
't2.medium',
- 't2.large'
+ 't2.large',
+ 'm3.medium'
]
RDS_INSTANCE_TYPES = [ |
4d5d4665f2b46e12618b7762246d84884447e99e | redash/cli/organization.py | redash/cli/organization.py | from flask_script import Manager
from redash import models
manager = Manager(help="Organization management commands.")
@manager.option('domains', help="comma separated list of domains to allow")
def set_google_apps_domains(domains):
organization = models.Organization.select().first()
organization.settings[m... | from flask_script import Manager
from redash import models
manager = Manager(help="Organization management commands.")
@manager.option('domains', help="comma separated list of domains to allow")
def set_google_apps_domains(domains):
organization = models.Organization.select().first()
organization.settings[m... | Add 'manage.py org list' command | Add 'manage.py org list' command
'org list' simply prints out the organizations.
| Python | bsd-2-clause | pubnative/redash,pubnative/redash,pubnative/redash,pubnative/redash,pubnative/redash | ---
+++
@@ -18,3 +18,14 @@
def show_google_apps_domains():
organization = models.Organization.select().first()
print "Current list of Google Apps domains: {}".format(organization.google_apps_domains)
+
+
+@manager.command
+def list():
+ """List all organizations"""
+ orgs = models.Organization.select... |
c23cd25247974abc85c66451737f4de8d8b19d1b | lib/rapidsms/backends/backend.py | lib/rapidsms/backends/backend.py | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
class Backend(object):
def log(self, level, message):
self.router.log(level, message)
def start(self):
raise NotImplementedError
def stop(self):
raise NotImplementedError
def send(self):
raise NotImpleme... | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
class Backend(object):
def __init__ (self, router):
self.router = router
def log(self, level, message):
self.router.log(level, message)
def start(self):
raise NotImplementedError
def stop(self):
raise NotImple... | Add a constructor method for Backend | Add a constructor method for Backend
| Python | bsd-3-clause | dimagi/rapidsms,ehealthafrica-ci/rapidsms,eHealthAfrica/rapidsms,ken-muturi/rapidsms,lsgunth/rapidsms,catalpainternational/rapidsms,unicefuganda/edtrac,catalpainternational/rapidsms,eHealthAfrica/rapidsms,ken-muturi/rapidsms,ken-muturi/rapidsms,lsgunth/rapidsms,unicefuganda/edtrac,lsgunth/rapidsms,ehealthafrica-ci/rapi... | ---
+++
@@ -1,8 +1,9 @@
#!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
-
class Backend(object):
+ def __init__ (self, router):
+ self.router = router
def log(self, level, message):
self.router.log(level, message) |
7a37e3afa29410636c75408bc649e70c519e07f1 | test/user_profile_test.py | test/user_profile_test.py | import json
from pymessenger.user_profile import UserProfileApi
from test_env import *
upa = UserProfileApi(PAGE_ACCESS_TOKEN, app_secret=APP_SECRET)
def test_fields_blank():
user_profile = upa.get(TEST_USER_ID)
assert user_profile is not None
def test_fields():
fields = ['first_name', 'last_name']
... | import json
import sys, os
sys.path.append(os.path.realpath(os.path.dirname(__file__)+"/.."))
from pymessenger.user_profile import UserProfileApi
TOKEN = os.environ.get('TOKEN')
APP_SECRET = os.environ.get('APP_SECRET')
TEST_USER_ID = os.environ.get('RECIPIENT_ID')
upa = UserProfileApi(TOKEN, app_secret=APP_SECRET)
... | Fix user profile test to include same environment variables | Fix user profile test to include same environment variables
| Python | mit | karlinnolabs/pymessenger,Cretezy/pymessenger2,davidchua/pymessenger | ---
+++
@@ -1,9 +1,14 @@
import json
+import sys, os
+sys.path.append(os.path.realpath(os.path.dirname(__file__)+"/.."))
from pymessenger.user_profile import UserProfileApi
-from test_env import *
-upa = UserProfileApi(PAGE_ACCESS_TOKEN, app_secret=APP_SECRET)
+TOKEN = os.environ.get('TOKEN')
+APP_SECRET = os.e... |
2fec4b3ffa1619f81088383c9f565b51f6171fd6 | seaborn/miscplot.py | seaborn/miscplot.py | from __future__ import division
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
__all__ = ["palplot", "dogplot"]
def palplot(pal, size=1):
"""Plot the values in a color palette as a horizontal array.
Parameters
----------
pal : sequence of matplotlib colors
color... | from __future__ import division
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
__all__ = ["palplot", "dogplot"]
def palplot(pal, size=1):
"""Plot the values in a color palette as a horizontal array.
Parameters
----------
pal : sequence of matplotlib colors
color... | Update to reflect new example data | Update to reflect new example data
| Python | bsd-3-clause | arokem/seaborn,mwaskom/seaborn,anntzer/seaborn,arokem/seaborn,mwaskom/seaborn,anntzer/seaborn | ---
+++
@@ -37,8 +37,9 @@
from urllib2 import urlopen
from io import BytesIO
- url = "https://github.com/mwaskom/seaborn-data/raw/master/png/img1.png"
- data = BytesIO(urlopen(url).read())
+ url = "https://github.com/mwaskom/seaborn-data/raw/master/png/img{}.png"
+ pic = np.random.randint(... |
694408d7f96c83318bbfc0d88be2a99a116deb90 | select2/__init__.py | select2/__init__.py | VERSION = (0, 7)
__version__ = '.'.join(map(str, VERSION))
DATE = "2014-06-17" | VERSION = (0, 8)
__version__ = '.'.join(map(str, VERSION))
DATE = "2014-06-17" | Fix format syntax with python 2.6 - upgrade version | Fix format syntax with python 2.6 - upgrade version
| Python | mit | 20tab/twentytab-select2,20tab/twentytab-select2,20tab/twentytab-select2 | ---
+++
@@ -1,3 +1,3 @@
-VERSION = (0, 7)
+VERSION = (0, 8)
__version__ = '.'.join(map(str, VERSION))
DATE = "2014-06-17" |
a4c5e9a970a297d59000468dde8423fa9db00c0f | packs/fixtures/actions/scripts/streamwriter-script.py | packs/fixtures/actions/scripts/streamwriter-script.py | #!/usr/bin/env python
import argparse
import sys
import ast
from lib.exceptions import CustomException
class StreamWriter(object):
def run(self, stream):
if stream.upper() == 'STDOUT':
sys.stdout.write('STREAM IS STDOUT.')
return stream
if stream.upper() == 'STDERR':
... | #!/usr/bin/env python
import argparse
import sys
import ast
import re
from lib.exceptions import CustomException
class StreamWriter(object):
def run(self, stream):
if stream.upper() == 'STDOUT':
sys.stdout.write('STREAM IS STDOUT.')
return stream
if stream.upper() == 'S... | Fix streamwriter action so it doesn't include "u" type prefix in the object result. | Fix streamwriter action so it doesn't include "u" type prefix in the
object result.
This way it works consistently and correctly under Python 2 and Python
3.
| Python | apache-2.0 | StackStorm/st2tests,StackStorm/st2tests,StackStorm/st2tests | ---
+++
@@ -3,6 +3,7 @@
import argparse
import sys
import ast
+import re
from lib.exceptions import CustomException
@@ -25,15 +26,21 @@
stream = args.stream
writer = StreamWriter()
stream = writer.run(stream)
+
str_arg = args.str_arg
int_arg = args.int_arg
obj_arg = args.obj_arg
... |
9fba6f871068b0d40b71b9de4f69ac59bc33f567 | tests/test_CheckButton.py | tests/test_CheckButton.py | #!/usr/bin/env python
import unittest
from kiwi.ui.widgets.checkbutton import ProxyCheckButton
class CheckButtonTest(unittest.TestCase):
def testForBool(self):
myChkBtn = ProxyCheckButton()
# PyGObject bug, we cannot set bool in the constructor with
# introspection
#self.assertEqu... | #!/usr/bin/env python
import unittest
import gtk
from kiwi.ui.widgets.checkbutton import ProxyCheckButton
class CheckButtonTest(unittest.TestCase):
def testForBool(self):
myChkBtn = ProxyCheckButton()
assert isinstance(myChkBtn, gtk.CheckButton)
# PyGObject bug, we cannot set bool in the... | Add a silly assert to avoid a pyflakes warning | Add a silly assert to avoid a pyflakes warning | Python | lgpl-2.1 | stoq/kiwi | ---
+++
@@ -1,5 +1,7 @@
#!/usr/bin/env python
import unittest
+
+import gtk
from kiwi.ui.widgets.checkbutton import ProxyCheckButton
@@ -7,6 +9,7 @@
class CheckButtonTest(unittest.TestCase):
def testForBool(self):
myChkBtn = ProxyCheckButton()
+ assert isinstance(myChkBtn, gtk.CheckButton... |
080cda37b93010232481c8fd6090a3909a086fe4 | tests/test_mdx_embedly.py | tests/test_mdx_embedly.py | import markdown
from mdx_embedly import EmbedlyExtension
def test_embedly():
s = "[https://github.com/yymm:embed]"
expected = """
<p>
<a class="embedly-card" href="https://github.com/yymm">embed.ly</a>
<script async src="//cdn.embedly.com/widgets/platform.js"charset="UTF-8"></script>
</p>
""".strip()
... | import markdown
from mdx_embedly import EmbedlyExtension
def test_embedly():
s = "[https://github.com/yymm:embed]"
expected = """
<p>
<a class="embedly-card" href="https://github.com/yymm">embed.ly</a>
<script async src="//cdn.embedly.com/widgets/platform.js" charset="UTF-8"></script>
</p>
""".strip()
... | Update expected value on test | Update expected value on test
| Python | mit | yymm/mdx_embedly | ---
+++
@@ -7,7 +7,7 @@
expected = """
<p>
<a class="embedly-card" href="https://github.com/yymm">embed.ly</a>
-<script async src="//cdn.embedly.com/widgets/platform.js"charset="UTF-8"></script>
+<script async src="//cdn.embedly.com/widgets/platform.js" charset="UTF-8"></script>
</p>
""".strip()
htm... |
82572b32e5ddc8dd8eade591708eb2ab45ea2ae3 | voctocore/lib/clock.py | voctocore/lib/clock.py | #!/usr/bin/python3
import logging
from gi.repository import Gst, GstNet
__all__ = ['Clock', 'NetTimeProvider']
port = 9998
log = logging.getLogger('Clock')
log.debug("Obtaining System-Clock")
Clock = Gst.SystemClock.obtain()
log.info("Using System-Clock for all Pipelines: %s", Clock)
log.info("Starting NetTimeProvi... | #!/usr/bin/python3
import logging
from gi.repository import Gst, GstNet
__all__ = ['Clock', 'NetTimeProvider']
port = 9998
log = logging.getLogger('Clock')
log.debug("Obtaining System-Clock")
Clock = Gst.SystemClock.obtain()
log.info("Using System-Clock for all Pipelines: %s", Clock)
log.info("Starting NetTimeProvi... | Rename NetTimeProvider6 to NetTimeProvider, to match exports | voctocore: Rename NetTimeProvider6 to NetTimeProvider, to match exports
| Python | mit | h01ger/voctomix,voc/voctomix,voc/voctomix,h01ger/voctomix | ---
+++
@@ -12,4 +12,4 @@
log.info("Using System-Clock for all Pipelines: %s", Clock)
log.info("Starting NetTimeProvider on Port %u", port)
-NetTimeProvider6 = GstNet.NetTimeProvider.new(Clock, '::', port)
+NetTimeProvider = GstNet.NetTimeProvider.new(Clock, '::', port) |
0fa23851cbe33ba0d3bddb8367d7089545de6847 | setup.py | setup.py | #! /usr/bin/env python
from distutils.core import setup
setup(
name = 'qless-py',
version = '0.10.0',
description = 'Redis-based Queue Management',
long_description = '''
Redis-based queue management, with heartbeating, job tracking,
stats, notifications, and ... | #! /usr/bin/env python
from distutils.core import setup
setup(
name = 'qless-py',
version = '0.10.0',
description = 'Redis-based Queue Management',
long_description = '''
Redis-based queue management, with heartbeating, job tracking,
stats, notifications, and ... | Fix for "No module named decorator" on fresh environment installs. | Fix for "No module named decorator" on fresh environment installs.
Fixes regression from 4b26b5837ced0c2f76495b05b87e63e05f81c2af.
| Python | mit | seomoz/qless-py,seomoz/qless-py | ---
+++
@@ -25,7 +25,7 @@
'ps': ['setproctitle']
},
install_requires = [
- 'argparse', 'hiredis', 'redis', 'psutil', 'simplejson'],
+ 'argparse', 'decorator', 'hiredis', 'redis', 'psutil', 'simplejson'],
classifiers = [
'License :: OSI Approved :: MIT Licens... |
8629221d23cf4fe8a447b12930fdee4801cd82f9 | setup.py | setup.py | #! /usr/bin/env python
"""TODO: Maybe add a docstring containing a long description
This would double as something we could put int the `long_description`
parameter for `setup` and it would squelch some complaints pylint has on
`setup.py`.
"""
from setuptools import setup
setup(name='demandlib',
versio... | #! /usr/bin/env python
"""TODO: Maybe add a docstring containing a long description
This would double as something we could put int the `long_description`
parameter for `setup` and it would squelch some complaints pylint has on
`setup.py`.
"""
from setuptools import setup
import os
setup(name='demandlib',
... | Fix data availability when installed via pip | Fix data availability when installed via pip
| Python | mit | oemof/demandlib | ---
+++
@@ -9,6 +9,7 @@
"""
from setuptools import setup
+import os
setup(name='demandlib',
version='0.1',
@@ -19,6 +20,12 @@
description='Demandlib of the open energy modelling framework',
packages=['demandlib'],
package_dir={'demandlib': 'demandlib'},
+ package_data = {
+ ... |
5476145559e0e47dac47b41dd4bfdb9fd41bfe29 | setup.py | setup.py | #!/usr/bin/env python
"""Setup script for the pyparsing module distribution."""
from distutils.core import setup
from pyparsing import __version__
setup(# Distribution meta-data
name = "pyparsing",
version = __version__,
description = "Python parsing module",
author = "Paul McGuire",
author_... | #!/usr/bin/env python
"""Setup script for the pyparsing module distribution."""
from distutils.core import setup
from pyparsing import __version__
setup(# Distribution meta-data
name = "pyparsing",
version = __version__,
description = "Python parsing module",
author = "Paul McGuire",
... | Add change to ship both pyparsing and pyparsing_py3 modules. | Add change to ship both pyparsing and pyparsing_py3 modules.
| Python | mit | 5monkeys/pyparsing | ---
+++
@@ -14,7 +14,7 @@
url = "http://pyparsing.wikispaces.com/",
download_url = "http://sourceforge.net/project/showfiles.php?group_id=97203",
license = "MIT License",
- py_modules = ["pyparsing"],
+ py_modules = ["pyparsing", "pyparsing_py3"],
classifiers=[
'Development Status :... |
d7f9b8376f6ca6e4c87a5b7d6fd2bbaf37b3db2f | setup.py | setup.py | from setuptools import setup, find_packages
from ckanext.qa import __version__
setup(
name='ckanext-qa',
version=__version__,
description='Quality Assurance plugin for CKAN',
long_description='',
classifiers=[],
keywords='',
author='Open Knowledge Foundation',
author_email='info@okfn.or... | from setuptools import setup, find_packages
from ckanext.qa import __version__
setup(
name='ckanext-qa',
version=__version__,
description='Quality Assurance plugin for CKAN',
long_description='',
classifiers=[],
keywords='',
author='Open Knowledge Foundation',
author_email='info@okfn.or... | Change celery and kombu requirements to match ckanext-datastorer | Change celery and kombu requirements to match ckanext-datastorer
| Python | mit | ckan/ckanext-qa,ckan/ckanext-qa,ckan/ckanext-qa | ---
+++
@@ -17,8 +17,8 @@
include_package_data=True,
zip_safe=False,
install_requires=[
- 'celery==2.4.5',
- 'kombu==1.5.1',
+ 'celery==2.4.2',
+ 'kombu==2.1.3',
'kombu-sqlalchemy==1.1.0',
'SQLAlchemy>=0.6.6',
'requests==0.6.4', |
be6ddfe1aa9a5d812bb3805316c8c85053c676ec | setup.py | setup.py | #!/usr/bin/env python
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup
setup(
name='wagtail-draftail',
version='0.1a',
description='Draft.js editor for Wagtail, built upon Draftail and draftjs_exporter',
author='Springload',
author_email... | #!/usr/bin/env python
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup
setup(
name='wagtail-draftail',
version='0.1a',
description='Draft.js editor for Wagtail, built upon Draftail and draftjs_exporter',
author='Springload',
author_email... | Make draftjs-exporter dep strict version check | Make draftjs-exporter dep strict version check
| Python | mit | gasman/wagtaildraftail,springload/wagtaildraftail,gasman/wagtaildraftail,springload/wagtaildraftail,gasman/wagtaildraftail,gasman/wagtaildraftail,springload/wagtaildraftail,springload/wagtaildraftail | ---
+++
@@ -14,6 +14,6 @@
url='https://github.com/springload/wagtaildraftail',
packages=find_packages(),
install_requires=[
- 'draftjs-exporter>=0.6.2',
+ 'draftjs-exporter==0.6.2',
]
) |
6757b7dc89d70b3c2307c489146ed7dfb7e6cce1 | setup.py | setup.py | from setuptools import setup
setup(
name='pyhunter',
packages=['pyhunter'],
version='0.2',
description='An (unofficial) Python wrapper for the Hunter.io API',
author='Quentin Durantay',
author_email='quentin.durantay@gmail.com',
url='https://github.com/VonStruddle/PyHunter',
download_u... | from setuptools import setup
setup(
name='pyhunter',
packages=['pyhunter'],
version='0.2',
description='An (unofficial) Python wrapper for the Hunter.io API',
author='Quentin Durantay',
author_email='quentin.durantay@gmail.com',
url='https://github.com/VonStruddle/PyHunter',
install_re... | Remove GitHub to download library | Remove GitHub to download library
| Python | mit | VonStruddle/PyHunter | ---
+++
@@ -9,7 +9,6 @@
author='Quentin Durantay',
author_email='quentin.durantay@gmail.com',
url='https://github.com/VonStruddle/PyHunter',
- download_url='https://github.com/VonStruddle/PyHunter/archive/0.1.tar.gz',
install_requires=['requests'],
keywords=['hunter', 'hunter.io', 'lead ge... |
6505a37ac7aebfb0ac3a4c76b924b9f80d524a23 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name="DependencyWatcher-Parser",
version="1.0",
url="http://github.com/DependencyWatcher/parser/",
author="Michael Spector",
license="Apache 2.0",
author_email="spektom@gmail.com",
long_description=__doc__,
packages=find_packages(),
inc... | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name="DependencyWatcher-Parser",
version="1.0",
url="http://github.com/DependencyWatcher/parser/",
author="Michael Spector",
license="Apache 2.0",
author_email="spektom@gmail.com",
long_description=__doc__,
packages=find_packages(),
inc... | Add pyparsing module to dependencies | Add pyparsing module to dependencies
| Python | apache-2.0 | DependencyWatcher/parser,DependencyWatcher/parser | ---
+++
@@ -14,6 +14,7 @@
include_package_data=True,
zip_safe=False,
install_requires=[
- "lxml"
+ "lxml",
+ "pyparsing"
]
) |
92f4f496d755187c9d48d2a34262402ba9295732 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='mutual-debt-simplifier',
version='1.0',
description='Tool to perform mutual debt simplification',
url='https://github.com/ric2b/Mutual_Debt_Simplification',
license='MIT',
author='',
author_email='',
packages=find_packages(exclud... | from setuptools import setup, find_packages
setup(
name='mutual-debt-simplifier',
version='1.0',
description='Tool to perform mutual debt simplification',
url='https://github.com/ric2b/Mutual_Debt_Simplification',
license='MIT',
author='',
author_email='',
packages=find_packages(exclud... | Fix import errors realted to missing 'mutual_debt' module | Fix import errors realted to missing 'mutual_debt' module
| Python | mit | ric2b/Mutual_Debt_Simplification | ---
+++
@@ -9,7 +9,7 @@
author='',
author_email='',
- packages=find_packages(exclude='*.tests'),
+ packages=find_packages(exclude=['*.tests']),
install_requires=['docopt==0.6.2', 'graphviz==0.8'],
|
729c1b3f798c7dafa3b8d528aa9bdf123f3068b1 | setup.py | setup.py | #coding:utf-8
import sys
from distutils.core import setup
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_a... | #coding:utf-8
import sys
from distutils.core import setup
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_a... | Fix the download URL to match the version number. | Fix the download URL to match the version number.
| Python | mit | ffcalculator/fantasydata-python | ---
+++
@@ -26,7 +26,7 @@
setup(
name='fantasy_data',
- version='1.1.2',
+ version='1.1.3',
description='FantasyData Python',
author='Fantasy Football Calculator',
author_email='support@fantasyfootballcalculator.com',
@@ -39,5 +39,5 @@
],
tests_require=['pytest'],
cmdclass ... |
e12d086e5ad4692cd6be16eed0649ebc89e6c640 | setup.py | setup.py | # coding: utf-8
"""
Plotting and analysis tools for the ARTIS 3D supernova radiative transfer code.
"""
import os
from setuptools import find_packages, setup
setup(name="artistools",
version=0.1,
author="Luke Shingles",
author_email="luke.shingles@gmail.com",
packages=find_packages(),
... | # coding: utf-8
"""
Plotting and analysis tools for the ARTIS 3D supernova radiative transfer code.
"""
import datetime
import os
from setuptools import find_packages, setup
print(datetime.datetime.now().isoformat())
setup(name="artistools",
version=datetime.datetime.now().isoformat(),
author="Luke Shin... | Use current date and time as version number | Use current date and time as version number
| Python | mit | lukeshingles/artistools,lukeshingles/artistools | ---
+++
@@ -4,12 +4,14 @@
Plotting and analysis tools for the ARTIS 3D supernova radiative transfer code.
"""
+import datetime
import os
from setuptools import find_packages, setup
+print(datetime.datetime.now().isoformat())
setup(name="artistools",
- version=0.1,
+ version=datetime.datetime.now(... |
119a1de0f495ee84d8354b75c05659f3d5a8b367 | setup.py | setup.py | # -*- coding: utf-8 -*-
"""django-c5filemanager setup file.
THIS SOFTWARE IS UNDER BSD LICENSE.
Copyright (c) 2010 Daniele Tricoli <eriol@mornie.org>
Read LICENSE for more informations.
"""
import os
from setuptools import setup, find_packages
from c5filemanager import get_version
def read(filename):
"""Small ... | # -*- coding: utf-8 -*-
"""django-c5filemanager setup file.
THIS SOFTWARE IS UNDER BSD LICENSE.
Copyright (c) 2010 Daniele Tricoli <eriol@mornie.org>
Read LICENSE for more informations.
"""
import os
from setuptools import setup, find_packages
from c5filemanager import get_version
def read(filename):
"""Small ... | Use PyPI for host sdist; updated classifiers | Use PyPI for host sdist; updated classifiers
| Python | bsd-3-clause | eriol/django-c5filemanager | ---
+++
@@ -16,18 +16,25 @@
"""Small tool function to read README."""
return open(os.path.join(os.path.dirname(__file__), filename)).read()
-download_page = 'http://downloads.mornie.org/django-c5filemanager/'
+classifiers = '''
+Development Status :: 4 - Beta
+Environment :: Web Environment
+Intended Audi... |
3a308c37856bafd8ecbc64a2e425c8199dcf2e68 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='LinkFinder',
packages=find_packages(),
version='1.0',
description="A python script that finds endpoints in JavaScript files.",
long_description=open('README.md').read(),
author='Gerben Javado',
url='https://githu... | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='LinkFinder',
packages=find_packages(),
version='1.0',
description="A python script that finds endpoints in JavaScript files.",
long_description=open('README.md').read(),
author='Gerben Javado',
url='https://githu... | Allow use as vendor library | Allow use as vendor library
With this little change this tool can be used as a dependency | Python | mit | GerbenJavado/LinkFinder,GerbenJavado/LinkFinder | ---
+++
@@ -9,5 +9,6 @@
long_description=open('README.md').read(),
author='Gerben Javado',
url='https://github.com/GerbenJavado/LinkFinder',
+ py_modules=['linkfinder'],
install_requires=['argparse', 'jsbeautifier'],
) |
4626d74436dc547dca0faea67a95ac2121f348e4 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='myria-python',
version='1.2.4',
author='Daniel Halperin',
author_email='dhalperi@cs.washington.edu',
packages=find_packages(),
scripts=[],
url='https://github.com/uwescience/myria',
description='Python interface for Myria.',
l... | from setuptools import setup, find_packages
setup(
name='myria-python',
version='1.2.5',
author='Daniel Halperin',
author_email='dhalperi@cs.washington.edu',
packages=find_packages(),
scripts=[],
url='https://github.com/uwescience/myria',
description='Python interface for Myria.',
l... | Undo workaround for broken json-table-schema release (via messytables) | Undo workaround for broken json-table-schema release (via messytables) | Python | bsd-3-clause | uwescience/myria-python,uwescience/myria-python | ---
+++
@@ -2,7 +2,7 @@
setup(
name='myria-python',
- version='1.2.4',
+ version='1.2.5',
author='Daniel Halperin',
author_email='dhalperi@cs.washington.edu',
packages=find_packages(),
@@ -14,7 +14,6 @@
# see https://stackoverflow.com/questions/18578439
install_requires=["pip >=... |
57fdb0bc4c3751ef89ec6fddd1ccb85a5f4ad56b | setup.py | setup.py | # -*- coding: utf-8 -*-
import sys
import os.path
from setuptools import Command, find_packages, setup
HERE = os.path.abspath(os.path.dirname(__file__))
README_PATH = os.path.join(HERE, 'README.rst')
try:
README = open(README_PATH).read()
except IOError:
README = ''
setup(
name='rollbar-udp-agent',
v... | # -*- coding: utf-8 -*-
import sys
import os.path
from setuptools import Command, find_packages, setup
HERE = os.path.abspath(os.path.dirname(__file__))
README_PATH = os.path.join(HERE, 'README.rst')
try:
README = open(README_PATH).read()
except IOError:
README = ''
setup(
name='rollbar-udp-agent',
v... | Make data_files paths absolute again | Make data_files paths absolute again
| Python | mit | lrascao/rollbar-udp-agent,lrascao/rollbar-udp-agent | ---
+++
@@ -25,8 +25,8 @@
],
},
packages=['rollbar_udp_agent'],
- data_files=[('etc', ['rollbar-udp-agent.conf']),
- ('etc/init.d', ['rollbar-udp-agent'])],
+ data_files=[('/etc', ['rollbar-udp-agent.conf']),
+ ('/etc/init.d', ['rollbar-udp-agent'])],
classi... |
1ec5fb8f7c85464da24f0a1db553bcd0cce7fe39 | 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/*']},
install_requires=['moa', 'kivy'],
author='Matthew Einhorn',
author_email='moiein2000@gmail.com',
license='MIT',... | 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... | 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/*']},
+ package_data={'cplcom': ['../media/*', '*.kv']},
install_requires=['moa', 'kivy'],
author='Matthew Einhorn',
author_email='moiein2000@gmail.com'... |
e4de6c2f10605fda5537d838d232e4d10e680a28 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name="cobertura-clover-transform",
version='1.1.4',
packages=find_packages(),
include_package_data=True,
description="Tools for transforming Cobertura test "
"coverage XML into Clover-style XML",
install_requires=['lxml'],
a... | from setuptools import setup, find_packages
setup(
name="cobertura-clover-transform",
version='1.1.4.post1',
packages=find_packages(),
include_package_data=True,
description="Tools for transforming Cobertura test "
"coverage XML into Clover-style XML",
install_requires=['lxml'],... | Bump version for trove classifiers | Bump version for trove classifiers
| Python | mit | cwacek/cobertura-clover-transform | ---
+++
@@ -2,7 +2,7 @@
setup(
name="cobertura-clover-transform",
- version='1.1.4',
+ version='1.1.4.post1',
packages=find_packages(),
include_package_data=True,
description="Tools for transforming Cobertura test " |
f6ba4c52be9fd4be9eb7d04c15ee441d86304f0c | setup.py | setup.py |
from setuptools import setup, find_packages
setup(
name="cdispyutils",
version="0.1.0",
description="General utilities",
license="Apache",
install_requires=[
"six==1.10.0",
"requests==2.13.0",
],
packages=find_packages(),
)
|
from setuptools import setup, find_packages
setup(
name="cdispyutils",
version="0.1.0",
description="General utilities",
license="Apache",
install_requires=[
"six==1.11.0",
"requests==2.13.0",
],
packages=find_packages(),
)
| Update six version to match | Update six version to match | Python | apache-2.0 | uc-cdis/cdis-python-utils | ---
+++
@@ -7,7 +7,7 @@
description="General utilities",
license="Apache",
install_requires=[
- "six==1.10.0",
+ "six==1.11.0",
"requests==2.13.0",
],
packages=find_packages(), |
eb15038cd582e087225985947e4b98ffbc86d812 | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('git_externals/__init__.py') as fp:
exec(fp.read())
classifiers = [
'Development Status :: 4 - Beta',
'Programming Language :: Python',
'Programming... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('git_externals/__init__.py') as fp:
exec(fp.read())
classifiers = [
'Development Status :: 4 - Beta',
'Programming Language :: Python',
'Programming... | Remove version requirement, add pathlib | Remove version requirement, add pathlib
| Python | mit | develersrl/git-externals,develersrl/git-externals,develersrl/git-externals | ---
+++
@@ -29,7 +29,8 @@
description='utility to manage svn externals',
long_description='',
packages=['git_externals'],
- install_requires=['click>=6.0'],
+ install_requires=['click',
+ 'pathlib'],
entry_points={
'console_scripts': [
'git-external... |
af1d3b67bb6428a298e5028b7c86624d2f7f00c8 | setup.py | setup.py | """
Copyright (c) 2010-2013, Anthony Garcia <anthony@lagg.me>
Distributed under the ISC License (see LICENSE)
"""
from distutils.core import setup, Command
from distutils.errors import DistutilsOptionError
from unittest import TestLoader, TextTestRunner
import steam
class run_tests(Command):
description = "Run th... | """
Copyright (c) 2010-2013, Anthony Garcia <anthony@lagg.me>
Distributed under the ISC License (see LICENSE)
"""
from distutils.core import setup, Command
from distutils.errors import DistutilsOptionError
from unittest import TestLoader, TextTestRunner
import steam
class run_tests(Command):
description = "Run th... | Add rst long description for pypi | Add rst long description for pypi
| Python | isc | miedzinski/steamodd,Lagg/steamodd | ---
+++
@@ -31,6 +31,7 @@
setup(name = "steamodd",
version = steam.__version__,
description = "High level Steam API implementation with low level reusable core",
+ long_description = "Please see the `README <https://github.com/Lagg/steamodd/blob/master/README.md>`_ for a full description.",
... |
c7a0f94eced9c2ac6f8a27c10a7a93da4b97f7d7 | setup.py | setup.py | from setuptools import setup
setup(
name='django-markwhat',
version=".".join(map(str, __import__('django_markwhat').__version__)),
packages=['django_markwhat', 'django_markwhat.templatetags'],
url='http://pypi.python.org/pypi/django-markwhat',
license=open('LICENSE').read(),
author='Alireza Sav... | from setuptools import setup
setup(
name='django-markwhat',
version=".".join(map(str, __import__('django_markwhat').__version__)),
packages=['django_markwhat', 'django_markwhat.templatetags'],
url='http://pypi.python.org/pypi/django-markwhat',
license=open('LICENSE').read(),
author='Alireza Sav... | Fix summary - pypi doesn't allow multiple lines | Fix summary - pypi doesn't allow multiple lines
| Python | bsd-3-clause | Alir3z4/django-markwhat | ---
+++
@@ -9,8 +9,8 @@
author='Alireza Savand',
author_email='alireza.savand@gmail.com',
install_requires=['Django', ],
- description="""A collection of template filters that implement
- common markup languages.""",
+ description="A collection of template filters that implement " + \
+ ... |
12daa2e0f2cc8772fd6ff2ee3abf6054e36e1f18 | settings.py | settings.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#Main Settings
blog_name = "Pomash"
blog_author = "JmPotato"
blog_url = "http://xxx.oo/"
twitter_card = False
twitter_username = "@Jm_Potato"
analytics = ""
enable_comment = True
disqus_name = "pomash"
theme = "default"
post_per_page = 3
#Please Change it!!!!!!
cookie... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#Main Settings
blog_name = "Pomash"
blog_author = "JmPotato"
blog_url = "http://xxx.oo/"
twitter_card = False
twitter_username = "@Jm_Potato"
analytics = ""
enable_comment = True
disqus_name = "pomash"
theme = "default"
post_per_page = 3
#Please Change it!!!!!!
cookie... | Set debug mode off as default | Set debug mode off as default
| Python | mit | JmPotato/Pomash,JmPotato/Pomash | ---
+++
@@ -25,7 +25,7 @@
#login_password = "admin"
#Development Settings
-DeBug = True
+DeBug = False
#Dropbox
app_token = '' |
d815c8de309239e3c6f28e54793c9973ca9acc39 | twilio/values.py | twilio/values.py | unset = object()
def of(d):
return {k: v for k, v in d.iteritems() if v != unset}
| from six import iteritems
unset = object()
def of(d):
return {k: v for k, v in iteritems(d) if v != unset}
| Replace iteritems with six helper | Replace iteritems with six helper
| Python | mit | twilio/twilio-python,tysonholub/twilio-python | ---
+++
@@ -1,6 +1,7 @@
+from six import iteritems
unset = object()
def of(d):
- return {k: v for k, v in d.iteritems() if v != unset}
+ return {k: v for k, v in iteritems(d) if v != unset}
|
b93722df95d3907782cdff034df360b79d1fd093 | python/paddle/v2/dataset/common.py | python/paddle/v2/dataset/common.py | import hashlib
import os
import shutil
import urllib2
__all__ = ['DATA_HOME', 'download']
DATA_HOME = os.path.expanduser('~/.cache/paddle_data_set')
if not os.path.exists(DATA_HOME):
os.makedirs(DATA_HOME)
def download(url, md5):
filename = os.path.split(url)[-1]
assert DATA_HOME is not None
filepa... | import hashlib
import os
import shutil
import urllib2
__all__ = ['DATA_HOME', 'download']
DATA_HOME = os.path.expanduser('~/.cache/paddle/dataset')
if not os.path.exists(DATA_HOME):
os.makedirs(DATA_HOME)
def download(url, md5):
filename = os.path.split(url)[-1]
assert DATA_HOME is not None
filepat... | Set data cache home directory to ~/.cache/paddle/dataset | Set data cache home directory to ~/.cache/paddle/dataset
| Python | apache-2.0 | yu239/Paddle,reyoung/Paddle,livc/Paddle,chengduoZH/Paddle,emailweixu/Paddle,jacquesqiao/Paddle,Canpio/Paddle,putcn/Paddle,yu239/Paddle,putcn/Paddle,gangliao/Paddle,lispc/Paddle,gangliao/Paddle,chengduoZH/Paddle,gangliao/Paddle,PaddlePaddle/Paddle,pengli09/Paddle,lcy-seso/Paddle,gangliao/Paddle,pengli09/Paddle,cxysteven... | ---
+++
@@ -5,7 +5,7 @@
__all__ = ['DATA_HOME', 'download']
-DATA_HOME = os.path.expanduser('~/.cache/paddle_data_set')
+DATA_HOME = os.path.expanduser('~/.cache/paddle/dataset')
if not os.path.exists(DATA_HOME):
os.makedirs(DATA_HOME) |
2989c7074853266fd134a10df4afdcb700499203 | analyticsdataserver/urls.py | analyticsdataserver/urls.py | from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic import RedirectView
from analyticsdataserver import views
urlpatterns = [
url(r'^$', RedirectView.as_view(url='/docs')), # pylint: disable=no-value-for-parameter
url(r'^api-a... | from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic import RedirectView
from analyticsdataserver import views
from rest_framework.authtoken.views import obtain_auth_token
urlpatterns = [
url(r'^$', RedirectView.as_view(url='/docs'))... | Update string arg to url() to callable | Update string arg to url() to callable
| Python | agpl-3.0 | Stanford-Online/edx-analytics-data-api,edx/edx-analytics-data-api,Stanford-Online/edx-analytics-data-api,edx/edx-analytics-data-api,Stanford-Online/edx-analytics-data-api | ---
+++
@@ -3,13 +3,14 @@
from django.contrib import admin
from django.views.generic import RedirectView
from analyticsdataserver import views
+from rest_framework.authtoken.views import obtain_auth_token
urlpatterns = [
url(r'^$', RedirectView.as_view(url='/docs')), # pylint: disable=no-value-for-param... |
ef516fb03db9bdaa0f0bea97526a65c319b8e43c | tohu/v3/utils.py | tohu/v3/utils.py | from collections import namedtuple
__all__ = ['identity', 'print_generated_sequence']
def identity(x):
"""
Helper function which returns its argument unchanged.
That is, `identity(x)` returns `x` for any input `x`.
"""
return x
def print_generated_sequence(gen, num, *, sep=", ", seed=None):
... | from collections import namedtuple
__all__ = ['identity', 'print_generated_sequence']
def identity(x):
"""
Helper function which returns its argument unchanged.
That is, `identity(x)` returns `x` for any input `x`.
"""
return x
def print_generated_sequence(gen, num, *, sep=", ", fmt='', seed=No... | Allow passing format option to helper function | Allow passing format option to helper function
| Python | mit | maxalbert/tohu | ---
+++
@@ -11,7 +11,7 @@
return x
-def print_generated_sequence(gen, num, *, sep=", ", seed=None):
+def print_generated_sequence(gen, num, *, sep=", ", fmt='', seed=None):
"""
Helper function which prints a sequence of `num` items
produced by the random generator `gen`.
@@ -19,7 +19,7 @@
... |
f12beb5d2fbdc72c12f473c5cac04716f4893666 | test/viz/test_volcano.py | test/viz/test_volcano.py | from sequana.viz import Volcano
def test1():
import numpy as np
fc = np.random.randn(1000)
pvalue = np.random.randn(1000)
v = Volcano(fc, -np.log10(pvalue**2), pvalue_threshold=3)
v.plot()
v.plot(logy=True)
| from sequana.viz import Volcano
import pandas as pd
def test1():
import numpy as np
fc = np.random.randn(1000)
pvalue = np.random.randn(1000)
df = pd.DataFrame({"log2FoldChange": fc, "padj": pvalue ** 2})
v = Volcano(data=df, pvalue_threshold=3)
v.plot()
v.plot(logy=True)
| Update test for volcano plot | Update test for volcano plot
| Python | bsd-3-clause | sequana/sequana,sequana/sequana,sequana/sequana,sequana/sequana,sequana/sequana | ---
+++
@@ -1,11 +1,13 @@
from sequana.viz import Volcano
+import pandas as pd
+
def test1():
import numpy as np
+
fc = np.random.randn(1000)
pvalue = np.random.randn(1000)
- v = Volcano(fc, -np.log10(pvalue**2), pvalue_threshold=3)
+ df = pd.DataFrame({"log2FoldChange": fc, "padj": pvalue **... |
3d1969ebf187ed0f0ee52e84e951f65b108ce4cf | l10n_br_coa_simple/hooks.py | l10n_br_coa_simple/hooks.py | # Copyright (C) 2020 - Gabriel Cardoso de Faria <gabriel.cardoso@kmee.com.br>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import api, tools, SUPERUSER_ID
def post_init_hook(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
coa_simple_tmpl = env.ref(
'l10n_br_co... | # Copyright (C) 2020 - Gabriel Cardoso de Faria <gabriel.cardoso@kmee.com.br>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import api, tools, SUPERUSER_ID
def post_init_hook(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
coa_simple_tmpl = env.ref(
'l10n_br_co... | Use admin user to create COA | [FIX] l10n_br_coa_simple: Use admin user to create COA
| Python | agpl-3.0 | akretion/l10n-brazil,OCA/l10n-brazil,OCA/l10n-brazil,OCA/l10n-brazil,akretion/l10n-brazil,akretion/l10n-brazil | ---
+++
@@ -18,6 +18,9 @@
# Load COA to Demo Company
if not tools.config.get('without_demo'):
- env.user.company_id = env.ref(
- 'l10n_br_fiscal.empresa_simples_nacional')
- coa_simple_tmpl.try_loading_for_current_company()
+ user_admin = env.ref('base.user_admin')
+ ... |
f43f71cb016bc71ea32e80c2fd86f05b6af38468 | snoop/ipython.py | snoop/ipython.py | import ast
from snoop import snoop
from IPython.core.magic import Magics, cell_magic, magics_class
@magics_class
class SnoopMagics(Magics):
@cell_magic
def snoop(self, _line, cell):
filename = self.shell.compile.cache(cell)
code = self.shell.compile(cell, filename, 'exec')
tracer = sn... | import ast
from snoop import snoop
from IPython.core.magic import Magics, cell_magic, magics_class
@magics_class
class SnoopMagics(Magics):
@cell_magic
def snoop(self, _line, cell):
filename = self.shell.compile.cache(cell)
code = self.shell.compile(cell, filename, 'exec')
tracer = sn... | Hide modules from variables traced by %%snoop | Hide modules from variables traced by %%snoop
| Python | mit | alexmojaki/snoop,alexmojaki/snoop | ---
+++
@@ -15,7 +15,16 @@
tracer.variable_whitelist = set()
for node in ast.walk(ast.parse(cell)):
if isinstance(node, ast.Name):
- tracer.variable_whitelist.add(node.id)
+ name = node.id
+
+ if isinstance(
+ ... |
e63a914457fc10d895eb776a164939da3ddd9464 | waftools/gogobject.py | waftools/gogobject.py | from waflib.Task import Task
from waflib.TaskGen import extension
class gogobject(Task):
run_str = '${GGG} ${GGGFLAGS} -o ${TGT[0].parent.abspath()} ${SRC}'
@extension('.go.in')
def gogobject_hook(self, node):
tg = self.bld.get_tgen_by_name('go-gobject-gen')
ggg = tg.link_task.outputs[0]
if not self.env.GGG:
s... | from waflib.Task import Task
from waflib.TaskGen import extension
class gogobject(Task):
run_str = '${GGG} ${GGGFLAGS} -o ${TGT[0].parent.abspath()} ${SRC}'
@extension('.go.in')
def gogobject_hook(self, node):
tg = self.bld.get_tgen_by_name('go-gobject-gen')
ggg = tg.link_task.outputs[0]
if not self.env.GGG:
s... | Use config.json as a go-gobject-gen dependency as well. | Use config.json as a go-gobject-gen dependency as well.
| Python | mit | nsf/gogobject,nsf/gogobject,nsf/gogobject,nsf/gogobject | ---
+++
@@ -16,5 +16,5 @@
c_out = go_out.change_ext('.gen.c')
h_out = go_out.change_ext('.gen.h')
task = self.create_task('gogobject', node, [go_out, c_out, h_out])
- task.dep_nodes = [ggg]
+ task.dep_nodes = [ggg, node.parent.find_node('config.json')]
return task |
8d0fe30fadc4834348c0f697b097f4753c7f9d84 | floppyforms/tests/fields.py | floppyforms/tests/fields.py | from .base import FloppyFormsTestCase
import floppyforms as forms
class IntegerFieldTests(FloppyFormsTestCase):
def test_parse_int(self):
int_field = forms.IntegerField()
result = int_field.clean('15')
self.assertTrue(15, result)
self.assertIsInstance(result, int)
| from .base import FloppyFormsTestCase
import floppyforms as forms
class IntegerFieldTests(FloppyFormsTestCase):
def test_parse_int(self):
int_field = forms.IntegerField()
result = int_field.clean('15')
self.assertEqual(15, result)
self.assertIsInstance(result, int)
| Fix test so it is testing something | Fix test so it is testing something
| Python | bsd-3-clause | gregmuellegger/django-floppyforms,gregmuellegger/django-floppyforms,jonashaag/django-floppyforms,gregmuellegger/django-floppyforms,jonashaag/django-floppyforms | ---
+++
@@ -7,5 +7,5 @@
def test_parse_int(self):
int_field = forms.IntegerField()
result = int_field.clean('15')
- self.assertTrue(15, result)
+ self.assertEqual(15, result)
self.assertIsInstance(result, int) |
ef048131d586812c2d73edd6297dfae4305b6074 | website/exceptions.py | website/exceptions.py | class OSFError(Exception):
"""Base class for exceptions raised by the Osf application"""
pass
class NodeError(OSFError):
"""Raised when an action cannot be performed on a Node model"""
pass
class NodeStateError(NodeError):
"""Raised when the Node's state is not suitable for the requested action
... | class OSFError(Exception):
"""Base class for exceptions raised by the Osf application"""
pass
class NodeError(OSFError):
"""Raised when an action cannot be performed on a Node model"""
pass
class NodeStateError(NodeError):
"""Raised when the Node's state is not suitable for the requested action
... | Update Sanction exception error message and docstrings | Update Sanction exception error message and docstrings
| Python | apache-2.0 | alexschiller/osf.io,amyshi188/osf.io,felliott/osf.io,cwisecarver/osf.io,ckc6cz/osf.io,TomBaxter/osf.io,emetsger/osf.io,HalcyonChimera/osf.io,caneruguz/osf.io,RomanZWang/osf.io,doublebits/osf.io,adlius/osf.io,ticklemepierce/osf.io,danielneis/osf.io,samchrisinger/osf.io,baylee-d/osf.io,sloria/osf.io,asanfilippo7/osf.io,R... | ---
+++
@@ -20,11 +20,15 @@
pass
class InvalidSanctionRejectionToken(SanctionTokenError):
- """Raised if a embargo disapproval token is not found."""
+ """Raised if a Sanction subclass disapproval token submitted is invalid
+ or associated with another admin authorizer
+ """
message_short = ... |
26e90f715f5fbd5adeae1703a48ebef2352c93a2 | salt/utils/parser.py | salt/utils/parser.py | # -*- coding: utf-8 -*-
"""
salt.utils.parser
~~~~~~~~~~~~~~~~~
:copyright: © 2012 UfSoft.org - :email:`Pedro Algarvio (pedro@algarvio.me)`
:license: Apache 2.0, see LICENSE for more details.
"""
import sys
import optparse
from salt import version
class OptionParser(optparse.OptionParser):
def ... | # -*- coding: utf-8 -*-
"""
salt.utils.parser
~~~~~~~~~~~~~~~~~
:copyright: © 2012 UfSoft.org - :email:`Pedro Algarvio (pedro@algarvio.me)`
:license: Apache 2.0, see LICENSE for more details.
"""
import sys
import optparse
from salt import version
class OptionParser(optparse.OptionParser):
def ... | Remove extra `%` from the `cli` tools. | Remove extra `%` from the `cli` tools.
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | ---
+++
@@ -16,7 +16,7 @@
def __init__(self, *args, **kwargs):
kwargs.setdefault("version", version.__version__)
- kwargs.setdefault('usage', '%%prog')
+ kwargs.setdefault('usage', '%prog')
optparse.OptionParser.__init__(self, *args, **kwargs)
def parse_args(self, args=No... |
04807105282211ff4ad79e8b4e9b13442e083c86 | planex_globals.py | planex_globals.py | import os.path
BUILD_ROOT_DIR = "planex-build-root"
[SPECS_DIR, SOURCES_DIR, SRPMS_DIR, RPMS_DIR, BUILD_DIR] = map(
lambda x: os.path.join(BUILD_ROOT_DIR, x),
['SPECS', 'SOURCES', 'SRPMS', 'RPMS', 'BUILD'])
SPECS_GLOB = os.path.join(SPECS_DIR, "*.spec")
| import os.path
BUILD_ROOT_DIR = "planex-build-root"
[SPECS_DIR, SOURCES_DIR, SRPMS_DIR, RPMS_DIR, BUILD_DIR] = [
os.path.join(BUILD_ROOT_DIR, dir_name) for dir_name in
['SPECS', 'SOURCES', 'SRPMS', 'RPMS', 'BUILD']]
SPECS_GLOB = os.path.join(SPECS_DIR, "*.spec")
| Replace deprecated 'map' builtin with list comprehension | globals: Replace deprecated 'map' builtin with list comprehension
Signed-off-by: Euan Harris <c3b6e83069c8e9e3af49a38fec6026be89559638@citrix.com>
| Python | lgpl-2.1 | djs55/planex,jonludlam/planex,djs55/planex,simonjbeaumont/planex,euanh/planex-cleanhistory,euanh/planex-cleanhistory,simonjbeaumont/planex,djs55/planex,jonludlam/planex,jonludlam/planex,simonjbeaumont/planex,euanh/planex-cleanhistory | ---
+++
@@ -2,8 +2,8 @@
BUILD_ROOT_DIR = "planex-build-root"
-[SPECS_DIR, SOURCES_DIR, SRPMS_DIR, RPMS_DIR, BUILD_DIR] = map(
- lambda x: os.path.join(BUILD_ROOT_DIR, x),
- ['SPECS', 'SOURCES', 'SRPMS', 'RPMS', 'BUILD'])
+[SPECS_DIR, SOURCES_DIR, SRPMS_DIR, RPMS_DIR, BUILD_DIR] = [
+ os.path.join(BUILD_... |
13f6eb8d1229c44b8746a9b1c9f8ca804e76bced | mrburns/settings/server.py | mrburns/settings/server.py | import os
import socket
from .base import * # noqa
SERVER_ENV = os.getenv('DJANGO_SERVER_ENV')
SECRET_KEY = os.getenv('SECRET_KEY')
STATIC_URL = os.getenv('STATIC_URL', STATIC_URL)
DEBUG = TEMPLATE_DEBUG = False
ALLOWED_HOSTS = [
'webwewant.mozilla.org',
'webwewant.allizom.org',
'glow.cdn.mozilla.net',
... | import os
import socket
from .base import * # noqa
SERVER_ENV = os.getenv('DJANGO_SERVER_ENV')
SECRET_KEY = os.getenv('SECRET_KEY')
STATIC_URL = os.getenv('STATIC_URL', STATIC_URL)
DEBUG = TEMPLATE_DEBUG = False
ALLOWED_HOSTS = [
'webwewant.mozilla.org',
'webwewant.allizom.org',
'glow.cdn.mozilla.net',
... | Add CDN origin domain to allowed hosts. | Add CDN origin domain to allowed hosts.
| Python | mpl-2.0 | almossawi/mrburns,mozilla/mrburns,mozilla/mrburns,almossawi/mrburns,mozilla/mrburns,almossawi/mrburns,almossawi/mrburns | ---
+++
@@ -12,6 +12,7 @@
'webwewant.mozilla.org',
'webwewant.allizom.org',
'glow.cdn.mozilla.net',
+ 'glow-origin.cdn.mozilla.net',
# the server's IP (for monitors)
socket.gethostbyname(socket.gethostname()),
] |
42a4d5959524875fd39c190f6119eb06a97eabf2 | build/setenv.py | build/setenv.py | import os,sys
#General vars
CURDIR=os.path.dirname(os.path.abspath(__file__))
TOPDIR=os.path.dirname(CURDIR)
DOWNLOAD_DIR=TOPDIR+'\\downloads'
#Default vars
PY_VER='Python27'
BIN_DIR=TOPDIR+'\\bin'
PY_DIR=BIN_DIR+'\\'+PY_VER #Don't mess with PYTHONHOME
####################################################... | import os,sys
#General vars
CURDIR=os.path.dirname(os.path.abspath(__file__))
TOPDIR=os.path.dirname(os.path.dirname(CURDIR))
DOWNLOAD_DIR=os.path.join(TOPDIR,'downloads')
#Default vars
PY_VER='Python27'
BIN_DIR=os.path.join(TOPDIR,'bin')
PY_DIR=os.path.join(BIN_DIR,PY_VER) #Don't mess with PYTHONHOME
##... | Change path following import of build folder | Change path following import of build folder | Python | mit | lpinner/metageta | ---
+++
@@ -2,19 +2,19 @@
#General vars
CURDIR=os.path.dirname(os.path.abspath(__file__))
-TOPDIR=os.path.dirname(CURDIR)
-DOWNLOAD_DIR=TOPDIR+'\\downloads'
+TOPDIR=os.path.dirname(os.path.dirname(CURDIR))
+DOWNLOAD_DIR=os.path.join(TOPDIR,'downloads')
#Default vars
PY_VER='Python27'
-BIN_DIR=TOPDIR+'\\bin'
-... |
18baa0b6f963692e6de8ee8425a36f75a21f83d0 | falafel/tests/content/test_content_manager.py | falafel/tests/content/test_content_manager.py | import os
import pytest
import tempfile
import shutil
from falafel.content.manager import ContentManager
@pytest.fixture
def cm():
tmp_dir = tempfile.mkdtemp()
yield ContentManager(tmp_dir, "falafel.tests.plugins")
shutil.rmtree(tmp_dir)
def test_create_manager(cm):
assert len(list(cm.get_all())) ==... | import os
import pytest
import tempfile
import shutil
from falafel.content.manager import ContentManager
@pytest.fixture
def cm():
tmp_dir = tempfile.mkdtemp()
yield ContentManager(tmp_dir, ["falafel.tests.plugins"])
shutil.rmtree(tmp_dir)
def test_create_manager(cm):
assert len(list(cm.get_all())) ... | Integrate content server with new settings module | Integrate content server with new settings module
| Python | apache-2.0 | RedHatInsights/insights-core,RedHatInsights/insights-core | ---
+++
@@ -8,7 +8,7 @@
@pytest.fixture
def cm():
tmp_dir = tempfile.mkdtemp()
- yield ContentManager(tmp_dir, "falafel.tests.plugins")
+ yield ContentManager(tmp_dir, ["falafel.tests.plugins"])
shutil.rmtree(tmp_dir)
|
cdc4f79210b69f131926374aff61be72ab573c46 | scripts/import_queued_submissions.py | scripts/import_queued_submissions.py | #!/usr/bin/env python
# Copyright (C) 2011 Lukas Lalinsky
# Distributed under the MIT license, see the LICENSE file for details.
from acoustid.script import run_script
from acoustid.data.submission import import_queued_submissions
def main(script, opts, args):
conn = script.engine.connect()
with conn.begin(... | #!/usr/bin/env python
# Copyright (C) 2011 Lukas Lalinsky
# Distributed under the MIT license, see the LICENSE file for details.
from acoustid.script import run_script
from acoustid.data.submission import import_queued_submissions
def main(script, opts, args):
conn = script.engine.connect()
with conn.begin(... | Raise the import batch size to 100 | Raise the import batch size to 100
| Python | mit | lalinsky/acoustid-server,lalinsky/acoustid-server,lalinsky/acoustid-server,lalinsky/acoustid-server | ---
+++
@@ -10,7 +10,7 @@
def main(script, opts, args):
conn = script.engine.connect()
with conn.begin():
- import_queued_submissions(conn)
+ import_queued_submissions(conn, limit=100)
run_script(main)
|
bebb1d9bc44300e7c65fba90d6c2eb76243ea372 | scripts/cm2lut.py | scripts/cm2lut.py | #!/usr/bin/env python
"""
Script used to create lut lists used by mayavi from matplotlib colormaps.
This requires matlplotlib to be installed and should not be ran by the
user, but only once in a while to synchronize with MPL developpement.
"""
# Authors: Frederic Petit <fredmfp@gmail.com>,
# Gael Varoquaux <... | #!/usr/bin/env python
"""
Script used to create lut lists used by mayavi from matplotlib colormaps.
This requires matlplotlib to be installed and should not be ran by the
user, but only once in a while to synchronize with MPL developpement.
"""
# Authors: Frederic Petit <fredmfp@gmail.com>,
# Gael Varoquaux <... | Add a modified lut-data-generating script to use pickle, rather than npz | ENH: Add a modified lut-data-generating script to use pickle, rather than npz
| Python | bsd-3-clause | dmsurti/mayavi,liulion/mayavi,alexandreleroux/mayavi,alexandreleroux/mayavi,dmsurti/mayavi,liulion/mayavi | ---
+++
@@ -6,13 +6,15 @@
"""
# Authors: Frederic Petit <fredmfp@gmail.com>,
# Gael Varoquaux <gael.varoquaux@normalesup.org>
-# Copyright (c) 2007, Enthought, Inc.
+# Copyright (c) 2007-2009, Enthought, Inc.
# License: BSD Style.
+import os
+import numpy as np
+
from matplotlib.cm import datad, get... |
fece0019a54534b56960a30785bb70edb5d205bf | example_base/forms.py | example_base/forms.py | # -*- encoding: utf-8 -*-
from base.form_utils import RequiredFieldForm
from .models import Document
from base.form_utils import FileDropInput
class DocumentForm(RequiredFieldForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
for name in ('file', 'description'):
... | # -*- encoding: utf-8 -*-
from django import forms
from base.form_utils import RequiredFieldForm, FileDropInput
from .models import Document
class DocumentForm(RequiredFieldForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
for name in ('file', 'description'):
... | Add examples of ways to use FileDropInput | Add examples of ways to use FileDropInput
| Python | apache-2.0 | pkimber/base,pkimber/base,pkimber/base,pkimber/base | ---
+++
@@ -1,8 +1,7 @@
# -*- encoding: utf-8 -*-
-from base.form_utils import RequiredFieldForm
-
+from django import forms
+from base.form_utils import RequiredFieldForm, FileDropInput
from .models import Document
-from base.form_utils import FileDropInput
class DocumentForm(RequiredFieldForm):
@@ -20,4 +19,... |
1e17e868ff332003da959a397b8846c9386b35e8 | API_to_backend.py | API_to_backend.py | from multiprocessing import Queue, Process
import time
import backend
command_queue = Queue()
response_queue = Queue()
def start_backend():
if handler:
handler.stop()
handler = Process(target=backend.start, args=(command_queue, response_queue))
handler.start()
def get_for(url, queue, timeout):
... | from multiprocessing import Queue, Process
import time
import backend
command_queue = Queue()
response_queue = Queue()
def start_backend():
handler = Process(target=backend.start, args=(command_queue, response_queue))
handler.start()
def get_for(url, queue, timeout):
beginning = time.time()
result =... | Revert "Quit Backend If Running" | Revert "Quit Backend If Running"
This reverts commit a00432191e2575aba0f20ffb1a96a323699ae4fc.
| Python | mit | IAPark/PITherm | ---
+++
@@ -6,8 +6,6 @@
def start_backend():
- if handler:
- handler.stop()
handler = Process(target=backend.start, args=(command_queue, response_queue))
handler.start()
|
7c18cbf6dced0435537fb4067dfa878ae9ccc6af | accounts/models.py | accounts/models.py | from django.db import models
from django.contrib.auth.models import User
class Profile(models.Model):
user = models.OneToOneField(User)
def __str__(self):
return self.user.get_full_name() or self.user.username
| from django.db import models
from django.db.models.signals import post_save
from django.contrib.auth.models import User
class Profile(models.Model):
user = models.OneToOneField(User)
def __str__(self):
return self.user.get_full_name() or self.user.username
def create_user_profile(sender, instance, ... | Create profile if user is created | Create profile if user is created
| Python | mit | lockhawksp/beethoven,lockhawksp/beethoven | ---
+++
@@ -1,4 +1,5 @@
from django.db import models
+from django.db.models.signals import post_save
from django.contrib.auth.models import User
@@ -7,3 +8,11 @@
def __str__(self):
return self.user.get_full_name() or self.user.username
+
+
+def create_user_profile(sender, instance, created, **kw... |
6034265dfdfb2a7e1e4881076cc0f011ff0e639d | netbox/extras/migrations/0022_custom_links.py | netbox/extras/migrations/0022_custom_links.py | # Generated by Django 2.2 on 2019-04-15 19:28
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
('extras', '0021_add_color_comments_changelog_to_tag'),
]
op... | # Generated by Django 2.2 on 2019-04-15 19:28
from django.db import migrations, models
import django.db.models.deletion
import extras.models
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
('extras', '0021_add_color_comments_changelog_to... | Add limit_choices_to to CustomLink.content_type field | Add limit_choices_to to CustomLink.content_type field
| Python | apache-2.0 | lampwins/netbox,lampwins/netbox,digitalocean/netbox,digitalocean/netbox,digitalocean/netbox,lampwins/netbox,lampwins/netbox,digitalocean/netbox | ---
+++
@@ -2,6 +2,7 @@
from django.db import migrations, models
import django.db.models.deletion
+import extras.models
class Migration(migrations.Migration):
@@ -23,7 +24,7 @@
('group_name', models.CharField(blank=True, max_length=50)),
('button_class', models.CharField(def... |
32f38eb01c3a203ae35d70b485fcee7b13f1acde | tests/help_generation_test.py | tests/help_generation_test.py | # Copyright 2016 PerfKitBenchmarker Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | # Copyright 2016 PerfKitBenchmarker Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | Call FLAGS.get_help if it's available. | Call FLAGS.get_help if it's available.
| Python | apache-2.0 | GoogleCloudPlatform/PerfKitBenchmarker,GoogleCloudPlatform/PerfKitBenchmarker,meteorfox/PerfKitBenchmarker,GoogleCloudPlatform/PerfKitBenchmarker,GoogleCloudPlatform/PerfKitBenchmarker,meteorfox/PerfKitBenchmarker | ---
+++
@@ -25,7 +25,10 @@
class HelpTest(unittest.TestCase):
def testHelp(self):
# Test that help generation finishes without errors
- flags.FLAGS.GetHelp()
+ if hasattr(flags.FLAGS, 'get_help'):
+ flags.FLAGS.get_help()
+ else:
+ flags.FLAGS.GetHelp()
class HelpXMLTest(unittest.Test... |
d8c15667e76ce6d0dfa96a16312e75b83c63479b | tests/test_response.py | tests/test_response.py | """Unit test some basic response rendering functionality.
These tests use the unittest.mock mechanism to provide a simple Assistant
instance for the _Response initialization.
"""
from unittest.mock import patch
from flask import Flask
from flask_assistant import Assistant
from flask_assistant.response import _Respons... | """Unit test some basic response rendering functionality.
These tests use the unittest.mock mechanism to provide a simple Assistant
instance for the _Response initialization.
"""
from flask import Flask
from flask_assistant import Assistant
from flask_assistant.response import _Response
import pytest
patch = pytest.i... | Disable test for py27 (mock not available) | Disable test for py27 (mock not available)
| Python | apache-2.0 | treethought/flask-assistant | ---
+++
@@ -3,11 +3,12 @@
These tests use the unittest.mock mechanism to provide a simple Assistant
instance for the _Response initialization.
"""
-from unittest.mock import patch
-
from flask import Flask
from flask_assistant import Assistant
from flask_assistant.response import _Response
+import pytest
+
+pat... |
4b578fb7683054727444f1ed5c2a7d9732a3d8e9 | ci_scripts/installPandoc.py | ci_scripts/installPandoc.py | import os
from subprocess import call, check_output
import sys
from shutil import copy2
platform = sys.platform
def checkAndInstall():
try:
check_output('pandoc -v'.split())
except OSError:
cudir = os.path.abspath(os.curdir)
os.chdir(os.path.abspath(os.path.join(os.path.pardir, 'downl... | import os
from subprocess import call, check_output
import sys
from shutil import copy2
platform = sys.platform
def checkAndInstall():
try:
check_output('pandoc -v'.split())
except OSError:
def getFile():
from requests import get
with open(pandocFile, "wb") as file:
... | Fix build wheels with Pandoc 2. | Fix build wheels with Pandoc 2.
| Python | bsd-3-clause | jr-garcia/AssimpCy,jr-garcia/AssimpCy | ---
+++
@@ -10,8 +10,6 @@
try:
check_output('pandoc -v'.split())
except OSError:
- cudir = os.path.abspath(os.curdir)
- os.chdir(os.path.abspath(os.path.join(os.path.pardir, 'downloads')))
def getFile():
from requests import get
@@ -32,8 +30,6 @@
c... |
b4c88bcedaf6cab078426675ddbaf0e963b4a821 | apps/reactions/serializers.py | apps/reactions/serializers.py | from apps.bluebottle_utils.serializers import SorlImageField, SlugHyperlinkedIdentityField
from django.contrib.auth.models import User
from rest_framework import serializers
from .models import Reaction
from rest_framework.fields import HyperlinkedIdentityField
class ReactionAuthorSerializer(serializers.ModelSerializ... | from apps.bluebottle_utils.serializers import SorlImageField
from django.contrib.auth.models import User
from rest_framework import serializers
from .models import Reaction
class ReactionAuthorSerializer(serializers.ModelSerializer):
picture = SorlImageField('userprofile.picture', '90x90', crop='center')
cla... | Make reaction api display user id instead of username. | Make reaction api display user id instead of username.
| Python | bsd-3-clause | onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site | ---
+++
@@ -1,8 +1,7 @@
-from apps.bluebottle_utils.serializers import SorlImageField, SlugHyperlinkedIdentityField
+from apps.bluebottle_utils.serializers import SorlImageField
from django.contrib.auth.models import User
from rest_framework import serializers
from .models import Reaction
-from rest_framework.fiel... |
afa94ea297c6042f4444c0ce833c9b1ee02373c1 | stowaway.py | stowaway.py | import time
import socket
import datetime
from ipaddress import ip_address
import zmq
import yaml
import quick2wire.i2c as i2c
from database import Writer
from database import Temperature, Base
if __name__ == '__main__':
context = zmq.Context()
publisher = context.socket(zmq.PUB)
database = context.soc... | import time
import socket
import datetime
from ipaddress import ip_address
import zmq
import yaml
import quick2wire.i2c as i2c
from database import Writer
from database import Temperature, Base
if __name__ == '__main__':
context = zmq.Context()
publisher = context.socket(zmq.PUB)
database = context.soc... | Send timestamp to the outside world | Send timestamp to the outside world
| Python | bsd-3-clause | CojoCompany/stowaway | ---
+++
@@ -35,7 +35,7 @@
temp = data[0][-2:]
temp = int.from_bytes(temp, byteorder='little', signed=True) / 100.
print(now, temp)
- publisher.send_pyobj(('TEMP', now, temp))
+ publisher.send_pyobj(('TEMP', now.timestamp(), temp))
database.send_pyobj(('TEMP', now, tem... |
34369635a22bf05abbabe47e708a2ed80db258e5 | MeetingMinutes.py | MeetingMinutes.py | import sublime, sublime_plugin
from .mistune import markdown
class CreateMinuteCommand(sublime_plugin.TextCommand):
def run(self, edit):
region = sublime.Region(0, self.view.size())
md_source = self.view.substr(region)
md_source.encode(encoding='UTF-8',errors='strict')
html_source = '<!DOCTYPE html><html><hea... | import sublime, sublime_plugin
import os
import re
from subprocess import call
from .mistune import markdown
class CreateMinuteCommand(sublime_plugin.TextCommand):
def run(self, edit):
region = sublime.Region(0, self.view.size())
md_source = self.view.substr(region)
md_source.encode(encoding='UTF-8',errors='s... | Save the created html in a HTML file. | Save the created html in a HTML file.
| Python | mit | Txarli/sublimetext-meeting-minutes,Txarli/sublimetext-meeting-minutes | ---
+++
@@ -1,5 +1,10 @@
import sublime, sublime_plugin
+import os
+import re
+from subprocess import call
+
from .mistune import markdown
+
class CreateMinuteCommand(sublime_plugin.TextCommand):
def run(self, edit):
@@ -7,4 +12,12 @@
md_source = self.view.substr(region)
md_source.encode(encoding='UTF-8'... |
bf069a93484bff41c7cb46975fc8c41a7280723a | pastas/version.py | pastas/version.py | # This is the only location where the version will be written and changed.
# Based on https://packaging.python.org/single_source_version/
__version__ = '0.9.4b'
| # This is the only location where the version will be written and changed.
# Based on https://packaging.python.org/single_source_version/
__version__ = '0.9.4'
| Prepare to update Master branch to v 0.9.4 | Prepare to update Master branch to v 0.9.4
| Python | mit | pastas/pasta,pastas/pastas,gwtsa/gwtsa | ---
+++
@@ -1,3 +1,3 @@
# This is the only location where the version will be written and changed.
# Based on https://packaging.python.org/single_source_version/
-__version__ = '0.9.4b'
+__version__ = '0.9.4' |
b8273181c1f8806ebea3504d11d1feda36ae27ee | src/dependenpy/__main__.py | src/dependenpy/__main__.py | # -*- coding: utf-8 -*-
"""
Entrypoint module, in case you use `python -mdependenpy`.
Why does this file exist, and why __main__? For more info, read:
- https://www.python.org/dev/peps/pep-0338/
- https://docs.python.org/2/using/cmdline.html#cmdoption-m
- https://docs.python.org/3/using/cmdline.html#cmdoption-m
"""
... | # -*- coding: utf-8 -*-
"""
Entrypoint module, in case you use `python -mdependenpy`.
Why does this file exist, and why __main__? For more info, read:
- https://www.python.org/dev/peps/pep-0338/
- https://docs.python.org/2/using/cmdline.html#cmdoption-m
- https://docs.python.org/3/using/cmdline.html#cmdoption-m
"""
... | Fix passed args (no more program name) | Fix passed args (no more program name)
| Python | isc | Pawamoy/dependenpy,Pawamoy/dependenpy | ---
+++
@@ -9,9 +9,10 @@
- https://docs.python.org/2/using/cmdline.html#cmdoption-m
- https://docs.python.org/3/using/cmdline.html#cmdoption-m
"""
+
import sys
from dependenpy.cli import main
if __name__ == "__main__":
- main(sys.argv)
+ main(sys.argv[1:]) |
c674ca2920e4a6774761312669f351554e3955eb | src/metabotnik/templatetags/utilz.py | src/metabotnik/templatetags/utilz.py | from django import template
from metabotnik.models import project_status_choices
register = template.Library()
@register.filter
def nicestatus(dbval):
'Converts a db status choice into a more user-friendly version'
for val, stat in project_status_choices:
if dbval == val:
return stat
r... | from django import template
from metabotnik.models import project_status_choices
register = template.Library()
@register.filter
def nicestatus(dbval):
'Converts a db status choice into a more user-friendly version'
for val, stat in project_status_choices:
if dbval == val:
return stat
r... | Move eye down a bit | Move eye down a bit
| Python | mit | epoz/metabotnik,epoz/metabotnik,epoz/metabotnik | ---
+++
@@ -17,6 +17,6 @@
width, height = float(datadict['width']), float(datadict['height'])
for i,obj in enumerate(datadict.get('images', [])):
if 'LINK' in obj.get('metadata', {}):
- tmp = (obj['pk'], obj['x'], obj['y'])
+ tmp = (obj['pk'], obj['x']+10, obj['y']+100)
... |
99dfe6fc1c8688b9d1e01218830738f0190c92f1 | wmtmetatdata/__init__.py | wmtmetatdata/__init__.py | """Metadata and tools for WMT components."""
import os
top_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
metadata_dir = os.path.join(top_dir, 'metadata')
| Add variables for top and metadata directories | Add variables for top and metadata directories
| Python | mit | csdms/wmt-metadata | ---
+++
@@ -0,0 +1,7 @@
+"""Metadata and tools for WMT components."""
+
+import os
+
+
+top_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
+metadata_dir = os.path.join(top_dir, 'metadata') | |
446bb5103ec54680931cb0af43ded22e59bf11e5 | Recorders.py | Recorders.py | from Measurement import Measurement
class Recorder(object):
def __init__(self, recorderType):
self.recorderType = recorderType
def record(self, measure: Measurement):
None
class PrintRecorder(Recorder):
def __init__(self, config):
Recorder.__init__(self, 'file')
self.form... | from Measurement import Measurement
class Recorder(object):
def __init__(self, recorderType):
self.recorderType = recorderType
def record(self, measure: Measurement):
None
class PrintRecorder(Recorder):
def __init__(self, config):
Recorder.__init__(self, 'file')
self.form... | Create recorder file if not exist | Create recorder file if not exist
| Python | mit | hectortosa/py-temperature-recorder | ---
+++
@@ -39,5 +39,5 @@
file_path = self.container + measure.device_id.split('/')[-1] + self.extension
- f = open(file_path, 'w')
+ f = open(file_path, 'w+')
f.writelines([log_entry]) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.