commit stringlengths 40 40 | old_file stringlengths 4 236 | new_file stringlengths 4 236 | old_contents stringlengths 1 3.26k | new_contents stringlengths 16 4.43k | subject stringlengths 16 624 | message stringlengths 17 3.29k | lang stringclasses 5
values | license stringclasses 13
values | repos stringlengths 5 91.5k |
|---|---|---|---|---|---|---|---|---|---|
44e062dd5f302c5eed66e2d54858e1b8f78b745b | src/data.py | src/data.py | import csv
import datetime
class Row(dict):
def __init__(self, *args, **kwargs):
super(Row, self).__init__(*args, **kwargs)
self._start_date = None
self._end_date = None
def _cast_date(self, s):
if not s:
return None
return datetime.datetime.strptime(s, '%... | import csv
import datetime
class Row(dict):
def __init__(self, *args, **kwargs):
super(Row, self).__init__(*args, **kwargs)
self._start_date = None
self._end_date = None
def _cast_date(self, s):
if not s:
return None
return datetime.datetime.strptime(s, '%... | Add site number and application type to properties. For better filtering of new and old biz. | Add site number and application type to properties. For better filtering of new and old biz.
| Python | unlicense | datascopeanalytics/chicago-new-business,datascopeanalytics/chicago-new-business |
e7a09ad3e3d57291aa509cd45b8d3ae7a4cadaf8 | scripts/delete_couchdb_collection.py | scripts/delete_couchdb_collection.py | import sys
import argparse
import os
from harvester.couchdb_init import get_couchdb
import couchdb
from harvester.couchdb_sync_db_by_collection import delete_collection
def confirm_deletion(cid):
prompt = "Are you sure you want to delete all couchdb " + \
"documents for %s? yes to confirm\n" % cid
... | #! /bin/env python
import sys
import argparse
import os
from harvester.couchdb_init import get_couchdb
import couchdb
from harvester.couchdb_sync_db_by_collection import delete_collection
def confirm_deletion(cid):
prompt = "Are you sure you want to delete all couchdb " + \
"documents for %s? yes to c... | Make it runnable directly from cli, no python in front | Make it runnable directly from cli, no python in front
| Python | bsd-3-clause | mredar/harvester,mredar/harvester,ucldc/harvester,barbarahui/harvester,ucldc/harvester,barbarahui/harvester |
733d48510c4d6d8f4b9f07b6e33075cc20d1720a | gewebehaken/app.py | gewebehaken/app.py | # -*- coding: utf-8 -*-
"""
Gewebehaken
~~~~~~~~~~~
The WSGI application
:Copyright: 2015 `Jochen Kupperschmidt <http://homework.nwsnet.de/>`_
:License: MIT, see LICENSE for details.
"""
import logging
from logging import FileHandler, Formatter
from flask import Flask
from .hooks.twitter import blueprint as twitt... | # -*- coding: utf-8 -*-
"""
Gewebehaken
~~~~~~~~~~~
The WSGI application
:Copyright: 2015 `Jochen Kupperschmidt <http://homework.nwsnet.de/>`_
:License: MIT, see LICENSE for details.
"""
import logging
from logging import FileHandler, Formatter
from flask import Flask
from .hooks.twitter import blueprint as twitt... | Remove default route for serving static files from URL map. | Remove default route for serving static files from URL map.
| Python | mit | homeworkprod/gewebehaken |
75db5105d609a2b28f19ee675de866425e2c5c3e | salt/modules/cp.py | salt/modules/cp.py | '''
Minion side functions for salt-cp
'''
import os
def recv(files, dest):
'''
Used with salt-cp, pass the files dict, and the destination
'''
ret = {}
for path, data in files.items():
final = ''
if os.path.basename(path) == os.path.basename(dest)\
and not os.path.is... | '''
Minion side functions for salt-cp
'''
# Import python libs
import os
# Import salt libs
import salt.simpleauth
def recv(files, dest):
'''
Used with salt-cp, pass the files dict, and the destination.
This function recieves small fast copy files from the master via salt-cp
'''
ret = {}
for ... | Add in the minion module function to download files from the master | Add in the minion module function to download files from the master
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt |
1f3eb1c526171b0ee8d2cab05e182c067bfb6c2e | tests/unit/modules/defaults_test.py | tests/unit/modules/defaults_test.py | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Jayesh Kariya <jayeshk@saltstack.com>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting import TestCase, skipIf
from salttesting.mock import (
MagicMock,
patch,
NO_MOCK,
NO_MOCK_REASON
)
imp... | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Jayesh Kariya <jayeshk@saltstack.com>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting import TestCase, skipIf
from salttesting.mock import (
MagicMock,
patch,
NO_MOCK,
NO_MOCK_REASON
)
imp... | Remove useless mocked unit test | Remove useless mocked unit test
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt |
794a233a70ac8cdd4fc0812bd651757b35e605f2 | tests/unit/utils/test_sanitizers.py | tests/unit/utils/test_sanitizers.py | # -*- coding: utf-8 -*-
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
from salt.ext.six import text_type as text
# Import Salt Libs
from salt.utils.sanitizers import clean
# Import Salt Testing Libs
from tests.support.unit import TestCase, skipIf
from tests.support.moc... | # -*- coding: utf-8 -*-
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
from salt.ext.six import text_type as text
# Import Salt Libs
from salt.utils.sanitizers import clean, mask_args_value
# Import Salt Testing Libs
from tests.support.unit import TestCase, skipIf
from ... | Add unit test for masking key:value of YAML | Add unit test for masking key:value of YAML
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt |
b222fbbbcca019a1849e70cc46b1527fa5fe2082 | database.py | database.py | from redis import StrictRedis
class QuizDB(StrictRedis):
def get_all_quizzes(self):
return self.smembers('quiz')
| from redis import StrictRedis
class QuizDB(StrictRedis):
def get_all_quizzes(self):
return self.smembers('quiz')
def get_question(self, quizid, questionid):
return self.hget("{0}:question".format(quizid), questionid)
| Add function to get a question | Add function to get a question
| Python | bsd-2-clause | estreeper/quizalicious,estreeper/quizalicious,estreeper/quizalicious |
26d7b8a1e0fef6b32b5705634fe40504a6aa258d | tests/test_elsewhere_twitter.py | tests/test_elsewhere_twitter.py | from __future__ import print_function, unicode_literals
from gittip.elsewhere import twitter
from gittip.testing import Harness
class TestElsewhereTwitter(Harness):
def test_get_user_info_gets_user_info(self):
twitter.TwitterAccount(self.db, "1", {'screen_name': 'alice'}).opt_in('alice')
expecte... | from __future__ import print_function, unicode_literals
from gittip.elsewhere import twitter
from gittip.testing import Harness
class TestElsewhereTwitter(Harness):
def test_get_user_info_gets_user_info(self):
twitter.TwitterAccount(self.db, "1", {'screen_name': 'alice'}).opt_in('alice')
expecte... | Add a test for Twitter accounts with long identifier. | Add a test for Twitter accounts with long identifier.
| Python | mit | gratipay/gratipay.com,eXcomm/gratipay.com,mccolgst/www.gittip.com,studio666/gratipay.com,gratipay/gratipay.com,eXcomm/gratipay.com,eXcomm/gratipay.com,gratipay/gratipay.com,mccolgst/www.gittip.com,studio666/gratipay.com,eXcomm/gratipay.com,mccolgst/www.gittip.com,mccolgst/www.gittip.com,studio666/gratipay.com,gratipay/... |
a6bed0c1de2fc437d3ad84f0b22d27d4706eb5ab | presentations/urls.py | presentations/urls.py | from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'presentations.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
)
| from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'presentations.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^', incl... | Add URL routing to app | Add URL routing to app
| Python | mit | masonsbro/presentations |
dd2d5e96672fc7870434f030ca63f6d7111642f9 | resources/launchers/alfanousDesktop.py | resources/launchers/alfanousDesktop.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import alfanousDesktop.Gui
alfanousDesktop.Gui.main()
| #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
# The paths should be generated by setup script
sys.argv.extend(
'-i', '/usr/share/alfanous-indexes/',
'-l', '/usr/locale/',
'-c', '/usr/share/alfanous-config/')
from alfanousDesktop.Gui import *
main()
| Add resource paths to python launcher script (proxy) | Add resource paths to python launcher script (proxy)
Former-commit-id: 7d20874c43637f1236442333f60a88ec653f53f2 | Python | agpl-3.0 | muslih/alfanous,muslih/alfanous,muslih/alfanous,muslih/alfanous,muslih/alfanous,muslih/alfanous,muslih/alfanous |
7669e6c65d46615c8e52e53dba5a1b4812e34a02 | soccerstats/api.py | soccerstats/api.py | """
Blueprint implementing the API wrapper.
:author: 2013, Pascal Hartig <phartig@weluse.de>
:license: BSD
"""
import json
from flask import Blueprint, request, abort
from .utils import JSONError
from .calc import calculate_scores
api = Blueprint('api', __name__, url_prefix='/v1')
class ScoresResponse(object):
... | """
Blueprint implementing the API wrapper.
:author: 2013, Pascal Hartig <phartig@weluse.de>
:license: BSD
"""
import json
from flask import Blueprint, request, abort
from .utils import JSONError
from .calc import calculate_scores
api = Blueprint('api', __name__, url_prefix='/v1')
class ScoresResponse(object):
... | Return sorted values for scores | Return sorted values for scores
| Python | bsd-3-clause | passy/soccer-stats-backend |
3eaf0ea514b0f78906af7e614079f3a90624bcc7 | estimate.py | estimate.py | #!/usr/bin/python3
from sys import stdin
def estimateConf(conf):
"""Estimate configuration from a string."""
confElements = [int(x) for x in conf.split(sep=" ")]
disk = confElements[0]
print(disk)
procRates = confElements[1:]
print(procRates)
def estimateConfsFromInput():
"""Parse and es... | #!/usr/bin/python3
from sys import stdin
def calcExhaustion(disk, procRates):
"""Calculate how many seconds before the disk is filled.
procRates lists the rates at which each process fills 1 byte of disk
space."""
print(disk)
print(procRates)
def estimateConf(conf):
"""Estimate ... | Create fn for calculating exhaustion | Create fn for calculating exhaustion
| Python | mit | MattHeard/EstimateDiskExhaustion |
8e2596db204d2f6779280309aaa06d90872e9fb2 | tests/test_bot_support.py | tests/test_bot_support.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import pytest
from .test_bot import TestBot
class TestBotSupport(TestBot):
@pytest.mark.parametrize('url,result', [
('https://google.com', ['https://google.com']),
('google.com', ['google.com']),
('google.com/search?q=insta... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import pytest
from .test_bot import TestBot
class TestBotSupport(TestBot):
@pytest.mark.parametrize('url,result', [
('https://google.com', ['https://google.com']),
('google.com', ['google.com']),
('google.com/sea... | Add test on check file if exist | Add test on check file if exist
| Python | apache-2.0 | instagrambot/instabot,ohld/instabot,instagrambot/instabot |
3c00c5de9d0bd6ecf860d09b786db9625e212102 | tools/perf_expectations/PRESUBMIT.py | tools/perf_expectations/PRESUBMIT.py | #!/usr/bin/python
# Copyright (c) 2009 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.
"""Presubmit script for perf_expectations.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
details on ... | #!/usr/bin/python
# Copyright (c) 2009 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.
"""Presubmit script for perf_expectations.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
details on ... | Use full pathname to perf_expectations in test. | Use full pathname to perf_expectations in test.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/266055
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@28770 0039d316-1c4b-4281-b951-d872f2087c98
| Python | bsd-3-clause | adobe/chromium,adobe/chromium,adobe/chromium,gavinp/chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,ropik/chromium,adobe/chromium,Crystalnix/house-of-life-chromium,ropik/chromium,gavinp/chromium,adobe/chromium,ropik/chromium,adobe/chromium,gavinp/chromium,adobe/chromium,yitian134/chromium,... |
490ce27b6e9213cd9200b6fb42e7676af58abd58 | zou/app/models/custom_action.py | zou/app/models/custom_action.py | from zou.app import db
from zou.app.models.serializer import SerializerMixin
from zou.app.models.base import BaseMixin
class CustomAction(db.Model, BaseMixin, SerializerMixin):
name = db.Column(db.String(80), nullable=False)
url = db.Column(db.String(400))
| from zou.app import db
from zou.app.models.serializer import SerializerMixin
from zou.app.models.base import BaseMixin
class CustomAction(db.Model, BaseMixin, SerializerMixin):
name = db.Column(db.String(80), nullable=False)
url = db.Column(db.String(400))
entity_type = db.Column(db.String(40), default="a... | Add entity type column to actions | Add entity type column to actions
| Python | agpl-3.0 | cgwire/zou |
76d9ff900204678423208967b4578764013984ad | tests/test-recipes/metadata/always_include_files_glob/run_test.py | tests/test-recipes/metadata/always_include_files_glob/run_test.py | import os
import sys
import json
def main():
prefix = os.environ['PREFIX']
info_file = os.path.join(prefix, 'conda-meta',
'always_include_files_regex-0.1-0.json')
with open(info_file, 'r') as fh:
info = json.load(fh)
if sys.platform == 'darwin':
assert sor... | import os
import sys
import json
def main():
prefix = os.environ['PREFIX']
info_file = os.path.join(prefix, 'conda-meta',
'always_include_files_regex-0.1-0.json')
with open(info_file, 'r') as fh:
info = json.load(fh)
if sys.platform == 'darwin':
assert set... | Test sets instead of lists | Test sets instead of lists
| Python | bsd-3-clause | dan-blanchard/conda-build,mwcraig/conda-build,dan-blanchard/conda-build,sandhujasmine/conda-build,dan-blanchard/conda-build,ilastik/conda-build,frol/conda-build,mwcraig/conda-build,rmcgibbo/conda-build,shastings517/conda-build,shastings517/conda-build,shastings517/conda-build,sandhujasmine/conda-build,frol/conda-build,... |
025c3f6b73c97fdb58b1a492efcb6efe44cfdab0 | twisted/plugins/caldav.py | twisted/plugins/caldav.py | from zope.interface import implements
from twisted.plugin import IPlugin
from twisted.application.service import IServiceMaker
from twisted.python import reflect
def serviceMakerProperty(propname):
def getProperty(self):
return getattr(reflect.namedClass(self.serviceMakerClass), propname)
return prop... | from zope.interface import implements
from twisted.plugin import IPlugin
from twisted.application.service import IServiceMaker
from twisted.python import reflect
from twisted.internet.protocol import Factory
Factory.noisy = False
def serviceMakerProperty(propname):
def getProperty(self):
return getattr(... | Set Factory.noisy to False by default | Set Factory.noisy to False by default
git-svn-id: 81e381228600e5752b80483efd2b45b26c451ea2@3933 e27351fd-9f3e-4f54-a53b-843176b1656c
| Python | apache-2.0 | trevor/calendarserver,trevor/calendarserver,trevor/calendarserver |
7d756efb7361c13b0db0f37ead9668351c3a6887 | unitTestUtils/parseXML.py | unitTestUtils/parseXML.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
from xml.etree.ElementTree import ParseError
import xml.etree.ElementTree as ET
import glob
import sys
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
def parse():
for infile in glob.glob('*.xml'):
tr... | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
from xml.etree.ElementTree import ParseError
import xml.etree.ElementTree as ET
import glob
import sys
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
def parse():
for infile in glob.glob('*.xml'):
tr... | Add a print with file where mistake is | Add a print with file where mistake is
| Python | apache-2.0 | wkrzemien/j-pet-framework,wkrzemien/j-pet-framework,wkrzemien/j-pet-framework,wkrzemien/j-pet-framework,wkrzemien/j-pet-framework |
e885701a12fcb2d2557c975fadbabc7ee28ebf8b | djoauth2/helpers.py | djoauth2/helpers.py | # coding: utf-8
import random
from string import ascii_letters, digits
# From http://tools.ietf.org/html/rfc6750#section-2.1
BEARER_TOKEN_CHARSET = ascii_letters + digits + '-._~+/'
def random_hash(length):
return ''.join(random.sample(BEARER_TOKEN_CHARSET, length))
def random_hash_generator(length):
return la... | # coding: utf-8
import random
import urlparse
from string import ascii_letters, digits
from urllib2 import urlencode
# From http://tools.ietf.org/html/rfc6750#section-2.1
BEARER_TOKEN_CHARSET = ascii_letters + digits + '-._~+/'
def random_hash(length):
return ''.join(random.sample(BEARER_TOKEN_CHARSET, length))
... | Add helper for updating URL GET parameters. | Add helper for updating URL GET parameters.
| Python | mit | vden/djoauth2-ng,vden/djoauth2-ng,Locu/djoauth2,seler/djoauth2,Locu/djoauth2,seler/djoauth2 |
e2722385831a0930765d2c4bb78a582d41f4b64b | src/sentry/replays.py | src/sentry/replays.py | from __future__ import absolute_import
import socket
from httplib import HTTPConnection, HTTPSConnection
from urllib import urlencode
from urlparse import urlparse
class Replayer(object):
def __init__(self, url, method, data=None, headers=None):
self.url = url
self.method = method
self.d... | from __future__ import absolute_import
import requests
class Replayer(object):
def __init__(self, url, method, data=None, headers=None):
self.url = url
self.method = method
self.data = data
self.headers = headers
def replay(self):
try:
response = requests.r... | Use requests instead of httplib to do replay | Use requests instead of httplib to do replay
| Python | bsd-3-clause | beeftornado/sentry,nicholasserra/sentry,Kryz/sentry,JackDanger/sentry,imankulov/sentry,JamesMura/sentry,zenefits/sentry,kevinlondon/sentry,mvaled/sentry,JamesMura/sentry,ifduyue/sentry,looker/sentry,daevaorn/sentry,fotinakis/sentry,gencer/sentry,looker/sentry,JackDanger/sentry,mvaled/sentry,Natim/sentry,beeftornado/sen... |
133617660fe96a817b47d4d0fba4cfa7567dcafb | exceptional.py | exceptional.py | """A module to demonstrate exceptions."""
import sys
def convert(item):
'''
Convert to an integer.
Args:
item: some object
Returns:
an integer representation of the object
Throws:
a ValueException
'''
try:
x = int(item)
print(str.format('Conversio... | """A module to demonstrate exceptions."""
import sys
def convert(item):
"""
Convert to an integer.
Args:
item: some object
Returns:
an integer representation of the object
Throws:
a ValueException
"""
try:
return int(item)
except (ValueError, TypeErro... | Use two return statements and remove printing | Use two return statements and remove printing
| Python | mit | kentoj/python-fundamentals |
a0172116503f0b212a184fc4a1d2179115675e17 | fuzzyfinder/main.py | fuzzyfinder/main.py | # -*- coding: utf-8 -*-
import re
from . import export
@export
def fuzzyfinder(text, collection):
"""
Args:
text (str): A partial string which is typically entered by a user.
collection (iterable): A collection of strings which will be filtered
based on the input ... | # -*- coding: utf-8 -*-
import re
from . import export
@export
def fuzzyfinder(text, collection):
"""
Args:
text (str): A partial string which is typically entered by a user.
collection (iterable): A collection of strings which will be filtered
based on the input ... | Remove string interpolation and sorting the collection. | Remove string interpolation and sorting the collection. | Python | bsd-3-clause | adammenges/fuzzyfinder,amjith/fuzzyfinder,harrisonfeng/fuzzyfinder |
caf0829191e9f3276fb144486ad602dcd482b60d | ignition/dsl/sfl/proteus_coefficient_printer.py | ignition/dsl/sfl/proteus_coefficient_printer.py | """Generator for Proteus coefficient evaluator"""
from .sfl_printer import SFLPrinter
from ...code_tools import comment_code, indent_code, PythonCodePrinter
coefficient_header = """\
Proteus Coefficient file generated from Ignition
"""
class_header = """\
class %{class_name}s(TC_base):
"""
class ProteusCoefficien... | """Generator for Proteus coefficient evaluator"""
from .sfl_printer import SFLPrinter
from ...code_tools import comment_code, indent_code, PythonCodePrinter
coefficient_header = """\
Proteus Coefficient file generated from Ignition
"""
class ProteusCoefficientPrinter(SFLPrinter):
"""Generator for Proteus Coeff... | Print head, remove code for proteus python class head (use codeobj) | Print head, remove code for proteus python class head (use codeobj)
| Python | bsd-3-clause | IgnitionProject/ignition,IgnitionProject/ignition,IgnitionProject/ignition |
373e4e0e58cfec09b60983494f7b3bb4712e0ccd | 2/ConfNEP.py | 2/ConfNEP.py | """A custom ILAMB confrontation for net ecosystem productivity (nep)."""
import os
import numpy as np
from ILAMB.Confrontation import Confrontation
from ILAMB.Variable import Variable
import ilamblib as il
class ConfNEP(Confrontation):
"""Confront ``nep`` model outputs with ``nee`` observations.
Net ecosyste... | """A custom ILAMB confrontation for net ecosystem productivity (nep)."""
import os
import numpy as np
from ILAMB.Confrontation import Confrontation
from ILAMB.Variable import Variable
from ILAMB.ilamblib import MakeComparable
class ConfNEP(Confrontation):
"""Confront ``nep`` model outputs with ``nee`` observation... | Change import so it works | Change import so it works
| Python | mit | permamodel/ILAMB-experiments |
23ec0899eaf60a9dc79f6671461a33eea7e7f464 | authtools/backends.py | authtools/backends.py | from django.contrib.auth.backends import ModelBackend
class CaseInsensitiveEmailBackend(ModelBackend):
"""
This authentication backend assumes that usernames are email addresses and simply lowercases
a username before an attempt is made to authenticate said username using Django's ModelBackend.
Examp... | from django.contrib.auth.backends import ModelBackend
class CaseInsensitiveEmailBackendMixin(object):
def authenticate(self, username=None, password=None, **kwargs):
if username is not None:
username = username.lower()
return super(CaseInsensitiveEmailBackendMixin, self).authenticate(... | Add mixin to make the case-insensitive email auth backend more flexible | Add mixin to make the case-insensitive email auth backend more flexible
| Python | bsd-2-clause | fusionbox/django-authtools,vuchau/django-authtools,moreati/django-authtools,eevol/django-authtools,kivikakk/django-authtools |
e7d171b8b3721093c126560d1982e8eaebc4de6b | jay/urls.py | jay/urls.py | """jay URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based v... | """jay URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based v... | Add namespace to votes app URLs | Add namespace to votes app URLs
| Python | mit | kuboschek/jay,OpenJUB/jay,OpenJUB/jay,kuboschek/jay,kuboschek/jay,OpenJUB/jay |
4874f1b1a7a3ff465493f601f5f056bf8f3f1921 | badgekit_webhooks/urls.py | badgekit_webhooks/urls.py | from __future__ import unicode_literals
from django.conf.urls import patterns, url
from . import views
from django.contrib.admin.views.decorators import staff_member_required
urlpatterns = patterns(
"",
url(r"^hello/$", "badgekit_webhooks.views.hello", name="badgekit_webhooks_hello"),
url(r"^issued/$", "b... | from __future__ import unicode_literals
from django.conf.urls import patterns, url
from . import views
from django.contrib.admin.views.decorators import staff_member_required
urlpatterns = patterns(
"",
url(r"^hello/$", "badgekit_webhooks.views.hello", name="badgekit_webhooks_hello"),
url(r"^issued/$", "b... | Move badge instance list beneath 'badges' url | Move badge instance list beneath 'badges' url
| Python | mit | tgs/django-badgekit-webhooks |
11312893661ac339212fad7d81a21c9ddc2533d3 | identities/tasks.py | identities/tasks.py | import json
import requests
from celery.task import Task
from django.conf import settings
class DeliverHook(Task):
def run(self, target, payload, instance=None, hook=None, **kwargs):
"""
target: the url to receive the payload.
payload: a python primitive data structure
insta... | import json
import requests
from celery.task import Task
from django.conf import settings
class DeliverHook(Task):
def run(self, target, payload, instance_id=None, hook_id=None, **kwargs):
"""
target: the url to receive the payload.
payload: a python primitive data structure
... | Clean up params and docstrings | Clean up params and docstrings
| Python | bsd-3-clause | praekelt/seed-identity-store,praekelt/seed-identity-store |
42a0fbf29168f12a4bc3afc53bbf7148b9d008f6 | spacy/tests/pipeline/test_textcat.py | spacy/tests/pipeline/test_textcat.py | from __future__ import unicode_literals
from ...language import Language
def test_simple_train():
nlp = Language()
nlp.add_pipe(nlp.create_pipe('textcat'))
nlp.get_pipe('textcat').add_label('is_good')
nlp.begin_training()
for i in range(5):
for text, answer in [('aaaa', 1.), ('bbbb', 0),... | # coding: utf8
from __future__ import unicode_literals
from ...language import Language
def test_simple_train():
nlp = Language()
nlp.add_pipe(nlp.create_pipe('textcat'))
nlp.get_pipe('textcat').add_label('answer')
nlp.begin_training()
for i in range(5):
for text, answer in [('aaaa', 1.),... | Fix textcat simple train example | Fix textcat simple train example
| Python | mit | aikramer2/spaCy,explosion/spaCy,explosion/spaCy,recognai/spaCy,explosion/spaCy,recognai/spaCy,aikramer2/spaCy,spacy-io/spaCy,aikramer2/spaCy,honnibal/spaCy,spacy-io/spaCy,spacy-io/spaCy,spacy-io/spaCy,honnibal/spaCy,spacy-io/spaCy,explosion/spaCy,explosion/spaCy,spacy-io/spaCy,recognai/spaCy,honnibal/spaCy,aikramer2/sp... |
0b5b25b5cc3b5fe59c0a263983dae05ebfdc8de9 | plenum/common/transactions.py | plenum/common/transactions.py | from enum import Enum
class Transactions(Enum):
def __str__(self):
return self.name
class PlenumTransactions(Transactions):
# These numeric constants CANNOT be changed once they have been used,
# because that would break backwards compatibility with the ledger
# Also the numeric constants ... | from enum import Enum
class Transactions(Enum):
def __str__(self):
return self.name
class PlenumTransactions(Transactions):
# These numeric constants CANNOT be changed once they have been used,
# because that would break backwards compatibility with the ledger
# Also the numeric constants ... | Add new TAA transaction codes | INDY-2066: Add new TAA transaction codes
Signed-off-by: Sergey Khoroshavin <b770466c7a06c5fe47531d5f0e31684f1131354d@dsr-corporation.com>
| Python | apache-2.0 | evernym/zeno,evernym/plenum |
e1c58062db9c107c358e3617793aaed7cdb3a133 | jobmon/util.py | jobmon/util.py | import os
import threading
class TerminableThreadMixin:
"""
TerminableThreadMixin is useful for threads that need to be terminated
from the outside. It provides a method called 'terminate', which communicates
to the thread that it needs to die, and then waits for the death to occur.
It imposes the... | import logging
import os
import threading
def reset_loggers():
"""
Removes all handlers from the current loggers to allow for a new basicConfig.
"""
root = logging.getLogger()
for handler in root.handlers[:]:
root.removeHandler(handler)
class TerminableThreadMixin:
"""
TerminableTh... | Add way to reset loggers | Add way to reset loggers
logging.basicConfig doesn't reset the current logging infrastructure, which
was messing up some tests that expected logs to be one place even though
they ended up in another
| Python | bsd-2-clause | adamnew123456/jobmon |
76ed5eb9d9d2f3a453de6976f52221e6970b6b71 | tests/unit/test_offline_compression.py | tests/unit/test_offline_compression.py | import os
import shutil
import tempfile
from django.test import TestCase
from django.core.management import call_command
from django.test.utils import override_settings
TMP_STATIC_DIR = tempfile.mkdtemp()
@override_settings(
COMPRESS_ENABLED=True,
COMPRESS_OFFLINE=True,
COMPRESS_ROOT=TMP_STATIC_DIR
)
c... | import os
import shutil
import tempfile
from django.test import TestCase
from django.core.management import call_command
from django.test.utils import override_settings
TMP_STATIC_DIR = tempfile.mkdtemp()
@override_settings(
COMPRESS_ENABLED=True,
COMPRESS_OFFLINE=True,
COMPRESS_ROOT=TMP_STATIC_DIR
)
c... | Add test for offline compression using django_compressor | Add test for offline compression using django_compressor
| Python | bsd-3-clause | tangentlabs/django-fancypages,socradev/django-fancypages,tangentlabs/django-fancypages,socradev/django-fancypages,socradev/django-fancypages,tangentlabs/django-fancypages |
d7e9eba6fb3628f0736bd468ae76e05099b9d651 | space/decorators.py | space/decorators.py | from django.http import HttpResponseBadRequest, HttpResponseForbidden
from django.views.decorators.csrf import csrf_exempt
from incubator.settings import STATUS_SECRETS
def one_or_zero(arg):
"""Typecast to 1 or 0"""
if arg == '1':
return 1
elif arg == '0':
return 0
raise ValueError("no... | from django.http import HttpResponseBadRequest, HttpResponseForbidden
from django.views.decorators.csrf import csrf_exempt
from django.conf import settings
def one_or_zero(arg):
"""Typecast to 1 or 0"""
if arg == '1':
return 1
elif arg == '0':
return 0
raise ValueError("not one or zero... | Use from django.conf import settings | Use from django.conf import settings
| Python | agpl-3.0 | UrLab/incubator,UrLab/incubator,UrLab/incubator,UrLab/incubator |
ce3c7daff5eaaf8eefecf3f4e5bd9fbca40a7a2a | cob/subsystems/tasks_subsystem.py | cob/subsystems/tasks_subsystem.py | import os
import logbook
from .base import SubsystemBase
_logger = logbook.Logger(__name__)
class TasksSubsystem(SubsystemBase):
NAME = 'tasks'
def activate(self, flask_app):
from ..celery.app import celery_app
self._config = self.project.config.get('celery', {})
# ensure critica... | import os
import logbook
from .base import SubsystemBase
_logger = logbook.Logger(__name__)
class TasksSubsystem(SubsystemBase):
NAME = 'tasks'
def activate(self, flask_app):
from ..celery.app import celery_app
self._config = self.project.config.get('celery', {})
# ensure critica... | Allow passing Celery configuration under the project's config | Allow passing Celery configuration under the project's config
| Python | bsd-3-clause | getweber/weber-cli |
455c8ed93dcac20b6393cf781e19971fa3b92cdb | tests/test_cookies.py | tests/test_cookies.py | # -*- coding: utf-8 -*-
def test_bar_fixture(testdir):
"""Make sure that pytest accepts our fixture."""
# create a temporary pytest test module
testdir.makepyfile("""
def test_sth(bar):
assert bar == "europython2015"
""")
# run pytest with the following cmd args
result = ... | # -*- coding: utf-8 -*-
def test_cookies_fixture(testdir):
"""Make sure that pytest accepts the `cookies` fixture."""
# create a temporary pytest test module
testdir.makepyfile("""
def test_valid_fixture(cookies):
assert hasattr(cookies, 'bake')
assert callable(cookies.bak... | Implement simple tests for the 'cookies' fixture | Implement simple tests for the 'cookies' fixture
| Python | mit | hackebrot/pytest-cookies |
134fcbd6e82957ac3abd2eebdc296fd4ccb457e9 | alexandria/api/books.py | alexandria/api/books.py | from . import app, mongo
from alexandria.decorators import *
from flask import request, jsonify, url_for, session
from flask.ext.classy import FlaskView, route
import json
from bson import json_util
class BooksView(FlaskView):
route_prefix = '/api/'
@authenticated
def index(self):
query = mongo.... | from . import app, mongo
from alexandria.decorators import *
from flask import request, jsonify, url_for, session
from flask.ext.classy import FlaskView, route
import json
from bson import json_util
class BooksView(FlaskView):
route_prefix = '/api/'
@authenticated
def index(self):
query = mongo.... | Set value of 'owner' to the value of the ObjectId | Set value of 'owner' to the value of the ObjectId
| Python | mit | citruspi/Alexandria,citruspi/Alexandria |
233e74abcc4a70f573e199074f5184b30bdfe1d2 | seam/__init__.py | seam/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" __init__.py
Seam
====
Seam is a simple layer between existing neuroimaging tools and your data.
While it is opinionated in how to execute tools, it makes no decisions
as to how data is organized or how the scripts are ultimately run. These
decisions are are up to yo... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" __init__.py
Seam
====
Seam is a simple layer between existing neuroimaging tools and your data.
While it is opinionated in how to execute tools, it makes no decisions
as to how data is organized or how the scripts are ultimately run. These
decisions are are up to yo... | Fix py3k relative import error | Fix py3k relative import error
| Python | mit | VUIIS/seam,VUIIS/seam |
418e7a7d8c8261578df046d251041ab0794d1580 | decorators.py | decorators.py | #!/usr/bin/env python
class RequiresType(object):
"""
Checks that the first (or position given by the keyword argument 'position'
argument to the function is an instance of one of the types given in the
positional decorator arguments
"""
def __init__(self, *types, **kwargs):
self.type... | #!/usr/bin/env python
class RequiresType(object):
"""
Checks that the first (or position given by the keyword argument 'position'
argument to the function is an instance of one of the types given in the
positional decorator arguments
"""
def __init__(self, *types, **kwargs):
self.type... | Raise TypeError instead of returning | Raise TypeError instead of returning
| Python | bsd-3-clause | rasher/reddit-modbot |
0d0d43f957cb79a99eaacef0623cd57351ca40f6 | test/factories.py | test/factories.py | # coding: utf-8
import factory
from django.contrib.auth.models import User
class UserFactory(factory.Factory):
FACTORY_FOR = User
first_name = "Boy"
last_name = "Factory"
email = factory.LazyAttribute(
lambda a:
"{0}_{1}@example.com".format(a.first_name, a.last_name).lower())
us... | # coding: utf-8
import factory
from django.contrib.auth.models import User
class UserFactory(factory.Factory):
FACTORY_FOR = User
first_name = "Boy"
last_name = "Factory"
email = factory.LazyAttribute(
lambda a:
"{0}_{1}@example.com".format(a.first_name, a.last_name).lower())
us... | Fix userfactory - set user flags | Fix userfactory - set user flags
| Python | mit | sarutobi/Rynda,sarutobi/ritmserdtsa,sarutobi/flowofkindness,sarutobi/Rynda,sarutobi/flowofkindness,sarutobi/ritmserdtsa,sarutobi/flowofkindness,sarutobi/ritmserdtsa,sarutobi/Rynda,sarutobi/Rynda,sarutobi/flowofkindness,sarutobi/ritmserdtsa |
f4fdba652a1822698778c65df66a2639ec0fc5ad | tests/conftest.py | tests/conftest.py | import pytest
from .app import setup, teardown
@pytest.fixture(autouse=True, scope='session')
def db_migration(request):
setup()
request.addfinalizer(teardown)
| from __future__ import absolute_import
import pytest
from .app import setup, teardown
from app import create_app
from app.models import db, Framework
@pytest.fixture(autouse=True, scope='session')
def db_migration(request):
setup()
request.addfinalizer(teardown)
@pytest.fixture(scope='session')
def app(r... | Add live and expired framework pytest fixtures | Add live and expired framework pytest fixtures
This is a tiny attempt to move away from relying on database migrations
to set up framework records for tests. Using migration framework records
means we need to use actual (sometimes expired) frameworks to write tests
ties us to existing frameworks and require manual rol... | Python | mit | alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api |
9145be89c1a5ba1a2c47bfeef571d40b9eb060bc | test/integration/test_user_args.py | test/integration/test_user_args.py | from . import *
class TestUserArgs(IntegrationTest):
def __init__(self, *args, **kwargs):
IntegrationTest.__init__(
self, os.path.join(examples_dir, '10_custom_args'),
configure=False, *args, **kwargs
)
def test_build_default(self):
self.configure()
sel... | from six import assertRegex
from . import *
class TestUserArgs(IntegrationTest):
def __init__(self, *args, **kwargs):
IntegrationTest.__init__(
self, os.path.join(examples_dir, '10_custom_args'),
configure=False, *args, **kwargs
)
def test_build_default(self):
... | Add integration test for user-args help | Add integration test for user-args help
| Python | bsd-3-clause | jimporter/bfg9000,jimporter/bfg9000,jimporter/bfg9000,jimporter/bfg9000 |
6a17674897bbb3a44fb2153967e3985dfdb3d5df | zounds/learn/graph.py | zounds/learn/graph.py | import featureflow as ff
from random_samples import ShuffledSamples
from random_samples import InfiniteSampler
from preprocess import PreprocessingPipeline
def learning_pipeline():
class LearningPipeline(ff.BaseModel):
samples = ff.PickleFeature(ff.IteratorNode)
shuffled = ff.PickleFeature(
... | import featureflow as ff
from random_samples import ShuffledSamples
from random_samples import InfiniteSampler
from preprocess import PreprocessingPipeline
def learning_pipeline():
class LearningPipeline(ff.BaseModel):
samples = ff.PickleFeature(ff.IteratorNode)
shuffled = ff.PickleFeature(
... | Add a new option allowing client code to turn off parallelism | Add a new option allowing client code to turn off parallelism
| Python | mit | JohnVinyard/zounds,JohnVinyard/zounds,JohnVinyard/zounds,JohnVinyard/zounds |
bfaf9d326fc0a2fc72a6f7b6ed92640c3fe9b87b | hirlite/__init__.py | hirlite/__init__.py | from .hirlite import Rlite, HirliteError
from .version import __version__
__all__ = ["Rlite", "HirliteError", "__version__"]
| import functools
from hirlite.hirlite import Rlite as RliteExtension, HirliteError
from hirlite.version import __version__
__all__ = ["Rlite", "HirliteError", "__version__"]
class Rlite(RliteExtension):
def __getattr__(self, command):
return functools.partial(self.command, command)
| Add support for calling commands by attr access | Add support for calling commands by attr access
| Python | bsd-2-clause | seppo0010/rlite-py,seppo0010/rlite-py,pombredanne/rlite-py,pombredanne/rlite-py |
700f6e6ef40a2d33e5678e260f03cd15148e0b3a | test/test_parse_file_guess_format.py | test/test_parse_file_guess_format.py | import unittest
import logging
from pathlib import Path
from shutil import copyfile
from tempfile import TemporaryDirectory
from rdflib.exceptions import ParserError
from rdflib import Graph
class FileParserGuessFormatTest(unittest.TestCase):
def test_ttl(self):
g = Graph()
self.assertIsInstance... | import unittest
import logging
from pathlib import Path
from shutil import copyfile
from tempfile import TemporaryDirectory
from rdflib.exceptions import ParserError
from rdflib import Graph
class FileParserGuessFormatTest(unittest.TestCase):
def test_jsonld(self):
g = Graph()
self.assertIsInsta... | Add test for adding JSON-LD to guess_format() | Add test for adding JSON-LD to guess_format()
This is a follow-on patch to:
e778e9413510721c2fedaae56d4ff826df265c30
Test was confirmed to pass by running this on the current `master`
branch, and confirmed to fail with e778e941 reverted.
nosetests test/test_parse_file_guess_format.py
Signed-off-by: Alex Nelson ... | Python | bsd-3-clause | RDFLib/rdflib,RDFLib/rdflib,RDFLib/rdflib,RDFLib/rdflib |
24c8122db0f38a1f798461a23d08535e4e6781d5 | photo/idxitem.py | photo/idxitem.py | """Provide the class IdxItem which represents an item in the index.
"""
import hashlib
def _md5file(fname):
"""Calculate the md5 hash for a file.
"""
m = hashlib.md5()
chunksize = 8192
with open(fname, 'rb') as f:
while True:
chunk = f.read(chunksize)
if not chunk:... | """Provide the class IdxItem which represents an item in the index.
"""
import hashlib
def _md5file(fname):
"""Calculate the md5 hash for a file.
"""
m = hashlib.md5()
chunksize = 8192
with open(fname, 'rb') as f:
while True:
chunk = f.read(chunksize)
if not chunk:... | Convert tags to a set on init and back to a list on writing. | Convert tags to a set on init and back to a list on writing.
| Python | apache-2.0 | RKrahl/photo-tools |
a75dbd5aa5e9b84d08919ea14743afb75182ee8b | steel/chunks/iff.py | steel/chunks/iff.py | import collections
import io
from steel.fields.numbers import BigEndian
from steel import fields
from steel.chunks import base
__all__ = ['Chunk', 'ChunkList', 'Form']
class Chunk(base.Chunk):
id = fields.String(size=4, encoding='ascii')
size = fields.Integer(size=4, endianness=BigEndian)
p... | import collections
import io
from steel.fields.numbers import BigEndian
from steel import fields
from steel.chunks import base
__all__ = ['Chunk', 'ChunkList', 'List', 'Form', 'Prop']
class Chunk(base.Chunk):
id = fields.String(size=4, encoding='ascii')
size = fields.Integer(size=4, endianness=B... | Add a List and Prop for better IFF compliance | Add a List and Prop for better IFF compliance
| Python | bsd-3-clause | gulopine/steel |
15ebd5a3509b20bad4cf0123dfac9be6878fa91c | app/models/bookmarks.py | app/models/bookmarks.py | from flask import current_app
from .. import db, login_manager
class Bookmarks(db.Model):
id = db.Column(db.Integer, primary_key=True)
listing_id = db.Column(db.Integer, unique=True)
merchant_id = db.Column(db.Integer, db.ForeignKey('user.id')) #also needs to be added to Hunter's Vendors model
def __i... | from flask import current_app
from .. import db, login_manager
class Bookmarks(db.Model):
id = db.Column(db.Integer, primary_key=True)
listing_id = db.Column(db.Integer, unique=True)
merchant_id = db.Column(db.Integer, db.ForeignKey('user.id'))
merchant = db.relationship('User', backref=db.backref('boo... | Set up the relationship between bookmark and merchant | Set up the relationship between bookmark and merchant
| Python | mit | hack4impact/reading-terminal-market,hack4impact/reading-terminal-market,hack4impact/reading-terminal-market |
013fa911c7b882a0b362549d4d9b1f9e1e688bc8 | violations/py_unittest.py | violations/py_unittest.py | import re
from django.template.loader import render_to_string
from tasks.const import STATUS_SUCCESS, STATUS_FAILED
from .base import library
@library.register('py_unittest')
def py_unittest_violation(data):
"""Python unittest violation parser"""
lines = data['raw'].split('\n')
line = ''
while len(lin... | import re
from django.template.loader import render_to_string
from tasks.const import STATUS_SUCCESS, STATUS_FAILED
from .base import library
@library.register('py_unittest')
def py_unittest_violation(data):
"""Python unittest violation parser"""
lines = data['raw'].split('\n')
line = ''
while len(lin... | Add total tests count to py unittest graph | Add total tests count to py unittest graph
| Python | mit | nvbn/coviolations_web,nvbn/coviolations_web |
83c79251b5040e18c5c8ac65a5e140e59edc4d3f | test_readability.py | test_readability.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import readability
import unittest
good_code = """
def this_is_some_good_code(var):
for i in range(10):
print(i)
"""
bad_code = """
tisgc = lambda var: [print(i) for i in range(10)]
"""
apl_code = u"""
life←{↑1 ⍵∨.∧3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵}
"""
class TestReada... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import readability
import unittest
good_code = """
def this_is_some_good_code(var):
for i in range(10):
print(i)
"""
bad_code = """
tisgc = lambda var: [print(i) for i in range(10)]
"""
# taken from http://en.wikipedia.org/wiki/APL_%28programming_language%29#Examp... | Test APL code should give credit to Wikipedia | Test APL code should give credit to Wikipedia
| Python | mit | swenson/readability |
db03af21b3f46e5f5af89ccf224bc2bf4b9f6d9b | zephyr/projects/herobrine/BUILD.py | zephyr/projects/herobrine/BUILD.py | # Copyright 2021 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
def register_variant(project_name, extra_dts_overlays=(), extra_kconfig_files=()):
register_npcx_project(
project_name=project_name,
... | # Copyright 2021 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
def register_variant(project_name, extra_dts_overlays=(), extra_kconfig_files=()):
register_npcx_project(
project_name=project_name,
... | Include the missing project config | herobrine: Include the missing project config
Need to include the project config prj_herobrine_npcx9.conf to
the build. It defines CONFIG_BOARD_HEROBRINE_NPCX9=y. The board
specific alternative component code (alt_dev_replacement.c)
requires this Kconfig option.
BRANCH=None
BUG=b:216836197
TEST=Booted the herobrine_n... | Python | bsd-3-clause | coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec |
f2ca059d6e3e9e593b053e6483ad071d58cc99d2 | tests/core/admin.py | tests/core/admin.py | from django.contrib import admin
from import_export.admin import ImportExportMixin
from .models import Book, Category, Author
class BookAdmin(ImportExportMixin, admin.ModelAdmin):
pass
admin.site.register(Book, BookAdmin)
admin.site.register(Category)
admin.site.register(Author)
| from django.contrib import admin
from import_export.admin import ImportExportMixin
from .models import Book, Category, Author
class BookAdmin(ImportExportMixin, admin.ModelAdmin):
list_filter = ['categories', 'author']
admin.site.register(Book, BookAdmin)
admin.site.register(Category)
admin.site.register(Auth... | Add BookAdmin options in test app | Add BookAdmin options in test app
| Python | bsd-2-clause | PetrDlouhy/django-import-export,copperleaftech/django-import-export,Akoten/django-import-export,daniell/django-import-export,pajod/django-import-export,piran/django-import-export,bmihelac/django-import-export,sergei-maertens/django-import-export,bmihelac/django-import-export,PetrDlouhy/django-import-export,copperleafte... |
25c56d4c68ec484b47ef320cfb46601c4435470b | tests/test_crc32.py | tests/test_crc32.py | import hmac
import unittest
from twoping import crc32
class TestCRC32(unittest.TestCase):
def test_crc32(self):
c = crc32.new()
c.update(b"Data to hash")
self.assertEqual(c.digest(), b"\x44\x9e\x0a\x5c")
def test_hmac(self):
h = hmac.new(b"Secret key", b"Data to hash", crc32)... | import hmac
import unittest
from twoping import crc32
class TestCRC32(unittest.TestCase):
def test_crc32(self):
c = crc32.new(b"Data to hash")
self.assertEqual(c.digest(), b"\x44\x9e\x0a\x5c")
def test_hmac(self):
h = hmac.new(b"Secret key", b"Data to hash", crc32)
self.asser... | Increase test coverage on crc32 | Increase test coverage on crc32
| Python | mpl-2.0 | rfinnie/2ping,rfinnie/2ping |
096e41266ac3686c1757fc4b5087e3b786287f91 | webapp/byceps/database.py | webapp/byceps/database.py | # -*- coding: utf-8 -*-
"""
byceps.database
~~~~~~~~~~~~~~~
Database utilities.
:Copyright: 2006-2014 Jochen Kupperschmidt
"""
import uuid
from flask.ext.sqlalchemy import BaseQuery, SQLAlchemy
from sqlalchemy.dialects.postgresql import UUID
db = SQLAlchemy()
db.Uuid = UUID
def generate_uuid():
"""Genera... | # -*- coding: utf-8 -*-
"""
byceps.database
~~~~~~~~~~~~~~~
Database utilities.
:Copyright: 2006-2014 Jochen Kupperschmidt
"""
import uuid
from flask.ext.sqlalchemy import BaseQuery, SQLAlchemy
from sqlalchemy.dialects.postgresql import UUID
db = SQLAlchemy(session_options={'autoflush': False})
db.Uuid = UUID
... | Disable autoflushing as introduced with Flask-SQLAlchemy 2.0. | Disable autoflushing as introduced with Flask-SQLAlchemy 2.0.
| Python | bsd-3-clause | homeworkprod/byceps,m-ober/byceps,m-ober/byceps,m-ober/byceps,homeworkprod/byceps,homeworkprod/byceps |
a393881b4cf79a34101c7d4821ed0ccd78f117cb | zsh/zsh_concat.py | zsh/zsh_concat.py | #!/usr/bin/env python3
from os import scandir
from sys import argv
from platform import uname
from pathlib import Path
filename_template = """
# -------------------------------------------------------------------------------
# filename: {filename}
# -------------------------------------------------------------------... | #!/usr/bin/env python3
from os import scandir
from sys import argv
from platform import uname
from pathlib import Path
filename_template = """
# -------------------------------------------------------------------------------
# filename: {filename}
# -------------------------------------------------------------------... | Fix script to save output to script’s directory. | Fix script to save output to script’s directory.
| Python | mit | skk/dotfiles,skk/dotfiles |
ee32d3746a9fa788a06931063a8242f936b6ed18 | src/data/meta.py | src/data/meta.py | import collections
class Meta(collections.OrderedDict):
def __init__(self, *args, **kwargs):
self._smallest = float('inf')
self._largest = 0
self._ordered = True
super(Meta, self).__init__(*args, **kwargs)
def __setitem__(self, key, value, *args, **kwargs):
if key in self and self[key] == val... | import collections
import typing
class Meta(collections.OrderedDict, typing.MutableMapping[str, float]):
def __init__(self, *args, **kwargs) -> None:
self._smallest = float('inf')
self._largest = 0
self._ordered = True
super(Meta, self).__init__(*args, **kwargs)
def __setitem__(self, key: str, va... | Add typing information to Meta. | Add typing information to Meta.
| Python | mit | PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge |
30230cb6fcb29cd437d3ce71c3370da6d38cb622 | python/04-2.py | python/04-2.py | #!/usr/bin/env python
import hashlib
prefix = ''
number = 1
with open('../inputs/04.txt') as f:
prefix = f.readlines()
prefix = prefix[0].rstrip()
while True:
md5 = hashlib.md5()
md5.update('{0}{1}'.format(prefix, number))
if md5.hexdigest()[:6] == '000000':
#print md5.hexdigest()
print nu... | #!/usr/bin/env python
import hashlib
prefix = ''
number = 1
with open('../inputs/04.txt') as f:
prefix = f.readlines()
prefix = prefix[0].rstrip()
md5 = hashlib.md5()
md5.update(prefix)
while True:
m = md5.copy()
m.update(str(number))
if m.hexdigest()[:6] == '000000':
print number
break
... | Use md5.copy() to be more efficient. | Use md5.copy() to be more efficient.
The hash.copy() documentation says this is more efficient given a common
initial substring.
| Python | mit | opello/adventofcode |
1152e7a329ee20494a4856f7a83f5ab1e6c4390e | runtests.py | runtests.py | #!/usr/bin/env python
import os, sys
from django.conf import settings
import django
DEFAULT_SETTINGS = dict(
INSTALLED_APPS=(
'django.contrib.contenttypes',
'model_utils',
'model_utils.tests',
),
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlit... | #!/usr/bin/env python
import os, sys
from django.conf import settings
import django
DEFAULT_SETTINGS = dict(
INSTALLED_APPS=(
'model_utils',
'model_utils.tests',
),
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3"
}
},
)
de... | Remove contenttypes from INSTALLED_APPS for testing; no longer needed. | Remove contenttypes from INSTALLED_APPS for testing; no longer needed.
| Python | bsd-3-clause | nemesisdesign/django-model-utils,timmygee/django-model-utils,patrys/django-model-utils,yeago/django-model-utils,nemesisdesign/django-model-utils,timmygee/django-model-utils,patrys/django-model-utils,carljm/django-model-utils,yeago/django-model-utils,carljm/django-model-utils |
155b1e6b8d431f1169a3e71d08d93d76a3414c59 | turbustat/statistics/vca_vcs/slice_thickness.py | turbustat/statistics/vca_vcs/slice_thickness.py | # Licensed under an MIT open source license - see LICENSE
import numpy as np
def change_slice_thickness(cube, slice_thickness=1.0):
'''
Degrades the velocity resolution of a data cube. This is to avoid
shot noise by removing velocity fluctuations at small thicknesses.
Parameters
----------
... | # Licensed under an MIT open source license - see LICENSE
import numpy as np
from astropy import units as u
from spectral_cube import SpectralCube
from astropy.convolution import Gaussian1DKernel
def spectral_regrid_cube(cube, channel_width):
fwhm_factor = np.sqrt(8 * np.log(2))
current_resolution = np.dif... | Add a corrected spectral regridding function that smooths before interpolating to a new spectral axis | Add a corrected spectral regridding function that smooths before interpolating to a new spectral axis
| Python | mit | e-koch/TurbuStat,Astroua/TurbuStat |
e39925db2834a7491f9b8b505e1e1cf181840035 | clowder_server/views.py | clowder_server/views.py | from braces.views import CsrfExemptMixin
from django.core.mail import send_mail
from django.http import HttpResponse
from django.views.generic import TemplateView, View
from clowder_server.models import Alert, Ping
class APIView(CsrfExemptMixin, View):
def post(self, request):
name = request.POST.get('n... | from braces.views import CsrfExemptMixin
from django.core.mail import send_mail
from django.http import HttpResponse
from django.views.generic import TemplateView, View
from clowder_server.models import Alert, Ping
class APIView(CsrfExemptMixin, View):
def post(self, request):
name = request.POST.get('n... | Add test response to frequency | Add test response to frequency
| Python | agpl-3.0 | framewr/clowder_server,framewr/clowder_server,keithhackbarth/clowder_server,keithhackbarth/clowder_server,framewr/clowder_server,keithhackbarth/clowder_server,keithhackbarth/clowder_server,framewr/clowder_server |
855434523df57183c31ed9b10e7458232b79046a | aclarknet/aclarknet/aclarknet/models.py | aclarknet/aclarknet/aclarknet/models.py | from django.db import models
class Client(models.Model):
client_name = models.CharField(max_length=60)
class Service(models.Model):
name = models.CharField(max_length=60)
class TeamMember(models.Model):
name = models.CharField(max_length=60)
| from django.db import models
class Client(models.Model):
client_name = models.CharField(max_length=60)
def __unicode__(self):
return self.client_name
class Service(models.Model):
name = models.CharField(max_length=60)
def __unicode__(self):
return self.name
class TeamMember(model... | Fix object name in Django Admin | Fix object name in Django Admin
http://stackoverflow.com/questions/9336463/django-xxxxxx-object-display-customization-in-admin-action-sidebar
| Python | mit | ACLARKNET/aclarknet-django,ACLARKNET/aclarknet-django |
6b06ff67097d0a2ef639df4a3d9baf4f6677b5fd | lmj/sim/__init__.py | lmj/sim/__init__.py | # Copyright (c) 2013 Leif Johnson <leif@leifjohnson.net>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify,... | # Copyright (c) 2013 Leif Johnson <leif@leifjohnson.net>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify,... | Update package imports for module name change. | Update package imports for module name change.
| Python | mit | EmbodiedCognition/pagoda,EmbodiedCognition/pagoda |
fd907ac07d5d20dcf8964dbef324bfa2da93ed44 | armstrong/core/arm_sections/managers.py | armstrong/core/arm_sections/managers.py | from django.db import models
class SectionSlugManager(models.Manager):
def __init__(self, section_field="primary_section", slug_field="slug",
*args, **kwargs):
super(SectionSlugManager, self).__init__(*args, **kwargs)
self.section_field = section_field
self.slug_field = slug_fi... | from django.db import models
class SectionSlugManager(models.Manager):
def __init__(self, section_field="primary_section", slug_field="slug",
*args, **kwargs):
super(SectionSlugManager, self).__init__(*args, **kwargs)
self.section_field = section_field
self.slug_field = slug_fi... | Handle situation where only a root full_slug is passed. | Handle situation where only a root full_slug is passed.
i.e. "section/" would break the rsplit(). If there is no slug, we can safely raise a DoesNotExist.
| Python | apache-2.0 | armstrong/armstrong.core.arm_sections,texastribune/armstrong.core.tt_sections,armstrong/armstrong.core.arm_sections,texastribune/armstrong.core.tt_sections,texastribune/armstrong.core.tt_sections |
20b4c81137d4abdd4db0dc80ae9a2e38cca4e8eb | examples/hello_twisted.py | examples/hello_twisted.py | """A simple example of Pyglet/Twisted integration. A Pyglet window
is displayed, and both Pyglet and Twisted are making scheduled calls
and regular intervals. Interacting with the window doesn't interfere
with either calls.
"""
import pyglet
import pygletreactor
pygletreactor.install() # <- this must come before...
fr... | """A simple example of Pyglet/Twisted integration. A Pyglet window
is displayed, and both Pyglet and Twisted are making scheduled calls
and regular intervals. Interacting with the window doesn't interfere
with either calls.
"""
import pyglet
import pygletreactor
pygletreactor.install() # <- this must come before...
fr... | Call to stop the reactor now uses the correct convention when closing from a thread other than the main reactor thread. | Call to stop the reactor now uses the correct convention when closing from a thread other than the main reactor thread.
Fixes Issue 5.
git-svn-id: a0251d2471cc357dbf602d275638891bc89eba80@9 4515f058-c067-11dd-9cb5-179210ed59e1
| Python | mit | padraigkitterick/pyglet-twisted |
7778b98e1a0d0ac7b9c14e4536e62de4db7debc9 | tests/integration/suite/test_global_role_bindings.py | tests/integration/suite/test_global_role_bindings.py | from .common import random_str
def test_cannot_update_global_role(admin_mc, remove_resource):
"""Asserts that globalRoleId field cannot be changed"""
admin_client = admin_mc.client
grb = admin_client.create_global_role_binding(
name="gr-" + random_str(),
userId=admin_mc.user.id,
g... | import pytest
from rancher import ApiError
from .common import random_str
def test_cannot_update_global_role(admin_mc, remove_resource):
"""Asserts that globalRoleId field cannot be changed"""
admin_client = admin_mc.client
grb = admin_client.create_global_role_binding(
name="gr-" + random_str()... | Add test for GRB validator | Add test for GRB validator
| Python | apache-2.0 | cjellick/rancher,rancherio/rancher,cjellick/rancher,rancher/rancher,cjellick/rancher,rancherio/rancher,rancher/rancher,rancher/rancher,rancher/rancher |
619253a51d0b79f170065e6023530937d7111102 | awscfncli/config/config.py | awscfncli/config/config.py | # -*- encoding: utf-8 -*-
import logging
import yaml
from collections import namedtuple
log = logging.getLogger(__name__)
def load(filename):
with open(filename) as fp:
config = yaml.safe_load(fp)
return CfnCliConfig.load(config)
class CfnCliConfig(namedtuple('CfnCliConfig', 'version blueprints e... | # -*- encoding: utf-8 -*-
import logging
import yaml
from collections import namedtuple
log = logging.getLogger(__name__)
def load(filename):
with open(filename) as fp:
config = yaml.safe_load(fp)
return CfnCliConfig.load(config)
class CfnCliConfig(namedtuple('CfnCliConfig', 'version blueprints e... | Use static method instead of classmethod | Use static method instead of classmethod
| Python | mit | Kotaimen/awscfncli,Kotaimen/awscfncli |
1285e4bcbdbcf3c28eced497c8585892f3ae1239 | django_summernote/admin.py | django_summernote/admin.py | from django.contrib import admin
from django.db import models
from django_summernote.widgets import SummernoteWidget, SummernoteInplaceWidget
from django_summernote.models import Attachment
from django_summernote.settings import summernote_config, get_attachment_model
__widget__ = SummernoteWidget if summernote_config... | from django.contrib import admin
from django.db import models
from django_summernote.widgets import SummernoteWidget, SummernoteInplaceWidget
from django_summernote.settings import summernote_config, get_attachment_model
__widget__ = SummernoteWidget if summernote_config['iframe'] \
else SummernoteInplaceWidget
... | Remove a non-used module importing | Remove a non-used module importing
| Python | mit | lqez/django-summernote,summernote/django-summernote,lqez/django-summernote,lqez/django-summernote,summernote/django-summernote,summernote/django-summernote |
7e638636606a4f7f7b5b6a09ec508746c8ca8f32 | 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','Ja existeix una factura')])
imp_del_ids += imp_obj.search([('state','=','erroni')... | #!/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','=','Aquest fitxer XML ja s\'ha processat en els següents IDs')])
imp_del_ids = imp_obj.s... | Fix Cannot delete invoice(s) that are already opened or paid | Fix Cannot delete invoice(s) that are already opened or paid
| Python | agpl-3.0 | Som-Energia/invoice-janitor |
8cee7d5478cde2b188da4dc93f844073be729a48 | src/gerobak/apps/profile/models.py | src/gerobak/apps/profile/models.py | from django.db import models
from django.contrib.auth.models import User
from django.conf import settings
from django.db.models.signals import post_save
from gerobak import utils
class Profile(models.Model):
pid = models.CharField(max_length=8)
user = models.ForeignKey(User)
added = models.DateTimeField(... | from django.db import models
from django.contrib.auth.models import User
from django.conf import settings
from django.db.models.signals import post_save
from gerobak import utils
class Profile(models.Model):
pid = models.CharField(max_length=8)
user = models.ForeignKey(User)
added = models.DateTimeField(... | Store task_id for update, install, and upgrade processes in the database. | Store task_id for update, install, and upgrade processes in the database.
| Python | agpl-3.0 | fajran/gerobak,fajran/gerobak |
6021f5af785e5234b9f83ea4ac740571b9308ae4 | Communication/mavtester.py | Communication/mavtester.py | #!/usr/bin/env python
'''
test mavlink messages
Do not forget to precise the baudrate (default 115200)
'''
import sys, struct, time, os
from curses import ascii
from pymavlink import mavutil
from argparse import ArgumentParser
parser = ArgumentParser(description=__doc__)
parser.add_argument("--baudrate", type=int,... | #!/usr/bin/env python
'''
test mavlink messages
Do not forget to precise the baudrate (default 115200)
'''
import sys, struct, time, os
from curses import ascii
from pymavlink import mavutil
from argparse import ArgumentParser
parser = ArgumentParser(description=__doc__)
parser.add_argument("--baudrate", type=int,... | Add reception of GPS_RAW_INT messages as demo | Add reception of GPS_RAW_INT messages as demo
| Python | mit | baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite |
3b8811af898ec8cbaa93c69c6b702b92756713dc | vumi/persist/tests/test_riak_manager.py | vumi/persist/tests/test_riak_manager.py | """Tests for vumi.persist.riak_manager."""
from twisted.trial.unittest import TestCase
from vumi.persist.riak_manager import RiakManager
class TestRiakManager(TestCase):
pass
| """Tests for vumi.persist.riak_manager."""
from itertools import count
from twisted.trial.unittest import TestCase
from twisted.internet.defer import returnValue
from vumi.persist.riak_manager import RiakManager, flatten_generator
from vumi.persist.tests.test_txriak_manager import CommonRiakManagerTests
class Test... | Add tests for (nottx)riak manager. | Add tests for (nottx)riak manager.
| Python | bsd-3-clause | vishwaprakashmishra/xmatrix,harrissoerja/vumi,TouK/vumi,vishwaprakashmishra/xmatrix,vishwaprakashmishra/xmatrix,TouK/vumi,TouK/vumi,harrissoerja/vumi,harrissoerja/vumi |
c4ea39ab8666a2872b25c9b8619f1b0feb823d9f | server.py | server.py | import os
from app import create_app, db
from flask.ext.script import Manager, Shell, Server
from flask.ext.migrate import Migrate, MigrateCommand
app = create_app(os.getenv('FLASK_CONFIG') or 'default')
manager = Manager(app)
manager.add_command("runserver", Server(host="0.0.0.0"))
migrate = Migrate(app, db)
def ma... | import os
from app import create_app, db
from flask.ext.script import Manager, Shell, Server
from flask.ext.migrate import Migrate, MigrateCommand
app = create_app(os.getenv('FLASK_CONFIG') or 'default')
manager = Manager(app)
manager.add_command("runserver", Server(host="0.0.0.0"))
migrate = Migrate(app, db)
def ma... | Change system return exit on failed tests | Change system return exit on failed tests
| Python | mit | luisfcofv/Superhero |
b80b781b8f446b8149b948a6ec4aeff63fd728ce | Orange/widgets/utils/plot/__init__.py | Orange/widgets/utils/plot/__init__.py | """
*************************
Plot classes and tools for use in Orange widgets
*************************
The main class of this module is :obj:`.OWPlot`, from which all plots
in visualization widgets should inherit.
This module also contains plot elements, which are normally used by the :obj:`.OWPlot`,
but can al... | """
*************************
Plot classes and tools for use in Orange widgets
*************************
The main class of this module is :obj:`.OWPlot`, from which all plots
in visualization widgets should inherit.
This module also contains plot elements, which are normally used by the :obj:`.OWPlot`,
but can al... | Handle PyQt 5.3 raising RuntimeError on incompatible orangeqt import | Handle PyQt 5.3 raising RuntimeError on incompatible orangeqt import
| Python | bsd-2-clause | cheral/orange3,cheral/orange3,cheral/orange3,cheral/orange3,cheral/orange3,cheral/orange3 |
59651470489a4479db6d9a79de3aacee6b9d7cd8 | travis/wait-until-cluster-initialised.py | travis/wait-until-cluster-initialised.py | #!/usr/bin/env python3
import json
import sys
import time
from urllib.request import urlopen
STATS_URL = "http://localhost:18001/stats"
MAXIMUM_TIME_SECONDS = 2 * 60
SLEEPING_INTERVAL_SECONDS = 1
STATUS_CODE_OK = 200
def is_initialised():
try:
response = urlopen(STATS_URL)
if (response.getcode()... | #!/usr/bin/env python3
import json
import sys
import time
from urllib.request import urlopen
STATS_URL = "http://localhost:18001/stats"
MAXIMUM_TIME_SECONDS = 2 * 60
SLEEPING_INTERVAL_SECONDS = 1
STATUS_CODE_OK = 200
def is_initialised():
try:
response = urlopen(STATS_URL)
if (response.getcode()... | Remove unused left over parameter | Remove unused left over parameter
| Python | apache-2.0 | codiply/barrio,codiply/barrio |
d81dbd7b25cd44f730e979efe03eb6e5e1d87f1b | admin/commandRunner.py | admin/commandRunner.py | import configparser
import sys
import os
parser = configparser.ConfigParser()
parser.read("../halite.ini")
WORKERS = dict(parser.items("workerIPs"))
command = sys.argv[1]
print(command)
for name in WORKERS:
print("########"+name+"########")
print(WORKERS[name])
os.system("ssh root@"+WORKERS[name]+" '"+com... | import pymysql
import configparser
import sys
import os
import os.path
parser = configparser.ConfigParser()
parser.read("../halite.ini")
DB_CONFIG = parser["database"]
keyPath = os.path.join("../", parser["aws"]["keyfilepath"])
db = pymysql.connect(host=DB_CONFIG["hostname"], user=DB_CONFIG['username'], passwd=DB_CO... | Switch command runner to using db | Switch command runner to using db
| Python | mit | HaliteChallenge/Halite,HaliteChallenge/Halite,yangle/HaliteIO,HaliteChallenge/Halite,lanyudhy/Halite-II,lanyudhy/Halite-II,yangle/HaliteIO,yangle/HaliteIO,lanyudhy/Halite-II,yangle/HaliteIO,yangle/HaliteIO,HaliteChallenge/Halite,HaliteChallenge/Halite-II,lanyudhy/Halite-II,HaliteChallenge/Halite,lanyudhy/Halite-II,lany... |
cba8bd7d3440cc643823e93036bc3b9ac938a412 | pinboard_linkrot.py | pinboard_linkrot.py | #!/usr/bin/env python
from __future__ import division
import requests
import json
import sys
from requests.exceptions import SSLError, InvalidSchema, ConnectionError
def get_link_status_code(link):
headers = {'User-agent':'Mozilla/5.0'}
try:
r = requests.get(link, headers = headers)
return r.s... | #!/usr/bin/env python
from __future__ import division
import requests
import json
import sys
from requests.exceptions import SSLError, InvalidSchema, ConnectionError
def get_link_status_code(link):
headers = {'User-agent':'Mozilla/5.0'}
try:
r = requests.head(link, headers=headers, allow_redirects=Tru... | Switch to head requests rather than get requests. | Switch to head requests rather than get requests.
| Python | mit | edgauthier/pinboard_linkrot |
91f107ef2ebdaf7ff210b9f36e2c810441f389e7 | services/rdio.py | services/rdio.py | from werkzeug.urls import url_decode
from oauthlib.oauth1.rfc5849 import SIGNATURE_TYPE_BODY
import foauth.providers
class Rdio(foauth.providers.OAuth1):
# General info about the provider
provider_url = 'http://www.rdio.com/'
docs_url = 'http://developer.rdio.com/docs/REST/'
category = 'Music'
#... | from werkzeug.urls import url_decode
import foauth.providers
class Rdio(foauth.providers.OAuth1):
# General info about the provider
provider_url = 'http://www.rdio.com/'
docs_url = 'http://developer.rdio.com/docs/REST/'
category = 'Music'
# URLs to interact with the API
request_token_url = '... | Allow Rdio to use default signature handling | Allow Rdio to use default signature handling
| Python | bsd-3-clause | foauth/oauth-proxy,foauth/foauth.org,foauth/foauth.org,foauth/foauth.org |
7959c38d82090db6a66c7d81a4adba089c9a884f | brains/orders/views.py | brains/orders/views.py | import math
from django.shortcuts import render
from django.template import RequestContext
from django.http import HttpResponseRedirect
from orders.models import Order
def index(request, x, y):
if request.META['HTTP_REFERER'] not in ('http://www.urbandead.com/map.cgi', 'http://urbandead.com/map.cgi'):
ret... | import math
from django.shortcuts import render
from django.template import RequestContext
from django.http import HttpResponseRedirect
from orders.models import Order
def index(request, x, y):
if request.META.get('HTTP_REFERER', None) not in ('http://www.urbandead.com/map.cgi', 'http://urbandead.com/map.cgi'):
... | Test things first you big dummy | Test things first you big dummy
| Python | bsd-3-clause | crisisking/udbraaains,crisisking/udbraaains,crisisking/udbraaains,crisisking/udbraaains |
9a7c84cab0931f2998af990200c4412f23cc2034 | scripts/run_unit_test.py | scripts/run_unit_test.py | #!/usr/bin/env python
import serial
import os
# Make and flash the unit test
FILE_LOCATION = os.path.dirname(os.path.abspath(__file__))
os.system("cd " + FILE_LOCATION + " ../")
print os.system("make flash_unit_test")
# Ask the user to reset the board
raw_input("\nPlease press the phsyical reset button on the STM32... | #!/usr/bin/env python
import serial
import os
# Make and flash the unit test
FILE_LOCATION = os.path.dirname(os.path.abspath(__file__))
os.chdir(FILE_LOCATION + "/../")
print os.system("make flash_unit_test")
# Ask the user to reset the board
raw_input("\nPlease press the phsyical reset button on the STM32F4Discove... | Add ability to run unit test script from anywhere | UNIT_TEST: Add ability to run unit test script from anywhere
| Python | mit | fnivek/Pop-a-Gator,fnivek/Pop-a-Gator,fnivek/Pop-a-Gator |
e2c3c9f50f3bdb537ef863d7cff80d4fd5e27911 | test/test_api.py | test/test_api.py | import unittest
import sys
import appdirs
if sys.version_info[0] < 3:
STRING_TYPE = basestring
else:
STRING_TYPE = str
class Test_AppDir(unittest.TestCase):
def test_metadata(self):
self.assertTrue(hasattr(appdirs, "__version__"))
self.assertTrue(hasattr(appdirs, "__version_info__"))
... | import sys
import appdirs
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
if sys.version_info[0] < 3:
STRING_TYPE = basestring
else:
STRING_TYPE = str
class Test_AppDir(unittest.TestCase):
def test_metadata(self):
self.assertTrue(hasattr(appdirs, "__versi... | Use unittest2 for Python < 2.7. | Use unittest2 for Python < 2.7.
| Python | mit | platformdirs/platformdirs |
53fa37b1e8a97c214a0a3c1f95be53dbe4d3d442 | comics/comics/wumovg.py | comics/comics/wumovg.py | from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = 'Wulffmorgenthaler (vg.no)'
language = 'no'
url = 'http://heltnormalt.no/wumo'
rights = 'Mikael Wulff & Anders Morgenthaler'
class Crawler(CrawlerBa... | from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = 'Wumo (vg.no)'
language = 'no'
url = 'http://heltnormalt.no/wumo'
rights = 'Mikael Wulff & Anders Morgenthaler'
class Crawler(CrawlerBase):
hist... | Update title of 'Wumo' crawlers, part two | Update title of 'Wumo' crawlers, part two
| Python | agpl-3.0 | jodal/comics,datagutten/comics,jodal/comics,jodal/comics,datagutten/comics,datagutten/comics,jodal/comics,datagutten/comics |
534066b1228bb0070c1d62445155afa696a37921 | contrail_provisioning/config/templates/contrail_plugin_ini.py | contrail_provisioning/config/templates/contrail_plugin_ini.py | import string
template = string.Template("""
[APISERVER]
api_server_ip = $__contrail_api_server_ip__
api_server_port = $__contrail_api_server_port__
multi_tenancy = $__contrail_multi_tenancy__
#use_ssl = False
#insecure = False
#certfile=$__contrail_api_server_cert_file__
#keyfile=$__contrail_api_server_key_file__
#ca... | import string
template = string.Template("""
[APISERVER]
api_server_ip = $__contrail_api_server_ip__
api_server_port = $__contrail_api_server_port__
multi_tenancy = $__contrail_multi_tenancy__
#use_ssl = False
#insecure = False
#certfile=$__contrail_api_server_cert_file__
#keyfile=$__contrail_api_server_key_file__
#ca... | Enable service-interface and vf-binding extensions by default in contrail based provisioning. | Enable service-interface and vf-binding extensions by default in
contrail based provisioning.
Change-Id: I5916f41cdf12ad54e74c0f76de244ed60f57aea5
Partial-Bug: 1556336
| Python | apache-2.0 | Juniper/contrail-provisioning,Juniper/contrail-provisioning |
eb987c4ca71ec53db46c0a8afa4265f70671330d | geotrek/settings/env_tests.py | geotrek/settings/env_tests.py | #
# Django Tests
# ..........................
TEST = True
CELERY_ALWAYS_EAGER = True
TEST_EXCLUDE = ('django',)
INSTALLED_APPS += (
'geotrek.diving',
'geotrek.sensitivity',
'geotrek.outdoor',
)
LOGGING['handlers']['console']['level'] = 'CRITICAL'
LANGUAGE_CODE = 'en'
MODELTRANSLATION_DEFAULT_LANGUAGE... | #
# Django Tests
# ..........................
TEST = True
CELERY_ALWAYS_EAGER = True
TEST_EXCLUDE = ('django',)
INSTALLED_APPS += (
'geotrek.diving',
'geotrek.sensitivity',
'geotrek.outdoor',
'drf_yasg',
)
LOGGING['handlers']['console']['level'] = 'CRITICAL'
LANGUAGE_CODE = 'en'
MODELTRANSLATION_... | Enable drf_yasg in test settings | Enable drf_yasg in test settings
| Python | bsd-2-clause | GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,makinacorpus/Geotrek |
456de4b1184780b9179ee9e6572a3f62cf22550a | tests/test_tools/simple_project.py | tests/test_tools/simple_project.py | project_1_yaml = {
'common': {
'sources': ['sources/main.cpp'],
'includes': ['includes/header1.h'],
'target': ['mbed-lpc1768']
}
}
projects_1_yaml = {
'projects': {
'project_1' : ['test_workspace/project_1.yaml']
},
}
| project_1_yaml = {
'common': {
'sources': ['sources/main.cpp'],
'includes': ['includes/header1.h'],
'target': ['mbed-lpc1768'],
'linker_file': ['linker_script'],
}
}
projects_1_yaml = {
'projects': {
'project_1' : ['test_workspace/project_1.yaml']
},
}
| Test - add linker script for tools project | Test - add linker script for tools project
| Python | apache-2.0 | molejar/project_generator,hwfwgrp/project_generator,0xc0170/project_generator,sarahmarshy/project_generator,ohagendorf/project_generator,project-generator/project_generator |
47aeeaad68ea0c9246ec68b7a49f385a4b7fe9cf | socketio/policyserver.py | socketio/policyserver.py | from gevent.server import StreamServer
__all__ = ['FlashPolicyServer']
class FlashPolicyServer(StreamServer):
policy = """<?xml version="1.0"?><!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy><allow-access-from domain="*" to-ports="*"/></cros... | from gevent.server import StreamServer
__all__ = ['FlashPolicyServer']
class FlashPolicyServer(StreamServer):
policy = """<?xml version="1.0"?><!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy><allow-access-from domain="*" to-ports="*"/></cros... | Fix to make sure we dont get errors in gevent socket write call when we are writing the policy file back | Fix to make sure we dont get errors in gevent socket write call when we are writing the policy file back
Conflicts:
socketio/policyserver.py
| Python | bsd-3-clause | abourget/gevent-socketio,arnuschky/gevent-socketio,bobvandevijver/gevent-socketio,Eugeny/gevent-socketio,hzruandd/gevent-socketio,gutomaia/gevent-socketio,gutomaia/gevent-socketio,yacneyac/gevent-socketio,smurfix/gevent-socketio,gutomaia/gevent-socketio,smurfix/gevent-socketio,Eugeny/gevent-socketio,kazmiruk/gevent-soc... |
fc04d8f2629e5fef10cf62749e7c91e6b7d2d557 | cms/djangoapps/contentstore/views/session_kv_store.py | cms/djangoapps/contentstore/views/session_kv_store.py | """
An :class:`~xblock.runtime.KeyValueStore` that stores data in the django session
"""
from __future__ import absolute_import
from xblock.runtime import KeyValueStore
class SessionKeyValueStore(KeyValueStore):
def __init__(self, request):
self._session = request.session
def get(self, key):
... | """
An :class:`~xblock.runtime.KeyValueStore` that stores data in the django session
"""
from __future__ import absolute_import
from xblock.runtime import KeyValueStore
def stringify(key):
return repr(tuple(key))
class SessionKeyValueStore(KeyValueStore):
def __init__(self, request):
self._session ... | Use strings instead of tuples as keys in SessionKeyValueStore | Use strings instead of tuples as keys in SessionKeyValueStore
Some Django packages expect only strings as keys in the user session,
and it is also a recommended practice in the Django manual.
| Python | agpl-3.0 | ESOedX/edx-platform,B-MOOC/edx-platform,jswope00/griffinx,openfun/edx-platform,MakeHer/edx-platform,benpatterson/edx-platform,stvstnfrd/edx-platform,AkA84/edx-platform,Softmotions/edx-platform,IONISx/edx-platform,kmoocdev2/edx-platform,nanolearningllc/edx-platform-cypress,unicri/edx-platform,romain-li/edx-platform,xinj... |
5eb3f2c61c2b61e1bad7faa006e5503bd9a20edf | uni_form/util.py | uni_form/util.py | from django import forms
from django.forms.widgets import Input
class SubmitButtonWidget(Input):
"""
A widget that handles a submit button.
"""
input_type = 'submit'
def render(self, name, value, attrs=None):
return super(SubmitButtonWidget, self).render(name,
self.attrs['value... | class BaseInput(object):
"""
An base Input class to reduce the amount of code in the Input classes.
"""
def __init__(self,name,value):
self.name = name
self.value = value
class Toggle(object):
"""
A container for holder toggled items such as fields and butt... | Revert "Made BaseInput inherit from forms.Field so inputs can be used in layouts. Added a SubmitButtonWidget." | Revert "Made BaseInput inherit from forms.Field so inputs can be used in layouts. Added a SubmitButtonWidget."
This reverts commit aa571b2e1fd177491895cc263b192467431b90c2.
| Python | mit | HungryCloud/django-crispy-forms,spectras/django-crispy-forms,iris-edu-int/django-crispy-forms,scuml/django-crispy-forms,ngenovictor/django-crispy-forms,CashStar/django-uni-form,PetrDlouhy/django-crispy-forms,RamezIssac/django-crispy-forms,jcomeauictx/django-crispy-forms,tarunlnmiit/django-crispy-forms,CashStar/django-u... |
bfe884723d06252648cb95fdfc0f9dd0f804795f | proxyswitch/driver.py | proxyswitch/driver.py | from flask import Flask
class Driver:
'''
Holds the driver state so the flasked script can change behaviour based
on what the user injects via HTTP
'''
name = 'nobody'
def start(self, name):
self.name = name
return self.name
def stop(self):
self.name = 'nob... | from flask import Flask
class Driver:
'''
Holds the driver state so the flasked script can change behaviour based
on what the user injects via HTTP
'''
name = 'nobody'
def start(self, name):
self.name = name
return self.name
def stop(self):
self.name = 'nob... | Change Flask interface to 0.0.0.0 | Change Flask interface to 0.0.0.0
| Python | mit | ustwo/mastermind,ustwo/mastermind |
fd054790ce32c3918f6edbe824540c09d7efce59 | stagehand/providers/__init__.py | stagehand/providers/__init__.py | import asyncio
from ..utils import load_plugins, invoke_plugins
from .base import ProviderError
plugins, broken_plugins = load_plugins('providers', ['thetvdb', 'tvrage'])
@asyncio.coroutine
def start(manager):
"""
Called when the manager is starting.
"""
yield from invoke_plugins(plugins, 'start', ma... | import asyncio
from ..utils import load_plugins, invoke_plugins
from .base import ProviderError
plugins, broken_plugins = load_plugins('providers', ['thetvdb'])
@asyncio.coroutine
def start(manager):
"""
Called when the manager is starting.
"""
yield from invoke_plugins(plugins, 'start', manager)
... | Remove tvrage from active providers as site is shut down | Remove tvrage from active providers as site is shut down
| Python | mit | jtackaberry/stagehand,jtackaberry/stagehand |
22b5f7ecc6057252ec77d037522b5783c5f86c1f | mcmodfixes.py | mcmodfixes.py | #!/usr/bin/python
# Fixes and mod-specific data for various mods' mcmod.info files
DEP_BLACKLIST = set((
"mod_MinecraftForge", # we always have Forge
"Forge", # typo for mod_MinecraftForge
"Industrialcraft", # typo for IC2
"GUI_Api", # typo for GuiAPI and not needed on server
))
DEP_ADDITIONS... | #!/usr/bin/python
# Fixes and mod-specific data for various mods' mcmod.info files
DEP_BLACKLIST = set((
"mod_MinecraftForge", # we always have Forge
"Forge", # typo for mod_MinecraftForge
"Industrialcraft", # typo for IC2
"GUI_Api", # typo for GuiAPI and not needed on server
"EurysCore", # rep... | Add mcmod.info fix for SlopesAndCorners SlimevoidLib dependency | Add mcmod.info fix for SlopesAndCorners SlimevoidLib dependency
| Python | bsd-3-clause | agaricusb/ModAnalyzer,agaricusb/ModAnalyzer |
60a90722fbd5fc047fee5e9f7377f03e11f6a654 | examples/root_finding/test_funcs.py | examples/root_finding/test_funcs.py | import math
def f1(x):
"""
Test function 1
"""
return x*x*x - math.pi*x + math.e/100
| import numpy as npy
def f1(x):
"""
Test function 1
"""
return x*x*x - npy.pi*x + npy.e/100
def f2(x):
"""
Test function 2
"""
return -1.13 + npy.tanh(x-2) + 4*npy.exp(-x)*npy.sin((1/8.)*x**3) \
*x + .1*npy.exp((1/35.)*x) | Use numpy instead of math to allow vectorization | Use numpy instead of math to allow vectorization
| Python | bsd-3-clause | robclewley/fovea,akuefler/fovea |
cd030a1ed2c3c7f0bf7d9a5d86f9cc81f802fcba | corehq/mobile_flags.py | corehq/mobile_flags.py | from collections import namedtuple
TAG_DIMAGI_ONLY = 'Dimagi Only'
MobileFlag = namedtuple('MobileFlag', 'slug label tags')
SUPERUSER = MobileFlag(
'superuser',
'Enable superuser-only features',
tags=(TAG_DIMAGI_ONLY,)
)
| from collections import namedtuple
MobileFlag = namedtuple('MobileFlag', 'slug label')
SUPERUSER = MobileFlag(
'superuser',
'Enable superuser-only features'
)
| Add tags for mobile flags when you need them | Add tags for mobile flags when you need them
| Python | bsd-3-clause | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq |
54bb12bdeec33e98451451837dce90665413bd67 | mgsv_names.py | mgsv_names.py | from __future__ import unicode_literals, print_function
import sqlite3, os, random
_select_random = 'select {0} from {1} limit 1 offset abs(random()) % (select count({0}) from {1});'
_select_uncommon = 'select value from uncommons where key=?;'
def generate_name():
conn = sqlite3.connect(os.path.join(os.path.dirn... | from __future__ import unicode_literals, print_function
import sqlite3, os, random
_select_random = 'select {0} from {1} limit 1 offset abs(random()) % (select count({0}) from {1});'
_select_uncommon = 'select value from uncommons where key=?;'
def generate_name():
conn = sqlite3.connect(os.path.join(os.path.dirn... | Print one name at a time. | Print one name at a time.
| Python | unlicense | rotated8/mgsv_names |
0298e8b6abcd7cea99df4cb235c73a49e340521a | tests/query_test/test_decimal_queries.py | tests/query_test/test_decimal_queries.py | #!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
# Targeted tests for decimal type.
#
import logging
import pytest
from copy import copy
from tests.common.test_vector import *
from tests.common.impala_test_suite import *
class TestDecimalQueries(ImpalaTestSuite):
BATCH_SIZES = [0, 1]
... | #!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
# Targeted tests for decimal type.
#
import logging
import pytest
from copy import copy
from tests.common.test_vector import *
from tests.common.impala_test_suite import *
class TestDecimalQueries(ImpalaTestSuite):
BATCH_SIZES = [0, 1]
... | Fix the ASAN build by xfailing test_decimal when ASAN_OPTIONS is set. | Fix the ASAN build by xfailing test_decimal when ASAN_OPTIONS is set.
Adding decimal columns crashes an ASAN built impalad. This change skips the test.
Change-Id: Ic94055a3f0d00f89354177de18bc27d2f4cecec2
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2532
Reviewed-by: Ishaan Joshi <d1d1e60202ec9f2503deb1b724986485... | Python | apache-2.0 | cloudera/Impala,michaelhkw/incubator-impala,michaelhkw/incubator-impala,michaelhkw/incubator-impala,michaelhkw/incubator-impala,michaelhkw/incubator-impala,cloudera/Impala,cloudera/Impala,cloudera/Impala,michaelhkw/incubator-impala,cloudera/Impala,cloudera/Impala,michaelhkw/incubator-impala,cloudera/Impala |
5977eb82f2614efe8cde843913db62a93c7978f5 | navigation_extensions.py | navigation_extensions.py | from django.utils.text import capfirst
from django.utils.translation import ugettext_lazy as _
from feincms.module.page.extensions.navigation import NavigationExtension, PagePretender
class ZivinetzNavigationExtension(NavigationExtension):
name = _('Zivinetz navigation extension')
def children(self, page, *... | from django.utils.text import capfirst
from django.utils.translation import ugettext_lazy as _
from feincms.module.page.extensions.navigation import NavigationExtension, PagePretender
class ZivinetzNavigationExtension(NavigationExtension):
name = _('Zivinetz navigation extension')
def children(self, page, *... | Remove job references from navigation | Remove job references from navigation
| Python | mit | matthiask/zivinetz,matthiask/zivinetz,matthiask/zivinetz,matthiask/zivinetz |
593bab981f36f7af52ae55914c18e368e8c1a94f | examples/app-on-ws-init.py | examples/app-on-ws-init.py | #!/usr/bin/env python3
# https://faq.i3wm.org/question/3699/how-can-i-open-an-application-when-i-open-a-certain-workspace-for-the-first-time/
from argparse import ArgumentParser
import i3ipc
i3 = i3ipc.Connection()
parser = ArgumentParser(description='Open an application on a given workspace when it is initialized'... | #!/usr/bin/env python3
# https://faq.i3wm.org/question/3699/how-can-i-open-an-application-when-i-open-a-certain-workspace-for-the-first-time/
from argparse import ArgumentParser
import i3ipc
i3 = i3ipc.Connection()
parser = ArgumentParser(description="""Open the given application each time the
given workspace i... | Make the 2 mandatory parameters mandatory. Make the help message a bit clearer and provides an example. | Make the 2 mandatory parameters mandatory.
Make the help message a bit clearer and provides an example.
| Python | bsd-3-clause | xenomachina/i3ipc-python,nicoe/i3ipc-python,acrisci/i3ipc-python,chrsclmn/i3ipc-python |
23f23884cb55899a77b08dfa8c1649a195815f8c | examples/semaphore_wait.py | examples/semaphore_wait.py | from locust import HttpLocust, TaskSet, task, events, between
from gevent.lock import Semaphore
all_locusts_spawned = Semaphore()
all_locusts_spawned.acquire()
def on_hatch_complete(**kw):
all_locusts_spawned.release()
events.hatch_complete += on_hatch_complete
class UserTasks(TaskSet):
def on_start(self):... | from locust import HttpLocust, TaskSet, task, events, between
from gevent.lock import Semaphore
all_locusts_spawned = Semaphore()
all_locusts_spawned.acquire()
@events.init.add_listener
def _(environment, **kw):
@environment.events.hatch_complete.add_listener
def on_hatch_complete(**kw):
all_locusts_... | Update example to use new event API | Update example to use new event API | Python | mit | locustio/locust,locustio/locust,locustio/locust,mbeacom/locust,mbeacom/locust,mbeacom/locust,locustio/locust,mbeacom/locust |
4ebdc10add211cb238002fcc79a7cf8409d99825 | djoser/social/views.py | djoser/social/views.py | from rest_framework import generics, permissions, status
from rest_framework.response import Response
from social_django.utils import load_backend, load_strategy
from djoser.conf import settings
from djoser.social.serializers import ProviderAuthSerializer
class ProviderAuthView(generics.CreateAPIView):
permissio... | from rest_framework import generics, permissions, status
from rest_framework.response import Response
from social_django.utils import load_backend, load_strategy
from djoser.conf import settings
from djoser.social.serializers import ProviderAuthSerializer
class ProviderAuthView(generics.CreateAPIView):
permissio... | Fix for Friendly tips when Missing SOCIAL_AUTH_ALLOWED_REDIRECT_URIS | Fix for Friendly tips when Missing SOCIAL_AUTH_ALLOWED_REDIRECT_URIS
i forget add SOCIAL_AUTH_ALLOWED_REDIRECT_URIS to my config
it return 400 error, i don't know why , i pay more time find the issues
so i add Friendly tips
-- sorry , my english is not well
and thank you all | Python | mit | sunscrapers/djoser,sunscrapers/djoser,sunscrapers/djoser |
745565adaff36e95676c427157acb52112e0a3cc | sitenco/config/vcs.py | sitenco/config/vcs.py | """
Version control management tools.
"""
import abc
import brigit
from docutils import nodes
from docutils.parsers.rst import directives
from .tool import Tool, Directive
class VCS(Tool):
"""Abstract class for VCS tools."""
__metaclass__ = abc.ABCMeta
def __init__(self, path, branch, url=None):
... | """
Version control management tools.
"""
import abc
import brigit
from docutils import nodes
from docutils.parsers.rst import directives
from .tool import Tool, Directive
class VCS(Tool):
"""Abstract class for VCS tools."""
__metaclass__ = abc.ABCMeta
def __init__(self, path, branch, url=None):
... | Clone git repos if they do not exist. | Clone git repos if they do not exist.
| Python | bsd-3-clause | Kozea/sitenco |
676c2a67877c32ad8845f374955ac07fdfbab561 | domain_models/fields.py | domain_models/fields.py | """Domain models fields."""
class Field(property):
"""Base field."""
def __init__(self):
"""Initializer."""
self.name = None
self.value = None
self.model = None
super(Field, self).__init__(self._get, self._set)
def _get(self, _):
"""Return field's value.""... | """Domain models fields."""
import six
class Field(property):
"""Base field."""
def __init__(self):
"""Initializer."""
self.name = None
self.value = None
self.model = None
super(Field, self).__init__(self._get, self._set)
def _get(self, _):
"""Return fiel... | Fix Unicode field in Python 3.2 | Fix Unicode field in Python 3.2
| Python | bsd-3-clause | ets-labs/domain_models,rmk135/domain_models,ets-labs/python-domain-models |
bb4a67d2817ccca3b15e09db1d72823626bd2ed6 | glitter/publisher/admin.py | glitter/publisher/admin.py | from __future__ import unicode_literals
from django import forms
from django.contrib.contenttypes.admin import GenericStackedInline
from .forms import object_version_choices
from .models import PublishAction
class ActionInline(GenericStackedInline):
model = PublishAction
fields = ('scheduled_time', 'publish... | from __future__ import unicode_literals
from django import forms
from django.contrib.contenttypes.admin import GenericStackedInline
from .forms import object_version_choices
from .models import PublishAction
class ActionInline(GenericStackedInline):
model = PublishAction
fields = ('scheduled_time', 'publish... | Rework the versions form widget | Rework the versions form widget
| Python | bsd-3-clause | developersociety/django-glitter,blancltd/django-glitter,blancltd/django-glitter,developersociety/django-glitter,blancltd/django-glitter,developersociety/django-glitter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.