commit stringlengths 40 40 | old_file stringlengths 4 150 | new_file stringlengths 4 150 | old_contents stringlengths 0 3.26k | new_contents stringlengths 1 4.43k | subject stringlengths 15 501 | message stringlengths 15 4.06k | lang stringclasses 4
values | license stringclasses 13
values | repos stringlengths 5 91.5k | diff stringlengths 0 4.35k |
|---|---|---|---|---|---|---|---|---|---|---|
64a653b6bd6c9aae2492f3ee838bda1fafe639d6 | upnpy/utils.py | upnpy/utils.py | # -*- coding: utf-8 -*-
"""
utils.py
~~~~~~~~
Defines utility functions used by UPnPy.
"""
def camelcase_to_underscore(text):
"""
Convert a camelCasedString to one separated_by_underscores. Treats
neighbouring capitals as acronyms and doesn't separated them, e.g. URL does
not become u_r_l. That would... | # -*- coding: utf-8 -*-
"""
utils.py
~~~~~~~~
Defines utility functions used by UPnPy.
"""
def camelcase_to_underscore(text):
"""
Convert a camelCasedString to one separated_by_underscores. Treats
neighbouring capitals as acronyms and doesn't separated them, e.g. URL does
not become u_r_l. That would... | Correct an AttributeError and a potential IndexErr | Correct an AttributeError and a potential IndexErr
| Python | mit | WenhaoYu/upnpy,Lukasa/upnpy | ---
+++
@@ -18,9 +18,9 @@
outstr = []
for char in text:
- if char.is_lower():
+ if char.islower():
outstr.append(char)
- elif outstr[-1].is_lower():
+ elif (len(outstr) > 0) and (outstr[-1].islower()):
outstr.append('_')
outstr.append(char... |
705aab2107793d1067d571b71bc140c320d69aae | bot/api/api.py | bot/api/api.py | from bot.api.telegram import TelegramBotApi
from bot.storage import State
class Api:
def __init__(self, telegram_api: TelegramBotApi, state: State):
self.telegram_api = telegram_api
self.state = state
def get_me(self):
return self.telegram_api.get_me()
def send_message(self, mess... | from bot.api.telegram import TelegramBotApi
from bot.storage import State
class Api:
def __init__(self, telegram_api: TelegramBotApi, state: State):
self.telegram_api = telegram_api
self.state = state
def get_me(self):
return self.telegram_api.get_me()
def send_message(self, mess... | Change yield from to return to be compatible with python 3.2 | Change yield from to return to be compatible with python 3.2
| Python | agpl-3.0 | alvarogzp/telegram-bot,alvarogzp/telegram-bot | ---
+++
@@ -15,7 +15,7 @@
reply_to_message_id=message.reply_to_message_id)
def get_pending_updates(self):
- yield from self.get_updates(timeout=0)
+ return self.get_updates(timeout=0)
def get_updates(self, timeout=45):
updates = self.... |
41c49a44c5f1bc9747b22b6d1f1088f1354a2cd5 | nes/cpu/decoder.py | nes/cpu/decoder.py | from sqlite3 import Connection, Row
class Decoder:
def __init__(self):
self.conn = Connection('nes.sqlite')
self.conn.row_factory = Row
def __del__(self):
self.conn.close()
def decode(self, opcode):
c = self.conn.cursor()
c.execute('select * from instruction where... | from sqlite3 import Connection, Row
class Decoder:
def __init__(self):
self.conn = Connection('nes.sqlite')
self.conn.row_factory = Row
def __del__(self):
self.conn.close()
def decode(self, opcode):
c = self.conn.cursor()
c.execute('select * from instruction where... | Raise an exception when it's an undocumented opcode. | Raise an exception when it's an undocumented opcode.
| Python | mit | Hexadorsimal/pynes | ---
+++
@@ -13,4 +13,7 @@
c = self.conn.cursor()
c.execute('select * from instruction where opcode=?', [opcode])
row = c.fetchone()
- return dict(zip(row.keys(), row))
+ if row:
+ return dict(zip(row.keys(), row))
+ else:
+ raise NotImplementedErro... |
6829e9b4cf87b8d8d8b6e5a1c3aaf881f66393cf | healthcheck/contrib/django/status_endpoint/views.py | healthcheck/contrib/django/status_endpoint/views.py | import json
from django.conf import settings
from django.views.decorators.http import require_http_methods
from django.http import HttpResponse
from healthcheck.healthcheck import (
DjangoDBsHealthCheck, FilesDontExistHealthCheck, HealthChecker)
class JsonResponse(HttpResponse):
def __init__(self, data, **k... | import json
from django.conf import settings
from django.views.decorators.http import require_http_methods
from django.http import HttpResponse
from healthcheck.healthcheck import (
DjangoDBsHealthCheck, FilesDontExistHealthCheck, HealthChecker)
class JsonResponse(HttpResponse):
def __init__(self, data, **k... | Remove duplicated JSON encoding for error messages | Remove duplicated JSON encoding for error messages
| Python | mit | yola/healthcheck | ---
+++
@@ -37,6 +37,6 @@
details = 'There were no checks.'
if not ok:
- return JsonResponseServerError(json.dumps(details))
+ return JsonResponseServerError(details)
return JsonResponse(details) |
df6f82dc8d6f429ec57dffb60e336253a062769b | angus/client/version.py | angus/client/version.py | # -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# ... | # -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# ... | Prepare a second release candidate for 0.0.15 | Prepare a second release candidate for 0.0.15
| Python | apache-2.0 | angus-ai/angus-sdk-python | ---
+++
@@ -18,4 +18,4 @@
# under the License.
-__version__ = "0.0.15rc1"
+__version__ = "0.0.15rc2" |
089e8c74106f3a19b229d085d73c932df6fe4e7d | application.py | application.py | from canis import siriusxm, spotify, oauth
def main():
try:
current = siriusxm.get_currently_playing('siriusxmu')
spotify_id = spotify.id_for_song(current)
print(current, spotify_id)
except Exception, e:
print "Error {}".format(e)
if __name__ == "__main__":
oauth.app.run(de... | from canis import siriusxm, spotify, oauth
def main():
try:
current = siriusxm.get_currently_playing('siriusxmu')
spotify_id = spotify.id_for_song(current)
print(current, spotify_id)
except Exception, e:
print "Error {}".format(e)
if __name__ == "__main__":
oauth.app.run()
... | Remove debug mode on flask | Remove debug mode on flask
| Python | mit | maxgoedjen/canis | ---
+++
@@ -9,5 +9,5 @@
print "Error {}".format(e)
if __name__ == "__main__":
- oauth.app.run(debug=True)
+ oauth.app.run()
main() |
697833caade1323ddb9a0b4e51031f1d494262cd | 201705/migonzalvar/biggest_set.py | 201705/migonzalvar/biggest_set.py | #!/usr/bin/env python3
from contextlib import contextmanager
import time
from main import has_subset_sum_zero
class Duration:
def __init__(self, elapsed=None):
self.elapsed = elapsed
@contextmanager
def less_than(secs):
duration = Duration()
tic = time.time()
yield duration
elapsed = ti... | #!/usr/bin/env python3
from contextlib import contextmanager
import time
from main import has_subset_sum_zero
class Duration:
def __init__(self, elapsed=None):
self.elapsed = elapsed
@contextmanager
def less_than(secs):
duration = Duration()
tic = time.time()
yield duration
elapsed = ti... | Use several strategies for performance | Use several strategies for performance
| Python | bsd-3-clause | VigoTech/reto,VigoTech/reto,VigoTech/reto,VigoTech/reto,VigoTech/reto,VigoTech/reto,VigoTech/reto,vigojug/reto,vigojug/reto,vigojug/reto,vigojug/reto,VigoTech/reto,vigojug/reto,vigojug/reto,vigojug/reto,vigojug/reto,VigoTech/reto,VigoTech/reto,vigojug/reto,vigojug/reto | ---
+++
@@ -16,21 +16,42 @@
tic = time.time()
yield duration
elapsed = time.time() - tic
- print(f'Duration: {elapsed} seconds')
- if elapsed >= secs:
- print('Limit reached. Stopping.')
- raise SystemExit(0)
+ duration.elapsed = elapsed
+
+
+def nosolution_case(N):
+ return r... |
0c785e349c2000bbf3b22671071a66eaca4d82d0 | astropy/io/votable/__init__.py | astropy/io/votable/__init__.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This package reads and writes data formats used by the Virtual
Observatory (VO) initiative, particularly the VOTable XML format.
"""
from .table import (
parse, parse_single_table, validate, from_table, is_votable)
from .exceptions import (
VO... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This package reads and writes data formats used by the Virtual
Observatory (VO) initiative, particularly the VOTable XML format.
"""
from .table import (
parse, parse_single_table, validate, from_table, is_votable, writeto)
from .exceptions import... | Put astropy.io.votable.writeto in the top-level namespace | Put astropy.io.votable.writeto in the top-level namespace
| Python | bsd-3-clause | DougBurke/astropy,AustereCuriosity/astropy,funbaker/astropy,joergdietrich/astropy,StuartLittlefair/astropy,larrybradley/astropy,tbabej/astropy,mhvk/astropy,pllim/astropy,stargaser/astropy,lpsinger/astropy,joergdietrich/astropy,lpsinger/astropy,AustereCuriosity/astropy,kelle/astropy,saimn/astropy,DougBurke/astropy,bsipo... | ---
+++
@@ -5,12 +5,13 @@
"""
from .table import (
- parse, parse_single_table, validate, from_table, is_votable)
+ parse, parse_single_table, validate, from_table, is_votable, writeto)
from .exceptions import (
VOWarning, VOTableChangeWarning, VOTableSpecWarning, UnimplementedWarning,
IOWarning,... |
fb1f03c7d46d9274f144a767830cf9c81078e8c8 | kovfig.py | kovfig.py | #! /usr/bin/env python
# coding:utf-8
from os import path
# the number of loop for train IBM Model 2
loop_count = 10
phrase_model_file = path.join(
path.abspath(path.dirname(__file__)),
"phrase.model"
)
bigram_model_file = path.join(
path.abspath(path.dirname(__file__)),
"bigram.model"
)
if __name__... | #! /usr/bin/env python
# coding:utf-8
from os import path
# the number of loop for train IBM Model 2
LOOP_COUNT = 10
PHRASE_MODEL_FILE = path.join(
path.abspath(path.dirname(__file__)),
"phrase.model"
)
BIGRAM_MODEL_FILE = path.join(
path.abspath(path.dirname(__file__)),
"bigram.model"
)
if __name__... | Use upper case variable for global vars | Use upper case variable for global vars
| Python | mit | kenkov/kovlive | ---
+++
@@ -5,23 +5,23 @@
# the number of loop for train IBM Model 2
-loop_count = 10
-phrase_model_file = path.join(
+LOOP_COUNT = 10
+PHRASE_MODEL_FILE = path.join(
path.abspath(path.dirname(__file__)),
"phrase.model"
)
-bigram_model_file = path.join(
+BIGRAM_MODEL_FILE = path.join(
path.abspat... |
b9b9382a62b00aa00255fbc9271ef5ec2db8c295 | fabfile.py | fabfile.py | from fabric.api import (
cd,
env,
put,
run,
sudo,
task
)
PRODUCTION_IP = '54.154.235.243'
PROJECT_DIRECTORY = '/home/ubuntu/ztm/'
COMPOSE_FILE = 'compose-production.yml'
@task
def production():
env.run = sudo
env.hosts = [
'ubuntu@' + PRODUCTION_IP + ':22',
]
def create... | from datetime import datetime
from fabric.api import (
cd,
env,
put,
run,
sudo,
task
)
PRODUCTION_IP = '54.154.235.243'
PROJECT_DIRECTORY = '/home/ubuntu/ztm/'
BACKUP_DIRECTORY = '/home/ubuntu/backup/'
COMPOSE_FILE = 'compose-production.yml'
@task
def production():
env.run = sudo
en... | Add S3 command for performing backup data | Add S3 command for performing backup data
| Python | mit | prontotools/zendesk-tickets-machine,prontotools/zendesk-tickets-machine,prontotools/zendesk-tickets-machine,prontotools/zendesk-tickets-machine | ---
+++
@@ -1,3 +1,5 @@
+from datetime import datetime
+
from fabric.api import (
cd,
env,
@@ -10,6 +12,7 @@
PRODUCTION_IP = '54.154.235.243'
PROJECT_DIRECTORY = '/home/ubuntu/ztm/'
+BACKUP_DIRECTORY = '/home/ubuntu/backup/'
COMPOSE_FILE = 'compose-production.yml'
@@ -30,6 +33,19 @@
@task
+de... |
873b82225d287dcca9b9bc0e0c3746233d15d947 | utilities.py | utilities.py | """
Various utilities
"""
import pprint
def load_state(path):
"""
Load an n-puzzle state from a file into an array and return it.
"""
result = []
with open(path) as f:
for line in f:
result.append(line.split())
return result
def print_state(state):
"""
Prittily re... | """
Various utilities
"""
import pprint
def load_state(path):
"""
Load an n-puzzle state from a file into an array and return it.
"""
result = []
with open(path) as f:
for line in f:
result.append([])
for square in line.split():
try:
... | Add function to check for goal state. | Add function to check for goal state.
| Python | mit | bandrebandrebandre/npuzz | ---
+++
@@ -10,7 +10,12 @@
result = []
with open(path) as f:
for line in f:
- result.append(line.split())
+ result.append([])
+ for square in line.split():
+ try:
+ result[-1].append(int(square))
+ except ValueError: ... |
422bb9ebfcff9826cf58d17a20df61cea21fdd77 | app/supplier_constants.py | app/supplier_constants.py | # Here we define a set of hardcoded keys that we use when denormalizing data from Supplier/ContactInformation tables
# into the SupplierFramework.declaration field. These are used only by the API and by the
# `digitalmarketplace-scripts/scripts/generate-framework-agreement-*-pages`, which generates framework agreement
... | # Here we define a set of hardcoded keys that we use when denormalizing data from Supplier/ContactInformation tables
# into the SupplierFramework.declaration field. These are used only by the API and by the
# `digitalmarketplace-scripts/scripts/generate-framework-agreement-*-pages`, which generates framework agreement
... | Remove VAT number from supplier constants | Remove VAT number from supplier constants
| Python | mit | alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api | ---
+++
@@ -12,4 +12,3 @@
KEY_REGISTRATION_TOWN = 'supplierRegisteredTown'
KEY_TRADING_NAME = 'supplierTradingName'
KEY_TRADING_STATUS = 'supplierTradingStatus'
-KEY_VAT_NUMBER = 'supplierVatNumber' |
99909048bc702e21e980bb1167caf9217aa31196 | steel/fields/strings.py | steel/fields/strings.py | import codecs
from steel.fields import Field
from steel.fields.mixin import Fixed
__all__ = ['Bytes', 'String', 'FixedBytes', 'FixedString']
class Bytes(Field):
"A stream of bytes that should be left unconverted"
def encode(self, value):
# Nothing to do here
return value
d... | import codecs
from steel.fields import Field
from steel.fields.mixin import Fixed
__all__ = ['Bytes', 'String', 'FixedBytes', 'FixedString']
class Bytes(Field):
"A stream of bytes that should be left unconverted"
def encode(self, value):
# Nothing to do here
return value
d... | Fix the docstring for FixedString | Fix the docstring for FixedString
| Python | bsd-3-clause | gulopine/steel-experiment | ---
+++
@@ -42,7 +42,7 @@
class FixedString(Fixed, String):
- "A stream of bytes that will always be set to the same value"
+ "A string that will always be set to the same value"
# The mixin does the heavy lifting
pass |
258a9dc694fc5ad308c6fbadfe01b0a375a2a34e | talks/core/renderers.py | talks/core/renderers.py | from rest_framework import renderers
from icalendar import Calendar, Event
class ICalRenderer(renderers.BaseRenderer):
media_type = 'text/calendar'
format = 'ical'
def render(self, data, media_type=None, renderer_context=None):
cal = Calendar()
cal.add('prodid', 'talks.ox.ac.uk')
... | from rest_framework import renderers
from icalendar import Calendar, Event
class ICalRenderer(renderers.BaseRenderer):
media_type = 'text/calendar'
format = 'ics'
def render(self, data, media_type=None, renderer_context=None):
cal = Calendar()
cal.add('prodid', 'talks.ox.ac.uk')
c... | Change default format to ics instead of ical | Change default format to ics instead of ical
| Python | apache-2.0 | ox-it/talks.ox,ox-it/talks.ox,ox-it/talks.ox | ---
+++
@@ -4,7 +4,7 @@
class ICalRenderer(renderers.BaseRenderer):
media_type = 'text/calendar'
- format = 'ical'
+ format = 'ics'
def render(self, data, media_type=None, renderer_context=None):
cal = Calendar() |
be00af0a0e87af5b4c82107d2f1356f378b65cb4 | obj_sys/management/commands/tag_the_file.py | obj_sys/management/commands/tag_the_file.py | import os
from optparse import make_option
from django.core.management import BaseCommand
from djangoautoconf.cmd_handler_base.msg_process_cmd_base import DjangoCmdBase
from obj_sys.models_ufs_obj import UfsObj
class FileTagger(DjangoCmdBase):
option_list = BaseCommand.option_list + (
make_option('--tag... | import os
from optparse import make_option
from django.core.management import BaseCommand
from djangoautoconf.cmd_handler_base.msg_process_cmd_base import DjangoCmdBase
from obj_sys.models_ufs_obj import UfsObj
class FileTagger(DjangoCmdBase):
option_list = BaseCommand.option_list + (
make_option('--tag... | Fix the issue that get_or_create returns a tuple instead of one object. | Fix the issue that get_or_create returns a tuple instead of one object.
| Python | bsd-3-clause | weijia/obj_sys,weijia/obj_sys | ---
+++
@@ -33,7 +33,7 @@
# enum_method = enum_git_repo
# pull_all_in_enumerable(enum_method)
if os.path.exists(self.options["file_path"]):
- new_file_ufs_obj = UfsObj.objects.get_or_create(full_path=self.options["file_path"])
+ new_file_ufs_obj, is_created = UfsObj.ob... |
fffb98874066d5762b815987d7e6768a2e9cb03c | tests/daemon_uid_gid.py | tests/daemon_uid_gid.py | #!/usr/bin/env python
from os import getuid, geteuid, getgid, getegid
from sys import argv
from time import sleep
from daemonize import Daemonize
pid = argv[1]
log = argv[2]
def main():
uids = getuid(), geteuid()
gids = getgid(), getegid()
with open(log, "w") as f:
f.write(" ".join(map(str, uid... | #!/usr/bin/env python
from os import getuid, geteuid, getgid, getegid
from sys import argv
from time import sleep
from daemonize import Daemonize
pid = argv[1]
log = argv[2]
def main():
uids = getuid(), geteuid()
gids = getgid(), getegid()
with open(log, "w") as f:
f.write(" ".join(map(str, uid... | Support debian based distributives in tests | Support debian based distributives in tests | Python | mit | thesharp/daemonize | ---
+++
@@ -17,5 +17,7 @@
f.write(" ".join(map(str, uids + gids)))
-daemon = Daemonize(app="test_app", pid=pid, action=main, user="nobody", group="nobody", keep_fds=[1, 2])
+group = "nogroup" if os.path.exists("/etc/debian_version") else "nobody"
+
+daemon = Daemonize(app="test_app", pid=pid, action=main... |
329f4cd5123440baf537db30340fd3d33d7bbbf1 | games/management/commands/makelove.py | games/management/commands/makelove.py | from django.core.management.base import BaseCommand
from games import models, bundle
def package_love(stdout, game, release):
if release.get_asset('love') is not None:
stdout.write(u"SKIPPING {}".format(release))
return
upload = release.get_asset('uploaded')
if upload is None:
s... | import zipfile
from django.core.management.base import BaseCommand
from games import models, bundle
def package_love(stdout, game, release):
if release.get_asset('love') is not None:
stdout.write(u"SKIPPING {}".format(release))
return
upload = release.get_asset('uploaded')
if upload is... | Make sure that uploaded files are zipfiles | Make sure that uploaded files are zipfiles
| Python | mit | stackmachine/bearweb,stackmachine/bearweb,stackmachine/bearweb,stackmachine/bearweb,stackmachine/bearweb,stackmachine/bearweb | ---
+++
@@ -1,3 +1,5 @@
+import zipfile
+
from django.core.management.base import BaseCommand
from games import models, bundle
@@ -14,7 +16,12 @@
stdout.write(u"NO UPLOAD {}".format(release))
return
- identity = bundle.detect_identity(upload.blob) or game.slug
+ try:
+ identity = ... |
52430087413e24c94a532e67a2c77248ecc0598c | saleor/core/extensions/checks.py | saleor/core/extensions/checks.py | import importlib
from typing import List
from django.conf import settings
from django.core.checks import Error, register
@register()
def check_extensions(app_configs, **kwargs):
"""Confirm a correct import of plugins and manager."""
errors = []
check_manager(errors)
plugins = settings.PLUGINS or []
... | from typing import List
from django.conf import settings
from django.core.checks import Error, register
from django.utils.module_loading import import_string
@register()
def check_extensions(app_configs, **kwargs):
"""Confirm a correct import of plugins and manager."""
errors = []
check_manager(errors)
... | Use django helper to validate manager and plugins paths | Use django helper to validate manager and plugins paths
| Python | bsd-3-clause | mociepka/saleor,mociepka/saleor,mociepka/saleor,maferelo/saleor,maferelo/saleor,maferelo/saleor | ---
+++
@@ -1,8 +1,8 @@
-import importlib
from typing import List
from django.conf import settings
from django.core.checks import Error, register
+from django.utils.module_loading import import_string
@register()
@@ -23,37 +23,22 @@
if not hasattr(settings, "EXTENSIONS_MANAGER") or not settings.EXTENSI... |
886d4d526d1766d154604f7a71182e48b3438a17 | linter.py | linter.py | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by roadhump
# Copyright (c) 2014 roadhump
#
# License: MIT
#
"""This module exports the ESLint plugin class."""
from SublimeLinter.lint import Linter
class ESLint(Linter):
"""Provides an interface to the eslint ... | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by roadhump
# Copyright (c) 2014 roadhump
#
# License: MIT
#
"""This module exports the ESLint plugin class."""
from SublimeLinter.lint import Linter
class ESLint(Linter):
"""Provides an interface to the eslint ... | Make fall back to ~/.eslintrc | Make fall back to ~/.eslintrc
| Python | mit | joeybaker/SublimeLinter-textlint,roadhump/SublimeLinter-eslint,AndBicScadMedia/SublimeLinter-eslint | ---
+++
@@ -32,4 +32,4 @@
'html': 'source.js.embedded.html'
}
tempfile_suffix = 'js'
- config_file = ('--config', '.eslintrc')
+ config_file = ('--config', '.eslintrc', '~') |
6f8a19c46a1d8b6b31039f212e733cd660551de7 | mws/apis/__init__.py | mws/apis/__init__.py | from .feeds import Feeds
from .finances import Finances
from .inbound_shipments import InboundShipments
from .inventory import Inventory
from .merchant_fulfillment import MerchantFulfillment
from .offamazonpayments import OffAmazonPayments
from .orders import Orders
from .products import Products
from .recommendations ... | from .feeds import Feeds
from .finances import Finances
from .inbound_shipments import InboundShipments
from .inventory import Inventory
from .merchant_fulfillment import MerchantFulfillment
from .offamazonpayments import OffAmazonPayments
from .orders import Orders
from .outbound_shipments import OutboundShipments
fro... | Include the new Subscriptions stub | Include the new Subscriptions stub | Python | unlicense | Bobspadger/python-amazon-mws,GriceTurrble/python-amazon-mws | ---
+++
@@ -5,11 +5,12 @@
from .merchant_fulfillment import MerchantFulfillment
from .offamazonpayments import OffAmazonPayments
from .orders import Orders
+from .outbound_shipments import OutboundShipments
from .products import Products
from .recommendations import Recommendations
from .reports import Reports
... |
22935ee89217ac1f8b8d3c921571381336069584 | lctools/lc.py | lctools/lc.py | from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
import libcloud.security
from config import get_config
def get_lc(profile, resource=None):
if resource is None:
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driv... | from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
import libcloud.security
from config import get_config
def get_lc(profile, resource=None):
if resource is None:
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driv... | Add a hack to overcome driver name inconsistency in libcloud. | Add a hack to overcome driver name inconsistency in libcloud.
| Python | apache-2.0 | novel/lc-tools,novel/lc-tools | ---
+++
@@ -29,7 +29,13 @@
if not isinstance(extra_kwargs, dict):
raise Exception('Extra arguments should be a Python dict')
- driver = get_driver(getattr(Provider, conf.get('driver').upper()))
+ # a hack because libcloud driver names for Rackspace doesn't match
+ # for loadbalancers ... |
c541e85f8b1dccaabd047027e89791d807550ee5 | fade/config.py | fade/config.py | #!/usr/bin/env python
"""
See LICENSE.txt file for copyright and license details.
"""
import os
basedir = os.path.abspath(os.path.dirname(__file__))
WTF_CSRF_ENABLED = True
SECRET_KEY = '3124534675689780'
# TODO: switch this to postgresql
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'app.db')
... | #!/usr/bin/env python
"""
See LICENSE.txt file for copyright and license details.
"""
import os
basedir = os.path.abspath(os.path.dirname(__file__))
WTF_CSRF_ENABLED = True
SECRET_KEY = '3124534675689780'
dbuser = 'rockwolf'
dbpass = ''
dbhost = 'testdb'
dbname = 'finance'
SQLALCHEMY_DATABASE_URI = 'postgresql:... | Switch database connection string to pg | Switch database connection string to pg | Python | bsd-3-clause | rockwolf/python,rockwolf/python,rockwolf/python,rockwolf/python,rockwolf/python,rockwolf/python | ---
+++
@@ -10,6 +10,16 @@
WTF_CSRF_ENABLED = True
SECRET_KEY = '3124534675689780'
-# TODO: switch this to postgresql
-SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'app.db')
-SQLALCHEMY_MIGRATE_REPO = os.path.join(basedir, 'db_repository')
+dbuser = 'rockwolf'
+dbpass = ''
+dbhost = 'testdb'
+db... |
6c8feca973703cf87a82cfa954fa3c7a3f152c72 | manage.py | manage.py | from project import app, db
from project import models
from flask.ext.script import Manager
from flask.ext.migrate import Migrate, MigrateCommand
migrate = Migrate(app, db)
manager = Manager(app)
manager.add_command('db', MigrateCommand)
if __name__ == '__main__':
manager.run()
| from project import app, db
from project import models
from flask.ext.script import Manager
from flask.ext.migrate import Migrate, MigrateCommand
migrate = Migrate(app, db)
manager = Manager(app)
manager.add_command('db', MigrateCommand)
@manager.command
def create_db():
"""Creates the db tables."""
db.crea... | Create create_db, drop_db and create_admin functions | Create create_db, drop_db and create_admin functions
| Python | mit | dylanshine/streamschool,dylanshine/streamschool | ---
+++
@@ -8,5 +8,24 @@
manager = Manager(app)
manager.add_command('db', MigrateCommand)
+
+@manager.command
+def create_db():
+ """Creates the db tables."""
+ db.create_all()
+
+
+@manager.command
+def drop_db():
+ """Drops the db tables."""
+ db.drop_all()
+
+
+@manager.command
+def create_admin():... |
e6f3bd9c61be29560e09f5d5d9c7e355ec14c2e3 | manage.py | manage.py | #!/usr/bin/env python
import sys
if __name__ == "__main__":
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| #!/usr/bin/env python
import sys
import os
if __name__ == "__main__":
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings')
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| Set a default settings module | Set a default settings module
| Python | bsd-3-clause | wagnerand/olympia,andymckay/addons-server,kumar303/addons-server,andymckay/olympia,aviarypl/mozilla-l10n-addons-server,aviarypl/mozilla-l10n-addons-server,wagnerand/addons-server,lavish205/olympia,Prashant-Surya/addons-server,harry-7/addons-server,harikishen/addons-server,mstriemer/olympia,mozilla/addons-server,andymck... | ---
+++
@@ -1,7 +1,11 @@
#!/usr/bin/env python
import sys
+import os
+
if __name__ == "__main__":
+ os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings')
+
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv) |
34f0e697ba4d6a787f0f4fc294163a09a52c185f | tests/test_arrayfire.py | tests/test_arrayfire.py | import arrayfire
# We're going to test several arrayfire behaviours that we rely on
from asserts import *
import afnumpy as af
import numpy as np
def test_cast():
a = afnumpy.random.rand(2,3)
# Check that device_ptr does not cause a copy
assert a.d_array.device_ptr() == a.d_array.device_ptr()
# Chec... | import arrayfire
# We're going to test several arrayfire behaviours that we rely on
from asserts import *
import afnumpy as af
import numpy as np
def test_af_cast():
a = afnumpy.arrayfire.randu(2,3)
# Check that device_ptr does not cause a copy
assert a.device_ptr() == a.device_ptr()
# Check that ca... | Add a pure arrayfire cast test to check for seg faults | Add a pure arrayfire cast test to check for seg faults
| Python | bsd-2-clause | FilipeMaia/afnumpy,daurer/afnumpy | ---
+++
@@ -7,6 +7,13 @@
import afnumpy as af
import numpy as np
+def test_af_cast():
+ a = afnumpy.arrayfire.randu(2,3)
+ # Check that device_ptr does not cause a copy
+ assert a.device_ptr() == a.device_ptr()
+ # Check that cast does not cause a copy
+ assert arrayfire.cast(a, a.dtype()).device_p... |
aac31b69da5ec3a3622ca7752e8273886b344683 | sublist/sublist.py | sublist/sublist.py | SUPERLIST = "superlist"
SUBLIST = "sublist"
EQUAL = "equal"
UNEQUAL = "unequal"
def check_lists(a, b):
if a == b:
return EQUAL
elif is_sublist(a, b):
return SUBLIST
elif is_sublist(b, a):
return SUPERLIST
else:
return UNEQUAL
def is_sublist(a, b):
return a in [b[i... | SUPERLIST = "superlist"
SUBLIST = "sublist"
EQUAL = "equal"
UNEQUAL = "unequal"
VERY_UNLIKELY_STRING = "ꗲꅯḪꍙ"
def check_lists(a, b):
if a == b:
return EQUAL
_a = VERY_UNLIKELY_STRING.join(map(str, a))
_b = VERY_UNLIKELY_STRING.join(map(str, b))
if _a in _b:
return SUBLIST
elif _b... | Switch back to the substring method - it's faster | Switch back to the substring method - it's faster
| Python | agpl-3.0 | CubicComet/exercism-python-solutions | ---
+++
@@ -3,17 +3,17 @@
EQUAL = "equal"
UNEQUAL = "unequal"
+VERY_UNLIKELY_STRING = "ꗲꅯḪꍙ"
+
def check_lists(a, b):
if a == b:
return EQUAL
- elif is_sublist(a, b):
+ _a = VERY_UNLIKELY_STRING.join(map(str, a))
+ _b = VERY_UNLIKELY_STRING.join(map(str, b))
+ if _a in _b:
r... |
6eae274fc200df9319e82abf99d0f2314a17a2af | formlibrary/migrations/0005_auto_20171204_0203.py | formlibrary/migrations/0005_auto_20171204_0203.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-12-04 10:03
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
dependencies = [
('workflow', '0007_auto_20171204_0203'),
... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-12-04 10:03
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('workflow', '0007_auto_20171204_0203'),
('formlibrar... | Split migration script of customform | Split migration script of customform
| Python | apache-2.0 | toladata/TolaActivity,toladata/TolaActivity,toladata/TolaActivity,toladata/TolaActivity | ---
+++
@@ -4,7 +4,6 @@
from django.db import migrations, models
import django.db.models.deletion
-import uuid
class Migration(migrations.Migration): |
265edc24561bdacfae2412680048c203f7f78c14 | calendarapp.py | calendarapp.py | from kivy.app import App
class CalendarApp(App):
"""Basic App to hold the calendar widget."""
def build(self):
return self.root
| import kivy
kivy.require('1.8.0')
from kivy.config import Config
Config.set('graphics', 'width', '360')
Config.set('graphics', 'height', '640')
from kivy.app import App
class CalendarApp(App):
"""Basic App to hold the calendar widget."""
def build(self):
return self.root
| Set the window size to emulate a mobile device | Set the window size to emulate a mobile device
| Python | mit | hackebrot/garden.calendar | ---
+++
@@ -1,3 +1,10 @@
+import kivy
+kivy.require('1.8.0')
+
+from kivy.config import Config
+Config.set('graphics', 'width', '360')
+Config.set('graphics', 'height', '640')
+
from kivy.app import App
|
dde622c7296ef1ebb7ee369c029ed1c8c861cf50 | client/capability-token-incoming/capability-token.6.x.py | client/capability-token-incoming/capability-token.6.x.py | from flask import Flask, Response
from twilio.jwt.client import ClientCapabilityToken
app = Flask(__name__)
@app.route('/token', methods=['GET'])
def get_capability_token():
"""Respond to incoming requests."""
# Find these values at twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
... | from flask import Flask, Response
from twilio.jwt.client import ClientCapabilityToken
app = Flask(__name__)
@app.route('/token', methods=['GET'])
def get_capability_token():
"""Respond to incoming requests."""
# Find these values at twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
... | Update capability token creation method | Update capability token creation method
Old method was `generate()`, it's not `to_jwt()` | Python | mit | TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets | ---
+++
@@ -15,7 +15,7 @@
capability = ClientCapabilityToken(account_sid, auth_token)
capability.allow_client_incoming("jenny")
- token = capability.generate()
+ token = capability.to_jwt()
return Response(token, mimetype='application/jwt')
|
86382d372fc8fd7ee42c264019989d3f119508a2 | integration-test/1106-merge-ocean-earth.py | integration-test/1106-merge-ocean-earth.py | # There should be a single, merged feature in each of these tiles
# Natural Earth
assert_less_than_n_features(5, 11, 11, 'water', {'kind': 'ocean'}, 2)
assert_less_than_n_features(5, 8, 11, 'earth', {'kind': 'earth'}, 2)
# OpenStreetMap
assert_less_than_n_features(9, 167, 186, 'water', {'kind': 'ocean'}, 2)
assert_le... | # There should be a single, merged feature in each of these tiles
# Natural Earth
assert_less_than_n_features(5, 12, 11, 'water', {'kind': 'ocean'}, 2)
assert_less_than_n_features(5, 8, 11, 'earth', {'kind': 'earth'}, 2)
# OpenStreetMap
assert_less_than_n_features(9, 167, 186, 'water', {'kind': 'ocean'}, 2)
assert_le... | Fix test by looking further east into the ocean | Fix test by looking further east into the ocean
| Python | mit | mapzen/vector-datasource,mapzen/vector-datasource,mapzen/vector-datasource | ---
+++
@@ -1,7 +1,7 @@
# There should be a single, merged feature in each of these tiles
# Natural Earth
-assert_less_than_n_features(5, 11, 11, 'water', {'kind': 'ocean'}, 2)
+assert_less_than_n_features(5, 12, 11, 'water', {'kind': 'ocean'}, 2)
assert_less_than_n_features(5, 8, 11, 'earth', {'kind': 'earth'},... |
401aafee6979cc95692555548b1fc10dea44a44e | product/api/views.py | product/api/views.py | from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from .serializers import ProductSerializer
from ..models import Product
from django.http import Http404
from rest_framework.views import APIView
class ProductDetail(APIView):
permission_classes = (IsAuthenticated,)... | from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from .serializers import ProductSerializer
from ..models import Product
from django.http import Http404
from rest_framework.views import APIView
class ProductDetail(APIView):
permission_classes = (IsAuthenticated,)... | Use remote fallback for API request | Use remote fallback for API request
| Python | bsd-3-clause | KlubJagiellonski/pola-backend,KlubJagiellonski/pola-backend,KlubJagiellonski/pola-backend,KlubJagiellonski/pola-backend | ---
+++
@@ -11,9 +11,9 @@
"""
Retrieve a product instance.
"""
- def get_object(self, slug):
+ def get_object(self, code):
try:
- return Product.objects.get(code=slug)
+ return Product.get_by_code(code=code)
except Product.DoesNotExist:
raise H... |
15db7def176572a667299cc30102c076b589620d | pyQuantuccia/tests/test_get_holiday_date.py | pyQuantuccia/tests/test_get_holiday_date.py | from pyQuantuccia import quantuccia
def test_get_holiday_date():
""" At the moment the only thing this function
can do is return NULL.
"""
assert(quantuccia.get_holiday_date() is None)
| from pyQuantuccia import quantuccia
def test_get_holiday_date():
""" At the moment the only thing this function
can do is return NULL.
"""
assert(quantuccia.get_holiday_date() is None)
| Correct spacing in the test file. | Correct spacing in the test file.
| Python | bsd-3-clause | jwg4/pyQuantuccia,jwg4/pyQuantuccia | ---
+++
@@ -1,4 +1,5 @@
from pyQuantuccia import quantuccia
+
def test_get_holiday_date():
""" At the moment the only thing this function |
17bd35d7a2b442faebdb39aad07294612d8e7038 | nflh/games.py | nflh/games.py | from datetime import datetime
GAME_VIDEO_BASE_URL = "http://www.nfl.com/feeds-rs/videos/byGameCenter/{0}.json"
LIVE_UPDATE_BASE_URL = "http://www.nfl.com/liveupdate/game-center/{0}/{0}_gtd.json"
class Game(object):
def __init__(self, id_, h, v):
self.id_ = id_
self.date = self.id_[:-2]
s... | from datetime import datetime
GAME_VIDEO_BASE_URL = "http://www.nfl.com/feeds-rs/videos/byGameCenter/{0}.json"
LIVE_UPDATE_BASE_URL = "http://www.nfl.com/liveupdate/game-center/{0}/{0}_gtd.json"
class Game(object):
def __init__(self, id_, h, v):
self.id_ = id_
self.date = self.id_[:-2]
s... | Add videos dict to Games. | Add videos dict to Games.
| Python | apache-2.0 | twbarber/nfl-highlight-bot | ---
+++
@@ -13,6 +13,7 @@
self.vis = v
self.latest_play_id = ""
self.latest_clip_id = ""
+ self.videos = {}
def is_today(self):
return self.date == str((datetime.today()).strftime('%Y%m%d')) |
c36b0639190de6517260d6b6e8e5991976336760 | shared/btr3baseball/DatasourceRepository.py | shared/btr3baseball/DatasourceRepository.py | import json
resource_package = __name__
resource_path_format = 'datasource/{}.json'
class DatasourceRepository:
def __init__(self):
self.availableSources = json.loads(pkg_resources.resource_string(resource_package, resource_path_format.format('all')))['available']
self.data = {}
for source... | import pkg_resources
import json
resource_package = __name__
resource_path_format = 'datasource/{}.json'
class DatasourceRepository:
def __init__(self):
self.availableSources = json.loads(pkg_resources.resource_string(resource_package, resource_path_format.format('all')))['available']
self.data = ... | Add pkg_resources back, working forward | Add pkg_resources back, working forward
| Python | apache-2.0 | bryantrobbins/baseball,bryantrobbins/baseball,bryantrobbins/baseball,bryantrobbins/baseball,bryantrobbins/baseball | ---
+++
@@ -1,3 +1,4 @@
+import pkg_resources
import json
resource_package = __name__ |
e9949cdf609aeb99cfe97c37638c6cb80c947198 | longclaw/longclawshipping/wagtail_hooks.py | longclaw/longclawshipping/wagtail_hooks.py | from wagtail.contrib.modeladmin.options import (
ModelAdmin, modeladmin_register
)
from longclaw.longclawshipping.models import ShippingCountry
class ShippingCountryModelAdmin(ModelAdmin):
model = ShippingCountry
menu_order = 200
menu_icon = 'site'
add_to_settings_menu = False
exclude_from_exp... | from wagtail.contrib.modeladmin.options import (
ModelAdmin, modeladmin_register
)
from longclaw.longclawshipping.models import ShippingCountry
class ShippingCountryModelAdmin(ModelAdmin):
model = ShippingCountry
menu_label = 'Shipping'
menu_order = 200
menu_icon = 'site'
add_to_settings_menu ... | Rename shipping label in model admin | Rename shipping label in model admin
| Python | mit | JamesRamm/longclaw,JamesRamm/longclaw,JamesRamm/longclaw,JamesRamm/longclaw | ---
+++
@@ -6,6 +6,7 @@
class ShippingCountryModelAdmin(ModelAdmin):
model = ShippingCountry
+ menu_label = 'Shipping'
menu_order = 200
menu_icon = 'site'
add_to_settings_menu = False |
8eddab84f27d5c068f5da477e05736c222cac4e2 | mass/utils.py | mass/utils.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Helper functions.
"""
# built-in modules
import json
# 3rd-party modules
from botocore.client import Config
# local modules
from mass.exception import UnsupportedScheduler
from mass.input_handler import InputHandler
def submit(job, protocol=None, priority=1, sched... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Helper functions.
"""
# built-in modules
import json
# 3rd-party modules
from botocore.client import Config
# local modules
from mass.exception import UnsupportedScheduler
from mass.input_handler import InputHandler
def submit(job, protocol=None, priority=1, sched... | Use [job.title] as genealogy of input_handler.save while submit job. | Use [job.title] as genealogy of input_handler.save while submit job.
| Python | apache-2.0 | badboy99tw/mass,KKBOX/mass,KKBOX/mass,badboy99tw/mass,KKBOX/mass,badboy99tw/mass | ---
+++
@@ -39,8 +39,7 @@
'protocol': protocol,
'body': handler.save(
data=job,
- job_title=job.title,
- task_title=job.title
+ genealogy=[job.title]
)
}),
executionStartToCloseTimeout=str(config.WOR... |
fad484694174e17ef8de9af99db3dda5cd866fac | md2pdf/core.py | md2pdf/core.py | # -*- coding: utf-8 -*-
from markdown2 import markdown, markdown_path
from weasyprint import HTML, CSS
from .exceptions import ValidationError
__title__ = 'md2pdf'
__version__ = '0.2.1'
__author__ = 'Julien Maupetit'
__license__ = 'MIT'
__copyright__ = 'Copyright 2013 Julien Maupetit'
def md2pdf(pdf_file_path, md_... | # -*- coding: utf-8 -*-
from markdown2 import markdown, markdown_path
from weasyprint import HTML, CSS
from .exceptions import ValidationError
__title__ = 'md2pdf'
__version__ = '0.2.1'
__author__ = 'Julien Maupetit'
__license__ = 'MIT'
__copyright__ = 'Copyright 2013 Julien Maupetit'
def md2pdf(pdf_file_path, md_... | Fix raw md content rendering | Fix raw md content rendering
| Python | mit | jmaupetit/md2pdf | ---
+++
@@ -24,7 +24,7 @@
if md_file_path:
raw_html = markdown_path(md_file_path, extras=extras)
elif md_content:
- raw_html = markdown(md_file_path, extras=extras)
+ raw_html = markdown(md_content, extras=extras)
if not len(raw_html):
raise ValidationError('Input mark... |
facaa380b9b0fbb8f5d6d4d7c6c24257235cbb65 | plugin.py | plugin.py | # -*- coding: utf-8 -*-
"""Load and Unload all GitGutter modules.
This module exports __all__ modules, which Sublime Text needs to know about.
The list of __all__ exported symbols is defined in modules/__init__.py.
"""
try:
from .modules import *
except ValueError:
from modules import *
def plugin_loaded():... | # -*- coding: utf-8 -*-
"""Load and Unload all GitGutter modules.
This module exports __all__ modules, which Sublime Text needs to know about.
The list of __all__ exported symbols is defined in modules/__init__.py.
"""
try:
from .modules import *
except ValueError:
from modules import *
except ImportError:
... | Handle module reload exceptions gracefully | Enhancement: Handle module reload exceptions gracefully
In some rare cases if the internal module structure has changed the 'reload' module can't recover all modules and will fail with ImportError. This is the situation we need to advice a restart of Sublime Text.
| Python | mit | jisaacks/GitGutter | ---
+++
@@ -9,6 +9,13 @@
from .modules import *
except ValueError:
from modules import *
+except ImportError:
+ # Failed to import at least one module. This can happen after upgrade due
+ # to internal structure changes.
+ import sublime
+ sublime.message_dialog(
+ "GitGutter failed to r... |
a07ac44d433981b7476ab3b57339797edddb368c | lenet_slim.py | lenet_slim.py | import tensorflow as tf
slim = tf.contrib.slim
def le_net(images, num_classes=10, scope='LeNet'):
with tf.variable_scope(scope, 'LeNet', [images, num_classes]):
net = slim.conv2d(images, 32, [5, 5], scope='conv1')
net = slim.max_pool2d(net, [2, 2], 2, scope='pool1')
net = slim.conv2d(net,... | import tensorflow as tf
slim = tf.contrib.slim
def le_net(images, num_classes=10, scope='LeNet'):
with tf.variable_scope(scope, 'LeNet', [images, num_classes]):
net = slim.conv2d(images, 32, [5, 5], scope='conv1')
net = slim.max_pool2d(net, [2, 2], 2, scope='pool1')
net = slim.conv2d(net,... | Fix the shape of gap_w | Fix the shape of gap_w | Python | mit | philipperemy/tensorflow-class-activation-mapping | ---
+++
@@ -11,7 +11,7 @@
net = slim.max_pool2d(net, [2, 2], 2, scope='pool2')
gap = tf.reduce_mean(net, (1, 2))
with tf.variable_scope('GAP'):
- gap_w = tf.get_variable('W', shape=[64, 10], initializer=tf.random_normal_initializer(0., 0.01))
+ gap_w = tf.get_variable(... |
7f48dde064acbf1c192ab0bf303ac8e80e56e947 | wafer/kv/models.py | wafer/kv/models.py | from django.contrib.auth.models import Group
from django.db import models
from jsonfield import JSONField
class KeyValue(models.Model):
group = models.ForeignKey(Group, on_delete=models.CASCADE)
key = models.CharField(max_length=64, db_index=True)
value = JSONField()
def __unicode__(self):
r... | from django.contrib.auth.models import Group
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from jsonfield import JSONField
@python_2_unicode_compatible
class KeyValue(models.Model):
group = models.ForeignKey(Group, on_delete=models.CASCADE)
key = models.CharField(... | Use @python_2_unicode_compatible rather than repeating methods | Use @python_2_unicode_compatible rather than repeating methods
| Python | isc | CTPUG/wafer,CTPUG/wafer,CTPUG/wafer,CTPUG/wafer | ---
+++
@@ -1,16 +1,15 @@
from django.contrib.auth.models import Group
from django.db import models
+from django.utils.encoding import python_2_unicode_compatible
from jsonfield import JSONField
+@python_2_unicode_compatible
class KeyValue(models.Model):
group = models.ForeignKey(Group, on_delete=model... |
9be09ccf5749fae1d7a72663d592de5a88a755eb | archive/archive_api/src/responses.py | archive/archive_api/src/responses.py | # -*- encoding: utf-8
import json
from flask import Response, jsonify
class ContextResponse(Response):
"""
This class adds the "@context" parameter to JSON responses before
they're sent to the user.
For an explanation of how this works/is used, read
https://blog.miguelgrinberg.com/post/customiz... | # -*- encoding: utf-8
import json
from flask import Response, jsonify
from werkzeug.wsgi import ClosingIterator
class ContextResponse(Response):
"""
This class adds the "@context" parameter to JSON responses before
they're sent to the user.
For an explanation of how this works/is used, read
htt... | Handle a Werkzeug ClosingIterator (as exposed by the tests) | Handle a Werkzeug ClosingIterator (as exposed by the tests)
| Python | mit | wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api | ---
+++
@@ -3,6 +3,7 @@
import json
from flask import Response, jsonify
+from werkzeug.wsgi import ClosingIterator
class ContextResponse(Response):
@@ -15,9 +16,14 @@
"""
context_url = "https://api.wellcomecollection.org/storage/v1/context.json"
- def __init__(self, response, **kwargs):
- ... |
939e5721300013b2977375f28897a6a573509112 | xml4h/exceptions.py | xml4h/exceptions.py | """
Custom *xml4h* exceptions.
"""
class BaseXml4hException(Exception):
"""
Base exception class for all non-standard exceptions raised by *xml4h*.
"""
pass
class FeatureUnavailableException(BaseXml4hException):
"""
User has attempted to use a feature that is available in some *xml4h*
im... | """
Custom *xml4h* exceptions.
"""
class Xml4hException(Exception):
"""
Base exception class for all non-standard exceptions raised by *xml4h*.
"""
pass
class FeatureUnavailableException(Xml4hException):
"""
User has attempted to use a feature that is available in some *xml4h*
implementa... | Rename base exception class; less ugly | Rename base exception class; less ugly
| Python | mit | jmurty/xml4h,pipermerriam/xml4h,czardoz/xml4h | ---
+++
@@ -3,14 +3,14 @@
"""
-class BaseXml4hException(Exception):
+class Xml4hException(Exception):
"""
Base exception class for all non-standard exceptions raised by *xml4h*.
"""
pass
-class FeatureUnavailableException(BaseXml4hException):
+class FeatureUnavailableException(Xml4hExcept... |
a23e211ebdee849543cd7c729a8dafc145ea6b5c | TorGTK/var.py | TorGTK/var.py | from gi.repository import Gtk
import tempfile
import os.path
version = "0.2.2"
# Define default port numbers
default_socks_port = 19050
default_control_port = 19051
# Tor process descriptor placeholder
tor_process = None
# Tor logfile location placeholder
tor_logfile_dir = tempfile.mkdtemp()
tor_logfile_location = ... | from gi.repository import Gtk
import tempfile
import os.path
import platform
version = "0.2.2"
# Define default port numbers
default_socks_port = 19050
default_control_port = 19051
# Tor process descriptor placeholder
tor_process = None
# Tor logfile location placeholder
tor_logfile_dir = tempfile.mkdtemp()
tor_log... | Add OS detection (mainly Windows vs Unix) to preferences directory selection | Add OS detection (mainly Windows vs Unix) to preferences directory selection
| Python | bsd-2-clause | neelchauhan/TorGTK,neelchauhan/TorNova | ---
+++
@@ -1,6 +1,7 @@
from gi.repository import Gtk
import tempfile
import os.path
+import platform
version = "0.2.2"
@@ -16,9 +17,13 @@
tor_logfile_location = os.path.join(tor_logfile_dir, "tor_log")
# User preferences location placeholder
-home_dir = os.path.expanduser("~")
-prefs_dir = os.path.join(h... |
3e54119f07b0fdcbbe556e86de3c161a3eb20ddf | mwikiircbot.py | mwikiircbot.py | import ircbotframe
import sys
class Handler:
def __init__(self, host, port=6667, name="MediaWiki", description="MediaWiki recent changes bot", channels=[]):
self.channels = channels
self.bot = ircbotframe.ircBot(host, port, name, description)
self.bot.bind("376", self.endMOTD)
self.... | import ircbotframe
import sys
class Handler:
def __init__(self, host, port=6667, name="MediaWiki", description="MediaWiki recent changes bot", channels=[]):
self.channels = channels
self.bot = ircbotframe.ircBot(host, port, name, description)
self.bot.bind("376", self.endMOTD)
self.... | Fix bot not joining any channels | Fix bot not joining any channels
Also removed unnecessary usage comment.
| Python | mit | fenhl/mwikiircbot | ---
+++
@@ -10,14 +10,14 @@
def endMOTD(self, sender, headers, message):
for chan in self.channels:
- bot.joinchan(chan)
+ self.bot.joinchan(chan)
def main(cmd, args):
- if len(args) < 1:
- print("Usage: `" + cmd + " <host> <channel> [<channel> ...]` (for full ar... |
e91a923efd7cff36368059f47ffbd52248362305 | me_api/middleware/me.py | me_api/middleware/me.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from flask import Blueprint, jsonify
from me_api.configs import Config
me = Blueprint('me', __name__)
@me.route('/')
def index():
routers = []
for module in Config.modules['modules'].values():
routers.append(modu... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from flask import Blueprint, jsonify
from me_api.configs import Config
me = Blueprint('me', __name__)
@me.route('/')
def index():
routers = [module_config['path'] for module_config in
Config.modules['modules']... | Improve the way that get all the routers | Improve the way that get all the routers
| Python | mit | lord63/me-api | ---
+++
@@ -13,7 +13,6 @@
@me.route('/')
def index():
- routers = []
- for module in Config.modules['modules'].values():
- routers.append(module['path'])
+ routers = [module_config['path'] for module_config in
+ Config.modules['modules'].values()]
return jsonify(me=Config.me, ro... |
850fba4b07e4c444aa8640c6f4c3816f8a3259ea | website_medical_patient_species/controllers/main.py | website_medical_patient_species/controllers/main.py | # -*- coding: utf-8 -*-
# Copyright 2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import http
from openerp.http import request
from openerp.addons.website_medical.controllers.main import (
WebsiteMedical
)
class WebsiteMedical(WebsiteMedical):
def _inje... | # -*- coding: utf-8 -*-
# Copyright 2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp.http import request
from openerp.addons.website_medical.controllers.main import (
WebsiteMedical
)
class WebsiteMedical(WebsiteMedical):
def _inject_medical_detail_vals(se... | Fix lint * Remove stray import to fix lint | [FIX] website_medical_patient_species: Fix lint
* Remove stray import to fix lint
| Python | agpl-3.0 | laslabs/vertical-medical,laslabs/vertical-medical | ---
+++
@@ -2,7 +2,6 @@
# Copyright 2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-from openerp import http
from openerp.http import request
from openerp.addons.website_medical.controllers.main import ( |
b94697fe7b4299f66336f56fb98f1c902278caed | polling_stations/apps/data_collection/management/commands/import_havant.py | polling_stations/apps/data_collection/management/commands/import_havant.py | from data_collection.management.commands import BaseXpressWebLookupCsvImporter
class Command(BaseXpressWebLookupCsvImporter):
council_id = 'E07000090'
addresses_name = 'HavantPropertyPostCodePollingStationWebLookup-2017-03-20.TSV'
stations_name = 'HavantPropertyPostCodePollingStationWebLookup-2017-... | from data_collection.management.commands import BaseXpressWebLookupCsvImporter
class Command(BaseXpressWebLookupCsvImporter):
council_id = 'E07000090'
addresses_name = 'HavantPropertyPostCodePollingStationWebLookup-2017-03-20.TSV'
stations_name = 'HavantPropertyPostCodePollingStationWebLookup-2017-... | Remove Havant election id (update expected) | Remove Havant election id (update expected)
| Python | bsd-3-clause | DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations,chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations | ---
+++
@@ -6,6 +6,6 @@
stations_name = 'HavantPropertyPostCodePollingStationWebLookup-2017-03-20.TSV'
elections = [
'local.hampshire.2017-05-04',
- 'parl.2017-06-08'
+ #'parl.2017-06-08'
]
csv_delimiter = '\t' |
bd1df334d68c82b0fc57b4c20da7844155382f83 | numpy-array-of-tuple.py | numpy-array-of-tuple.py | # Numpy converts a list of tuples *not* into an array of tuples, but into a 2D
# array instead.
list_of_tuples = [(1, 2), (3, 4)]
import numpy as np
print('list of tuples:', list_of_tuples, 'type:', type(list_of_tuples))
A = np.array(list_of_tuples)
print('numpy array of tuples:', A, 'type:', type(A))
# It makes comp... | # Numpy converts a list of tuples *not* into an array of tuples, but into a 2D
# array instead.
import numpy as np # 1.11.1
list_of_tuples = [(1, 2), (3, 4)]
print('list of tuples:', list_of_tuples, 'type:', type(list_of_tuples))
A = np.array(list_of_tuples)
print('numpy array of tuples:', A, 'type:', type(A))
# I... | Update numpy array of tuples with np version | Update numpy array of tuples with np version
| Python | mit | cmey/surprising-snippets,cmey/surprising-snippets | ---
+++
@@ -1,8 +1,10 @@
# Numpy converts a list of tuples *not* into an array of tuples, but into a 2D
# array instead.
+import numpy as np # 1.11.1
+
list_of_tuples = [(1, 2), (3, 4)]
-import numpy as np
print('list of tuples:', list_of_tuples, 'type:', type(list_of_tuples))
+
A = np.array(list_of_tuples)
pr... |
717339f2cb2aed818729a407009a30de53b62a2c | oocgcm/test/test_eos.py | oocgcm/test/test_eos.py | import os
import numpy as np
import xarray as xr
from . import TestCase, assert_equal,assert_allclose,requires_numba
from oocgcm.oceanfuncs.eos import misc
@requires_numba
def test_numpy_spice():
assert_allclose(misc._spice(15,33),0.54458641375)
| import os
import numpy as np
import xarray as xr
from . import TestCase, assert_equal,assert_allclose,requires_numba,has_numba
if has_numba:
from oocgcm.oceanfuncs.eos import misc
@requires_numba
def test_numpy_spice():
assert_allclose(misc._spice(15,33),0.54458641375)
| Fix has_numba for travis build | Fix has_numba for travis build
| Python | apache-2.0 | lesommer/oocgcm | ---
+++
@@ -3,9 +3,10 @@
import xarray as xr
-from . import TestCase, assert_equal,assert_allclose,requires_numba
+from . import TestCase, assert_equal,assert_allclose,requires_numba,has_numba
-from oocgcm.oceanfuncs.eos import misc
+if has_numba:
+ from oocgcm.oceanfuncs.eos import misc
@requires_numba
... |
d60ce9b23bcf2f8c60b2a8ce75eeba8779345b8b | Orange/tests/__init__.py | Orange/tests/__init__.py | import os
import unittest
from Orange.widgets.tests import test_setting_provider, \
test_settings_handler, test_context_handler, \
test_class_values_context_handler, test_domain_context_handler
from Orange.widgets.data.tests import test_owselectcolumns
try:
from Orange.widgets.tests import test_widget
... | import os
import unittest
from Orange.widgets.tests import test_setting_provider, \
test_settings_handler, test_context_handler, \
test_class_values_context_handler, test_domain_context_handler
from Orange.widgets.data.tests import test_owselectcolumns
try:
from Orange.widgets.tests import test_widget
... | Disable widget test. (does not run on travis) | Disable widget test. (does not run on travis)
| Python | bsd-2-clause | marinkaz/orange3,cheral/orange3,qPCR4vir/orange3,kwikadi/orange3,kwikadi/orange3,kwikadi/orange3,cheral/orange3,qusp/orange3,marinkaz/orange3,cheral/orange3,qPCR4vir/orange3,qusp/orange3,qPCR4vir/orange3,marinkaz/orange3,marinkaz/orange3,kwikadi/orange3,cheral/orange3,kwikadi/orange3,qPCR4vir/orange3,qPCR4vir/orange3,q... | ---
+++
@@ -31,7 +31,7 @@
])
if run_widget_tests:
all_tests.extend([
- load(test_widget),
+ #load(test_widget), # does not run on travis
])
return unittest.TestSuite(all_tests)
|
083a4066ed82065aa1b00cb714a7829dc2571327 | crypto_enigma/_version.py | crypto_enigma/_version.py | #!/usr/bin/env python
# encoding: utf8
"""
Description
.. note::
Any additional note.
"""
from __future__ import (absolute_import, print_function, division, unicode_literals)
# See - http://www.python.org/dev/peps/pep-0440/
# See - http://semver.org
__author__ = 'Roy Levien'
__copyright__ = '(c) 2014-2015 Roy ... | #!/usr/bin/env python
# encoding: utf8
"""
Description
.. note::
Any additional note.
"""
from __future__ import (absolute_import, print_function, division, unicode_literals)
# See - http://www.python.org/dev/peps/pep-0440/
# See - http://semver.org
__author__ = 'Roy Levien'
__copyright__ = '(c) 2014-2015 Roy ... | Update test version following release | Update test version following release
| Python | bsd-3-clause | orome/crypto-enigma-py | ---
+++
@@ -15,8 +15,8 @@
__author__ = 'Roy Levien'
__copyright__ = '(c) 2014-2015 Roy Levien'
__release__ = '0.2.1' # N(.N)*
-__pre_release__ = 'b1' # aN | bN | cN |
-__suffix__ = '' #'.dev5' # .devN | | .postN
+__pre_release__ = 'b2' # aN | bN | cN |
+__suffix__ = '.dev1' # .devN | | .postN
__version__ = _... |
ed1a14ef8f2038950b7e56c7ae5c21daa1d6618a | ordered_model/models.py | ordered_model/models.py | from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import reverse
from django.db import models
class OrderedModel(models.Model):
"""
An abstract model that allows objects to be ordered relative to each other.
Provides an ``order`` field.
"""
order = models.Po... | from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import reverse
from django.db import models
from django.db.models import Max
class OrderedModel(models.Model):
"""
An abstract model that allows objects to be ordered relative to each other.
Provides an ``order`` fiel... | Use aggregate Max to fetch new order value. | Use aggregate Max to fetch new order value.
| Python | bsd-3-clause | foozmeat/django-ordered-model,foozmeat/django-ordered-model,pombredanne/django-ordered-model,pombredanne/django-ordered-model,pombredanne/django-ordered-model,foozmeat/django-ordered-model | ---
+++
@@ -1,6 +1,7 @@
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import reverse
from django.db import models
+from django.db.models import Max
class OrderedModel(models.Model):
@@ -17,11 +18,8 @@
def save(self, *args, **kwargs):
if not self.id:
-... |
6443a0fed1b915745c591f425027d07216d28e12 | podium/urls.py | podium/urls.py | """podium URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/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-bas... | """podium URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/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-bas... | Use include, not a view, for the root URL. | Use include, not a view, for the root URL.
| Python | mit | pyatl/podium-django,pyatl/podium-django,pyatl/podium-django | ---
+++
@@ -22,5 +22,5 @@
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^talks/', include('podium.talks.urls')),
- url(r'^$', views.session_list_view),
+ url(r'^', include('podium.talks.urls')),
] |
04c32537f7925aaeb54d8d7aa6da34ce85479c2c | mistraldashboard/test/helpers.py | mistraldashboard/test/helpers.py | # Copyright 2015 Huawei Technologies Co., Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | # Copyright 2015 Huawei Technologies Co., Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | Drop mox, no longer needed | Drop mox, no longer needed
The porting of mistral-dashboard is complete.
This fullfills the community goal "Remove Use of mox/mox3 for Testing"
set for Rocky: https://governance.openstack.org/tc/goals/rocky/mox_removal.html
Remove use_mox and remove dead code.
Change-Id: I59839fecd85caaf8b81129b7f890c4ed50d39db8
Sig... | Python | apache-2.0 | openstack/mistral-dashboard,openstack/mistral-dashboard,openstack/mistral-dashboard | ---
+++
@@ -17,10 +17,6 @@
from mistraldashboard.test.test_data import utils
-def create_stubs(stubs_to_create={}):
- return helpers.create_stubs(stubs_to_create)
-
-
class MistralTestsMixin(object):
def _setup_test_data(self):
super(MistralTestsMixin, self)._setup_test_data()
@@ -28,10 +24,8 @... |
087a706fb8cadf98e3bd515427665997ca2001ba | tests/pytests/functional/states/test_npm.py | tests/pytests/functional/states/test_npm.py | import pytest
from salt.exceptions import CommandExecutionError
@pytest.fixture(scope="module", autouse=True)
def install_npm(sminion):
try:
sminion.functions.pkg.install("npm")
# Just name the thing we're looking for
sminion.functions.npm # pylint: disable=pointless-statement
except ... | import pytest
from salt.exceptions import CommandExecutionError
@pytest.fixture(scope="module", autouse=True)
def install_npm(sminion):
try:
sminion.functions.state.single("pkg.installed", name="npm")
# Just name the thing we're looking for
sminion.functions.npm # pylint: disable=pointles... | Use state.single to not upgrade npm | Use state.single to not upgrade npm
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | ---
+++
@@ -5,11 +5,11 @@
@pytest.fixture(scope="module", autouse=True)
def install_npm(sminion):
try:
- sminion.functions.pkg.install("npm")
+ sminion.functions.state.single("pkg.installed", name="npm")
# Just name the thing we're looking for
sminion.functions.npm # pylint: di... |
3071684f73e736950023be9f47c93dd31c50be1c | send2trash/compat.py | send2trash/compat.py | # Copyright 2017 Virgil Dupras
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licenses/bsd_license
import sys
import os
PY3 = sys.version_info[0] >= 3
if PY3:
text_typ... | # Copyright 2017 Virgil Dupras
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licenses/bsd_license
import sys
import os
PY3 = sys.version_info[0] >= 3
if PY3:
text_typ... | Fix newly-introduced crash under Windows | Fix newly-introduced crash under Windows
ref #14
| Python | bsd-3-clause | hsoft/send2trash | ---
+++
@@ -11,7 +11,9 @@
if PY3:
text_type = str
binary_type = bytes
- environb = os.environb
+ if os.supports_bytes_environ:
+ # environb will be unset under Windows, but then again we're not supposed to use it.
+ environb = os.environb
else:
text_type = unicode
binary_type... |
6fcc041c45dc426d570aa4c44e48c3fc9d8fd5c0 | settings/settings.py | settings/settings.py | # This file contains the project wide settings. It is not
# part of version control and it should be adapted to
# suit each deployment.
from os import environ
# Use the absolute path to the directory that stores the data.
# This can differ per deployment
DATA_DIRECTORY = "/cheshire3/clic/dbs/dickens/data/"
#TODO: ... | # This file contains the project wide settings. It is not
# part of version control and it should be adapted to
# suit each deployment.
from os import environ
# Use the absolute path to the directory that stores the data.
# This can differ per deployment
DATA_DIRECTORY = "/home/vagrant/code/clic-project/clic/dbs/di... | Update the setting DATA_DIRECTORY to match the vagrant setup | Update the setting DATA_DIRECTORY to match the vagrant setup
| Python | mit | CentreForCorpusResearch/clic,CentreForCorpusResearch/clic,CentreForResearchInAppliedLinguistics/clic,CentreForResearchInAppliedLinguistics/clic,CentreForResearchInAppliedLinguistics/clic,CentreForCorpusResearch/clic | ---
+++
@@ -7,7 +7,7 @@
# Use the absolute path to the directory that stores the data.
# This can differ per deployment
-DATA_DIRECTORY = "/cheshire3/clic/dbs/dickens/data/"
+DATA_DIRECTORY = "/home/vagrant/code/clic-project/clic/dbs/dickens/data/"
#TODO: make the cache settings imported in api.py
CACHE_DIR =... |
11b70d10b07c38c1d84b58f5e8563a43c44d8f91 | pyop/tests.py | pyop/tests.py | '''
These are tests to assist with creating :class:`.LinearOperator`.
'''
import numpy as np
from numpy.testing import assert_allclose
def adjointTest(O, significant = 7):
''' Test for verifying forward and adjoint functions in LinearOperator.
adjointTest verifies correctness for the forward and adjoint funct... | '''
These are tests to assist with creating :class:`.LinearOperator`.
'''
import numpy as np
from numpy.testing import assert_allclose
def adjointTest(O, significant = 7):
''' Test for verifying forward and adjoint functions in LinearOperator.
adjointTest verifies correctness for the forward and adjoint funct... | Fix wrong rtol in adjointTest | Fix wrong rtol in adjointTest | Python | bsd-3-clause | ryanorendorff/pyop | ---
+++
@@ -34,4 +34,4 @@
x = np.random.rand(O.shape[1])
y = np.random.rand(O.shape[0])
- assert_allclose(O.T(y).dot(x), y.dot(O(x)), rtol = 10**significant)
+ assert_allclose(O.T(y).dot(x), y.dot(O(x)), rtol = 10**(-significant)) |
1b6217eea2284814583447901661823f3a3d0240 | service/scheduler/schedule.py | service/scheduler/schedule.py | import os
import sys
import time
from redis import StrictRedis
from rq import Queue
from apscheduler.schedulers.blocking import BlockingScheduler
sys.path.append('/usr/local/d1lod')
from d1lod import jobs
conn = StrictRedis(host='redis', port='6379')
q = Queue(connection=conn)
sched = BlockingScheduler()
@sched.sc... | import os
import sys
import time
from redis import StrictRedis
from rq import Queue
from apscheduler.schedulers.blocking import BlockingScheduler
sys.path.append('/usr/local/d1lod')
from d1lod import jobs
conn = StrictRedis(host='redis', port='6379')
q = Queue(connection=conn)
sched = BlockingScheduler()
@sched.sc... | Add export job and print_job jobs | Add export job and print_job jobs
| Python | apache-2.0 | ec-geolink/d1lod,ec-geolink/d1lod,ec-geolink/d1lod,ec-geolink/d1lod | ---
+++
@@ -26,5 +26,13 @@
def debug_job():
q.enqueue(jobs.calculate_stats)
+@sched.scheduled_job('interval', minutes=1)
+def export_job():
+ q.enqueue(jobs.export_graph)
+
+@sched.scheduled_job('interval', minutes=1)
+def debug_job():
+ jobs.print_jobs()
+
time.sleep(10)
sched.start() |
17ac79bd57c1d89767bffccfec755df159205e2c | test/conditional_break/conditional_break.py | test/conditional_break/conditional_break.py | import sys
import lldb
import lldbutil
def stop_if_called_from_a():
# lldb.debugger_unique_id stores the id of the debugger associated with us.
dbg = lldb.SBDebugger.FindDebuggerWithID(lldb.debugger_unique_id)
# Perform synchronous interaction with the debugger.
dbg.SetAsync(False)
# Get the comm... | import sys
import lldb
import lldbutil
def stop_if_called_from_a():
# lldb.debugger_unique_id stores the id of the debugger associated with us.
dbg = lldb.SBDebugger.FindDebuggerWithID(lldb.debugger_unique_id)
# Perform synchronous interaction with the debugger.
dbg.SetAsync(False)
# Retrieve the... | Simplify the breakpoint command function. Instead of fetching the command interpreter and run the "process continue" command, use the SBProcess.Continue() API. | Simplify the breakpoint command function. Instead of fetching the command interpreter
and run the "process continue" command, use the SBProcess.Continue() API.
git-svn-id: b33bab8abb5b18c12ee100cd7761ab452d00b2b0@122434 91177308-0d34-0410-b5e6-96231b3b80d8
| Python | apache-2.0 | apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb | ---
+++
@@ -8,12 +8,6 @@
# Perform synchronous interaction with the debugger.
dbg.SetAsync(False)
-
- # Get the command interpreter.
- ci = dbg.GetCommandInterpreter()
-
- # And the result object for ci interaction.
- res = lldb.SBCommandReturnObject()
# Retrieve the target, process, an... |
8a6002015cf873d3054bd20d8d287a3fe7be6b84 | server.py | server.py | from tornado import ioloop, web, websocket
class EchoWebSocket(websocket.WebSocketHandler):
def open(self):
print("WebSocket opened")
def on_message(self, message):
self.write_message("You said: " + message)
def on_close(self):
print("WebSocket closed")
class Main... | from tornado import ioloop, web, websocket
class EchoWebSocket(websocket.WebSocketHandler):
def open(self):
print("WebSocket opened")
def on_message(self, message):
self.write_message("You said: " + message)
def on_close(self):
print("WebSocket closed")
SCRIPT = '... | Load file or path now. | Load file or path now.
| Python | bsd-3-clause | GrAndSE/livehtml,GrAndSE/livehtml | ---
+++
@@ -12,15 +12,7 @@
print("WebSocket closed")
-class MainHandler(web.RequestHandler):
- def get(self):
- print 'MainHandler get'
- self.write('''<!DOCTYPE html>
-<html>
-<head>
- <title></title>
-</head>
-<body>
+SCRIPT = '''
<script type="text/javascript">
var ws... |
d00e84e1e41b43f5b680bb310b68444cd9bbcba5 | fireplace/cards/tgt/shaman.py | fireplace/cards/tgt/shaman.py | from ..utils import *
##
# Hero Powers
# Lightning Jolt
class AT_050t:
play = Hit(TARGET, 2)
##
# Minions
# Tuskarr Totemic
class AT_046:
play = Summon(CONTROLLER, RandomTotem())
# Draenei Totemcarver
class AT_047:
play = Buff(SELF, "AT_047e") * Count(FRIENDLY_MINIONS + TOTEM)
# Thunder Bluff Valiant
class... | from ..utils import *
##
# Hero Powers
# Lightning Jolt
class AT_050t:
play = Hit(TARGET, 2)
##
# Minions
# Tuskarr Totemic
class AT_046:
play = Summon(CONTROLLER, RandomTotem())
# Draenei Totemcarver
class AT_047:
play = Buff(SELF, "AT_047e") * Count(FRIENDLY_MINIONS + TOTEM)
# Thunder Bluff Valiant
class... | Implement more TGT Shaman cards | Implement more TGT Shaman cards
| Python | agpl-3.0 | oftc-ftw/fireplace,amw2104/fireplace,amw2104/fireplace,smallnamespace/fireplace,jleclanche/fireplace,liujimj/fireplace,Ragowit/fireplace,Meerkov/fireplace,liujimj/fireplace,smallnamespace/fireplace,Meerkov/fireplace,beheh/fireplace,oftc-ftw/fireplace,Ragowit/fireplace,NightKev/fireplace | ---
+++
@@ -27,6 +27,12 @@
inspire = Buff(FRIENDLY_MINIONS + TOTEM, "AT_049e")
+# The Mistcaller
+class AT_054:
+ # The Enchantment ID is correct
+ play = Buff(FRIENDLY + (IN_DECK | IN_HAND), "AT_045e")
+
+
##
# Spells
|
4021d27a7bd15a396b637beb57c10fc95936cb3f | snippet_parser/fr.py | snippet_parser/fr.py | #-*- encoding: utf-8 -*-
import base
class SnippetParser(base.SnippetParserBase):
def strip_template(self, template, normalize, collapse):
if template.name.matches('unité'):
return ' '.join(map(unicode, template.params[:2]))
elif self.is_citation_needed(template):
repl = [b... | #-*- encoding: utf-8 -*-
import base
def handle_date(template):
year = None
if len(template.params) >= 3:
try:
year = int(unicode(template.params[2]))
except ValueError:
pass
if isinstance(year, int):
# assume {{date|d|m|y|...}}
return ' '.join(map(u... | Implement a couple of other French templates. | Implement a couple of other French templates.
Still need to add tests for these.
| Python | mit | Stryn/citationhunt,jhsoby/citationhunt,Stryn/citationhunt,Stryn/citationhunt,jhsoby/citationhunt,jhsoby/citationhunt,jhsoby/citationhunt,Stryn/citationhunt | ---
+++
@@ -1,11 +1,37 @@
#-*- encoding: utf-8 -*-
import base
+
+def handle_date(template):
+ year = None
+ if len(template.params) >= 3:
+ try:
+ year = int(unicode(template.params[2]))
+ except ValueError:
+ pass
+ if isinstance(year, int):
+ # assume {{date|... |
77c114925fb45fa56c1da358ed47d8222775f99f | tailor/listeners/mainlistener.py | tailor/listeners/mainlistener.py | from tailor.swift.swiftlistener import SwiftListener
from tailor.utils.charformat import isUpperCamelCase
class MainListener(SwiftListener):
def enterClassName(self, ctx):
className = ctx.getText()
if not isUpperCamelCase(className):
print('Line', str(ctx.start.line) + ':', 'Class name... | from tailor.swift.swiftlistener import SwiftListener
from tailor.utils.charformat import isUpperCamelCase
class MainListener(SwiftListener):
def enterClassName(self, ctx):
className = ctx.getText()
if not isUpperCamelCase(className):
print('Line', str(ctx.start.line) + ':', 'Class nam... | Add overrides for UpperCamelCase construct names | Add overrides for UpperCamelCase construct names
| Python | mit | sleekbyte/tailor,sleekbyte/tailor,sleekbyte/tailor,sleekbyte/tailor,sleekbyte/tailor | ---
+++
@@ -1,5 +1,6 @@
from tailor.swift.swiftlistener import SwiftListener
from tailor.utils.charformat import isUpperCamelCase
+
class MainListener(SwiftListener):
@@ -7,3 +8,12 @@
className = ctx.getText()
if not isUpperCamelCase(className):
print('Line', str(ctx.start.line) ... |
f5e6ba58fa29bd89722c1e4bf4ec743eb1125f75 | python/helpers/pycharm/django_manage_shell.py | python/helpers/pycharm/django_manage_shell.py | #!/usr/bin/env python
from fix_getpass import fixGetpass
import os
from django.core import management
import sys
try:
from runpy import run_module
except ImportError:
from runpy_compat import run_module
def run(working_dir):
sys.path.insert(0, working_dir)
manage_file = os.getenv('PYCHARM_DJANGO_MANAGE_MODUL... | #!/usr/bin/env python
from fix_getpass import fixGetpass
import os
from django.core import management
import sys
try:
from runpy import run_module
except ImportError:
from runpy_compat import run_module
def run(working_dir):
sys.path.insert(0, working_dir)
manage_file = os.getenv('PYCHARM_DJANGO_MANAGE_MODUL... | Fix circular import problem in Django console (PY-9030). | Fix circular import problem in Django console (PY-9030).
| Python | apache-2.0 | retomerz/intellij-community,adedayo/intellij-community,muntasirsyed/intellij-community,samthor/intellij-community,michaelgallacher/intellij-community,SerCeMan/intellij-community,apixandru/intellij-community,lucafavatella/intellij-community,wreckJ/intellij-community,caot/intellij-community,signed/intellij-community,hurr... | ---
+++
@@ -28,5 +28,20 @@
fixGetpass()
+ try:
+ #import settings to prevent circular dependencies later on import django.db
+ from django.conf import settings
+ apps=settings.INSTALLED_APPS
+
+ # From django.core.management.shell
+
+ # XXX: (Temporary) workaround for ticket #1796: fo... |
1cba9aec784e54efc647db227a665fa9f88cab27 | dthm4kaiako/config/__init__.py | dthm4kaiako/config/__init__.py | """Configuration for Django system."""
__version__ = "0.9.0"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
| """Configuration for Django system."""
__version__ = "0.9.1"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
| Increment version number to 0.9.1 | Increment version number to 0.9.1
| Python | mit | uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers | ---
+++
@@ -1,6 +1,6 @@
"""Configuration for Django system."""
-__version__ = "0.9.0"
+__version__ = "0.9.1"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num |
0c0b163d6454134595fb8ba794281afe56bc0100 | gae-firebase-listener-python/main.py | gae-firebase-listener-python/main.py | import os
import webapp2
IS_DEV = os.environ["SERVER_SOFTWARE"][:3] == "Dev"
allowed_users = set()
if IS_DEV:
allowed_users.add("dev-instance")
class LoggingHandler(webapp2.RequestHandler):
def post(self):
user = self.request.headers.get('X-Appengine-Inbound-Appid', None)
if user and user in allo... | import os
import webapp2
IS_DEV = os.environ["SERVER_SOFTWARE"][:3] == "Dev"
allowed_users = set()
if IS_DEV:
allowed_users.add("dev-instance")
else:
# Add your Java App Engine proxy App Id here
allowed_users.add("your-java-appengine-proxy-app-id")
class LoggingHandler(webapp2.RequestHandler):
def po... | Add proxy app id to listener | Add proxy app id to listener
| Python | mit | misterwilliam/gae-firebase-event-proxy,misterwilliam/gae-firebase-event-proxy | ---
+++
@@ -5,6 +5,9 @@
allowed_users = set()
if IS_DEV:
allowed_users.add("dev-instance")
+else:
+ # Add your Java App Engine proxy App Id here
+ allowed_users.add("your-java-appengine-proxy-app-id")
class LoggingHandler(webapp2.RequestHandler):
|
0e6253bb0f06ebd4bf81c9e06037398899e37328 | main/bfkdf.py | main/bfkdf.py | import brainfuck
import scrypt
import prng
def hash(password, salt):
k0 = scrypt.hash(password, salt, 512, 4, 8, 96)
code_key = k0[ 0:32]
data_key = k0[32:64]
code_iv = k0[64:80]
data_iv = k0[80:96]
code_rng = prng.AESCTR(code_key, code_iv)
data_rng = prng.AESCTR(data_key, data_iv)
co... | import brainfuck
import scrypt
import prng
def hash(password, salt):
"""The hash function you want to call."""
k0 = scrypt.hash(password, salt, 512, 4, 8, 48)
debug("k0", k0)
rng = prng.AESCTR(k0[:32], k0[32:])
b = run_brainfuck(rng)
k1 = scrypt.hash(b, salt, 512, 4, 8, 32)
debug("k1", k1)... | Make some attempt to preserve randomness. Use only 1 AES CTR step. | Make some attempt to preserve randomness. Use only 1 AES CTR step.
| Python | unlicense | stribika/bfkdf | ---
+++
@@ -3,18 +3,34 @@
import prng
def hash(password, salt):
- k0 = scrypt.hash(password, salt, 512, 4, 8, 96)
- code_key = k0[ 0:32]
- data_key = k0[32:64]
- code_iv = k0[64:80]
- data_iv = k0[80:96]
- code_rng = prng.AESCTR(code_key, code_iv)
- data_rng = prng.AESCTR(data_key, data_iv)... |
db4b8b2abbb1726a3d2db3496b82e0ad6c0572e9 | gateway_mac.py | gateway_mac.py | import socket, struct
import scapy.all as scapy
def get_default_gateway_linux():
"""Read the default gateway directly from /proc."""
with open("/proc/net/route") as fh:
for line in fh:
fields = line.strip().split()
if fields[1] != '00000000' or not int(fields[3], 16) & 2:
... | import socket, struct
import scapy.all as scapy
def get_default_gateway_linux():
"""Read the default gateway directly from /proc."""
routes = []
with open("/proc/net/route") as fh:
for line in fh:
fields = line.strip().split()
if fields[1] != '00000000' or not int(fields[3],... | Update to support multiple default gateways | Update to support multiple default gateways | Python | mit | nulledbyte/scripts | ---
+++
@@ -3,13 +3,17 @@
def get_default_gateway_linux():
"""Read the default gateway directly from /proc."""
+ routes = []
with open("/proc/net/route") as fh:
for line in fh:
fields = line.strip().split()
if fields[1] != '00000000' or not int(fields[3], 16) & 2:
- ... |
b256f2733d32b55e6a3a7ebfa1300b1a13555bab | tools/pdtools/setup.py | tools/pdtools/setup.py | from setuptools import setup, find_packages
setup(
name="pdtools",
version='0.8.0',
author="ParaDrop Labs",
description="ParaDrop development tools",
install_requires=[
'click>=6.7',
'future>=0.16.0',
'PyYAML>=3.12',
'requests>=2.18.1',
'six>=1.10.0'
],
... | from setuptools import setup, find_packages
setup(
name="pdtools",
version='0.8.0',
author="ParaDrop Labs",
description="ParaDrop development tools",
install_requires=[
'click>=6.7',
'future>=0.16.0',
'GitPython>=2.1.5',
'PyYAML>=3.12',
'requests>=2.18.1',
... | Add GitPython dependency for pdtools. | Add GitPython dependency for pdtools.
| Python | apache-2.0 | ParadropLabs/Paradrop,ParadropLabs/Paradrop,ParadropLabs/Paradrop | ---
+++
@@ -8,6 +8,7 @@
install_requires=[
'click>=6.7',
'future>=0.16.0',
+ 'GitPython>=2.1.5',
'PyYAML>=3.12',
'requests>=2.18.1',
'six>=1.10.0' |
4db52d5c8a10460fb9ea4a701e953f790a720f83 | admin/common_auth/forms.py | admin/common_auth/forms.py | from __future__ import absolute_import
from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.admin.widgets import FilteredSelectMultiple
from django.contrib.auth.models import Group
from osf.models.user import OSFUser
from admin.common_auth.models import AdminProfile
cl... | from __future__ import absolute_import
from django import forms
from django.db.models import Q
from django.contrib.auth.models import Group
from admin.common_auth.models import AdminProfile
class LoginForm(forms.Form):
email = forms.CharField(label=u'Email', required=True)
password = forms.CharField(
... | Update UserRegistrationForm to be connected to an existing OSF user. | Update UserRegistrationForm to be connected to an existing OSF user.
| Python | apache-2.0 | aaxelb/osf.io,Nesiehr/osf.io,erinspace/osf.io,brianjgeiger/osf.io,TomBaxter/osf.io,adlius/osf.io,pattisdr/osf.io,CenterForOpenScience/osf.io,baylee-d/osf.io,crcresearch/osf.io,brianjgeiger/osf.io,binoculars/osf.io,adlius/osf.io,laurenrevere/osf.io,mfraezz/osf.io,cslzchen/osf.io,caneruguz/osf.io,chrisseto/osf.io,felliot... | ---
+++
@@ -1,11 +1,9 @@
from __future__ import absolute_import
from django import forms
-from django.contrib.auth.forms import UserCreationForm
-from django.contrib.admin.widgets import FilteredSelectMultiple
+from django.db.models import Q
from django.contrib.auth.models import Group
-from osf.models.user im... |
32c971233fa4c83a163036da0090d35463d43c75 | bananas/management/commands/syncpermissions.py | bananas/management/commands/syncpermissions.py | from django.contrib.auth.models import Permission
from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
help = "Create admin permissions"
def handle(self, *args, **options):
if args: # pragma: no cover
raise CommandError("Command doesn't accept an... | from django.contrib.auth.models import Permission
from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
help = "Create admin permissions"
def handle(self, *args, **options):
if args: # pragma: no cover
raise CommandError("Command doesn't accept an... | Update permission names when syncing | Update permission names when syncing
| Python | mit | 5monkeys/django-bananas,5monkeys/django-bananas,5monkeys/django-bananas | ---
+++
@@ -30,8 +30,8 @@
print("Found new admin view: {} [{}]".format(ct.name, ct.app_label))
for codename, name in model._meta.permissions:
- p, created = Permission.objects.get_or_create(
- codename=codename, name=name, content_type=... |
66cfb6f42cf681d848f944af5bbb7d472280d895 | src/pyuniprot/cli.py | src/pyuniprot/cli.py | import click
from .manager import database
from .webserver.web import get_app
@click.group()
def main():
pass
@main.command()
def update():
"""Update PyUniProt data"""
database.update()
@main.command()
def web():
get_app().run()
| import click
from .manager import database
from .webserver.web import get_app
@click.group()
def main():
pass
@main.command()
def update():
"""Update PyUniProt data"""
database.update()
@main.command()
@click.option('--host', default='0.0.0.0', help='Flask host. Defaults to localhost')
@click.option('--... | Add host and port options to web runner | Add host and port options to web runner
| Python | apache-2.0 | cebel/pyuniprot,cebel/pyuniprot | ---
+++
@@ -11,8 +11,9 @@
"""Update PyUniProt data"""
database.update()
+
@main.command()
-def web():
- get_app().run()
-
-
+@click.option('--host', default='0.0.0.0', help='Flask host. Defaults to localhost')
+@click.option('--port', type=int, help='Flask port. Defaults to 5000')
+def web(host, port)... |
44f0207fe58b6798e612c16c06f3a0ee5b94cc9e | tests/scoring_engine/web/test_admin.py | tests/scoring_engine/web/test_admin.py | from web_test import WebTest
from scoring_engine.models.team import Team
from scoring_engine.models.user import User
class TestAdmin(WebTest):
def setup(self):
super(TestAdmin, self).setup()
team1 = Team(name="Team 1", color="White")
self.db.save(team1)
user1 = User(username='testus... | from web_test import WebTest
from scoring_engine.models.team import Team
from scoring_engine.models.user import User
class TestAdmin(WebTest):
def setup(self):
super(TestAdmin, self).setup()
team1 = Team(name="Team 1", color="White")
self.db.save(team1)
user1 = User(username='testu... | Add extra line for class in test admin | Add extra line for class in test admin
Signed-off-by: Brandon Myers <9cda508be11a1ae7ceef912b85c196946f0ec5f3@mozilla.com>
| Python | mit | pwnbus/scoring_engine,pwnbus/scoring_engine,pwnbus/scoring_engine,pwnbus/scoring_engine | ---
+++
@@ -1,6 +1,7 @@
from web_test import WebTest
from scoring_engine.models.team import Team
from scoring_engine.models.user import User
+
class TestAdmin(WebTest):
def setup(self): |
6556604fb98c2153412384d6f0f705db2da1aa60 | tinycss2/css-parsing-tests/make_color3_hsl.py | tinycss2/css-parsing-tests/make_color3_hsl.py | import colorsys # It turns out Python already does HSL -> RGB!
def trim(s):
return s if not s.endswith('.0') else s[:-2]
print('[')
print(',\n'.join(
'"hsl%s(%s, %s%%, %s%%%s)", [%s, %s, %s, %s]' % (
('a' if a is not None else '', h,
trim(str(s / 10.)), trim(str(l / 10.)),
', %s' ... | import colorsys # It turns out Python already does HSL -> RGB!
def trim(s):
return s if not s.endswith('.0') else s[:-2]
print('[')
print(',\n'.join(
'"hsl%s(%s, %s%%, %s%%%s)", [%s, %s, %s, %s]' % (
('a' if alpha is not None else '', hue,
trim(str(saturation / 10.)), trim(str(light / 10.)... | Fix failing tests with recent versions of pytest-flake8 | Fix failing tests with recent versions of pytest-flake8
| Python | bsd-3-clause | SimonSapin/tinycss2 | ---
+++
@@ -8,16 +8,17 @@
print('[')
print(',\n'.join(
'"hsl%s(%s, %s%%, %s%%%s)", [%s, %s, %s, %s]' % (
- ('a' if a is not None else '', h,
- trim(str(s / 10.)), trim(str(l / 10.)),
- ', %s' % a if a is not None else '') +
+ ('a' if alpha is not None else '', hue,
+ trim(... |
13a39f4e025160f584beef8442e82ec3c3526a95 | raco/myrial/cli_test.py | raco/myrial/cli_test.py | """Basic test of the command-line interface to Myrial."""
import subprocess
import unittest
class CliTest(unittest.TestCase):
def test_cli(self):
out = subprocess.check_output(['python', 'scripts/myrial',
'examples/reachable.myl'])
self.assertIn('DO', out)
... | """Basic test of the command-line interface to Myrial."""
import subprocess
import unittest
class CliTest(unittest.TestCase):
def test_cli(self):
out = subprocess.check_output(['python', 'scripts/myrial',
'examples/reachable.myl'])
self.assertIn('DO', out)
... | Test of standalone myrial mode | Test of standalone myrial mode
| Python | bsd-3-clause | uwescience/raco,uwescience/raco,uwescience/raco,uwescience/raco,uwescience/raco | ---
+++
@@ -12,6 +12,11 @@
self.assertIn('DO', out)
self.assertIn('WHILE', out)
+ def test_cli_standalone(self):
+ out = subprocess.check_output(['python', 'scripts/myrial', '-f',
+ 'examples/standalone.myl'])
+ self.assertIn('Dan Suciu,engine... |
0940612c13094f1950c70b4abc66ddcd76b20544 | setup.py | setup.py | from setuptools import setup
setup(
name='Fulfil-Shop',
version='0.1dev',
packages=['shop'],
license='BSD',
include_package_data=True,
zip_safe=False,
long_description=open('README.rst').read(),
install_requires=[
'Flask',
'Flask-WTF',
'Flask-Assets',
'Fl... | from setuptools import setup
setup(
name='Fulfil-Shop',
version='0.1dev',
packages=['shop'],
license='BSD',
include_package_data=True,
zip_safe=False,
long_description=open('README.rst').read(),
install_requires=[
'Flask',
'Flask-WTF',
'Flask-Assets',
'cs... | Add cssmin and jsmin to requires | Add cssmin and jsmin to requires
| Python | bsd-3-clause | joeirimpan/shop,joeirimpan/shop,joeirimpan/shop | ---
+++
@@ -12,6 +12,8 @@
'Flask',
'Flask-WTF',
'Flask-Assets',
+ 'cssmin',
+ 'jsmin',
'Flask-Login',
'Flask-Cache',
'Flask-DebugToolbar', |
f495656a3a9a19a3bdb7cbb02b188e2c54740626 | setup.py | setup.py | from setuptools import setup
setup(
name='django-kewl',
version=".".join(map(str, __import__('short_url').__version__)),
packages=['django_kewl'],
url='https://github.com/Alir3z4/django-kewl',
license='BSD',
author='Alireza Savand',
author_email='alireza.savand@gmail.com',
description='... | from setuptools import setup
setup(
name='django-kewl',
version=".".join(map(str, __import__('short_url').__version__)),
packages=['django_kewl'],
url='https://github.com/Alir3z4/django-kewl',
license='BSD',
author='Alireza Savand',
author_email='alireza.savand@gmail.com',
description='... | Add BSD license as well | Add BSD license as well
| Python | bsd-3-clause | Alir3z4/django-kewl | ---
+++
@@ -22,6 +22,7 @@
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
- 'Topic :: Software Development'
+ 'Topic :: Software Development',
+ 'License :: OSI Approved :: BSD License',
],
) |
922a0a321ee82ad2f23205f8c1ee55bf2c5a35ab | setup.py | setup.py | import setuptools
from flatdict import __version__
setuptools.setup(
name='flatdict',
version=__version__,
description=('Python module for interacting with nested dicts as a '
'single level dict with delimited keys.'),
long_description=open('README.rst').read(),
author='Gavin M. R... | import setuptools
from flatdict import __version__
setuptools.setup(
name='flatdict',
version=__version__,
description=('Python module for interacting with nested dicts as a '
'single level dict with delimited keys.'),
long_description=open('README.rst').read(),
author='Gavin M. R... | Add 3.7 to the trove classifiers | Add 3.7 to the trove classifiers
| Python | bsd-3-clause | gmr/flatdict,gmr/flatdict | ---
+++
@@ -28,6 +28,7 @@
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
+ 'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: Implementation :: CPython',
'Programmin... |
274d882fbfb97d6d4cbf013fcdf9d8644e22099e | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='tw2.wysihtml5',
version='0.2',
description='WYSIHTML5 widget for ToscaWidgets2',
author='Moritz Schlarb',
author_email='mail@moritz-schlarb.de',
url='https://github.com/toscawidgets/tw2.wysihtml5',
install_requires=[
"tw2.core... | from setuptools import setup, find_packages
setup(
name='tw2.wysihtml5',
version='0.3',
description='WYSIHTML5 widget for ToscaWidgets2',
author='Moritz Schlarb',
author_email='mail@moritz-schlarb.de',
url='https://github.com/toscawidgets/tw2.wysihtml5',
install_requires=[
"tw2.core... | Increase version so that my tests can run... :-] | Increase version so that my tests can run... :-]
| Python | bsd-2-clause | toscawidgets/tw2.wysihtml5,toscawidgets/tw2.wysihtml5 | ---
+++
@@ -2,7 +2,7 @@
setup(
name='tw2.wysihtml5',
- version='0.2',
+ version='0.3',
description='WYSIHTML5 widget for ToscaWidgets2',
author='Moritz Schlarb',
author_email='mail@moritz-schlarb.de', |
a021b077834a932b5c8da6be49bb98e7862392d4 | setup.py | setup.py | import os
from distutils.core import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='django-mingus',
version='0.9.7',
description='A django blog engine.',
long_description=read('README.textile'),
author='Kevin Fricovsky',
author_email=... | import os
from distutils.core import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='django-mingus',
version='0.9.7',
description='A django blog engine.',
long_description=read('README.textile'),
author='Kevin Fricovsky',
author_email=... | Install templates when using pip to install package. | Install templates when using pip to install package.
| Python | apache-2.0 | emorozov/django-mingus,emorozov/django-mingus,emorozov/django-mingus,emorozov/django-mingus | ---
+++
@@ -29,4 +29,5 @@
'Framework :: Django',
],
zip_safe=False,
+ include_package_data=True,
) |
32f7b04861c53cf6367ffcb40b4955334742dbad | setup.py | setup.py | from setuptools import setup
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'flask_swagger_ui/README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='flask-swagger-ui',
... | from setuptools import setup
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'flask_swagger_ui/README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='flask-swagger-ui',
... | Mark the module as not zip safe. | Mark the module as not zip safe.
The template finder code in Flask doesn't handle zipped eggs well,
and thus won't find index.template.html. This makes the module
crash when attempting to load the UI.
| Python | mit | sveint/flask-swagger-ui,sveint/flask-swagger-ui,sveint/flask-swagger-ui | ---
+++
@@ -13,6 +13,7 @@
version='3.0.12a',
description='Swagger UI blueprint for Flask',
long_description=long_description,
+ zip_safe=False,
url='https://github.com/sveint/flask-swagger-ui',
|
e0388a4be8b15964ce87dafcf69805619f273805 | setup.py | setup.py | from setuptools import setup
setup(name='pygraphc',
version='0.0.1',
description='Event log clustering in Python',
long_description='This package contains event log clustering method including non-graph and '
'graph-based approaches.',
classifiers=[
'Developme... | from setuptools import setup
setup(name='pygraphc',
version='0.0.1',
description='Event log clustering in Python',
long_description='This package contains event log clustering method including non-graph and '
'graph-based approaches.',
classifiers=[
'Developme... | Add entry_points to run executable pygraphc | Add entry_points to run executable pygraphc
| Python | mit | studiawan/pygraphc | ---
+++
@@ -18,10 +18,11 @@
license='MIT',
packages=['pygraphc'],
scripts=['scripts/pygraphc'],
+ entry_points={
+ 'console_scripts': ['pygraphc=scripts.pygraphc:main']
+ },
install_requires=[
'networkx',
- 'numpy',
- 'scipy',
... |
3dac61f518a0913faa5bb3350d0161f09b63f0e0 | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup, find_packages
except ImportError:
import ez_setup
ez_setup.use_setuptools()
from setuptools import setup, find_packages
import os
setup(
name = "django-powerdns",
version = "0.1",
url = 'http://bitbucket.org/... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup, find_packages
except ImportError:
import ez_setup
ez_setup.use_setuptools()
from setuptools import setup, find_packages
import os
setup(
name = "django-powerdns",
version = "0.1",
url = 'http://bitbucket.org/... | Add Django as a dependency | Add Django as a dependency
| Python | bsd-2-clause | zefciu/django-powerdns-dnssec,dominikkowalski/django-powerdns-dnssec,allegro/django-powerdns-dnssec,dominikkowalski/django-powerdns-dnssec,dominikkowalski/django-powerdns-dnssec,zefciu/django-powerdns-dnssec,dominikkowalski/django-powerdns-dnssec,zefciu/django-powerdns-dnssec,allegro/django-powerdns-dnssec,dominikkowal... | ---
+++
@@ -34,4 +34,7 @@
'Topic :: Internet :: WWW/HTTP :: WSGI :: Application',
'Topic :: Software Development :: Libraries :: Python Modules',
]
+ install_requires=[
+ 'Django>=1.2',
+ ]
) |
8f2c6cb5da0c456cefe958db305292a0abda8607 | setup.py | setup.py | # -*- coding: utf-8 -*-
"""setup.py -- setup file for antimarkdown
"""
import os
from setuptools import setup
README = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'README.rst')
setup(
name = "antimarkdown",
packages = ['antimarkdown'],
install_requires = [
'lxml',
],
package... | # -*- coding: utf-8 -*-
"""setup.py -- setup file for antimarkdown
"""
import os
from setuptools import setup
README = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'README.rst')
setup(
name = "antimarkdown",
packages = ['antimarkdown'],
install_requires = [
'lxml',
],
package... | Fix license trove classifier, bump to 1.0.1 | Fix license trove classifier, bump to 1.0.1
| Python | mit | Crossway/antimarkdown,Crossway/antimarkdown | ---
+++
@@ -19,7 +19,7 @@
},
zip_safe = False,
- version = "1.0.0",
+ version = "1.0.1",
description = "HTML to Markdown converter.",
long_description = open(README).read(),
author = "David Eyk",
@@ -31,7 +31,7 @@
'Environment :: Console',
'Environment :: Web Environ... |
e1200dfc7a882340037448ff64241786e828c8c3 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='mittn',
use_scm_version=True,
description='Mittn',
long_description=open('README.rst').read(),
classifiers=[
"Programming Language :: Python :: 2.7"
],
license='Apache License 2.0',
author='F-Secure Corporation',
au... | from setuptools import setup, find_packages
setup(
name='mittn',
use_scm_version=True,
description='Mittn',
long_description=open('README.rst').read() + '\n' + open('CHANGELOG.rst').read(),
classifiers=[
"Programming Language :: Python :: 2.7"
],
license='Apache License 2.0',
... | Include changelog on pypi page | Dev: Include changelog on pypi page
| Python | apache-2.0 | F-Secure/mittn,F-Secure/mittn | ---
+++
@@ -5,7 +5,7 @@
name='mittn',
use_scm_version=True,
description='Mittn',
- long_description=open('README.rst').read(),
+ long_description=open('README.rst').read() + '\n' + open('CHANGELOG.rst').read(),
classifiers=[
"Programming Language :: Python :: 2.7"
], |
15437c33fd25a1f10c3203037be3bfef17716fbb | setup.py | setup.py | import os
from setuptools import setup, find_packages
LONG_DESCRIPTION = """Django-Prometheus
This library contains code to expose some monitoring metrics relevant
to Django internals so they can be monitored by Prometheus.io.
See https://github.com/korfuri/django-prometheus for usage
instructions.
"""
setup(
n... | import os
from setuptools import setup, find_packages
LONG_DESCRIPTION = """Django-Prometheus
This library contains code to expose some monitoring metrics relevant
to Django internals so they can be monitored by Prometheus.io.
See https://github.com/korfuri/django-prometheus for usage
instructions.
"""
setup(
n... | Add trove classifiers for Python versions | Add trove classifiers for Python versions
These are set to the versions tested by Travis.
This fixes #39. | Python | apache-2.0 | korfuri/django-prometheus,obytes/django-prometheus,obytes/django-prometheus,korfuri/django-prometheus | ---
+++
@@ -31,6 +31,12 @@
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"Intended Audience :: System Administrators",
+ "Programming Language :: Python :: 2",
+ "Programming Language :: Python :: 2.7",
+ "Programming Language :: Pyth... |
0f97e1427cf86cab4d53f613eb440c1cf4426e6d | setup.py | setup.py | from distutils.core import setup
setup(
name = 'django-test-addons',
packages = ['test_addons'],
version = '0.3.5',
description = 'Library to provide support for testing multiple database system like Mongo, Redis, Neo4j along with django.',
author = 'Hakampreet Singh Pandher',
author_email = 'hspandher@outlook.c... | from distutils.core import setup
setup(
name = 'django-test-addons',
packages = ['test_addons'],
version = '0.3.6',
description = 'Library to provide support for testing multiple database system like Mongo, Redis, Neo4j along with django.',
author = 'Hakampreet Singh Pandher',
author_email = 'hspandher@outlook.c... | Change download url for release 0.3.6 | Change download url for release 0.3.6
| Python | mit | hspandher/django-test-addons | ---
+++
@@ -3,12 +3,12 @@
setup(
name = 'django-test-addons',
packages = ['test_addons'],
- version = '0.3.5',
+ version = '0.3.6',
description = 'Library to provide support for testing multiple database system like Mongo, Redis, Neo4j along with django.',
author = 'Hakampreet Singh Pandher',
author_email ... |
40afc357e0850c71153f8779583fc03f643b2271 | setup.py | setup.py | from setuptools import find_packages, setup
setup(name='satnogsclient',
packages=find_packages(),
version='0.2.5',
author='SatNOGS team',
author_email='client-dev@satnogs.org',
url='https://github.com/satnogs/satnogs-client/',
description='SatNOGS Client',
include_package_dat... | from setuptools import find_packages, setup
setup(
name='satnogsclient',
version='0.2.5',
url='https://github.com/satnogs/satnogs-client/',
author='SatNOGS team',
author_email='client-dev@satnogs.org',
description='SatNOGS Client',
zip_safe=False,
install_requires=[
'APSchedule... | Reorder and group metadata and options together | Reorder and group metadata and options together
| Python | agpl-3.0 | adamkalis/satnogs-client,adamkalis/satnogs-client | ---
+++
@@ -1,30 +1,32 @@
from setuptools import find_packages, setup
-setup(name='satnogsclient',
- packages=find_packages(),
- version='0.2.5',
- author='SatNOGS team',
- author_email='client-dev@satnogs.org',
- url='https://github.com/satnogs/satnogs-client/',
- description='SatN... |
b65b0ed8d09d4a22164f16ed60f7c5b71d6f54db | setup.py | setup.py | import setuptools
from gitvendor.version import Version
from setuptools import find_packages
CLASSIFIERS = [
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: MIT License',
'Environment :: Console',
'Topic :: Software Development'
]
setuptools.setup(name='git-vendor',
ver... | import setuptools
from gitvendor.version import Version
from setuptools import find_packages
CLASSIFIERS = [
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: MIT License',
'Environment :: Console',
'Topic :: Software Development'
]
setuptools.setup(name='git-vendor',
ver... | Move download_url and bump version | Move download_url and bump version
| Python | mit | chuckbutler/git-vendor | ---
+++
@@ -10,12 +10,13 @@
]
setuptools.setup(name='git-vendor',
- version=Version('0.0.1').number,
+ version=Version('0.0.3').number,
description='Vendor tagged releases from git to $VCS',
long_description=open('README.md').read().strip(),
... |
c1d111ab00cdc916412cc2985ef4bbc184166f20 | setup.py | setup.py | """
``onecodex``
------------
``onecodex`` provides a command line client for interaction with the
One Codex API.
Links
`````
* `One Codex: <https://www.onecodex.com/>`
* `API Docs: <http://docs.onecodex.com/>`
"""
from setuptools import setup
setup(
name='onecodex',
version='0.0.1',
url='https://www... | """
``onecodex``
------------
``onecodex`` provides a command line client for interaction with the
One Codex API.
Links
`````
* `One Codex: <https://www.onecodex.com/>`
* `API Docs: <http://docs.onecodex.com/>`
"""
from setuptools import setup
setup(
name='onecodex',
version='0.0.1',
url='https://www... | Change contact field and author field for PyPI. | Change contact field and author field for PyPI.
| Python | mit | onecodex/onecodex,refgenomics/onecodex,refgenomics/onecodex,onecodex/onecodex | ---
+++
@@ -21,8 +21,8 @@
version='0.0.1',
url='https://www.onecodex.com/',
license='MIT',
- author='Nick Boyd Greenfield',
- author_email='nick@onecodex.com',
+ author='Reference Genomics, Inc.',
+ author_email='help@onecodex.com',
description='One Codex Command Line Client',
lon... |
a30ed634f641c3c62dc0d4501ed4cb852c9930d0 | setup.py | setup.py | import os
from setuptools import setup
setup(
name = "augur",
version = "0.1.0",
author = "nextstrain developers",
author_email = "trevor@bedford.io, richard.neher@unibas.ch",
description = ("Pipelines for real-time phylogenetic analysis"),
license = "MIT",
keywo... | import os
from setuptools import setup
setup(
name = "augur",
version = "0.1.0",
author = "nextstrain developers",
author_email = "trevor@bedford.io, richard.neher@unibas.ch",
description = ("Pipelines for real-time phylogenetic analysis"),
license = "MIT",
keywo... | Update TreeTime dep link now that the py3 branch is merged | Update TreeTime dep link now that the py3 branch is merged
| Python | agpl-3.0 | nextstrain/augur,blab/nextstrain-augur,nextstrain/augur,nextstrain/augur | ---
+++
@@ -24,7 +24,7 @@
"treetime ==0.4.0"
],
dependency_links = [
- "https://api.github.com/repos/neherlab/treetime/tarball/py3#egg=treetime-0.4.0"
+ "https://api.github.com/repos/neherlab/treetime/tarball/v0.4.0#egg=treetime-0.4.0"
],
classifi... |
0f18b3ff63bf6183247e7bce25160547f8cfc21d | setup.py | setup.py | import os
import sys
from distutils.core import setup
if sys.version_info < (3,):
print('\nSorry, but Adventure can only be installed under Python 3.\n')
sys.exit(1)
README_PATH = os.path.join(os.path.dirname(__file__), 'adventure', 'README.txt')
with open(README_PATH, encoding="utf-8") as f:
README_TEXT ... | import os
import sys
from distutils.core import setup
if sys.version_info < (3,):
print('\nSorry, but Adventure can only be installed under Python 3.\n')
sys.exit(1)
README_PATH = os.path.join(os.path.dirname(__file__), 'adventure', 'README.txt')
with open(README_PATH, encoding="utf-8") as f:
README_TEXT ... | Change PyPI trove classifier for license terms. | Change PyPI trove classifier for license terms.
| Python | apache-2.0 | devinmcgloin/advent,devinmcgloin/advent | ---
+++
@@ -24,7 +24,7 @@
'Development Status :: 6 - Mature',
'Environment :: Console',
'Intended Audience :: End Users/Desktop',
- 'License :: OSI Approved :: BSD License',
+ 'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 3',... |
1641243682f080257b7f79b35503985d3d72aa44 | setup.py | setup.py | from setuptools import setup
setup(name='osm_hall_monitor',
version='0.2',
description='Passive changeset monitoring for OpenStreetMap.',
url='http://github.com/ethan-nelson/osm_hall_monitor',
author='Ethan Nelson',
author_email='ethan-nelson@users.noreply.github.com',
install_requi... | from setuptools import setup
setup(name='osm_hall_monitor',
version='0.2',
description='Passive changeset monitoring for OpenStreetMap.',
url='http://github.com/ethan-nelson/osm_hall_monitor',
author='Ethan Nelson',
author_email='ethan-nelson@users.noreply.github.com',
install_requi... | Fix requirement for diff tool | Fix requirement for diff tool
| Python | mit | ethan-nelson/osm_hall_monitor | ---
+++
@@ -6,7 +6,7 @@
url='http://github.com/ethan-nelson/osm_hall_monitor',
author='Ethan Nelson',
author_email='ethan-nelson@users.noreply.github.com',
- install_requires = ['psycopg2','osmdt'],
+ install_requires = ['psycopg2','osm_diff_tool'],
packages=['osmhm'],
zip... |
024878fc913097364123d28a99ab7cb5501b0af5 | setup.py | setup.py | #!/usr/bin/env python
import subprocess
from distutils.core import setup
requirements = [pkg.split('=')[0] for pkg in open('requirements.txt').readlines()]
description = 'Download videos from Udemy for personal offline use'
try:
subprocess.call(["pandoc", "README.md", "-f", "markdown", "-t", "rst", "-o", "README... | #!/usr/bin/env python
import os
import subprocess
from distutils.core import setup
requirements = [pkg.split('=')[0] for pkg in open('requirements.txt').readlines()]
description = 'Download videos from Udemy for personal offline use'
try:
subprocess.call(["pandoc", "README.md", "-f", "markdown", "-t", "rst", "-o... | Set permission mask to allow read/exec for all users | Set permission mask to allow read/exec for all users
| Python | unlicense | rinodung/udemy-dl | ---
+++
@@ -1,5 +1,6 @@
#!/usr/bin/env python
+import os
import subprocess
from distutils.core import setup
@@ -21,6 +22,10 @@
version = open('CHANGES.txt').readlines()[0][1:].strip()
+# if installed as root or with sudo, set permission mask to allow read/exec for all users
+if os.getuid() == 0:
+ os.u... |
f27e08b0dcace5b9f49c5b2a211347a2f50f8254 | stats.py | stats.py | from bs4 import BeautifulSoup
import requests
def statsRoyale(tag):
link = 'http://statsroyale.com/profile/' + tag
response = (requests.get(link)).text
soup = BeautifulSoup(response, 'html.parser')
stats = {}
content = soup.find_all('div', {'class':'content'})
stats['clan'] = content[0].get_text()
if stats['cl... | from bs4 import BeautifulSoup
import requests
def statsRoyale(tag):
if not tag.find('/') == -1:
tag = tag[::-1]
pos = tag.find('/')
tag = tag[:pos]
tag = tag[::-1]
link = 'http://statsroyale.com/profile/' + tag
response = (requests.get(link)).text
soup = BeautifulSoup(response, 'html.parser')
descriptio... | Use tags or direct url | Use tags or direct url | Python | mit | atulya2109/Stats-Royale-Python | ---
+++
@@ -2,26 +2,29 @@
import requests
def statsRoyale(tag):
+ if not tag.find('/') == -1:
+ tag = tag[::-1]
+ pos = tag.find('/')
+ tag = tag[:pos]
+ tag = tag[::-1]
+
link = 'http://statsroyale.com/profile/' + tag
response = (requests.get(link)).text
soup = BeautifulSoup(response, 'html.parser')
+
... |
30d108b3a206d938ef67c112bc6c953a12c606af | tasks.py | tasks.py | """Task functions for use with Invoke."""
from invoke import task
@task
def clean(context):
cmd = '$(npm bin)/gulp clean'
context.run(cmd)
@task
def requirements(context):
steps = [
'pip install -r requirements.txt',
'npm install',
'$(npm bin)/bower install',
]
cmd = ' &... | """Task functions for use with Invoke."""
from invoke import task
@task
def clean(context):
cmd = '$(npm bin)/gulp clean'
context.run(cmd)
@task
def requirements(context):
steps = [
'pip install -r requirements.txt',
'npm install',
'$(npm bin)/bower install',
]
cmd = ' &... | Allow specifying custom host and port when starting app | Allow specifying custom host and port when starting app
| Python | mit | rlucioni/typesetter,rlucioni/typesetter,rlucioni/typesetter | ---
+++
@@ -20,12 +20,14 @@
context.run(cmd)
+
@task
-def run(context):
+def run(context, host='127.0.0.1', port='5000'):
steps = [
- 'open http://127.0.0.1:5000/',
- 'FLASK_APP=typesetter/typesetter.py FLASK_DEBUG=1 flask run',
+ 'open http://{host}:{port}/',
+ 'FLASK_APP=t... |
c05b06577785bdf34f1fcd051ecf6d4398d2f77e | tasks.py | tasks.py | from os.path import join
from invoke import Collection, ctask as task
from invocations import docs as _docs
d = 'sites'
# Usage doc/API site (published as docs.paramiko.org)
path = join(d, 'docs')
docs = Collection.from_module(_docs, name='docs', config={
'sphinx.source': path,
'sphinx.target': join(path, '... | from os.path import join
from shutil import rmtree, move
from invoke import Collection, ctask as task
from invocations import docs as _docs
from invocations.packaging import publish
d = 'sites'
# Usage doc/API site (published as docs.paramiko.org)
docs_path = join(d, 'docs')
docs_build = join(docs_path, '_build')
d... | Add new release task w/ API doc prebuilding | Add new release task w/ API doc prebuilding
| Python | lgpl-2.1 | thusoy/paramiko,CptLemming/paramiko,rcorrieri/paramiko,redixin/paramiko,Automatic/paramiko,jaraco/paramiko,esc/paramiko,ameily/paramiko,zarr12steven/paramiko,dorianpula/paramiko,mirrorcoder/paramiko,jorik041/paramiko,thisch/paramiko,dlitz/paramiko,paramiko/paramiko,digitalquacks/paramiko,fvicente/paramiko,SebastianDeis... | ---
+++
@@ -1,23 +1,26 @@
from os.path import join
+from shutil import rmtree, move
from invoke import Collection, ctask as task
from invocations import docs as _docs
+from invocations.packaging import publish
d = 'sites'
# Usage doc/API site (published as docs.paramiko.org)
-path = join(d, 'docs')
+docs... |
f4ba2cba93222b4dd494caf487cdd6be4309e41a | studygroups/forms.py | studygroups/forms.py | from django import forms
from studygroups.models import StudyGroupSignup, Application
from localflavor.us.forms import USPhoneNumberField
class ApplicationForm(forms.ModelForm):
mobile = USPhoneNumberField(required=False)
class Meta:
model = Application
labels = {
'name': 'Please t... | from django import forms
from studygroups.models import StudyGroupSignup, Application
from localflavor.us.forms import USPhoneNumberField
class ApplicationForm(forms.ModelForm):
mobile = USPhoneNumberField(required=False)
class Meta:
model = Application
labels = {
'name': 'Please t... | Update labels for application form | Update labels for application form
| Python | mit | p2pu/learning-circles,p2pu/learning-circles,p2pu/learning-circles,p2pu/learning-circles | ---
+++
@@ -10,10 +10,11 @@
labels = {
'name': 'Please tell us what to call you',
'mobile': 'What is your mobile number?',
- 'contact_method': 'Please tell us how would you perfer us to contact us',
- 'computer_access': 'Do you have normal everyday access to th... |
6755255332039ab3c0ea60346f61420b52e2f474 | tests/functional/test_l10n.py | tests/functional/test_l10n.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import random
import pytest
from ..pages.home import HomePage
@pytest.mark.nondestructive
def test_change_language(b... | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import random
import pytest
from ..pages.home import HomePage
@pytest.mark.nondestructive
def test_change_language(b... | Fix intermittent failure in l10n language selector test | Fix intermittent failure in l10n language selector test
| Python | mpl-2.0 | sgarrity/bedrock,TheoChevalier/bedrock,craigcook/bedrock,mkmelin/bedrock,TheoChevalier/bedrock,Sancus/bedrock,hoosteeno/bedrock,sylvestre/bedrock,schalkneethling/bedrock,Sancus/bedrock,analytics-pros/mozilla-bedrock,sylvestre/bedrock,glogiotatidis/bedrock,jgmize/bedrock,kyoshino/bedrock,mkmelin/bedrock,gerv/bedrock,dav... | ---
+++
@@ -18,5 +18,5 @@
available = [l for l in page.footer.languages if l not in excluded]
new = random.choice(available)
page.footer.select_language(new)
- assert new in selenium.current_url, 'Language is not in URL'
+ assert '/{0}/'.format(new) in selenium.current_url, 'Language is not in UR... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.