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
19
3.3k
prompt
stringlengths
21
3.65k
445a150982f2119b340d95edc66940e0ec54afbd
lib/ansiblelint/rules/NoFormattingInWhenRule.py
lib/ansiblelint/rules/NoFormattingInWhenRule.py
from ansiblelint import AnsibleLintRule class NoFormattingInWhenRule(AnsibleLintRule): id = 'CINCH0001' shortdesc = 'No Jinja2 in when' description = '"when" lines should not include Jinja2 variables' tags = ['deprecated'] def _is_valid(self, when): if not isinstance(when, (str, unicode))...
from ansiblelint import AnsibleLintRule try: from types import StringTypes except ImportError: # Python3 removed types.StringTypes StringTypes = str, class NoFormattingInWhenRule(AnsibleLintRule): id = 'CINCH0001' shortdesc = 'No Jinja2 in when' description = '"when" lines should not include J...
Fix Python3 unicode test error
Fix Python3 unicode test error
Python
mit
willthames/ansible-lint,dataxu/ansible-lint,MatrixCrawler/ansible-lint
from ansiblelint import AnsibleLintRule try: from types import StringTypes except ImportError: # Python3 removed types.StringTypes StringTypes = str, class NoFormattingInWhenRule(AnsibleLintRule): id = 'CINCH0001' shortdesc = 'No Jinja2 in when' description = '"when" lines should not include J...
Fix Python3 unicode test error from ansiblelint import AnsibleLintRule class NoFormattingInWhenRule(AnsibleLintRule): id = 'CINCH0001' shortdesc = 'No Jinja2 in when' description = '"when" lines should not include Jinja2 variables' tags = ['deprecated'] def _is_valid(self, when): if not ...
679c2daceb7f4e9d193e345ee42b0334dd576c64
changes/web/index.py
changes/web/index.py
import changes import urlparse from flask import render_template, current_app, redirect, url_for, session from flask.views import MethodView class IndexView(MethodView): def get(self, path=''): # require auth if not session.get('email'): return redirect(url_for('login')) if c...
import changes import urlparse from flask import render_template, current_app, redirect, url_for, session from flask.views import MethodView class IndexView(MethodView): def get(self, path=''): # require auth if not session.get('email'): return redirect(url_for('login')) if c...
Disable Sentry due to sync behavior
Disable Sentry due to sync behavior
Python
apache-2.0
bowlofstew/changes,wfxiang08/changes,wfxiang08/changes,dropbox/changes,bowlofstew/changes,wfxiang08/changes,dropbox/changes,dropbox/changes,bowlofstew/changes,wfxiang08/changes,dropbox/changes,bowlofstew/changes
import changes import urlparse from flask import render_template, current_app, redirect, url_for, session from flask.views import MethodView class IndexView(MethodView): def get(self, path=''): # require auth if not session.get('email'): return redirect(url_for('login')) if c...
Disable Sentry due to sync behavior import changes import urlparse from flask import render_template, current_app, redirect, url_for, session from flask.views import MethodView class IndexView(MethodView): def get(self, path=''): # require auth if not session.get('email'): return red...
be5ffde03bd08a613353c876fd91b35f8a38d76a
oidc_provider/urls.py
oidc_provider/urls.py
from django.conf.urls import patterns, include, url from django.views.decorators.csrf import csrf_exempt from oidc_provider.views import * urlpatterns = patterns('', url(r'^authorize/?$', AuthorizeView.as_view(), name='authorize'), url(r'^token/?$', csrf_exempt(TokenView.as_view()), name='token'), url(r'...
from django.conf.urls import patterns, include, url from django.views.decorators.csrf import csrf_exempt from oidc_provider.views import * urlpatterns = [ url(r'^authorize/?$', AuthorizeView.as_view(), name='authorize'), url(r'^token/?$', csrf_exempt(TokenView.as_view()), name='token'), url(r'^userinfo/?...
Remove patterns which will be deprecated in 1.10
Remove patterns which will be deprecated in 1.10
Python
mit
torreco/django-oidc-provider,ByteInternet/django-oidc-provider,wojtek-fliposports/django-oidc-provider,bunnyinc/django-oidc-provider,torreco/django-oidc-provider,bunnyinc/django-oidc-provider,juanifioren/django-oidc-provider,juanifioren/django-oidc-provider,ByteInternet/django-oidc-provider,wojtek-fliposports/django-oi...
from django.conf.urls import patterns, include, url from django.views.decorators.csrf import csrf_exempt from oidc_provider.views import * urlpatterns = [ url(r'^authorize/?$', AuthorizeView.as_view(), name='authorize'), url(r'^token/?$', csrf_exempt(TokenView.as_view()), name='token'), url(r'^userinfo/?...
Remove patterns which will be deprecated in 1.10 from django.conf.urls import patterns, include, url from django.views.decorators.csrf import csrf_exempt from oidc_provider.views import * urlpatterns = patterns('', url(r'^authorize/?$', AuthorizeView.as_view(), name='authorize'), url(r'^token/?$', csrf_exem...
f93fcd5cee878c201dd1be2102a2a9433a63c4b5
scripts/set-artist-streamable.py
scripts/set-artist-streamable.py
#!/usr/bin/env python import psycopg2 as ordbms import urllib, urllib2 import xml.etree.cElementTree as ElementTree class SetArtistStreamable: def __init__(self): self.conn = ordbms.connect ("dbname='librefm'") self.cursor = self.conn.cursor() def updateAll(self): """Sets artists streamable ...
#!/usr/bin/env python import psycopg2 as ordbms import urllib, urllib2 import xml.etree.cElementTree as ElementTree class SetArtistStreamable: def __init__(self): self.conn = ordbms.connect ("dbname='librefm'") self.cursor = self.conn.cursor() def updateAll(self): """Sets artists streamable ...
Make streamable artist updates as they happen, rather than commiting at the end of all artists
Make streamable artist updates as they happen, rather than commiting at the end of all artists
Python
agpl-3.0
foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm
#!/usr/bin/env python import psycopg2 as ordbms import urllib, urllib2 import xml.etree.cElementTree as ElementTree class SetArtistStreamable: def __init__(self): self.conn = ordbms.connect ("dbname='librefm'") self.cursor = self.conn.cursor() def updateAll(self): """Sets artists streamable ...
Make streamable artist updates as they happen, rather than commiting at the end of all artists #!/usr/bin/env python import psycopg2 as ordbms import urllib, urllib2 import xml.etree.cElementTree as ElementTree class SetArtistStreamable: def __init__(self): self.conn = ordbms.connect ("dbname='librefm'") ...
a50aeb81a588f8297f194d793cb8f8cf0e15a411
lambda/list_member.py
lambda/list_member.py
from __future__ import print_function from enum import IntEnum import yaml MemberFlag = IntEnum('MemberFlag', [ 'digest', 'digest2', 'modPost', 'preapprove', 'noPost', 'diagnostic', 'moderator', 'myopic', 'superadmin', 'admin', 'protected', 'ccErrors', 'reports', ...
from __future__ import print_function from enum import IntEnum import yaml MemberFlag = IntEnum('MemberFlag', [ 'digest', 'digest2', 'modPost', 'preapprove', 'noPost', 'diagnostic', 'moderator', 'myopic', 'superadmin', 'admin', 'protected', 'ccErrors', 'reports', ...
Convert list member addresses to non-unicode strings when possible.
Convert list member addresses to non-unicode strings when possible.
Python
mit
ilg/LambdaMLM
from __future__ import print_function from enum import IntEnum import yaml MemberFlag = IntEnum('MemberFlag', [ 'digest', 'digest2', 'modPost', 'preapprove', 'noPost', 'diagnostic', 'moderator', 'myopic', 'superadmin', 'admin', 'protected', 'ccErrors', 'reports', ...
Convert list member addresses to non-unicode strings when possible. from __future__ import print_function from enum import IntEnum import yaml MemberFlag = IntEnum('MemberFlag', [ 'digest', 'digest2', 'modPost', 'preapprove', 'noPost', 'diagnostic', 'moderator', 'myopic', 'superad...
224abc99becc1683605a6dc5c3460510efef3efb
tests/test_pyserial.py
tests/test_pyserial.py
from __future__ import (absolute_import, print_function, unicode_literals) import os import sys lib_path = os.path.abspath('../') sys.path.append(lib_path) import io import struct import unittest import threading import time import serial try: import unittest2 as unittest except ImportError: import unittest ...
from __future__ import (absolute_import, print_function, unicode_literals) import os import sys lib_path = os.path.abspath('../') sys.path.append(lib_path) import io import struct import unittest import threading import time import serial try: import unittest2 as unittest except ImportError: import unittest ...
Comment out the pyserial TestIsCorrectVariant test.
Comment out the pyserial TestIsCorrectVariant test.
Python
agpl-3.0
Jnesselr/s3g,makerbot/s3g,Jnesselr/s3g,makerbot/s3g,makerbot/s3g,makerbot/s3g
from __future__ import (absolute_import, print_function, unicode_literals) import os import sys lib_path = os.path.abspath('../') sys.path.append(lib_path) import io import struct import unittest import threading import time import serial try: import unittest2 as unittest except ImportError: import unittest ...
Comment out the pyserial TestIsCorrectVariant test. from __future__ import (absolute_import, print_function, unicode_literals) import os import sys lib_path = os.path.abspath('../') sys.path.append(lib_path) import io import struct import unittest import threading import time import serial try: import unittest2...
2752af0f94ba477ac95b00a05243719d1a01c354
src/checker/pluginManager.py
src/checker/pluginManager.py
""" Plugin manager is Checker's main module. Plugin Manager is using Yapsy to find and load plugins from a directory and loads them via PluginRunner. """ from yapsy.PluginManager import PluginManager from pluginRunner import PluginRunner from configLoader import ConfigLoader from down import Scraper import lo...
""" Plugin manager is Checker's main module. Plugin Manager is using Yapsy to find and load plugins from a directory and loads them via PluginRunner. """ from yapsy.PluginManager import PluginManager from pluginRunner import PluginRunner from configLoader import ConfigLoader from down import Scraper import lo...
Fix typo - XML<->YAML configuration
Fix typo - XML<->YAML configuration
Python
mit
eghuro/crawlcheck
""" Plugin manager is Checker's main module. Plugin Manager is using Yapsy to find and load plugins from a directory and loads them via PluginRunner. """ from yapsy.PluginManager import PluginManager from pluginRunner import PluginRunner from configLoader import ConfigLoader from down import Scraper import lo...
Fix typo - XML<->YAML configuration """ Plugin manager is Checker's main module. Plugin Manager is using Yapsy to find and load plugins from a directory and loads them via PluginRunner. """ from yapsy.PluginManager import PluginManager from pluginRunner import PluginRunner from configLoader import ConfigLoade...
db14ed2c23b3838796e648faade2c73b786d61ff
tartpy/eventloop.py
tartpy/eventloop.py
""" Very basic implementation of an event loop ========================================== The eventloop is a singleton to schedule and run events. Exports ------- - ``EventLoop``: the basic eventloop """ import queue import sys import threading import time import traceback from .singleton import Singleton def ...
""" Very basic implementation of an event loop ========================================== The eventloop is a singleton to schedule and run events. Exports ------- - ``EventLoop``: the basic eventloop """ import queue import sys import threading import time import traceback from .singleton import Singleton def ...
Make exception message builder a nicer function
Make exception message builder a nicer function It is used by clients in other modules.
Python
mit
waltermoreira/tartpy
""" Very basic implementation of an event loop ========================================== The eventloop is a singleton to schedule and run events. Exports ------- - ``EventLoop``: the basic eventloop """ import queue import sys import threading import time import traceback from .singleton import Singleton def ...
Make exception message builder a nicer function It is used by clients in other modules. """ Very basic implementation of an event loop ========================================== The eventloop is a singleton to schedule and run events. Exports ------- - ``EventLoop``: the basic eventloop """ import queue import s...
2640566b45736229cab347b9482a7372488ec53b
eccodes/highlevel/message.py
eccodes/highlevel/message.py
import io import eccodes class Message: def __init__(self, handle): self.handle = handle def __del__(self): eccodes.codes_release(self.handle) def get_array(self, name): return eccodes.codes_get_array(self.handle, name) def set_array(self, name, value): return eccod...
import io import eccodes class Message: def __init__(self, handle): self.handle = handle def __del__(self): eccodes.codes_release(self.handle) def get(self, name): return eccodes.codes_get(self.handle, name) def set(self, name, value): return eccodes.codes_set(self....
Add get/set methods to the Message class
Add get/set methods to the Message class
Python
apache-2.0
ecmwf/eccodes-python,ecmwf/eccodes-python
import io import eccodes class Message: def __init__(self, handle): self.handle = handle def __del__(self): eccodes.codes_release(self.handle) def get(self, name): return eccodes.codes_get(self.handle, name) def set(self, name, value): return eccodes.codes_set(self....
Add get/set methods to the Message class import io import eccodes class Message: def __init__(self, handle): self.handle = handle def __del__(self): eccodes.codes_release(self.handle) def get_array(self, name): return eccodes.codes_get_array(self.handle, name) def set_arra...
d00aea75e0f4e6ba74a2ccf57d02a0ef912d17ac
db/TableConfig.py
db/TableConfig.py
{ PDBConst.Name: "config", PDBConst.Columns: [ { PDBConst.Name: "Name", PDBConst.Attributes: ["varchar(128)", "not null", "primary key"] }, { PDBConst.Name: "Value", PDBConst.Attributes: ["varchar(128)"] }], PDBConst.Initials: [ {"Name": "'version'", "...
{ PDBConst.Name: "config", PDBConst.Columns: [ { PDBConst.Name: "Name", PDBConst.Attributes: ["varchar(128)", "not null", "primary key"] }, { PDBConst.Name: "Value", PDBConst.Attributes: ["varchar(128)"] }], PDBConst.Initials: [ {"Name": "'version'", "...
Update DB to v4.2 on note pdf support
Update DB to v4.2 on note pdf support
Python
mit
eddiedb6/ej,eddiedb6/ej,eddiedb6/ej
{ PDBConst.Name: "config", PDBConst.Columns: [ { PDBConst.Name: "Name", PDBConst.Attributes: ["varchar(128)", "not null", "primary key"] }, { PDBConst.Name: "Value", PDBConst.Attributes: ["varchar(128)"] }], PDBConst.Initials: [ {"Name": "'version'", "...
Update DB to v4.2 on note pdf support { PDBConst.Name: "config", PDBConst.Columns: [ { PDBConst.Name: "Name", PDBConst.Attributes: ["varchar(128)", "not null", "primary key"] }, { PDBConst.Name: "Value", PDBConst.Attributes: ["varchar(128)"] }], PDBConst.Init...
8bc2b19e9aef410832555fb9962c243f0d4aef96
brink/decorators.py
brink/decorators.py
def require_request_model(cls, *args, validate=True, **kwargs): """ Makes a handler require that a request body that map towards the given model is provided. Unless the ``validate`` option is set to ``False`` the data will be validated against the model's fields. The model will be passed to the han...
import asyncio def require_request_model(cls, *args, validate=True, **kwargs): """ Makes a handler require that a request body that map towards the given model is provided. Unless the ``validate`` option is set to ``False`` the data will be validated against the model's fields. The model will be ...
Add decorator for using websocket subhandlers
Add decorator for using websocket subhandlers
Python
bsd-3-clause
brinkframework/brink
import asyncio def require_request_model(cls, *args, validate=True, **kwargs): """ Makes a handler require that a request body that map towards the given model is provided. Unless the ``validate`` option is set to ``False`` the data will be validated against the model's fields. The model will be ...
Add decorator for using websocket subhandlers def require_request_model(cls, *args, validate=True, **kwargs): """ Makes a handler require that a request body that map towards the given model is provided. Unless the ``validate`` option is set to ``False`` the data will be validated against the model's f...
a6ae05c13666b83a1f1a8707fe21972bd1f758d9
walltime.py
walltime.py
#!/usr/bin/env python """ Created on Fri Mar 14 15:25:36 2014 @author: ibackus """ import matplotlib.pyplot as plt import numpy as np import datetime import sys if len(sys.argv) < 2: print 'USAGE: walltime filename' else: fname = sys.argv[-1] log_file = np.genfromtxt(fname, comments='#...
#!/usr/bin/env python """ Created on Fri Mar 14 15:25:36 2014 @author: ibackus """ import time t0 = time.time() import matplotlib.pyplot as plt import numpy as np import datetime import sys t1 = time.time() print 'Importing took {} s'.format(t1-t0) if len(sys.argv) < 2: print 'USAGE: walltime filename...
Print statements added for profiling
Print statements added for profiling
Python
mit
ibackus/custom_python_packages,trquinn/custom_python_packages
#!/usr/bin/env python """ Created on Fri Mar 14 15:25:36 2014 @author: ibackus """ import time t0 = time.time() import matplotlib.pyplot as plt import numpy as np import datetime import sys t1 = time.time() print 'Importing took {} s'.format(t1-t0) if len(sys.argv) < 2: print 'USAGE: walltime filename...
Print statements added for profiling #!/usr/bin/env python """ Created on Fri Mar 14 15:25:36 2014 @author: ibackus """ import matplotlib.pyplot as plt import numpy as np import datetime import sys if len(sys.argv) < 2: print 'USAGE: walltime filename' else: fname = sys.argv[-1] log_f...
9fe639db9cf671073057fc983a03c8d10b8752d3
genes/docker/main.py
genes/docker/main.py
from genes import apt import platform class Config: OS = platform.system() (DIST, _, CODE) = platform.linux_distribution() REPO = DIST.lower() + '-' + CODE def main(): if Config.OS == 'Linux': if Config.DIST == 'Ubuntu' or Config.DIST == 'Debian': apt.recv_key('58118E89F3A912897C07...
from genes import apt import platform class Config: OS = platform.system() (DIST, _, CODE) = platform.linux_distribution() REPO = DIST.lower() + '-' + CODE def main(): if Config.OS == 'Linux': if Config.DIST == 'Ubuntu' or Config.DIST == 'Debian': apt.recv_key('58118E89F3A912897C07...
Add todos and stubs for osx
Add todos and stubs for osx
Python
mit
hatchery/genepool,hatchery/Genepool2
from genes import apt import platform class Config: OS = platform.system() (DIST, _, CODE) = platform.linux_distribution() REPO = DIST.lower() + '-' + CODE def main(): if Config.OS == 'Linux': if Config.DIST == 'Ubuntu' or Config.DIST == 'Debian': apt.recv_key('58118E89F3A912897C07...
Add todos and stubs for osx from genes import apt import platform class Config: OS = platform.system() (DIST, _, CODE) = platform.linux_distribution() REPO = DIST.lower() + '-' + CODE def main(): if Config.OS == 'Linux': if Config.DIST == 'Ubuntu' or Config.DIST == 'Debian': apt.re...
b3f3325484426e2f77dc2df092c316ed38584970
test/proper_noun_test.py
test/proper_noun_test.py
from jargonprofiler.util import tag_proper_nouns from jargonprofiler.munroe import munroe_score def test_proper_noun_in_sentance(): assert tag_proper_nouns("My name is Eilis.") == set(["Eilis"]) def test_proper_noun_begins_sentance(): assert tag_proper_nouns("Eilis is a girl") == set(["Eilis"]) def test_...
from jargonprofiler.util import tag_proper_nouns from jargonprofiler.munroe import munroe_score def test_proper_noun_in_sentance(): assert tag_proper_nouns("My name is Eilis.") == set(["Eilis"]) def test_proper_noun_begins_sentance(): assert tag_proper_nouns("Eilis is a girl") == set(["Eilis"]) def test_...
Update test now 'is' is a common word
Update test now 'is' is a common word
Python
mit
ejh243/MunroeJargonProfiler,ejh243/MunroeJargonProfiler
from jargonprofiler.util import tag_proper_nouns from jargonprofiler.munroe import munroe_score def test_proper_noun_in_sentance(): assert tag_proper_nouns("My name is Eilis.") == set(["Eilis"]) def test_proper_noun_begins_sentance(): assert tag_proper_nouns("Eilis is a girl") == set(["Eilis"]) def test_...
Update test now 'is' is a common word from jargonprofiler.util import tag_proper_nouns from jargonprofiler.munroe import munroe_score def test_proper_noun_in_sentance(): assert tag_proper_nouns("My name is Eilis.") == set(["Eilis"]) def test_proper_noun_begins_sentance(): assert tag_proper_nouns("Eilis is...
535b07758a16dec2ce79781f19b34a96044b99d3
fluent_contents/conf/plugin_template/models.py
fluent_contents/conf/plugin_template/models.py
from django.db import models from django.utils.six import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from fluent_contents.models import ContentItem @python_2_unicode_compatible class {{ model }}(ContentItem): """ CMS plugin data model to ... """ title = models...
from django.db import models from django.utils.translation import gettext_lazy as _ from fluent_contents.models import ContentItem class {{ model }}(ContentItem): """ CMS plugin data model to ... """ title = models.CharField(_("Title"), max_length=200) class Meta: verbose_name = _("{{ mo...
Update plugin_template to Python 3-only standards
Update plugin_template to Python 3-only standards
Python
apache-2.0
edoburu/django-fluent-contents,django-fluent/django-fluent-contents,edoburu/django-fluent-contents,edoburu/django-fluent-contents,django-fluent/django-fluent-contents,django-fluent/django-fluent-contents
from django.db import models from django.utils.translation import gettext_lazy as _ from fluent_contents.models import ContentItem class {{ model }}(ContentItem): """ CMS plugin data model to ... """ title = models.CharField(_("Title"), max_length=200) class Meta: verbose_name = _("{{ mo...
Update plugin_template to Python 3-only standards from django.db import models from django.utils.six import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from fluent_contents.models import ContentItem @python_2_unicode_compatible class {{ model }}(ContentItem): """ CMS ...
e018f35e51712e4d6a03f5b31e33f61c03365538
profiles/views.py
profiles/views.py
from django.shortcuts import render from django.contrib.auth.models import User from django.http import Http404 from django.views.generic import DetailView from django.contrib.auth.decorators import login_required from django.utils.decorators import method_decorator from django.shortcuts import get_object_or_404 from ...
from django.shortcuts import render from django.contrib.auth.models import User from django.http import Http404 from django.views.generic import DetailView from django.contrib.auth.decorators import login_required from django.utils.decorators import method_decorator from django.shortcuts import get_object_or_404 from ...
Order content on profile by most recent.
Order content on profile by most recent.
Python
mit
ImmaculateObsession/nest,ImmaculateObsession/nest,ImmaculateObsession/nest,ImmaculateObsession/nest,ImmaculateObsession/nest
from django.shortcuts import render from django.contrib.auth.models import User from django.http import Http404 from django.views.generic import DetailView from django.contrib.auth.decorators import login_required from django.utils.decorators import method_decorator from django.shortcuts import get_object_or_404 from ...
Order content on profile by most recent. from django.shortcuts import render from django.contrib.auth.models import User from django.http import Http404 from django.views.generic import DetailView from django.contrib.auth.decorators import login_required from django.utils.decorators import method_decorator from django...
dbe28b1d00a17acdd276263c9042dbd7b5dfc311
src/adhocracy_kit/adhocracy_kit/__init__.py
src/adhocracy_kit/adhocracy_kit/__init__.py
"""Adhocracy extension.""" from pyramid.config import Configurator from adhocracy_core import root_factory def includeme(config): """Setup adhocracy extension. The kit package should be exactly like the spd package but with different root permissions and default translations for the emails. """ ...
"""Adhocracy extension.""" from pyramid.config import Configurator from adhocracy_core import root_factory def includeme(config): """Setup adhocracy extension. The kit package should be exactly like the spd package but with different root permissions and default translations for the emails. """ ...
Fix wrong config includes in kit package
Fix wrong config includes in kit package
Python
agpl-3.0
liqd/adhocracy3.mercator,fhartwig/adhocracy3.mercator,liqd/adhocracy3.mercator,liqd/adhocracy3.mercator,fhartwig/adhocracy3.mercator,fhartwig/adhocracy3.mercator,fhartwig/adhocracy3.mercator,fhartwig/adhocracy3.mercator,liqd/adhocracy3.mercator,fhartwig/adhocracy3.mercator,liqd/adhocracy3.mercator,fhartwig/adhocracy3.m...
"""Adhocracy extension.""" from pyramid.config import Configurator from adhocracy_core import root_factory def includeme(config): """Setup adhocracy extension. The kit package should be exactly like the spd package but with different root permissions and default translations for the emails. """ ...
Fix wrong config includes in kit package """Adhocracy extension.""" from pyramid.config import Configurator from adhocracy_core import root_factory def includeme(config): """Setup adhocracy extension. The kit package should be exactly like the spd package but with different root permissions and default...
55b0d7eba281fc2c13505c956f5c23bb49b34988
tests/test_qiniu.py
tests/test_qiniu.py
import os from os.path import dirname, join import uuid import qiniu.conf import qiniu.io import qiniu.rs import qiniu.rsf QINIU_ACCESS_KEY = os.environ.get('QINIU_ACCESS_KEY') QINIU_SECRET_KEY = os.environ.get('QINIU_SECRET_KEY') QINIU_BUCKET_NAME = os.environ.get('QINIU_BUCKET_NAME') QINIU_BUCKET_DOMAIN = os.envir...
import os from os.path import dirname, join import uuid import qiniu.conf import qiniu.io import qiniu.rs import qiniu.rsf QINIU_ACCESS_KEY = os.environ.get('QINIU_ACCESS_KEY') QINIU_SECRET_KEY = os.environ.get('QINIU_SECRET_KEY') QINIU_BUCKET_NAME = os.environ.get('QINIU_BUCKET_NAME') QINIU_BUCKET_DOMAIN = os.envir...
Test with even smaller files
Test with even smaller files
Python
mit
glasslion/django-qiniu-storage,jeffrey4l/django-qiniu-storage,Mark-Shine/django-qiniu-storage,jackeyGao/django-qiniu-storage
import os from os.path import dirname, join import uuid import qiniu.conf import qiniu.io import qiniu.rs import qiniu.rsf QINIU_ACCESS_KEY = os.environ.get('QINIU_ACCESS_KEY') QINIU_SECRET_KEY = os.environ.get('QINIU_SECRET_KEY') QINIU_BUCKET_NAME = os.environ.get('QINIU_BUCKET_NAME') QINIU_BUCKET_DOMAIN = os.envir...
Test with even smaller files import os from os.path import dirname, join import uuid import qiniu.conf import qiniu.io import qiniu.rs import qiniu.rsf QINIU_ACCESS_KEY = os.environ.get('QINIU_ACCESS_KEY') QINIU_SECRET_KEY = os.environ.get('QINIU_SECRET_KEY') QINIU_BUCKET_NAME = os.environ.get('QINIU_BUCKET_NAME') ...
a9bdf9ec691f0e688af41be1216977b9ce9c8976
helpers.py
helpers.py
""" A bunch of helper functions that, when fixed up, will return the things we need to make this website work! These functions use the weather and twitter APIs!!! """ ## Import python libraries we need up here. ############################################### ### Problem One! ### #########...
""" A bunch of helper functions that, when fixed up, will return the things we need to make this website work! These functions use the weather and twitter APIs!!! """ ## Import python libraries we need up here. ############################################### ### Problem One! ### #########...
Set tweet limit to 30 tweets
Set tweet limit to 30 tweets
Python
apache-2.0
samanehsan/spark_github,samanehsan/spark_github,samanehsan/learn-git,samanehsan/learn-git
""" A bunch of helper functions that, when fixed up, will return the things we need to make this website work! These functions use the weather and twitter APIs!!! """ ## Import python libraries we need up here. ############################################### ### Problem One! ### #########...
Set tweet limit to 30 tweets """ A bunch of helper functions that, when fixed up, will return the things we need to make this website work! These functions use the weather and twitter APIs!!! """ ## Import python libraries we need up here. ############################################### ### Problem One...
d21743f2543f8d953a837d75bff0fcdb0105f4db
feincms/module/page/extensions/changedate.py
feincms/module/page/extensions/changedate.py
""" Track the modification date for pages. """ from datetime import datetime from django.db import models from django.db.models import Q from django.utils.translation import ugettext_lazy as _ from django.conf import settings def register(cls, admin_cls): cls.add_to_class('creation_date', models.DateTimeField(_...
Add page extension for tracking page creation and modification dates.
Add page extension for tracking page creation and modification dates. This can be used in conjunction with a response processor to set the "last-modified" or "etag" response headers.
Python
bsd-3-clause
feincms/feincms,hgrimelid/feincms,pjdelport/feincms,joshuajonah/feincms,nickburlett/feincms,matthiask/django-content-editor,joshuajonah/feincms,matthiask/django-content-editor,matthiask/django-content-editor,nickburlett/feincms,michaelkuty/feincms,joshuajonah/feincms,mjl/feincms,michaelkuty/feincms,hgrimelid/feincms,jo...
""" Track the modification date for pages. """ from datetime import datetime from django.db import models from django.db.models import Q from django.utils.translation import ugettext_lazy as _ from django.conf import settings def register(cls, admin_cls): cls.add_to_class('creation_date', models.DateTimeField(_...
Add page extension for tracking page creation and modification dates. This can be used in conjunction with a response processor to set the "last-modified" or "etag" response headers.
702217fee6e332b3d08902bb67f0725626f0c88d
test_defuzz.py
test_defuzz.py
from defuzz import Defuzzer def test_it(): dfz = Defuzzer() assert dfz.defuzz((1, 2)) == (1, 2) assert dfz.defuzz((1, 3)) == (1, 3) assert dfz.defuzz((1.00000001, 2)) == (1, 2) assert dfz.defuzz((1, 2, 3, 4, 5)) == (1, 2, 3, 4, 5) assert dfz.defuzz((2.00000001, 3)) == (2.00000001, 3) asser...
import itertools import math from defuzz import Defuzzer from hypothesis import given from hypothesis.strategies import floats, lists, tuples from hypo_helpers import f def test_it(): dfz = Defuzzer() assert dfz.defuzz((1, 2)) == (1, 2) assert dfz.defuzz((1, 3)) == (1, 3) assert dfz.defuzz((1.00000...
Add a Hypothesis test for Defuzzer
Add a Hypothesis test for Defuzzer
Python
apache-2.0
nedbat/zellij
import itertools import math from defuzz import Defuzzer from hypothesis import given from hypothesis.strategies import floats, lists, tuples from hypo_helpers import f def test_it(): dfz = Defuzzer() assert dfz.defuzz((1, 2)) == (1, 2) assert dfz.defuzz((1, 3)) == (1, 3) assert dfz.defuzz((1.00000...
Add a Hypothesis test for Defuzzer from defuzz import Defuzzer def test_it(): dfz = Defuzzer() assert dfz.defuzz((1, 2)) == (1, 2) assert dfz.defuzz((1, 3)) == (1, 3) assert dfz.defuzz((1.00000001, 2)) == (1, 2) assert dfz.defuzz((1, 2, 3, 4, 5)) == (1, 2, 3, 4, 5) assert dfz.defuzz((2.000000...
462205a8dde700b4d5f36225bbe5f9d15b59832b
Climate_Police/tests/test_pollution_map.py
Climate_Police/tests/test_pollution_map.py
#run the test with default values of df, state and year import unittest from pollution_map import pollution_map import pandas as pd df = pd.read_csv("../data/pollution_us_2000_2016.csv") source = 'CO' # options: NO2, O3, SO2 and CO year = '2008' # options: 2000 - 2016 option = 'Mean' # options: Mean, AQI, 1st Max...
Add unit test for pollution_map
Add unit test for pollution_map
Python
mit
abhisheksugam/Climate_Police
#run the test with default values of df, state and year import unittest from pollution_map import pollution_map import pandas as pd df = pd.read_csv("../data/pollution_us_2000_2016.csv") source = 'CO' # options: NO2, O3, SO2 and CO year = '2008' # options: 2000 - 2016 option = 'Mean' # options: Mean, AQI, 1st Max...
Add unit test for pollution_map
8c2eb34d1a1f70150b3f3e7c9bc7255e5178bda6
accounts/migrations/0003_migrate_api_keys.py
accounts/migrations/0003_migrate_api_keys.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations def migrate_keys(apps, schema_editor): Token = apps.get_model("authtoken", "Token") ApiKey = apps.get_model("tastypie", "ApiKey") for key in ApiKey.objects.all(): Token.objects.create( use...
Write migration for API keys
Write migration for API keys
Python
agpl-3.0
lutris/website,Turupawn/website,lutris/website,Turupawn/website,Turupawn/website,lutris/website,Turupawn/website,lutris/website
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations def migrate_keys(apps, schema_editor): Token = apps.get_model("authtoken", "Token") ApiKey = apps.get_model("tastypie", "ApiKey") for key in ApiKey.objects.all(): Token.objects.create( use...
Write migration for API keys
15c773250b52a03196a023e286f4f3a2405ba94e
backend/uclapi/dashboard/app_helpers.py
backend/uclapi/dashboard/app_helpers.py
from binascii import hexlify import os def generate_api_token(): key = hexlify(os.urandom(30)).decode() dashes_key = "" for idx, char in enumerate(key): if idx % 15 == 0 and idx != len(key)-1: dashes_key += "-" else: dashes_key += char final = "uclapi" + dashes...
from binascii import hexlify from random import choice import os import string def generate_api_token(): key = hexlify(os.urandom(30)).decode() dashes_key = "" for idx, char in enumerate(key): if idx % 15 == 0 and idx != len(key)-1: dashes_key += "-" else: dashes_k...
Add helpers to the dashboard code to generate OAuth keys
Add helpers to the dashboard code to generate OAuth keys
Python
mit
uclapi/uclapi,uclapi/uclapi,uclapi/uclapi,uclapi/uclapi
from binascii import hexlify from random import choice import os import string def generate_api_token(): key = hexlify(os.urandom(30)).decode() dashes_key = "" for idx, char in enumerate(key): if idx % 15 == 0 and idx != len(key)-1: dashes_key += "-" else: dashes_k...
Add helpers to the dashboard code to generate OAuth keys from binascii import hexlify import os def generate_api_token(): key = hexlify(os.urandom(30)).decode() dashes_key = "" for idx, char in enumerate(key): if idx % 15 == 0 and idx != len(key)-1: dashes_key += "-" else: ...
dc87c5d000f06e1618c7fbd0daae602131e0602e
commands/globaladd.py
commands/globaladd.py
from devbot import chat def call(message: str, name, protocol, cfg, commands): if ' ' in message: chat.say('/msg {} Sorry, that was not a valid player name: It contains spaces.'.format(name)) return chat.say_wrap('/msg {}', 'You have been added to global chat. Use /g GlobalCh...
from devbot import chat def call(message: str, name, protocol, cfg, commands): if ' ' in message: chat.say('/msg {} Sorry, that was not a valid player name: It contains spaces.'.format(name)) return chat.say('/msg {} Invited {} to GlobalChat'.format(name, message)) chat.say_wrap('/msg {}'....
Fix formatting issues with gadd
Fix formatting issues with gadd
Python
mit
Ameliorate/DevotedBot,Ameliorate/DevotedBot
from devbot import chat def call(message: str, name, protocol, cfg, commands): if ' ' in message: chat.say('/msg {} Sorry, that was not a valid player name: It contains spaces.'.format(name)) return chat.say('/msg {} Invited {} to GlobalChat'.format(name, message)) chat.say_wrap('/msg {}'....
Fix formatting issues with gadd from devbot import chat def call(message: str, name, protocol, cfg, commands): if ' ' in message: chat.say('/msg {} Sorry, that was not a valid player name: It contains spaces.'.format(name)) return chat.say_wrap('/msg {}', 'You have been adde...
7d090b22eb1f4aa841207a3940ce485b8539af5c
tests/test_provider_mbta.py
tests/test_provider_mbta.py
import busbus from busbus.provider.mbta import MBTAProvider from .conftest import mock_gtfs_zip import arrow import pytest import responses @pytest.fixture(scope='module') @responses.activate def mbta_provider(engine): responses.add(responses.GET, MBTAProvider.gtfs_url, body=mock_gtfs_zip('mbta...
Add MBTA provider test cases
Add MBTA provider test cases
Python
mit
spaceboats/busbus
import busbus from busbus.provider.mbta import MBTAProvider from .conftest import mock_gtfs_zip import arrow import pytest import responses @pytest.fixture(scope='module') @responses.activate def mbta_provider(engine): responses.add(responses.GET, MBTAProvider.gtfs_url, body=mock_gtfs_zip('mbta...
Add MBTA provider test cases
79770a0e0f31f1292f8b5ab103509e7835570f20
src/collectors/SmartCollector/SmartCollector.py
src/collectors/SmartCollector/SmartCollector.py
import diamond.collector import subprocess import re import os class SmartCollector(diamond.collector.Collector): """ Collect data from S.M.A.R.T.'s attribute reporting. """ def get_default_config(self): """ Returns default configuration options. """ return { ...
import diamond.collector import subprocess import re import os class SmartCollector(diamond.collector.Collector): """ Collect data from S.M.A.R.T.'s attribute reporting. """ def get_default_config(self): """ Returns default configuration options. """ return { ...
Use ID instead of attribute if attribute name is 'Unknown_Attribute'.
Use ID instead of attribute if attribute name is 'Unknown_Attribute'.
Python
mit
zoidbergwill/Diamond,CYBERBUGJR/Diamond,TinLe/Diamond,tellapart/Diamond,Netuitive/Diamond,socialwareinc/Diamond,hvnsweeting/Diamond,joel-airspring/Diamond,joel-airspring/Diamond,hamelg/Diamond,signalfx/Diamond,stuartbfox/Diamond,disqus/Diamond,python-diamond/Diamond,rtoma/Diamond,mfriedenhagen/Diamond,socialwareinc/Dia...
import diamond.collector import subprocess import re import os class SmartCollector(diamond.collector.Collector): """ Collect data from S.M.A.R.T.'s attribute reporting. """ def get_default_config(self): """ Returns default configuration options. """ return { ...
Use ID instead of attribute if attribute name is 'Unknown_Attribute'. import diamond.collector import subprocess import re import os class SmartCollector(diamond.collector.Collector): """ Collect data from S.M.A.R.T.'s attribute reporting. """ def get_default_config(self): """ Returns...
ea56607fa7ae7257682170e881c67ae5e0f6719c
tests/rest_views.py
tests/rest_views.py
from django.views.generic import View from nap.datamapper.models import ModelDataMapper from nap.rest import views from .models import Poll class PollMapper(ModelDataMapper): class Meta: model = Poll fields = ['question', 'pub_date'] class SinglePollView(views.ObjectGetMixin, views.ObjectPutMi...
from django.views.generic import View from nap.datamapper.models import ModelDataMapper from nap.rest import views from .models import Poll class PollMapper(ModelDataMapper): class Meta: model = Poll fields = ['question', 'pub_date'] class SinglePollView(views.ObjectGetMixin, views.ObjectPutMi...
Update test to use Base view
Update test to use Base view
Python
bsd-3-clause
MarkusH/django-nap,limbera/django-nap
from django.views.generic import View from nap.datamapper.models import ModelDataMapper from nap.rest import views from .models import Poll class PollMapper(ModelDataMapper): class Meta: model = Poll fields = ['question', 'pub_date'] class SinglePollView(views.ObjectGetMixin, views.ObjectPutMi...
Update test to use Base view from django.views.generic import View from nap.datamapper.models import ModelDataMapper from nap.rest import views from .models import Poll class PollMapper(ModelDataMapper): class Meta: model = Poll fields = ['question', 'pub_date'] class SinglePollView(views.Obj...
9caa0aa6c8fddc8a21997cf4df88d407b1598412
keras_cv/__init__.py
keras_cv/__init__.py
# Copyright 2022 The KerasCV Authors # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
# Copyright 2022 The KerasCV Authors # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
Add export for models module
Add export for models module
Python
apache-2.0
keras-team/keras-cv,keras-team/keras-cv,keras-team/keras-cv
# Copyright 2022 The KerasCV Authors # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
Add export for models module # Copyright 2022 The KerasCV Authors # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
563645019adaf20ee66af0b4cc13e8b08bcc9d32
lino_noi/lib/tickets/__init__.py
lino_noi/lib/tickets/__init__.py
# -*- coding: UTF-8 -*- # Copyright 2016 Luc Saffre # License: BSD (see file COPYING for details) """Fixtures specific for the Team variant of Lino Noi. .. autosummary:: :toctree: models """ from lino_xl.lib.tickets import * class Plugin(Plugin): """Adds the :mod:`lino_xl.lib.votes` plugin. """ ...
# -*- coding: UTF-8 -*- # Copyright 2016 Luc Saffre # License: BSD (see file COPYING for details) """Fixtures specific for the Team variant of Lino Noi. .. autosummary:: :toctree: models """ from lino_xl.lib.tickets import * class Plugin(Plugin): """Adds the :mod:`lino_xl.lib.votes` plugin. """ ...
Fix menu items for noi/tickets
Fix menu items for noi/tickets
Python
bsd-2-clause
khchine5/noi,lsaffre/noi,lsaffre/noi,lino-framework/noi,lino-framework/noi,khchine5/noi,lsaffre/noi
# -*- coding: UTF-8 -*- # Copyright 2016 Luc Saffre # License: BSD (see file COPYING for details) """Fixtures specific for the Team variant of Lino Noi. .. autosummary:: :toctree: models """ from lino_xl.lib.tickets import * class Plugin(Plugin): """Adds the :mod:`lino_xl.lib.votes` plugin. """ ...
Fix menu items for noi/tickets # -*- coding: UTF-8 -*- # Copyright 2016 Luc Saffre # License: BSD (see file COPYING for details) """Fixtures specific for the Team variant of Lino Noi. .. autosummary:: :toctree: models """ from lino_xl.lib.tickets import * class Plugin(Plugin): """Adds the :mod:`lino_x...
ff65a3e1b0f061100a20462dea4f654b02707a6f
fig/cli/command.py
fig/cli/command.py
from docker import Client import logging import os import re import yaml from ..project import Project from .docopt_command import DocoptCommand from .formatter import Formatter from .utils import cached_property log = logging.getLogger(__name__) class Command(DocoptCommand): @cached_property def client(self...
from docker import Client import logging import os import re import yaml import socket from ..project import Project from .docopt_command import DocoptCommand from .formatter import Formatter from .utils import cached_property from .errors import UserError log = logging.getLogger(__name__) class Command(DocoptComman...
Check default socket and localhost:4243 for Docker daemon
Check default socket and localhost:4243 for Docker daemon
Python
apache-2.0
MSakamaki/compose,alexisbellido/docker.github.io,prologic/compose,KevinGreene/compose,phiroict/docker,calou/compose,rillig/docker.github.io,docker/docker.github.io,phiroict/docker,vlajos/compose,ekristen/compose,JimGalasyn/docker.github.io,albers/compose,zhangspook/compose,charleswhchan/compose,talolard/compose,nhumric...
from docker import Client import logging import os import re import yaml import socket from ..project import Project from .docopt_command import DocoptCommand from .formatter import Formatter from .utils import cached_property from .errors import UserError log = logging.getLogger(__name__) class Command(DocoptComman...
Check default socket and localhost:4243 for Docker daemon from docker import Client import logging import os import re import yaml from ..project import Project from .docopt_command import DocoptCommand from .formatter import Formatter from .utils import cached_property log = logging.getLogger(__name__) class Comma...
e093b77da3f914d15ace4d916cbe0ae9543c1327
setup.py
setup.py
import ez_setup ez_setup.use_setuptools() from setuptools import setup, find_packages setup( name = "mobile-city-history", version = 0.1, author = "Jan-Christopher Pien", author_email = "jan_christopher.pien@fokus.fraunhofer.de", url = "http://www.foo.bar", license = "MIT", description = "...
import ez_setup ez_setup.use_setuptools() from setuptools import setup, find_packages setup( name = "mobile-city-history", version = 0.1, author = "Jan-Christopher Pien", author_email = "jan_christopher.pien@fokus.fraunhofer.de", url = "http://www.foo.bar", license = "MIT", description = "...
Add mssql to staging branch
Add mssql to staging branch
Python
mit
fraunhoferfokus/mobile-city-memory,jessepeng/coburg-city-memory,fraunhoferfokus/mobile-city-memory,jessepeng/coburg-city-memory
import ez_setup ez_setup.use_setuptools() from setuptools import setup, find_packages setup( name = "mobile-city-history", version = 0.1, author = "Jan-Christopher Pien", author_email = "jan_christopher.pien@fokus.fraunhofer.de", url = "http://www.foo.bar", license = "MIT", description = "...
Add mssql to staging branch import ez_setup ez_setup.use_setuptools() from setuptools import setup, find_packages setup( name = "mobile-city-history", version = 0.1, author = "Jan-Christopher Pien", author_email = "jan_christopher.pien@fokus.fraunhofer.de", url = "http://www.foo.bar", license...
de24375a9d23f07eced1a8e7f2cffcf02e34bdf2
integration_tests/conftest.py
integration_tests/conftest.py
import os import subprocess import sys import time import pytest ARGS = [ '--debug', '--deployment-name', 'integration_test', '--dbuser', 'zoeuser', '--dbhost', 'postgres', '--dbport', '5432', '--dbname', 'zoe', '--dbpass', 'zoepass', '--master-url', 'tcp://localhost:4850', '--auth...
import os import subprocess import sys import time import pytest ARGS = [ '--debug', '--deployment-name', 'integration_test', '--dbuser', 'zoeuser', '--dbhost', 'postgres', '--dbport', '5432', '--dbname', 'zoe', '--dbpass', 'zoepass', '--master-url', 'tcp://localhost:4850', '--list...
Remove auth-type option from tests
Remove auth-type option from tests
Python
apache-2.0
DistributedSystemsGroup/zoe,DistributedSystemsGroup/zoe,DistributedSystemsGroup/zoe,DistributedSystemsGroup/zoe,DistributedSystemsGroup/zoe
import os import subprocess import sys import time import pytest ARGS = [ '--debug', '--deployment-name', 'integration_test', '--dbuser', 'zoeuser', '--dbhost', 'postgres', '--dbport', '5432', '--dbname', 'zoe', '--dbpass', 'zoepass', '--master-url', 'tcp://localhost:4850', '--list...
Remove auth-type option from tests import os import subprocess import sys import time import pytest ARGS = [ '--debug', '--deployment-name', 'integration_test', '--dbuser', 'zoeuser', '--dbhost', 'postgres', '--dbport', '5432', '--dbname', 'zoe', '--dbpass', 'zoepass', '--master-url',...
27a944d5fc74972a90e8dd69879ebc27c4412b99
test/python_api/default-constructor/sb_frame.py
test/python_api/default-constructor/sb_frame.py
""" Fuzz tests an object after the default construction to make sure it does not crash lldb. """ import sys import lldb def fuzz_obj(obj): obj.GetFrameID() obj.GetPC() obj.SetPC(0xffffffff) obj.GetSP() obj.GetFP() obj.GetPCAddress() obj.GetSymbolContext(0) obj.GetModule() obj.GetCo...
""" Fuzz tests an object after the default construction to make sure it does not crash lldb. """ import sys import lldb def fuzz_obj(obj): obj.GetFrameID() obj.GetPC() obj.SetPC(0xffffffff) obj.GetSP() obj.GetFP() obj.GetPCAddress() obj.GetSymbolContext(0) obj.GetModule() obj.GetCo...
Add FindValue() and WatchValue() fuzz calls to the mix.
Add FindValue() and WatchValue() fuzz calls to the mix. git-svn-id: b33bab8abb5b18c12ee100cd7761ab452d00b2b0@140439 91177308-0d34-0410-b5e6-96231b3b80d8
Python
apache-2.0
apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb
""" Fuzz tests an object after the default construction to make sure it does not crash lldb. """ import sys import lldb def fuzz_obj(obj): obj.GetFrameID() obj.GetPC() obj.SetPC(0xffffffff) obj.GetSP() obj.GetFP() obj.GetPCAddress() obj.GetSymbolContext(0) obj.GetModule() obj.GetCo...
Add FindValue() and WatchValue() fuzz calls to the mix. git-svn-id: b33bab8abb5b18c12ee100cd7761ab452d00b2b0@140439 91177308-0d34-0410-b5e6-96231b3b80d8 """ Fuzz tests an object after the default construction to make sure it does not crash lldb. """ import sys import lldb def fuzz_obj(obj): obj.GetFrameID() ...
701f6a06b8405620905a67b47c5702c100a1447a
scripts/check_sorted.py
scripts/check_sorted.py
import sys prev_val = 0 prev_val2 = 0 counter = 0 for line in sys.stdin: parts = line.split() curr_val = int(parts[0]) curr_val2 = int(parts[1]) val1 = int(parts[0]) val2 = int(parts[1]) if val1 > val2: print >>sys.stderr, "Not triangular:", counter sys.exit(1) if curr_v...
Check to make sure the input file is sorted
Check to make sure the input file is sorted
Python
mit
hms-dbmi/clodius,hms-dbmi/clodius
import sys prev_val = 0 prev_val2 = 0 counter = 0 for line in sys.stdin: parts = line.split() curr_val = int(parts[0]) curr_val2 = int(parts[1]) val1 = int(parts[0]) val2 = int(parts[1]) if val1 > val2: print >>sys.stderr, "Not triangular:", counter sys.exit(1) if curr_v...
Check to make sure the input file is sorted
6021c4c54cb0a437878553a1e23f8d433476ff2d
main.py
main.py
import json from kivy.app import App from kivy.uix.boxlayout import BoxLayout from kivy.properties import ObjectProperty from kivy.network.urlrequest import UrlRequest class AddLocationForm(BoxLayout): search_input = ObjectProperty() search_results = ObjectProperty() def search_location(self): ...
import json from kivy.app import App from kivy.uix.boxlayout import BoxLayout from kivy.properties import ObjectProperty from kivy.network.urlrequest import UrlRequest class AddLocationForm(BoxLayout): search_input = ObjectProperty() search_results = ObjectProperty() def search_location(self): ...
Stop crashing when search doesn't have any matches
Stop crashing when search doesn't have any matches
Python
mit
ciappi/Weather
import json from kivy.app import App from kivy.uix.boxlayout import BoxLayout from kivy.properties import ObjectProperty from kivy.network.urlrequest import UrlRequest class AddLocationForm(BoxLayout): search_input = ObjectProperty() search_results = ObjectProperty() def search_location(self): ...
Stop crashing when search doesn't have any matches import json from kivy.app import App from kivy.uix.boxlayout import BoxLayout from kivy.properties import ObjectProperty from kivy.network.urlrequest import UrlRequest class AddLocationForm(BoxLayout): search_input = ObjectProperty() search_results = Objec...
e164a50432f4f133e07d864a1923852754924f34
byceps/services/authentication/service.py
byceps/services/authentication/service.py
""" byceps.services.authentication.service ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2018 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ from ..user.models.user import User from ..user import service as user_service from .exceptions import AuthenticationFailed from .password ...
""" byceps.services.authentication.service ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2018 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ from ..user.models.user import User from ..user import service as user_service from .exceptions import AuthenticationFailed from .password ...
Check for account activity before password verification
Check for account activity before password verification
Python
bsd-3-clause
m-ober/byceps,m-ober/byceps,m-ober/byceps,homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps
""" byceps.services.authentication.service ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2018 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ from ..user.models.user import User from ..user import service as user_service from .exceptions import AuthenticationFailed from .password ...
Check for account activity before password verification """ byceps.services.authentication.service ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2018 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ from ..user.models.user import User from ..user import service as user_service fro...
118fc8570b15700a62e5cb5aa7c3d1bfe70c9dc6
Python/concurrency/furutes_prot.py
Python/concurrency/furutes_prot.py
# concurrent.futures - Launch parallel tasks import concurrent.futures as ft def main(): with ft.ThreadPoolExecutor(max_workers=1) as executor: future = executor.submit(fnc, 323, 4) print(future.result()) #future = executor.map(fnc, (33, 22)) #print(future.result()) def fnc(x, y):...
Add concurrent.future ti Python prototypes
Add concurrent.future ti Python prototypes
Python
apache-2.0
yuriyshapovalov/Prototypes,yuriyshapovalov/Prototypes,yuriyshapovalov/Prototypes
# concurrent.futures - Launch parallel tasks import concurrent.futures as ft def main(): with ft.ThreadPoolExecutor(max_workers=1) as executor: future = executor.submit(fnc, 323, 4) print(future.result()) #future = executor.map(fnc, (33, 22)) #print(future.result()) def fnc(x, y):...
Add concurrent.future ti Python prototypes
0f54780e142cb6bd15df2ed702bd4fa4b2d3fe79
keys.py
keys.py
#!/usr/bin/env python #keys.py keys = dict( consumer_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', consumer_secret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', access_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', access_secret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', )
#!/usr/bin/env python #keys.py keys = dict( consumer_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', consumer_secret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', access_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', access_secret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', )
Use spaces instead of tabs
Use spaces instead of tabs
Python
mit
bman4789/weatherBot,bman4789/weatherBot,BrianMitchL/weatherBot
#!/usr/bin/env python #keys.py keys = dict( consumer_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', consumer_secret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', access_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', access_secret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', )
Use spaces instead of tabs #!/usr/bin/env python #keys.py keys = dict( consumer_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', consumer_secret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', access_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', access_secret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', )
dfef23d834ab67acf91dcefd6fe39e089c71fb9a
quantized_mesh_tile/__init__.py
quantized_mesh_tile/__init__.py
""" This module provides high level utility functions to encode and decode a terrain tile. Reference --------- """ from .terrain import TerrainTile from .topology import TerrainTopology def encode(geometries, bounds=[], watermask=[], hasLighting=False, gzipped=False): """ Function to convert geometries in a...
Add higher level functions encode and decode
Add higher level functions encode and decode
Python
mit
loicgasser/quantized-mesh-tile
""" This module provides high level utility functions to encode and decode a terrain tile. Reference --------- """ from .terrain import TerrainTile from .topology import TerrainTopology def encode(geometries, bounds=[], watermask=[], hasLighting=False, gzipped=False): """ Function to convert geometries in a...
Add higher level functions encode and decode
d595f953a8993afd94f1616fbf815afe0b85a646
scripts/master/factory/dart/channels.py
scripts/master/factory/dart/channels.py
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. class Channel(object): def __init__(self, name, branch, position, category_postfix, priority): self.branch = branch self.builder_postfix = '-' + na...
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. class Channel(object): def __init__(self, name, branch, position, category_postfix, priority): self.branch = branch self.builder_postfix = '-' + na...
Make stable builders pull from 1.8
Make stable builders pull from 1.8 Review URL: https://codereview.chromium.org/760053002 git-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@293121 0039d316-1c4b-4281-b951-d872f2087c98
Python
bsd-3-clause
eunchong/build,eunchong/build,eunchong/build,eunchong/build
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. class Channel(object): def __init__(self, name, branch, position, category_postfix, priority): self.branch = branch self.builder_postfix = '-' + na...
Make stable builders pull from 1.8 Review URL: https://codereview.chromium.org/760053002 git-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@293121 0039d316-1c4b-4281-b951-d872f2087c98 # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can b...
b3c99c3ce6ec181cf2ea82dbbbac5801d7f27874
app/interact_app.py
app/interact_app.py
import os import tornado.web from tornado.options import define from .handlers import LandingHandler, RequestHandler class InteractApp(tornado.web.Application): """ Entry point for the interact app. """ def __init__(self, config=None): # Terrible hack to get config object in global namespace....
import os import tornado.web from tornado.options import define from .handlers import LandingHandler, RequestHandler class InteractApp(tornado.web.Application): """ Entry point for the interact app. """ def __init__(self, config=None): # Terrible hack to get config object in global namespace....
Disable template caching for now.
Disable template caching for now.
Python
apache-2.0
data-8/DS8-Interact,data-8/DS8-Interact,data-8/DS8-Interact
import os import tornado.web from tornado.options import define from .handlers import LandingHandler, RequestHandler class InteractApp(tornado.web.Application): """ Entry point for the interact app. """ def __init__(self, config=None): # Terrible hack to get config object in global namespace....
Disable template caching for now. import os import tornado.web from tornado.options import define from .handlers import LandingHandler, RequestHandler class InteractApp(tornado.web.Application): """ Entry point for the interact app. """ def __init__(self, config=None): # Terrible hack to get...
1706fd54e50c6e4a67c84ceaa17708ca9346efe8
qipipe/__init__.py
qipipe/__init__.py
"""The top-level Quantitative Imaging Pipeline module.""" __version__ = '4.5.3' """ The one-based major.minor.patch version. The version numbering scheme loosely follows http://semver.org/. The major version is incremented when there is an incompatible public API change. The minor version is incremented when there is ...
"""The top-level Quantitative Imaging Pipeline module.""" __version__ = '4.5.3' """ The one-based major.minor.patch version. The version numbering scheme loosely follows http://semver.org/. The major version is incremented when a significant feature set is introduced. The minor version is incremented when there is a f...
Modify the version numbering guideline.
Modify the version numbering guideline.
Python
bsd-2-clause
ohsu-qin/qipipe
"""The top-level Quantitative Imaging Pipeline module.""" __version__ = '4.5.3' """ The one-based major.minor.patch version. The version numbering scheme loosely follows http://semver.org/. The major version is incremented when a significant feature set is introduced. The minor version is incremented when there is a f...
Modify the version numbering guideline. """The top-level Quantitative Imaging Pipeline module.""" __version__ = '4.5.3' """ The one-based major.minor.patch version. The version numbering scheme loosely follows http://semver.org/. The major version is incremented when there is an incompatible public API change. The mi...
3429293244359b5635b7d060caf527a36850f3a2
orchestrator/__init__.py
orchestrator/__init__.py
from __future__ import absolute_import from celery.signals import setup_logging import orchestrator.logger __version__ = '0.3.5' __author__ = 'sukrit' orchestrator.logger.init_logging() setup_logging.connect(orchestrator.logger.init_celery_logging)
from __future__ import absolute_import from celery.signals import setup_logging import orchestrator.logger __version__ = '0.3.6' __author__ = 'sukrit' orchestrator.logger.init_logging() setup_logging.connect(orchestrator.logger.init_celery_logging)
Prepare for next dev version to incorporate encofing fixes in flask-hyperschema library
Prepare for next dev version to incorporate encofing fixes in flask-hyperschema library
Python
mit
totem/cluster-orchestrator,totem/cluster-orchestrator,totem/cluster-orchestrator
from __future__ import absolute_import from celery.signals import setup_logging import orchestrator.logger __version__ = '0.3.6' __author__ = 'sukrit' orchestrator.logger.init_logging() setup_logging.connect(orchestrator.logger.init_celery_logging)
Prepare for next dev version to incorporate encofing fixes in flask-hyperschema library from __future__ import absolute_import from celery.signals import setup_logging import orchestrator.logger __version__ = '0.3.5' __author__ = 'sukrit' orchestrator.logger.init_logging() setup_logging.connect(orchestrator.logger.i...
1709c602b8a423d1eee6521c5e74987db0fc8b81
fancypages/contrib/oscar_fancypages/mixins.py
fancypages/contrib/oscar_fancypages/mixins.py
from ... import mixins class OscarFancyPageMixin(mixins.FancyPageMixin): node_attr_name = 'category' slug_url_kwarg = 'category_slug' context_object_name = 'fancypage' def get_context_data(self, **kwargs): ctx = super(OscarFancyPageMixin, self).get_context_data(**kwargs) ctx[self.cont...
from ... import mixins class OscarFancyPageMixin(mixins.FancyPageMixin): node_attr_name = 'category' slug_url_kwarg = 'category_slug' context_object_name = 'products' def get_context_data(self, **kwargs): ctx = super(OscarFancyPageMixin, self).get_context_data(**kwargs) ctx['fancypage...
Change context object for product list view in Oscar contrib
Change context object for product list view in Oscar contrib
Python
bsd-3-clause
tangentlabs/django-fancypages,tangentlabs/django-fancypages,tangentlabs/django-fancypages,socradev/django-fancypages,socradev/django-fancypages,socradev/django-fancypages
from ... import mixins class OscarFancyPageMixin(mixins.FancyPageMixin): node_attr_name = 'category' slug_url_kwarg = 'category_slug' context_object_name = 'products' def get_context_data(self, **kwargs): ctx = super(OscarFancyPageMixin, self).get_context_data(**kwargs) ctx['fancypage...
Change context object for product list view in Oscar contrib from ... import mixins class OscarFancyPageMixin(mixins.FancyPageMixin): node_attr_name = 'category' slug_url_kwarg = 'category_slug' context_object_name = 'fancypage' def get_context_data(self, **kwargs): ctx = super(OscarFancyPag...
0599961b1509d7b8e0bec310b40a62f11a55cc8f
src/tagversion/entrypoints.py
src/tagversion/entrypoints.py
""" tagversion Entrypoints """ import logging import sys from tagversion.argparse import ArgumentParser from tagversion.git import GitVersion from tagversion.write import WriteFile def main(): logging.basicConfig(level=logging.WARNING) parser = ArgumentParser() subcommand = parser.add_subparsers(dest='s...
""" tagversion Entrypoints """ import logging import os import sys from tagversion.argparse import ArgumentParser from tagversion.git import GitVersion from tagversion.write import WriteFile LOG_LEVEL = os.environ.get('LOG_LEVEL', 'warning') def main(): logging.basicConfig(level=getattr(logging, LOG_LEVEL.upper...
Allow log level to be changed via environment variable
Allow log level to be changed via environment variable
Python
bsd-2-clause
rca/tag-version,rca/tag-version
""" tagversion Entrypoints """ import logging import os import sys from tagversion.argparse import ArgumentParser from tagversion.git import GitVersion from tagversion.write import WriteFile LOG_LEVEL = os.environ.get('LOG_LEVEL', 'warning') def main(): logging.basicConfig(level=getattr(logging, LOG_LEVEL.upper...
Allow log level to be changed via environment variable """ tagversion Entrypoints """ import logging import sys from tagversion.argparse import ArgumentParser from tagversion.git import GitVersion from tagversion.write import WriteFile def main(): logging.basicConfig(level=logging.WARNING) parser = Argumen...
e559c897cec534c58ab7940e2623a1decfb4958a
numpy/distutils/command/install_clib.py
numpy/distutils/command/install_clib.py
import os from distutils.core import Command from numpy.distutils.misc_util import get_cmd class install_clib(Command): description = "Command to install installable C libraries" user_options = [] def initialize_options(self): self.install_dir = None self.outfiles = [] def finalize_o...
import os from distutils.core import Command from distutils.ccompiler import new_compiler from numpy.distutils.misc_util import get_cmd class install_clib(Command): description = "Command to install installable C libraries" user_options = [] def initialize_options(self): self.install_dir = None ...
Move import at the top of module.
Move import at the top of module.
Python
bsd-3-clause
jorisvandenbossche/numpy,MichaelAquilina/numpy,b-carter/numpy,sonnyhu/numpy,GrimDerp/numpy,dch312/numpy,githubmlai/numpy,astrofrog/numpy,brandon-rhodes/numpy,joferkington/numpy,CMartelLML/numpy,rajathkumarmp/numpy,ahaldane/numpy,MaPePeR/numpy,empeeu/numpy,pelson/numpy,nguyentu1602/numpy,jakirkham/numpy,jakirkham/numpy,...
import os from distutils.core import Command from distutils.ccompiler import new_compiler from numpy.distutils.misc_util import get_cmd class install_clib(Command): description = "Command to install installable C libraries" user_options = [] def initialize_options(self): self.install_dir = None ...
Move import at the top of module. import os from distutils.core import Command from numpy.distutils.misc_util import get_cmd class install_clib(Command): description = "Command to install installable C libraries" user_options = [] def initialize_options(self): self.install_dir = None sel...
453730335b1e8d5d159350e0752faf282378f5e6
newsletter/models.py
newsletter/models.py
from django.db import models from django.utils import timezone from django.utils.datetime_safe import strftime from hashlib import sha256 from markdownx.models import MarkdownxField def generate_unsub_token(email, date): return sha256('{date}:{email}'.format(date=date, email=email).encode()).hexdigest() clas...
from django.db import models from django.utils import timezone from django.utils.datetime_safe import strftime from hashlib import sha256 from markdownx.models import MarkdownxField def generate_unsub_token(email, date): return sha256('{date}:{email}'.format(date=date, email=email).encode()).hexdigest() clas...
Change default email to newsletter@uwcs instead of noreply
Change default email to newsletter@uwcs instead of noreply
Python
mit
davidjrichardson/uwcs-zarya,davidjrichardson/uwcs-zarya
from django.db import models from django.utils import timezone from django.utils.datetime_safe import strftime from hashlib import sha256 from markdownx.models import MarkdownxField def generate_unsub_token(email, date): return sha256('{date}:{email}'.format(date=date, email=email).encode()).hexdigest() clas...
Change default email to newsletter@uwcs instead of noreply from django.db import models from django.utils import timezone from django.utils.datetime_safe import strftime from hashlib import sha256 from markdownx.models import MarkdownxField def generate_unsub_token(email, date): return sha256('{date}:{email}'...
38ce0d6b0433a68787c18691407c815d4eb1fdb2
txscrypt/__init__.py
txscrypt/__init__.py
""" A Twisted-friendly wrapper for scrypt. """ from txscrypt.wrapper import computeKey, verifyPassword from txscrypt._version import __version__ __all__ = ["computeKey", "verifyPassword"]
""" A Twisted-friendly wrapper for scrypt. """ from txscrypt.wrapper import checkPassword, computeKey from txscrypt._version import __version__ __all__ = ["verifyPassword", "computeKey"]
Make checkPassword the only public API, remove verifyPassword
Make checkPassword the only public API, remove verifyPassword
Python
isc
lvh/txscrypt
""" A Twisted-friendly wrapper for scrypt. """ from txscrypt.wrapper import checkPassword, computeKey from txscrypt._version import __version__ __all__ = ["verifyPassword", "computeKey"]
Make checkPassword the only public API, remove verifyPassword """ A Twisted-friendly wrapper for scrypt. """ from txscrypt.wrapper import computeKey, verifyPassword from txscrypt._version import __version__ __all__ = ["computeKey", "verifyPassword"]
dd64801ffa4949f0458eec2721a333a480a8fc3c
app/runserver.py
app/runserver.py
from flask_script import Manager from config.config import app manager = Manager(app) @manager.command def run_local(): app.run(debug=True) @manager.command def run_test(): # To-Do pass @manager.command def run_production(): # TO-DO pass if __name__ == '__main__': manager.run()
from flask_script import Manager from config.config import app manager = Manager(app) # Deploy for development @manager.command def run_dev(): app.run(debug=True) # Deploy for intergation tests @manager.command def run_test(): # To-Do pass # Deploy for production @manager.command def run_production(): ...
Change naming schema for deploy
Change naming schema for deploy
Python
mit
tforrest/soda-automation,tforrest/soda-automation
from flask_script import Manager from config.config import app manager = Manager(app) # Deploy for development @manager.command def run_dev(): app.run(debug=True) # Deploy for intergation tests @manager.command def run_test(): # To-Do pass # Deploy for production @manager.command def run_production(): ...
Change naming schema for deploy from flask_script import Manager from config.config import app manager = Manager(app) @manager.command def run_local(): app.run(debug=True) @manager.command def run_test(): # To-Do pass @manager.command def run_production(): # TO-DO pass if __name__ == '__ma...
e01d45e3ee39023814bca75b1344477e42865b0b
ds_max_priority_queue.py
ds_max_priority_queue.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function class MaxPriorityQueue(object): """Max Priority Queue.""" def __init__(self): pass def main(): pass if __name__ == '__main__': main()
from __future__ import absolute_import from __future__ import division from __future__ import print_function def parent(i): return i // 2 def left(i): return 2 * i def right(i): return 2 * i + 1 class MaxPriorityQueue(object): """Max Priority Queue.""" def __init__(self): pass def main(): pass ...
Add parent(), left() & right()
Add parent(), left() & right()
Python
bsd-2-clause
bowen0701/algorithms_data_structures
from __future__ import absolute_import from __future__ import division from __future__ import print_function def parent(i): return i // 2 def left(i): return 2 * i def right(i): return 2 * i + 1 class MaxPriorityQueue(object): """Max Priority Queue.""" def __init__(self): pass def main(): pass ...
Add parent(), left() & right() from __future__ import absolute_import from __future__ import division from __future__ import print_function class MaxPriorityQueue(object): """Max Priority Queue.""" def __init__(self): pass def main(): pass if __name__ == '__main__': main()
b57a0a89cd2596174300319ee0a83490ad987177
setup.py
setup.py
from os import path from setuptools import setup # Utility function to read the README file. # Used for the long_description. It's nice, because now 1) we have a top level # README file and 2) it's easier to type in the README file than to put a raw # string in below ... def read(fname): return open(path.join(pa...
from os import path from setuptools import setup # Utility function to read the README file. # Used for the long_description. It's nice, because now 1) we have a top level # README file and 2) it's easier to type in the README file than to put a raw # string in below ... def read(fname): return open(path.join(pa...
Add Python 3.11 support as of version 1.10.0
Add Python 3.11 support as of version 1.10.0
Python
mit
andrasmaroy/pconf
from os import path from setuptools import setup # Utility function to read the README file. # Used for the long_description. It's nice, because now 1) we have a top level # README file and 2) it's easier to type in the README file than to put a raw # string in below ... def read(fname): return open(path.join(pa...
Add Python 3.11 support as of version 1.10.0 from os import path from setuptools import setup # Utility function to read the README file. # Used for the long_description. It's nice, because now 1) we have a top level # README file and 2) it's easier to type in the README file than to put a raw # string in below ......
e38b98a44d5961439e9c60e9398f183dc6dbf39e
scripts/profileshader.py
scripts/profileshader.py
#!/usr/bin/env python ########################################################################## # # Copyright 2012 VMware, Inc. # All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in th...
Add a script to analyse profile output per shader.
Add a script to analyse profile output per shader.
Python
mit
surround-io/apitrace,joshua5201/apitrace,tuanthng/apitrace,surround-io/apitrace,apitrace/apitrace,PeterLValve/apitrace,tuanthng/apitrace,PeterLValve/apitrace,swq0553/apitrace,swq0553/apitrace,tuanthng/apitrace,schulmar/apitrace,trtt/apitrace,surround-io/apitrace,EoD/apitrace,trtt/apitrace,tuanthng/apitrace,swq0553/apit...
#!/usr/bin/env python ########################################################################## # # Copyright 2012 VMware, Inc. # All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in th...
Add a script to analyse profile output per shader.
b7b0159e462efb7abfd63c0e3066704637fa4df2
txircd/modules/extra/stats_ports.py
txircd/modules/extra/stats_ports.py
from twisted.plugin import IPlugin from txircd.factory import UserFactory from txircd.module_interface import IModuleData, ModuleData from zope.interface import implements class StatsPorts(ModuleData): implements(IPlugin, IModuleData) name = "StatsPorts" def actions(self): return [ ("statsruntype-ports", 10, se...
Add STATS type to display the ports that the server is listening on
Add STATS type to display the ports that the server is listening on
Python
bsd-3-clause
Heufneutje/txircd
from twisted.plugin import IPlugin from txircd.factory import UserFactory from txircd.module_interface import IModuleData, ModuleData from zope.interface import implements class StatsPorts(ModuleData): implements(IPlugin, IModuleData) name = "StatsPorts" def actions(self): return [ ("statsruntype-ports", 10, se...
Add STATS type to display the ports that the server is listening on
888584a49e697551c4f680cc8651be2fe80fc65d
configgen/generators/ppsspp/ppssppGenerator.py
configgen/generators/ppsspp/ppssppGenerator.py
#!/usr/bin/env python import Command #~ import reicastControllers import recalboxFiles from generators.Generator import Generator import ppssppControllers import shutil import os.path import ConfigParser class PPSSPPGenerator(Generator): # Main entry of the module # Configure fba and return a command def ...
#!/usr/bin/env python import Command #~ import reicastControllers import recalboxFiles from generators.Generator import Generator import ppssppControllers import shutil import os.path import ConfigParser class PPSSPPGenerator(Generator): # Main entry of the module # Configure fba and return a command def ...
Remove a bad typo from reicast
Remove a bad typo from reicast
Python
mit
nadenislamarre/recalbox-configgen,recalbox/recalbox-configgen,digitalLumberjack/recalbox-configgen
#!/usr/bin/env python import Command #~ import reicastControllers import recalboxFiles from generators.Generator import Generator import ppssppControllers import shutil import os.path import ConfigParser class PPSSPPGenerator(Generator): # Main entry of the module # Configure fba and return a command def ...
Remove a bad typo from reicast #!/usr/bin/env python import Command #~ import reicastControllers import recalboxFiles from generators.Generator import Generator import ppssppControllers import shutil import os.path import ConfigParser class PPSSPPGenerator(Generator): # Main entry of the module # Configure f...
d3f09baf1e1de0272e1a579a207f685feb6c673f
common/mixins.py
common/mixins.py
from __future__ import unicode_literals from django.core.exceptions import ValidationError from django.db import models from django.utils.text import slugify class TimestampMixin(models.Model): """Mixin for date and timestamp. Inherits django's models.Model.""" date_created = models.DateTimeField(auto_now_a...
from __future__ import unicode_literals from django.core.exceptions import ValidationError from django.db import models from django.utils.text import slugify from django.utils.translation import ugettext_lazy as _ class TimestampMixin(models.Model): """Mixin for date and timestamp. Inherits django's models.Model...
Return user-friendly error message for SlugifyMixin class
Return user-friendly error message for SlugifyMixin class
Python
mit
teamtaverna/core
from __future__ import unicode_literals from django.core.exceptions import ValidationError from django.db import models from django.utils.text import slugify from django.utils.translation import ugettext_lazy as _ class TimestampMixin(models.Model): """Mixin for date and timestamp. Inherits django's models.Model...
Return user-friendly error message for SlugifyMixin class from __future__ import unicode_literals from django.core.exceptions import ValidationError from django.db import models from django.utils.text import slugify class TimestampMixin(models.Model): """Mixin for date and timestamp. Inherits django's models.Mo...
483800541ee66de006392c361e06177bc9db4784
kboard/board/urls.py
kboard/board/urls.py
# Created by JHJ on 2016. 10. 5. from django.conf.urls import url from . import views app_name = 'board' urlpatterns = [ url(r'^$', views.board_list, name='board_list'), url(r'^(?P<board_slug>[-a-z]+)/$', views.post_list, name='post_list'), url(r'^(?P<board_slug>[-a-z]+)/new/$', views.new_post, name='new...
# Created by JHJ on 2016. 10. 5. from django.conf.urls import url from django.conf import settings from django.conf.urls.static import static from . import views app_name = 'board' urlpatterns = [ url(r'^$', views.board_list, name='board_list'), url(r'^(?P<board_slug>[-a-z]+)/$', views.post_list, name='post_...
Set url to serve uploaded file during development
Set url to serve uploaded file during development
Python
mit
guswnsxodlf/k-board,kboard/kboard,cjh5414/kboard,kboard/kboard,hyesun03/k-board,hyesun03/k-board,hyesun03/k-board,guswnsxodlf/k-board,cjh5414/kboard,darjeeling/k-board,cjh5414/kboard,kboard/kboard,guswnsxodlf/k-board
# Created by JHJ on 2016. 10. 5. from django.conf.urls import url from django.conf import settings from django.conf.urls.static import static from . import views app_name = 'board' urlpatterns = [ url(r'^$', views.board_list, name='board_list'), url(r'^(?P<board_slug>[-a-z]+)/$', views.post_list, name='post_...
Set url to serve uploaded file during development # Created by JHJ on 2016. 10. 5. from django.conf.urls import url from . import views app_name = 'board' urlpatterns = [ url(r'^$', views.board_list, name='board_list'), url(r'^(?P<board_slug>[-a-z]+)/$', views.post_list, name='post_list'), url(r'^(?P<bo...
d8e876fc60d96f0d635862e845ae565ef3e2afb9
openpnm/models/geometry/__init__.py
openpnm/models/geometry/__init__.py
r""" **openpnm.models.geometry** ---- This submodule contains pore-scale models that calculate geometrical properties """ from . import pore_size from . import pore_seed from . import pore_volume from . import pore_surface_area from . import pore_area from . import throat_area from . import throat_equivalent_area ...
r""" **openpnm.models.geometry** ---- This submodule contains pore-scale models that calculate geometrical properties """ from . import pore_size from . import pore_seed from . import pore_volume from . import pore_surface_area from . import pore_area from . import throat_centroid from . import throat_area from . ...
Update init file in models.geometry
Update init file in models.geometry
Python
mit
TomTranter/OpenPNM,PMEAL/OpenPNM
r""" **openpnm.models.geometry** ---- This submodule contains pore-scale models that calculate geometrical properties """ from . import pore_size from . import pore_seed from . import pore_volume from . import pore_surface_area from . import pore_area from . import throat_centroid from . import throat_area from . ...
Update init file in models.geometry r""" **openpnm.models.geometry** ---- This submodule contains pore-scale models that calculate geometrical properties """ from . import pore_size from . import pore_seed from . import pore_volume from . import pore_surface_area from . import pore_area from . import throat_area f...
d8347132e246caf4874384000014353ce200dff4
launcher/launcher/ui/__init__.py
launcher/launcher/ui/__init__.py
CURATORS = "https://auth.globus.org/6265343a-52e3-11e7-acd7-22000b100078" DEFAULT_CONFIG = { "server": { "protocol": "https", "host": "", "catalog_id": 1 }, "viewer_mode": "2d", "curator_mode": False, "cache_dir": "~/synspy" }
CURATORS = "https://auth.globus.org/6265343a-52e3-11e7-acd7-22000b100078" DEFAULT_CONFIG = { "server": { "protocol": "https", "host": "synapse.isrd.isi.edu", "catalog_id": 1 }, "viewer_mode": "2d", "curator_mode": False, "cache_dir": "~/synspy" }
Set prod server as config default.
Set prod server as config default.
Python
bsd-3-clause
informatics-isi-edu/synspy,informatics-isi-edu/synspy,informatics-isi-edu/synspy
CURATORS = "https://auth.globus.org/6265343a-52e3-11e7-acd7-22000b100078" DEFAULT_CONFIG = { "server": { "protocol": "https", "host": "synapse.isrd.isi.edu", "catalog_id": 1 }, "viewer_mode": "2d", "curator_mode": False, "cache_dir": "~/synspy" }
Set prod server as config default. CURATORS = "https://auth.globus.org/6265343a-52e3-11e7-acd7-22000b100078" DEFAULT_CONFIG = { "server": { "protocol": "https", "host": "", "catalog_id": 1 }, "viewer_mode": "2d", "curator_mode": False, "cache_dir": "~/synspy" }
ed6146566d57105af88855c6b8668b4f76e98dbf
xmanager/xm_local/__init__.py
xmanager/xm_local/__init__.py
# Copyright 2021 DeepMind Technologies Limited # # 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 agr...
# Copyright 2021 DeepMind Technologies Limited # # 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 agr...
Make `DockerOptions` part of the `xm_local` module
Make `DockerOptions` part of the `xm_local` module PiperOrigin-RevId: 376139511 Change-Id: Ia0ec1337b9ef2c175dea6b0c45e0a99b285d2b31 GitOrigin-RevId: 799d3ef6a98a6e4922b0b60c190c0d82cd538548
Python
apache-2.0
deepmind/xmanager,deepmind/xmanager
# Copyright 2021 DeepMind Technologies Limited # # 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 agr...
Make `DockerOptions` part of the `xm_local` module PiperOrigin-RevId: 376139511 Change-Id: Ia0ec1337b9ef2c175dea6b0c45e0a99b285d2b31 GitOrigin-RevId: 799d3ef6a98a6e4922b0b60c190c0d82cd538548 # Copyright 2021 DeepMind Technologies Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may no...
ed08bb7cb943c6299c97d44b1c4bd0c53d581cfb
omftools/cli/enumize_translation.py
omftools/cli/enumize_translation.py
import argparse import re from omftools.pyshadowdive.language import LanguageFile re_non_alphanumeric = re.compile(r'[\W]+') def txt(text: str) -> str: o = text.replace(' ', '_') o = re.sub(re_non_alphanumeric, '', o) o = o.upper() return o def generate_enum(in_file: str, out_file: str): langu...
Add tool for generating transtions enum
Add tool for generating transtions enum
Python
mit
omf2097/pyomftools,omf2097/pyomftools
import argparse import re from omftools.pyshadowdive.language import LanguageFile re_non_alphanumeric = re.compile(r'[\W]+') def txt(text: str) -> str: o = text.replace(' ', '_') o = re.sub(re_non_alphanumeric, '', o) o = o.upper() return o def generate_enum(in_file: str, out_file: str): langu...
Add tool for generating transtions enum
39eea826a1f29c2bd77d5f4f5bead7011b47f0bb
sed/engine/__init__.py
sed/engine/__init__.py
from sed.engine.StreamEditor import StreamEditor from sed.engine.sed_file_util import call_main from sed.engine.match_engine import ACCEPT, REJECT, NEXT, REPEAT, CUT from sed.engine.sed_regex import ANY __all__ = [ "StreamEditor", "call_main", "ACCEPT", "REJECT", "NEXT", "REPEAT", "ANY", ]
""" Interface to sed engine - defines objects exported from this module """ from sed.engine.StreamEditor import StreamEditor from sed.engine.sed_file_util import call_main from sed.engine.match_engine import ( ACCEPT, REJECT, NEXT, REPEAT, CUT, ) from sed.engine.sed_regex import ANY __all__ = [ ...
Add CUT to list of externally visible objects
Add CUT to list of externally visible objects
Python
mit
hughdbrown/sed,hughdbrown/sed
""" Interface to sed engine - defines objects exported from this module """ from sed.engine.StreamEditor import StreamEditor from sed.engine.sed_file_util import call_main from sed.engine.match_engine import ( ACCEPT, REJECT, NEXT, REPEAT, CUT, ) from sed.engine.sed_regex import ANY __all__ = [ ...
Add CUT to list of externally visible objects from sed.engine.StreamEditor import StreamEditor from sed.engine.sed_file_util import call_main from sed.engine.match_engine import ACCEPT, REJECT, NEXT, REPEAT, CUT from sed.engine.sed_regex import ANY __all__ = [ "StreamEditor", "call_main", "ACCEPT", "REJE...
9fa3775c78b8c44b503ce1565e2e990644a61da6
Lib/test/test_lib2to3.py
Lib/test/test_lib2to3.py
# Skipping test_parser and test_all_fixers # because of running from lib2to3.tests import test_fixers, test_pytree, test_util import unittest from test.test_support import run_unittest def suite(): tests = unittest.TestSuite() loader = unittest.TestLoader() for m in (test_fixers,test_pytree,test_util): ...
# Skipping test_parser and test_all_fixers # because of running from lib2to3.tests import test_fixers, test_pytree, test_util import unittest from test.test_support import run_unittest, requires # Don't run lib2to3 tests by default since they take too long if __name__ != '__main__': requires('lib2to3') def suite(...
Disable lib2to3 by default, unless run explicitly.
Disable lib2to3 by default, unless run explicitly.
Python
mit
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
# Skipping test_parser and test_all_fixers # because of running from lib2to3.tests import test_fixers, test_pytree, test_util import unittest from test.test_support import run_unittest, requires # Don't run lib2to3 tests by default since they take too long if __name__ != '__main__': requires('lib2to3') def suite(...
Disable lib2to3 by default, unless run explicitly. # Skipping test_parser and test_all_fixers # because of running from lib2to3.tests import test_fixers, test_pytree, test_util import unittest from test.test_support import run_unittest def suite(): tests = unittest.TestSuite() loader = unittest.TestLoader() ...
71b7885bc1e3740adf8c07c23b41835e1e69f8a2
sqlobject/tests/test_class_hash.py
sqlobject/tests/test_class_hash.py
from sqlobject import * from sqlobject.tests.dbtest import * ######################################## # Test hashing a column instance ######################################## class ClassHashTest(SQLObject): name = StringCol(length=50, alternateID=True, dbName='name_col') def test_class_hash(): setupClass...
from sqlobject import * from sqlobject.tests.dbtest import * ######################################## # Test hashing a column instance ######################################## class ClassHashTest(SQLObject): name = StringCol(length=50, alternateID=True, dbName='name_col') def test_class_hash(): setupClass...
Fix flake8 warning in test case
Fix flake8 warning in test case
Python
lgpl-2.1
drnlm/sqlobject,sqlobject/sqlobject,drnlm/sqlobject,sqlobject/sqlobject
from sqlobject import * from sqlobject.tests.dbtest import * ######################################## # Test hashing a column instance ######################################## class ClassHashTest(SQLObject): name = StringCol(length=50, alternateID=True, dbName='name_col') def test_class_hash(): setupClass...
Fix flake8 warning in test case from sqlobject import * from sqlobject.tests.dbtest import * ######################################## # Test hashing a column instance ######################################## class ClassHashTest(SQLObject): name = StringCol(length=50, alternateID=True, dbName='name_col') def ...
37c33a4a133326cce7083ea68607971344f0e6ed
rules/binutils.py
rules/binutils.py
import xyz import os import shutil class Binutils(xyz.BuildProtocol): pkg_name = 'binutils' supported_targets = ['arm-none-eabi'] def check(self, builder): if builder.target not in self.supported_targets: raise xyz.UsageError("Invalid target ({}) for {}".format(builder.target, self.pkg...
import xyz import os import shutil class Binutils(xyz.BuildProtocol): pkg_name = 'binutils' supported_targets = ['arm-none-eabi'] def check(self, builder): if builder.target not in self.supported_targets: raise xyz.UsageError("Invalid target ({}) for {}".format(builder.target, self.pkg...
Remove info dirs (for now)
Remove info dirs (for now)
Python
mit
BreakawayConsulting/xyz
import xyz import os import shutil class Binutils(xyz.BuildProtocol): pkg_name = 'binutils' supported_targets = ['arm-none-eabi'] def check(self, builder): if builder.target not in self.supported_targets: raise xyz.UsageError("Invalid target ({}) for {}".format(builder.target, self.pkg...
Remove info dirs (for now) import xyz import os import shutil class Binutils(xyz.BuildProtocol): pkg_name = 'binutils' supported_targets = ['arm-none-eabi'] def check(self, builder): if builder.target not in self.supported_targets: raise xyz.UsageError("Invalid target ({}) for {}".for...
a4dc87b5a9b555f74efa9bfe2bd16af5340d1199
googlesearch/googlesearch.py
googlesearch/googlesearch.py
#!/usr/bin/python import json import urllib def showsome(searchfor): query = urllib.urlencode({'q': searchfor}) url = 'http://ajax.googleapis.com/ajax/services/search/web?v=1.0&%s' % query search_response = urllib.urlopen(url) search_results = search_response.read() results = json.loads(search_results) dat...
#!/usr/bin/python import json import urllib import sys def showsome(searchfor): query = urllib.urlencode({'q': searchfor}) url = 'http://ajax.googleapis.com/ajax/services/search/web?v=1.0&%s' % query search_response = urllib.urlopen(url) search_results = search_response.read() results = json.loads(search_res...
Update of the google search code to be a command line program.
Update of the google search code to be a command line program.
Python
apache-2.0
phpsystems/code,phpsystems/code
#!/usr/bin/python import json import urllib import sys def showsome(searchfor): query = urllib.urlencode({'q': searchfor}) url = 'http://ajax.googleapis.com/ajax/services/search/web?v=1.0&%s' % query search_response = urllib.urlopen(url) search_results = search_response.read() results = json.loads(search_res...
Update of the google search code to be a command line program. #!/usr/bin/python import json import urllib def showsome(searchfor): query = urllib.urlencode({'q': searchfor}) url = 'http://ajax.googleapis.com/ajax/services/search/web?v=1.0&%s' % query search_response = urllib.urlopen(url) search_results = sea...
8170aca01f6922ef653bceb9121eb7fc098f85de
defenses/torch/audio/input_tranformation/resampling.py
defenses/torch/audio/input_tranformation/resampling.py
import torchaudio import librosa # resampling reference https://core.ac.uk/download/pdf/228298313.pdf # resampling input transformation defense for audio T = torchaudio.transforms # Read audio file audio_data = librosa.load(files, sr=16000)[0][-19456:] audio_data = torch.tensor(audio_data).float().to(device) # Di...
import torchaudio import librosa # resampling reference https://core.ac.uk/download/pdf/228298313.pdf # resampling input transformation defense for audio T = torchaudio.transforms # Read audio file audio_data = librosa.load(files, sr=16000)[0][-19456:] audio_data = torch.tensor(audio_data).float().to(device) # Di...
Format the code to black
Format the code to black
Python
mit
cleverhans-lab/cleverhans,cleverhans-lab/cleverhans,cleverhans-lab/cleverhans
import torchaudio import librosa # resampling reference https://core.ac.uk/download/pdf/228298313.pdf # resampling input transformation defense for audio T = torchaudio.transforms # Read audio file audio_data = librosa.load(files, sr=16000)[0][-19456:] audio_data = torch.tensor(audio_data).float().to(device) # Di...
Format the code to black import torchaudio import librosa # resampling reference https://core.ac.uk/download/pdf/228298313.pdf # resampling input transformation defense for audio T = torchaudio.transforms # Read audio file audio_data = librosa.load(files, sr=16000)[0][-19456:] audio_data = torch.tensor(audio_data)...
7c4a8d1249becb11727002c4eb2cd2f58c712244
zou/app/utils/emails.py
zou/app/utils/emails.py
from flask_mail import Message from zou.app import mail, app def send_email(subject, body, recipient_email, html=None): """ Send an email with given subject and body to given recipient. """ if html is None: html = body with app.app_context(): message = Message( sender=...
from flask_mail import Message from zou.app import mail, app def send_email(subject, body, recipient_email, html=None): """ Send an email with given subject and body to given recipient. """ if html is None: html = body with app.app_context(): mail_default_sender = app.config["MAIL...
Fix configuration of email default sender
Fix configuration of email default sender
Python
agpl-3.0
cgwire/zou
from flask_mail import Message from zou.app import mail, app def send_email(subject, body, recipient_email, html=None): """ Send an email with given subject and body to given recipient. """ if html is None: html = body with app.app_context(): mail_default_sender = app.config["MAIL...
Fix configuration of email default sender from flask_mail import Message from zou.app import mail, app def send_email(subject, body, recipient_email, html=None): """ Send an email with given subject and body to given recipient. """ if html is None: html = body with app.app_context(): ...
76ec25090ece865d67f63c07c32aff7cebf105c1
ynr/apps/people/migrations/0034_get_birth_year.py
ynr/apps/people/migrations/0034_get_birth_year.py
# Generated by Django 3.2.4 on 2021-10-27 14:41 from django.db import migrations def get_birth_year(apps, schema_editor): Person = apps.get_model("people", "Person") for person in Person.objects.all(): birth_year = person.birth_date.split("-")[0] person.birth_date = birth_year person....
# Generated by Django 3.2.4 on 2021-10-27 14:41 from django.db import migrations def get_birth_year(apps, schema_editor): Person = apps.get_model("people", "Person") for person in Person.objects.exclude(birth_date="").iterator(): birth_year = person.birth_date.split("-")[0] person.birth_date ...
Improve performance of birth date data migration
Improve performance of birth date data migration
Python
agpl-3.0
DemocracyClub/yournextrepresentative,DemocracyClub/yournextrepresentative,DemocracyClub/yournextrepresentative
# Generated by Django 3.2.4 on 2021-10-27 14:41 from django.db import migrations def get_birth_year(apps, schema_editor): Person = apps.get_model("people", "Person") for person in Person.objects.exclude(birth_date="").iterator(): birth_year = person.birth_date.split("-")[0] person.birth_date ...
Improve performance of birth date data migration # Generated by Django 3.2.4 on 2021-10-27 14:41 from django.db import migrations def get_birth_year(apps, schema_editor): Person = apps.get_model("people", "Person") for person in Person.objects.all(): birth_year = person.birth_date.split("-")[0] ...
a06dc82df053ea47f8a39b46d938f52679b2cff5
grow/preprocessors/blogger_test.py
grow/preprocessors/blogger_test.py
from . import google_drive from grow.pods import pods from grow.pods import storage from grow.testing import testing import cStringIO import csv import json import unittest import yaml class BloggerTestCase(testing.TestCase): def test_run(self): pod = testing.create_pod() fields = { '...
from . import google_drive from grow.pods import pods from grow.pods import storage from grow.testing import testing import cStringIO import csv import json import unittest import yaml class BloggerTestCase(testing.TestCase): def test_run(self): pod = testing.create_pod() fields = { '...
Use different blog for test data.
Use different blog for test data.
Python
mit
grow/pygrow,denmojo/pygrow,denmojo/pygrow,denmojo/pygrow,grow/grow,grow/pygrow,grow/grow,grow/grow,grow/grow,grow/pygrow,denmojo/pygrow
from . import google_drive from grow.pods import pods from grow.pods import storage from grow.testing import testing import cStringIO import csv import json import unittest import yaml class BloggerTestCase(testing.TestCase): def test_run(self): pod = testing.create_pod() fields = { '...
Use different blog for test data. from . import google_drive from grow.pods import pods from grow.pods import storage from grow.testing import testing import cStringIO import csv import json import unittest import yaml class BloggerTestCase(testing.TestCase): def test_run(self): pod = testing.create_pod...
ad68c13a4080c80c88b039e3033f6b94421f4a27
sms_send_demo.py
sms_send_demo.py
""" Basic demo of summit-python that sends a simple SMS message from the command-line. """ import argparse from summit.rest import SummitRestClient def main(): parser = argparse.ArgumentParser( description="Command-line SMS sender using Corvisa's Summit API.") parser.add_argument('--key', required=T...
Add demo script to send SMS message from command_line
Add demo script to send SMS message from command_line
Python
mit
josephl/summit-python
""" Basic demo of summit-python that sends a simple SMS message from the command-line. """ import argparse from summit.rest import SummitRestClient def main(): parser = argparse.ArgumentParser( description="Command-line SMS sender using Corvisa's Summit API.") parser.add_argument('--key', required=T...
Add demo script to send SMS message from command_line
ef67ce4372128d8f7e9689e1090ee44674c8f391
scripts/analytics/run_keen_events.py
scripts/analytics/run_keen_events.py
from framework.celery_tasks import app as celery_app from scripts.analytics.base import DateAnalyticsHarness from scripts.analytics.node_log_events import NodeLogEvents class EventAnalyticsHarness(DateAnalyticsHarness): @property def analytics_classes(self): return [NodeLogEvents] @celery_app.task(...
from framework.celery_tasks import app as celery_app from scripts.analytics.base import DateAnalyticsHarness from scripts.analytics.node_log_events import NodeLogEvents from scripts.analytics.user_domain_events import UserDomainEvents class EventAnalyticsHarness(DateAnalyticsHarness): @property def analytics...
Add new user domain event collector to main keen events script
Add new user domain event collector to main keen events script
Python
apache-2.0
chrisseto/osf.io,caneruguz/osf.io,felliott/osf.io,alexschiller/osf.io,leb2dg/osf.io,chrisseto/osf.io,caseyrollins/osf.io,baylee-d/osf.io,icereval/osf.io,hmoco/osf.io,leb2dg/osf.io,chrisseto/osf.io,mluo613/osf.io,rdhyee/osf.io,acshi/osf.io,mluo613/osf.io,Nesiehr/osf.io,CenterForOpenScience/osf.io,rdhyee/osf.io,felliott/...
from framework.celery_tasks import app as celery_app from scripts.analytics.base import DateAnalyticsHarness from scripts.analytics.node_log_events import NodeLogEvents from scripts.analytics.user_domain_events import UserDomainEvents class EventAnalyticsHarness(DateAnalyticsHarness): @property def analytics...
Add new user domain event collector to main keen events script from framework.celery_tasks import app as celery_app from scripts.analytics.base import DateAnalyticsHarness from scripts.analytics.node_log_events import NodeLogEvents class EventAnalyticsHarness(DateAnalyticsHarness): @property def analytics_c...
8b77e1e865d72720a602b7b7cc5912cb852d68cf
settings/dev.py
settings/dev.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import os from .common import * # noqa DEBUG = True TEMPLATE_DEBUG = DEBUG DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(ROOT_DIR, 'db.sqlite3'), } } ACCOUNT_DEFAULT_H...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import os from .common import * # noqa DEBUG = True TEMPLATE_DEBUG = DEBUG DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(ROOT_DIR, 'db.sqlite3'), } } ACCOUNT_DEFAULT_H...
Revert back to original settings for Celery Broker
Revert back to original settings for Celery Broker
Python
mit
pythonindia/junction,pythonindia/junction,pythonindia/junction,pythonindia/junction
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import os from .common import * # noqa DEBUG = True TEMPLATE_DEBUG = DEBUG DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(ROOT_DIR, 'db.sqlite3'), } } ACCOUNT_DEFAULT_H...
Revert back to original settings for Celery Broker # -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import os from .common import * # noqa DEBUG = True TEMPLATE_DEBUG = DEBUG DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join...
3803eae05013c04b4cf4516f40a851da048d939f
setup.py
setup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys try: from setuptools import setup except ImportError: from distutils.core import setup if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit() requires = ['pyrax==1.4.7', 'ipython==0.13.2', ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys try: from setuptools import setup except ImportError: from distutils.core import setup if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit() requires = ['pyrax==1.4.7', 'ipython==0.13.2', ...
Add pyzmq. Note: this package doesn't need it but IPython notebook does
Add pyzmq. Note: this package doesn't need it but IPython notebook does
Python
apache-2.0
rgbkrk/bookstore
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys try: from setuptools import setup except ImportError: from distutils.core import setup if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit() requires = ['pyrax==1.4.7', 'ipython==0.13.2', ...
Add pyzmq. Note: this package doesn't need it but IPython notebook does #!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys try: from setuptools import setup except ImportError: from distutils.core import setup if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') s...
52d15d09ed079d1b8598f314524066b56273af3d
addie/_version.py
addie/_version.py
# This file was generated by 'versioneer.py' (0.15) from # revision-control system data, or from the parent directory name of an # unpacked source archive. Distribution tarballs contain a pre-generated copy # of this file. import json import sys version_json = ''' { "dirty": false, "error": null, "full-revisionid...
# This file was generated by 'versioneer.py' (0.15) from # revision-control system data, or from the parent directory name of an # unpacked source archive. Distribution tarballs contain a pre-generated copy # of this file. import json version_json = ''' { "dirty": false, "error": null, "full-revisionid": "aaeac97...
Remove sys import in versioneer file
Remove sys import in versioneer file
Python
mit
neutrons/FastGR,neutrons/FastGR,neutrons/FastGR
# This file was generated by 'versioneer.py' (0.15) from # revision-control system data, or from the parent directory name of an # unpacked source archive. Distribution tarballs contain a pre-generated copy # of this file. import json version_json = ''' { "dirty": false, "error": null, "full-revisionid": "aaeac97...
Remove sys import in versioneer file # This file was generated by 'versioneer.py' (0.15) from # revision-control system data, or from the parent directory name of an # unpacked source archive. Distribution tarballs contain a pre-generated copy # of this file. import json import sys version_json = ''' { "dirty": fa...
64d17f591bfde49d3a7b5f49f987c1138eecebf8
tests/source/start_trace.py
tests/source/start_trace.py
"""Write some logs.""" import sys import time from mdk import start mdk = start() def main(): session = mdk.session() session.info("process1", "hello") time.sleep(1) sys.stdout.write(session.inject()) sys.stdout.flush() mdk.stop() if __name__ == '__main__': main()
"""Write some logs.""" import sys import time from mdk import start mdk = start() def main(): session = mdk.session() session.info("process1", "hello") time.sleep(5) sys.stdout.write(session.inject()) sys.stdout.flush() mdk.stop() if __name__ == '__main__': main()
Increase sleep in test to reduce timing sensitivity with prod servers.
Increase sleep in test to reduce timing sensitivity with prod servers.
Python
apache-2.0
datawire/mdk,datawire/mdk,datawire/mdk,datawire/mdk
"""Write some logs.""" import sys import time from mdk import start mdk = start() def main(): session = mdk.session() session.info("process1", "hello") time.sleep(5) sys.stdout.write(session.inject()) sys.stdout.flush() mdk.stop() if __name__ == '__main__': main()
Increase sleep in test to reduce timing sensitivity with prod servers. """Write some logs.""" import sys import time from mdk import start mdk = start() def main(): session = mdk.session() session.info("process1", "hello") time.sleep(1) sys.stdout.write(session.inject()) sys.stdout.flush() ...
4a3da350105314310cb0a44f11b50c9c6c6617ee
integration-test/1387-business-and-spur-routes.py
integration-test/1387-business-and-spur-routes.py
from . import FixtureTest class BusinessAndSpurRoutes(FixtureTest): def test_first_capitol_dr_i70_business(self): self.load_fixtures([ 'https://www.openstreetmap.org/relation/1933234', ]) # check that First Capitol Dr, part of the above relation, is given # a network ...
from . import FixtureTest class BusinessAndSpurRoutes(FixtureTest): def _check_route_relation( self, rel_id, way_id, tile, shield_text, network): z, x, y = map(int, tile.split('/')) self.load_fixtures([ 'https://www.openstreetmap.org/relation/%d' % (rel_id,), ], c...
Add more test cases for spur / business route modifiers.
Add more test cases for spur / business route modifiers.
Python
mit
mapzen/vector-datasource,mapzen/vector-datasource,mapzen/vector-datasource
from . import FixtureTest class BusinessAndSpurRoutes(FixtureTest): def _check_route_relation( self, rel_id, way_id, tile, shield_text, network): z, x, y = map(int, tile.split('/')) self.load_fixtures([ 'https://www.openstreetmap.org/relation/%d' % (rel_id,), ], c...
Add more test cases for spur / business route modifiers. from . import FixtureTest class BusinessAndSpurRoutes(FixtureTest): def test_first_capitol_dr_i70_business(self): self.load_fixtures([ 'https://www.openstreetmap.org/relation/1933234', ]) # check that First Capitol Dr,...
7a281be50ba1fc59281a76470776fa9c8efdfd54
pijobs/scrolljob.py
pijobs/scrolljob.py
import scrollphat from pijobs.scrollphatjob import ScrollphatJob class ScrollJob(ScrollphatJob): def default_options(self): opts = { 'brightness': 2, 'interval': 0.1, 'sleep': 1.0, } return opts def init(self): self.set_brightness...
import scrollphat from pijobs.scrollphatjob import ScrollphatJob class ScrollJob(ScrollphatJob): def default_options(self): opts = { 'brightness': 2, 'interval': 0.1, 'sleep': 1.0, } return opts def init(self): self.set_brightness...
Add back rotatation for scroll job.
Add back rotatation for scroll job.
Python
mit
ollej/piapi,ollej/piapi
import scrollphat from pijobs.scrollphatjob import ScrollphatJob class ScrollJob(ScrollphatJob): def default_options(self): opts = { 'brightness': 2, 'interval': 0.1, 'sleep': 1.0, } return opts def init(self): self.set_brightness...
Add back rotatation for scroll job. import scrollphat from pijobs.scrollphatjob import ScrollphatJob class ScrollJob(ScrollphatJob): def default_options(self): opts = { 'brightness': 2, 'interval': 0.1, 'sleep': 1.0, } return opts def in...
a31e62f2a981f7662aee8a35ad195252a542d08d
plugins/say.py
plugins/say.py
from motobot import command, action @command('say') def say_command(bot, message, database): masters = [ "Moto-chan", "Motoko11", "Akahige", "betholas", "Baradium", "Cold_slither", "Drahken" ] if message.nick.lower() not in [x.lower() for x in m...
from motobot import command, action @command('say') def say_command(bot, message, database): masters = [ "Moto-chan", "Motoko11", "MotoNyan", "Akahige", "betholas", "Baradium", "Cold_slither", "Drahken" ] if message.nick.lower() not in [...
Add MotoNyan to mad hax
Add MotoNyan to mad hax
Python
mit
Motoko11/MotoBot
from motobot import command, action @command('say') def say_command(bot, message, database): masters = [ "Moto-chan", "Motoko11", "MotoNyan", "Akahige", "betholas", "Baradium", "Cold_slither", "Drahken" ] if message.nick.lower() not in [...
Add MotoNyan to mad hax from motobot import command, action @command('say') def say_command(bot, message, database): masters = [ "Moto-chan", "Motoko11", "Akahige", "betholas", "Baradium", "Cold_slither", "Drahken" ] if message.nick.lower() not...
06110d32be6bc52f05274318a0f5ff27828acf91
setup.py
setup.py
#!/usr/bin/env python # Support setuptools or distutils try: from setuptools import setup, find_packages except ImportError: from distutils.core import setup # Version info -- read without importing _locals = {} version_module = execfile('invocations/_version.py', _locals) version = _locals['__version__'] se...
#!/usr/bin/env python # Support setuptools or distutils try: from setuptools import setup, find_packages except ImportError: from distutils.core import setup # Version info -- read without importing _locals = {} with open('invocations/_version.py') as fp: exec(fp.read(), None, _locals) version = _locals['...
Switch to a Python3 Compataible open + read + exec vs execfile
Switch to a Python3 Compataible open + read + exec vs execfile
Python
bsd-2-clause
pyinvoke/invocations,alex/invocations,mrjmad/invocations,singingwolfboy/invocations
#!/usr/bin/env python # Support setuptools or distutils try: from setuptools import setup, find_packages except ImportError: from distutils.core import setup # Version info -- read without importing _locals = {} with open('invocations/_version.py') as fp: exec(fp.read(), None, _locals) version = _locals['...
Switch to a Python3 Compataible open + read + exec vs execfile #!/usr/bin/env python # Support setuptools or distutils try: from setuptools import setup, find_packages except ImportError: from distutils.core import setup # Version info -- read without importing _locals = {} version_module = execfile('invocat...
7da7789a6508a60d0ad7662ac69bcee9c478c239
numpy/typing/tests/data/fail/array_constructors.py
numpy/typing/tests/data/fail/array_constructors.py
import numpy as np a: np.ndarray generator = (i for i in range(10)) np.require(a, requirements=1) # E: No overload variant np.require(a, requirements="TEST") # E: incompatible type np.zeros("test") # E: incompatible type np.zeros() # E: Too few arguments np.ones("test") # E: incompatible type np.ones() # E: T...
import numpy as np a: np.ndarray generator = (i for i in range(10)) np.require(a, requirements=1) # E: No overload variant np.require(a, requirements="TEST") # E: incompatible type np.zeros("test") # E: incompatible type np.zeros() # E: Missing positional argument np.ones("test") # E: incompatible type np.ones...
Fix two failing typing tests
TST: Fix two failing typing tests Mypy 0.800 changed one of its error messages; the `fail` tests have now been altered to reflect this change
Python
bsd-3-clause
seberg/numpy,jakirkham/numpy,endolith/numpy,pdebuyl/numpy,seberg/numpy,seberg/numpy,mhvk/numpy,pbrod/numpy,pbrod/numpy,pbrod/numpy,endolith/numpy,pbrod/numpy,seberg/numpy,madphysicist/numpy,pbrod/numpy,mattip/numpy,jakirkham/numpy,numpy/numpy,madphysicist/numpy,rgommers/numpy,mhvk/numpy,mhvk/numpy,rgommers/numpy,anntze...
import numpy as np a: np.ndarray generator = (i for i in range(10)) np.require(a, requirements=1) # E: No overload variant np.require(a, requirements="TEST") # E: incompatible type np.zeros("test") # E: incompatible type np.zeros() # E: Missing positional argument np.ones("test") # E: incompatible type np.ones...
TST: Fix two failing typing tests Mypy 0.800 changed one of its error messages; the `fail` tests have now been altered to reflect this change import numpy as np a: np.ndarray generator = (i for i in range(10)) np.require(a, requirements=1) # E: No overload variant np.require(a, requirements="TEST") # E: incompati...
d4137375513e22e9fda3ad6abb53e99492101727
setup.py
setup.py
from setuptools import setup, find_packages # Prevent "TypeError: 'NoneType' object is not callable" error # when running python setup.py test # (see http://www.eby-sarna.com/pipermail/peak/2010-May/003357.html) try: import multiprocessing except ImportError: pass setup( name='cmakelists_parsing', ve...
from setuptools import setup, find_packages # Prevent "TypeError: 'NoneType' object is not callable" error # when running python setup.py test # (see http://www.eby-sarna.com/pipermail/peak/2010-May/003357.html) try: import multiprocessing except ImportError: pass setup( name='cmakelists_parsing', ve...
Fix entry point for pretty printing script.
Fix entry point for pretty printing script.
Python
mit
ijt/cmakelists_parsing,wjwwood/parse_cmake
from setuptools import setup, find_packages # Prevent "TypeError: 'NoneType' object is not callable" error # when running python setup.py test # (see http://www.eby-sarna.com/pipermail/peak/2010-May/003357.html) try: import multiprocessing except ImportError: pass setup( name='cmakelists_parsing', ve...
Fix entry point for pretty printing script. from setuptools import setup, find_packages # Prevent "TypeError: 'NoneType' object is not callable" error # when running python setup.py test # (see http://www.eby-sarna.com/pipermail/peak/2010-May/003357.html) try: import multiprocessing except ImportError: pass ...
012f93ae03aded72b64ac9bbfb6d2995199d4d8f
tests/test_api_views.py
tests/test_api_views.py
import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.api.settings") import django from django.test import TestCase from rest_framework.test import APIRequestFactory from api.webview.views import DocumentList django.setup() class APIViewTests(TestCase): def setUp(self): self.factory = APIRequ...
import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.api.settings") import django from django.test import TestCase from rest_framework.test import APIRequestFactory from api.webview.views import DocumentList, status django.setup() class APIViewTests(TestCase): def setUp(self): self.factory =...
Add test for status view
Add test for status view
Python
apache-2.0
erinspace/scrapi,erinspace/scrapi,felliott/scrapi,fabianvf/scrapi,CenterForOpenScience/scrapi,felliott/scrapi,CenterForOpenScience/scrapi,fabianvf/scrapi
import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.api.settings") import django from django.test import TestCase from rest_framework.test import APIRequestFactory from api.webview.views import DocumentList, status django.setup() class APIViewTests(TestCase): def setUp(self): self.factory =...
Add test for status view import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.api.settings") import django from django.test import TestCase from rest_framework.test import APIRequestFactory from api.webview.views import DocumentList django.setup() class APIViewTests(TestCase): def setUp(self): ...
1d02a8526abf8dfd9f76bbec7fac26a58ff0b25b
nodeconductor/quotas/management/commands/initglobalquotashistory.py
nodeconductor/quotas/management/commands/initglobalquotashistory.py
from __future__ import unicode_literals from django.contrib.contenttypes.models import ContentType from django.core import serializers as django_serializers from django.core.management.base import BaseCommand from reversion.models import Version, Revision from nodeconductor.quotas import models from nodeconductor.quo...
Implement command for quotas history population
Implement command for quotas history population - itacloud-5296
Python
mit
opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor
from __future__ import unicode_literals from django.contrib.contenttypes.models import ContentType from django.core import serializers as django_serializers from django.core.management.base import BaseCommand from reversion.models import Version, Revision from nodeconductor.quotas import models from nodeconductor.quo...
Implement command for quotas history population - itacloud-5296
a5f4636e5bea14770253e646b94970c226669e50
telemetry/telemetry/core/platform/platform_backend_unittest.py
telemetry/telemetry/core/platform/platform_backend_unittest.py
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import logging import time import unittest from telemetry.core import platform as platform_module class PlatformBackendTest(unittest.TestCase): def test...
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import logging import time import unittest from telemetry import decorators from telemetry.core import platform as platform_module class PlatformBackendTe...
Disable power and smoke unit tests on Mac 10.9.
[telemetry] Disable power and smoke unit tests on Mac 10.9. powermetrics is failing on the bots. BUG=423688 TEST=trybots R=tonyg Review URL: https://codereview.chromium.org/746793002 Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#305147}
Python
bsd-3-clause
SummerLW/Perf-Insight-Report,benschmaus/catapult,catapult-project/catapult,SummerLW/Perf-Insight-Report,catapult-project/catapult,catapult-project/catapult-csm,catapult-project/catapult,sahiljain/catapult,benschmaus/catapult,catapult-project/catapult-csm,SummerLW/Perf-Insight-Report,benschmaus/catapult,sahiljain/catapu...
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import logging import time import unittest from telemetry import decorators from telemetry.core import platform as platform_module class PlatformBackendTe...
[telemetry] Disable power and smoke unit tests on Mac 10.9. powermetrics is failing on the bots. BUG=423688 TEST=trybots R=tonyg Review URL: https://codereview.chromium.org/746793002 Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#305147} # Copyright 2014 The Chromium Authors. All rights reserved. #...
15bd37c9042e2f5734e1123d28ec1544780c7f8f
Scripts/Make_Load_Maps/project_nodal_load.py
Scripts/Make_Load_Maps/project_nodal_load.py
import numpy as np import scipy.sparse as sparse import argparse, os from itertools import izip as zip # Uses the output of nodal_projection_matrix.py to aggregate signals # into the nodal domain. parser = argparse.ArgumentParser(description='Wind conversion options') parser.add_argument('-r', '--indir', help='Input ...
Add projection to nodal load
Add projection to nodal load
Python
apache-2.0
DTU-ELMA/European_Dataset,DTU-ELMA/European_Dataset
import numpy as np import scipy.sparse as sparse import argparse, os from itertools import izip as zip # Uses the output of nodal_projection_matrix.py to aggregate signals # into the nodal domain. parser = argparse.ArgumentParser(description='Wind conversion options') parser.add_argument('-r', '--indir', help='Input ...
Add projection to nodal load
c67a468d9b02e396c184305dc7b1bbb97982cf7b
python/testData/debug/test_multithread.py
python/testData/debug/test_multithread.py
try: import thread except : import _thread as thread import threading def bar(y): z = 100 + y print("Z=%d"%z) t = None def foo(x): global t y = x + 1 print("Y=%d"%y) t = threading.Thread(target=bar, args=(y,)) t.start() id = thread.start_new_thread(foo, (1,)) while True: p...
try: import thread except : import _thread as thread import threading from time import sleep def bar(y): z = 100 + y print("Z=%d"%z) t = None def foo(x): global t y = x + 1 print("Y=%d"%y) t = threading.Thread(target=bar, args=(y,)) t.start() id = thread.start_new_thread(foo, (...
Fix tests: add sleep to the main thread in order to stop in the child threads on the slow IronPython.
Fix tests: add sleep to the main thread in order to stop in the child threads on the slow IronPython.
Python
apache-2.0
FHannes/intellij-community,signed/intellij-community,xfournet/intellij-community,semonte/intellij-community,mglukhikh/intellij-community,ibinti/intellij-community,youdonghai/intellij-community,xfournet/intellij-community,hurricup/intellij-community,salguarnieri/intellij-community,da1z/intellij-community,hurricup/intell...
try: import thread except : import _thread as thread import threading from time import sleep def bar(y): z = 100 + y print("Z=%d"%z) t = None def foo(x): global t y = x + 1 print("Y=%d"%y) t = threading.Thread(target=bar, args=(y,)) t.start() id = thread.start_new_thread(foo, (...
Fix tests: add sleep to the main thread in order to stop in the child threads on the slow IronPython. try: import thread except : import _thread as thread import threading def bar(y): z = 100 + y print("Z=%d"%z) t = None def foo(x): global t y = x + 1 print("Y=%d"%y) t = threading.T...
d93628d8cc63301148a139a6c1c354620e5e57d1
tests/settings.py
tests/settings.py
SECRET_KEY = 'SEKRIT' INSTALLED_APPS = ( 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.auth', 'django.contrib.admin', 'tests', ) ROOT_URLCONF = 'tests.urls' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'enumfields.db', ...
SECRET_KEY = 'SEKRIT' INSTALLED_APPS = ( 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.auth', 'django.contrib.admin', 'tests', ) ROOT_URLCONF = 'tests.urls' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'enumfields.db', ...
Add new required middleware to make tests pass on Django 1.7
Add new required middleware to make tests pass on Django 1.7
Python
mit
suutari-ai/django-enumfields,jackyyf/django-enumfields,bxm156/django-enumfields,jessamynsmith/django-enumfields
SECRET_KEY = 'SEKRIT' INSTALLED_APPS = ( 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.auth', 'django.contrib.admin', 'tests', ) ROOT_URLCONF = 'tests.urls' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'enumfields.db', ...
Add new required middleware to make tests pass on Django 1.7 SECRET_KEY = 'SEKRIT' INSTALLED_APPS = ( 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.auth', 'django.contrib.admin', 'tests', ) ROOT_URLCONF = 'tests.urls' DATABASES = { 'default': { 'ENGINE': 'd...
78da548cbf7646ea1d67859cbd0946d6931b2b0d
ad-hoc-scripts/lift.py
ad-hoc-scripts/lift.py
#! /usr/bin/env python3 import sys import json for arg in sys.argv[1:]: with open(arg) as f: equajson = json.load(f) field_list = [ "always-an-integer", "always-positive", "always-dimensionless", "bound-variable", "fixed-constant", "special-function" ...
#! /usr/bin/env python3 import sys import json for arg in sys.argv[1:]: with open(arg) as f: equajson = json.load(f) field_list = [ "always-an-integer", "always-positive", "always-dimensionless", "bound-variable", "fixed-constant", "special-function" ...
Fix serious file overwriting problem.
Fix serious file overwriting problem.
Python
mit
nbeaver/equajson
#! /usr/bin/env python3 import sys import json for arg in sys.argv[1:]: with open(arg) as f: equajson = json.load(f) field_list = [ "always-an-integer", "always-positive", "always-dimensionless", "bound-variable", "fixed-constant", "special-function" ...
Fix serious file overwriting problem. #! /usr/bin/env python3 import sys import json for arg in sys.argv[1:]: with open(arg) as f: equajson = json.load(f) field_list = [ "always-an-integer", "always-positive", "always-dimensionless", "bound-variable", "fixed-c...
164b860e4a44a22a1686cf6133fac6258fc97db6
nbgrader/tests/apps/test_nbgrader_fetch.py
nbgrader/tests/apps/test_nbgrader_fetch.py
from nbgrader.tests import run_command from nbgrader.tests.apps.base import BaseTestApp class TestNbGraderFetch(BaseTestApp): def test_help(self): """Does the help display without error?""" run_command("nbgrader fetch --help-all")
import os from nbgrader.tests import run_command from nbgrader.tests.apps.base import BaseTestApp class TestNbGraderFetch(BaseTestApp): def _fetch(self, assignment, exchange, flags="", retcode=0): run_command( 'nbgrader fetch abc101 {} ' '--TransferApp.exchange_directory={} ' ...
Add some basic tests for nbgrader fetch
Add some basic tests for nbgrader fetch
Python
bsd-3-clause
modulexcite/nbgrader,jupyter/nbgrader,MatKallada/nbgrader,alope107/nbgrader,modulexcite/nbgrader,dementrock/nbgrader,alope107/nbgrader,EdwardJKim/nbgrader,jhamrick/nbgrader,jhamrick/nbgrader,jhamrick/nbgrader,jupyter/nbgrader,EdwardJKim/nbgrader,ellisonbg/nbgrader,jupyter/nbgrader,jhamrick/nbgrader,EdwardJKim/nbgrader,...
import os from nbgrader.tests import run_command from nbgrader.tests.apps.base import BaseTestApp class TestNbGraderFetch(BaseTestApp): def _fetch(self, assignment, exchange, flags="", retcode=0): run_command( 'nbgrader fetch abc101 {} ' '--TransferApp.exchange_directory={} ' ...
Add some basic tests for nbgrader fetch from nbgrader.tests import run_command from nbgrader.tests.apps.base import BaseTestApp class TestNbGraderFetch(BaseTestApp): def test_help(self): """Does the help display without error?""" run_command("nbgrader fetch --help-all")
bc95ab06932378b3befe1c5628735f25a2807b14
utils.py
utils.py
from google.appengine.api import users from model import User def create_user(google_user): user = User( google_user=google_user, ) user.put() return user def get_current_user_model(): return get_user_model_for(users.get_current_user()) def get_user_model_for(google_user=None): return...
from google.appengine.api import users from model import User def create_user(google_user): user = User( google_user=google_user ) user.put() return user def get_current_user_model(): return get_user_model_for(users.get_current_user()) def get_user_model_for(google_user=None): return ...
Fix potential issue when creating users
Fix potential issue when creating users
Python
mit
studyindenmark/newscontrol,youtify/newscontrol,studyindenmark/newscontrol,youtify/newscontrol
from google.appengine.api import users from model import User def create_user(google_user): user = User( google_user=google_user ) user.put() return user def get_current_user_model(): return get_user_model_for(users.get_current_user()) def get_user_model_for(google_user=None): return ...
Fix potential issue when creating users from google.appengine.api import users from model import User def create_user(google_user): user = User( google_user=google_user, ) user.put() return user def get_current_user_model(): return get_user_model_for(users.get_current_user()) def get_user...
199b3b2d95c7ada67a0b3c49abe9b6347266c0eb
codefett/users/serializers.py
codefett/users/serializers.py
from rest_framework import serializers from .models import CFUser class CFUserSerializer(serializers.ModelSerializer): """ Serializes a CFUser Model """ user__password = serializers.CharField(write_only=True, required=False) class Meta: model = CFUser fields = ('id', 'user__email'...
from django.contrib.auth import update_session_auth_hash from rest_framework import serializers from .models import CFUser class CFUserSerializer(serializers.ModelSerializer): """ Serializes a CFUser Model """ password = serializers.CharField(write_only=True, required=False) confirm_password = ser...
Complete update method of User Serializer
Complete update method of User Serializer
Python
agpl-3.0
Rulox/codefett,Rulox/codefett,Rulox/codefett
from django.contrib.auth import update_session_auth_hash from rest_framework import serializers from .models import CFUser class CFUserSerializer(serializers.ModelSerializer): """ Serializes a CFUser Model """ password = serializers.CharField(write_only=True, required=False) confirm_password = ser...
Complete update method of User Serializer from rest_framework import serializers from .models import CFUser class CFUserSerializer(serializers.ModelSerializer): """ Serializes a CFUser Model """ user__password = serializers.CharField(write_only=True, required=False) class Meta: model = C...
294b305aa7e0c78c72d4eac87ded476425873b62
src/inbox/server/basicauth.py
src/inbox/server/basicauth.py
# TODO perhaps move this to normal auth module... import getpass AUTH_TYPES = {'Gmail': 'OAuth', 'Yahoo': 'Password', 'EAS': 'Password'} class AuthError(Exception): pass def password_auth(email_address): pw = getpass.getpass('Password for %s (hidden): ' % email_address) if len(pw) <= 0: raise ...
# TODO perhaps move this to normal auth module... import getpass AUTH_TYPES = {'Gmail': 'OAuth', 'Yahoo': 'Password', 'EAS': 'Password'} message = 'Password for {0}(hidden): ' class AuthError(Exception): pass def password_auth(email_address, message=message): pw = getpass.getpass(message.format(email_addre...
Change for EAS invalid pw case, to allow user to re-enter pw once before raising error.
Change for EAS invalid pw case, to allow user to re-enter pw once before raising error. Summary: One line change in password_auth to allow password re-rentry. See D106 too Test Plan: None Reviewers: mg Differential Revision: https://review.inboxapp.com/D107
Python
agpl-3.0
ErinCall/sync-engine,ErinCall/sync-engine,ErinCall/sync-engine,wakermahmud/sync-engine,Eagles2F/sync-engine,wakermahmud/sync-engine,EthanBlackburn/sync-engine,PriviPK/privipk-sync-engine,rmasters/inbox,closeio/nylas,EthanBlackburn/sync-engine,Eagles2F/sync-engine,jobscore/sync-engine,Eagles2F/sync-engine,jobscore/sync-...
# TODO perhaps move this to normal auth module... import getpass AUTH_TYPES = {'Gmail': 'OAuth', 'Yahoo': 'Password', 'EAS': 'Password'} message = 'Password for {0}(hidden): ' class AuthError(Exception): pass def password_auth(email_address, message=message): pw = getpass.getpass(message.format(email_addre...
Change for EAS invalid pw case, to allow user to re-enter pw once before raising error. Summary: One line change in password_auth to allow password re-rentry. See D106 too Test Plan: None Reviewers: mg Differential Revision: https://review.inboxapp.com/D107 # TODO perhaps move this to normal auth module... import ...
daca419af5f75443a09c6897e968c4af158412c1
tempest/tests/services/compute/test_migrations_client.py
tempest/tests/services/compute/test_migrations_client.py
# Copyright 2015 NEC Corporation. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
Add unit tests for migrations_client
Add unit tests for migrations_client This patch adds unit tests for migrations_client. Change-Id: I9bb9556d9c9b821c55c97f57dd783c00e5a05e04
Python
apache-2.0
vedujoshi/tempest,flyingfish007/tempest,LIS/lis-tempest,cisco-openstack/tempest,openstack/tempest,masayukig/tempest,openstack/tempest,tonyli71/tempest,bigswitch/tempest,sebrandon1/tempest,izadorozhna/tempest,sebrandon1/tempest,bigswitch/tempest,tonyli71/tempest,flyingfish007/tempest,zsoltdudas/lis-tempest,Juniper/tempe...
# Copyright 2015 NEC Corporation. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
Add unit tests for migrations_client This patch adds unit tests for migrations_client. Change-Id: I9bb9556d9c9b821c55c97f57dd783c00e5a05e04
60f88e2e90ff411f121236a0e44100ca2022f9bb
test_sequencer.py
test_sequencer.py
def run(tests): print '=> Going to run', len(tests), 'tests' ok = [] fail = [] for number, test in enumerate(tests): print '\t-> [' + str(number) + '/' + str(len(tests)) + ']', test.__doc__ error = test() if error is None: ok.append((number, test)) else: ...
import sys # "Test" is a function. It takes no arguments and returns any encountered errors. # If there is no error, test should return 'None'. Tests shouldn't have any dependencies # amongst themselves. def run(tests): """If no arguments (sys.argv) are given, runs tests. If there are any arguments they are ...
Use formatted strings, add tests filter
Use formatted strings, add tests filter
Python
mit
fmfi-svt-deadlock/hw-testing,fmfi-svt-deadlock/hw-testing
import sys # "Test" is a function. It takes no arguments and returns any encountered errors. # If there is no error, test should return 'None'. Tests shouldn't have any dependencies # amongst themselves. def run(tests): """If no arguments (sys.argv) are given, runs tests. If there are any arguments they are ...
Use formatted strings, add tests filter def run(tests): print '=> Going to run', len(tests), 'tests' ok = [] fail = [] for number, test in enumerate(tests): print '\t-> [' + str(number) + '/' + str(len(tests)) + ']', test.__doc__ error = test() if error is None: ok.a...
698273ac6863eeaa3963c84fac6a49a918cc261b
freelancefinder/freelancefinder/tests/test_xforwardedfor_middleware.py
freelancefinder/freelancefinder/tests/test_xforwardedfor_middleware.py
"""Test the X-Forwarded-For middleware.""" from ..middleware.xforwardedfor import xforwardedfor def get_response_method(thing): """Do nothing.""" return thing def test_setting_correctly(rf): """Override REMOTE_ADDR if HTTP_X_FORWARDED_FOR is present.""" request = rf.get('/') request.META['REMOT...
Add tests for xforwardedfor middleware
Add tests for xforwardedfor middleware
Python
bsd-3-clause
ScorpionResponse/freelancefinder,ScorpionResponse/freelancefinder,ScorpionResponse/freelancefinder
"""Test the X-Forwarded-For middleware.""" from ..middleware.xforwardedfor import xforwardedfor def get_response_method(thing): """Do nothing.""" return thing def test_setting_correctly(rf): """Override REMOTE_ADDR if HTTP_X_FORWARDED_FOR is present.""" request = rf.get('/') request.META['REMOT...
Add tests for xforwardedfor middleware
4374eb9cf20350f1d5610bfbae358dbb733bb044
python/subnets-in-cidr.py
python/subnets-in-cidr.py
#!/usr/bin/python import argparse import netaddr import os import infoblox_netmri parser = argparse.ArgumentParser() parser.add_argument("cidr") args = parser.parse_args() print("Searching for subnets in %s." % args.cidr) url = os.environ['NETMRI_API_URL'] user = os.environ['NETMRI_USER'] password = os.environ['N...
Add a sample script for searching subnets in a CIDR
Add a sample script for searching subnets in a CIDR See request in community: https://community.infoblox.com/t5/Network-Change-Configuration/Anyone-ha ve-an-Example-NetMRI-REST-call-using-filters-in-Python/m-p/5021#M1430
Python
mit
infobloxopen/netmri-toolkit,infobloxopen/netmri-toolkit,infobloxopen/netmri-toolkit
#!/usr/bin/python import argparse import netaddr import os import infoblox_netmri parser = argparse.ArgumentParser() parser.add_argument("cidr") args = parser.parse_args() print("Searching for subnets in %s." % args.cidr) url = os.environ['NETMRI_API_URL'] user = os.environ['NETMRI_USER'] password = os.environ['N...
Add a sample script for searching subnets in a CIDR See request in community: https://community.infoblox.com/t5/Network-Change-Configuration/Anyone-ha ve-an-Example-NetMRI-REST-call-using-filters-in-Python/m-p/5021#M1430
4927a1c29d258b1ab7c70ffecff6904b808480eb
bokeh/validation/warnings.py
bokeh/validation/warnings.py
''' Define standard warning codes and messages for Bokeh validation checks. 1000 : *MISSING_RENDERERS* A |Plot| object has no renderers configured (will result in a blank plot). 1001 : *NO_GLYPH_RENDERERS* A |Plot| object has no glyph renderers (will result in an empty plot frame). 1002 : *EMPTY_LAYOUT* ...
''' Define standard warning codes and messages for Bokeh validation checks. 1000 : *MISSING_RENDERERS* A |Plot| object has no renderers configured (will result in a blank plot). 1001 : *NO_GLYPH_RENDERERS* A |Plot| object has no glyph renderers (will result in an empty plot frame). 1002 : *EMPTY_LAYOUT* ...
Add module level documentation for colon warning
Add module level documentation for colon warning
Python
bsd-3-clause
ericmjl/bokeh,timsnyder/bokeh,draperjames/bokeh,philippjfr/bokeh,mindriot101/bokeh,aavanian/bokeh,aavanian/bokeh,phobson/bokeh,daodaoliang/bokeh,KasperPRasmussen/bokeh,rothnic/bokeh,dennisobrien/bokeh,phobson/bokeh,DuCorey/bokeh,timsnyder/bokeh,jplourenco/bokeh,ericdill/bokeh,srinathv/bokeh,bokeh/bokeh,srinathv/bokeh,j...
''' Define standard warning codes and messages for Bokeh validation checks. 1000 : *MISSING_RENDERERS* A |Plot| object has no renderers configured (will result in a blank plot). 1001 : *NO_GLYPH_RENDERERS* A |Plot| object has no glyph renderers (will result in an empty plot frame). 1002 : *EMPTY_LAYOUT* ...
Add module level documentation for colon warning ''' Define standard warning codes and messages for Bokeh validation checks. 1000 : *MISSING_RENDERERS* A |Plot| object has no renderers configured (will result in a blank plot). 1001 : *NO_GLYPH_RENDERERS* A |Plot| object has no glyph renderers (will result in...
0b7636422c632172dfc68ea2a5f21ec649248c8c
nimp/commands/vs_build.py
nimp/commands/vs_build.py
# -*- coding: utf-8 -*- from nimp.commands._command import * from nimp.utilities.build import * #------------------------------------------------------------------------------- class VsBuildCommand(Command): def __init__(self): Command.__init__(self, 'vs-build', 'Builds a Visual Studio project') #--...
# -*- coding: utf-8 -*- from nimp.commands._command import * from nimp.utilities.build import * #------------------------------------------------------------------------------- class VsBuildCommand(Command): def __init__(self): Command.__init__(self, 'vs-build', 'Builds a Visual Studio project') #--...
Use separate variable names for Visual Studio config/platform.
Use separate variable names for Visual Studio config/platform.
Python
mit
dontnod/nimp
# -*- coding: utf-8 -*- from nimp.commands._command import * from nimp.utilities.build import * #------------------------------------------------------------------------------- class VsBuildCommand(Command): def __init__(self): Command.__init__(self, 'vs-build', 'Builds a Visual Studio project') #--...
Use separate variable names for Visual Studio config/platform. # -*- coding: utf-8 -*- from nimp.commands._command import * from nimp.utilities.build import * #------------------------------------------------------------------------------- class VsBuildCommand(Command): def __init__(self): Command.__ini...
39e561b2675649279cbff4aa457216d12072160b
paws/request.py
paws/request.py
from Cookie import SimpleCookie from urlparse import parse_qs from utils import MultiDict, cached_property class Request(object): def __init__(self, event, context): self.event = event self.context = context @property def method(self): return self.event['httpMethod'] @proper...
from Cookie import SimpleCookie from urlparse import parse_qs from utils import MultiDict, cached_property class Request(object): def __init__(self, event, context): self.event = event self.context = context @property def method(self): return self.event['httpMethod'] @proper...
Use more sensible name for post data
Use more sensible name for post data
Python
bsd-3-clause
funkybob/paws
from Cookie import SimpleCookie from urlparse import parse_qs from utils import MultiDict, cached_property class Request(object): def __init__(self, event, context): self.event = event self.context = context @property def method(self): return self.event['httpMethod'] @proper...
Use more sensible name for post data from Cookie import SimpleCookie from urlparse import parse_qs from utils import MultiDict, cached_property class Request(object): def __init__(self, event, context): self.event = event self.context = context @property def method(self): return...