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
92e7164cf152700c4ae60013bfbb9536e425a64c
neo/rawio/tests/test_nixrawio.py
neo/rawio/tests/test_nixrawio.py
import unittest from neo.rawio.nixrawio import NIXRawIO from neo.rawio.tests.common_rawio_test import BaseTestRawIO testfname = "neoraw.nix" class TestNixRawIO(BaseTestRawIO, unittest.TestCase, ): rawioclass = NIXRawIO entities_to_test = [testfname] files_to_download = [testfname] if __name__ == "__mai...
import unittest from neo.rawio.nixrawio import NIXRawIO from neo.rawio.tests.common_rawio_test import BaseTestRawIO testfname = "nixrawio-1.5.nix" class TestNixRawIO(BaseTestRawIO, unittest.TestCase): rawioclass = NIXRawIO entities_to_test = [testfname] files_to_download = [testfname] if __name__ == "...
Change filename for NIXRawIO tests
[nixio] Change filename for NIXRawIO tests
Python
bsd-3-clause
NeuralEnsemble/python-neo,INM-6/python-neo,JuliaSprenger/python-neo,apdavison/python-neo,rgerkin/python-neo,samuelgarcia/python-neo
<REPLACE_OLD> "neoraw.nix" class <REPLACE_NEW> "nixrawio-1.5.nix" class <REPLACE_END> <REPLACE_OLD> unittest.TestCase, ): <REPLACE_NEW> unittest.TestCase): <REPLACE_END> <|endoftext|> import unittest from neo.rawio.nixrawio import NIXRawIO from neo.rawio.tests.common_rawio_test import BaseTestRawIO testfname = "...
[nixio] Change filename for NIXRawIO tests import unittest from neo.rawio.nixrawio import NIXRawIO from neo.rawio.tests.common_rawio_test import BaseTestRawIO testfname = "neoraw.nix" class TestNixRawIO(BaseTestRawIO, unittest.TestCase, ): rawioclass = NIXRawIO entities_to_test = [testfname] files_to_do...
5ac6cc208bf1a3fbe4e860a2356102a2457a1e43
server/mod_auth/auth.py
server/mod_auth/auth.py
from app_factory.create_app import db from models import User from forms import RegistrationForm, LoginForm def load_user(user_id): return User.query.filter_by(id=user_id).first() def login(request): form = LoginForm.from_json(request.form) if request.method == 'POST' and form.validate(): return...
from models import User from forms import LoginForm def load_user(user_id): """Returns a user from the database based on their id""" return User.query.filter_by(id=user_id).first() def login(request): """Handle a login request from a user.""" form = LoginForm.from_json(request.form) if request.m...
Clean up unused imports and add docstrings
Clean up unused imports and add docstrings
Python
mit
ganemone/ontheside,ganemone/ontheside,ganemone/ontheside
<DELETE> app_factory.create_app import db from <DELETE_END> <DELETE> RegistrationForm, <DELETE_END> <INSERT> """Returns a user from the database based on their id""" <INSERT_END> <INSERT> """Handle a login request from a user.""" <INSERT_END> <|endoftext|> from models import User from forms import LoginForm d...
Clean up unused imports and add docstrings from app_factory.create_app import db from models import User from forms import RegistrationForm, LoginForm def load_user(user_id): return User.query.filter_by(id=user_id).first() def login(request): form = LoginForm.from_json(request.form) if request.method =...
7a3ee543960495ed720cfcaccbbe7a8afcfed0dd
l10n_br_coa_generic/hooks.py
l10n_br_coa_generic/hooks.py
# Copyright (C) 2020 - Gabriel Cardoso de Faria <gabriel.cardoso@kmee.com.br> # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from odoo import api, tools, SUPERUSER_ID def post_init_hook(cr, registry): env = api.Environment(cr, SUPERUSER_ID, {}) coa_generic_tmpl = env.ref( 'l10n_br_c...
# Copyright (C) 2020 - Gabriel Cardoso de Faria <gabriel.cardoso@kmee.com.br> # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from odoo import api, tools, SUPERUSER_ID def post_init_hook(cr, registry): env = api.Environment(cr, SUPERUSER_ID, {}) coa_generic_tmpl = env.ref( 'l10n_br_c...
Use admin user to create COA
[FIX] l10n_br_coa_generic: Use admin user to create COA
Python
agpl-3.0
akretion/l10n-brazil,akretion/l10n-brazil,OCA/l10n-brazil,akretion/l10n-brazil,OCA/l10n-brazil,OCA/l10n-brazil
<REPLACE_OLD> env.user.company_id <REPLACE_NEW> user_admin = env.ref('base.user_admin') user_admin.company_id <REPLACE_END> <REPLACE_OLD> 'l10n_br_fiscal.empresa_lucro_presumido') <REPLACE_NEW> 'l10n_br_base.empresa_lucro_presumido') <REPLACE_END> <REPLACE_OLD> coa_generic_tmpl.try_loading_for_current_company...
[FIX] l10n_br_coa_generic: Use admin user to create COA # Copyright (C) 2020 - Gabriel Cardoso de Faria <gabriel.cardoso@kmee.com.br> # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from odoo import api, tools, SUPERUSER_ID def post_init_hook(cr, registry): env = api.Environment(cr, SUPERUSER_I...
74d9bf3818b2c93e78028b5ff24e4c0b7e231ce1
scripts/downgrade-pip-on-pypy.py
scripts/downgrade-pip-on-pypy.py
""" Downgrade to pip < 20.2 when running on PyPy because pip 20.2 (the most recent release at the time of writing) breaks compatibility with PyPy, thereby causing Travis CI builds of py2deb to fail as well. For more details please refer to https://github.com/pypa/pip/issues/8653. """ import pip import platform import ...
""" Downgrade to pip < 20.2 when running on PyPy. Unfortunately pip 20.2 (the most recent release at the time of writing) breaks compatibility with PyPy, thereby causing Travis CI builds of py2deb to fail as well. For details please refer to https://github.com/pypa/pip/issues/8653. """ import pip import platform impo...
Fix flake8 "violations" in new PyPy compensation script
Fix flake8 "violations" in new PyPy compensation script
Python
mit
paylogic/py2deb,paylogic/py2deb
<REPLACE_OLD> PyPy because <REPLACE_NEW> PyPy. Unfortunately <REPLACE_END> <REPLACE_OLD> recent release <REPLACE_NEW> recent release <REPLACE_END> <REPLACE_OLD> breaks compatibility <REPLACE_NEW> breaks compatibility <REPLACE_END> <REPLACE_OLD> causing Travis <REPLACE_NEW> causing Travis <REPLACE_END> <REPLACE_OLD> as...
Fix flake8 "violations" in new PyPy compensation script """ Downgrade to pip < 20.2 when running on PyPy because pip 20.2 (the most recent release at the time of writing) breaks compatibility with PyPy, thereby causing Travis CI builds of py2deb to fail as well. For more details please refer to https://github.com/pypa...
b87073e7c7d4387b6608142de7fd6216a1d093b9
setup.py
setup.py
from distutils.core import setup setup(name = "bitey", description="Bitcode Import Tool", long_description = """ Bitey allows LLVM bitcode to be directly imported into Python as an high performance extension module without the need for writing wrappers. """, license="""BSD""", ...
from distutils.core import setup setup(name = "bitey", description="Bitcode Import Tool", long_description = """ Bitey allows LLVM bitcode to be directly imported into Python as an high performance extension module without the need for writing wrappers. """, license="""BSD""", ...
Add trove classifier for Python 3
Add trove classifier for Python 3
Python
bsd-3-clause
dabeaz/bitey,dabeaz/bitey
<INSERT> 'Programming Language :: Python :: 3', <INSERT_END> <|endoftext|> from distutils.core import setup setup(name = "bitey", description="Bitcode Import Tool", long_description = """ Bitey allows LLVM bitcode to be directly imported into Python as an high performance extension...
Add trove classifier for Python 3 from distutils.core import setup setup(name = "bitey", description="Bitcode Import Tool", long_description = """ Bitey allows LLVM bitcode to be directly imported into Python as an high performance extension module without the need for writing wrappers. """, ...
4ca8889396595f9da99becbb88fb7e38ab0ed560
hunter/reviewsapi.py
hunter/reviewsapi.py
import requests import os from .endpoints import * class UnauthorizedToken(Exception): pass class ReviewsAPI: def __init__(self): token = os.environ.get('UDACITY_AUTH_TOKEN') self.headers = {'Authorization': token, 'Content-Length': '0'} def certifications(self): try: ...
import requests import os from .endpoints import * class UnauthorizedToken(Exception): pass class ReviewsAPI: def __init__(self): token = os.environ.get('UDACITY_AUTH_TOKEN') self.headers = {'Authorization': token, 'Content-Length': '0'} def certifications(self): try: ...
Raise exception if connection not succeed and customize error message
Raise exception if connection not succeed and customize error message
Python
mit
anapaulagomes/reviews-assigner
<INSERT> raw_response.raise_for_status() <INSERT_END> <REPLACE_OLD> UnauthorizedToken <REPLACE_NEW> UnauthorizedToken('Maybe it\'s time to change you token!') <REPLACE_END> <|endoftext|> import requests import os from .endpoints import * class UnauthorizedToken(Exception): pass cla...
Raise exception if connection not succeed and customize error message import requests import os from .endpoints import * class UnauthorizedToken(Exception): pass class ReviewsAPI: def __init__(self): token = os.environ.get('UDACITY_AUTH_TOKEN') self.headers = {'Authorization': token, 'Cont...
ee53ec51d98802bf0bc55e70c39cc0918f2bb274
icekit/plugins/blog_post/content_plugins.py
icekit/plugins/blog_post/content_plugins.py
""" Definition of the plugin. """ from django.apps import apps from django.conf import settings from django.db.models.loading import get_model from django.utils.translation import ugettext_lazy as _ from fluent_contents.extensions import ContentPlugin, plugin_pool default_blog_model = 'blog_tools.BlogPost' icekit_blo...
""" Definition of the plugin. """ from django.apps import apps from django.conf import settings from django.utils.translation import ugettext_lazy as _ from fluent_contents.extensions import ContentPlugin, plugin_pool default_blog_model = 'blog_tools.BlogPost' icekit_blog_model = getattr(settings, 'ICEKIT_BLOG_MODEL'...
Update Blog model and content item matching
Update Blog model and content item matching
Python
mit
ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit
<DELETE> django.db.models.loading import get_model from <DELETE_END> <REPLACE_OLD> get_model(getattr(settings, <REPLACE_NEW> apps.get_model(getattr(settings, <REPLACE_END> <REPLACE_OLD> 'blog_post.PostItem')) <REPLACE_NEW> 'blog_post.BlogPostItem')) <REPLACE_END> <|endoftext|> """ Definition of the plugin. """ from d...
Update Blog model and content item matching """ Definition of the plugin. """ from django.apps import apps from django.conf import settings from django.db.models.loading import get_model from django.utils.translation import ugettext_lazy as _ from fluent_contents.extensions import ContentPlugin, plugin_pool default_...
723d7410b48fd4fc42ed9afe470ba3b37381599a
noxfile.py
noxfile.py
"""Development automation.""" import nox def _install_this_editable(session, *, extras=None): if extras is None: extras = [] session.install("flit") session.run( "flit", "install", "-s", "--deps=production", "--extras", ",".join(extras), si...
"""Development automation.""" import nox def _install_this_editable(session, *, extras=None): if extras is None: extras = [] session.install("flit") session.run( "flit", "install", "-s", "--deps=production", "--extras", ",".join(extras), si...
Add docs-live to perform demo-runs
Add docs-live to perform demo-runs
Python
mit
GaretJax/sphinx-autobuild
<INSERT> "build/docs") @nox.session(name="docs-live") def docs_live(session): _install_this_editable(session, extras=["docs"]) session.run("sphinx-autobuild", "-b", "html", "docs/", <INSERT_END> <|endoftext|> """Development automation.""" import nox def _install_this_editable(session, *, extras=None): ...
Add docs-live to perform demo-runs """Development automation.""" import nox def _install_this_editable(session, *, extras=None): if extras is None: extras = [] session.install("flit") session.run( "flit", "install", "-s", "--deps=production", "--extras", ...
dd1e7b06c4fbb31da91a14a57d98b4910eb4a351
candidates/tests/helpers.py
candidates/tests/helpers.py
from __future__ import print_function import difflib import pprint import sys def p(*args): """A helper for printing to stderr""" print(file=sys.stderr, *args) def equal_arg(arg1, arg2): """Return True if the args are equal, False otherwise If the arguments aren't equal under ==, return True, other...
Add equal_call_args for helpful diffs of args
Add equal_call_args for helpful diffs of args This is particularly useful because mock's assert_called_with produces really unhelpful output if the the expectation doesn't match.
Python
agpl-3.0
neavouli/yournextrepresentative,neavouli/yournextrepresentative,mhl/yournextmp-popit,neavouli/yournextrepresentative,datamade/yournextmp-popit,openstate/yournextrepresentative,mysociety/yournextmp-popit,DemocracyClub/yournextrepresentative,mysociety/yournextmp-popit,mhl/yournextmp-popit,neavouli/yournextrepresentative,...
<REPLACE_OLD> <REPLACE_NEW> from __future__ import print_function import difflib import pprint import sys def p(*args): """A helper for printing to stderr""" print(file=sys.stderr, *args) def equal_arg(arg1, arg2): """Return True if the args are equal, False otherwise If the arguments aren't equal...
Add equal_call_args for helpful diffs of args This is particularly useful because mock's assert_called_with produces really unhelpful output if the the expectation doesn't match.
02c18a46935d58ac08a340e5011fb345ffb7f83a
h2o-py/tests/testdir_algos/gbm/pyunit_cup98_01GBM_medium.py
h2o-py/tests/testdir_algos/gbm/pyunit_cup98_01GBM_medium.py
import sys sys.path.insert(1, "../../../") import h2o def cupMediumGBM(ip,port): # Connect to h2o h2o.init(ip,port) train = h2o.import_frame(path=h2o.locate("bigdata/laptop/usecases/cup98LRN_z.csv")) test = h2o.import_frame(path=h2o.locate("bigdata/laptop/usecases/cup98VAL_z.csv")) train["TARGET_B"] = trai...
import sys sys.path.insert(1, "../../../") import h2o def cupMediumGBM(ip,port): # Connect to h2o h2o.init(ip,port) train = h2o.import_frame(path=h2o.locate("bigdata/laptop/usecases/cup98LRN_z.csv")) test = h2o.import_frame(path=h2o.locate("bigdata/laptop/usecases/cup98VAL_z.csv")) train["TARGET_B"] = trai...
Update test for new column naming rules. Remove '' as a name and call column 'C1'
Update test for new column naming rules. Remove '' as a name and call column 'C1'
Python
apache-2.0
bospetersen/h2o-3,spennihana/h2o-3,mrgloom/h2o-3,michalkurka/h2o-3,spennihana/h2o-3,PawarPawan/h2o-v3,jangorecki/h2o-3,junwucs/h2o-3,printedheart/h2o-3,kyoren/https-github.com-h2oai-h2o-3,michalkurka/h2o-3,michalkurka/h2o-3,datachand/h2o-3,ChristosChristofidis/h2o-3,bospetersen/h2o-3,brightchen/h2o-3,jangorecki/h2o-3,m...
<REPLACE_OLD> ['', <REPLACE_NEW> ['C1', <REPLACE_END> <|endoftext|> import sys sys.path.insert(1, "../../../") import h2o def cupMediumGBM(ip,port): # Connect to h2o h2o.init(ip,port) train = h2o.import_frame(path=h2o.locate("bigdata/laptop/usecases/cup98LRN_z.csv")) test = h2o.import_frame(path=h2o.locate("b...
Update test for new column naming rules. Remove '' as a name and call column 'C1' import sys sys.path.insert(1, "../../../") import h2o def cupMediumGBM(ip,port): # Connect to h2o h2o.init(ip,port) train = h2o.import_frame(path=h2o.locate("bigdata/laptop/usecases/cup98LRN_z.csv")) test = h2o.import_frame(pa...
92b9b33a13b093d1a9bf6ac22b000405a3403234
chandra_aca/tests/test_residuals.py
chandra_aca/tests/test_residuals.py
import numpy as np from ..centroid_resid import get_obs_slot_residuals def test_multi_ai(): # obsid 15175 has two aspect intervals dyags, dzags = get_obs_slot_residuals(15175, 4) assert np.all(np.abs(dyags) < 3) assert np.all(np.abs(dzags) < 6) def test_obc_centroids(): dyags, dzags = get_obs_slot...
import numpy as np from ..centroid_resid import get_obs_slot_residuals def test_multi_ai(): # obsid 15175 has two aspect intervals dyags, yt, dzags, zt = get_obs_slot_residuals(15175, 4) assert np.all(np.abs(dyags) < 3) assert np.all(np.abs(dzags) < 6) def test_obc_centroids(): dyags, yt, dzags, z...
Update tests using helper method for new API
Update tests using helper method for new API
Python
bsd-2-clause
sot/chandra_aca,sot/chandra_aca
<REPLACE_OLD> dzags <REPLACE_NEW> yt, dzags, zt <REPLACE_END> <REPLACE_OLD> dzags <REPLACE_NEW> yt, dzags, zt <REPLACE_END> <REPLACE_OLD> dzags <REPLACE_NEW> yt, dzags, zt <REPLACE_END> <|endoftext|> import numpy as np from ..centroid_resid import get_obs_slot_residuals def test_multi_ai(): # obsid 15175 has two a...
Update tests using helper method for new API import numpy as np from ..centroid_resid import get_obs_slot_residuals def test_multi_ai(): # obsid 15175 has two aspect intervals dyags, dzags = get_obs_slot_residuals(15175, 4) assert np.all(np.abs(dyags) < 3) assert np.all(np.abs(dzags) < 6) def test_ob...
69c2921f308ef1bd102ba95152ebdeccf72b8f6e
source/seedsource/tasks/cleanup_tifs.py
source/seedsource/tasks/cleanup_tifs.py
from django.conf import settings import os import os.path import time import re from celery.task import task @task def cleanup_temp_tif_files(age=7200): temp_dir = settings.DATASET_DOWNLOAD_DIR cutoff = time.time() - age t_files = os.listdir(temp_dir) for t_file in t_files: if re.search('.tif$'...
from django.conf import settings import os import os.path import time import re from celery.task import task @task def cleanup_temp_tif_files(age=7200): temp_dir = settings.DATASET_DOWNLOAD_DIR cutoff = time.time() - age t_files = os.listdir(temp_dir) for t_file in t_files: if re.search('.zip$'...
Update GeoTIFF cleanup to cleanup .zip
Update GeoTIFF cleanup to cleanup .zip
Python
bsd-3-clause
consbio/seedsource,consbio/seedsource,consbio/seedsource
<REPLACE_OLD> re.search('.tif$', <REPLACE_NEW> re.search('.zip$', <REPLACE_END> <|endoftext|> from django.conf import settings import os import os.path import time import re from celery.task import task @task def cleanup_temp_tif_files(age=7200): temp_dir = settings.DATASET_DOWNLOAD_DIR cutoff = time.time() - ...
Update GeoTIFF cleanup to cleanup .zip from django.conf import settings import os import os.path import time import re from celery.task import task @task def cleanup_temp_tif_files(age=7200): temp_dir = settings.DATASET_DOWNLOAD_DIR cutoff = time.time() - age t_files = os.listdir(temp_dir) for t_file...
9ebe165f7534539012eddb70e8e4ba5b73280ce0
scripts/sendfile.py
scripts/sendfile.py
import os, socket, sys, struct, getopt def sendfile(filename, ip): statinfo = os.stat(filename) fbiinfo = struct.pack('!q', statinfo.st_size) with open(filename, 'rb') as f: sock = socket.socket() sock.connect((ip, 5000)) sock.send(fbiinfo) while True: chunk = f.read(16384) if not chunk: break # ...
Add script for network CIA installation using FBI
Add script for network CIA installation using FBI
Python
mit
cpp3ds/cpp3ds,cpp3ds/cpp3ds,cpp3ds/cpp3ds,cpp3ds/cpp3ds
<INSERT> import os, socket, sys, struct, getopt def sendfile(filename, ip): statinfo = os.stat(filename) fbiinfo = struct.pack('!q', statinfo.st_size) with open(filename, 'rb') as f: sock = socket.socket() sock.connect((ip, 5000)) sock.send(fbiinfo) while True: chunk = f.read(16384) if not chunk: ...
Add script for network CIA installation using FBI
983df9ceaebb42ca31b131f437362193070eb1db
paasta_tools/clusterman.py
paasta_tools/clusterman.py
import staticconf CLUSTERMAN_YAML_FILE_PATH = '/nail/srv/configs/clusterman.yaml' CLUSTERMAN_METRICS_YAML_FILE_PATH = '/nail/srv/configs/clusterman_metrics.yaml' def get_clusterman_metrics(): try: import clusterman_metrics clusterman_yaml = CLUSTERMAN_YAML_FILE_PATH staticconf.YamlConfigu...
import staticconf CLUSTERMAN_YAML_FILE_PATH = '/nail/srv/configs/clusterman.yaml' CLUSTERMAN_METRICS_YAML_FILE_PATH = '/nail/srv/configs/clusterman_metrics.yaml' def get_clusterman_metrics(): try: import clusterman_metrics clusterman_yaml = CLUSTERMAN_YAML_FILE_PATH staticconf.YamlConfigu...
Fix regression in manpages build
Fix regression in manpages build
Python
apache-2.0
Yelp/paasta,Yelp/paasta
<REPLACE_OLD> ImportError: <REPLACE_NEW> (ImportError, FileNotFoundError): <REPLACE_END> <|endoftext|> import staticconf CLUSTERMAN_YAML_FILE_PATH = '/nail/srv/configs/clusterman.yaml' CLUSTERMAN_METRICS_YAML_FILE_PATH = '/nail/srv/configs/clusterman_metrics.yaml' def get_clusterman_metrics(): try: imp...
Fix regression in manpages build import staticconf CLUSTERMAN_YAML_FILE_PATH = '/nail/srv/configs/clusterman.yaml' CLUSTERMAN_METRICS_YAML_FILE_PATH = '/nail/srv/configs/clusterman_metrics.yaml' def get_clusterman_metrics(): try: import clusterman_metrics clusterman_yaml = CLUSTERMAN_YAML_FILE_P...
54a6031c54c8b64eeeed7a28f7836f886022bdd0
main.py
main.py
from evaluate_user import evaluate_user def main(): user_id = "" while user_id != 'exit': user_id = raw_input("Enter user id: ") if user_id != 'exit' and evaluate_user(user_id) == 1: print("Cannot evaluate user.\n") if __name__ == "__main__": main()
from evaluate_user import evaluate_user from Tkinter import * from ScrolledText import ScrolledText from ttk import Frame, Button, Label, Style import re class EvaluatorWindow(Frame): def __init__(self, parent): Frame.__init__(self, parent) self.parent = parent self.parent.title("Twitte...
Replace line endings with whitespace instead of deleting them.
Replace line endings with whitespace instead of deleting them.
Python
apache-2.0
ngrudzinski/sentiment_analysis_437
<REPLACE_OLD> evaluate_user def main(): <REPLACE_NEW> evaluate_user from Tkinter import * from ScrolledText import ScrolledText from ttk import Frame, Button, Label, Style import re class EvaluatorWindow(Frame): def __init__(self, parent): Frame.__init__(self, parent) self.parent = parent ...
Replace line endings with whitespace instead of deleting them. from evaluate_user import evaluate_user def main(): user_id = "" while user_id != 'exit': user_id = raw_input("Enter user id: ") if user_id != 'exit' and evaluate_user(user_id) == 1: print("Cannot evaluate user.\n") if...
b6db7abfd59a1b97fbb4d1b867e3316c029c94ff
spec/Report_S06_spec.py
spec/Report_S06_spec.py
from expects import expect, equal from primestg.report import Report from ast import literal_eval with description('Report S06 example'): with before.all: self.data_filenames = [ 'spec/data/S06.xml', # 'spec/data/S06_empty.xml' ] self.report = [] for data_...
from expects import expect, equal from primestg.report import Report from ast import literal_eval with description('Report S06 example'): with before.all: self.data_filenames = [ 'spec/data/S06.xml', 'spec/data/S06_with_error.xml', # 'spec/data/S06_empty.xml' ]...
TEST for correct an with errors S06 report
TEST for correct an with errors S06 report
Python
agpl-3.0
gisce/primestg
<INSERT> 'spec/data/S06_with_error.xml', <INSERT_END> <INSERT> warnings = [] <INSERT_END> <INSERT> result = [] <INSERT_END> <REPLACE_OLD> literal_eval(result_string) result = self.report[key].values <REPLACE_NEW> literal_eval(result_string) for cnc in self.report[ke...
TEST for correct an with errors S06 report from expects import expect, equal from primestg.report import Report from ast import literal_eval with description('Report S06 example'): with before.all: self.data_filenames = [ 'spec/data/S06.xml', # 'spec/data/S06_empty.xml' ]...
36e9f441d75109bef7cd0e0bd17c40db0a6564d4
ncbi_genome_download/__init__.py
ncbi_genome_download/__init__.py
"""Download genome files from the NCBI""" from .config import ( SUPPORTED_TAXONOMIC_GROUPS, NgdConfig ) from .core import ( args_download, download, argument_parser, ) __version__ = '0.2.8' __all__ = [ 'download', 'args_download', 'SUPPORTED_TAXONOMIC_GROUPS', 'NgdConfig', 'argu...
"""Download genome files from the NCBI""" from .config import ( SUPPORTED_TAXONOMIC_GROUPS, NgdConfig ) from .core import ( args_download, download, argument_parser, ) __version__ = '0.2.9' __all__ = [ 'download', 'args_download', 'SUPPORTED_TAXONOMIC_GROUPS', 'NgdConfig', 'argu...
Bump version number to 0.2.9
Bump version number to 0.2.9 Signed-off-by: Kai Blin <ad3597797f6179d503c382b2627cc19939309418@biosustain.dtu.dk>
Python
apache-2.0
kblin/ncbi-genome-download,kblin/ncbi-genome-download
<REPLACE_OLD> '0.2.8' __all__ <REPLACE_NEW> '0.2.9' __all__ <REPLACE_END> <|endoftext|> """Download genome files from the NCBI""" from .config import ( SUPPORTED_TAXONOMIC_GROUPS, NgdConfig ) from .core import ( args_download, download, argument_parser, ) __version__ = '0.2.9' __all__ = [ 'down...
Bump version number to 0.2.9 Signed-off-by: Kai Blin <ad3597797f6179d503c382b2627cc19939309418@biosustain.dtu.dk> """Download genome files from the NCBI""" from .config import ( SUPPORTED_TAXONOMIC_GROUPS, NgdConfig ) from .core import ( args_download, download, argument_parser, ) __version__ = '...
c5a0d0c5bf578a2221322c068a41ce6331b84c9b
tests/test_cattery.py
tests/test_cattery.py
import pytest from catinabox import cattery class TestCattery(object): ########################################################################### # add_cats ########################################################################### def test__add_cats__succeeds(self): c = cattery.Cattery()...
import pytest from catinabox import cattery, mccattery @pytest.fixture(params=[ cattery.Cattery, mccattery.McCattery ]) def cattery_fixture(request): return request.param() ########################################################################### # add_cats ###########################################...
Add full tests for mccattery and cattery
Add full tests for mccattery and cattery
Python
mit
keeppythonweird/catinabox,indexOutOfBound5/catinabox
<REPLACE_OLD> cattery class TestCattery(object): <REPLACE_NEW> cattery, mccattery @pytest.fixture(params=[ <REPLACE_END> <REPLACE_OLD> ########################################################################### <REPLACE_NEW> cattery.Cattery, <REPLACE_END> <REPLACE_OLD> # add_cats <REPLACE_NEW> mccattery.McCat...
Add full tests for mccattery and cattery import pytest from catinabox import cattery class TestCattery(object): ########################################################################### # add_cats ########################################################################### def test__add_cats__suc...
a0dd5f40852af01d83451fd213f57a61a4fe0cc5
openstack_dashboard/dashboards/project/images/snapshots/urls.py
openstack_dashboard/dashboards/project/images/snapshots/urls.py
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the...
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the...
Fix too loose url regex for snapshot creation
Fix too loose url regex for snapshot creation Current regex '^(?P<instance_id>[^/]+)/create' for url projects/images/<instance-id>/create will match all urls start with 'create' by mistake. The '$' added will make sure the regex only match 'create' as expect. Change-Id: I9f180d8d904d15e9458513f39b1e4719ac6800a3 Close...
Python
apache-2.0
gerrive/horizon,wolverineav/horizon,noironetworks/horizon,openstack/horizon,wolverineav/horizon,redhat-openstack/horizon,davidcusatis/horizon,noironetworks/horizon,Mirantis/mos-horizon,django-leonardo/horizon,redhat-cip/horizon,bigswitch/horizon,dan1/horizon-x509,redhat-cip/horizon,davidcusatis/horizon,django-leonardo/...
<REPLACE_OLD> url(r'^(?P<instance_id>[^/]+)/create', <REPLACE_NEW> url(r'^(?P<instance_id>[^/]+)/create/$', <REPLACE_END> <|endoftext|> # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula...
Fix too loose url regex for snapshot creation Current regex '^(?P<instance_id>[^/]+)/create' for url projects/images/<instance-id>/create will match all urls start with 'create' by mistake. The '$' added will make sure the regex only match 'create' as expect. Change-Id: I9f180d8d904d15e9458513f39b1e4719ac6800a3 Close...
f361ee6fb384a3500892a619279e229373a1b35f
src/config/svc-monitor/svc_monitor/tests/test_init.py
src/config/svc-monitor/svc_monitor/tests/test_init.py
import logging import mock import unittest from mock import patch from svc_monitor.svc_monitor import SvcMonitor from pysandesh.sandesh_base import Sandesh class Arguments(object): def __init__(self): self.disc_server_ip = None self.disc_server_port = None self.collectors = None s...
import logging import mock import unittest from mock import patch from svc_monitor.svc_monitor import SvcMonitor from pysandesh.sandesh_base import Sandesh class Arguments(object): def __init__(self): self.disc_server_ip = None self.disc_server_port = None self.collectors = None s...
Fix svc_monitor tests by adding a missing arg
Fix svc_monitor tests by adding a missing arg This commit d318b73fbab8f0c200c71adf642968a624a7db29 introduced a cluster_id arg but this arg is not initialized in the test file. Change-Id: I770e5f2c949afd408b8906439e711e7f619afa57
Python
apache-2.0
hthompson6/contrail-controller,tcpcloud/contrail-controller,rombie/contrail-controller,Juniper/contrail-dev-controller,vpramo/contrail-controller,facetothefate/contrail-controller,eonpatapon/contrail-controller,facetothefate/contrail-controller,numansiddique/contrail-controller,tcpcloud/contrail-controller,tcpcloud/con...
<REPLACE_OLD> Sandesh._DEFAULT_SYSLOG_FACILITY class <REPLACE_NEW> Sandesh._DEFAULT_SYSLOG_FACILITY self.cluster_id = None class <REPLACE_END> <|endoftext|> import logging import mock import unittest from mock import patch from svc_monitor.svc_monitor import SvcMonitor from pysandesh.sandesh_base import San...
Fix svc_monitor tests by adding a missing arg This commit d318b73fbab8f0c200c71adf642968a624a7db29 introduced a cluster_id arg but this arg is not initialized in the test file. Change-Id: I770e5f2c949afd408b8906439e711e7f619afa57 import logging import mock import unittest from mock import patch from svc_monitor.sv...
8a9c6c9df8f29f5ff6f9bb1a6200536f08cf08a9
getlost.py
getlost.py
from os import environ from urllib2 import urlopen from flask import Flask, json, make_response app = Flask(__name__) url = 'http://open.mapquestapi.com/directions/v2/route' params = '?key={apikey}&ambiguities=ignore&routeType=pedestrian' rel = url + params + '&from={flat},{flng}&to={tlat},{tlng}' @app.route("/rout...
from os import environ from urllib2 import urlopen from flask import Flask, json, jsonify app = Flask(__name__) from hip import get_ranking_array url = 'http://open.mapquestapi.com/directions/v2/route' params = '?key={apikey}&ambiguities=ignore&routeType=pedestrian' rel = url + params + '&from={flat},{flng}&to={tlat...
Return route, hip rank and total rank
Return route, hip rank and total rank
Python
apache-2.0
kynan/GetLost
<REPLACE_OLD> make_response app <REPLACE_NEW> jsonify app <REPLACE_END> <REPLACE_OLD> Flask(__name__) url <REPLACE_NEW> Flask(__name__) from hip import get_ranking_array url <REPLACE_END> <REPLACE_OLD> get_coords(from_lat, <REPLACE_NEW> route(from_lat, <REPLACE_END> <REPLACE_OLD> resp_dict <REPLACE_NEW> route <REPLA...
Return route, hip rank and total rank from os import environ from urllib2 import urlopen from flask import Flask, json, make_response app = Flask(__name__) url = 'http://open.mapquestapi.com/directions/v2/route' params = '?key={apikey}&ambiguities=ignore&routeType=pedestrian' rel = url + params + '&from={flat},{flng...
f7b592d44bd6586cea34ff7262a874142802fb84
Python/setup.py
Python/setup.py
"""Setup file to Not Another Neuroimaging Slicer """ from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) with open(path.abspath(path.join(here, 'README.md'))) as f: long_description = f.read() setup( name='qipype', version=...
"""Setup file to Not Another Neuroimaging Slicer """ from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) with open(path.abspath(path.join(here, 'README.md'))) as f: long_description = f.read() setup( name='qipype', version=...
Make qipype and QUIT version numbers match
Make qipype and QUIT version numbers match
Python
mpl-2.0
spinicist/QUIT,spinicist/QUIT,spinicist/QUIT,spinicist/QUIT
<REPLACE_OLD> version='0.3', <REPLACE_NEW> version='3.2', <REPLACE_END> <|endoftext|> """Setup file to Not Another Neuroimaging Slicer """ from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) with open(path.abspath(path.join(here, 'REA...
Make qipype and QUIT version numbers match """Setup file to Not Another Neuroimaging Slicer """ from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) with open(path.abspath(path.join(here, 'README.md'))) as f: long_description = f.re...
a94aab8fa6e795d1e440e20e9751810393ac0a73
tests/test_ping.py
tests/test_ping.py
from flask.ext.resty import Api import pytest # ----------------------------------------------------------------------------- @pytest.fixture(autouse=True) def routes(app): api = Api(app, '/api') api.add_ping('/ping') # ----------------------------------------------------------------------------- def tes...
Add test for ping endpoint
Add test for ping endpoint
Python
mit
taion/flask-jsonapiview,4Catalyzer/flask-jsonapiview,4Catalyzer/flask-resty
<INSERT> from flask.ext.resty import Api import pytest # ----------------------------------------------------------------------------- @pytest.fixture(autouse=True) def routes(app): <INSERT_END> <INSERT> api = Api(app, '/api') api.add_ping('/ping') # ---------------------------------------------------------...
Add test for ping endpoint
64f3e09eb74158233af37513d0cedf75b8d62aae
packagename/conftest.py
packagename/conftest.py
# this contains imports plugins that configure py.test for astropy tests. # by importing them here in conftest.py they are discoverable by py.test # no matter how it is invoked within the source tree. from astropy.tests.pytest_plugins import * ## Uncomment the following line to treat all DeprecationWarnings as ## exc...
# this contains imports plugins that configure py.test for astropy tests. # by importing them here in conftest.py they are discoverable by py.test # no matter how it is invoked within the source tree. from astropy.tests.pytest_plugins import * ## Uncomment the following line to treat all DeprecationWarnings as ## exc...
Add note about adding/removing packages to/from pytest header
Add note about adding/removing packages to/from pytest header
Python
bsd-3-clause
alexrudy/Zeeko,alexrudy/Zeeko
<REPLACE_OLD> enable_deprecations_as_exceptions() <REPLACE_NEW> enable_deprecations_as_exceptions() ## Uncomment and customize the following lines to add/remove entries ## from the list of packages for which version numbers are displayed ## when running the tests # PYTEST_HEADER_MODULES['scikit-image'] = 'skimage' # ...
Add note about adding/removing packages to/from pytest header # this contains imports plugins that configure py.test for astropy tests. # by importing them here in conftest.py they are discoverable by py.test # no matter how it is invoked within the source tree. from astropy.tests.pytest_plugins import * ## Uncomment...
135d4ff79a9a650442548fa5acf44f2dbcd20c0e
voltron/common.py
voltron/common.py
import os import logging import logging.config LOG_CONFIG = { 'version': 1, 'formatters': { 'standard': {'format': 'voltron: [%(levelname)s] %(message)s'} }, 'handlers': { 'default': { 'class': 'logging.StreamHandler', 'formatter': 'standard' } }, ...
import os import logging import logging.config LOG_CONFIG = { 'version': 1, 'formatters': { 'standard': {'format': 'voltron: [%(levelname)s] %(message)s'} }, 'handlers': { 'default': { 'class': 'logging.StreamHandler', 'formatter': 'standard' } }, ...
Create some shims for py3k
Create some shims for py3k
Python
mit
snare/voltron,snare/voltron,snare/voltron,snare/voltron
<REPLACE_OLD> log <REPLACE_NEW> log # Python 3 shims if not hasattr(__builtins__, "xrange"): xrange = range <REPLACE_END> <|endoftext|> import os import logging import logging.config LOG_CONFIG = { 'version': 1, 'formatters': { 'standard': {'format': 'voltron: [%(levelname)s] %(message)s'} ...
Create some shims for py3k import os import logging import logging.config LOG_CONFIG = { 'version': 1, 'formatters': { 'standard': {'format': 'voltron: [%(levelname)s] %(message)s'} }, 'handlers': { 'default': { 'class': 'logging.StreamHandler', 'formatter': 'st...
215fba180eee818b123e31a15e4b9d6a6a895c79
scripts/overhead.py
scripts/overhead.py
#!/usr/bin/env python import sys if sys.argv.__len__() < 3: print "Usage : Enter time needed for each portion of the code" print " % overhead <advance> <exchange> <regrid>" sys.exit(); a = float(sys.argv[1]) e = float(sys.argv[2]) r = float(sys.argv[3]) o = r + e print " " # print "%40s %6.1f%%" % (...
#!/usr/bin/env python import sys if sys.argv.__len__() < 3: print "Usage : Enter time needed for each portion of the code" print " % overhead <advance> <exchange> <regrid>" sys.exit(); a = float(sys.argv[1]) e = float(sys.argv[2]) r = float(sys.argv[3]) o = r + e + a print " " # print "%40s %6.1f%%"...
Make everything a percentage of the total
Make everything a percentage of the total
Python
bsd-2-clause
ForestClaw/forestclaw,ForestClaw/forestclaw,ForestClaw/forestclaw,ForestClaw/forestclaw,ForestClaw/forestclaw,ForestClaw/forestclaw
<REPLACE_OLD> e print <REPLACE_NEW> e + a print <REPLACE_END> <|endoftext|> #!/usr/bin/env python import sys if sys.argv.__len__() < 3: print "Usage : Enter time needed for each portion of the code" print " % overhead <advance> <exchange> <regrid>" sys.exit(); a = float(sys.argv[1]) e = float(sys.ar...
Make everything a percentage of the total #!/usr/bin/env python import sys if sys.argv.__len__() < 3: print "Usage : Enter time needed for each portion of the code" print " % overhead <advance> <exchange> <regrid>" sys.exit(); a = float(sys.argv[1]) e = float(sys.argv[2]) r = float(sys.argv[3]) o = ...
13544ca42db9947eaed7e82c4733683f1fc7c381
cobe/control.py
cobe/control.py
import argparse import logging import sys from . import commands parser = argparse.ArgumentParser(description="Cobe control") parser.add_argument("-b", "--brain", default="cobe.brain") parser.add_argument("--debug", action="store_true", help=argparse.SUPPRESS) subparsers = parser.add_subparsers(title="Commands") com...
import argparse import logging import sys from . import commands parser = argparse.ArgumentParser(description="Cobe control") parser.add_argument("-b", "--brain", default="cobe.brain") parser.add_argument("--debug", action="store_true", help=argparse.SUPPRESS) parser.add_argument("--instatrace", metavar="FILE", ...
Add a command line argument for enabling instatrace globally
Add a command line argument for enabling instatrace globally
Python
mit
LeMagnesium/cobe,meska/cobe,LeMagnesium/cobe,pteichman/cobe,wodim/cobe-ng,DarkMio/cobe,tiagochiavericosta/cobe,wodim/cobe-ng,tiagochiavericosta/cobe,pteichman/cobe,DarkMio/cobe,meska/cobe
<REPLACE_OLD> help=argparse.SUPPRESS) subparsers <REPLACE_NEW> help=argparse.SUPPRESS) parser.add_argument("--instatrace", metavar="FILE", help="log performance statistics to FILE") subparsers <REPLACE_END> <INSERT> if args.instatrace: instatrace.Instatrace().init(args.instatrace) <IN...
Add a command line argument for enabling instatrace globally import argparse import logging import sys from . import commands parser = argparse.ArgumentParser(description="Cobe control") parser.add_argument("-b", "--brain", default="cobe.brain") parser.add_argument("--debug", action="store_true", help=argparse.SUPPR...
3136b2525ad0716c6b6f7fa60f78f5f6d776ee55
linter.py
linter.py
# # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Jack Brewer # Copyright (c) 2015 Jack Brewer # # License: MIT """Exports the Stylint plugin class.""" from SublimeLinter.lint import NodeLinter, util class Stylint(NodeLinter): """Provides an interface to sty...
# # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Jack Brewer # Copyright (c) 2015 Jack Brewer # # License: MIT """Exports the Stylint plugin class.""" from SublimeLinter.lint import NodeLinter, util class Stylint(NodeLinter): """Provides an interface to sty...
Remove vue from selectors and just use embedded html
Remove vue from selectors and just use embedded html
Python
mit
jackbrewer/SublimeLinter-contrib-stylint
<DELETE> text.html.vue, <DELETE_END> <|endoftext|> # # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Jack Brewer # Copyright (c) 2015 Jack Brewer # # License: MIT """Exports the Stylint plugin class.""" from SublimeLinter.lint import NodeLinter, util class Stylin...
Remove vue from selectors and just use embedded html # # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Jack Brewer # Copyright (c) 2015 Jack Brewer # # License: MIT """Exports the Stylint plugin class.""" from SublimeLinter.lint import NodeLinter, util class Styl...
2c62c7f063af02f6872edd2801c6700bfffeebd4
cloud_browser/cloud/config.py
cloud_browser/cloud/config.py
"""Cloud configuration.""" from cloud_browser.cloud.rackspace import RackspaceConnection class Config(object): """Cloud configuration helper.""" conn_cls = RackspaceConnection __singleton = None def __init__(self, connection): """Initializer.""" self.connection = connection @clas...
"""Cloud configuration.""" class Config(object): """Cloud configuration helper.""" __singleton = None def __init__(self, connection): """Initializer.""" self.connection = connection @classmethod def from_settings(cls): """Create configuration from Django settings or envir...
Refactor to allow different connection class bindings.
Config: Refactor to allow different connection class bindings.
Python
mit
ryan-roemer/django-cloud-browser,ryan-roemer/django-cloud-browser,ryan-roemer/django-cloud-browser,UrbanDaddy/django-cloud-browser,UrbanDaddy/django-cloud-browser
<REPLACE_OLD> configuration.""" from cloud_browser.cloud.rackspace import RackspaceConnection class <REPLACE_NEW> configuration.""" class <REPLACE_END> <DELETE> conn_cls = RackspaceConnection <DELETE_END> <INSERT> conn = None if conn is None: # Try Rackspace <INSERT_END> <INSERT>...
Config: Refactor to allow different connection class bindings. """Cloud configuration.""" from cloud_browser.cloud.rackspace import RackspaceConnection class Config(object): """Cloud configuration helper.""" conn_cls = RackspaceConnection __singleton = None def __init__(self, connection): ""...
5753ea19d7d83413cf64ecce6360a2f29ef920bf
docs/source/conf.py
docs/source/conf.py
import os import sys import sphinx_rtd_theme os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") sys.path.insert(0, os.path.abspath("../..")) import django django.setup() project = "django-postgres-extra" copyright = "2019, Sector Labs" author = "Sector Labs" extensions = [ "sphinx_rtd_theme", "sphin...
import os import sys import sphinx_rtd_theme os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") sys.path.insert(0, os.path.abspath("../..")) import django django.setup() project = "django-postgres-extra" copyright = "2019, Sector Labs" author = "Sector Labs" extensions = [ "sphinx_rtd_theme", "sphin...
Use 'stable' Django version for intersphinx
Use 'stable' Django version for intersphinx This will ensure documentation references always point at the latest version.
Python
mit
SectorLabs/django-postgres-extra
<REPLACE_OLD> ("https://docs.djangoproject.com/en/2.2/", "https://docs.djangoproject.com/en/2.2/_objects/"), } <REPLACE_NEW> ("https://docs.djangoproject.com/en/stable/", "https://docs.djangoproject.com/en/stable/_objects/"), } <REPLACE_END> <|endoftext|> import os import sys import sphinx_rtd_theme os.environ.setde...
Use 'stable' Django version for intersphinx This will ensure documentation references always point at the latest version. import os import sys import sphinx_rtd_theme os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") sys.path.insert(0, os.path.abspath("../..")) import django django.setup() project = "djan...
aca1f53bc42915e8994c76607c86f486fb314a7a
py/island-perimeter.py
py/island-perimeter.py
class Solution(object): def islandPerimeter(self, grid): """ :type grid: List[List[int]] :rtype: int """ r = len(grid) c = len(grid[0]) perimeter = 0 for i in xrange(r): for j in xrange(c): if grid[i][j] == 1: ...
Add py solution for 463. Island Perimeter
Add py solution for 463. Island Perimeter 463. Island Perimeter: https://leetcode.com/problems/island-perimeter/
Python
apache-2.0
ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode
<REPLACE_OLD> <REPLACE_NEW> class Solution(object): def islandPerimeter(self, grid): """ :type grid: List[List[int]] :rtype: int """ r = len(grid) c = len(grid[0]) perimeter = 0 for i in xrange(r): for j in xrange(c): if gr...
Add py solution for 463. Island Perimeter 463. Island Perimeter: https://leetcode.com/problems/island-perimeter/
cf8671568bee0f3b631aba986fad2d846f2c587a
test/chtest/dev_proc_sys.py
test/chtest/dev_proc_sys.py
#!/usr/bin/env python3 import os.path import sys # File in /sys seem to vary between Linux systems. Thus, try a few candidates # and use the first one that exists. What we want is any file under /sys with # permissions root:root -rw-------. sys_file = None for f in ("/sys/devices/cpu/rdpmc", "/sys/kernel/mm...
#!/usr/bin/env python3 import os.path import sys # File in /sys seem to vary between Linux systems. Thus, try a few candidates # and use the first one that exists. What we want is any file under /sys with # permissions root:root -rw-------. sys_file = None for f in ("/sys/devices/cpu/rdpmc", "/sys/kernel/mm...
Add a further path inside /sys to test
Add a further path inside /sys to test On (at least) a Debian "stretch" system, the charliecloud image contains none of the tested paths inside /sys. This patch adds one that does exist there. Signed-off-by: Matthew Vernon <d2337109245c21c6e400ba5f0470cfb01956d9f2@sanger.ac.uk>
Python
apache-2.0
hpc/charliecloud,hpc/charliecloud,hpc/charliecloud
<REPLACE_OLD> "/sys/kernel/slab/request_sock_TCP/red_zone"): <REPLACE_NEW> "/sys/kernel/slab/request_sock_TCP/red_zone", "sys/kernel/debug/kprobes/enabled"): <REPLACE_END> <|endoftext|> #!/usr/bin/env python3 import os.path import sys # File in /sys seem to vary between Linux systems. Thus, try a few candidates ...
Add a further path inside /sys to test On (at least) a Debian "stretch" system, the charliecloud image contains none of the tested paths inside /sys. This patch adds one that does exist there. Signed-off-by: Matthew Vernon <d2337109245c21c6e400ba5f0470cfb01956d9f2@sanger.ac.uk> #!/usr/bin/env python3 import os.path...
95366beb54dfecc43e6ba3dc651fe5fd12aeb5a5
python/gui.py
python/gui.py
import netgen def StartGUI(): from tkinter import Tk global win win = Tk() win.tk.eval('lappend ::auto_path ' + netgen._netgen_lib_dir) win.tk.eval('lappend ::auto_path ' + netgen._netgen_bin_dir) # load with absolute path to avoid issues on MacOS win.tk.eval('load '+netgen._netgen_lib_dir...
import netgen def StartGUI(): from tkinter import Tk global win win = Tk() win.tk.eval('lappend ::auto_path ' + netgen._netgen_lib_dir) win.tk.eval('lappend ::auto_path ' + netgen._netgen_bin_dir) # load with absolute path to avoid issues on MacOS win.tk.eval('load "'+netgen._netgen_lib_di...
Fix spaces in install dir
Fix spaces in install dir
Python
lgpl-2.1
looooo/netgen,live-clones/netgen,looooo/netgen,looooo/netgen,live-clones/netgen,looooo/netgen,live-clones/netgen,looooo/netgen,looooo/netgen,live-clones/netgen,live-clones/netgen,live-clones/netgen
<REPLACE_OLD> '+netgen._netgen_lib_dir.replace('\\','/')+'/libgui[info sharedlibextension] <REPLACE_NEW> "'+netgen._netgen_lib_dir.replace('\\','/')+'/libgui[info sharedlibextension]" <REPLACE_END> <|endoftext|> import netgen def StartGUI(): from tkinter import Tk global win win = Tk() win.tk.eval('la...
Fix spaces in install dir import netgen def StartGUI(): from tkinter import Tk global win win = Tk() win.tk.eval('lappend ::auto_path ' + netgen._netgen_lib_dir) win.tk.eval('lappend ::auto_path ' + netgen._netgen_bin_dir) # load with absolute path to avoid issues on MacOS win.tk.eval('lo...
139346c72a09719eba3d444c67d1b54c1b68eae6
uni_form/templatetags/uni_form_field.py
uni_form/templatetags/uni_form_field.py
from django import template register = template.Library() class_converter = { "textinput":"textinput textInput", "fileinput":"fileinput fileUpload" } @register.filter def is_checkbox(field): return field.field.widget.__class__.__name__.lower() == "checkboxinput" @register.filter def with_class(field): ...
from django import template register = template.Library() class_converter = { "textinput":"textinput textInput", "fileinput":"fileinput fileUpload", "passwordinput":"passwordinput textInput" } @register.filter def is_checkbox(field): return field.field.widget.__class__.__name__.lower() == "checkboxin...
Add "passwordinput" to class_converter, because it needs the textInput class too.
Add "passwordinput" to class_converter, because it needs the textInput class too.
Python
mit
treyhunner/django-crispy-forms,uranusjr/django-crispy-forms-ng,alanwj/django-crispy-forms,iris-edu-int/django-crispy-forms,scuml/django-crispy-forms,RamezIssac/django-crispy-forms,PetrDlouhy/django-crispy-forms,zixan/django-crispy-forms,smirolo/django-crispy-forms,schrd/django-crispy-forms,CashStar/django-uni-form,pyda...
<REPLACE_OLD> fileUpload" } @register.filter def <REPLACE_NEW> fileUpload", "passwordinput":"passwordinput textInput" } @register.filter def <REPLACE_END> <|endoftext|> from django import template register = template.Library() class_converter = { "textinput":"textinput textInput", "fileinput":"fileinput...
Add "passwordinput" to class_converter, because it needs the textInput class too. from django import template register = template.Library() class_converter = { "textinput":"textinput textInput", "fileinput":"fileinput fileUpload" } @register.filter def is_checkbox(field): return field.field.widget.__cla...
73df211afe212124a69f8585e30d03332b20767c
migrate/__init__.py
migrate/__init__.py
""" SQLAlchemy migrate provides two APIs :mod:`migrate.versioning` for database schema version and repository management and :mod:`migrate.changeset` that allows to define database schema changes using Python. """ from migrate.versioning import * from migrate.changeset import * __version__ = '0.7.3.dev'
""" SQLAlchemy migrate provides two APIs :mod:`migrate.versioning` for database schema version and repository management and :mod:`migrate.changeset` that allows to define database schema changes using Python. """ from migrate.versioning import * from migrate.changeset import * __version__ = '0.8.1'
Fix the version number to match the last release.
Fix the version number to match the last release. ** NOTE: our release process really should do this ahead of time. Change-Id: Ic0cce0d57b4f05092417c4cf1a4ca5a74812ec3c
Python
mit
rcherrueau/sqlalchemy-migrate,rcherrueau/sqlalchemy-migrate,andras-tim/sqlalchemy-migrate,dannon/sqlalchemy-migrate,stackforge/sqlalchemy-migrate,openstack/sqlalchemy-migrate,openstack/sqlalchemy-migrate
<REPLACE_OLD> '0.7.3.dev' <REPLACE_NEW> '0.8.1' <REPLACE_END> <|endoftext|> """ SQLAlchemy migrate provides two APIs :mod:`migrate.versioning` for database schema version and repository management and :mod:`migrate.changeset` that allows to define database schema changes using Python. """ from migrate.ve...
Fix the version number to match the last release. ** NOTE: our release process really should do this ahead of time. Change-Id: Ic0cce0d57b4f05092417c4cf1a4ca5a74812ec3c """ SQLAlchemy migrate provides two APIs :mod:`migrate.versioning` for database schema version and repository management and :mod:`migrate....
69705079398391cdc392b18dcd440fbc3b7404fd
celery_cgi.py
celery_cgi.py
import os import logging from celery import Celery from temp_config.set_environment import DeployEnv runtime_env = DeployEnv() runtime_env.load_deployment_environment() redis_server = os.environ.get('REDIS_HOSTNAME') redis_port = os.environ.get('REDIS_PORT') celery_tasks = [ 'hms_flask.modules.hms_controller', ...
import os import logging from celery import Celery from temp_config.set_environment import DeployEnv runtime_env = DeployEnv() runtime_env.load_deployment_environment() redis_server = os.environ.get('REDIS_HOSTNAME') redis_port = os.environ.get('REDIS_PORT') celery_tasks = [ 'hms_flask.modules.hms_controller', ...
Set celery to ignore results
Set celery to ignore results
Python
unlicense
puruckertom/ubertool_ecorest,puruckertom/ubertool_ecorest,quanted/ubertool_ecorest,quanted/ubertool_ecorest,puruckertom/ubertool_ecorest,quanted/ubertool_ecorest,quanted/ubertool_ecorest,puruckertom/ubertool_ecorest
<REPLACE_OLD> CELERY_IGNORE_RESULT=False, <REPLACE_NEW> CELERY_IGNORE_RESULT=True, <REPLACE_END> <|endoftext|> import os import logging from celery import Celery from temp_config.set_environment import DeployEnv runtime_env = DeployEnv() runtime_env.load_deployment_environment() redis_server = os.environ.get('REDIS...
Set celery to ignore results import os import logging from celery import Celery from temp_config.set_environment import DeployEnv runtime_env = DeployEnv() runtime_env.load_deployment_environment() redis_server = os.environ.get('REDIS_HOSTNAME') redis_port = os.environ.get('REDIS_PORT') celery_tasks = [ 'hms_fla...
b89b6a3d609c29ed544e2ab6b0995932b475ef96
admin/common_auth/forms.py
admin/common_auth/forms.py
from __future__ import absolute_import from django import forms from django.contrib.auth.models import Group from osf.models import AdminProfile class LoginForm(forms.Form): email = forms.CharField(label=u'Email', required=True) password = forms.CharField( label=u'Password', widget=forms.Pas...
from __future__ import absolute_import from django import forms from django.contrib.auth.models import Group from osf.models import AdminProfile class LoginForm(forms.Form): email = forms.CharField(label=u'Email', required=True) password = forms.CharField( label=u'Password', widget=forms.Pas...
Exclude collection groups from ADM UI
Exclude collection groups from ADM UI
Python
apache-2.0
Johnetordoff/osf.io,adlius/osf.io,adlius/osf.io,aaxelb/osf.io,Johnetordoff/osf.io,erinspace/osf.io,mfraezz/osf.io,CenterForOpenScience/osf.io,CenterForOpenScience/osf.io,brianjgeiger/osf.io,pattisdr/osf.io,mfraezz/osf.io,baylee-d/osf.io,cslzchen/osf.io,mattclark/osf.io,HalcyonChimera/osf.io,cslzchen/osf.io,mattclark/os...
<INSERT> # TODO: Moving to guardian, find a better way to distinguish "admin-like" groups from object permission groups <INSERT_END> <REPLACE_OLD> queryset=Group.objects.all(), <REPLACE_NEW> queryset=Group.objects.exclude(name__startswith='collections_'), <REPLACE_END> <|endoftext|> from __future__ import absolut...
Exclude collection groups from ADM UI from __future__ import absolute_import from django import forms from django.contrib.auth.models import Group from osf.models import AdminProfile class LoginForm(forms.Form): email = forms.CharField(label=u'Email', required=True) password = forms.CharField( labe...
8bc4a4a5c6ef82b43f78ac9bcd1ce7e2888e2e4b
backend/messages.py
backend/messages.py
# -*- coding: utf-8 -*- import json from enum import Enum class BEMessages(Enum): ALL_MAIN_BROADCAST = 'ALL_MAIN_BROADCAST' class FEMessages(Enum): pass class AllMainBroadCast(object): message_type = BEMessages.ALL_MAIN_BROADCAST def __init__(self): pass def broadcast(self): ...
# -*- coding: utf-8 -*- import json from enum import Enum class BEMessages(Enum): ALL_MAIN_BROADCAST = 'ALL_MAIN_BROADCAST' class FEMessages(Enum): pass class AllMainBroadCast(object): message_type = BEMessages.ALL_MAIN_BROADCAST def __init__(self): pass def broadcast(self, handler)...
Add handler send logic to message
Add handler send logic to message
Python
mit
verekia/hackarena,verekia/hackarena,verekia/hackarena,verekia/hackarena
<REPLACE_OLD> broadcast(self): <REPLACE_NEW> broadcast(self, handler): <REPLACE_END> <REPLACE_OLD> '', <REPLACE_NEW> 'TEST', <REPLACE_END> <DELETE> # TODO: actually broadcast message <DELETE_END> <REPLACE_OLD> print json_content <REPLACE_NEW> handler.send(json_content) <REPLACE_END> <|endoftext|> # -*- codi...
Add handler send logic to message # -*- coding: utf-8 -*- import json from enum import Enum class BEMessages(Enum): ALL_MAIN_BROADCAST = 'ALL_MAIN_BROADCAST' class FEMessages(Enum): pass class AllMainBroadCast(object): message_type = BEMessages.ALL_MAIN_BROADCAST def __init__(self): pas...
68b499ea6b73232b3b8a860b3c8b808a1736b733
myfedora/controllers/template.py
myfedora/controllers/template.py
from ${package}.lib.base import * class TemplateController(BaseController): def view(self, url): """By default, the final controller tried to fulfill the request when no other routes match. It may be used to display a template when all else fails, e.g.:: def view(self, url): ...
from myfedora.lib.base import * class TemplateController(BaseController): def view(self, url): """By default, the final controller tried to fulfill the request when no other routes match. It may be used to display a template when all else fails, e.g.:: def view(self, url): ...
Fix a busted import statement in our TemplateController
Fix a busted import statement in our TemplateController
Python
agpl-3.0
Fale/fedora-packages,fedora-infra/fedora-packages,fedora-infra/fedora-packages,Fale/fedora-packages,Fale/fedora-packages,fedora-infra/fedora-packages,fedora-infra/fedora-packages
<REPLACE_OLD> ${package}.lib.base <REPLACE_NEW> myfedora.lib.base <REPLACE_END> <|endoftext|> from myfedora.lib.base import * class TemplateController(BaseController): def view(self, url): """By default, the final controller tried to fulfill the request when no other routes match. It may be used t...
Fix a busted import statement in our TemplateController from ${package}.lib.base import * class TemplateController(BaseController): def view(self, url): """By default, the final controller tried to fulfill the request when no other routes match. It may be used to display a template when a...
bbc208548f0dd381f3045d24db3c21c4c8ee004e
grovepi/scan.py
grovepi/scan.py
import time import grove_i2c_temp_hum_mini # temp + humidity import hp206c # altitude + temp + pressure import grovepi # used by air sensor and dust sensor import atexit # used for the dust sensor import json # Initialize the sensors t= grove_i2c_temp_hum_mini.th02() h= hp206c.hp206c() grovepi.dust_sensor_en() air_se...
Test all sensors at once
Test all sensors at once
Python
mit
mmewen/UTSEUS-Binky,mmewen/UTSEUS-Binky,mmewen/UTSEUS-Binky,mmewen/UTSEUS-Binky,mmewen/UTSEUS-Binky
<INSERT> import time import grove_i2c_temp_hum_mini # temp + humidity import hp206c # altitude + temp + pressure import grovepi <INSERT_END> <INSERT> # used by air sensor and dust sensor import atexit # used for the dust sensor import json # Initialize the sensors t= grove_i2c_temp_hum_mini.th02() h= hp206c.hp206c() g...
Test all sensors at once
5e270a34e2c7787459f307e957161aadd8d24476
run_checks.py
run_checks.py
import os from pre_push import run_checks filepath = os.path.dirname(os.path.abspath(__file__)) project_root = os.path.join(filepath, "..") if __name__ == "__main__": run_checks(project_root)
Add separate script to run checks from jenkins
Add separate script to run checks from jenkins
Python
mit
kriskavalieri/nodejs-docker-boilerplate,kriskavalieri/nodejs-docker-boilerplate
<INSERT> import os from pre_push import run_checks filepath = os.path.dirname(os.path.abspath(__file__)) project_root = os.path.join(filepath, "..") if __name__ == "__main__": <INSERT_END> <INSERT> run_checks(project_root) <INSERT_END> <|endoftext|> import os from pre_push import run_checks filepath = os.path.di...
Add separate script to run checks from jenkins
2fe72f41b1b62cf770869b8d3ccefeef1096ea11
conftest.py
conftest.py
# -*- coding: UTF-8 -*- """ Configure pytest environment. Add project-specific information. .. seealso:: * https://github.com/pytest-dev/pytest-html """ import behave import pytest @pytest.fixture(autouse=True) def _annotate_environment(request): """Add project-specific information to test-run environment: ...
# -*- coding: UTF-8 -*- """ Configure pytest environment. Add project-specific information. .. seealso:: * https://github.com/pytest-dev/pytest-html """ import behave import pytest @pytest.fixture(autouse=True) def _annotate_environment(request): """Add project-specific information to test-run environment: ...
FIX when pytest-html is not installed.
FIX when pytest-html is not installed.
Python
bsd-2-clause
Abdoctor/behave,Abdoctor/behave,jenisys/behave,jenisys/behave
<INSERT> environment = getattr(request.config, "_environment", None) if environment: # -- PROVIDED-BY: pytest-html <INSERT_END> <REPLACE_OLD> request.config._environment.append(("behave", <REPLACE_NEW> environment.append(("behave", <REPLACE_END> <|endoftext|> # -*- coding: UTF-8 -*- """ Configur...
FIX when pytest-html is not installed. # -*- coding: UTF-8 -*- """ Configure pytest environment. Add project-specific information. .. seealso:: * https://github.com/pytest-dev/pytest-html """ import behave import pytest @pytest.fixture(autouse=True) def _annotate_environment(request): """Add project-specifi...
a80b95f64a17c4bc5c506313fe94e66b4ad2e836
cyclonejet/__init__.py
cyclonejet/__init__.py
# -*- encoding:utf-8 -*- from flask import Flask from cyclonejet.views.frontend import frontend from flaskext.sqlalchemy import SQLAlchemy import settings app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = settings.DB_URI app.register_module(frontend) db = SQLAlchemy(app)
# -*- encoding:utf-8 -*- from flask import Flask, render_template from cyclonejet.views.frontend import frontend from cyclonejet.views.errors import errors from flaskext.sqlalchemy import SQLAlchemy import settings app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = settings.DB_URI #Blueprint registration...
Switch to Blueprints, custom 404 handler.
Switch to Blueprints, custom 404 handler.
Python
agpl-3.0
tsoporan/cyclonejet
<REPLACE_OLD> Flask from <REPLACE_NEW> Flask, render_template from <REPLACE_END> <INSERT> cyclonejet.views.errors import errors from <INSERT_END> <REPLACE_OLD> settings app <REPLACE_NEW> settings app <REPLACE_END> <REPLACE_OLD> settings.DB_URI app.register_module(frontend) db <REPLACE_NEW> settings.DB_URI #Bluep...
Switch to Blueprints, custom 404 handler. # -*- encoding:utf-8 -*- from flask import Flask from cyclonejet.views.frontend import frontend from flaskext.sqlalchemy import SQLAlchemy import settings app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = settings.DB_URI app.register_module(frontend) db = SQLAlc...
615e57fefa2b3b52ce351ef1d8039216927dc891
Parallel/Testing/Cxx/TestSockets.py
Parallel/Testing/Cxx/TestSockets.py
""" Driver script for testing sockets Unix only """ import os, sys, time # Fork, run server in child, client in parent pid = os.fork() if pid == 0: # exec the parent os.execv(sys.argv[1], ('-D', sys.argv[3])) else: # wait a little to make sure that the server is ready time.sleep(10) # run the c...
""" Driver script for testing sockets Unix only """ import os, sys, time # Fork, run server in child, client in parent pid = os.fork() if pid == 0: # exec the parent os.execv(sys.argv[1], ('-D', sys.argv[3])) else: # wait a little to make sure that the server is ready time.sleep(10) # run the c...
Fix space problem and put try around os.kill
ERR: Fix space problem and put try around os.kill
Python
bsd-3-clause
SimVascular/VTK,johnkit/vtk-dev,gram526/VTK,daviddoria/PointGraphsPhase1,sankhesh/VTK,hendradarwin/VTK,jeffbaumes/jeffbaumes-vtk,ashray/VTK-EVM,msmolens/VTK,SimVascular/VTK,arnaudgelas/VTK,gram526/VTK,berendkleinhaneveld/VTK,johnkit/vtk-dev,Wuteyan/VTK,aashish24/VTK-old,mspark93/VTK,hendradarwin/VTK,collects/VTK,collec...
<REPLACE_OLD> os.system('%s <REPLACE_NEW> os.system('"%s" <REPLACE_END> <REPLACE_OLD> %s <REPLACE_NEW> "%s" <REPLACE_END> <REPLACE_OLD> %s' <REPLACE_NEW> "%s"' <REPLACE_END> <INSERT> try: <INSERT_END> <INSERT> except: pass <INSERT_END> <|endoftext|> """ Driver script for testing sockets Unix only ""...
ERR: Fix space problem and put try around os.kill """ Driver script for testing sockets Unix only """ import os, sys, time # Fork, run server in child, client in parent pid = os.fork() if pid == 0: # exec the parent os.execv(sys.argv[1], ('-D', sys.argv[3])) else: # wait a little to make sure that the...
46816c4d8470192e76e730969ddcedeb8391fdcf
setup.py
setup.py
#!/usr/bin/env python from distutils.core import setup setup(name="Neighborhoodize", version='0.9', description='Utility for translating lat, long coordinates into ' 'neighborhoods in various cities', author='Brian Lange', author_email='brian.lange@datascopeanalytics.com', ...
#!/usr/bin/env python from distutils.core import setup setup(name="Neighborhoodize", version='0.9', description='Utility for translating lat, long coordinates into ' 'neighborhoods in various cities', author='Brian Lange', author_email='brian.lange@datascopeanalytics.com', ...
Add download url for pypi
Add download url for pypi
Python
mit
bjlange/neighborhoodize
<INSERT> download_url = 'https://github.com/bjlange/neighborhoodize/tarball/0.9', <INSERT_END> <|endoftext|> #!/usr/bin/env python from distutils.core import setup setup(name="Neighborhoodize", version='0.9', description='Utility for translating lat, long coordinates into ' 'neighb...
Add download url for pypi #!/usr/bin/env python from distutils.core import setup setup(name="Neighborhoodize", version='0.9', description='Utility for translating lat, long coordinates into ' 'neighborhoods in various cities', author='Brian Lange', author_email='brian.lange@...
1e001eb11938bd5c613e655f86943167cd945d50
local_sync_client.py
local_sync_client.py
# -*- coding: utf-8 -*- import os class LocalSyncClient(object): def __init__(self, local_dir): self.local_dir = local_dir def get_object_timestamp(self, key): object_path = os.path.join(self.local_dir, key) if os.path.exists(object_path): return os.stat(object_path).st_m...
# -*- coding: utf-8 -*- import os class LocalSyncClient(object): def __init__(self, local_dir): self.local_dir = local_dir def get_object_timestamp(self, key): object_path = os.path.join(self.local_dir, key) if os.path.exists(object_path): return os.stat(object_path).st_m...
Fix bug which caused put_object in LocalSyncClient to fail on create
Fix bug which caused put_object in LocalSyncClient to fail on create
Python
mit
MichaelAquilina/s3backup,MichaelAquilina/s3backup
<REPLACE_OLD> key) <REPLACE_NEW> key) <REPLACE_END> <REPLACE_OLD> os.stat(object_path) <REPLACE_NEW> None if os.path.exists(object_path): object_stat = os.stat(object_path) <REPLACE_END> <REPLACE_OLD> fp2.write(fp.read()) <REPLACE_NEW> fp2.write(fp.read()) if object_stat is not None:...
Fix bug which caused put_object in LocalSyncClient to fail on create # -*- coding: utf-8 -*- import os class LocalSyncClient(object): def __init__(self, local_dir): self.local_dir = local_dir def get_object_timestamp(self, key): object_path = os.path.join(self.local_dir, key) if os....
5f6d994dfde18206e000537510b87f451234f1d3
installer/installer_config/forms.py
installer/installer_config/forms.py
from django import forms from django.forms.models import ModelForm from installer_config.models import EnvironmentProfile, Package, TerminalPrompt class EnvironmentForm(ModelForm): packages = forms.ModelMultipleChoiceField(widget=forms.CheckboxSelectMultiple, queryse...
from django import forms from django.forms.models import ModelForm from installer_config.models import EnvironmentProfile, UserChoice class EnvironmentForm(ModelForm): packages = forms.ModelMultipleChoiceField(widget=forms.CheckboxSelectMultiple, queryset=UserChoice....
Fix form to query UserChoices, not Packages
Fix form to query UserChoices, not Packages
Python
mit
ezPy-co/ezpy,ezPy-co/ezpy,alibulota/Package_Installer,alibulota/Package_Installer
<REPLACE_OLD> Package, TerminalPrompt <REPLACE_NEW> UserChoice <REPLACE_END> <REPLACE_OLD> queryset=Package.objects.all()) <REPLACE_NEW> queryset=UserChoice.objects.all()) <REPLACE_END> <|endoftext|> from django import forms from django.forms.models import ModelForm from installer_config.models import Environment...
Fix form to query UserChoices, not Packages from django import forms from django.forms.models import ModelForm from installer_config.models import EnvironmentProfile, Package, TerminalPrompt class EnvironmentForm(ModelForm): packages = forms.ModelMultipleChoiceField(widget=forms.CheckboxSelectMultiple, ...
b4cb2758b76633856e2fd701a9469447b75192fc
lowfat/migrations/0120_auto_20180206_1505.py
lowfat/migrations/0120_auto_20180206_1505.py
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2018-02-06 15:05 from __future__ import unicode_literals import datetime from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('lowfat', '0119_auto_20171214_0722'), ] operations = [ migrati...
Add migration for default year
Add migration for default year
Python
bsd-3-clause
softwaresaved/fat,softwaresaved/fat,softwaresaved/fat,softwaresaved/fat
<REPLACE_OLD> <REPLACE_NEW> # -*- coding: utf-8 -*- # Generated by Django 1.11 on 2018-02-06 15:05 from __future__ import unicode_literals import datetime from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('lowfat', '0119_auto_20171214_0722'), ] o...
Add migration for default year
6a462d6cbf1d82e9e600b997185a265bcd35b6e4
jsonrpc/__init__.py
jsonrpc/__init__.py
__version = (1, 0, 4) __version__ = version = '.'.join(map(str, __version)) __project__ = PROJECT = __name__ #from .jsonrpc import JSONRPCProtocol, JSONRPCRequest, JSONRPCResponse #from .exceptions import * # lint_ignore=W0611,W0401
__version = (1, 0, 5) __version__ = version = '.'.join(map(str, __version)) __project__ = PROJECT = __name__ #from .jsonrpc import JSONRPCProtocol, JSONRPCRequest, JSONRPCResponse #from .exceptions import * # lint_ignore=W0611,W0401
Update version: add python 3.3 to classifiers.
Update version: add python 3.3 to classifiers.
Python
mit
pavlov99/json-rpc
<REPLACE_OLD> 4) __version__ <REPLACE_NEW> 5) __version__ <REPLACE_END> <|endoftext|> __version = (1, 0, 5) __version__ = version = '.'.join(map(str, __version)) __project__ = PROJECT = __name__ #from .jsonrpc import JSONRPCProtocol, JSONRPCRequest, JSONRPCResponse #from .exceptions import * # lint_ignore=W0611,W...
Update version: add python 3.3 to classifiers. __version = (1, 0, 4) __version__ = version = '.'.join(map(str, __version)) __project__ = PROJECT = __name__ #from .jsonrpc import JSONRPCProtocol, JSONRPCRequest, JSONRPCResponse #from .exceptions import * # lint_ignore=W0611,W0401
1619ba48666be69710cd6bcbffe663cd1f7c1066
troposphere/codeguruprofiler.py
troposphere/codeguruprofiler.py
# Copyright (c) 2020, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. from . import AWSObject class ProfilingGroup(AWSObject): resource_type = "AWS::CodeGuruProfiler::ProfilingGroup" props = { 'AgentPermissions': (dict, False), 'ProfilingGroupName': (b...
# Copyright (c) 2012-2019, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. # # *** Do not modify - this file is autogenerated *** # Resource specification version: 16.1.0 from . import AWSObject class ProfilingGroup(AWSObject): resource_type = "AWS::CodeGuruProfiler::Prof...
Add AWS::CodeGuruProfiler::ProfilingGroup.ComputePlatform per 2020-07-09 update
Add AWS::CodeGuruProfiler::ProfilingGroup.ComputePlatform per 2020-07-09 update
Python
bsd-2-clause
cloudtools/troposphere,cloudtools/troposphere
<REPLACE_OLD> 2020, <REPLACE_NEW> 2012-2019, <REPLACE_END> <REPLACE_OLD> license. from <REPLACE_NEW> license. # # *** Do not modify - this file is autogenerated *** # Resource specification version: 16.1.0 from <REPLACE_END> <INSERT> 'ComputePlatform': (basestring, False), <INSERT_END> <|endoftext|> # Copyri...
Add AWS::CodeGuruProfiler::ProfilingGroup.ComputePlatform per 2020-07-09 update # Copyright (c) 2020, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. from . import AWSObject class ProfilingGroup(AWSObject): resource_type = "AWS::CodeGuruProfiler::ProfilingGroup" prop...
d3a4153edcc25b358cfe3b0f0b315cbf064266bd
lintcode/Medium/105_Copy_List_with_Random_Pointer.py
lintcode/Medium/105_Copy_List_with_Random_Pointer.py
# Definition for singly-linked list with a random pointer. # class RandomListNode: # def __init__(self, x): # self.label = x # self.next = None # self.random = None class Solution: # @param head: A RandomListNode # @return: A RandomListNode def copyRandomList(self, head): ...
Add solution to lintcode question 105
Add solution to lintcode question 105
Python
mit
Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode
<REPLACE_OLD> <REPLACE_NEW> # Definition for singly-linked list with a random pointer. # class RandomListNode: # def __init__(self, x): # self.label = x # self.next = None # self.random = None class Solution: # @param head: A RandomListNode # @return: A RandomListNode def copyRa...
Add solution to lintcode question 105
3b07818db48a5e3a205389051ccd9640e1079cc7
tests/lib/__init__.py
tests/lib/__init__.py
from os.path import abspath, dirname, join import sh import psycopg2 import requests PROJECT_FOLDER=dirname(dirname(abspath(__file__))) DOCKER_FOLDER=join(PROJECT_FOLDER, 'docker') def docker_compose(version, *args): sh.docker_compose('-f', 'docker/{version}/docker-compose.yml'.format(version=version), *args) d...
from os.path import abspath, dirname, join import sh import psycopg2 import requests import time PROJECT_FOLDER=dirname(dirname(abspath(__file__))) DOCKER_FOLDER=join(PROJECT_FOLDER, 'docker') def docker_compose(version, *args): sh.docker_compose('-f', 'docker/{version}/docker-compose.yml'.format(version=version...
Make the lib pretty complete
Make the lib pretty complete Should be able to replicate set up and tear down now
Python
mit
matthewfranglen/postgres-elasticsearch-fdw
<REPLACE_OLD> requests PROJECT_FOLDER=dirname(dirname(abspath(__file__))) DOCKER_FOLDER=join(PROJECT_FOLDER, <REPLACE_NEW> requests import time PROJECT_FOLDER=dirname(dirname(abspath(__file__))) DOCKER_FOLDER=join(PROJECT_FOLDER, <REPLACE_END> <REPLACE_OLD> test_pg(): <REPLACE_NEW> wait_for(condition): <REPLACE_END...
Make the lib pretty complete Should be able to replicate set up and tear down now from os.path import abspath, dirname, join import sh import psycopg2 import requests PROJECT_FOLDER=dirname(dirname(abspath(__file__))) DOCKER_FOLDER=join(PROJECT_FOLDER, 'docker') def docker_compose(version, *args): sh.docker_co...
a10e21a8fe811e896998ba510255592a966f0782
infra/recipes/build_windows.py
infra/recipes/build_windows.py
# Copyright 2022 The ChromiumOS Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from recipe_engine.post_process import Filter PYTHON_VERSION_COMPATIBILITY = "PY3" DEPS = [ "crosvm", "recipe_engine/buildbucket", "recipe_engine/context", "re...
# Copyright 2022 The ChromiumOS Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from recipe_engine.post_process import Filter PYTHON_VERSION_COMPATIBILITY = "PY3" DEPS = [ "crosvm", "recipe_engine/buildbucket", "recipe_engine/context", "re...
Enable clippy in windows LUCI
crosvm: Enable clippy in windows LUCI For linux based systems, clippy continues to run in health_check BUG=b:257249038 TEST=CQ Change-Id: I39d3d45a0db72c61e79fd2c51b195b82c067a244 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3993934 Reviewed-by: Dennis Kempin <cd09796fb571bec2782819dbfd333...
Python
bsd-3-clause
google/crosvm,google/crosvm,google/crosvm,google/crosvm
<INSERT> ) api.step( "Clippy windows crosvm", [ "vpython3", "./tools/clippy", ], <INSERT_END> <|endoftext|> # Copyright 2022 The ChromiumOS Authors # Use of this source code is governed by a BSD-style license that can be # found in the ...
crosvm: Enable clippy in windows LUCI For linux based systems, clippy continues to run in health_check BUG=b:257249038 TEST=CQ Change-Id: I39d3d45a0db72c61e79fd2c51b195b82c067a244 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3993934 Reviewed-by: Dennis Kempin <cd09796fb571bec2782819dbfd333...
517d25cf79c4d04661309ab7b3ab0638a2f968ee
api/docbleach/utils/__init__.py
api/docbleach/utils/__init__.py
import os import random import string def secure_uuid(): """ Strength: 6*3 random characters from a list of 62, approx. 64^18 possible strings, or 2^100. Should be enough to prevent a successful bruteforce, as download links are only valid for 3 hours :return: """ return id_generator() + "...
import os import string from random import SystemRandom cryptogen = SystemRandom() def secure_uuid(): """ Strength: 6*3 random characters from a list of 62, approx. 64^18 possible strings, or 2^100. Should be enough to prevent a successful bruteforce, as download links are only valid for 3 hours ...
Use SystemRandom to generate security-viable randomness
Use SystemRandom to generate security-viable randomness
Python
mit
docbleach/DocBleach-Web,docbleach/DocBleach-Web,docbleach/DocBleach-Web,docbleach/DocBleach-Web
<REPLACE_OLD> random import string def <REPLACE_NEW> string from random import SystemRandom cryptogen = SystemRandom() def <REPLACE_END> <REPLACE_OLD> ''.join(random.choice(chars) <REPLACE_NEW> ''.join(cryptogen.choice(chars) <REPLACE_END> <|endoftext|> import os import string from random import SystemRandom cryp...
Use SystemRandom to generate security-viable randomness import os import random import string def secure_uuid(): """ Strength: 6*3 random characters from a list of 62, approx. 64^18 possible strings, or 2^100. Should be enough to prevent a successful bruteforce, as download links are only valid for 3...
7fdbe50d113a78fd02101056b56d44d917c5571c
joins/models.py
joins/models.py
from django.db import models # Create your models here. class Join(models.Model): email = models.EmailField() ip_address = models.CharField(max_length=120, default='ABC') timestamp = models.DateTimeField(auto_now_add = True, auto_now=False) updated = models.DateTimeField(auto_now_add = False, auto_now=True) def...
from django.db import models # Create your models here. class Join(models.Model): email = models.EmailField() ip_address = models.CharField(max_length=120, default='ABC') timestamp = models.DateTimeField(auto_now_add = True, auto_now=False) updated = models.DateTimeField(auto_now_add = False, auto_now=True) def...
Add South Guide, made message for it
Add South Guide, made message for it
Python
mit
codingforentrepreneurs/launch-with-code,codingforentrepreneurs/launch-with-code,krishnazure/launch-with-code,krishnazure/launch-with-code,krishnazure/launch-with-code
<REPLACE_OLD> %(self.email) <REPLACE_NEW> %(self.email) #To see the guide on using south, go here: #https://github.com/codingforentrepreneurs/Guides/blob/master/using_south_in_django.md <REPLACE_END> <|endoftext|> from django.db import models # Create your models here. class Join(models.Model): email = models...
Add South Guide, made message for it from django.db import models # Create your models here. class Join(models.Model): email = models.EmailField() ip_address = models.CharField(max_length=120, default='ABC') timestamp = models.DateTimeField(auto_now_add = True, auto_now=False) updated = models.DateTimeField(auto...
9083afc0e308588345c74675654a4c0d3061f39d
test/test_machine.py
test/test_machine.py
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import (absolute_import, division, print_function, unicode_literals) from os.path import join import six from asv import machine def test_machine(tmpdir): tmpdir = six.text_type(tmpd...
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import (absolute_import, division, print_function, unicode_literals) from os.path import join import six from asv import machine def test_machine(tmpdir): tmpdir = six.text_type(tmpd...
Add a test for asv machine --yes using defaults values
Add a test for asv machine --yes using defaults values
Python
bsd-3-clause
pv/asv,spacetelescope/asv,qwhelan/asv,airspeed-velocity/asv,airspeed-velocity/asv,pv/asv,qwhelan/asv,spacetelescope/asv,airspeed-velocity/asv,pv/asv,pv/asv,qwhelan/asv,spacetelescope/asv,spacetelescope/asv,airspeed-velocity/asv,qwhelan/asv
<REPLACE_OLD> '640k' <REPLACE_NEW> '640k' def test_machine_defaults(tmpdir): tmpdir = six.text_type(tmpdir) m = machine.Machine.load( interactive=True, use_defaults=True, _path=join(tmpdir, 'asv-machine.json')) assert m.__dict__ == m.get_defaults() <REPLACE_END> <|endoftext|> #...
Add a test for asv machine --yes using defaults values # -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import (absolute_import, division, print_function, unicode_literals) from os.path import join import six from asv import machine d...
9a2d3c2a576597730b7316ddbf7169ed3164a690
rtgraph/core/constants.py
rtgraph/core/constants.py
from enum import Enum class Constants: app_title = "RTGraph" app_version = '0.2.0' app_export_path = "../data" app_sources = ["Serial", "Simulator"] app_encoding = "utf-8" plot_update_ms = 16 plot_xlabel_title = "Time" plot_xlabel_unit = "s" plot_colors = ['#0072bd', '#d95319', '#...
from enum import Enum class Constants: app_title = "RTGraph" app_version = '0.2.0' app_export_path = "data" app_sources = ["Serial", "Simulator"] app_encoding = "utf-8" plot_update_ms = 16 plot_xlabel_title = "Time" plot_xlabel_unit = "s" plot_colors = ['#0072bd', '#d95319', '#edb...
Update export path to new structure
Update export path to new structure
Python
mit
ssepulveda/RTGraph
<REPLACE_OLD> "../data" <REPLACE_NEW> "data" <REPLACE_END> <|endoftext|> from enum import Enum class Constants: app_title = "RTGraph" app_version = '0.2.0' app_export_path = "data" app_sources = ["Serial", "Simulator"] app_encoding = "utf-8" plot_update_ms = 16 plot_xlabel_title = "Time...
Update export path to new structure from enum import Enum class Constants: app_title = "RTGraph" app_version = '0.2.0' app_export_path = "../data" app_sources = ["Serial", "Simulator"] app_encoding = "utf-8" plot_update_ms = 16 plot_xlabel_title = "Time" plot_xlabel_unit = "s" pl...
93f61fa8eb526763ddaf3de476cee6643f044908
stringer/utils/file_utils.py
stringer/utils/file_utils.py
''' Utilities to search files and retain meta data about files. ''' import logging import os import mmap def map_file(path=None): logging.debug("map_file: " + path) file_map = "" if path is None or path is os.path.isfile(path): logging.error('generate string is None') logging.error('path...
Write three functions to begin the feature to mask values of some keyvalue pairs. Publish to begin writing the tests and making these work and process better. Write it through.
Write three functions to begin the feature to mask values of some keyvalue pairs. Publish to begin writing the tests and making these work and process better. Write it through.
Python
apache-2.0
kalaboster/stringer,kalaboster/stringer
<REPLACE_OLD> <REPLACE_NEW> ''' Utilities to search files and retain meta data about files. ''' import logging import os import mmap def map_file(path=None): logging.debug("map_file: " + path) file_map = "" if path is None or path is os.path.isfile(path): logging.error('generate string is None'...
Write three functions to begin the feature to mask values of some keyvalue pairs. Publish to begin writing the tests and making these work and process better. Write it through.
860629358dd7651b1f35a70f65dfabb1010daa77
tests/QueryableListTests/tutils.py
tests/QueryableListTests/tutils.py
def filterDictToStr(filterDict): return ', '.join(['%s=%s' %(key, repr(value)) for key, value in filterDict.items()]) class DataObject(object): def __init__(self, **kwargs): for key, value in kwargs.items(): setattr(self, key, value) def __str__(self): return 'DataObject( %s ...
def filterDictToStr(filterDict): return ', '.join(['%s=%s' %(key, repr(value)) for key, value in filterDict.items()]) class DataObject(object): def __init__(self, **kwargs): for key, value in kwargs.items(): setattr(self, key, value) def __str__(self): return 'DataObject( %s ...
Add a hashable-dict type for testing
Add a hashable-dict type for testing
Python
lgpl-2.1
kata198/QueryableList,kata198/QueryableList
<REPLACE_OLD> __str__ <REPLACE_NEW> __str__ class hashableDict(dict): ''' A dict that is hashable. ''' def __hash__(self): KEYVAL_SEP = '~~..~~' NONEVAL='~~__NONE$$zz' PAIRS_SEP='88ascvjikZZ' hashableStr = [] keys = list(self.keys()) keys.sort()...
Add a hashable-dict type for testing def filterDictToStr(filterDict): return ', '.join(['%s=%s' %(key, repr(value)) for key, value in filterDict.items()]) class DataObject(object): def __init__(self, **kwargs): for key, value in kwargs.items(): setattr(self, key, value) def __str__(...
ab88061c78cd17913faf6249f4d70a48779b4e56
tests/unit_test_xmile2py.py
tests/unit_test_xmile2py.py
import os import unittest import tempfile from io import StringIO from pysd.py_backend.xmile.xmile2py import translate_xmile class TestEquationStringParsing(unittest.TestCase): def test_multiline_equation(): with open('tests/test-models/tests/game/test_game.stmx', 'r') as stmx: contents = s...
Test to ensure equations with line breaks are parsed correctly
Test to ensure equations with line breaks are parsed correctly
Python
mit
JamesPHoughton/pysd
<INSERT> import os import unittest import tempfile from io import StringIO from pysd.py_backend.xmile.xmile2py import translate_xmile class TestEquationStringParsing(unittest.TestCase): <INSERT_END> <INSERT> def test_multiline_equation(): with open('tests/test-models/tests/game/test_game.stmx', 'r') as ...
Test to ensure equations with line breaks are parsed correctly
2f33ba5a84630e405e388719ee3db0674cd11f81
setup.py
setup.py
import os from distutils.core import setup VERSION = '0.1.0' README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read() required = [ 'Django >= 1.5.0', ] setup( name='madmin', version=VERSION, description="Virtual mail administration django app", author="Lewis Gunsch", auth...
import os from distutils.core import setup VERSION = '0.2.0-dev' README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read() required = [ 'Django >= 1.5.0', ] setup( name='madmin', version=VERSION, description="Virtual mail administration django app", author="Lewis Gunsch", ...
Bump the version number - 0.2.0-dev.
Bump the version number - 0.2.0-dev. Signed-off-by: Lewis Gunsch <748e1641a368164906d4a0c0e3965345453dcc93@gunsch.ca>
Python
mit
lgunsch/django-vmail
<REPLACE_OLD> '0.1.0' README <REPLACE_NEW> '0.2.0-dev' README <REPLACE_END> <|endoftext|> import os from distutils.core import setup VERSION = '0.2.0-dev' README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read() required = [ 'Django >= 1.5.0', ] setup( name='madmin', version=VERSIO...
Bump the version number - 0.2.0-dev. Signed-off-by: Lewis Gunsch <748e1641a368164906d4a0c0e3965345453dcc93@gunsch.ca> import os from distutils.core import setup VERSION = '0.1.0' README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read() required = [ 'Django >= 1.5.0', ] setup( name='mad...
8785f602900ab3bf3e297ee8f90ecf47c059cdde
sphinxcontrib/openstreetmap.py
sphinxcontrib/openstreetmap.py
# -*- coding: utf-8 -*- """ sphinxcontrib.openstreetmap =========================== Embed OpenStreetMap on your documentation. :copyright: Copyright 2015 HAYASHI Kentaro <kenhys@gmail.com> :license: BSD, see LICENSE for details. """ from docutils import nodes from docutils.parsers.rst import directives from sphi...
# -*- coding: utf-8 -*- """ sphinxcontrib.openstreetmap =========================== Embed OpenStreetMap on your documentation. :copyright: Copyright 2015 HAYASHI Kentaro <kenhys@gmail.com> :license: BSD, see LICENSE for details. """ from docutils import nodes from docutils.parsers.rst import directives from sphi...
Add marker as required parameter
Add marker as required parameter
Python
bsd-2-clause
kenhys/sphinxcontrib-openstreetmap,kenhys/sphinxcontrib-openstreetmap
<REPLACE_OLD> directives.unchanged <REPLACE_NEW> directives.unchanged, 'marker': directives.unchanged, <REPLACE_END> <|endoftext|> # -*- coding: utf-8 -*- """ sphinxcontrib.openstreetmap =========================== Embed OpenStreetMap on your documentation. :copyright: Copyright 2015 HAYASHI Kentaro <ke...
Add marker as required parameter # -*- coding: utf-8 -*- """ sphinxcontrib.openstreetmap =========================== Embed OpenStreetMap on your documentation. :copyright: Copyright 2015 HAYASHI Kentaro <kenhys@gmail.com> :license: BSD, see LICENSE for details. """ from docutils import nodes from docutils.parse...
047697aa92f297c5e9c74ef0bd9eb3702b5fce13
bioagents/dtda/generate_tas_dump.py
bioagents/dtda/generate_tas_dump.py
import os import pickle from collections import defaultdict from indra.sources import tas from indra.databases import drugbank_client def normalize_drug(drug): flags = score_drug(drug) if 'long_name' in flags: if 'DRUGBANK' in drug.db_refs: db_name = \ drugbank_client.get_d...
Add script to reproduce custom TAS dump
Add script to reproduce custom TAS dump
Python
bsd-2-clause
sorgerlab/bioagents,bgyori/bioagents
<REPLACE_OLD> <REPLACE_NEW> import os import pickle from collections import defaultdict from indra.sources import tas from indra.databases import drugbank_client def normalize_drug(drug): flags = score_drug(drug) if 'long_name' in flags: if 'DRUGBANK' in drug.db_refs: db_name = \ ...
Add script to reproduce custom TAS dump
ddacad6879d955f46f58bbfefd3363246c256193
examples/subclassing2.py
examples/subclassing2.py
from flask_table import Table, Col class RawCol(Col): """Class that will just output whatever it is given and will not escape it. """ def td_format(self, content): return content class ItemTable(Table): name = Col('Name') raw = RawCol('Raw') def main(): items = [{'name': 'A', ...
Add subclassing example for RawCol
Add subclassing example for RawCol
Python
bsd-3-clause
plumdog/flask_table,plumdog/flask_table,plumdog/flask_table
<INSERT> from flask_table import Table, Col class RawCol(Col): <INSERT_END> <INSERT> """Class that will just output whatever it is given and will not escape it. """ def td_format(self, content): return content class ItemTable(Table): name = Col('Name') raw = RawCol('Raw') def main(...
Add subclassing example for RawCol
1e2218469428fe974dfe0c0403a8c6fda8417321
setup.py
setup.py
import os from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name='rs_limits', version='0.5.1', author='Kevin L. Mitchell', author_email='kevin.mitchell@rackspace.com', description="Rackspace-specific rate-limit preprocesso...
import os from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name='rs_limits', version='0.5.1', author='Kevin L. Mitchell', author_email='kevin.mitchell@rackspace.com', description="Rackspace-specific rate-limit preprocesso...
Add nose to dependencies list.
Add nose to dependencies list.
Python
apache-2.0
klmitch/rs_limits
<INSERT> 'nose', <INSERT_END> <|endoftext|> import os from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name='rs_limits', version='0.5.1', author='Kevin L. Mitchell', author_email='kevin.mitchell@rackspace.com', de...
Add nose to dependencies list. import os from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name='rs_limits', version='0.5.1', author='Kevin L. Mitchell', author_email='kevin.mitchell@rackspace.com', description="Rackspace...
4155d6ca5db149d8b213cc4078580fc2e85d7f4d
vinotes/apps/api/migrations/0002_auto_20150325_1104.py
vinotes/apps/api/migrations/0002_auto_20150325_1104.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('api', '0001_initial'), ] operations = [ migrations.AddField( model_name='wine', name='description', ...
Migrate database for model changes.
Migrate database for model changes.
Python
unlicense
rcutmore/vinotes-api,rcutmore/vinotes-api
<INSERT> # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): <INSERT_END> <INSERT> dependencies = [ ('api', '0001_initial'), ] operations = [ migrations.AddField( model_name='wine', ...
Migrate database for model changes.
01eb74ebca81f79ab829073f163b028d3e98f055
setup.py
setup.py
''' cd dropbox/codes/check_forbidden py -3.4 setup.py py2exe Libraries used: import tkinter import tkinter.filedialog import csv import os import re from time import sleep import zipfile ''' from distutils.core import setup import py2exe setup( console=[{'author': 'Shun Sakurai', ...
''' cd dropbox/codes/check_forbidden py -3.4 setup.py py2exe Libraries used: import tkinter import tkinter.filedialog import csv import os import re from time import sleep import zipfile ''' from distutils.core import setup import py2exe setup( console=[{'author': 'Shun Sakurai', ...
Change the application name to 'Check Forbidden'
Change the application name to 'Check Forbidden'
Python
mit
ShunSakurai/check_forbidden,ShunSakurai/check_forbidden
<INSERT> 'dest_base': 'Check Forbidden', <INSERT_END> <|endoftext|> ''' cd dropbox/codes/check_forbidden py -3.4 setup.py py2exe Libraries used: import tkinter import tkinter.filedialog import csv import os import re from time import sleep import zipfile ''' from distutils.core imp...
Change the application name to 'Check Forbidden' ''' cd dropbox/codes/check_forbidden py -3.4 setup.py py2exe Libraries used: import tkinter import tkinter.filedialog import csv import os import re from time import sleep import zipfile ''' from distutils.core import setup import py2exe setup( ...
7cfb3d6be9e1fc24b5e86e3179e874bcbe01c47c
profiles/tasks.py
profiles/tasks.py
""" Celery tasks for the User Profiles portion of RAPID. """ import datetime import logging from celery.schedules import crontab from celery.task import PeriodicTask from profiles.models import Profile LOGGER = logging.getLogger(None) """The logger for this module""" # Note: Logging doesn't appear to work properly ...
""" Celery tasks for the User Profiles portion of RAPID. """ import datetime import logging from celery.schedules import crontab from celery.task import PeriodicTask from profiles.models import Profile LOGGER = logging.getLogger(None) """The logger for this module""" # Note: Logging doesn't appear to work properly ...
Update the crontab schedule to run every day at midnight
Update the crontab schedule to run every day at midnight
Python
mit
gdit-cnd/RAPID,gdit-cnd/RAPID,gdit-cnd/RAPID,LindaTNguyen/RAPID,gdit-cnd/RAPID,LindaTNguyen/RAPID,LindaTNguyen/RAPID,LindaTNguyen/RAPID,gdit-cnd/RAPID,LindaTNguyen/RAPID
<REPLACE_OLD> #run_every <REPLACE_NEW> run_every <REPLACE_END> <REPLACE_OLD> hour=0) run_every = crontab() <REPLACE_NEW> hour=0) <REPLACE_END> <|endoftext|> """ Celery tasks for the User Profiles portion of RAPID. """ import datetime import logging from celery.schedules import crontab from celery.task import...
Update the crontab schedule to run every day at midnight """ Celery tasks for the User Profiles portion of RAPID. """ import datetime import logging from celery.schedules import crontab from celery.task import PeriodicTask from profiles.models import Profile LOGGER = logging.getLogger(None) """The logger for this ...
3170407aaaeffbc76e31e5fc78d4dacd008e27d2
backbone_calendar/ajax/mixins.py
backbone_calendar/ajax/mixins.py
from django import http from django.utils import simplejson as json class JSONResponseMixin(object): context_variable = 'object_list' def render_to_response(self, context): "Returns a JSON response containing 'context' as payload" return self.get_json_response(self.convert_context_to_json(con...
import json from django import http class JSONResponseMixin(object): context_variable = 'object_list' def render_to_response(self, context): "Returns a JSON response containing 'context' as payload" return self.get_json_response(self.convert_context_to_json(context)) def dispatch(self, ...
Use json and not simplejson
Use json and not simplejson
Python
agpl-3.0
rezometz/django-backbone-calendar,rezometz/django-backbone-calendar,rezometz/django-backbone-calendar
<REPLACE_OLD> from <REPLACE_NEW> import json from <REPLACE_END> <REPLACE_OLD> http from django.utils import simplejson as json class <REPLACE_NEW> http class <REPLACE_END> <|endoftext|> import json from django import http class JSONResponseMixin(object): context_variable = 'object_list' def render_to_r...
Use json and not simplejson from django import http from django.utils import simplejson as json class JSONResponseMixin(object): context_variable = 'object_list' def render_to_response(self, context): "Returns a JSON response containing 'context' as payload" return self.get_json_response(sel...
df4601af8ce70e48ffd4362556c2b07e4a6f53db
nettests/experimental/script.py
nettests/experimental/script.py
from ooni import nettest from ooni.utils import log from twisted.internet import defer, protocol, reactor from twisted.python import usage import os def which(program): def is_exe(fpath): return os.path.isfile(fpath) and os.access(fpath, os.X_OK) fpath, fname = os.path.split(program) if fpath: ...
Add Dominic Hamon's nettest for running tests written with other interpreters.
Add Dominic Hamon's nettest for running tests written with other interpreters. * Fixes #8011.
Python
bsd-2-clause
kdmurray91/ooni-probe,Karthikeyan-kkk/ooni-probe,Karthikeyan-kkk/ooni-probe,kdmurray91/ooni-probe,lordappsec/ooni-probe,lordappsec/ooni-probe,lordappsec/ooni-probe,0xPoly/ooni-probe,juga0/ooni-probe,Karthikeyan-kkk/ooni-probe,0xPoly/ooni-probe,0xPoly/ooni-probe,juga0/ooni-probe,juga0/ooni-probe,kdmurray91/ooni-probe,kd...
<REPLACE_OLD> <REPLACE_NEW> from ooni import nettest from ooni.utils import log from twisted.internet import defer, protocol, reactor from twisted.python import usage import os def which(program): def is_exe(fpath): return os.path.isfile(fpath) and os.access(fpath, os.X_OK) fpath, fname = os.path.s...
Add Dominic Hamon's nettest for running tests written with other interpreters. * Fixes #8011.
5250a31587f414f6673c13e42095dbb859bf8cb4
setup.py
setup.py
# Copyright 2013-2015 Massachusetts Open Cloud Contributors # # 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 applicab...
# Copyright 2013-2015 Massachusetts Open Cloud Contributors # # 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 applicab...
Replace dependency on SQLAlchemy with Flask-SQLALchemy
Replace dependency on SQLAlchemy with Flask-SQLALchemy
Python
apache-2.0
CCI-MOC/haas,kylehogan/haas,kylehogan/hil,henn/hil_sahil,henn/hil,henn/hil,kylehogan/hil,SahilTikale/haas,meng-sun/hil,henn/hil_sahil,meng-sun/hil,henn/haas
<REPLACE_OLD> install_requires=['SQLAlchemy==0.9.7', <REPLACE_NEW> install_requires=['Flask-SQLAlchemy', <REPLACE_END> <|endoftext|> # Copyright 2013-2015 Massachusetts Open Cloud Contributors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the...
Replace dependency on SQLAlchemy with Flask-SQLALchemy # Copyright 2013-2015 Massachusetts Open Cloud Contributors # # 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....
971a180a5afab6ee53a9b15413341c649cda0a1c
dtags/config.py
dtags/config.py
import os import json from dtags.utils import halt, expand_path TAGS = os.path.expanduser('~/.dtags') def load_tags(): """Load the tags from disk.""" if not os.path.exists(TAGS): try: with open(TAGS, "w") as config_file: json.dump({}, config_file) except (IOError,...
import os import json from dtags.utils import halt, expand_path TAGS = os.path.expanduser('~/.dtags') def load_tags(): """Load the tags from disk.""" if not os.path.exists(TAGS): try: with open(TAGS, "w") as config_file: json.dump({}, config_file) except (IOError,...
Fix a bug in load_tags function
Fix a bug in load_tags function
Python
mit
joowani/dtags
<INSERT> if not json_str: return {} <INSERT_END> <REPLACE_OLD> {} <REPLACE_NEW> json.loads(json_str) <REPLACE_END> <REPLACE_OLD> json_str else json.loads(json_str) <REPLACE_NEW> tag_data: return {} <REPLACE_END> <|endoftext|> import os import jso...
Fix a bug in load_tags function import os import json from dtags.utils import halt, expand_path TAGS = os.path.expanduser('~/.dtags') def load_tags(): """Load the tags from disk.""" if not os.path.exists(TAGS): try: with open(TAGS, "w") as config_file: json.dump({}, conf...
25993238cb18212a2b83b2d6b0aa98939d38f192
scripts/lwtnn-split-keras-network.py
scripts/lwtnn-split-keras-network.py
#!/usr/bin/env python3 """ Convert a keras model, saved with model.save(...) to a weights and architecture component. """ import argparse def get_args(): d = '(default: %(default)s)' parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('model') parser.add_argument('-w','--weight-fi...
#!/usr/bin/env python3 """ Convert a keras model, saved with model.save(...) to a weights and architecture component. """ import argparse def get_args(): d = '(default: %(default)s)' parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('model') parser.add_argument('-w','--weight-fi...
Remove Keras from network splitter
Remove Keras from network splitter Keras isn't as stable as h5py and json. This commit removes the keras dependency from the network splitting function.
Python
mit
lwtnn/lwtnn,lwtnn/lwtnn,lwtnn/lwtnn
<INSERT> from h5py <INSERT_END> <REPLACE_OLD> keras <REPLACE_NEW> File import json <REPLACE_END> <REPLACE_OLD> keras.models.load_model(args.model) m.save_weights(args.weight_file_name) <REPLACE_NEW> File(args.model,'r') <REPLACE_END> <REPLACE_OLD> open(args.architecture_file_name,'w') <REPLACE_NEW> File(arg...
Remove Keras from network splitter Keras isn't as stable as h5py and json. This commit removes the keras dependency from the network splitting function. #!/usr/bin/env python3 """ Convert a keras model, saved with model.save(...) to a weights and architecture component. """ import argparse def get_args(): d = '(...
ae928afd0752c9f66b3b6701f67502013f2869ca
cla_backend/apps/legalaid/management/commands/recalculate_assigned_out_of_hours.py
cla_backend/apps/legalaid/management/commands/recalculate_assigned_out_of_hours.py
from django.conf import settings from django.core.management import BaseCommand, CommandError from django.utils import timezone from legalaid.models import Case class Command(BaseCommand): help = "Recalculate case.assigned_out_of_hours since a given date" def handle(self, *args, **options): try: ...
Add management command to recalculate the field
Add management command to recalculate the field
Python
mit
ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend
<REPLACE_OLD> <REPLACE_NEW> from django.conf import settings from django.core.management import BaseCommand, CommandError from django.utils import timezone from legalaid.models import Case class Command(BaseCommand): help = "Recalculate case.assigned_out_of_hours since a given date" def handle(self, *args,...
Add management command to recalculate the field
3d64eb4a7438b6b4f46f1fdf7f47d530cb11b09c
spacy/tests/regression/test_issue2396.py
spacy/tests/regression/test_issue2396.py
# coding: utf-8 from __future__ import unicode_literals from ..util import get_doc import pytest import numpy @pytest.mark.parametrize('sentence,matrix', [ ( 'She created a test for spacy', numpy.array([ [0, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1], [1, 1, 2, 3, 3, 3...
# coding: utf-8 from __future__ import unicode_literals from ..util import get_doc import pytest import numpy from numpy.testing import assert_array_equal @pytest.mark.parametrize('words,heads,matrix', [ ( 'She created a test for spacy'.split(), [1, 0, 1, -2, -1, -1], numpy.array([ ...
Update get_lca_matrix test for develop
Update get_lca_matrix test for develop
Python
mit
explosion/spaCy,explosion/spaCy,spacy-io/spaCy,explosion/spaCy,honnibal/spaCy,honnibal/spaCy,honnibal/spaCy,spacy-io/spaCy,honnibal/spaCy,spacy-io/spaCy,spacy-io/spaCy,explosion/spaCy,explosion/spaCy,spacy-io/spaCy,spacy-io/spaCy,explosion/spaCy
<REPLACE_OLD> numpy @pytest.mark.parametrize('sentence,matrix', <REPLACE_NEW> numpy from numpy.testing import assert_array_equal @pytest.mark.parametrize('words,heads,matrix', <REPLACE_END> <REPLACE_OLD> spacy', <REPLACE_NEW> spacy'.split(), [1, 0, 1, -2, -1, -1], <REPLACE_END> <REPLACE_OLD> test_issue2396...
Update get_lca_matrix test for develop # coding: utf-8 from __future__ import unicode_literals from ..util import get_doc import pytest import numpy @pytest.mark.parametrize('sentence,matrix', [ ( 'She created a test for spacy', numpy.array([ [0, 1, 1, 1, 1, 1], [1, 1, 1,...
ea06febec1d9bb3c288bade012f1d9c1144577fd
007.py
007.py
""" Project Euler Problem 7 ======================= By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. What is the 10001st prime number? """ from itertools import count def is_prime(number): """ Takes a number and returns True if it's a prime number, otherwi...
Add solution and unit tests for problem 7
Add solution and unit tests for problem 7
Python
mit
BeataBak/project-euler-problems
<REPLACE_OLD> <REPLACE_NEW> """ Project Euler Problem 7 ======================= By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. What is the 10001st prime number? """ from itertools import count def is_prime(number): """ Takes a number and returns True if...
Add solution and unit tests for problem 7
844c6f18d06dcb397db76436e5f4b8ddcb1beddc
py/path-with-maximum-gold.py
py/path-with-maximum-gold.py
class Solution(object): def getMaximumGold(self, grid): """ :type grid: List[List[int]] :rtype: int """ self.grid = grid self.rows = len(grid) if self.rows: self.cols = len(grid[0]) ans = 0 for x in range(self.rows): fo...
Add py solution for 1219. Path with Maximum Gold
Add py solution for 1219. Path with Maximum Gold 1219. Path with Maximum Gold: https://leetcode.com/problems/path-with-maximum-gold/
Python
apache-2.0
ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode
<REPLACE_OLD> <REPLACE_NEW> class Solution(object): def getMaximumGold(self, grid): """ :type grid: List[List[int]] :rtype: int """ self.grid = grid self.rows = len(grid) if self.rows: self.cols = len(grid[0]) ans = 0 for x in ran...
Add py solution for 1219. Path with Maximum Gold 1219. Path with Maximum Gold: https://leetcode.com/problems/path-with-maximum-gold/
7d068af4cab1eeb9d7e4b78babb8216f60314f4f
portal/tests/test_views.py
portal/tests/test_views.py
from django.test import TestCase from django.urls import reverse # Create your tests here. class HomeViewTestCase(TestCase): """HomeView test suite""" expected_url = '/' def test_desired_location(self): resp = self.client.get(self.expected_url) self.assertEqual(resp.status_code, 200) ...
Add view test cases for portal
Add view test cases for portal
Python
mit
huangsam/chowist,huangsam/chowist,huangsam/chowist
<REPLACE_OLD> <REPLACE_NEW> from django.test import TestCase from django.urls import reverse # Create your tests here. class HomeViewTestCase(TestCase): """HomeView test suite""" expected_url = '/' def test_desired_location(self): resp = self.client.get(self.expected_url) self.assertEqu...
Add view test cases for portal
8acb681ff8963621452f0e018781c76d4935cb84
projects/urls.py
projects/urls.py
from django.conf.urls import patterns, url urlpatterns = patterns('projects.views', url(r'^add/$', 'add_project', name='add_project'), url(r'^edit/(?P<project_id>\d+)/$', 'edit_project', name='edit_project'), url(r'^status/(?P<project_id>\d+)/$', 'edit_status', name='edit_status'), url(r'^archive/$', ...
from django.conf.urls import patterns, url urlpatterns = patterns('projects.views', url(r'^add/$', 'add_project', name='add_project'), url(r'^edit/(?P<project_id>\d+)/$', 'edit_project', name='edit_project'), url(r'^edit_status/(?P<project_id>\d+)/$', 'edit_status', name='edit_status'), url(r'^status/...
Add url for project_status_edit option
Add url for project_status_edit option
Python
mit
Hackfmi/Diaphanum,Hackfmi/Diaphanum
<INSERT> url(r'^edit_status/(?P<project_id>\d+)/$', 'edit_status', name='edit_status'), <INSERT_END> <|endoftext|> from django.conf.urls import patterns, url urlpatterns = patterns('projects.views', url(r'^add/$', 'add_project', name='add_project'), url(r'^edit/(?P<project_id>\d+)/$', 'edit_project', name...
Add url for project_status_edit option from django.conf.urls import patterns, url urlpatterns = patterns('projects.views', url(r'^add/$', 'add_project', name='add_project'), url(r'^edit/(?P<project_id>\d+)/$', 'edit_project', name='edit_project'), url(r'^status/(?P<project_id>\d+)/$', 'edit_status', name...
1846ebff5c71a8c3bb0c9cccd29460f656f5a21b
oauthlib/__init__.py
oauthlib/__init__.py
""" oauthlib ~~~~~~~~ A generic, spec-compliant, thorough implementation of the OAuth request-signing logic. :copyright: (c) 2011 by Idan Gazit. :license: BSD, see LICENSE for details. """ __author__ = 'Idan Gazit <idan@gazit.me>' __version__ = '0.6.0'
Add meta info in oauthlib module
Add meta info in oauthlib module
Python
bsd-3-clause
hirokiky/oauthlib,skion/oauthlib-oidc,cyrilchaponeverysens/oauthlib,Blitzen/oauthlib,mick88/oauthlib,idan/oauthlib,barseghyanartur/oauthlib,masci/oauthlib,metatoaster/oauthlib,bjmc/oauthlib,oauthlib/oauthlib,flamusdiu/oauthlib,singingwolfboy/oauthlib,armersong/oauthlib,garciasolero/oauthlib,masci/oauthlib,flamusdiu/oau...
<INSERT> """ <INSERT_END> <INSERT> oauthlib ~~~~~~~~ A generic, spec-compliant, thorough implementation of the OAuth request-signing logic. :copyright: (c) 2011 by Idan Gazit. :license: BSD, see LICENSE for details. """ __author__ = 'Idan Gazit <idan@gazit.me>' __version__ = '0.6.0' <INSERT_E...
Add meta info in oauthlib module
af3577a1ab0f7005d95c64be640550263efcb416
indra/tools/reading/util/reporter.py
indra/tools/reading/util/reporter.py
from reportlab.lib.enums import TA_JUSTIFY from reportlab.lib.pagesizes import letter from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Image from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib.units import inch class Reporter(object): def __init__(self, name...
Add a simple class to work with canvas tools.
Add a simple class to work with canvas tools.
Python
bsd-2-clause
johnbachman/indra,bgyori/indra,johnbachman/indra,johnbachman/belpy,sorgerlab/belpy,johnbachman/belpy,pvtodorov/indra,sorgerlab/belpy,johnbachman/belpy,sorgerlab/indra,pvtodorov/indra,pvtodorov/indra,bgyori/indra,pvtodorov/indra,bgyori/indra,sorgerlab/indra,johnbachman/indra,sorgerlab/indra,sorgerlab/belpy
<REPLACE_OLD> <REPLACE_NEW> from reportlab.lib.enums import TA_JUSTIFY from reportlab.lib.pagesizes import letter from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Image from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib.units import inch class Reporter(object)...
Add a simple class to work with canvas tools.
ac4f5451baaefd67392d9b908c9ccffc4083a9ad
fluidsynth/fluidsynth.py
fluidsynth/fluidsynth.py
from cffi import FFI ffi = FFI() ffi.cdef(""" typedef struct _fluid_hashtable_t fluid_settings_t; typedef struct _fluid_synth_t fluid_synth_t; typedef struct _fluid_audio_driver_t fluid_audio_driver_t; fluid_settings_t* new_fluid_settings(void); fluid_synth_t* new_fluid_synth(fluid_settings_t* settings); fluid_audio_...
from cffi import FFI ffi = FFI() ffi.cdef(""" typedef struct _fluid_hashtable_t fluid_settings_t; typedef struct _fluid_synth_t fluid_synth_t; typedef struct _fluid_audio_driver_t fluid_audio_driver_t; fluid_settings_t* new_fluid_settings(void); fluid_synth_t* new_fluid_synth(fluid_settings_t* settings); fluid_audio_...
Change the LD search path
Change the LD search path
Python
mit
paultag/python-fluidsynth
<REPLACE_OLD> ffi.dlopen("/usr/lib/x86_64-linux-gnu/libfluidsynth.so.1") # Testing <REPLACE_NEW> ffi.dlopen("libfluidsynth.so.1") <REPLACE_END> <|endoftext|> from cffi import FFI ffi = FFI() ffi.cdef(""" typedef struct _fluid_hashtable_t fluid_settings_t; typedef struct _fluid_synth_t fluid_synth_t; typedef struct ...
Change the LD search path from cffi import FFI ffi = FFI() ffi.cdef(""" typedef struct _fluid_hashtable_t fluid_settings_t; typedef struct _fluid_synth_t fluid_synth_t; typedef struct _fluid_audio_driver_t fluid_audio_driver_t; fluid_settings_t* new_fluid_settings(void); fluid_synth_t* new_fluid_synth(fluid_settings...
4e309e7f70760e400dc7150b34e7f86c4c5643b4
golddust/packages.py
golddust/packages.py
# Copyright 2015-2017 John "LuaMilkshake" Marion # # 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 ag...
# Copyright 2015-2017 John "LuaMilkshake" Marion # # 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 ag...
Add munge_jar stub for InstallScript
Add munge_jar stub for InstallScript
Python
apache-2.0
Packeteers/GoldDust
<REPLACE_OLD> script. <REPLACE_NEW> script. These functions are used to perform extra work beyond extracting files. Note that JAR modification should only be done using the `munge_jar` function. This lets GoldDust know that you're modifying the JAR so it can properly handle other JAR mod packages...
Add munge_jar stub for InstallScript # Copyright 2015-2017 John "LuaMilkshake" Marion # # 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 # # U...
c788e509500025252154b6dbde65d1b6bf9ee3f7
nbgrader/tests/apps/test_nbgrader_formgrade.py
nbgrader/tests/apps/test_nbgrader_formgrade.py
from .. import run_nbgrader from .base import BaseTestApp class TestNbGraderFormgrade(BaseTestApp): def test_help(self): """Does the help display without error?""" run_nbgrader(["formgrade", "--help-all"])
Add back in command line test for nbgrader formgrade
Add back in command line test for nbgrader formgrade
Python
bsd-3-clause
jupyter/nbgrader,jupyter/nbgrader,jupyter/nbgrader,jupyter/nbgrader,jhamrick/nbgrader,jhamrick/nbgrader,jhamrick/nbgrader,jupyter/nbgrader,jhamrick/nbgrader
<INSERT> from .. import run_nbgrader from .base import BaseTestApp class TestNbGraderFormgrade(BaseTestApp): <INSERT_END> <INSERT> def test_help(self): """Does the help display without error?""" run_nbgrader(["formgrade", "--help-all"]) <INSERT_END> <|endoftext|> from .. import run_nbgrader from ...
Add back in command line test for nbgrader formgrade
9260852d12ca686843ba30f3786b542e6418e4ff
setup.py
setup.py
import os import sys import imp from setuptools import find_packages try: from restricted_pkg import setup except: # allow falling back to setuptools only if # we are not trying to upload if 'upload' in sys.argv: raise ImportError('restricted_pkg is required to upload, first do pip install rest...
### GAMECHANGER_CI_PREVENT_BUILD import os import sys import imp from setuptools import find_packages try: from restricted_pkg import setup except: # allow falling back to setuptools only if # we are not trying to upload if 'upload' in sys.argv: raise ImportError('restricted_pkg is required to ...
Add magic comment to stop our CI from building a package
Add magic comment to stop our CI from building a package
Python
mit
gamechanger/dusty,gamechanger/dusty,gamechanger/dusty,gamechanger/dusty,gamechanger/dusty
<REPLACE_OLD> import <REPLACE_NEW> ### GAMECHANGER_CI_PREVENT_BUILD import <REPLACE_END> <|endoftext|> ### GAMECHANGER_CI_PREVENT_BUILD import os import sys import imp from setuptools import find_packages try: from restricted_pkg import setup except: # allow falling back to setuptools only if # we are not ...
Add magic comment to stop our CI from building a package import os import sys import imp from setuptools import find_packages try: from restricted_pkg import setup except: # allow falling back to setuptools only if # we are not trying to upload if 'upload' in sys.argv: raise ImportError('restr...
8061b8dd4e836e6af16dd93b332f8cea6b55433c
exgrep.py
exgrep.py
#!/usr/bin/env python3 # -*- coding: utf8 -*- """ Usage: exgrep TERM [options] EXCEL_FILE... Options: TERM The term to grep for. Can be any valid (python) regular expression. EXCEL_FILE The list of files to search through -o Only output the matched part """ import re from docopt import docopt import ...
#!/usr/bin/env python3 # -*- coding: utf8 -*- """ Usage: exgrep TERM [options] EXCEL_FILE... Options: TERM The term to grep for. Can be any valid (python) regular expression. EXCEL_FILE The list of files to search through -c COL Only search in the column specified by COL. -o Only output the match...
Add support for only searching specified column
Add support for only searching specified column
Python
mit
Sakartu/excel-toolkit
<REPLACE_OLD> through -o <REPLACE_NEW> through -c COL Only search in the column specified by COL. -o <REPLACE_END> <INSERT> idx, <INSERT_END> <REPLACE_OLD> sheet.row_values(rownum): <REPLACE_NEW> enumerate(sheet.row_values(rownum)): if args['-c'] and idx != int(args['-c']): con...
Add support for only searching specified column #!/usr/bin/env python3 # -*- coding: utf8 -*- """ Usage: exgrep TERM [options] EXCEL_FILE... Options: TERM The term to grep for. Can be any valid (python) regular expression. EXCEL_FILE The list of files to search through -o Only output the matched part...
9b80275d589aef1cca81f29de0eff6eca18e8565
pywt/setup.py
pywt/setup.py
#!/usr/bin/env python from __future__ import division, print_function, absolute_import def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration import numpy as np config = Configuration('pywt', parent_package, top_path) config.add_data_dir('tests') ...
#!/usr/bin/env python from __future__ import division, print_function, absolute_import def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration import numpy as np config = Configuration('pywt', parent_package, top_path) config.add_data_dir('tests') ...
Fix format string for Python-2.6
BLD: Fix format string for Python-2.6
Python
mit
aaren/pywt,ThomasA/pywt,rgommers/pywt,ThomasA/pywt,michelp/pywt,grlee77/pywt,rgommers/pywt,kwohlfahrt/pywt,rgommers/pywt,aaren/pywt,michelp/pywt,rgommers/pywt,kwohlfahrt/pywt,ThomasA/pywt,kwohlfahrt/pywt,michelp/pywt,eriol/pywt,PyWavelets/pywt,aaren/pywt,grlee77/pywt,PyWavelets/pywt,eriol/pywt,eriol/pywt
<REPLACE_OLD> sources=["src/{}.c".format(s) <REPLACE_NEW> sources=["src/{0}.c".format(s) <REPLACE_END> <REPLACE_OLD> depends=(["src/{}.template.c".format(s) <REPLACE_NEW> depends=(["src/{0}.template.c".format(s) <REPLACE_END> <REPLACE_OLD> ["src/{}.template.h".format(s) <REPLACE_NEW> ["src/{0}.template.h".format(s) <RE...
BLD: Fix format string for Python-2.6 #!/usr/bin/env python from __future__ import division, print_function, absolute_import def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration import numpy as np config = Configuration('pywt', parent_package, top_path...
a5beccfa3574f4fcb1b6030737b728e65803791f
numpy/array_api/_typing.py
numpy/array_api/_typing.py
""" This file defines the types for type annotations. These names aren't part of the module namespace, but they are used in the annotations in the function signatures. The functions in the module are only valid for inputs that match the given type annotations. """ __all__ = [ "Array", "Device", "Dtype", ...
""" This file defines the types for type annotations. These names aren't part of the module namespace, but they are used in the annotations in the function signatures. The functions in the module are only valid for inputs that match the given type annotations. """ __all__ = [ "Array", "Device", "Dtype", ...
Fix invalid parameter types used in `Dtype`
MAINT: Fix invalid parameter types used in `Dtype`
Python
bsd-3-clause
anntzer/numpy,charris/numpy,mattip/numpy,endolith/numpy,mhvk/numpy,charris/numpy,mhvk/numpy,jakirkham/numpy,seberg/numpy,endolith/numpy,pdebuyl/numpy,jakirkham/numpy,rgommers/numpy,seberg/numpy,numpy/numpy,rgommers/numpy,anntzer/numpy,charris/numpy,pdebuyl/numpy,endolith/numpy,mhvk/numpy,seberg/numpy,endolith/numpy,rgo...
<REPLACE_OLD> "PyCapsule", ] from <REPLACE_NEW> "PyCapsule", ] import sys from <REPLACE_END> <REPLACE_OLD> Union from <REPLACE_NEW> Union, TYPE_CHECKING from <REPLACE_END> <INSERT> Array from numpy import <INSERT_END> <REPLACE_OLD> Array, <REPLACE_NEW> dtype, <REPLACE_END> <REPLACE_OLD> Literal["cpu"] Dtype = Typ...
MAINT: Fix invalid parameter types used in `Dtype` """ This file defines the types for type annotations. These names aren't part of the module namespace, but they are used in the annotations in the function signatures. The functions in the module are only valid for inputs that match the given type annotations. """ _...
10a787c9f2147081001239029146b5b049db17f0
featureflow/__init__.py
featureflow/__init__.py
__version__ = '1.16.14' from model import BaseModel from feature import Feature, JSONFeature, TextFeature, CompressedFeature, \ PickleFeature from extractor import Node, Graph, Aggregator, NotEnoughData from bytestream import ByteStream, ByteStreamFeature, ZipWrapper, iter_zip from data import \ IdProvider...
__version__ = '1.16.14' from model import BaseModel from feature import Feature, JSONFeature, TextFeature, CompressedFeature, \ PickleFeature from extractor import Node, Graph, Aggregator, NotEnoughData from bytestream import ByteStream, ByteStreamFeature, ZipWrapper, iter_zip from data import \ IdProvider...
Add PickleDecoder to the public API
Add PickleDecoder to the public API
Python
mit
JohnVinyard/featureflow,JohnVinyard/featureflow
<REPLACE_OLD> Decoder from <REPLACE_NEW> Decoder, PickleDecoder from <REPLACE_END> <|endoftext|> __version__ = '1.16.14' from model import BaseModel from feature import Feature, JSONFeature, TextFeature, CompressedFeature, \ PickleFeature from extractor import Node, Graph, Aggregator, NotEnoughData from bytes...
Add PickleDecoder to the public API __version__ = '1.16.14' from model import BaseModel from feature import Feature, JSONFeature, TextFeature, CompressedFeature, \ PickleFeature from extractor import Node, Graph, Aggregator, NotEnoughData from bytestream import ByteStream, ByteStreamFeature, ZipWrapper, iter_z...
6b183d7541dddc7531b3a37e8550952ec1b12dca
go/apps/urls.py
go/apps/urls.py
from django.conf.urls.defaults import patterns, url, include urlpatterns = patterns('', url(r'^survey/', include('go.apps.surveys.urls', namespace='survey')), url(r'^multi_survey/', include('go.apps.multi_surveys.urls', namespace='multi_survey')), url(r'^bulk_message/', include('go....
from django.conf.urls.defaults import patterns, url, include urlpatterns = patterns('', url(r'^survey/', include('go.apps.surveys.urls', namespace='survey')), url(r'^multi_survey/', include('go.apps.multi_surveys.urls', namespace='multi_survey')), url(r'^bulk_message/', include('go....
Fix typo in jsbox URLs.
Fix typo in jsbox URLs.
Python
bsd-3-clause
praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go
<REPLACE_OLD> include('go.apps.jsbos.urls', <REPLACE_NEW> include('go.apps.jsbox.urls', <REPLACE_END> <|endoftext|> from django.conf.urls.defaults import patterns, url, include urlpatterns = patterns('', url(r'^survey/', include('go.apps.surveys.urls', namespace='survey')), url(r'^multi_survey/', ...
Fix typo in jsbox URLs. from django.conf.urls.defaults import patterns, url, include urlpatterns = patterns('', url(r'^survey/', include('go.apps.surveys.urls', namespace='survey')), url(r'^multi_survey/', include('go.apps.multi_surveys.urls', namespace='multi_survey')), url(r'^bulk_messag...
0c7c19a9edffea9474b0aa6379bafef283425483
reboot_router_claro3G.py
reboot_router_claro3G.py
#! /usr/bin/env python # -*- coding: utf-8 -*- import urllib2 as http # URL with GET to reboot router url_get_reboot = 'http://10.11.12.254/log/in?un=admin&pw=admin12&rd=%2Fuir%2Frebo.htm?rc=&Nrd=0&Nsm=1' # Handling HTTP Cookie - Session Cookie Router cookieprocessor = http.HTTPCookieProcessor() # Customize it Ope...
#! /usr/bin/env python # -*- coding: utf-8 -*- import urllib2 as http # URL with GET to reboot router or status main page to tests #url_get_reboot = 'http://10.11.12.254/log/in?un=admin&pw=admin12&rd=%2Fuir%2Frebo.htm?rc=&Nrd=0&Nsm=1' url_get_status = 'http://10.11.12.254/log/in?un=admin&pw=admin12&rd=%2Fuir%2Fstatus...
Add variavel url_root to url of the reboot router and status mainpage router
Add variavel url_root to url of the reboot router and status mainpage router
Python
apache-2.0
cleitonbueno/reboot_router
<REPLACE_OLD> router url_get_reboot <REPLACE_NEW> router or status main page to tests #url_get_reboot <REPLACE_END> <REPLACE_OLD> 'http://10.11.12.254/log/in?un=admin&pw=admin12&rd=%2Fuir%2Frebo.htm?rc=&Nrd=0&Nsm=1' # <REPLACE_NEW> 'http://10.11.12.254/log/in?un=admin&pw=admin12&rd=%2Fuir%2Frebo.htm?rc=&Nrd=0&Nsm=1' ...
Add variavel url_root to url of the reboot router and status mainpage router #! /usr/bin/env python # -*- coding: utf-8 -*- import urllib2 as http # URL with GET to reboot router url_get_reboot = 'http://10.11.12.254/log/in?un=admin&pw=admin12&rd=%2Fuir%2Frebo.htm?rc=&Nrd=0&Nsm=1' # Handling HTTP Cookie - Session ...
596aceae0b76d919bc85cafdbb3128bae647ea9f
config_diag/tests/test_policy.py
config_diag/tests/test_policy.py
import os import numpy as np from ..policy import MDPDialogBuilder class TestMDPDialogBuilder(object): def setup(self): tests_dir = os.path.abspath(os.path.dirname(__file__)) csv_file = os.path.join(tests_dir, "Titanic.csv") self.config_sample = np.genfromtxt(csv_file, skip_header=1, ...
Add a test case for MDPDialogBuilder
Add a test case for MDPDialogBuilder
Python
apache-2.0
yasserglez/configurator,yasserglez/configurator
<REPLACE_OLD> <REPLACE_NEW> import os import numpy as np from ..policy import MDPDialogBuilder class TestMDPDialogBuilder(object): def setup(self): tests_dir = os.path.abspath(os.path.dirname(__file__)) csv_file = os.path.join(tests_dir, "Titanic.csv") self.config_sample = np.genfromtx...
Add a test case for MDPDialogBuilder
b99770a7c55cd6951df872793a54bfa260b145f9
basics/test/module-test.py
basics/test/module-test.py
from unittest import TestCase from basics import BaseCharacter from basics import BaseAttachment class ModuleTest(TestCase): def test_character_attach_attachment(self): character = BaseCharacter().save() attachment = BaseAttachment().save() # Attachment should not be among the character...
from unittest import TestCase from basics import BaseCharacter from basics import BaseAttachment from basics import BaseThing class ModuleTest(TestCase): def test_character_attach_attachment(self): character = BaseCharacter().save() attachment = BaseAttachment().save() # Attachment shou...
Write test for container containment.
Write test for container containment.
Python
apache-2.0
JASchilz/RoverMUD
<REPLACE_OLD> BaseAttachment class <REPLACE_NEW> BaseAttachment from basics import BaseThing class <REPLACE_END> <REPLACE_OLD> self.fail("Test unwritten") <REPLACE_NEW> thing_a = BaseThing().save() thing_b = BaseThing().save() # thing_b should not be among thing_a's stuff self.assertNotIn(...
Write test for container containment. from unittest import TestCase from basics import BaseCharacter from basics import BaseAttachment class ModuleTest(TestCase): def test_character_attach_attachment(self): character = BaseCharacter().save() attachment = BaseAttachment().save() # Attac...
edf08b9928558688c2402d1c144f04777f4b4bc5
gb/helpers.py
gb/helpers.py
"""Helpers to facilitate API interaction.""" # Spoken strings come to us as words, not numbers. NUM_WORD_INT = { 'zero': 0, 'one': 1, 'two': 2, 'three': 3, 'four': 4, 'five': 5, 'six': 6, 'seven': 7, 'eight': 8, 'nine': 9 } # The same thing as NUM_WORD_INT, but already stringi...
"""Helpers to facilitate API interaction.""" from functools import wraps from datetime import datetime # Spoken strings come to us as words, not numbers. NUM_WORD_INT = { 'zero': 0, 'one': 1, 'two': 2, 'three': 3, 'four': 4, 'five': 5, 'six': 6, 'seven': 7, 'eight': 8, 'nine': ...
Add caching feature to API lookup requests
Add caching feature to API lookup requests
Python
mit
jaykwon/giantanswers
<REPLACE_OLD> interaction.""" # <REPLACE_NEW> interaction.""" from functools import wraps from datetime import datetime # <REPLACE_END> <REPLACE_OLD> digits. <REPLACE_NEW> digits. <REPLACE_END> <REPLACE_OLD> made <REPLACE_NEW> made <REPLACE_END> <REPLACE_OLD> phrase <REPLACE_NEW> phrase CACHE = {}...
Add caching feature to API lookup requests """Helpers to facilitate API interaction.""" # Spoken strings come to us as words, not numbers. NUM_WORD_INT = { 'zero': 0, 'one': 1, 'two': 2, 'three': 3, 'four': 4, 'five': 5, 'six': 6, 'seven': 7, 'eight': 8, 'nine': 9 } # The sam...
3bf3813ed03f755d7aa777fc023add5c51a54311
tests/test_sqlalchemy_create_table.py
tests/test_sqlalchemy_create_table.py
# -*- coding: utf-8; -*- import re from sqlalchemy import Column, Integer, MetaData, String, Table from sqlalchemy.sql.ddl import CreateTable from pyathena.sqlalchemy_athena import AthenaDialect def test_create_table(): # Given table = Table('table_name', MetaData(), Column('column_name', String)) diale...
Add failing test showing the issue
Add failing test showing the issue Relates to issue #258.
Python
mit
laughingman7743/PyAthena
<INSERT> # -*- coding: utf-8; -*- import re from sqlalchemy import Column, Integer, MetaData, String, Table from sqlalchemy.sql.ddl import CreateTable from pyathena.sqlalchemy_athena import AthenaDialect def test_create_table(): <INSERT_END> <INSERT> # Given table = Table('table_name', MetaData(), Column('co...
Add failing test showing the issue Relates to issue #258.
89ccd37938fc4ca98b0683ecd8c93e48eef3bf35
forms.py
forms.py
from django import forms class RemoteSubscribeForm(forms.Form): username = forms.CharField(max_length=64, label="Username") profile_url = forms.URLField(label="OMB Compatable Profile URL") AUTHORIZE_CHOICES = ( ('on', 'Accept'), ('off', 'Reject') ) class AuthorizeForm(forms.Form): token = forms.C...
from django import forms class RemoteSubscribeForm(forms.Form): username = forms.CharField(max_length=64, label="Username") profile_url = forms.URLField(label="OMB Compatable Profile URL") AUTHORIZE_CHOICES = ( (1, 'Accept'), (0, 'Reject') ) class AuthorizeForm(forms.Form): token = forms.CharFiel...
Use integer values for the remote subscribe form to comply with the django oauth_provider.
Use integer values for the remote subscribe form to comply with the django oauth_provider.
Python
mit
skabber/django-omb
<REPLACE_OLD> ('on', <REPLACE_NEW> (1, <REPLACE_END> <REPLACE_OLD> ('off', <REPLACE_NEW> (0, <REPLACE_END> <|endoftext|> from django import forms class RemoteSubscribeForm(forms.Form): username = forms.CharField(max_length=64, label="Username") profile_url = forms.URLField(label="OMB Compatable Profile URL") ...
Use integer values for the remote subscribe form to comply with the django oauth_provider. from django import forms class RemoteSubscribeForm(forms.Form): username = forms.CharField(max_length=64, label="Username") profile_url = forms.URLField(label="OMB Compatable Profile URL") AUTHORIZE_CHOICES = ( ('o...
18085ebbf45473046980d182fe285d6663698e72
src/query_processing/query_processing.py
src/query_processing/query_processing.py
# LING 573 Question Answering System # Code last updated 4/15/14 by Andrea Kahn # This code implements a QueryProcessor for the question answering system. # TODO: A QueryProcessor should be initialized with the Question object, but should it # have this question as an attribute, or should it have attributes id, type,...
Add skeleton for query-processing module
Add skeleton for query-processing module
Python
mit
amkahn/question-answering,amkahn/question-answering
<REPLACE_OLD> <REPLACE_NEW> # LING 573 Question Answering System # Code last updated 4/15/14 by Andrea Kahn # This code implements a QueryProcessor for the question answering system. # TODO: A QueryProcessor should be initialized with the Question object, but should it # have this question as an attribute, or should...
Add skeleton for query-processing module
2ef671ca19f237ab0bf3fcc632048b34a2c5d3dc
tutorials/models.py
tutorials/models.py
from django.db import models from markdownx.models import MarkdownxField # Create your models here. class Tutorial(models.Model): # ToDo: Fields that are out-commented are missing according to the mockup -> datamodel ?? # Category = models.TextField() title = models.TextField() html = models.TextFie...
from django.db import models from django.urls import reverse from markdownx.models import MarkdownxField # add options if needed CATEGORY_OPTIONS = [('io', 'I/O'), ('intro', 'Introduction')] LEVEL_OPTIONS = [(1, '1'), (2, '2'), (3, '3')] # Create your models here. class Tutorial(models.Model): # ToDo: Fields th...
Add options for choices fields, Add new fields to Tutorial model
Add options for choices fields, Add new fields to Tutorial model
Python
agpl-3.0
openego/oeplatform,openego/oeplatform,openego/oeplatform,openego/oeplatform
<INSERT> django.urls import reverse from <INSERT_END> <INSERT> add options if needed CATEGORY_OPTIONS = [('io', 'I/O'), ('intro', 'Introduction')] LEVEL_OPTIONS = [(1, '1'), (2, '2'), (3, '3')] # <INSERT_END> <REPLACE_OLD> here. class <REPLACE_NEW> here. class <REPLACE_END> <REPLACE_OLD> # Category <REPLACE_NEW> c...
Add options for choices fields, Add new fields to Tutorial model from django.db import models from markdownx.models import MarkdownxField # Create your models here. class Tutorial(models.Model): # ToDo: Fields that are out-commented are missing according to the mockup -> datamodel ?? # Category = models.Te...
774fff656463eb44fb10813f8668e37ed2d459fc
ktbs_bench/utils/decorators.py
ktbs_bench/utils/decorators.py
from functools import wraps from inspect import getcallargs from timer import Timer def bench(f): """Times a function given specific arguments.""" timer = Timer(tick_now=False) @wraps(f) def wrapped(*args, **kwargs): timer.start() f(*args, **kwargs) timer.stop() res...
from functools import wraps from inspect import getcallargs from timer import Timer def bench(f): """Times a function given specific arguments.""" @wraps(f) def wrapped(*args, **kwargs): timer = Timer(tick_now=False) timer.start() f(*args, **kwargs) timer.stop() ...
Fix timer in @bench to be reset for each benched function call
Fix timer in @bench to be reset for each benched function call
Python
mit
ktbs/ktbs-bench,ktbs/ktbs-bench
<DELETE> timer = Timer(tick_now=False) <DELETE_END> <INSERT> timer = Timer(tick_now=False) <INSERT_END> <|endoftext|> from functools import wraps from inspect import getcallargs from timer import Timer def bench(f): """Times a function given specific arguments.""" @wraps(f) def wrapped(*arg...
Fix timer in @bench to be reset for each benched function call from functools import wraps from inspect import getcallargs from timer import Timer def bench(f): """Times a function given specific arguments.""" timer = Timer(tick_now=False) @wraps(f) def wrapped(*args, **kwargs): timer.star...
c6837af1af2939965976bfb45099bf7c2407a9da
twitter_api/middleware/ghetto_oauth.py
twitter_api/middleware/ghetto_oauth.py
from django.contrib.auth.models import User import re class GhettoOAuthMiddleware(object): def process_view(self, request, view_func, view_args, view_kwargs): user_id = None if 'HTTP_AUTHORIZATION' in request.META and request.META['HTTP_AUTHORIZATION'].startswith('OAuth'): m = re.search...
from django.contrib.auth.models import User import re class GhettoOAuthMiddleware(object): def process_view(self, request, view_func, view_args, view_kwargs): user_id = self._get_token_from_header(request, 'HTTP_AUTHORIZATION') if not user_id: user_id = self._get_token_from_header(reque...
Add more HTTP headers to GhettoOauth
Add more HTTP headers to GhettoOauth The official iPhone Twitter client uses HTTP_X_VERIFY_CREDENTIALS_AUTHORIZATION when it's connecting to image upload services.
Python
bsd-2-clause
simonw/bugle_project,devfort/bugle,simonw/bugle_project,devfort/bugle,devfort/bugle
<REPLACE_OLD> None <REPLACE_NEW> self._get_token_from_header(request, 'HTTP_AUTHORIZATION') <REPLACE_END> <REPLACE_OLD> 'HTTP_AUTHORIZATION' in request.META and request.META['HTTP_AUTHORIZATION'].startswith('OAuth'): m = re.search(r'oauth_token="(\d+)"', request.META['HTTP_AUTHORIZATI...
Add more HTTP headers to GhettoOauth The official iPhone Twitter client uses HTTP_X_VERIFY_CREDENTIALS_AUTHORIZATION when it's connecting to image upload services. from django.contrib.auth.models import User import re class GhettoOAuthMiddleware(object): def process_view(self, request, view_func, view_args, view...