commit stringlengths 40 40 | old_file stringlengths 4 118 | new_file stringlengths 4 118 | old_contents stringlengths 0 2.94k | new_contents stringlengths 1 4.43k | subject stringlengths 15 444 | message stringlengths 16 3.45k | lang stringclasses 1
value | license stringclasses 13
values | repos stringlengths 5 43.2k | prompt stringlengths 17 4.58k | response stringlengths 1 4.43k | prompt_tagged stringlengths 58 4.62k | response_tagged stringlengths 1 4.43k | text stringlengths 132 7.29k | text_tagged stringlengths 173 7.33k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
65574a215e60811bb023edf3cc6a7bfb6ff201a1 | tiddlywebwiki/manage.py | tiddlywebwiki/manage.py | """
TiddlyWebWiki-specific twanager commands
"""
from tiddlyweb.store import Store
from tiddlyweb.manage import make_command, usage
from tiddlywebwiki.tiddlywiki import import_wiki_file
from tiddlywebwiki.importer import import_list
def init(config):
@make_command()
def update(args):
"""Update all ... | """
TiddlyWebWiki-specific twanager commands
"""
from tiddlyweb.store import Store
from tiddlyweb.manage import make_command, usage
from tiddlywebwiki.tiddlywiki import import_wiki_file
from tiddlywebwiki.importer import import_list
def init(config):
@make_command()
def update(args):
"""Update all ... | Update the docs on twimport and imwiki to indicate that imwiki is deprecated. | Update the docs on twimport and imwiki to indicate that imwiki is deprecated.
| Python | bsd-3-clause | tiddlyweb/tiddlywebwiki,tiddlyweb/tiddlywebwiki,tiddlyweb/tiddlywebwiki | """
TiddlyWebWiki-specific twanager commands
"""
from tiddlyweb.store import Store
from tiddlyweb.manage import make_command, usage
from tiddlywebwiki.tiddlywiki import import_wiki_file
from tiddlywebwiki.importer import import_list
def init(config):
@make_command()
def update(args):
"""Update all ... | """
TiddlyWebWiki-specific twanager commands
"""
from tiddlyweb.store import Store
from tiddlyweb.manage import make_command, usage
from tiddlywebwiki.tiddlywiki import import_wiki_file
from tiddlywebwiki.importer import import_list
def init(config):
@make_command()
def update(args):
"""Update all ... | <commit_before>"""
TiddlyWebWiki-specific twanager commands
"""
from tiddlyweb.store import Store
from tiddlyweb.manage import make_command, usage
from tiddlywebwiki.tiddlywiki import import_wiki_file
from tiddlywebwiki.importer import import_list
def init(config):
@make_command()
def update(args):
... | """
TiddlyWebWiki-specific twanager commands
"""
from tiddlyweb.store import Store
from tiddlyweb.manage import make_command, usage
from tiddlywebwiki.tiddlywiki import import_wiki_file
from tiddlywebwiki.importer import import_list
def init(config):
@make_command()
def update(args):
"""Update all ... | """
TiddlyWebWiki-specific twanager commands
"""
from tiddlyweb.store import Store
from tiddlyweb.manage import make_command, usage
from tiddlywebwiki.tiddlywiki import import_wiki_file
from tiddlywebwiki.importer import import_list
def init(config):
@make_command()
def update(args):
"""Update all ... | <commit_before>"""
TiddlyWebWiki-specific twanager commands
"""
from tiddlyweb.store import Store
from tiddlyweb.manage import make_command, usage
from tiddlywebwiki.tiddlywiki import import_wiki_file
from tiddlywebwiki.importer import import_list
def init(config):
@make_command()
def update(args):
... |
e70f30758a501db12af4fbbfc4204e2858967c8b | conllu/compat.py | conllu/compat.py | try:
from io import StringIO
except ImportError:
from StringIO import StringIO
try:
from contextlib import redirect_stdout
except ImportError:
import sys
import contextlib
@contextlib.contextmanager
def redirect_stdout(target):
original = sys.stdout
sys.stdout = target
... | try:
from io import StringIO
except ImportError:
from StringIO import StringIO
try:
from contextlib import redirect_stdout
except ImportError:
import sys
import contextlib
@contextlib.contextmanager
def redirect_stdout(target):
original = sys.stdout
sys.stdout = target
... | Make fullmatch work on python 2.7. | Bug: Make fullmatch work on python 2.7.
| Python | mit | EmilStenstrom/conllu | try:
from io import StringIO
except ImportError:
from StringIO import StringIO
try:
from contextlib import redirect_stdout
except ImportError:
import sys
import contextlib
@contextlib.contextmanager
def redirect_stdout(target):
original = sys.stdout
sys.stdout = target
... | try:
from io import StringIO
except ImportError:
from StringIO import StringIO
try:
from contextlib import redirect_stdout
except ImportError:
import sys
import contextlib
@contextlib.contextmanager
def redirect_stdout(target):
original = sys.stdout
sys.stdout = target
... | <commit_before>try:
from io import StringIO
except ImportError:
from StringIO import StringIO
try:
from contextlib import redirect_stdout
except ImportError:
import sys
import contextlib
@contextlib.contextmanager
def redirect_stdout(target):
original = sys.stdout
sys.stdou... | try:
from io import StringIO
except ImportError:
from StringIO import StringIO
try:
from contextlib import redirect_stdout
except ImportError:
import sys
import contextlib
@contextlib.contextmanager
def redirect_stdout(target):
original = sys.stdout
sys.stdout = target
... | try:
from io import StringIO
except ImportError:
from StringIO import StringIO
try:
from contextlib import redirect_stdout
except ImportError:
import sys
import contextlib
@contextlib.contextmanager
def redirect_stdout(target):
original = sys.stdout
sys.stdout = target
... | <commit_before>try:
from io import StringIO
except ImportError:
from StringIO import StringIO
try:
from contextlib import redirect_stdout
except ImportError:
import sys
import contextlib
@contextlib.contextmanager
def redirect_stdout(target):
original = sys.stdout
sys.stdou... |
e12e40ea368dc9027e63474c45b43da42accaf67 | pyconcz_2016/settings_dev.py | pyconcz_2016/settings_dev.py | from .settings import *
DEBUG = True
SECRET_KEY = 42
INTERNAL_IPS = ['127.0.0.1']
CSRF_COOKIE_SECURE = False
SESSION_COOKIE_SECURE = False
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'db.sqlite3',
}
}
WEBPACK_LOADER['DEFAULT']['STATS_FILE'] = (
os.path.join... | from .settings import *
DEBUG = True
SECRET_KEY = 42
INTERNAL_IPS = ['127.0.0.1']
CSRF_COOKIE_SECURE = False
SESSION_COOKIE_SECURE = False
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'db.sqlite3',
}
}
WEBPACK_STATS = os.path.join(BASE_DIR, 'static_build', 'web... | Allow local development without running webpack | Allow local development without running webpack
| Python | mit | benabraham/cz.pycon.org-2017,benabraham/cz.pycon.org-2017,pyvec/cz.pycon.org-2016,pyvec/cz.pycon.org-2016,pyvec/cz.pycon.org-2017,benabraham/cz.pycon.org-2017,pyvec/cz.pycon.org-2017,pyvec/cz.pycon.org-2016,pyvec/cz.pycon.org-2017 | from .settings import *
DEBUG = True
SECRET_KEY = 42
INTERNAL_IPS = ['127.0.0.1']
CSRF_COOKIE_SECURE = False
SESSION_COOKIE_SECURE = False
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'db.sqlite3',
}
}
WEBPACK_LOADER['DEFAULT']['STATS_FILE'] = (
os.path.join... | from .settings import *
DEBUG = True
SECRET_KEY = 42
INTERNAL_IPS = ['127.0.0.1']
CSRF_COOKIE_SECURE = False
SESSION_COOKIE_SECURE = False
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'db.sqlite3',
}
}
WEBPACK_STATS = os.path.join(BASE_DIR, 'static_build', 'web... | <commit_before>from .settings import *
DEBUG = True
SECRET_KEY = 42
INTERNAL_IPS = ['127.0.0.1']
CSRF_COOKIE_SECURE = False
SESSION_COOKIE_SECURE = False
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'db.sqlite3',
}
}
WEBPACK_LOADER['DEFAULT']['STATS_FILE'] = (
... | from .settings import *
DEBUG = True
SECRET_KEY = 42
INTERNAL_IPS = ['127.0.0.1']
CSRF_COOKIE_SECURE = False
SESSION_COOKIE_SECURE = False
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'db.sqlite3',
}
}
WEBPACK_STATS = os.path.join(BASE_DIR, 'static_build', 'web... | from .settings import *
DEBUG = True
SECRET_KEY = 42
INTERNAL_IPS = ['127.0.0.1']
CSRF_COOKIE_SECURE = False
SESSION_COOKIE_SECURE = False
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'db.sqlite3',
}
}
WEBPACK_LOADER['DEFAULT']['STATS_FILE'] = (
os.path.join... | <commit_before>from .settings import *
DEBUG = True
SECRET_KEY = 42
INTERNAL_IPS = ['127.0.0.1']
CSRF_COOKIE_SECURE = False
SESSION_COOKIE_SECURE = False
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'db.sqlite3',
}
}
WEBPACK_LOADER['DEFAULT']['STATS_FILE'] = (
... |
56e45a5146cfcde797be5cb8d3c52a1fbf874d88 | user_clipboard/forms.py | user_clipboard/forms.py | from django import forms
from .models import Clipboard
class ClipboardFileForm(forms.ModelForm):
class Meta:
model = Clipboard
fields = ('file',)
def save(self, commit=True):
# Delete old file before saving the new one
if self.instance.pk:
old_instance = self._met... | from django import forms
from .models import Clipboard
class BaseClipboardForm(object):
def save(self, commit=True):
# Delete old file before saving the new one
if self.instance.pk:
old_instance = self._meta.model.objects.get(pk=self.instance.pk)
old_instance.file.delete(s... | Create BaseClipboardForm for easy extending if needed | Create BaseClipboardForm for easy extending if needed | Python | mit | IndustriaTech/django-user-clipboard,MagicSolutions/django-user-clipboard,IndustriaTech/django-user-clipboard,MagicSolutions/django-user-clipboard | from django import forms
from .models import Clipboard
class ClipboardFileForm(forms.ModelForm):
class Meta:
model = Clipboard
fields = ('file',)
def save(self, commit=True):
# Delete old file before saving the new one
if self.instance.pk:
old_instance = self._met... | from django import forms
from .models import Clipboard
class BaseClipboardForm(object):
def save(self, commit=True):
# Delete old file before saving the new one
if self.instance.pk:
old_instance = self._meta.model.objects.get(pk=self.instance.pk)
old_instance.file.delete(s... | <commit_before>from django import forms
from .models import Clipboard
class ClipboardFileForm(forms.ModelForm):
class Meta:
model = Clipboard
fields = ('file',)
def save(self, commit=True):
# Delete old file before saving the new one
if self.instance.pk:
old_insta... | from django import forms
from .models import Clipboard
class BaseClipboardForm(object):
def save(self, commit=True):
# Delete old file before saving the new one
if self.instance.pk:
old_instance = self._meta.model.objects.get(pk=self.instance.pk)
old_instance.file.delete(s... | from django import forms
from .models import Clipboard
class ClipboardFileForm(forms.ModelForm):
class Meta:
model = Clipboard
fields = ('file',)
def save(self, commit=True):
# Delete old file before saving the new one
if self.instance.pk:
old_instance = self._met... | <commit_before>from django import forms
from .models import Clipboard
class ClipboardFileForm(forms.ModelForm):
class Meta:
model = Clipboard
fields = ('file',)
def save(self, commit=True):
# Delete old file before saving the new one
if self.instance.pk:
old_insta... |
e05ea934335eac29c0b2f164eab600008546324c | recurring_contract/migrations/1.2/post-migration.py | recurring_contract/migrations/1.2/post-migration.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Coninckx David <[email protected]>
#
# The licence is in the file __ope... | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Coninckx David <[email protected]>
#
# The licence is in the file __ope... | Remove wrong migration of contracts. | Remove wrong migration of contracts.
| Python | agpl-3.0 | CompassionCH/compassion-accounting,ndtran/compassion-accounting,ndtran/compassion-accounting,ecino/compassion-accounting,ecino/compassion-accounting,CompassionCH/compassion-accounting,ndtran/compassion-accounting | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Coninckx David <[email protected]>
#
# The licence is in the file __ope... | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Coninckx David <[email protected]>
#
# The licence is in the file __ope... | <commit_before># -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Coninckx David <[email protected]>
#
# The licence is in... | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Coninckx David <[email protected]>
#
# The licence is in the file __ope... | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Coninckx David <[email protected]>
#
# The licence is in the file __ope... | <commit_before># -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Coninckx David <[email protected]>
#
# The licence is in... |
d1d66c37419a85a4258f37201261d76a8f6a9e03 | ckeditor/fields.py | ckeditor/fields.py | from django.db import models
from django import forms
from ckeditor.widgets import CKEditorWidget
class RichTextField(models.TextField):
def __init__(self, *args, **kwargs):
self.config_name = kwargs.pop("config_name", "default")
super(RichTextField, self).__init__(*args, **kwargs)
def formf... | from django.db import models
from django import forms
from ckeditor.widgets import CKEditorWidget
class RichTextField(models.TextField):
def __init__(self, *args, **kwargs):
self.config_name = kwargs.pop("config_name", "default")
super(RichTextField, self).__init__(*args, **kwargs)
def formf... | Fix Function RichTextFormField now received a new parameter max_lenght for django 1.7 | Fix Function RichTextFormField now received a new parameter max_lenght for django 1.7
| Python | bsd-3-clause | gian88/django-ckeditor-amazon-s3,gian88/django-ckeditor-amazon-s3,gian88/django-ckeditor-amazon-s3,gian88/django-ckeditor-amazon-s3,gian88/django-ckeditor-amazon-s3,gian88/django-ckeditor-amazon-s3 | from django.db import models
from django import forms
from ckeditor.widgets import CKEditorWidget
class RichTextField(models.TextField):
def __init__(self, *args, **kwargs):
self.config_name = kwargs.pop("config_name", "default")
super(RichTextField, self).__init__(*args, **kwargs)
def formf... | from django.db import models
from django import forms
from ckeditor.widgets import CKEditorWidget
class RichTextField(models.TextField):
def __init__(self, *args, **kwargs):
self.config_name = kwargs.pop("config_name", "default")
super(RichTextField, self).__init__(*args, **kwargs)
def formf... | <commit_before>from django.db import models
from django import forms
from ckeditor.widgets import CKEditorWidget
class RichTextField(models.TextField):
def __init__(self, *args, **kwargs):
self.config_name = kwargs.pop("config_name", "default")
super(RichTextField, self).__init__(*args, **kwargs)... | from django.db import models
from django import forms
from ckeditor.widgets import CKEditorWidget
class RichTextField(models.TextField):
def __init__(self, *args, **kwargs):
self.config_name = kwargs.pop("config_name", "default")
super(RichTextField, self).__init__(*args, **kwargs)
def formf... | from django.db import models
from django import forms
from ckeditor.widgets import CKEditorWidget
class RichTextField(models.TextField):
def __init__(self, *args, **kwargs):
self.config_name = kwargs.pop("config_name", "default")
super(RichTextField, self).__init__(*args, **kwargs)
def formf... | <commit_before>from django.db import models
from django import forms
from ckeditor.widgets import CKEditorWidget
class RichTextField(models.TextField):
def __init__(self, *args, **kwargs):
self.config_name = kwargs.pop("config_name", "default")
super(RichTextField, self).__init__(*args, **kwargs)... |
b72c9a26c00ca31966be3ae8b529e9272d300290 | __main__.py | __main__.py | import sys
import argparse
from . import parse
from . import compile
from . import runtime
from .interactive import Interactive
class Interactive (Interactive):
def __init__(self, args):
super().__init__()
self.args = args
self.single = sys.stdin.isatty() or args.print
def displ... | import sys
import argparse
from . import parse
from . import compile
from . import runtime
from .interactive import Interactive
class Interactive (Interactive):
def __init__(self, args):
super().__init__()
self.args = args
def traceback(self, trace):
# When running in non-interac... | Remove the -p command-line option. | Remove the -p command-line option.
It's pretty useless anyway. Use instead.
| Python | mit | pyos/dg | import sys
import argparse
from . import parse
from . import compile
from . import runtime
from .interactive import Interactive
class Interactive (Interactive):
def __init__(self, args):
super().__init__()
self.args = args
self.single = sys.stdin.isatty() or args.print
def displ... | import sys
import argparse
from . import parse
from . import compile
from . import runtime
from .interactive import Interactive
class Interactive (Interactive):
def __init__(self, args):
super().__init__()
self.args = args
def traceback(self, trace):
# When running in non-interac... | <commit_before>import sys
import argparse
from . import parse
from . import compile
from . import runtime
from .interactive import Interactive
class Interactive (Interactive):
def __init__(self, args):
super().__init__()
self.args = args
self.single = sys.stdin.isatty() or args.print... | import sys
import argparse
from . import parse
from . import compile
from . import runtime
from .interactive import Interactive
class Interactive (Interactive):
def __init__(self, args):
super().__init__()
self.args = args
def traceback(self, trace):
# When running in non-interac... | import sys
import argparse
from . import parse
from . import compile
from . import runtime
from .interactive import Interactive
class Interactive (Interactive):
def __init__(self, args):
super().__init__()
self.args = args
self.single = sys.stdin.isatty() or args.print
def displ... | <commit_before>import sys
import argparse
from . import parse
from . import compile
from . import runtime
from .interactive import Interactive
class Interactive (Interactive):
def __init__(self, args):
super().__init__()
self.args = args
self.single = sys.stdin.isatty() or args.print... |
5d8a37cdbd41af594f03d78092b78a22afc53c05 | __main__.py | __main__.py | #!/usr/bin/env python
import argparse
from githublist.parser import main as get_data
from githublist.serve import serve_content
parser = argparse.ArgumentParser(description='View repositories for any GitHub account.')
parser.add_argument('user', type=str, help='GitHub user handle')
parser.add_argument('-f', '--forma... | #!/usr/bin/env python
import argparse
from githublist.parser import main as get_data
from githublist.serve import serve_content
parser = argparse.ArgumentParser(description='View repositories for any GitHub account.')
parser.add_argument('user', type=str, nargs='+', help='GitHub user handle')
parser.add_argument('-f... | Add support for multiple users, format types | Add support for multiple users, format types
| Python | mit | kshvmdn/github-list,kshvmdn/github-list,kshvmdn/github-list | #!/usr/bin/env python
import argparse
from githublist.parser import main as get_data
from githublist.serve import serve_content
parser = argparse.ArgumentParser(description='View repositories for any GitHub account.')
parser.add_argument('user', type=str, help='GitHub user handle')
parser.add_argument('-f', '--forma... | #!/usr/bin/env python
import argparse
from githublist.parser import main as get_data
from githublist.serve import serve_content
parser = argparse.ArgumentParser(description='View repositories for any GitHub account.')
parser.add_argument('user', type=str, nargs='+', help='GitHub user handle')
parser.add_argument('-f... | <commit_before>#!/usr/bin/env python
import argparse
from githublist.parser import main as get_data
from githublist.serve import serve_content
parser = argparse.ArgumentParser(description='View repositories for any GitHub account.')
parser.add_argument('user', type=str, help='GitHub user handle')
parser.add_argument... | #!/usr/bin/env python
import argparse
from githublist.parser import main as get_data
from githublist.serve import serve_content
parser = argparse.ArgumentParser(description='View repositories for any GitHub account.')
parser.add_argument('user', type=str, nargs='+', help='GitHub user handle')
parser.add_argument('-f... | #!/usr/bin/env python
import argparse
from githublist.parser import main as get_data
from githublist.serve import serve_content
parser = argparse.ArgumentParser(description='View repositories for any GitHub account.')
parser.add_argument('user', type=str, help='GitHub user handle')
parser.add_argument('-f', '--forma... | <commit_before>#!/usr/bin/env python
import argparse
from githublist.parser import main as get_data
from githublist.serve import serve_content
parser = argparse.ArgumentParser(description='View repositories for any GitHub account.')
parser.add_argument('user', type=str, help='GitHub user handle')
parser.add_argument... |
7dd94bf965fafafb279a4304108462e4060c729c | waterbutler/identity.py | waterbutler/identity.py | import asyncio
from waterbutler import settings
@asyncio.coroutine
def fetch_rest_identity(params):
response = yield from aiohttp.request(
'get',
settings.IDENTITY_API_URL,
params=params,
headers={'Content-Type': 'application/json'},
)
# TOOD Handle Errors nicely
if r... | import asyncio
import aiohttp
from waterbutler import settings
IDENTITY_METHODS = {}
def get_identity_func(name):
try:
return IDENTITY_METHODS[name]
except KeyError:
raise NotImplementedError('No identity getter for {0}'.format(name))
def register_identity(name):
def _register_identi... | Make use of a register decorator | Make use of a register decorator
| Python | apache-2.0 | Johnetordoff/waterbutler,RCOSDP/waterbutler,cosenal/waterbutler,rafaeldelucena/waterbutler,TomBaxter/waterbutler,icereval/waterbutler,chrisseto/waterbutler,Ghalko/waterbutler,rdhyee/waterbutler,CenterForOpenScience/waterbutler,hmoco/waterbutler,felliott/waterbutler,kwierman/waterbutler | import asyncio
from waterbutler import settings
@asyncio.coroutine
def fetch_rest_identity(params):
response = yield from aiohttp.request(
'get',
settings.IDENTITY_API_URL,
params=params,
headers={'Content-Type': 'application/json'},
)
# TOOD Handle Errors nicely
if r... | import asyncio
import aiohttp
from waterbutler import settings
IDENTITY_METHODS = {}
def get_identity_func(name):
try:
return IDENTITY_METHODS[name]
except KeyError:
raise NotImplementedError('No identity getter for {0}'.format(name))
def register_identity(name):
def _register_identi... | <commit_before>import asyncio
from waterbutler import settings
@asyncio.coroutine
def fetch_rest_identity(params):
response = yield from aiohttp.request(
'get',
settings.IDENTITY_API_URL,
params=params,
headers={'Content-Type': 'application/json'},
)
# TOOD Handle Errors ... | import asyncio
import aiohttp
from waterbutler import settings
IDENTITY_METHODS = {}
def get_identity_func(name):
try:
return IDENTITY_METHODS[name]
except KeyError:
raise NotImplementedError('No identity getter for {0}'.format(name))
def register_identity(name):
def _register_identi... | import asyncio
from waterbutler import settings
@asyncio.coroutine
def fetch_rest_identity(params):
response = yield from aiohttp.request(
'get',
settings.IDENTITY_API_URL,
params=params,
headers={'Content-Type': 'application/json'},
)
# TOOD Handle Errors nicely
if r... | <commit_before>import asyncio
from waterbutler import settings
@asyncio.coroutine
def fetch_rest_identity(params):
response = yield from aiohttp.request(
'get',
settings.IDENTITY_API_URL,
params=params,
headers={'Content-Type': 'application/json'},
)
# TOOD Handle Errors ... |
dd8176f26addcf36419f1723448ab1e3ae8d0e89 | metashare/repository/search_fields.py | metashare/repository/search_fields.py | """
Project: META-SHARE prototype implementation
Author: Christian Spurk <[email protected]>
"""
from haystack.exceptions import SearchFieldError
from haystack.indexes import SearchField, CharField, MultiValueField
class LabeledField(SearchField):
"""
A kind of mixin class for creating `SearchField`s with a labe... | """
Project: META-SHARE prototype implementation
Author: Christian Spurk <[email protected]>
"""
from haystack.exceptions import SearchFieldError
from haystack.indexes import SearchField, CharField, MultiValueField
class LabeledField(SearchField):
"""
A kind of mixin class for creating `SearchField`s with a labe... | Order facets and add sub facet feature | Order facets and add sub facet feature
| Python | bsd-3-clause | MiltosD/CEF-ELRC,JuliBakagianni/CEF-ELRC,MiltosD/CEFELRC,zeehio/META-SHARE,MiltosD/CEF-ELRC,JuliBakagianni/CEF-ELRC,MiltosD/CEFELRC,MiltosD/CEF-ELRC,JuliBakagianni/META-SHARE,MiltosD/CEFELRC,JuliBakagianni/CEF-ELRC,MiltosD/CEFELRC,zeehio/META-SHARE,zeehio/META-SHARE,MiltosD/CEF-ELRC,JuliBakagianni/CEF-ELRC,zeehio/META-... | """
Project: META-SHARE prototype implementation
Author: Christian Spurk <[email protected]>
"""
from haystack.exceptions import SearchFieldError
from haystack.indexes import SearchField, CharField, MultiValueField
class LabeledField(SearchField):
"""
A kind of mixin class for creating `SearchField`s with a labe... | """
Project: META-SHARE prototype implementation
Author: Christian Spurk <[email protected]>
"""
from haystack.exceptions import SearchFieldError
from haystack.indexes import SearchField, CharField, MultiValueField
class LabeledField(SearchField):
"""
A kind of mixin class for creating `SearchField`s with a labe... | <commit_before>"""
Project: META-SHARE prototype implementation
Author: Christian Spurk <[email protected]>
"""
from haystack.exceptions import SearchFieldError
from haystack.indexes import SearchField, CharField, MultiValueField
class LabeledField(SearchField):
"""
A kind of mixin class for creating `SearchFiel... | """
Project: META-SHARE prototype implementation
Author: Christian Spurk <[email protected]>
"""
from haystack.exceptions import SearchFieldError
from haystack.indexes import SearchField, CharField, MultiValueField
class LabeledField(SearchField):
"""
A kind of mixin class for creating `SearchField`s with a labe... | """
Project: META-SHARE prototype implementation
Author: Christian Spurk <[email protected]>
"""
from haystack.exceptions import SearchFieldError
from haystack.indexes import SearchField, CharField, MultiValueField
class LabeledField(SearchField):
"""
A kind of mixin class for creating `SearchField`s with a labe... | <commit_before>"""
Project: META-SHARE prototype implementation
Author: Christian Spurk <[email protected]>
"""
from haystack.exceptions import SearchFieldError
from haystack.indexes import SearchField, CharField, MultiValueField
class LabeledField(SearchField):
"""
A kind of mixin class for creating `SearchFiel... |
7577c51486169e8026a74cd680e2f4b58e4ea60a | models/phase3_eval/process_sparser.py | models/phase3_eval/process_sparser.py | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
import os
import glob
from indra import sparser
base_folder = 'sources/sparser-20170330'
sentences_folder = 'sources/sparser-20170210'
def get_file_names(base_dir):
fnames = glob.glob(os.path.join(base_dir, '*.... | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
import os
import glob
import json
from indra import sparser
from indra.statements import stmts_from_json, get_valid_location, \
get_valid_residue
base_folder = os.environ['HOME'] + \
... | Read and fix Sparser jsons | Read and fix Sparser jsons
| Python | bsd-2-clause | pvtodorov/indra,sorgerlab/belpy,johnbachman/belpy,johnbachman/belpy,bgyori/indra,sorgerlab/indra,sorgerlab/belpy,pvtodorov/indra,sorgerlab/indra,bgyori/indra,johnbachman/belpy,sorgerlab/indra,bgyori/indra,johnbachman/indra,sorgerlab/belpy,pvtodorov/indra,johnbachman/indra,pvtodorov/indra,johnbachman/indra | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
import os
import glob
from indra import sparser
base_folder = 'sources/sparser-20170330'
sentences_folder = 'sources/sparser-20170210'
def get_file_names(base_dir):
fnames = glob.glob(os.path.join(base_dir, '*.... | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
import os
import glob
import json
from indra import sparser
from indra.statements import stmts_from_json, get_valid_location, \
get_valid_residue
base_folder = os.environ['HOME'] + \
... | <commit_before>from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
import os
import glob
from indra import sparser
base_folder = 'sources/sparser-20170330'
sentences_folder = 'sources/sparser-20170210'
def get_file_names(base_dir):
fnames = glob.glob(os.path.joi... | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
import os
import glob
import json
from indra import sparser
from indra.statements import stmts_from_json, get_valid_location, \
get_valid_residue
base_folder = os.environ['HOME'] + \
... | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
import os
import glob
from indra import sparser
base_folder = 'sources/sparser-20170330'
sentences_folder = 'sources/sparser-20170210'
def get_file_names(base_dir):
fnames = glob.glob(os.path.join(base_dir, '*.... | <commit_before>from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
import os
import glob
from indra import sparser
base_folder = 'sources/sparser-20170330'
sentences_folder = 'sources/sparser-20170210'
def get_file_names(base_dir):
fnames = glob.glob(os.path.joi... |
58b798c6e8dc36a28f6e553ce29ae7eab75ea386 | angr/procedures/linux_kernel/cwd.py | angr/procedures/linux_kernel/cwd.py | import angr
import logging
l = logging.getLogger(name=__name__)
class getcwd(angr.SimProcedure):
def run(self, buf, size):
cwd = self.state.fs.cwd
size = self.state.solver.If(size-1 > len(cwd), len(cwd), size-1)
try:
self.state.memory.store(buf, cwd, size=size)
self... | import angr
import logging
l = logging.getLogger(name=__name__)
class getcwd(angr.SimProcedure):
def run(self, buf, size):
cwd = self.state.fs.cwd
size = self.state.solver.If(size-1 > len(cwd), len(cwd), size-1)
try:
self.state.memory.store(buf, cwd, size=size)
self... | Fix string resolution for filesystem | Fix string resolution for filesystem
| Python | bsd-2-clause | angr/angr,angr/angr,angr/angr | import angr
import logging
l = logging.getLogger(name=__name__)
class getcwd(angr.SimProcedure):
def run(self, buf, size):
cwd = self.state.fs.cwd
size = self.state.solver.If(size-1 > len(cwd), len(cwd), size-1)
try:
self.state.memory.store(buf, cwd, size=size)
self... | import angr
import logging
l = logging.getLogger(name=__name__)
class getcwd(angr.SimProcedure):
def run(self, buf, size):
cwd = self.state.fs.cwd
size = self.state.solver.If(size-1 > len(cwd), len(cwd), size-1)
try:
self.state.memory.store(buf, cwd, size=size)
self... | <commit_before>import angr
import logging
l = logging.getLogger(name=__name__)
class getcwd(angr.SimProcedure):
def run(self, buf, size):
cwd = self.state.fs.cwd
size = self.state.solver.If(size-1 > len(cwd), len(cwd), size-1)
try:
self.state.memory.store(buf, cwd, size=size)
... | import angr
import logging
l = logging.getLogger(name=__name__)
class getcwd(angr.SimProcedure):
def run(self, buf, size):
cwd = self.state.fs.cwd
size = self.state.solver.If(size-1 > len(cwd), len(cwd), size-1)
try:
self.state.memory.store(buf, cwd, size=size)
self... | import angr
import logging
l = logging.getLogger(name=__name__)
class getcwd(angr.SimProcedure):
def run(self, buf, size):
cwd = self.state.fs.cwd
size = self.state.solver.If(size-1 > len(cwd), len(cwd), size-1)
try:
self.state.memory.store(buf, cwd, size=size)
self... | <commit_before>import angr
import logging
l = logging.getLogger(name=__name__)
class getcwd(angr.SimProcedure):
def run(self, buf, size):
cwd = self.state.fs.cwd
size = self.state.solver.If(size-1 > len(cwd), len(cwd), size-1)
try:
self.state.memory.store(buf, cwd, size=size)
... |
442aa916dc7b6d199b2c5e1fe973aa3fed8e9c35 | src/python/grpcio_tests/tests_aio/unit/init_test.py | src/python/grpcio_tests/tests_aio/unit/init_test.py | # Copyright 2019 The gRPC 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | # Copyright 2019 The gRPC 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | Make sure the module space won't be polluted by "from grpc import aio" | Make sure the module space won't be polluted by "from grpc import aio"
| Python | apache-2.0 | jtattermusch/grpc,donnadionne/grpc,nicolasnoble/grpc,grpc/grpc,ejona86/grpc,donnadionne/grpc,ctiller/grpc,jtattermusch/grpc,nicolasnoble/grpc,donnadionne/grpc,vjpai/grpc,grpc/grpc,grpc/grpc,ctiller/grpc,vjpai/grpc,jtattermusch/grpc,donnadionne/grpc,grpc/grpc,ejona86/grpc,stanley-cheung/grpc,stanley-cheung/grpc,nicolasn... | # Copyright 2019 The gRPC 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | # Copyright 2019 The gRPC 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | <commit_before># Copyright 2019 The gRPC 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | # Copyright 2019 The gRPC 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | # Copyright 2019 The gRPC 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | <commit_before># Copyright 2019 The gRPC 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
f99c2687786144d3c06d25705cc884199b962272 | microdrop/tests/update_dmf_control_board.py | microdrop/tests/update_dmf_control_board.py | import os
import subprocess
if __name__ == '__main__':
os.chdir('microdrop/plugins')
if not os.path.exists('dmf_control_board'):
print 'Clone dmf_control_board repository...'
subprocess.call(['git', 'clone',
'http://microfluidics.utoronto.ca/git/dmf_control_board.git']... | import os
import subprocess
if __name__ == '__main__':
os.chdir('microdrop/plugins')
if not os.path.exists('dmf_control_board'):
print 'Clone dmf_control_board repository...'
subprocess.check_call(['git', 'clone',
'http://microfluidics.utoronto.ca/git/dmf_control_board... | Check that update script is successful | Check that update script is successful
| Python | bsd-3-clause | wheeler-microfluidics/microdrop | import os
import subprocess
if __name__ == '__main__':
os.chdir('microdrop/plugins')
if not os.path.exists('dmf_control_board'):
print 'Clone dmf_control_board repository...'
subprocess.call(['git', 'clone',
'http://microfluidics.utoronto.ca/git/dmf_control_board.git']... | import os
import subprocess
if __name__ == '__main__':
os.chdir('microdrop/plugins')
if not os.path.exists('dmf_control_board'):
print 'Clone dmf_control_board repository...'
subprocess.check_call(['git', 'clone',
'http://microfluidics.utoronto.ca/git/dmf_control_board... | <commit_before>import os
import subprocess
if __name__ == '__main__':
os.chdir('microdrop/plugins')
if not os.path.exists('dmf_control_board'):
print 'Clone dmf_control_board repository...'
subprocess.call(['git', 'clone',
'http://microfluidics.utoronto.ca/git/dmf_cont... | import os
import subprocess
if __name__ == '__main__':
os.chdir('microdrop/plugins')
if not os.path.exists('dmf_control_board'):
print 'Clone dmf_control_board repository...'
subprocess.check_call(['git', 'clone',
'http://microfluidics.utoronto.ca/git/dmf_control_board... | import os
import subprocess
if __name__ == '__main__':
os.chdir('microdrop/plugins')
if not os.path.exists('dmf_control_board'):
print 'Clone dmf_control_board repository...'
subprocess.call(['git', 'clone',
'http://microfluidics.utoronto.ca/git/dmf_control_board.git']... | <commit_before>import os
import subprocess
if __name__ == '__main__':
os.chdir('microdrop/plugins')
if not os.path.exists('dmf_control_board'):
print 'Clone dmf_control_board repository...'
subprocess.call(['git', 'clone',
'http://microfluidics.utoronto.ca/git/dmf_cont... |
9cdae34b42ef51502a54dc4dfbd70486d695c114 | anyway/parsers/utils.py | anyway/parsers/utils.py | def batch_iterator(iterable, batch_size):
iterator = iter(iterable)
iteration_stopped = False
while True:
batch = []
for _ in xrange(batch_size):
try:
batch.append(next(iterator))
except StopIteration:
iteration_stopped = True
... | def batch_iterator(iterable, batch_size):
iterator = iter(iterable)
iteration_stopped = False
while True:
batch = []
for _ in range(batch_size):
try:
batch.append(next(iterator))
except StopIteration:
iteration_stopped = True
... | Change xrange to range for forward-competability | Change xrange to range for forward-competability
| Python | mit | hasadna/anyway,hasadna/anyway,hasadna/anyway,hasadna/anyway | def batch_iterator(iterable, batch_size):
iterator = iter(iterable)
iteration_stopped = False
while True:
batch = []
for _ in xrange(batch_size):
try:
batch.append(next(iterator))
except StopIteration:
iteration_stopped = True
... | def batch_iterator(iterable, batch_size):
iterator = iter(iterable)
iteration_stopped = False
while True:
batch = []
for _ in range(batch_size):
try:
batch.append(next(iterator))
except StopIteration:
iteration_stopped = True
... | <commit_before>def batch_iterator(iterable, batch_size):
iterator = iter(iterable)
iteration_stopped = False
while True:
batch = []
for _ in xrange(batch_size):
try:
batch.append(next(iterator))
except StopIteration:
iteration_stopped ... | def batch_iterator(iterable, batch_size):
iterator = iter(iterable)
iteration_stopped = False
while True:
batch = []
for _ in range(batch_size):
try:
batch.append(next(iterator))
except StopIteration:
iteration_stopped = True
... | def batch_iterator(iterable, batch_size):
iterator = iter(iterable)
iteration_stopped = False
while True:
batch = []
for _ in xrange(batch_size):
try:
batch.append(next(iterator))
except StopIteration:
iteration_stopped = True
... | <commit_before>def batch_iterator(iterable, batch_size):
iterator = iter(iterable)
iteration_stopped = False
while True:
batch = []
for _ in xrange(batch_size):
try:
batch.append(next(iterator))
except StopIteration:
iteration_stopped ... |
2bfd89b7fe7c4ac4c70f324a745dedbd84dd0672 | __main__.py | __main__.py | from . import *
import readline
ps1 = '\n% '
ps2 = '| '
try:
from blessings import Terminal
term = Terminal()
ps1 = term.bold_blue(ps1)
ps2 = term.bold_blue(ps2)
def fancy_movement():
print(term.move_up() + term.clear_eol() + term.move_up())
except ImportError:
def fancy_movement():
... | from . import *
import readline
ps1 = '\n% '
ps2 = '| '
try:
from blessings import Terminal
term = Terminal()
def fancy_movement():
print(term.move_up() + term.clear_eol() + term.move_up())
except ImportError:
def fancy_movement():
pass
def getfilefunc(mod, droplast=True):
return ... | Remove colors from REPL prompt | Remove colors from REPL prompt
They weren't playing nice with Readline.
There's still an optional dependency on Blessings, but that is only
used to strip away the trailing ps2.
| Python | isc | gvx/isle | from . import *
import readline
ps1 = '\n% '
ps2 = '| '
try:
from blessings import Terminal
term = Terminal()
ps1 = term.bold_blue(ps1)
ps2 = term.bold_blue(ps2)
def fancy_movement():
print(term.move_up() + term.clear_eol() + term.move_up())
except ImportError:
def fancy_movement():
... | from . import *
import readline
ps1 = '\n% '
ps2 = '| '
try:
from blessings import Terminal
term = Terminal()
def fancy_movement():
print(term.move_up() + term.clear_eol() + term.move_up())
except ImportError:
def fancy_movement():
pass
def getfilefunc(mod, droplast=True):
return ... | <commit_before>from . import *
import readline
ps1 = '\n% '
ps2 = '| '
try:
from blessings import Terminal
term = Terminal()
ps1 = term.bold_blue(ps1)
ps2 = term.bold_blue(ps2)
def fancy_movement():
print(term.move_up() + term.clear_eol() + term.move_up())
except ImportError:
def fancy... | from . import *
import readline
ps1 = '\n% '
ps2 = '| '
try:
from blessings import Terminal
term = Terminal()
def fancy_movement():
print(term.move_up() + term.clear_eol() + term.move_up())
except ImportError:
def fancy_movement():
pass
def getfilefunc(mod, droplast=True):
return ... | from . import *
import readline
ps1 = '\n% '
ps2 = '| '
try:
from blessings import Terminal
term = Terminal()
ps1 = term.bold_blue(ps1)
ps2 = term.bold_blue(ps2)
def fancy_movement():
print(term.move_up() + term.clear_eol() + term.move_up())
except ImportError:
def fancy_movement():
... | <commit_before>from . import *
import readline
ps1 = '\n% '
ps2 = '| '
try:
from blessings import Terminal
term = Terminal()
ps1 = term.bold_blue(ps1)
ps2 = term.bold_blue(ps2)
def fancy_movement():
print(term.move_up() + term.clear_eol() + term.move_up())
except ImportError:
def fancy... |
03ef4407612d553095f39694527d20543bc4405a | subiquity/core.py | subiquity/core.py | # Copyright 2015 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | # Copyright 2015 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | Drop Installpath controller, whilst it's single option. | Drop Installpath controller, whilst it's single option.
| Python | agpl-3.0 | CanonicalLtd/subiquity,CanonicalLtd/subiquity | # Copyright 2015 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | # Copyright 2015 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | <commit_before># Copyright 2015 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This progra... | # Copyright 2015 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | # Copyright 2015 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | <commit_before># Copyright 2015 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This progra... |
4d4e0534c7c9ac674876175d63927fc38a5aa507 | app/sense.py | app/sense.py | import threading
import time
class SensorThread(object):
def __init__(self, notify, delay=0):
self.notify = notify
self.delay = delay
self.interval = 0.2
self.color = -1
def start(self, control, robot):
self.control = control
self.robot = robot
thread =... | import threading
import time
class SensorThread(object):
def __init__(self, notify, delay=0):
self.notify = notify
self.delay = delay
self.interval = 0.1
self.color = -1
def start(self, control, robot):
self.control = control
self.robot = robot
thread =... | Increase the frequency of the sensing checks (important for the color sensor/simple line following. | Increase the frequency of the sensing checks (important for the color sensor/simple line following.
| Python | bsd-2-clause | legorovers/legoflask,legorovers/legoflask,legorovers/legoflask | import threading
import time
class SensorThread(object):
def __init__(self, notify, delay=0):
self.notify = notify
self.delay = delay
self.interval = 0.2
self.color = -1
def start(self, control, robot):
self.control = control
self.robot = robot
thread =... | import threading
import time
class SensorThread(object):
def __init__(self, notify, delay=0):
self.notify = notify
self.delay = delay
self.interval = 0.1
self.color = -1
def start(self, control, robot):
self.control = control
self.robot = robot
thread =... | <commit_before>import threading
import time
class SensorThread(object):
def __init__(self, notify, delay=0):
self.notify = notify
self.delay = delay
self.interval = 0.2
self.color = -1
def start(self, control, robot):
self.control = control
self.robot = robot
... | import threading
import time
class SensorThread(object):
def __init__(self, notify, delay=0):
self.notify = notify
self.delay = delay
self.interval = 0.1
self.color = -1
def start(self, control, robot):
self.control = control
self.robot = robot
thread =... | import threading
import time
class SensorThread(object):
def __init__(self, notify, delay=0):
self.notify = notify
self.delay = delay
self.interval = 0.2
self.color = -1
def start(self, control, robot):
self.control = control
self.robot = robot
thread =... | <commit_before>import threading
import time
class SensorThread(object):
def __init__(self, notify, delay=0):
self.notify = notify
self.delay = delay
self.interval = 0.2
self.color = -1
def start(self, control, robot):
self.control = control
self.robot = robot
... |
add4824d69afc928790459129fffbdf72820971f | accloudtant/__main__.py | accloudtant/__main__.py | import csv
def area(entry):
if entry[" UsageType"].startswith("EUC1-"):
return "EU (Frankfurt)"
if __name__ == "__main__":
usage = []
with open("tests/fixtures/2021/03/S3.csv") as f:
reader = csv.DictReader(f)
for row in reader:
usage.append(row)
print("Simple S... | import csv
def area(entry):
if entry[" UsageType"].startswith("EUC1-"):
return "EU (Frankfurt)"
def get_areas(entries):
areas = {}
for entry in entries:
area_name = area(entry)
if area_name not in areas:
areas[area_name] = []
areas[area_name].append(entry)
... | Print list of concepts per area | Print list of concepts per area
| Python | apache-2.0 | ifosch/accloudtant | import csv
def area(entry):
if entry[" UsageType"].startswith("EUC1-"):
return "EU (Frankfurt)"
if __name__ == "__main__":
usage = []
with open("tests/fixtures/2021/03/S3.csv") as f:
reader = csv.DictReader(f)
for row in reader:
usage.append(row)
print("Simple S... | import csv
def area(entry):
if entry[" UsageType"].startswith("EUC1-"):
return "EU (Frankfurt)"
def get_areas(entries):
areas = {}
for entry in entries:
area_name = area(entry)
if area_name not in areas:
areas[area_name] = []
areas[area_name].append(entry)
... | <commit_before>import csv
def area(entry):
if entry[" UsageType"].startswith("EUC1-"):
return "EU (Frankfurt)"
if __name__ == "__main__":
usage = []
with open("tests/fixtures/2021/03/S3.csv") as f:
reader = csv.DictReader(f)
for row in reader:
usage.append(row)
... | import csv
def area(entry):
if entry[" UsageType"].startswith("EUC1-"):
return "EU (Frankfurt)"
def get_areas(entries):
areas = {}
for entry in entries:
area_name = area(entry)
if area_name not in areas:
areas[area_name] = []
areas[area_name].append(entry)
... | import csv
def area(entry):
if entry[" UsageType"].startswith("EUC1-"):
return "EU (Frankfurt)"
if __name__ == "__main__":
usage = []
with open("tests/fixtures/2021/03/S3.csv") as f:
reader = csv.DictReader(f)
for row in reader:
usage.append(row)
print("Simple S... | <commit_before>import csv
def area(entry):
if entry[" UsageType"].startswith("EUC1-"):
return "EU (Frankfurt)"
if __name__ == "__main__":
usage = []
with open("tests/fixtures/2021/03/S3.csv") as f:
reader = csv.DictReader(f)
for row in reader:
usage.append(row)
... |
f704722d54092a6d9b65f726a6b83d208b3e1946 | chatroom.py | chatroom.py | class ChatRoom:
def __init__(self, name, user):
self.name = name
self.users = [user]
def add_user(self, user):
self.users.apend(user)
self.users.sort()
def remove_user(self, user):
self.users.remove(user)
return len (self.users)
| class ChatRoom:
def __init__(self, name, user):
self.name = name
self.users = [user]
def add_user(self, user):
self.users.apend(user)
self.users.sort()
def remove_user(self, user):
if user in self.users:
self.users.remove(user)
return len (s... | Make sure user is in room's user list before removing | Make sure user is in room's user list before removing
| Python | mit | jtoelke/fenfirechat | class ChatRoom:
def __init__(self, name, user):
self.name = name
self.users = [user]
def add_user(self, user):
self.users.apend(user)
self.users.sort()
def remove_user(self, user):
self.users.remove(user)
return len (self.users)
Make sure user is in roo... | class ChatRoom:
def __init__(self, name, user):
self.name = name
self.users = [user]
def add_user(self, user):
self.users.apend(user)
self.users.sort()
def remove_user(self, user):
if user in self.users:
self.users.remove(user)
return len (s... | <commit_before>class ChatRoom:
def __init__(self, name, user):
self.name = name
self.users = [user]
def add_user(self, user):
self.users.apend(user)
self.users.sort()
def remove_user(self, user):
self.users.remove(user)
return len (self.users)
<commit_m... | class ChatRoom:
def __init__(self, name, user):
self.name = name
self.users = [user]
def add_user(self, user):
self.users.apend(user)
self.users.sort()
def remove_user(self, user):
if user in self.users:
self.users.remove(user)
return len (s... | class ChatRoom:
def __init__(self, name, user):
self.name = name
self.users = [user]
def add_user(self, user):
self.users.apend(user)
self.users.sort()
def remove_user(self, user):
self.users.remove(user)
return len (self.users)
Make sure user is in roo... | <commit_before>class ChatRoom:
def __init__(self, name, user):
self.name = name
self.users = [user]
def add_user(self, user):
self.users.apend(user)
self.users.sort()
def remove_user(self, user):
self.users.remove(user)
return len (self.users)
<commit_m... |
8d34496986e68de8aa1a691a494da08f523cb034 | oauthenticator/tests/conftest.py | oauthenticator/tests/conftest.py | """Py.Test fixtures"""
from tornado.httpclient import AsyncHTTPClient
from pytest import fixture
from .mocks import MockAsyncHTTPClient
@fixture
def client(io_loop, request):
"""Return mocked AsyncHTTPClient"""
before = AsyncHTTPClient.configured_class()
AsyncHTTPClient.configure(MockAsyncHTTPClient)
... | """Py.Test fixtures"""
from tornado.httpclient import AsyncHTTPClient
from tornado import ioloop
from pytest import fixture
from .mocks import MockAsyncHTTPClient
@fixture
def io_loop(request):
"""Same as pytest-tornado.io_loop, adapted for tornado 5"""
io_loop = ioloop.IOLoop()
io_loop.make_current()
... | Add ioloop fixture that works with tornado 5 | Add ioloop fixture that works with tornado 5
| Python | bsd-3-clause | maltevogl/oauthenticator,minrk/oauthenticator,NickolausDS/oauthenticator,jupyterhub/oauthenticator,jupyter/oauthenticator,jupyter/oauthenticator,enolfc/oauthenticator | """Py.Test fixtures"""
from tornado.httpclient import AsyncHTTPClient
from pytest import fixture
from .mocks import MockAsyncHTTPClient
@fixture
def client(io_loop, request):
"""Return mocked AsyncHTTPClient"""
before = AsyncHTTPClient.configured_class()
AsyncHTTPClient.configure(MockAsyncHTTPClient)
... | """Py.Test fixtures"""
from tornado.httpclient import AsyncHTTPClient
from tornado import ioloop
from pytest import fixture
from .mocks import MockAsyncHTTPClient
@fixture
def io_loop(request):
"""Same as pytest-tornado.io_loop, adapted for tornado 5"""
io_loop = ioloop.IOLoop()
io_loop.make_current()
... | <commit_before>"""Py.Test fixtures"""
from tornado.httpclient import AsyncHTTPClient
from pytest import fixture
from .mocks import MockAsyncHTTPClient
@fixture
def client(io_loop, request):
"""Return mocked AsyncHTTPClient"""
before = AsyncHTTPClient.configured_class()
AsyncHTTPClient.configure(MockAsync... | """Py.Test fixtures"""
from tornado.httpclient import AsyncHTTPClient
from tornado import ioloop
from pytest import fixture
from .mocks import MockAsyncHTTPClient
@fixture
def io_loop(request):
"""Same as pytest-tornado.io_loop, adapted for tornado 5"""
io_loop = ioloop.IOLoop()
io_loop.make_current()
... | """Py.Test fixtures"""
from tornado.httpclient import AsyncHTTPClient
from pytest import fixture
from .mocks import MockAsyncHTTPClient
@fixture
def client(io_loop, request):
"""Return mocked AsyncHTTPClient"""
before = AsyncHTTPClient.configured_class()
AsyncHTTPClient.configure(MockAsyncHTTPClient)
... | <commit_before>"""Py.Test fixtures"""
from tornado.httpclient import AsyncHTTPClient
from pytest import fixture
from .mocks import MockAsyncHTTPClient
@fixture
def client(io_loop, request):
"""Return mocked AsyncHTTPClient"""
before = AsyncHTTPClient.configured_class()
AsyncHTTPClient.configure(MockAsync... |
12f1024d559c300c7c04256362da78ec8d3a647b | data/models.py | data/models.py | from django.db import models
class DataPoint(models.Model):
name = models.CharField(max_length=600)
exact_name = models.CharField(max_length=1000, null=True, blank=True)
decay_feature = models.CharField(max_length=1000, null=True, blank=True)
options = models.CharField(max_length=100)
homo = mode... | import numpy
import ast
from django.db import models
class DataPoint(models.Model):
name = models.CharField(max_length=600)
exact_name = models.CharField(max_length=1000, null=True, blank=True)
decay_feature = models.CharField(max_length=1000, null=True, blank=True)
options = models.CharField(max_le... | Add method on DataPoint to get numpy matrices with all the ML data | Add method on DataPoint to get numpy matrices with all the ML data
| Python | mit | crcollins/chemtools-webapp,crcollins/chemtools-webapp,crcollins/chemtools-webapp,crcollins/chemtools-webapp,crcollins/chemtools-webapp | from django.db import models
class DataPoint(models.Model):
name = models.CharField(max_length=600)
exact_name = models.CharField(max_length=1000, null=True, blank=True)
decay_feature = models.CharField(max_length=1000, null=True, blank=True)
options = models.CharField(max_length=100)
homo = mode... | import numpy
import ast
from django.db import models
class DataPoint(models.Model):
name = models.CharField(max_length=600)
exact_name = models.CharField(max_length=1000, null=True, blank=True)
decay_feature = models.CharField(max_length=1000, null=True, blank=True)
options = models.CharField(max_le... | <commit_before>from django.db import models
class DataPoint(models.Model):
name = models.CharField(max_length=600)
exact_name = models.CharField(max_length=1000, null=True, blank=True)
decay_feature = models.CharField(max_length=1000, null=True, blank=True)
options = models.CharField(max_length=100)
... | import numpy
import ast
from django.db import models
class DataPoint(models.Model):
name = models.CharField(max_length=600)
exact_name = models.CharField(max_length=1000, null=True, blank=True)
decay_feature = models.CharField(max_length=1000, null=True, blank=True)
options = models.CharField(max_le... | from django.db import models
class DataPoint(models.Model):
name = models.CharField(max_length=600)
exact_name = models.CharField(max_length=1000, null=True, blank=True)
decay_feature = models.CharField(max_length=1000, null=True, blank=True)
options = models.CharField(max_length=100)
homo = mode... | <commit_before>from django.db import models
class DataPoint(models.Model):
name = models.CharField(max_length=600)
exact_name = models.CharField(max_length=1000, null=True, blank=True)
decay_feature = models.CharField(max_length=1000, null=True, blank=True)
options = models.CharField(max_length=100)
... |
83e83cdd90364e037530974e2cea977a05ac449b | pos_picking_state_fix/models/pos_picking.py | pos_picking_state_fix/models/pos_picking.py | # -*- coding: utf-8 -*-
# See README file for full copyright and licensing details.
import time
from openerp import models, api
from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT
class PosPicking(models.Model):
_inherit = 'pos.order'
@api.multi
def create_picking(self):
try:
su... | # -*- coding: utf-8 -*-
# See README file for full copyright and licensing details.
import time
from openerp import models, api
from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT
class PosPicking(models.Model):
_inherit = 'pos.order'
@api.multi
def create_picking(self):
try:
su... | Move code outside of exception | [FIX] Move code outside of exception
| Python | agpl-3.0 | rgbconsulting/rgb-pos,rgbconsulting/rgb-addons,rgbconsulting/rgb-pos,rgbconsulting/rgb-addons | # -*- coding: utf-8 -*-
# See README file for full copyright and licensing details.
import time
from openerp import models, api
from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT
class PosPicking(models.Model):
_inherit = 'pos.order'
@api.multi
def create_picking(self):
try:
su... | # -*- coding: utf-8 -*-
# See README file for full copyright and licensing details.
import time
from openerp import models, api
from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT
class PosPicking(models.Model):
_inherit = 'pos.order'
@api.multi
def create_picking(self):
try:
su... | <commit_before># -*- coding: utf-8 -*-
# See README file for full copyright and licensing details.
import time
from openerp import models, api
from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT
class PosPicking(models.Model):
_inherit = 'pos.order'
@api.multi
def create_picking(self):
try:... | # -*- coding: utf-8 -*-
# See README file for full copyright and licensing details.
import time
from openerp import models, api
from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT
class PosPicking(models.Model):
_inherit = 'pos.order'
@api.multi
def create_picking(self):
try:
su... | # -*- coding: utf-8 -*-
# See README file for full copyright and licensing details.
import time
from openerp import models, api
from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT
class PosPicking(models.Model):
_inherit = 'pos.order'
@api.multi
def create_picking(self):
try:
su... | <commit_before># -*- coding: utf-8 -*-
# See README file for full copyright and licensing details.
import time
from openerp import models, api
from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT
class PosPicking(models.Model):
_inherit = 'pos.order'
@api.multi
def create_picking(self):
try:... |
6807e5a5966f1f37f69a54e255a9981918cc8fb6 | tests/test_cmd.py | tests/test_cmd.py | import base64
import os
from distutils.core import Command
class TestCommand(Command):
description = "Launch all tests under fusion_tables app"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def create_client_secret_file(self):
clie... | import base64
import os
from distutils.core import Command
class TestCommand(Command):
description = "Launch all tests under fusion_tables app"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def create_client_secret_file(self):
clie... | Fix unit test python3 compatibility. | Fix unit test python3 compatibility.
| Python | mit | bsvetchine/django-fusion-tables | import base64
import os
from distutils.core import Command
class TestCommand(Command):
description = "Launch all tests under fusion_tables app"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def create_client_secret_file(self):
clie... | import base64
import os
from distutils.core import Command
class TestCommand(Command):
description = "Launch all tests under fusion_tables app"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def create_client_secret_file(self):
clie... | <commit_before>import base64
import os
from distutils.core import Command
class TestCommand(Command):
description = "Launch all tests under fusion_tables app"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def create_client_secret_file(self... | import base64
import os
from distutils.core import Command
class TestCommand(Command):
description = "Launch all tests under fusion_tables app"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def create_client_secret_file(self):
clie... | import base64
import os
from distutils.core import Command
class TestCommand(Command):
description = "Launch all tests under fusion_tables app"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def create_client_secret_file(self):
clie... | <commit_before>import base64
import os
from distutils.core import Command
class TestCommand(Command):
description = "Launch all tests under fusion_tables app"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def create_client_secret_file(self... |
5397cbd48ce149b5671dcd694d83467af84093dc | fantasyStocks/fantasyStocks/urls.py | fantasyStocks/fantasyStocks/urls.py | """fantasyStocks URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Cla... | """fantasyStocks URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Cla... | Add version to API URL | Add version to API URL
| Python | apache-2.0 | ddsnowboard/FantasyStocks,ddsnowboard/FantasyStocks,ddsnowboard/FantasyStocks | """fantasyStocks URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Cla... | """fantasyStocks URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Cla... | <commit_before>"""fantasyStocks URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, n... | """fantasyStocks URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Cla... | """fantasyStocks URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Cla... | <commit_before>"""fantasyStocks URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, n... |
1f50f159de11a6ff48ce9ce1a502e990228f8dc0 | builtin_fns.py | builtin_fns.py | import object as obj
import ast
from evaluator import NULL, TRUE, FALSE
class Builtin(object):
builtins = []
"""a builtin function"""
def __init__(self, pattern, fn):
self.pattern = pattern # e.g. ["print", "$obj"]
self.fn = fn # fn(args) where args is a dictionary
... | import object as obj
import ast
from evaluator import NULL, TRUE, FALSE
class Builtin(object):
builtins = []
"""a builtin function"""
def __init__(self, pattern, fn):
self.pattern = pattern # e.g. ["print", "$obj"]
self.fn = fn # fn(args) where args is a dictionary
... | Add a few more builtins | Add a few more builtins
- print $obj without newline
- input
- input with prompt $prompt
| Python | mit | Zac-Garby/pluto-lang | import object as obj
import ast
from evaluator import NULL, TRUE, FALSE
class Builtin(object):
builtins = []
"""a builtin function"""
def __init__(self, pattern, fn):
self.pattern = pattern # e.g. ["print", "$obj"]
self.fn = fn # fn(args) where args is a dictionary
... | import object as obj
import ast
from evaluator import NULL, TRUE, FALSE
class Builtin(object):
builtins = []
"""a builtin function"""
def __init__(self, pattern, fn):
self.pattern = pattern # e.g. ["print", "$obj"]
self.fn = fn # fn(args) where args is a dictionary
... | <commit_before>import object as obj
import ast
from evaluator import NULL, TRUE, FALSE
class Builtin(object):
builtins = []
"""a builtin function"""
def __init__(self, pattern, fn):
self.pattern = pattern # e.g. ["print", "$obj"]
self.fn = fn # fn(args) where args is a dicti... | import object as obj
import ast
from evaluator import NULL, TRUE, FALSE
class Builtin(object):
builtins = []
"""a builtin function"""
def __init__(self, pattern, fn):
self.pattern = pattern # e.g. ["print", "$obj"]
self.fn = fn # fn(args) where args is a dictionary
... | import object as obj
import ast
from evaluator import NULL, TRUE, FALSE
class Builtin(object):
builtins = []
"""a builtin function"""
def __init__(self, pattern, fn):
self.pattern = pattern # e.g. ["print", "$obj"]
self.fn = fn # fn(args) where args is a dictionary
... | <commit_before>import object as obj
import ast
from evaluator import NULL, TRUE, FALSE
class Builtin(object):
builtins = []
"""a builtin function"""
def __init__(self, pattern, fn):
self.pattern = pattern # e.g. ["print", "$obj"]
self.fn = fn # fn(args) where args is a dicti... |
fc66db188ecabbe21cea23c91a9e9b24bbf9d11e | bluebottle/homepage/views.py | bluebottle/homepage/views.py | from rest_framework import generics, response
from .models import HomePage
from .serializers import HomePageSerializer
# Instead of serving all the objects separately we combine Slide, Quote and Stats into a dummy object
class HomePageDetail(generics.GenericAPIView):
serializer_class = HomePageSerializer
de... | from django.utils import translation
from rest_framework import generics, response
from .models import HomePage
from .serializers import HomePageSerializer
# Instead of serving all the objects separately we combine Slide, Quote and Stats into a dummy object
class HomePageDetail(generics.GenericAPIView):
seriali... | Fix translations for homepage stats | Fix translations for homepage stats
| Python | bsd-3-clause | jfterpstra/bluebottle,onepercentclub/bluebottle,jfterpstra/bluebottle,onepercentclub/bluebottle,jfterpstra/bluebottle,jfterpstra/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | from rest_framework import generics, response
from .models import HomePage
from .serializers import HomePageSerializer
# Instead of serving all the objects separately we combine Slide, Quote and Stats into a dummy object
class HomePageDetail(generics.GenericAPIView):
serializer_class = HomePageSerializer
de... | from django.utils import translation
from rest_framework import generics, response
from .models import HomePage
from .serializers import HomePageSerializer
# Instead of serving all the objects separately we combine Slide, Quote and Stats into a dummy object
class HomePageDetail(generics.GenericAPIView):
seriali... | <commit_before>from rest_framework import generics, response
from .models import HomePage
from .serializers import HomePageSerializer
# Instead of serving all the objects separately we combine Slide, Quote and Stats into a dummy object
class HomePageDetail(generics.GenericAPIView):
serializer_class = HomePageSer... | from django.utils import translation
from rest_framework import generics, response
from .models import HomePage
from .serializers import HomePageSerializer
# Instead of serving all the objects separately we combine Slide, Quote and Stats into a dummy object
class HomePageDetail(generics.GenericAPIView):
seriali... | from rest_framework import generics, response
from .models import HomePage
from .serializers import HomePageSerializer
# Instead of serving all the objects separately we combine Slide, Quote and Stats into a dummy object
class HomePageDetail(generics.GenericAPIView):
serializer_class = HomePageSerializer
de... | <commit_before>from rest_framework import generics, response
from .models import HomePage
from .serializers import HomePageSerializer
# Instead of serving all the objects separately we combine Slide, Quote and Stats into a dummy object
class HomePageDetail(generics.GenericAPIView):
serializer_class = HomePageSer... |
b510b01b1a67ab5a606eefb251f6649d2b238ccc | yolk/__init__.py | yolk/__init__.py | """yolk.
Author: Rob Cakebread <cakebread at gmail>
License : BSD
"""
__version__ = '0.7.2'
| """yolk.
Author: Rob Cakebread <cakebread at gmail>
License : BSD
"""
__version__ = '0.7.3'
| Increment patch version to 0.7.3 | Increment patch version to 0.7.3
| Python | bsd-3-clause | myint/yolk,myint/yolk | """yolk.
Author: Rob Cakebread <cakebread at gmail>
License : BSD
"""
__version__ = '0.7.2'
Increment patch version to 0.7.3 | """yolk.
Author: Rob Cakebread <cakebread at gmail>
License : BSD
"""
__version__ = '0.7.3'
| <commit_before>"""yolk.
Author: Rob Cakebread <cakebread at gmail>
License : BSD
"""
__version__ = '0.7.2'
<commit_msg>Increment patch version to 0.7.3<commit_after> | """yolk.
Author: Rob Cakebread <cakebread at gmail>
License : BSD
"""
__version__ = '0.7.3'
| """yolk.
Author: Rob Cakebread <cakebread at gmail>
License : BSD
"""
__version__ = '0.7.2'
Increment patch version to 0.7.3"""yolk.
Author: Rob Cakebread <cakebread at gmail>
License : BSD
"""
__version__ = '0.7.3'
| <commit_before>"""yolk.
Author: Rob Cakebread <cakebread at gmail>
License : BSD
"""
__version__ = '0.7.2'
<commit_msg>Increment patch version to 0.7.3<commit_after>"""yolk.
Author: Rob Cakebread <cakebread at gmail>
License : BSD
"""
__version__ = '0.7.3'
|
7714816525547da48060cf45b699c91602fd5095 | winrm/__init__.py | winrm/__init__.py | from winrm.protocol import Protocol
class Response(object):
"""Response from a remote command execution"""
def __init__(self, args):
self.std_out, self.std_err, self.status_code = args
def __repr__(self):
#TODO put tree dots at the end if out/err was truncated
return '<Response co... | from winrm.protocol import Protocol
class Response(object):
"""Response from a remote command execution"""
def __init__(self, args):
self.std_out, self.std_err, self.status_code = args
def __repr__(self):
#TODO put tree dots at the end if out/err was truncated
return '<Response co... | Fix string formatting to work with python 2.6. | Fix string formatting to work with python 2.6.
| Python | mit | luisfdez/pywinrm,max-orlov/pywinrm,diyan/pywinrm,luisfdez/pywinrm,GitHubFriction/pywinrm,GitHubFriction/pywinrm,cchurch/pywinrm,GitHubFriction/pywinrm,cchurch/pywinrm,cchurch/pywinrm,luisfdez/pywinrm,max-orlov/pywinrm,max-orlov/pywinrm | from winrm.protocol import Protocol
class Response(object):
"""Response from a remote command execution"""
def __init__(self, args):
self.std_out, self.std_err, self.status_code = args
def __repr__(self):
#TODO put tree dots at the end if out/err was truncated
return '<Response co... | from winrm.protocol import Protocol
class Response(object):
"""Response from a remote command execution"""
def __init__(self, args):
self.std_out, self.std_err, self.status_code = args
def __repr__(self):
#TODO put tree dots at the end if out/err was truncated
return '<Response co... | <commit_before>from winrm.protocol import Protocol
class Response(object):
"""Response from a remote command execution"""
def __init__(self, args):
self.std_out, self.std_err, self.status_code = args
def __repr__(self):
#TODO put tree dots at the end if out/err was truncated
retur... | from winrm.protocol import Protocol
class Response(object):
"""Response from a remote command execution"""
def __init__(self, args):
self.std_out, self.std_err, self.status_code = args
def __repr__(self):
#TODO put tree dots at the end if out/err was truncated
return '<Response co... | from winrm.protocol import Protocol
class Response(object):
"""Response from a remote command execution"""
def __init__(self, args):
self.std_out, self.std_err, self.status_code = args
def __repr__(self):
#TODO put tree dots at the end if out/err was truncated
return '<Response co... | <commit_before>from winrm.protocol import Protocol
class Response(object):
"""Response from a remote command execution"""
def __init__(self, args):
self.std_out, self.std_err, self.status_code = args
def __repr__(self):
#TODO put tree dots at the end if out/err was truncated
retur... |
1c51c772d4b21eba70cd09429e603f1873b2c13c | examples/demo.py | examples/demo.py | #!/usr/bin/env python
import pytaf
taf_str = """
TAF AMD KDEN 291134Z 2912/3018 32006KT 1/4SM FG OVC001
TEMPO 2914/2915 1SM -BR CLR
FM291500 04006KT P6SM SKC
TEMPO 2915/2917 2SM BR OVC008
FM291900 05007KT P6SM SCT050 BKN090 WS010/13040KT
PROB30 2921/3001 VRB20G30KT -TSRA BKN050CB
FM30... | #!/usr/bin/env python
import pytaf
taf_str = """
TAF AMD KDEN 291134Z 2912/3018 32006KT 1/4SM FG OVC001
TEMPO 2914/2915 1SM -BR CLR
FM291500 04006KT P6SM SKC
TEMPO 2915/2917 2SM BR OVC008
FM291900 05007KT P6SM SCT050 BKN090 WS010/13040KT
PROB30 2921/3001 VRB20G30KT -TSRA BKN050CB
FM30... | Update the example script to work with python3. | Update the example script to work with python3.
| Python | mit | dmbaturin/pytaf | #!/usr/bin/env python
import pytaf
taf_str = """
TAF AMD KDEN 291134Z 2912/3018 32006KT 1/4SM FG OVC001
TEMPO 2914/2915 1SM -BR CLR
FM291500 04006KT P6SM SKC
TEMPO 2915/2917 2SM BR OVC008
FM291900 05007KT P6SM SCT050 BKN090 WS010/13040KT
PROB30 2921/3001 VRB20G30KT -TSRA BKN050CB
FM30... | #!/usr/bin/env python
import pytaf
taf_str = """
TAF AMD KDEN 291134Z 2912/3018 32006KT 1/4SM FG OVC001
TEMPO 2914/2915 1SM -BR CLR
FM291500 04006KT P6SM SKC
TEMPO 2915/2917 2SM BR OVC008
FM291900 05007KT P6SM SCT050 BKN090 WS010/13040KT
PROB30 2921/3001 VRB20G30KT -TSRA BKN050CB
FM30... | <commit_before>#!/usr/bin/env python
import pytaf
taf_str = """
TAF AMD KDEN 291134Z 2912/3018 32006KT 1/4SM FG OVC001
TEMPO 2914/2915 1SM -BR CLR
FM291500 04006KT P6SM SKC
TEMPO 2915/2917 2SM BR OVC008
FM291900 05007KT P6SM SCT050 BKN090 WS010/13040KT
PROB30 2921/3001 VRB20G30KT -TSRA BKN0... | #!/usr/bin/env python
import pytaf
taf_str = """
TAF AMD KDEN 291134Z 2912/3018 32006KT 1/4SM FG OVC001
TEMPO 2914/2915 1SM -BR CLR
FM291500 04006KT P6SM SKC
TEMPO 2915/2917 2SM BR OVC008
FM291900 05007KT P6SM SCT050 BKN090 WS010/13040KT
PROB30 2921/3001 VRB20G30KT -TSRA BKN050CB
FM30... | #!/usr/bin/env python
import pytaf
taf_str = """
TAF AMD KDEN 291134Z 2912/3018 32006KT 1/4SM FG OVC001
TEMPO 2914/2915 1SM -BR CLR
FM291500 04006KT P6SM SKC
TEMPO 2915/2917 2SM BR OVC008
FM291900 05007KT P6SM SCT050 BKN090 WS010/13040KT
PROB30 2921/3001 VRB20G30KT -TSRA BKN050CB
FM30... | <commit_before>#!/usr/bin/env python
import pytaf
taf_str = """
TAF AMD KDEN 291134Z 2912/3018 32006KT 1/4SM FG OVC001
TEMPO 2914/2915 1SM -BR CLR
FM291500 04006KT P6SM SKC
TEMPO 2915/2917 2SM BR OVC008
FM291900 05007KT P6SM SCT050 BKN090 WS010/13040KT
PROB30 2921/3001 VRB20G30KT -TSRA BKN0... |
8a70475983d973b5f9287d7a7c807c55994d3b70 | aioriak/tests/test_kv.py | aioriak/tests/test_kv.py | from .base import IntegrationTest, AsyncUnitTestCase
class BasicKVTests(IntegrationTest, AsyncUnitTestCase):
def test_no_returnbody(self):
async def go():
bucket = self.client.bucket(self.bucket_name)
o = await bucket.new(self.key_name, "bar")
await o.store(return_body=... | from .base import IntegrationTest, AsyncUnitTestCase
class BasicKVTests(IntegrationTest, AsyncUnitTestCase):
def test_no_returnbody(self):
async def go():
bucket = self.client.bucket(self.bucket_name)
o = await bucket.new(self.key_name, "bar")
await o.store(return_body=... | Add test store unicode object | Add test store unicode object
| Python | mit | rambler-digital-solutions/aioriak | from .base import IntegrationTest, AsyncUnitTestCase
class BasicKVTests(IntegrationTest, AsyncUnitTestCase):
def test_no_returnbody(self):
async def go():
bucket = self.client.bucket(self.bucket_name)
o = await bucket.new(self.key_name, "bar")
await o.store(return_body=... | from .base import IntegrationTest, AsyncUnitTestCase
class BasicKVTests(IntegrationTest, AsyncUnitTestCase):
def test_no_returnbody(self):
async def go():
bucket = self.client.bucket(self.bucket_name)
o = await bucket.new(self.key_name, "bar")
await o.store(return_body=... | <commit_before>from .base import IntegrationTest, AsyncUnitTestCase
class BasicKVTests(IntegrationTest, AsyncUnitTestCase):
def test_no_returnbody(self):
async def go():
bucket = self.client.bucket(self.bucket_name)
o = await bucket.new(self.key_name, "bar")
await o.sto... | from .base import IntegrationTest, AsyncUnitTestCase
class BasicKVTests(IntegrationTest, AsyncUnitTestCase):
def test_no_returnbody(self):
async def go():
bucket = self.client.bucket(self.bucket_name)
o = await bucket.new(self.key_name, "bar")
await o.store(return_body=... | from .base import IntegrationTest, AsyncUnitTestCase
class BasicKVTests(IntegrationTest, AsyncUnitTestCase):
def test_no_returnbody(self):
async def go():
bucket = self.client.bucket(self.bucket_name)
o = await bucket.new(self.key_name, "bar")
await o.store(return_body=... | <commit_before>from .base import IntegrationTest, AsyncUnitTestCase
class BasicKVTests(IntegrationTest, AsyncUnitTestCase):
def test_no_returnbody(self):
async def go():
bucket = self.client.bucket(self.bucket_name)
o = await bucket.new(self.key_name, "bar")
await o.sto... |
992a5a41580a520b330ec0fbbeba4e328924523a | tests/structures/test_list_comprehension.py | tests/structures/test_list_comprehension.py | from ..utils import TranspileTestCase
class ListComprehensionTests(TranspileTestCase):
def test_syntax(self):
self.assertCodeExecution("""
x = [1, 2, 3, 4, 5]
print([v**2 for v in x])
print([v for v in x])
""")
def test_list_comprehension_with_if_condi... | from ..utils import TranspileTestCase
class ListComprehensionTests(TranspileTestCase):
def test_syntax(self):
self.assertCodeExecution("""
x = [1, 2, 3, 4, 5]
print([v**2 for v in x])
print([v for v in x])
""")
def test_list_comprehension_with_if_condi... | Add a test for list comprehensions with more than two ifs | Add a test for list comprehensions with more than two ifs
| Python | bsd-3-clause | freakboy3742/voc,cflee/voc,cflee/voc,freakboy3742/voc | from ..utils import TranspileTestCase
class ListComprehensionTests(TranspileTestCase):
def test_syntax(self):
self.assertCodeExecution("""
x = [1, 2, 3, 4, 5]
print([v**2 for v in x])
print([v for v in x])
""")
def test_list_comprehension_with_if_condi... | from ..utils import TranspileTestCase
class ListComprehensionTests(TranspileTestCase):
def test_syntax(self):
self.assertCodeExecution("""
x = [1, 2, 3, 4, 5]
print([v**2 for v in x])
print([v for v in x])
""")
def test_list_comprehension_with_if_condi... | <commit_before>from ..utils import TranspileTestCase
class ListComprehensionTests(TranspileTestCase):
def test_syntax(self):
self.assertCodeExecution("""
x = [1, 2, 3, 4, 5]
print([v**2 for v in x])
print([v for v in x])
""")
def test_list_comprehensio... | from ..utils import TranspileTestCase
class ListComprehensionTests(TranspileTestCase):
def test_syntax(self):
self.assertCodeExecution("""
x = [1, 2, 3, 4, 5]
print([v**2 for v in x])
print([v for v in x])
""")
def test_list_comprehension_with_if_condi... | from ..utils import TranspileTestCase
class ListComprehensionTests(TranspileTestCase):
def test_syntax(self):
self.assertCodeExecution("""
x = [1, 2, 3, 4, 5]
print([v**2 for v in x])
print([v for v in x])
""")
def test_list_comprehension_with_if_condi... | <commit_before>from ..utils import TranspileTestCase
class ListComprehensionTests(TranspileTestCase):
def test_syntax(self):
self.assertCodeExecution("""
x = [1, 2, 3, 4, 5]
print([v**2 for v in x])
print([v for v in x])
""")
def test_list_comprehensio... |
f5b813b597e7dbc3d6ee3456ddb8318dacd1700b | wheresyourtrash/apps/notifications/tests.py | wheresyourtrash/apps/notifications/tests.py | import mock
import unittest
from django.test import TestCase
from datetime import datetime, timedelta
from notifications.models import District, DistrictExceptions, Municipality
class DistrictTestCase(TestCase):
def setUp(self):
today = datetime.now()
m = Municipality.objects.create(state="ME", z... | from django.test import TestCase
from datetime import datetime, timedelta
from notifications.models import District, DistrictExceptions, Municipality
class DistrictTestCase(TestCase):
def setUp(self):
today = datetime.now()
m = Municipality.objects.create(state="ME", zipcode="04421",
... | Remove unittest and mock for now | Remove unittest and mock for now
| Python | bsd-3-clause | Code4Maine/wheresyourtrash,mainecivichackday/wheresyourtrash,mainecivichackday/wheresyourtrash,mainecivichackday/wheresyourtrash,mainecivichackday/wheresyourtrash,Code4Maine/wheresyourtrash,Code4Maine/wheresyourtrash,Code4Maine/wheresyourtrash | import mock
import unittest
from django.test import TestCase
from datetime import datetime, timedelta
from notifications.models import District, DistrictExceptions, Municipality
class DistrictTestCase(TestCase):
def setUp(self):
today = datetime.now()
m = Municipality.objects.create(state="ME", z... | from django.test import TestCase
from datetime import datetime, timedelta
from notifications.models import District, DistrictExceptions, Municipality
class DistrictTestCase(TestCase):
def setUp(self):
today = datetime.now()
m = Municipality.objects.create(state="ME", zipcode="04421",
... | <commit_before>import mock
import unittest
from django.test import TestCase
from datetime import datetime, timedelta
from notifications.models import District, DistrictExceptions, Municipality
class DistrictTestCase(TestCase):
def setUp(self):
today = datetime.now()
m = Municipality.objects.creat... | from django.test import TestCase
from datetime import datetime, timedelta
from notifications.models import District, DistrictExceptions, Municipality
class DistrictTestCase(TestCase):
def setUp(self):
today = datetime.now()
m = Municipality.objects.create(state="ME", zipcode="04421",
... | import mock
import unittest
from django.test import TestCase
from datetime import datetime, timedelta
from notifications.models import District, DistrictExceptions, Municipality
class DistrictTestCase(TestCase):
def setUp(self):
today = datetime.now()
m = Municipality.objects.create(state="ME", z... | <commit_before>import mock
import unittest
from django.test import TestCase
from datetime import datetime, timedelta
from notifications.models import District, DistrictExceptions, Municipality
class DistrictTestCase(TestCase):
def setUp(self):
today = datetime.now()
m = Municipality.objects.creat... |
de731520f9ad3f871a976fd597ff1a4d8acf155f | tests/modules/test_enumerable.py | tests/modules/test_enumerable.py | class TestEnumberable(object):
def test_inject(self, ec):
w_res = ec.space.execute(ec, """
return (5..10).inject(1) do |prod, n|
prod * n
end
""")
assert ec.space.int_w(w_res) == 15120
w_res = ec.space.execute(ec, """
return (1..10).inject 0 do |s... | class TestEnumberable(object):
def test_inject(self, ec):
w_res = ec.space.execute(ec, """
return (5..10).inject(1) do |prod, n|
prod * n
end
""")
assert ec.space.int_w(w_res) == 15120
w_res = ec.space.execute(ec, """
return (1..10).inject 0 do |s... | Fix true test, add false test | Fix true test, add false test
| Python | bsd-3-clause | babelsberg/babelsberg-r,topazproject/topaz,topazproject/topaz,babelsberg/babelsberg-r,babelsberg/babelsberg-r,babelsberg/babelsberg-r,babelsberg/babelsberg-r,topazproject/topaz,kachick/topaz,kachick/topaz,topazproject/topaz,kachick/topaz | class TestEnumberable(object):
def test_inject(self, ec):
w_res = ec.space.execute(ec, """
return (5..10).inject(1) do |prod, n|
prod * n
end
""")
assert ec.space.int_w(w_res) == 15120
w_res = ec.space.execute(ec, """
return (1..10).inject 0 do |s... | class TestEnumberable(object):
def test_inject(self, ec):
w_res = ec.space.execute(ec, """
return (5..10).inject(1) do |prod, n|
prod * n
end
""")
assert ec.space.int_w(w_res) == 15120
w_res = ec.space.execute(ec, """
return (1..10).inject 0 do |s... | <commit_before>class TestEnumberable(object):
def test_inject(self, ec):
w_res = ec.space.execute(ec, """
return (5..10).inject(1) do |prod, n|
prod * n
end
""")
assert ec.space.int_w(w_res) == 15120
w_res = ec.space.execute(ec, """
return (1..10)... | class TestEnumberable(object):
def test_inject(self, ec):
w_res = ec.space.execute(ec, """
return (5..10).inject(1) do |prod, n|
prod * n
end
""")
assert ec.space.int_w(w_res) == 15120
w_res = ec.space.execute(ec, """
return (1..10).inject 0 do |s... | class TestEnumberable(object):
def test_inject(self, ec):
w_res = ec.space.execute(ec, """
return (5..10).inject(1) do |prod, n|
prod * n
end
""")
assert ec.space.int_w(w_res) == 15120
w_res = ec.space.execute(ec, """
return (1..10).inject 0 do |s... | <commit_before>class TestEnumberable(object):
def test_inject(self, ec):
w_res = ec.space.execute(ec, """
return (5..10).inject(1) do |prod, n|
prod * n
end
""")
assert ec.space.int_w(w_res) == 15120
w_res = ec.space.execute(ec, """
return (1..10)... |
8324b45214dee9cd52c1c9bc85e6d10567dae6e1 | plugins/join_on_invite/plugin.py | plugins/join_on_invite/plugin.py | class InviteJoinPlugin(object):
def __init__(self, cardinal):
cardinal.event_manager.register_callback("irc.invite", self.join_channel)
def join_channel(self, cardinal, user, channel):
cardinal.join(channel);
def setup(cardinal):
return InviteJoinPlugin(cardinal)
| class InviteJoinPlugin(object):
"""Simple plugin that joins a channel if an invite is given."""
callback_id = None
"""ID generated when callback was added for the irc.invite event"""
def __init__(self, cardinal):
"""Register our callback and save the callback ID"""
self.callback_id = c... | Remove callback from join_on_invite during close() | Remove callback from join_on_invite during close()
| Python | mit | BiohZn/Cardinal,JohnMaguire/Cardinal | class InviteJoinPlugin(object):
def __init__(self, cardinal):
cardinal.event_manager.register_callback("irc.invite", self.join_channel)
def join_channel(self, cardinal, user, channel):
cardinal.join(channel);
def setup(cardinal):
return InviteJoinPlugin(cardinal)
Remove callback from join_... | class InviteJoinPlugin(object):
"""Simple plugin that joins a channel if an invite is given."""
callback_id = None
"""ID generated when callback was added for the irc.invite event"""
def __init__(self, cardinal):
"""Register our callback and save the callback ID"""
self.callback_id = c... | <commit_before>class InviteJoinPlugin(object):
def __init__(self, cardinal):
cardinal.event_manager.register_callback("irc.invite", self.join_channel)
def join_channel(self, cardinal, user, channel):
cardinal.join(channel);
def setup(cardinal):
return InviteJoinPlugin(cardinal)
<commit_msg... | class InviteJoinPlugin(object):
"""Simple plugin that joins a channel if an invite is given."""
callback_id = None
"""ID generated when callback was added for the irc.invite event"""
def __init__(self, cardinal):
"""Register our callback and save the callback ID"""
self.callback_id = c... | class InviteJoinPlugin(object):
def __init__(self, cardinal):
cardinal.event_manager.register_callback("irc.invite", self.join_channel)
def join_channel(self, cardinal, user, channel):
cardinal.join(channel);
def setup(cardinal):
return InviteJoinPlugin(cardinal)
Remove callback from join_... | <commit_before>class InviteJoinPlugin(object):
def __init__(self, cardinal):
cardinal.event_manager.register_callback("irc.invite", self.join_channel)
def join_channel(self, cardinal, user, channel):
cardinal.join(channel);
def setup(cardinal):
return InviteJoinPlugin(cardinal)
<commit_msg... |
ea42e8c61bddf614a5fc444b53eb38dcdcff88af | HotCIDR/hotcidr/ports.py | HotCIDR/hotcidr/ports.py | def parse(s):
try:
return Port(int(s))
except ValueError:
if s == "all":
return Port(None)
else:
start, _, end = s.partition('-')
try:
return Port(int(start), int(end))
except ValueError:
return None
class ... | def parse(s):
try:
return Port(int(s))
except ValueError:
if s == "all":
return Port(None)
else:
start, _, end = s.partition('-')
try:
return Port(int(start), int(end))
except ValueError:
return None
class ... | Check that input to port is an integer | Check that input to port is an integer
| Python | apache-2.0 | ViaSat/hotcidr | def parse(s):
try:
return Port(int(s))
except ValueError:
if s == "all":
return Port(None)
else:
start, _, end = s.partition('-')
try:
return Port(int(start), int(end))
except ValueError:
return None
class ... | def parse(s):
try:
return Port(int(s))
except ValueError:
if s == "all":
return Port(None)
else:
start, _, end = s.partition('-')
try:
return Port(int(start), int(end))
except ValueError:
return None
class ... | <commit_before>def parse(s):
try:
return Port(int(s))
except ValueError:
if s == "all":
return Port(None)
else:
start, _, end = s.partition('-')
try:
return Port(int(start), int(end))
except ValueError:
retur... | def parse(s):
try:
return Port(int(s))
except ValueError:
if s == "all":
return Port(None)
else:
start, _, end = s.partition('-')
try:
return Port(int(start), int(end))
except ValueError:
return None
class ... | def parse(s):
try:
return Port(int(s))
except ValueError:
if s == "all":
return Port(None)
else:
start, _, end = s.partition('-')
try:
return Port(int(start), int(end))
except ValueError:
return None
class ... | <commit_before>def parse(s):
try:
return Port(int(s))
except ValueError:
if s == "all":
return Port(None)
else:
start, _, end = s.partition('-')
try:
return Port(int(start), int(end))
except ValueError:
retur... |
dc30ef09b024d035ed543c658bfe005d15330111 | build/split.py | build/split.py | #!/usr/bin/env python2.7
import json
import os
import re
def main():
session_cells = {n: [] for n in range(1, 6+1)}
f = open(os.path.dirname(__file__) + '/../All.ipynb')
j = json.load(f)
cells = j['cells']
for cell in cells:
source = u''.join(cell['source'])
m = re.search(r'# +(\d+... | #!/usr/bin/env python2.7
import json
import os
import re
def main():
session_cells = {n: [] for n in range(1, 6+1)}
f = open(os.path.dirname(__file__) + '/../All.ipynb')
j = json.load(f)
cells = j['cells']
for cell in cells:
source = u''.join(cell['source'])
m = re.search(r'# +(\d+... | Switch to looking for separate solutions files | Switch to looking for separate solutions files
| Python | mit | RobbieNesmith/PandasTutorial,Srisai85/pycon-pandas-tutorial,baomingTang/pycon-pandas-tutorial,ledrui/pycon-pandas-tutorial,wkuling/pycon-pandas-tutorial,deepesch/pycon-pandas-tutorial,baomingTang/pycon-pandas-tutorial,jainshailesh/pycon-pandas-tutorial,chrish42/pycon-pandas-tutorial,xy008areshsu/pycon-pandas-tutorial,l... | #!/usr/bin/env python2.7
import json
import os
import re
def main():
session_cells = {n: [] for n in range(1, 6+1)}
f = open(os.path.dirname(__file__) + '/../All.ipynb')
j = json.load(f)
cells = j['cells']
for cell in cells:
source = u''.join(cell['source'])
m = re.search(r'# +(\d+... | #!/usr/bin/env python2.7
import json
import os
import re
def main():
session_cells = {n: [] for n in range(1, 6+1)}
f = open(os.path.dirname(__file__) + '/../All.ipynb')
j = json.load(f)
cells = j['cells']
for cell in cells:
source = u''.join(cell['source'])
m = re.search(r'# +(\d+... | <commit_before>#!/usr/bin/env python2.7
import json
import os
import re
def main():
session_cells = {n: [] for n in range(1, 6+1)}
f = open(os.path.dirname(__file__) + '/../All.ipynb')
j = json.load(f)
cells = j['cells']
for cell in cells:
source = u''.join(cell['source'])
m = re.s... | #!/usr/bin/env python2.7
import json
import os
import re
def main():
session_cells = {n: [] for n in range(1, 6+1)}
f = open(os.path.dirname(__file__) + '/../All.ipynb')
j = json.load(f)
cells = j['cells']
for cell in cells:
source = u''.join(cell['source'])
m = re.search(r'# +(\d+... | #!/usr/bin/env python2.7
import json
import os
import re
def main():
session_cells = {n: [] for n in range(1, 6+1)}
f = open(os.path.dirname(__file__) + '/../All.ipynb')
j = json.load(f)
cells = j['cells']
for cell in cells:
source = u''.join(cell['source'])
m = re.search(r'# +(\d+... | <commit_before>#!/usr/bin/env python2.7
import json
import os
import re
def main():
session_cells = {n: [] for n in range(1, 6+1)}
f = open(os.path.dirname(__file__) + '/../All.ipynb')
j = json.load(f)
cells = j['cells']
for cell in cells:
source = u''.join(cell['source'])
m = re.s... |
e6bacdb207bdedd854fceb49378bdea129004e49 | bib.py | bib.py | import sqlite3
conn = sqlite3.connect('surfaces.db')
c = conn.cursor()
c.execute('''CREATE TABLE bibliography (
kdim INT,
pg INT,
q INT,
K2 INT,
chi INT,
e INT,
h11 INT,
sp INT,
ref TEXT
);
''')
rationalsurfaces = [(-1, 0, 0, "NULL", "NULL", "NULL", 0, 4, '''The projective plane, birational to the Hir... | import sqlite3
conn = sqlite3.connect('surfaces.db')
c = conn.cursor()
c.execute('''CREATE TABLE bibliography (
kdim INT,
pg INT,
q INT,
K2 INT,
chi INT,
e INT,
h11 INT,
sp INT,
ref TEXT
);
''')
rationalsurfaces = [(-1, 0, 0, 9, 3, 1, 0, 7, '''The projective plane, birational to the Hirzebruch surface... | Add a bit more info about rational surfaces | Add a bit more info about rational surfaces
| Python | unlicense | jcommelin/superficie-algebriche,jcommelin/superficie-algebriche | import sqlite3
conn = sqlite3.connect('surfaces.db')
c = conn.cursor()
c.execute('''CREATE TABLE bibliography (
kdim INT,
pg INT,
q INT,
K2 INT,
chi INT,
e INT,
h11 INT,
sp INT,
ref TEXT
);
''')
rationalsurfaces = [(-1, 0, 0, "NULL", "NULL", "NULL", 0, 4, '''The projective plane, birational to the Hir... | import sqlite3
conn = sqlite3.connect('surfaces.db')
c = conn.cursor()
c.execute('''CREATE TABLE bibliography (
kdim INT,
pg INT,
q INT,
K2 INT,
chi INT,
e INT,
h11 INT,
sp INT,
ref TEXT
);
''')
rationalsurfaces = [(-1, 0, 0, 9, 3, 1, 0, 7, '''The projective plane, birational to the Hirzebruch surface... | <commit_before>import sqlite3
conn = sqlite3.connect('surfaces.db')
c = conn.cursor()
c.execute('''CREATE TABLE bibliography (
kdim INT,
pg INT,
q INT,
K2 INT,
chi INT,
e INT,
h11 INT,
sp INT,
ref TEXT
);
''')
rationalsurfaces = [(-1, 0, 0, "NULL", "NULL", "NULL", 0, 4, '''The projective plane, birati... | import sqlite3
conn = sqlite3.connect('surfaces.db')
c = conn.cursor()
c.execute('''CREATE TABLE bibliography (
kdim INT,
pg INT,
q INT,
K2 INT,
chi INT,
e INT,
h11 INT,
sp INT,
ref TEXT
);
''')
rationalsurfaces = [(-1, 0, 0, 9, 3, 1, 0, 7, '''The projective plane, birational to the Hirzebruch surface... | import sqlite3
conn = sqlite3.connect('surfaces.db')
c = conn.cursor()
c.execute('''CREATE TABLE bibliography (
kdim INT,
pg INT,
q INT,
K2 INT,
chi INT,
e INT,
h11 INT,
sp INT,
ref TEXT
);
''')
rationalsurfaces = [(-1, 0, 0, "NULL", "NULL", "NULL", 0, 4, '''The projective plane, birational to the Hir... | <commit_before>import sqlite3
conn = sqlite3.connect('surfaces.db')
c = conn.cursor()
c.execute('''CREATE TABLE bibliography (
kdim INT,
pg INT,
q INT,
K2 INT,
chi INT,
e INT,
h11 INT,
sp INT,
ref TEXT
);
''')
rationalsurfaces = [(-1, 0, 0, "NULL", "NULL", "NULL", 0, 4, '''The projective plane, birati... |
e9f53219d305052e7bb74d82cd1a9166d3e7b2f2 | bot.py | bot.py | #!/usr/bin/python
import sys
import asyncore
import logging
from irc import Bot
logging.basicConfig(level=logging.DEBUG, format="%(asctime)s - %(message)s")
bot = Bot('localhost')
try:
bot.run()
asyncore.loop()
except KeyboardInterrupt:
bot.irc_command('QUIT', 'Bye :)')
sys.exit(0)
| #!/usr/bin/python
import sys
import asyncore
import logging
from irc import Bot
from listener import Listener
logging.basicConfig(level=logging.DEBUG, format="%(asctime)s - %(message)s")
bot = Bot('localhost')
listener = Listener()
def parse(line):
if line.startswith('@'):
target, line = line[1:].split... | Integrate listener and irc parts | Integrate listener and irc parts
| Python | mit | adamcik/pycat,adamcik/pycat | #!/usr/bin/python
import sys
import asyncore
import logging
from irc import Bot
logging.basicConfig(level=logging.DEBUG, format="%(asctime)s - %(message)s")
bot = Bot('localhost')
try:
bot.run()
asyncore.loop()
except KeyboardInterrupt:
bot.irc_command('QUIT', 'Bye :)')
sys.exit(0)
Integrate listen... | #!/usr/bin/python
import sys
import asyncore
import logging
from irc import Bot
from listener import Listener
logging.basicConfig(level=logging.DEBUG, format="%(asctime)s - %(message)s")
bot = Bot('localhost')
listener = Listener()
def parse(line):
if line.startswith('@'):
target, line = line[1:].split... | <commit_before>#!/usr/bin/python
import sys
import asyncore
import logging
from irc import Bot
logging.basicConfig(level=logging.DEBUG, format="%(asctime)s - %(message)s")
bot = Bot('localhost')
try:
bot.run()
asyncore.loop()
except KeyboardInterrupt:
bot.irc_command('QUIT', 'Bye :)')
sys.exit(0)
<... | #!/usr/bin/python
import sys
import asyncore
import logging
from irc import Bot
from listener import Listener
logging.basicConfig(level=logging.DEBUG, format="%(asctime)s - %(message)s")
bot = Bot('localhost')
listener = Listener()
def parse(line):
if line.startswith('@'):
target, line = line[1:].split... | #!/usr/bin/python
import sys
import asyncore
import logging
from irc import Bot
logging.basicConfig(level=logging.DEBUG, format="%(asctime)s - %(message)s")
bot = Bot('localhost')
try:
bot.run()
asyncore.loop()
except KeyboardInterrupt:
bot.irc_command('QUIT', 'Bye :)')
sys.exit(0)
Integrate listen... | <commit_before>#!/usr/bin/python
import sys
import asyncore
import logging
from irc import Bot
logging.basicConfig(level=logging.DEBUG, format="%(asctime)s - %(message)s")
bot = Bot('localhost')
try:
bot.run()
asyncore.loop()
except KeyboardInterrupt:
bot.irc_command('QUIT', 'Bye :)')
sys.exit(0)
<... |
b292df611945e15a852db01d61e3b9004307a244 | bot.py | bot.py | import os
import time
from crawl import crawl
import tweepy
class TwitterAPI:
"""
Class for accessing the Twitter API.
Requires API credentials to be available in environment
variables. These will be set appropriately if the bot was created
with init.sh included with the heroku-twitterbot-starter... | import os
import time
from crawl import crawl
import tweepy
class TwitterAPI:
"""
Class for accessing the Twitter API.
Requires API credentials to be available in environment
variables. These will be set appropriately if the bot was created
with init.sh included with the heroku-twitterbot-starter... | Speed up for a while | Speed up for a while
| Python | mit | gregsabo/only_keep_one,gregsabo/only_keep_one | import os
import time
from crawl import crawl
import tweepy
class TwitterAPI:
"""
Class for accessing the Twitter API.
Requires API credentials to be available in environment
variables. These will be set appropriately if the bot was created
with init.sh included with the heroku-twitterbot-starter... | import os
import time
from crawl import crawl
import tweepy
class TwitterAPI:
"""
Class for accessing the Twitter API.
Requires API credentials to be available in environment
variables. These will be set appropriately if the bot was created
with init.sh included with the heroku-twitterbot-starter... | <commit_before>import os
import time
from crawl import crawl
import tweepy
class TwitterAPI:
"""
Class for accessing the Twitter API.
Requires API credentials to be available in environment
variables. These will be set appropriately if the bot was created
with init.sh included with the heroku-twi... | import os
import time
from crawl import crawl
import tweepy
class TwitterAPI:
"""
Class for accessing the Twitter API.
Requires API credentials to be available in environment
variables. These will be set appropriately if the bot was created
with init.sh included with the heroku-twitterbot-starter... | import os
import time
from crawl import crawl
import tweepy
class TwitterAPI:
"""
Class for accessing the Twitter API.
Requires API credentials to be available in environment
variables. These will be set appropriately if the bot was created
with init.sh included with the heroku-twitterbot-starter... | <commit_before>import os
import time
from crawl import crawl
import tweepy
class TwitterAPI:
"""
Class for accessing the Twitter API.
Requires API credentials to be available in environment
variables. These will be set appropriately if the bot was created
with init.sh included with the heroku-twi... |
2f4bd8b133a3c4db43c039d94a1ecb757f4f41a8 | django_graphene_utils/mixins.py | django_graphene_utils/mixins.py | from .forms import ReduceMixinForm
__all__ = ['ReduceMixin']
"""
Mutation mixin to work with form applying the ReduceMixinForm
"""
class ReduceMixin(object):
def get_form_kwargs(self, root, args, context, info):
# ensure we can do it
assert issubclass(self._meta.form, ReduceMixinForm)
# ... | from .forms import ReduceMixinForm
__all__ = ['ReduceMixin']
"""
Mutation mixin to work with form applying the ReduceMixinForm
"""
class ReduceMixin(object):
def get_form_kwargs(self, root, args, context, info):
# ensure we can do it
assert issubclass(self._meta.form_class, ReduceMixinForm)
... | Fix critical error on ReduceMixin | Fix critical error on ReduceMixin
| Python | mit | amille44420/django-graphene-utils | from .forms import ReduceMixinForm
__all__ = ['ReduceMixin']
"""
Mutation mixin to work with form applying the ReduceMixinForm
"""
class ReduceMixin(object):
def get_form_kwargs(self, root, args, context, info):
# ensure we can do it
assert issubclass(self._meta.form, ReduceMixinForm)
# ... | from .forms import ReduceMixinForm
__all__ = ['ReduceMixin']
"""
Mutation mixin to work with form applying the ReduceMixinForm
"""
class ReduceMixin(object):
def get_form_kwargs(self, root, args, context, info):
# ensure we can do it
assert issubclass(self._meta.form_class, ReduceMixinForm)
... | <commit_before>from .forms import ReduceMixinForm
__all__ = ['ReduceMixin']
"""
Mutation mixin to work with form applying the ReduceMixinForm
"""
class ReduceMixin(object):
def get_form_kwargs(self, root, args, context, info):
# ensure we can do it
assert issubclass(self._meta.form, ReduceMixinF... | from .forms import ReduceMixinForm
__all__ = ['ReduceMixin']
"""
Mutation mixin to work with form applying the ReduceMixinForm
"""
class ReduceMixin(object):
def get_form_kwargs(self, root, args, context, info):
# ensure we can do it
assert issubclass(self._meta.form_class, ReduceMixinForm)
... | from .forms import ReduceMixinForm
__all__ = ['ReduceMixin']
"""
Mutation mixin to work with form applying the ReduceMixinForm
"""
class ReduceMixin(object):
def get_form_kwargs(self, root, args, context, info):
# ensure we can do it
assert issubclass(self._meta.form, ReduceMixinForm)
# ... | <commit_before>from .forms import ReduceMixinForm
__all__ = ['ReduceMixin']
"""
Mutation mixin to work with form applying the ReduceMixinForm
"""
class ReduceMixin(object):
def get_form_kwargs(self, root, args, context, info):
# ensure we can do it
assert issubclass(self._meta.form, ReduceMixinF... |
6032fb8eb10a2f6be28142c7473e03b4bc349c7c | partitions/registry.py | partitions/registry.py | from django.conf import settings
class Registry(object):
def __init__(self):
self._partitions = {}
def register(self, key, app_model, expression):
if not isinstance(app_model, basestring):
app_model = "%s.%s" % (
app_model._meta.app_label,
... | from django.conf import settings
class Registry(object):
def __init__(self):
self._partitions = {}
def register(self, key, app_model, expression):
if not isinstance(app_model, basestring):
app_model = "%s.%s" % (
app_model._meta.app_label,
... | Use update instead of setting key directly | Use update instead of setting key directly
| Python | bsd-3-clause | eldarion/django-partitions | from django.conf import settings
class Registry(object):
def __init__(self):
self._partitions = {}
def register(self, key, app_model, expression):
if not isinstance(app_model, basestring):
app_model = "%s.%s" % (
app_model._meta.app_label,
... | from django.conf import settings
class Registry(object):
def __init__(self):
self._partitions = {}
def register(self, key, app_model, expression):
if not isinstance(app_model, basestring):
app_model = "%s.%s" % (
app_model._meta.app_label,
... | <commit_before>from django.conf import settings
class Registry(object):
def __init__(self):
self._partitions = {}
def register(self, key, app_model, expression):
if not isinstance(app_model, basestring):
app_model = "%s.%s" % (
app_model._meta.app_label,
... | from django.conf import settings
class Registry(object):
def __init__(self):
self._partitions = {}
def register(self, key, app_model, expression):
if not isinstance(app_model, basestring):
app_model = "%s.%s" % (
app_model._meta.app_label,
... | from django.conf import settings
class Registry(object):
def __init__(self):
self._partitions = {}
def register(self, key, app_model, expression):
if not isinstance(app_model, basestring):
app_model = "%s.%s" % (
app_model._meta.app_label,
... | <commit_before>from django.conf import settings
class Registry(object):
def __init__(self):
self._partitions = {}
def register(self, key, app_model, expression):
if not isinstance(app_model, basestring):
app_model = "%s.%s" % (
app_model._meta.app_label,
... |
abf2f4209f8adf06bef624e9d0a188eba39c2c7a | cinch/lexer.py | cinch/lexer.py | # This is the lexer. We could build a state machine which would parse
# each token character by character, but the point of this project is to
# be as simple as possible, so we will literally just split the string on
# spaces, scrub all newlines, and filter out any empty strings
def lex(source):
"""Lex the source... | import re
# This is the lexer. We could build a state machine which would parse
# each token character by character, but the point of this project is to
# be as simple as possible, so we will literally just split the string on
# spaces, scrub all newlines, and filter out any empty strings
def lex(source):
"""Lex... | Remove comments as part of lexing | Remove comments as part of lexing
| Python | mit | iankronquist/cinch-lang,tschuy/cinch-lang | # This is the lexer. We could build a state machine which would parse
# each token character by character, but the point of this project is to
# be as simple as possible, so we will literally just split the string on
# spaces, scrub all newlines, and filter out any empty strings
def lex(source):
"""Lex the source... | import re
# This is the lexer. We could build a state machine which would parse
# each token character by character, but the point of this project is to
# be as simple as possible, so we will literally just split the string on
# spaces, scrub all newlines, and filter out any empty strings
def lex(source):
"""Lex... | <commit_before># This is the lexer. We could build a state machine which would parse
# each token character by character, but the point of this project is to
# be as simple as possible, so we will literally just split the string on
# spaces, scrub all newlines, and filter out any empty strings
def lex(source):
""... | import re
# This is the lexer. We could build a state machine which would parse
# each token character by character, but the point of this project is to
# be as simple as possible, so we will literally just split the string on
# spaces, scrub all newlines, and filter out any empty strings
def lex(source):
"""Lex... | # This is the lexer. We could build a state machine which would parse
# each token character by character, but the point of this project is to
# be as simple as possible, so we will literally just split the string on
# spaces, scrub all newlines, and filter out any empty strings
def lex(source):
"""Lex the source... | <commit_before># This is the lexer. We could build a state machine which would parse
# each token character by character, but the point of this project is to
# be as simple as possible, so we will literally just split the string on
# spaces, scrub all newlines, and filter out any empty strings
def lex(source):
""... |
b51e4e7af7065a487f5ee91697fda8848c209faf | libpasteurize/fixes/fix_newstyle.py | libpasteurize/fixes/fix_newstyle.py | u"""
Fixer for "class Foo: ..." -> "class Foo(object): ..."
"""
from lib2to3 import fixer_base
from lib2to3.fixer_util import LParen, RParen, Name
from libfuturize.fixer_util import touch_import_top
def insert_object(node, idx):
node.insert_child(idx, RParen())
node.insert_child(idx, Name(u"object"))
no... | u"""
Fixer for "class Foo: ..." -> "class Foo(object): ..."
"""
from lib2to3 import fixer_base
from lib2to3.fixer_util import LParen, RParen, Name
from libfuturize.fixer_util import touch_import_top
def insert_object(node, idx):
node.insert_child(idx, RParen())
node.insert_child(idx, Name(u"object"))
no... | Generalize fixer for old->new-style classes to accept "class C():" | Generalize fixer for old->new-style classes to accept "class C():"
| Python | mit | michaelpacer/python-future,PythonCharmers/python-future,QuLogic/python-future,krischer/python-future,michaelpacer/python-future,PythonCharmers/python-future,QuLogic/python-future,krischer/python-future | u"""
Fixer for "class Foo: ..." -> "class Foo(object): ..."
"""
from lib2to3 import fixer_base
from lib2to3.fixer_util import LParen, RParen, Name
from libfuturize.fixer_util import touch_import_top
def insert_object(node, idx):
node.insert_child(idx, RParen())
node.insert_child(idx, Name(u"object"))
no... | u"""
Fixer for "class Foo: ..." -> "class Foo(object): ..."
"""
from lib2to3 import fixer_base
from lib2to3.fixer_util import LParen, RParen, Name
from libfuturize.fixer_util import touch_import_top
def insert_object(node, idx):
node.insert_child(idx, RParen())
node.insert_child(idx, Name(u"object"))
no... | <commit_before>u"""
Fixer for "class Foo: ..." -> "class Foo(object): ..."
"""
from lib2to3 import fixer_base
from lib2to3.fixer_util import LParen, RParen, Name
from libfuturize.fixer_util import touch_import_top
def insert_object(node, idx):
node.insert_child(idx, RParen())
node.insert_child(idx, Name(u"o... | u"""
Fixer for "class Foo: ..." -> "class Foo(object): ..."
"""
from lib2to3 import fixer_base
from lib2to3.fixer_util import LParen, RParen, Name
from libfuturize.fixer_util import touch_import_top
def insert_object(node, idx):
node.insert_child(idx, RParen())
node.insert_child(idx, Name(u"object"))
no... | u"""
Fixer for "class Foo: ..." -> "class Foo(object): ..."
"""
from lib2to3 import fixer_base
from lib2to3.fixer_util import LParen, RParen, Name
from libfuturize.fixer_util import touch_import_top
def insert_object(node, idx):
node.insert_child(idx, RParen())
node.insert_child(idx, Name(u"object"))
no... | <commit_before>u"""
Fixer for "class Foo: ..." -> "class Foo(object): ..."
"""
from lib2to3 import fixer_base
from lib2to3.fixer_util import LParen, RParen, Name
from libfuturize.fixer_util import touch_import_top
def insert_object(node, idx):
node.insert_child(idx, RParen())
node.insert_child(idx, Name(u"o... |
5c12b0c04b25e414b1bd04250cde0c3b1f869104 | hr_emergency_contact/models/hr_employee.py | hr_emergency_contact/models/hr_employee.py | # -*- coding: utf-8 -*-
# © 2011 Michael Telahun Makonnen <[email protected]>
# © 2016 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields
class HrEmployee(models.Model):
_name = 'hr.employee'
_inherit = 'hr.employee'
emergency... | # -*- coding: utf-8 -*-
# © 2011 Michael Telahun Makonnen <[email protected]>
# © 2016 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields
class HrEmployee(models.Model):
_inherit = 'hr.employee'
emergency_contact_ids = fields.Many... | Remove _name attribute on hr.employee | Remove _name attribute on hr.employee
| Python | agpl-3.0 | VitalPet/hr,thinkopensolutions/hr,VitalPet/hr,xpansa/hr,Eficent/hr,Eficent/hr,feketemihai/hr,feketemihai/hr,acsone/hr,open-synergy/hr,open-synergy/hr,xpansa/hr,acsone/hr,thinkopensolutions/hr | # -*- coding: utf-8 -*-
# © 2011 Michael Telahun Makonnen <[email protected]>
# © 2016 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields
class HrEmployee(models.Model):
_name = 'hr.employee'
_inherit = 'hr.employee'
emergency... | # -*- coding: utf-8 -*-
# © 2011 Michael Telahun Makonnen <[email protected]>
# © 2016 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields
class HrEmployee(models.Model):
_inherit = 'hr.employee'
emergency_contact_ids = fields.Many... | <commit_before># -*- coding: utf-8 -*-
# © 2011 Michael Telahun Makonnen <[email protected]>
# © 2016 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields
class HrEmployee(models.Model):
_name = 'hr.employee'
_inherit = 'hr.employee'... | # -*- coding: utf-8 -*-
# © 2011 Michael Telahun Makonnen <[email protected]>
# © 2016 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields
class HrEmployee(models.Model):
_inherit = 'hr.employee'
emergency_contact_ids = fields.Many... | # -*- coding: utf-8 -*-
# © 2011 Michael Telahun Makonnen <[email protected]>
# © 2016 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields
class HrEmployee(models.Model):
_name = 'hr.employee'
_inherit = 'hr.employee'
emergency... | <commit_before># -*- coding: utf-8 -*-
# © 2011 Michael Telahun Makonnen <[email protected]>
# © 2016 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields
class HrEmployee(models.Model):
_name = 'hr.employee'
_inherit = 'hr.employee'... |
7b4f69971684bf2c5abfa50876583eb7c640bdac | kuulemma/views/feedback.py | kuulemma/views/feedback.py | from flask import Blueprint, abort, jsonify, request
from flask.ext.mail import Message
from kuulemma.extensions import db, mail
from kuulemma.models import Feedback
from kuulemma.settings.base import FEEDBACK_RECIPIENTS
feedback = Blueprint(
name='feedback',
import_name=__name__,
url_prefix='/feedback'
)... | from flask import abort, Blueprint, jsonify, request
from flask.ext.mail import Message
from kuulemma.extensions import db, mail
from kuulemma.models import Feedback
from kuulemma.settings.base import FEEDBACK_RECIPIENTS
feedback = Blueprint(
name='feedback',
import_name=__name__,
url_prefix='/feedback'
)... | Fix order of imports to comply with isort | Fix order of imports to comply with isort
| Python | agpl-3.0 | City-of-Helsinki/kuulemma,fastmonkeys/kuulemma,City-of-Helsinki/kuulemma,fastmonkeys/kuulemma,City-of-Helsinki/kuulemma,fastmonkeys/kuulemma | from flask import Blueprint, abort, jsonify, request
from flask.ext.mail import Message
from kuulemma.extensions import db, mail
from kuulemma.models import Feedback
from kuulemma.settings.base import FEEDBACK_RECIPIENTS
feedback = Blueprint(
name='feedback',
import_name=__name__,
url_prefix='/feedback'
)... | from flask import abort, Blueprint, jsonify, request
from flask.ext.mail import Message
from kuulemma.extensions import db, mail
from kuulemma.models import Feedback
from kuulemma.settings.base import FEEDBACK_RECIPIENTS
feedback = Blueprint(
name='feedback',
import_name=__name__,
url_prefix='/feedback'
)... | <commit_before>from flask import Blueprint, abort, jsonify, request
from flask.ext.mail import Message
from kuulemma.extensions import db, mail
from kuulemma.models import Feedback
from kuulemma.settings.base import FEEDBACK_RECIPIENTS
feedback = Blueprint(
name='feedback',
import_name=__name__,
url_prefi... | from flask import abort, Blueprint, jsonify, request
from flask.ext.mail import Message
from kuulemma.extensions import db, mail
from kuulemma.models import Feedback
from kuulemma.settings.base import FEEDBACK_RECIPIENTS
feedback = Blueprint(
name='feedback',
import_name=__name__,
url_prefix='/feedback'
)... | from flask import Blueprint, abort, jsonify, request
from flask.ext.mail import Message
from kuulemma.extensions import db, mail
from kuulemma.models import Feedback
from kuulemma.settings.base import FEEDBACK_RECIPIENTS
feedback = Blueprint(
name='feedback',
import_name=__name__,
url_prefix='/feedback'
)... | <commit_before>from flask import Blueprint, abort, jsonify, request
from flask.ext.mail import Message
from kuulemma.extensions import db, mail
from kuulemma.models import Feedback
from kuulemma.settings.base import FEEDBACK_RECIPIENTS
feedback = Blueprint(
name='feedback',
import_name=__name__,
url_prefi... |
43cc10fff32ef98522ba100da34816049908abb7 | zeus/api/resources/auth_index.py | zeus/api/resources/auth_index.py | from flask import session
from zeus import auth
from zeus.models import Identity, User
from .base import Resource
from ..schemas import IdentitySchema, UserSchema
user_schema = UserSchema(strict=True)
identities_schema = IdentitySchema(many=True, strict=True)
class AuthIndexResource(Resource):
auth_required = ... | from flask import session
from zeus import auth
from zeus.models import Email, Identity, User
from .base import Resource
from ..schemas import EmailSchema, IdentitySchema, UserSchema
emails_schema = EmailSchema(many=True, strict=True)
identities_schema = IdentitySchema(many=True, strict=True)
user_schema = UserSchem... | Add emails to auth details | Add emails to auth details
| Python | apache-2.0 | getsentry/zeus,getsentry/zeus,getsentry/zeus,getsentry/zeus | from flask import session
from zeus import auth
from zeus.models import Identity, User
from .base import Resource
from ..schemas import IdentitySchema, UserSchema
user_schema = UserSchema(strict=True)
identities_schema = IdentitySchema(many=True, strict=True)
class AuthIndexResource(Resource):
auth_required = ... | from flask import session
from zeus import auth
from zeus.models import Email, Identity, User
from .base import Resource
from ..schemas import EmailSchema, IdentitySchema, UserSchema
emails_schema = EmailSchema(many=True, strict=True)
identities_schema = IdentitySchema(many=True, strict=True)
user_schema = UserSchem... | <commit_before>from flask import session
from zeus import auth
from zeus.models import Identity, User
from .base import Resource
from ..schemas import IdentitySchema, UserSchema
user_schema = UserSchema(strict=True)
identities_schema = IdentitySchema(many=True, strict=True)
class AuthIndexResource(Resource):
a... | from flask import session
from zeus import auth
from zeus.models import Email, Identity, User
from .base import Resource
from ..schemas import EmailSchema, IdentitySchema, UserSchema
emails_schema = EmailSchema(many=True, strict=True)
identities_schema = IdentitySchema(many=True, strict=True)
user_schema = UserSchem... | from flask import session
from zeus import auth
from zeus.models import Identity, User
from .base import Resource
from ..schemas import IdentitySchema, UserSchema
user_schema = UserSchema(strict=True)
identities_schema = IdentitySchema(many=True, strict=True)
class AuthIndexResource(Resource):
auth_required = ... | <commit_before>from flask import session
from zeus import auth
from zeus.models import Identity, User
from .base import Resource
from ..schemas import IdentitySchema, UserSchema
user_schema = UserSchema(strict=True)
identities_schema = IdentitySchema(many=True, strict=True)
class AuthIndexResource(Resource):
a... |
ec9d542e4a6df758b3847486c9084ff8a31b6a7c | judge/management/commands/copy_language.py | judge/management/commands/copy_language.py | from django.core.management.base import BaseCommand, CommandError
from judge.models import Language
class Command(BaseCommand):
help = 'allows the problems allowed to be submitted in the <source> language to be submitted in <target> language'
def add_arguments(self, parser):
parser.add_argument('sou... | from django.core.management.base import BaseCommand, CommandError
from judge.models import Language
class Command(BaseCommand):
help = 'allows the problems allowed to be submitted in the <source> language to be submitted in <target> language'
def add_arguments(self, parser):
parser.add_argument('sou... | Use .set() rather than direct assignment | Use .set() rather than direct assignment | Python | agpl-3.0 | DMOJ/site,DMOJ/site,DMOJ/site,DMOJ/site | from django.core.management.base import BaseCommand, CommandError
from judge.models import Language
class Command(BaseCommand):
help = 'allows the problems allowed to be submitted in the <source> language to be submitted in <target> language'
def add_arguments(self, parser):
parser.add_argument('sou... | from django.core.management.base import BaseCommand, CommandError
from judge.models import Language
class Command(BaseCommand):
help = 'allows the problems allowed to be submitted in the <source> language to be submitted in <target> language'
def add_arguments(self, parser):
parser.add_argument('sou... | <commit_before>from django.core.management.base import BaseCommand, CommandError
from judge.models import Language
class Command(BaseCommand):
help = 'allows the problems allowed to be submitted in the <source> language to be submitted in <target> language'
def add_arguments(self, parser):
parser.ad... | from django.core.management.base import BaseCommand, CommandError
from judge.models import Language
class Command(BaseCommand):
help = 'allows the problems allowed to be submitted in the <source> language to be submitted in <target> language'
def add_arguments(self, parser):
parser.add_argument('sou... | from django.core.management.base import BaseCommand, CommandError
from judge.models import Language
class Command(BaseCommand):
help = 'allows the problems allowed to be submitted in the <source> language to be submitted in <target> language'
def add_arguments(self, parser):
parser.add_argument('sou... | <commit_before>from django.core.management.base import BaseCommand, CommandError
from judge.models import Language
class Command(BaseCommand):
help = 'allows the problems allowed to be submitted in the <source> language to be submitted in <target> language'
def add_arguments(self, parser):
parser.ad... |
692234e72862839d8c14fb0f1a6ebe7259b15413 | core/report.py | core/report.py | import config
def sendMail():
print config.config
print "Sent e-mail"
def sendToGrapite():
pass
| from config import config as conf
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import smtplib
import time
import pushnotify
def sendMail(recipients, subject, body):
if not isinstance( recipients, list ):
recipients = [ recipients ]
session = smtplib.SMTP( conf.ge... | Complete e-mail, Graphite and push notification support | Complete e-mail, Graphite and push notification support
| Python | mit | nlindblad/ocarina,nlindblad/ocarina | import config
def sendMail():
print config.config
print "Sent e-mail"
def sendToGrapite():
pass
Complete e-mail, Graphite and push notification support | from config import config as conf
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import smtplib
import time
import pushnotify
def sendMail(recipients, subject, body):
if not isinstance( recipients, list ):
recipients = [ recipients ]
session = smtplib.SMTP( conf.ge... | <commit_before>import config
def sendMail():
print config.config
print "Sent e-mail"
def sendToGrapite():
pass
<commit_msg>Complete e-mail, Graphite and push notification support<commit_after> | from config import config as conf
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import smtplib
import time
import pushnotify
def sendMail(recipients, subject, body):
if not isinstance( recipients, list ):
recipients = [ recipients ]
session = smtplib.SMTP( conf.ge... | import config
def sendMail():
print config.config
print "Sent e-mail"
def sendToGrapite():
pass
Complete e-mail, Graphite and push notification supportfrom config import config as conf
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import smtplib
import time
import pu... | <commit_before>import config
def sendMail():
print config.config
print "Sent e-mail"
def sendToGrapite():
pass
<commit_msg>Complete e-mail, Graphite and push notification support<commit_after>from config import config as conf
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMET... |
482bed9a37f49ba4ae68c94cf69edf28586be07d | examples/bank_account_debits.py | examples/bank_account_debits.py | '''
Learn how to verify a bank account so you can debit with it.
'''
from __future__ import unicode_literals
import balanced
def init():
key = balanced.APIKey().save()
balanced.configure(key.secret)
balanced.Marketplace().save()
def main():
init()
# create a bank account
bank_account = bal... | '''
Learn how to verify a bank account so you can debit with it.
'''
from __future__ import unicode_literals
import balanced
def init():
key = balanced.APIKey().save()
balanced.configure(key.secret)
balanced.Marketplace().save()
def main():
init()
# create a bank account
bank_account = bal... | Update example for bank account debits for confirm() | Update example for bank account debits for confirm()
| Python | mit | balanced/balanced-python,trenton42/txbalanced | '''
Learn how to verify a bank account so you can debit with it.
'''
from __future__ import unicode_literals
import balanced
def init():
key = balanced.APIKey().save()
balanced.configure(key.secret)
balanced.Marketplace().save()
def main():
init()
# create a bank account
bank_account = bal... | '''
Learn how to verify a bank account so you can debit with it.
'''
from __future__ import unicode_literals
import balanced
def init():
key = balanced.APIKey().save()
balanced.configure(key.secret)
balanced.Marketplace().save()
def main():
init()
# create a bank account
bank_account = bal... | <commit_before>'''
Learn how to verify a bank account so you can debit with it.
'''
from __future__ import unicode_literals
import balanced
def init():
key = balanced.APIKey().save()
balanced.configure(key.secret)
balanced.Marketplace().save()
def main():
init()
# create a bank account
ban... | '''
Learn how to verify a bank account so you can debit with it.
'''
from __future__ import unicode_literals
import balanced
def init():
key = balanced.APIKey().save()
balanced.configure(key.secret)
balanced.Marketplace().save()
def main():
init()
# create a bank account
bank_account = bal... | '''
Learn how to verify a bank account so you can debit with it.
'''
from __future__ import unicode_literals
import balanced
def init():
key = balanced.APIKey().save()
balanced.configure(key.secret)
balanced.Marketplace().save()
def main():
init()
# create a bank account
bank_account = bal... | <commit_before>'''
Learn how to verify a bank account so you can debit with it.
'''
from __future__ import unicode_literals
import balanced
def init():
key = balanced.APIKey().save()
balanced.configure(key.secret)
balanced.Marketplace().save()
def main():
init()
# create a bank account
ban... |
41fccd9d5060f2b8dcedde2cb9ab3391b48df420 | scripts/generate_input_syntax.py | scripts/generate_input_syntax.py | #!/usr/bin/env python
import sys, os
# get the location of this script
app_path = os.path.abspath(os.path.dirname(sys.argv[0]))
# this script is actually in the scripts subdirectory, so go up a level
app_path += '/..'
# Set the name of the application here and moose directory relative to the application
app_name = 'R... | #!/usr/bin/env python
import sys, os
# get the location of this script
app_path = os.path.abspath(os.path.dirname(sys.argv[0]))
# Set the name of the application here and moose directory relative to the application
app_name = 'raven'
MOOSE_DIR = os.path.abspath(os.path.join(app_path, '..', '..' 'moose'))
FRAMEWORK_D... | Update scripts to reflect new MOOSE_DIR definition | Update scripts to reflect new MOOSE_DIR definition
r25009
| Python | apache-2.0 | idaholab/raven,idaholab/raven,idaholab/raven,idaholab/raven,joshua-cogliati-inl/raven,joshua-cogliati-inl/raven,joshua-cogliati-inl/raven,idaholab/raven,idaholab/raven,joshua-cogliati-inl/raven,joshua-cogliati-inl/raven,idaholab/raven,joshua-cogliati-inl/raven,joshua-cogliati-inl/raven | #!/usr/bin/env python
import sys, os
# get the location of this script
app_path = os.path.abspath(os.path.dirname(sys.argv[0]))
# this script is actually in the scripts subdirectory, so go up a level
app_path += '/..'
# Set the name of the application here and moose directory relative to the application
app_name = 'R... | #!/usr/bin/env python
import sys, os
# get the location of this script
app_path = os.path.abspath(os.path.dirname(sys.argv[0]))
# Set the name of the application here and moose directory relative to the application
app_name = 'raven'
MOOSE_DIR = os.path.abspath(os.path.join(app_path, '..', '..' 'moose'))
FRAMEWORK_D... | <commit_before>#!/usr/bin/env python
import sys, os
# get the location of this script
app_path = os.path.abspath(os.path.dirname(sys.argv[0]))
# this script is actually in the scripts subdirectory, so go up a level
app_path += '/..'
# Set the name of the application here and moose directory relative to the applicatio... | #!/usr/bin/env python
import sys, os
# get the location of this script
app_path = os.path.abspath(os.path.dirname(sys.argv[0]))
# Set the name of the application here and moose directory relative to the application
app_name = 'raven'
MOOSE_DIR = os.path.abspath(os.path.join(app_path, '..', '..' 'moose'))
FRAMEWORK_D... | #!/usr/bin/env python
import sys, os
# get the location of this script
app_path = os.path.abspath(os.path.dirname(sys.argv[0]))
# this script is actually in the scripts subdirectory, so go up a level
app_path += '/..'
# Set the name of the application here and moose directory relative to the application
app_name = 'R... | <commit_before>#!/usr/bin/env python
import sys, os
# get the location of this script
app_path = os.path.abspath(os.path.dirname(sys.argv[0]))
# this script is actually in the scripts subdirectory, so go up a level
app_path += '/..'
# Set the name of the application here and moose directory relative to the applicatio... |
f9247d6b869af4f1a57afd907d7fb9a0545cdec5 | anserv/frontend/views.py | anserv/frontend/views.py | from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.contrib.auth.decorators import login_required
from django.conf import settings... | from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.contrib.auth.decorators import login_required
from django.conf import settings... | Change structure of the redirect | Change structure of the redirect
| Python | agpl-3.0 | edx/edxanalytics,edx/insights,edx/edxanalytics,edx/edxanalytics,edx/insights,edx/edxanalytics | from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.contrib.auth.decorators import login_required
from django.conf import settings... | from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.contrib.auth.decorators import login_required
from django.conf import settings... | <commit_before>from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.contrib.auth.decorators import login_required
from django.conf ... | from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.contrib.auth.decorators import login_required
from django.conf import settings... | from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.contrib.auth.decorators import login_required
from django.conf import settings... | <commit_before>from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.contrib.auth.decorators import login_required
from django.conf ... |
1cfaf387af8e373d2bf3fdc8d6144f889489ba13 | esis/cli.py | esis/cli.py | # -*- coding: utf-8 -*-
"""Elastic Search Index & Search."""
import argparse
def main():
"""Entry point for the esis.py script."""
args = parse_arguments()
print args
def parse_arguments():
"""Parse command line arguments.
:returns: Parsed arguments
:rtype: argparse.Namespace
"""
p... | # -*- coding: utf-8 -*-
"""Elastic Search Index & Search."""
import argparse
import os
def main():
"""Entry point for the esis.py script."""
args = parse_arguments()
print args
def valid_directory(path):
"""Directory validation."""
if not os.path.isdir(path):
raise argparse.ArgumentTypeE... | Add directory validation to argument parsing | Add directory validation to argument parsing
| Python | mit | jcollado/esis | # -*- coding: utf-8 -*-
"""Elastic Search Index & Search."""
import argparse
def main():
"""Entry point for the esis.py script."""
args = parse_arguments()
print args
def parse_arguments():
"""Parse command line arguments.
:returns: Parsed arguments
:rtype: argparse.Namespace
"""
p... | # -*- coding: utf-8 -*-
"""Elastic Search Index & Search."""
import argparse
import os
def main():
"""Entry point for the esis.py script."""
args = parse_arguments()
print args
def valid_directory(path):
"""Directory validation."""
if not os.path.isdir(path):
raise argparse.ArgumentTypeE... | <commit_before># -*- coding: utf-8 -*-
"""Elastic Search Index & Search."""
import argparse
def main():
"""Entry point for the esis.py script."""
args = parse_arguments()
print args
def parse_arguments():
"""Parse command line arguments.
:returns: Parsed arguments
:rtype: argparse.Namespace... | # -*- coding: utf-8 -*-
"""Elastic Search Index & Search."""
import argparse
import os
def main():
"""Entry point for the esis.py script."""
args = parse_arguments()
print args
def valid_directory(path):
"""Directory validation."""
if not os.path.isdir(path):
raise argparse.ArgumentTypeE... | # -*- coding: utf-8 -*-
"""Elastic Search Index & Search."""
import argparse
def main():
"""Entry point for the esis.py script."""
args = parse_arguments()
print args
def parse_arguments():
"""Parse command line arguments.
:returns: Parsed arguments
:rtype: argparse.Namespace
"""
p... | <commit_before># -*- coding: utf-8 -*-
"""Elastic Search Index & Search."""
import argparse
def main():
"""Entry point for the esis.py script."""
args = parse_arguments()
print args
def parse_arguments():
"""Parse command line arguments.
:returns: Parsed arguments
:rtype: argparse.Namespace... |
c9215a00bfe8d1edaf2840f6cd4b3ae8061c26f5 | allauth_uwum/provider.py | allauth_uwum/provider.py | """The UWUM (Unified WeGovNow User Management) provider."""
from allauth.socialaccount import app_settings
from allauth.socialaccount.providers import registry
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class UWUMAccount... | """The UWUM (Unified WeGovNow User Management) provider."""
from allauth.socialaccount import app_settings
from allauth.socialaccount.providers import registry
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class UWUMAccount... | Set "notify_email" in default scope only if settings allow it | Set "notify_email" in default scope only if settings allow it
| Python | mit | ExCiteS/django-allauth-uwum | """The UWUM (Unified WeGovNow User Management) provider."""
from allauth.socialaccount import app_settings
from allauth.socialaccount.providers import registry
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class UWUMAccount... | """The UWUM (Unified WeGovNow User Management) provider."""
from allauth.socialaccount import app_settings
from allauth.socialaccount.providers import registry
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class UWUMAccount... | <commit_before>"""The UWUM (Unified WeGovNow User Management) provider."""
from allauth.socialaccount import app_settings
from allauth.socialaccount.providers import registry
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
cl... | """The UWUM (Unified WeGovNow User Management) provider."""
from allauth.socialaccount import app_settings
from allauth.socialaccount.providers import registry
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class UWUMAccount... | """The UWUM (Unified WeGovNow User Management) provider."""
from allauth.socialaccount import app_settings
from allauth.socialaccount.providers import registry
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class UWUMAccount... | <commit_before>"""The UWUM (Unified WeGovNow User Management) provider."""
from allauth.socialaccount import app_settings
from allauth.socialaccount.providers import registry
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
cl... |
1a16281c6591ab059db09ab5a8af4826d3f3698a | eche.py | eche.py | #!env python
"""Eche - a simple, lisp like language.
Usage:
eche FILE ...
eche (-h | --help)
eche --version
Options:
-h --help Show this screen.
--version Show version.
"""
import sys
import pathlib
from docopt import docopt
sys.path.append(str(pathlib.Path('.').joinpath('eche')))
import ... | #!env python
"""Eche - a simple, lisp like language.
Usage:
eche [FILE ...]
eche (-h | --help)
eche --version
Options:
-h --help Show this screen.
--version Show version.
"""
import sys
import pathlib
from docopt import docopt
sys.path.append(str(pathlib.Path('.').joinpath('eche')))
impor... | Change args to show repl if no FILEs are given. | Change args to show repl if no FILEs are given.
| Python | mit | skk/eche | #!env python
"""Eche - a simple, lisp like language.
Usage:
eche FILE ...
eche (-h | --help)
eche --version
Options:
-h --help Show this screen.
--version Show version.
"""
import sys
import pathlib
from docopt import docopt
sys.path.append(str(pathlib.Path('.').joinpath('eche')))
import ... | #!env python
"""Eche - a simple, lisp like language.
Usage:
eche [FILE ...]
eche (-h | --help)
eche --version
Options:
-h --help Show this screen.
--version Show version.
"""
import sys
import pathlib
from docopt import docopt
sys.path.append(str(pathlib.Path('.').joinpath('eche')))
impor... | <commit_before>#!env python
"""Eche - a simple, lisp like language.
Usage:
eche FILE ...
eche (-h | --help)
eche --version
Options:
-h --help Show this screen.
--version Show version.
"""
import sys
import pathlib
from docopt import docopt
sys.path.append(str(pathlib.Path('.').joinpath('e... | #!env python
"""Eche - a simple, lisp like language.
Usage:
eche [FILE ...]
eche (-h | --help)
eche --version
Options:
-h --help Show this screen.
--version Show version.
"""
import sys
import pathlib
from docopt import docopt
sys.path.append(str(pathlib.Path('.').joinpath('eche')))
impor... | #!env python
"""Eche - a simple, lisp like language.
Usage:
eche FILE ...
eche (-h | --help)
eche --version
Options:
-h --help Show this screen.
--version Show version.
"""
import sys
import pathlib
from docopt import docopt
sys.path.append(str(pathlib.Path('.').joinpath('eche')))
import ... | <commit_before>#!env python
"""Eche - a simple, lisp like language.
Usage:
eche FILE ...
eche (-h | --help)
eche --version
Options:
-h --help Show this screen.
--version Show version.
"""
import sys
import pathlib
from docopt import docopt
sys.path.append(str(pathlib.Path('.').joinpath('e... |
f1667a27200d63b1c672586017318fd319a7985e | github2/commits.py | github2/commits.py | from github2.core import BaseData, GithubCommand, Attribute, DateAttribute
class Commit(BaseData):
messsage = Attribute("Commit message.")
parents = Attribute("List of parents for this commit.")
url = Attribute("Canonical URL for this commit.")
author = Attribute("Author metadata (dict with name/email... | from github2.core import BaseData, GithubCommand, Attribute, DateAttribute
class Commit(BaseData):
message = Attribute("Commit message.")
parents = Attribute("List of parents for this commit.")
url = Attribute("Canonical URL for this commit.")
author = Attribute("Author metadata (dict with name/email.... | Fix typo messsage -> message | Fix typo messsage -> message
| Python | bsd-3-clause | ask/python-github2 | from github2.core import BaseData, GithubCommand, Attribute, DateAttribute
class Commit(BaseData):
messsage = Attribute("Commit message.")
parents = Attribute("List of parents for this commit.")
url = Attribute("Canonical URL for this commit.")
author = Attribute("Author metadata (dict with name/email... | from github2.core import BaseData, GithubCommand, Attribute, DateAttribute
class Commit(BaseData):
message = Attribute("Commit message.")
parents = Attribute("List of parents for this commit.")
url = Attribute("Canonical URL for this commit.")
author = Attribute("Author metadata (dict with name/email.... | <commit_before>from github2.core import BaseData, GithubCommand, Attribute, DateAttribute
class Commit(BaseData):
messsage = Attribute("Commit message.")
parents = Attribute("List of parents for this commit.")
url = Attribute("Canonical URL for this commit.")
author = Attribute("Author metadata (dict ... | from github2.core import BaseData, GithubCommand, Attribute, DateAttribute
class Commit(BaseData):
message = Attribute("Commit message.")
parents = Attribute("List of parents for this commit.")
url = Attribute("Canonical URL for this commit.")
author = Attribute("Author metadata (dict with name/email.... | from github2.core import BaseData, GithubCommand, Attribute, DateAttribute
class Commit(BaseData):
messsage = Attribute("Commit message.")
parents = Attribute("List of parents for this commit.")
url = Attribute("Canonical URL for this commit.")
author = Attribute("Author metadata (dict with name/email... | <commit_before>from github2.core import BaseData, GithubCommand, Attribute, DateAttribute
class Commit(BaseData):
messsage = Attribute("Commit message.")
parents = Attribute("List of parents for this commit.")
url = Attribute("Canonical URL for this commit.")
author = Attribute("Author metadata (dict ... |
e76ca364ab979e309d34ff458ef2629145a52ce2 | magnum/db/sqlalchemy/alembic/versions/a1136d335540_add_docker_storage_driver_column.py | magnum/db/sqlalchemy/alembic/versions/a1136d335540_add_docker_storage_driver_column.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | Fix for enum type docker_storage_driver | Fix for enum type docker_storage_driver
Create enum type "docker_storage_driver" for migration
This is fixing
oslo_db.exception.DBError: (psycopg2.ProgrammingError) type
"docker_storage_driver" does not exist
Closes-Bug: #1609776
Change-Id: I92d427e90bd73b4114d8688d3761cabac450fc9d
| Python | apache-2.0 | openstack/magnum,openstack/magnum,ArchiFleKs/magnum,ArchiFleKs/magnum | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | <commit_before># Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | <commit_before># Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
6881d127cf55dc96c44467ea807a9288a5108dff | scripts/lib/check_for_course_revisions.py | scripts/lib/check_for_course_revisions.py | from collections import OrderedDict
import json
from .load_data_from_file import load_data_from_file
from .get_old_dict_values import get_old_dict_values
from .log import log
from .paths import make_course_path
def load_previous(course_path):
try:
prior_data = load_data_from_file(course_path)
prior = json.loads... | from collections import OrderedDict
from tzlocal import get_localzone
import json
from .load_data_from_file import load_data_from_file
from .get_old_dict_values import get_old_dict_values
from .log import log
from .paths import make_course_path
def load_previous(course_path):
try:
prior_data = load_data_from_file... | Add '_updated' property to revisions | Add '_updated' property to revisions
| Python | mit | StoDevX/course-data-tools,StoDevX/course-data-tools | from collections import OrderedDict
import json
from .load_data_from_file import load_data_from_file
from .get_old_dict_values import get_old_dict_values
from .log import log
from .paths import make_course_path
def load_previous(course_path):
try:
prior_data = load_data_from_file(course_path)
prior = json.loads... | from collections import OrderedDict
from tzlocal import get_localzone
import json
from .load_data_from_file import load_data_from_file
from .get_old_dict_values import get_old_dict_values
from .log import log
from .paths import make_course_path
def load_previous(course_path):
try:
prior_data = load_data_from_file... | <commit_before>from collections import OrderedDict
import json
from .load_data_from_file import load_data_from_file
from .get_old_dict_values import get_old_dict_values
from .log import log
from .paths import make_course_path
def load_previous(course_path):
try:
prior_data = load_data_from_file(course_path)
pri... | from collections import OrderedDict
from tzlocal import get_localzone
import json
from .load_data_from_file import load_data_from_file
from .get_old_dict_values import get_old_dict_values
from .log import log
from .paths import make_course_path
def load_previous(course_path):
try:
prior_data = load_data_from_file... | from collections import OrderedDict
import json
from .load_data_from_file import load_data_from_file
from .get_old_dict_values import get_old_dict_values
from .log import log
from .paths import make_course_path
def load_previous(course_path):
try:
prior_data = load_data_from_file(course_path)
prior = json.loads... | <commit_before>from collections import OrderedDict
import json
from .load_data_from_file import load_data_from_file
from .get_old_dict_values import get_old_dict_values
from .log import log
from .paths import make_course_path
def load_previous(course_path):
try:
prior_data = load_data_from_file(course_path)
pri... |
646e376a8e9bdc1daaa38ebee2de39e945ab443d | tests/test_cookiecutter_generation.py | tests/test_cookiecutter_generation.py | # -*- coding: utf-8 -*-
import pytest
@pytest.fixture
def context():
return {
"project_name": "My Test Project",
"repo_name": "my_test_project",
"author_name": "Test Author",
"email": "[email protected]",
"description": "A short description of the project.",
"domain_... | # -*- coding: utf-8 -*-
import os
import re
import pytest
from binaryornot.check import is_binary
PATTERN = "{{(\s?cookiecutter)[.](.*?)}}"
RE_OBJ = re.compile(PATTERN)
@pytest.fixture
def context():
return {
"project_name": "My Test Project",
"repo_name": "my_test_project",
"author_nam... | Integrate additional checks of base.py with slight improvements | Integrate additional checks of base.py with slight improvements
| Python | bsd-3-clause | webyneter/cookiecutter-django,kappataumu/cookiecutter-django,crdoconnor/cookiecutter-django,gappsexperts/cookiecutter-django,mjhea0/cookiecutter-django,mistalaba/cookiecutter-django,calculuscowboy/cookiecutter-django,hairychris/cookiecutter-django,kappataumu/cookiecutter-django,thisjustin/cookiecutter-django,ddiazpinto... | # -*- coding: utf-8 -*-
import pytest
@pytest.fixture
def context():
return {
"project_name": "My Test Project",
"repo_name": "my_test_project",
"author_name": "Test Author",
"email": "[email protected]",
"description": "A short description of the project.",
"domain_... | # -*- coding: utf-8 -*-
import os
import re
import pytest
from binaryornot.check import is_binary
PATTERN = "{{(\s?cookiecutter)[.](.*?)}}"
RE_OBJ = re.compile(PATTERN)
@pytest.fixture
def context():
return {
"project_name": "My Test Project",
"repo_name": "my_test_project",
"author_nam... | <commit_before># -*- coding: utf-8 -*-
import pytest
@pytest.fixture
def context():
return {
"project_name": "My Test Project",
"repo_name": "my_test_project",
"author_name": "Test Author",
"email": "[email protected]",
"description": "A short description of the project.",
... | # -*- coding: utf-8 -*-
import os
import re
import pytest
from binaryornot.check import is_binary
PATTERN = "{{(\s?cookiecutter)[.](.*?)}}"
RE_OBJ = re.compile(PATTERN)
@pytest.fixture
def context():
return {
"project_name": "My Test Project",
"repo_name": "my_test_project",
"author_nam... | # -*- coding: utf-8 -*-
import pytest
@pytest.fixture
def context():
return {
"project_name": "My Test Project",
"repo_name": "my_test_project",
"author_name": "Test Author",
"email": "[email protected]",
"description": "A short description of the project.",
"domain_... | <commit_before># -*- coding: utf-8 -*-
import pytest
@pytest.fixture
def context():
return {
"project_name": "My Test Project",
"repo_name": "my_test_project",
"author_name": "Test Author",
"email": "[email protected]",
"description": "A short description of the project.",
... |
cf457a8ba688b33748bb03baa5a77d9b4e638e9d | emote/emote.py | emote/emote.py | """ A simple CLI tool for quickly copying common emoticon/emoji to your
clipboard. """
import pyperclip
import json
import sys
import argparse
with open("mapping.json") as f:
emotes = json.load(f)
def main():
parser = argparse.ArgumentParser(
description=sys.modules[__name__].__doc__,
... | """ A simple CLI tool for quickly copying common emoticon/emoji to your
clipboard. """
import pyperclip
import json
import sys
import argparse
with open("mapping.json") as f:
emotes = json.load(f)
def parse_arguments():
parser = argparse.ArgumentParser(
description=sys.modules[__name__].__doc__,
... | Add partially implemented list option. | Add partially implemented list option.
| Python | mit | d6e/emotion | """ A simple CLI tool for quickly copying common emoticon/emoji to your
clipboard. """
import pyperclip
import json
import sys
import argparse
with open("mapping.json") as f:
emotes = json.load(f)
def main():
parser = argparse.ArgumentParser(
description=sys.modules[__name__].__doc__,
... | """ A simple CLI tool for quickly copying common emoticon/emoji to your
clipboard. """
import pyperclip
import json
import sys
import argparse
with open("mapping.json") as f:
emotes = json.load(f)
def parse_arguments():
parser = argparse.ArgumentParser(
description=sys.modules[__name__].__doc__,
... | <commit_before>""" A simple CLI tool for quickly copying common emoticon/emoji to your
clipboard. """
import pyperclip
import json
import sys
import argparse
with open("mapping.json") as f:
emotes = json.load(f)
def main():
parser = argparse.ArgumentParser(
description=sys.modules[__name__].__doc_... | """ A simple CLI tool for quickly copying common emoticon/emoji to your
clipboard. """
import pyperclip
import json
import sys
import argparse
with open("mapping.json") as f:
emotes = json.load(f)
def parse_arguments():
parser = argparse.ArgumentParser(
description=sys.modules[__name__].__doc__,
... | """ A simple CLI tool for quickly copying common emoticon/emoji to your
clipboard. """
import pyperclip
import json
import sys
import argparse
with open("mapping.json") as f:
emotes = json.load(f)
def main():
parser = argparse.ArgumentParser(
description=sys.modules[__name__].__doc__,
... | <commit_before>""" A simple CLI tool for quickly copying common emoticon/emoji to your
clipboard. """
import pyperclip
import json
import sys
import argparse
with open("mapping.json") as f:
emotes = json.load(f)
def main():
parser = argparse.ArgumentParser(
description=sys.modules[__name__].__doc_... |
f76a66809237af29de8bfaeacd017d8f8b60df78 | python/http_checker.py | python/http_checker.py | import unittest
import requests
import lxml.html
class TestHtmlTask(unittest.TestCase):
def setUp(self):
self.ulr_google = "https://www.google.com.ua/"
self.url_habr = "http://habrahabr.ru/hub/gdev/"
def test_1(self):
expected_response_1 = 200
r = requests.get(self.ulr_google)... | import unittest
import requests
import lxml.html
import xmlrunner
class TestHtmlTask(unittest.TestCase):
def setUp(self):
self.urls = open("urls.txt", 'r')
self.url_google = self.urls.readline()
self.url_habr = self.urls.readline()
self.urls.close()
def test_1(self):
e... | Save test results to XML added | Save test results to XML added | Python | mit | amazpyel/sqa_training,amazpyel/sqa_training,amazpyel/sqa_training | import unittest
import requests
import lxml.html
class TestHtmlTask(unittest.TestCase):
def setUp(self):
self.ulr_google = "https://www.google.com.ua/"
self.url_habr = "http://habrahabr.ru/hub/gdev/"
def test_1(self):
expected_response_1 = 200
r = requests.get(self.ulr_google)... | import unittest
import requests
import lxml.html
import xmlrunner
class TestHtmlTask(unittest.TestCase):
def setUp(self):
self.urls = open("urls.txt", 'r')
self.url_google = self.urls.readline()
self.url_habr = self.urls.readline()
self.urls.close()
def test_1(self):
e... | <commit_before>import unittest
import requests
import lxml.html
class TestHtmlTask(unittest.TestCase):
def setUp(self):
self.ulr_google = "https://www.google.com.ua/"
self.url_habr = "http://habrahabr.ru/hub/gdev/"
def test_1(self):
expected_response_1 = 200
r = requests.get(s... | import unittest
import requests
import lxml.html
import xmlrunner
class TestHtmlTask(unittest.TestCase):
def setUp(self):
self.urls = open("urls.txt", 'r')
self.url_google = self.urls.readline()
self.url_habr = self.urls.readline()
self.urls.close()
def test_1(self):
e... | import unittest
import requests
import lxml.html
class TestHtmlTask(unittest.TestCase):
def setUp(self):
self.ulr_google = "https://www.google.com.ua/"
self.url_habr = "http://habrahabr.ru/hub/gdev/"
def test_1(self):
expected_response_1 = 200
r = requests.get(self.ulr_google)... | <commit_before>import unittest
import requests
import lxml.html
class TestHtmlTask(unittest.TestCase):
def setUp(self):
self.ulr_google = "https://www.google.com.ua/"
self.url_habr = "http://habrahabr.ru/hub/gdev/"
def test_1(self):
expected_response_1 = 200
r = requests.get(s... |
ec5bcd6a2ea41651e9a64ee1e5315b3bb4d06306 | hydroshare/urls.py | hydroshare/urls.py | from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.auth import views as auth_views
admin.autodiscover()
urlpatterns = [
url("^mmh-admin/", include(admin.site.urls)),
url(r'^accounts/login/$'... | from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.auth import views as auth_views
admin.autodiscover()
urlpatterns = [
url("^mmh-admin/", include(admin.site.urls)),
url(r'^accounts/login/$'... | Clarify comment around inclusion of static serving | Clarify comment around inclusion of static serving
| Python | bsd-3-clause | ResearchSoftwareInstitute/MyHPOM,ResearchSoftwareInstitute/MyHPOM,ResearchSoftwareInstitute/MyHPOM,ResearchSoftwareInstitute/MyHPOM,ResearchSoftwareInstitute/MyHPOM | from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.auth import views as auth_views
admin.autodiscover()
urlpatterns = [
url("^mmh-admin/", include(admin.site.urls)),
url(r'^accounts/login/$'... | from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.auth import views as auth_views
admin.autodiscover()
urlpatterns = [
url("^mmh-admin/", include(admin.site.urls)),
url(r'^accounts/login/$'... | <commit_before>from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.auth import views as auth_views
admin.autodiscover()
urlpatterns = [
url("^mmh-admin/", include(admin.site.urls)),
url(r'^ac... | from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.auth import views as auth_views
admin.autodiscover()
urlpatterns = [
url("^mmh-admin/", include(admin.site.urls)),
url(r'^accounts/login/$'... | from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.auth import views as auth_views
admin.autodiscover()
urlpatterns = [
url("^mmh-admin/", include(admin.site.urls)),
url(r'^accounts/login/$'... | <commit_before>from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.auth import views as auth_views
admin.autodiscover()
urlpatterns = [
url("^mmh-admin/", include(admin.site.urls)),
url(r'^ac... |
9864f9c60e65fa73f15504950df5ce71baf23dcb | ideascube/utils.py | ideascube/utils.py | import sys
from django.conf import settings
class classproperty(property):
"""
Use it to decorate a classmethod to make it a "class property".
"""
def __get__(self, cls, owner):
return self.fget.__get__(None, owner)()
def get_server_name():
# Import here to avoid cyclic import
from ... | import sys
from django.conf import settings
class classproperty(property):
"""
Use it to decorate a classmethod to make it a "class property".
"""
def __get__(self, cls, owner):
return self.fget.__get__(None, owner)()
def get_server_name():
# Import here to avoid cyclic import
from ... | Use the API as it was intended | Use the API as it was intended
| Python | agpl-3.0 | ideascube/ideascube,ideascube/ideascube,ideascube/ideascube,ideascube/ideascube | import sys
from django.conf import settings
class classproperty(property):
"""
Use it to decorate a classmethod to make it a "class property".
"""
def __get__(self, cls, owner):
return self.fget.__get__(None, owner)()
def get_server_name():
# Import here to avoid cyclic import
from ... | import sys
from django.conf import settings
class classproperty(property):
"""
Use it to decorate a classmethod to make it a "class property".
"""
def __get__(self, cls, owner):
return self.fget.__get__(None, owner)()
def get_server_name():
# Import here to avoid cyclic import
from ... | <commit_before>import sys
from django.conf import settings
class classproperty(property):
"""
Use it to decorate a classmethod to make it a "class property".
"""
def __get__(self, cls, owner):
return self.fget.__get__(None, owner)()
def get_server_name():
# Import here to avoid cyclic i... | import sys
from django.conf import settings
class classproperty(property):
"""
Use it to decorate a classmethod to make it a "class property".
"""
def __get__(self, cls, owner):
return self.fget.__get__(None, owner)()
def get_server_name():
# Import here to avoid cyclic import
from ... | import sys
from django.conf import settings
class classproperty(property):
"""
Use it to decorate a classmethod to make it a "class property".
"""
def __get__(self, cls, owner):
return self.fget.__get__(None, owner)()
def get_server_name():
# Import here to avoid cyclic import
from ... | <commit_before>import sys
from django.conf import settings
class classproperty(property):
"""
Use it to decorate a classmethod to make it a "class property".
"""
def __get__(self, cls, owner):
return self.fget.__get__(None, owner)()
def get_server_name():
# Import here to avoid cyclic i... |
088eb8d51f0092c9cfa62c490ae5a9ad111061e0 | webapp/byceps/util/templatefilters.py | webapp/byceps/util/templatefilters.py | # -*- coding: utf-8 -*-
"""
byceps.util.templatefilters
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provide and register custom template filters.
:Copyright: 2006-2015 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from . import dateformat, money
def dim(value):
"""Render value in a way so that it ... | # -*- coding: utf-8 -*-
"""
byceps.util.templatefilters
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provide and register custom template filters.
:Copyright: 2006-2015 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from jinja2 import evalcontextfilter, Markup
from . import dateformat, money
@evalconte... | Mark HTML generated by custom template filter as safe if auto-escaping is enabled. | Mark HTML generated by custom template filter as safe if auto-escaping is enabled.
| Python | bsd-3-clause | homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps,m-ober/byceps,m-ober/byceps,m-ober/byceps | # -*- coding: utf-8 -*-
"""
byceps.util.templatefilters
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provide and register custom template filters.
:Copyright: 2006-2015 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from . import dateformat, money
def dim(value):
"""Render value in a way so that it ... | # -*- coding: utf-8 -*-
"""
byceps.util.templatefilters
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provide and register custom template filters.
:Copyright: 2006-2015 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from jinja2 import evalcontextfilter, Markup
from . import dateformat, money
@evalconte... | <commit_before># -*- coding: utf-8 -*-
"""
byceps.util.templatefilters
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provide and register custom template filters.
:Copyright: 2006-2015 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from . import dateformat, money
def dim(value):
"""Render value in a ... | # -*- coding: utf-8 -*-
"""
byceps.util.templatefilters
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provide and register custom template filters.
:Copyright: 2006-2015 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from jinja2 import evalcontextfilter, Markup
from . import dateformat, money
@evalconte... | # -*- coding: utf-8 -*-
"""
byceps.util.templatefilters
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provide and register custom template filters.
:Copyright: 2006-2015 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from . import dateformat, money
def dim(value):
"""Render value in a way so that it ... | <commit_before># -*- coding: utf-8 -*-
"""
byceps.util.templatefilters
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provide and register custom template filters.
:Copyright: 2006-2015 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from . import dateformat, money
def dim(value):
"""Render value in a ... |
78edb47cc53e52504f2ceb8efa23ae1e50b66946 | synapse/media/v1/__init__.py | synapse/media/v1/__init__.py | # -*- coding: utf-8 -*-
import PIL.Image
# check for JPEG support.
try:
PIL.Image._getdecoder("rgb", "jpeg", None)
except IOError as e:
if str(e).startswith("decoder jpeg not available"):
raise Exception(
"FATAL: jpeg codec not supported. Install pillow correctly! "
" 'sudo apt-... | Add runtime checks on startup to enforce that JPEG/PNG support is included when installing pillow. | SYN-208/SYN-228: Add runtime checks on startup to enforce that JPEG/PNG support is included when installing pillow.
| Python | apache-2.0 | rzr/synapse,matrix-org/synapse,illicitonion/synapse,rzr/synapse,matrix-org/synapse,howethomas/synapse,matrix-org/synapse,iot-factory/synapse,matrix-org/synapse,rzr/synapse,howethomas/synapse,illicitonion/synapse,matrix-org/synapse,matrix-org/synapse,howethomas/synapse,TribeMedia/synapse,iot-factory/synapse,iot-factory/... | SYN-208/SYN-228: Add runtime checks on startup to enforce that JPEG/PNG support is included when installing pillow. | # -*- coding: utf-8 -*-
import PIL.Image
# check for JPEG support.
try:
PIL.Image._getdecoder("rgb", "jpeg", None)
except IOError as e:
if str(e).startswith("decoder jpeg not available"):
raise Exception(
"FATAL: jpeg codec not supported. Install pillow correctly! "
" 'sudo apt-... | <commit_before><commit_msg>SYN-208/SYN-228: Add runtime checks on startup to enforce that JPEG/PNG support is included when installing pillow.<commit_after> | # -*- coding: utf-8 -*-
import PIL.Image
# check for JPEG support.
try:
PIL.Image._getdecoder("rgb", "jpeg", None)
except IOError as e:
if str(e).startswith("decoder jpeg not available"):
raise Exception(
"FATAL: jpeg codec not supported. Install pillow correctly! "
" 'sudo apt-... | SYN-208/SYN-228: Add runtime checks on startup to enforce that JPEG/PNG support is included when installing pillow.# -*- coding: utf-8 -*-
import PIL.Image
# check for JPEG support.
try:
PIL.Image._getdecoder("rgb", "jpeg", None)
except IOError as e:
if str(e).startswith("decoder jpeg not available"):
... | <commit_before><commit_msg>SYN-208/SYN-228: Add runtime checks on startup to enforce that JPEG/PNG support is included when installing pillow.<commit_after># -*- coding: utf-8 -*-
import PIL.Image
# check for JPEG support.
try:
PIL.Image._getdecoder("rgb", "jpeg", None)
except IOError as e:
if str(e).startswit... | |
724c3548d657c10de15eb830810a89b94af6d978 | dikedata_api/parsers.py | dikedata_api/parsers.py | # (c) Nelen & Schuurmans. MIT licensed, see LICENSE.rst.
from __future__ import unicode_literals
from rest_framework.parsers import BaseParser, DataAndFiles
class SimpleFileUploadParser(BaseParser):
"""
A naive raw file upload parser.
"""
media_type = '*/*' # Accept anything
def parse(self, st... | # (c) Nelen & Schuurmans. MIT licensed, see LICENSE.rst.
from __future__ import unicode_literals
from rest_framework.parsers import BaseParser, DataAndFiles
class SimpleFileUploadParser(BaseParser):
"""
A naive raw file upload parser.
"""
media_type = '*/*' # Accept anything
def parse(self, st... | Use comma in CSV POST. | Use comma in CSV POST.
| Python | mit | ddsc/dikedata-api | # (c) Nelen & Schuurmans. MIT licensed, see LICENSE.rst.
from __future__ import unicode_literals
from rest_framework.parsers import BaseParser, DataAndFiles
class SimpleFileUploadParser(BaseParser):
"""
A naive raw file upload parser.
"""
media_type = '*/*' # Accept anything
def parse(self, st... | # (c) Nelen & Schuurmans. MIT licensed, see LICENSE.rst.
from __future__ import unicode_literals
from rest_framework.parsers import BaseParser, DataAndFiles
class SimpleFileUploadParser(BaseParser):
"""
A naive raw file upload parser.
"""
media_type = '*/*' # Accept anything
def parse(self, st... | <commit_before># (c) Nelen & Schuurmans. MIT licensed, see LICENSE.rst.
from __future__ import unicode_literals
from rest_framework.parsers import BaseParser, DataAndFiles
class SimpleFileUploadParser(BaseParser):
"""
A naive raw file upload parser.
"""
media_type = '*/*' # Accept anything
def... | # (c) Nelen & Schuurmans. MIT licensed, see LICENSE.rst.
from __future__ import unicode_literals
from rest_framework.parsers import BaseParser, DataAndFiles
class SimpleFileUploadParser(BaseParser):
"""
A naive raw file upload parser.
"""
media_type = '*/*' # Accept anything
def parse(self, st... | # (c) Nelen & Schuurmans. MIT licensed, see LICENSE.rst.
from __future__ import unicode_literals
from rest_framework.parsers import BaseParser, DataAndFiles
class SimpleFileUploadParser(BaseParser):
"""
A naive raw file upload parser.
"""
media_type = '*/*' # Accept anything
def parse(self, st... | <commit_before># (c) Nelen & Schuurmans. MIT licensed, see LICENSE.rst.
from __future__ import unicode_literals
from rest_framework.parsers import BaseParser, DataAndFiles
class SimpleFileUploadParser(BaseParser):
"""
A naive raw file upload parser.
"""
media_type = '*/*' # Accept anything
def... |
6d894dc15af674b7814be32664354fb79faf227f | gateway_mac.py | gateway_mac.py | import socket, struct
import scapy.all as scapy
def get_default_gateway_linux():
"""Read the default gateway directly from /proc."""
routes = []
with open("/proc/net/route") as fh:
for line in fh:
fields = line.strip().split()
if fields[1] != '00000000' or not int(fields[3],... | import socket, struct
import scapy.all as scapy
def get_default_gateway_linux():
"""Read the default gateway directly from /proc."""
routes = []
with open("/proc/net/route") as fh:
for line in fh:
fields = line.strip().split()
if fields[1] != '00000000' or not int(fields[3],... | Fix bugs with code for multiple gateways | Fix bugs with code for multiple gateways | Python | mit | nulledbyte/scripts | import socket, struct
import scapy.all as scapy
def get_default_gateway_linux():
"""Read the default gateway directly from /proc."""
routes = []
with open("/proc/net/route") as fh:
for line in fh:
fields = line.strip().split()
if fields[1] != '00000000' or not int(fields[3],... | import socket, struct
import scapy.all as scapy
def get_default_gateway_linux():
"""Read the default gateway directly from /proc."""
routes = []
with open("/proc/net/route") as fh:
for line in fh:
fields = line.strip().split()
if fields[1] != '00000000' or not int(fields[3],... | <commit_before>import socket, struct
import scapy.all as scapy
def get_default_gateway_linux():
"""Read the default gateway directly from /proc."""
routes = []
with open("/proc/net/route") as fh:
for line in fh:
fields = line.strip().split()
if fields[1] != '00000000' or not... | import socket, struct
import scapy.all as scapy
def get_default_gateway_linux():
"""Read the default gateway directly from /proc."""
routes = []
with open("/proc/net/route") as fh:
for line in fh:
fields = line.strip().split()
if fields[1] != '00000000' or not int(fields[3],... | import socket, struct
import scapy.all as scapy
def get_default_gateway_linux():
"""Read the default gateway directly from /proc."""
routes = []
with open("/proc/net/route") as fh:
for line in fh:
fields = line.strip().split()
if fields[1] != '00000000' or not int(fields[3],... | <commit_before>import socket, struct
import scapy.all as scapy
def get_default_gateway_linux():
"""Read the default gateway directly from /proc."""
routes = []
with open("/proc/net/route") as fh:
for line in fh:
fields = line.strip().split()
if fields[1] != '00000000' or not... |
706ad8367488104e2e5c32908faaf85a5fb5e00a | varify/context_processors.py | varify/context_processors.py | import os
import logging
from django.conf import settings
log = logging.getLogger(__name__)
def static(request):
"Shorthand static URLs. In debug mode, the JavaScript is not minified."
static_url = settings.STATIC_URL
prefix = 'src' if settings.DEBUG else 'min'
return {
'CSS_URL': os.path.join... | import os
import logging
from django.conf import settings
log = logging.getLogger(__name__)
def static(request):
"Shorthand static URLs. In debug mode, the JavaScript is not minified."
static_url = settings.STATIC_URL
prefix = 'src' if settings.DEBUG else 'min'
return {
'CSS_URL': os.path.joi... | Add default argument when looking up sentry dsn setting | Add default argument when looking up sentry dsn setting
| Python | bsd-2-clause | chop-dbhi/varify,chop-dbhi/varify,chop-dbhi/varify,chop-dbhi/varify | import os
import logging
from django.conf import settings
log = logging.getLogger(__name__)
def static(request):
"Shorthand static URLs. In debug mode, the JavaScript is not minified."
static_url = settings.STATIC_URL
prefix = 'src' if settings.DEBUG else 'min'
return {
'CSS_URL': os.path.join... | import os
import logging
from django.conf import settings
log = logging.getLogger(__name__)
def static(request):
"Shorthand static URLs. In debug mode, the JavaScript is not minified."
static_url = settings.STATIC_URL
prefix = 'src' if settings.DEBUG else 'min'
return {
'CSS_URL': os.path.joi... | <commit_before>import os
import logging
from django.conf import settings
log = logging.getLogger(__name__)
def static(request):
"Shorthand static URLs. In debug mode, the JavaScript is not minified."
static_url = settings.STATIC_URL
prefix = 'src' if settings.DEBUG else 'min'
return {
'CSS_URL... | import os
import logging
from django.conf import settings
log = logging.getLogger(__name__)
def static(request):
"Shorthand static URLs. In debug mode, the JavaScript is not minified."
static_url = settings.STATIC_URL
prefix = 'src' if settings.DEBUG else 'min'
return {
'CSS_URL': os.path.joi... | import os
import logging
from django.conf import settings
log = logging.getLogger(__name__)
def static(request):
"Shorthand static URLs. In debug mode, the JavaScript is not minified."
static_url = settings.STATIC_URL
prefix = 'src' if settings.DEBUG else 'min'
return {
'CSS_URL': os.path.join... | <commit_before>import os
import logging
from django.conf import settings
log = logging.getLogger(__name__)
def static(request):
"Shorthand static URLs. In debug mode, the JavaScript is not minified."
static_url = settings.STATIC_URL
prefix = 'src' if settings.DEBUG else 'min'
return {
'CSS_URL... |
f857771d98627722bc9c81ee3d039ab11c3e8afb | jsonfield/utils.py | jsonfield/utils.py | import datetime
from decimal import Decimal
from django.core.serializers.json import DjangoJSONEncoder
class TZAwareJSONEncoder(DjangoJSONEncoder):
def default(self, obj):
if isinstance(obj, datetime.datetime):
return obj.strftime("%Y-%m-%d %H:%M:%S%z")
return super(TZAwareJSONEncoder,... | import datetime
from decimal import Decimal
from django.core.serializers.json import DjangoJSONEncoder
DATETIME = (datetime.datetime,)
DATE = (datetime.date,)
TIME = (datetime.time,)
try:
import freezegun.api
except ImportError:
pass
else:
DATETIME += (freezegun.api.FakeDatetime,)
DATE += (freezegun.... | Make compatible with freezegun when testing. | Make compatible with freezegun when testing.
| Python | bsd-3-clause | SideStudios/django-jsonfield | import datetime
from decimal import Decimal
from django.core.serializers.json import DjangoJSONEncoder
class TZAwareJSONEncoder(DjangoJSONEncoder):
def default(self, obj):
if isinstance(obj, datetime.datetime):
return obj.strftime("%Y-%m-%d %H:%M:%S%z")
return super(TZAwareJSONEncoder,... | import datetime
from decimal import Decimal
from django.core.serializers.json import DjangoJSONEncoder
DATETIME = (datetime.datetime,)
DATE = (datetime.date,)
TIME = (datetime.time,)
try:
import freezegun.api
except ImportError:
pass
else:
DATETIME += (freezegun.api.FakeDatetime,)
DATE += (freezegun.... | <commit_before>import datetime
from decimal import Decimal
from django.core.serializers.json import DjangoJSONEncoder
class TZAwareJSONEncoder(DjangoJSONEncoder):
def default(self, obj):
if isinstance(obj, datetime.datetime):
return obj.strftime("%Y-%m-%d %H:%M:%S%z")
return super(TZAw... | import datetime
from decimal import Decimal
from django.core.serializers.json import DjangoJSONEncoder
DATETIME = (datetime.datetime,)
DATE = (datetime.date,)
TIME = (datetime.time,)
try:
import freezegun.api
except ImportError:
pass
else:
DATETIME += (freezegun.api.FakeDatetime,)
DATE += (freezegun.... | import datetime
from decimal import Decimal
from django.core.serializers.json import DjangoJSONEncoder
class TZAwareJSONEncoder(DjangoJSONEncoder):
def default(self, obj):
if isinstance(obj, datetime.datetime):
return obj.strftime("%Y-%m-%d %H:%M:%S%z")
return super(TZAwareJSONEncoder,... | <commit_before>import datetime
from decimal import Decimal
from django.core.serializers.json import DjangoJSONEncoder
class TZAwareJSONEncoder(DjangoJSONEncoder):
def default(self, obj):
if isinstance(obj, datetime.datetime):
return obj.strftime("%Y-%m-%d %H:%M:%S%z")
return super(TZAw... |
c2cfb617d9bedf93e2c6dfb5ff6cdfcd35d5c0fe | db/shot_attempt.py | db/shot_attempt.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import uuid
from db.common import Base
from db.specific_event import SpecificEvent
class ShotAttempt(Base, SpecificEvent):
__tablename__ = 'shot_attempts'
__autoload__ = True
STANDARD_ATTRS = [
"game_id", "team_id", "event_id", "player_id", "shot_at... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import uuid
from sqlalchemy import and_
from db.common import Base, session_scope
from db.specific_event import SpecificEvent
class ShotAttempt(Base, SpecificEvent):
__tablename__ = 'shot_attempts'
__autoload__ = True
STANDARD_ATTRS = [
"game_id", ... | Add method to find by event and player id | Add method to find by event and player id
| Python | mit | leaffan/pynhldb | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import uuid
from db.common import Base
from db.specific_event import SpecificEvent
class ShotAttempt(Base, SpecificEvent):
__tablename__ = 'shot_attempts'
__autoload__ = True
STANDARD_ATTRS = [
"game_id", "team_id", "event_id", "player_id", "shot_at... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import uuid
from sqlalchemy import and_
from db.common import Base, session_scope
from db.specific_event import SpecificEvent
class ShotAttempt(Base, SpecificEvent):
__tablename__ = 'shot_attempts'
__autoload__ = True
STANDARD_ATTRS = [
"game_id", ... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import uuid
from db.common import Base
from db.specific_event import SpecificEvent
class ShotAttempt(Base, SpecificEvent):
__tablename__ = 'shot_attempts'
__autoload__ = True
STANDARD_ATTRS = [
"game_id", "team_id", "event_id", "playe... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import uuid
from sqlalchemy import and_
from db.common import Base, session_scope
from db.specific_event import SpecificEvent
class ShotAttempt(Base, SpecificEvent):
__tablename__ = 'shot_attempts'
__autoload__ = True
STANDARD_ATTRS = [
"game_id", ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import uuid
from db.common import Base
from db.specific_event import SpecificEvent
class ShotAttempt(Base, SpecificEvent):
__tablename__ = 'shot_attempts'
__autoload__ = True
STANDARD_ATTRS = [
"game_id", "team_id", "event_id", "player_id", "shot_at... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import uuid
from db.common import Base
from db.specific_event import SpecificEvent
class ShotAttempt(Base, SpecificEvent):
__tablename__ = 'shot_attempts'
__autoload__ = True
STANDARD_ATTRS = [
"game_id", "team_id", "event_id", "playe... |
779620e53bd9c71e1c9e078ff46498d363dd392e | wagtail/admin/staticfiles.py | wagtail/admin/staticfiles.py | import hashlib
from django.conf import settings
from django.templatetags.static import static
from wagtail import __version__
if getattr(settings, 'WAGTAILADMIN_STATIC_FILE_VERSION_STRINGS', True):
VERSION_HASH = hashlib.sha1(
(__version__ + settings.SECRET_KEY).encode('utf-8')
).hexdigest()[:8]
els... | import hashlib
from django.conf import settings
from django.contrib.staticfiles.storage import HashedFilesMixin
from django.core.files.storage import get_storage_class
from django.templatetags.static import static
from wagtail import __version__
# Check whether we should add cache-busting '?v=...' parameters to sta... | Disable querystrings if a storage backend with hashed filenames is active | Disable querystrings if a storage backend with hashed filenames is active
| Python | bsd-3-clause | rsalmaso/wagtail,gasman/wagtail,kaedroho/wagtail,rsalmaso/wagtail,torchbox/wagtail,mixxorz/wagtail,timorieber/wagtail,nimasmi/wagtail,rsalmaso/wagtail,jnns/wagtail,torchbox/wagtail,wagtail/wagtail,zerolab/wagtail,mixxorz/wagtail,torchbox/wagtail,kaedroho/wagtail,gasman/wagtail,takeflight/wagtail,zerolab/wagtail,wagtail... | import hashlib
from django.conf import settings
from django.templatetags.static import static
from wagtail import __version__
if getattr(settings, 'WAGTAILADMIN_STATIC_FILE_VERSION_STRINGS', True):
VERSION_HASH = hashlib.sha1(
(__version__ + settings.SECRET_KEY).encode('utf-8')
).hexdigest()[:8]
els... | import hashlib
from django.conf import settings
from django.contrib.staticfiles.storage import HashedFilesMixin
from django.core.files.storage import get_storage_class
from django.templatetags.static import static
from wagtail import __version__
# Check whether we should add cache-busting '?v=...' parameters to sta... | <commit_before>import hashlib
from django.conf import settings
from django.templatetags.static import static
from wagtail import __version__
if getattr(settings, 'WAGTAILADMIN_STATIC_FILE_VERSION_STRINGS', True):
VERSION_HASH = hashlib.sha1(
(__version__ + settings.SECRET_KEY).encode('utf-8')
).hexd... | import hashlib
from django.conf import settings
from django.contrib.staticfiles.storage import HashedFilesMixin
from django.core.files.storage import get_storage_class
from django.templatetags.static import static
from wagtail import __version__
# Check whether we should add cache-busting '?v=...' parameters to sta... | import hashlib
from django.conf import settings
from django.templatetags.static import static
from wagtail import __version__
if getattr(settings, 'WAGTAILADMIN_STATIC_FILE_VERSION_STRINGS', True):
VERSION_HASH = hashlib.sha1(
(__version__ + settings.SECRET_KEY).encode('utf-8')
).hexdigest()[:8]
els... | <commit_before>import hashlib
from django.conf import settings
from django.templatetags.static import static
from wagtail import __version__
if getattr(settings, 'WAGTAILADMIN_STATIC_FILE_VERSION_STRINGS', True):
VERSION_HASH = hashlib.sha1(
(__version__ + settings.SECRET_KEY).encode('utf-8')
).hexd... |
bf6a4ea469c21e45a8c382ff935e57debfb142f9 | pyowm/constants.py | pyowm/constants.py | """
Constants for the PyOWM library
"""
PYOWM_VERSION = '2.2.0'
LATEST_OWM_API_VERSION = '2.5'
| """
Constants for the PyOWM library
"""
PYOWM_VERSION = '2.2.1'
LATEST_OWM_API_VERSION = '2.5'
| Fix version prior to release | Fix version prior to release
| Python | mit | LukasBoersma/pyowm,LukasBoersma/pyowm,csparpa/pyowm,csparpa/pyowm,LukasBoersma/pyowm | """
Constants for the PyOWM library
"""
PYOWM_VERSION = '2.2.0'
LATEST_OWM_API_VERSION = '2.5'
Fix version prior to release | """
Constants for the PyOWM library
"""
PYOWM_VERSION = '2.2.1'
LATEST_OWM_API_VERSION = '2.5'
| <commit_before>"""
Constants for the PyOWM library
"""
PYOWM_VERSION = '2.2.0'
LATEST_OWM_API_VERSION = '2.5'
<commit_msg>Fix version prior to release<commit_after> | """
Constants for the PyOWM library
"""
PYOWM_VERSION = '2.2.1'
LATEST_OWM_API_VERSION = '2.5'
| """
Constants for the PyOWM library
"""
PYOWM_VERSION = '2.2.0'
LATEST_OWM_API_VERSION = '2.5'
Fix version prior to release"""
Constants for the PyOWM library
"""
PYOWM_VERSION = '2.2.1'
LATEST_OWM_API_VERSION = '2.5'
| <commit_before>"""
Constants for the PyOWM library
"""
PYOWM_VERSION = '2.2.0'
LATEST_OWM_API_VERSION = '2.5'
<commit_msg>Fix version prior to release<commit_after>"""
Constants for the PyOWM library
"""
PYOWM_VERSION = '2.2.1'
LATEST_OWM_API_VERSION = '2.5'
|
4d163ab5a2c4c9c6b07d4c0dfea1b91ab5e05fec | web-scraper/course_finder.py | web-scraper/course_finder.py | import requests
import http.cookiejar
import time
def get_raw_data():
url = 'http://coursefinder.utoronto.ca/course-search/search/courseSearch/course/search'
data = {
'queryText': '',
'requirements': '',
'campusParam': 'St. George,Scarborough,Mississauga'
}
cookies = http.cooki... | Create method that retrieves coursefinder URLS | Create method that retrieves coursefinder URLS
| Python | mit | cobalt-io/cobalt,cobalt-uoft/cobalt,qasim/cobalt,ivanzhangio/cobalt,cobalt-io/cobalt,kshvmdn/cobalt | Create method that retrieves coursefinder URLS | import requests
import http.cookiejar
import time
def get_raw_data():
url = 'http://coursefinder.utoronto.ca/course-search/search/courseSearch/course/search'
data = {
'queryText': '',
'requirements': '',
'campusParam': 'St. George,Scarborough,Mississauga'
}
cookies = http.cooki... | <commit_before><commit_msg>Create method that retrieves coursefinder URLS<commit_after> | import requests
import http.cookiejar
import time
def get_raw_data():
url = 'http://coursefinder.utoronto.ca/course-search/search/courseSearch/course/search'
data = {
'queryText': '',
'requirements': '',
'campusParam': 'St. George,Scarborough,Mississauga'
}
cookies = http.cooki... | Create method that retrieves coursefinder URLSimport requests
import http.cookiejar
import time
def get_raw_data():
url = 'http://coursefinder.utoronto.ca/course-search/search/courseSearch/course/search'
data = {
'queryText': '',
'requirements': '',
'campusParam': 'St. George,Scarboroug... | <commit_before><commit_msg>Create method that retrieves coursefinder URLS<commit_after>import requests
import http.cookiejar
import time
def get_raw_data():
url = 'http://coursefinder.utoronto.ca/course-search/search/courseSearch/course/search'
data = {
'queryText': '',
'requirements': '',
... | |
3fe4cb6fbafe69b9e7520466b7e7e2d405cf0ed0 | bookmarks/forms.py | bookmarks/forms.py | from django import forms
from django.utils.translation import ugettext_lazy as _
from tagging.forms import TagField
from bookmarks.models import Bookmark, BookmarkInstance
class BookmarkInstanceForm(forms.ModelForm):
url = forms.URLField(label = "URL", verify_exists=True, widget=forms.TextInput(attrs={"size... | from django import forms
from django.utils.translation import ugettext_lazy as _
from tagging.forms import TagField
from bookmarks.models import Bookmark, BookmarkInstance
class BookmarkInstanceForm(forms.ModelForm):
url = forms.URLField(label = "URL", widget=forms.TextInput(attrs={"size": 40}))
descrip... | Make URLField compatible with Django 1.4 and remove verify_exists attribute | Make URLField compatible with Django 1.4 and remove verify_exists attribute
| Python | mit | incuna/incuna-bookmarks,incuna/incuna-bookmarks | from django import forms
from django.utils.translation import ugettext_lazy as _
from tagging.forms import TagField
from bookmarks.models import Bookmark, BookmarkInstance
class BookmarkInstanceForm(forms.ModelForm):
url = forms.URLField(label = "URL", verify_exists=True, widget=forms.TextInput(attrs={"size... | from django import forms
from django.utils.translation import ugettext_lazy as _
from tagging.forms import TagField
from bookmarks.models import Bookmark, BookmarkInstance
class BookmarkInstanceForm(forms.ModelForm):
url = forms.URLField(label = "URL", widget=forms.TextInput(attrs={"size": 40}))
descrip... | <commit_before>from django import forms
from django.utils.translation import ugettext_lazy as _
from tagging.forms import TagField
from bookmarks.models import Bookmark, BookmarkInstance
class BookmarkInstanceForm(forms.ModelForm):
url = forms.URLField(label = "URL", verify_exists=True, widget=forms.TextInp... | from django import forms
from django.utils.translation import ugettext_lazy as _
from tagging.forms import TagField
from bookmarks.models import Bookmark, BookmarkInstance
class BookmarkInstanceForm(forms.ModelForm):
url = forms.URLField(label = "URL", widget=forms.TextInput(attrs={"size": 40}))
descrip... | from django import forms
from django.utils.translation import ugettext_lazy as _
from tagging.forms import TagField
from bookmarks.models import Bookmark, BookmarkInstance
class BookmarkInstanceForm(forms.ModelForm):
url = forms.URLField(label = "URL", verify_exists=True, widget=forms.TextInput(attrs={"size... | <commit_before>from django import forms
from django.utils.translation import ugettext_lazy as _
from tagging.forms import TagField
from bookmarks.models import Bookmark, BookmarkInstance
class BookmarkInstanceForm(forms.ModelForm):
url = forms.URLField(label = "URL", verify_exists=True, widget=forms.TextInp... |
be9d4292e8357d637ebc7e73e1b2333766db5997 | braid/postgres.py | braid/postgres.py | from fabric.api import sudo
from braid import package
def install():
package.install(['postgresql-9.1', 'postgresql-server-dev-9.1'])
def createUser(name):
sudo('createuser -D -R -S {}'.format(name), user='postgres')
def createDb(name, owner):
sudo('createdb -O {} {}'.format(owner, name), user='postgr... | from fabric.api import sudo, quiet
from braid import package
from pipes import quote
def install():
package.install(['postgresql-9.1', 'postgresql-server-dev-9.1'])
def _runQuery(query):
with quiet():
return sudo('psql --no-align --no-readline --no-password --quiet '
'--tuples-onl... | Make createDb and createUser idempotent. | Make createDb and createUser idempotent.
| Python | mit | alex/braid,alex/braid | from fabric.api import sudo
from braid import package
def install():
package.install(['postgresql-9.1', 'postgresql-server-dev-9.1'])
def createUser(name):
sudo('createuser -D -R -S {}'.format(name), user='postgres')
def createDb(name, owner):
sudo('createdb -O {} {}'.format(owner, name), user='postgr... | from fabric.api import sudo, quiet
from braid import package
from pipes import quote
def install():
package.install(['postgresql-9.1', 'postgresql-server-dev-9.1'])
def _runQuery(query):
with quiet():
return sudo('psql --no-align --no-readline --no-password --quiet '
'--tuples-onl... | <commit_before>from fabric.api import sudo
from braid import package
def install():
package.install(['postgresql-9.1', 'postgresql-server-dev-9.1'])
def createUser(name):
sudo('createuser -D -R -S {}'.format(name), user='postgres')
def createDb(name, owner):
sudo('createdb -O {} {}'.format(owner, name... | from fabric.api import sudo, quiet
from braid import package
from pipes import quote
def install():
package.install(['postgresql-9.1', 'postgresql-server-dev-9.1'])
def _runQuery(query):
with quiet():
return sudo('psql --no-align --no-readline --no-password --quiet '
'--tuples-onl... | from fabric.api import sudo
from braid import package
def install():
package.install(['postgresql-9.1', 'postgresql-server-dev-9.1'])
def createUser(name):
sudo('createuser -D -R -S {}'.format(name), user='postgres')
def createDb(name, owner):
sudo('createdb -O {} {}'.format(owner, name), user='postgr... | <commit_before>from fabric.api import sudo
from braid import package
def install():
package.install(['postgresql-9.1', 'postgresql-server-dev-9.1'])
def createUser(name):
sudo('createuser -D -R -S {}'.format(name), user='postgres')
def createDb(name, owner):
sudo('createdb -O {} {}'.format(owner, name... |
b48b41fb9634c7e12b805e8bd3ca4f0abb942c3a | django/__init__.py | django/__init__.py | VERSION = (1, 0, 'post-release-SVN')
def get_version():
"Returns the version as a human-format string."
v = '.'.join([str(i) for i in VERSION[:-1]])
if VERSION[-1]:
from django.utils.version import get_svn_revision
v = '%s-%s-%s' % (v, VERSION[-1], get_svn_revision())
return v
| VERSION = (1, 1, 0, 'alpha', 0)
def get_version():
version = '%s.%s' % (VERSION[0], VERSION[1])
if VERSION[2]:
version = '%s.%s' % (version, VERSION[2])
if VERSION[3:] == ('alpha', 0):
version = '%s pre-alpha' % version
else:
version = '%s %s' % (version, VERSION[3])
if ... | Update django.VERSION in trunk per previous discussion | Update django.VERSION in trunk per previous discussion
--HG--
extra : convert_revision : svn%3Abcc190cf-cafb-0310-a4f2-bffc1f526a37/django/trunk%409103
| Python | bsd-3-clause | Belgabor/django,Belgabor/django,Belgabor/django | VERSION = (1, 0, 'post-release-SVN')
def get_version():
"Returns the version as a human-format string."
v = '.'.join([str(i) for i in VERSION[:-1]])
if VERSION[-1]:
from django.utils.version import get_svn_revision
v = '%s-%s-%s' % (v, VERSION[-1], get_svn_revision())
return v
Update dj... | VERSION = (1, 1, 0, 'alpha', 0)
def get_version():
version = '%s.%s' % (VERSION[0], VERSION[1])
if VERSION[2]:
version = '%s.%s' % (version, VERSION[2])
if VERSION[3:] == ('alpha', 0):
version = '%s pre-alpha' % version
else:
version = '%s %s' % (version, VERSION[3])
if ... | <commit_before>VERSION = (1, 0, 'post-release-SVN')
def get_version():
"Returns the version as a human-format string."
v = '.'.join([str(i) for i in VERSION[:-1]])
if VERSION[-1]:
from django.utils.version import get_svn_revision
v = '%s-%s-%s' % (v, VERSION[-1], get_svn_revision())
ret... | VERSION = (1, 1, 0, 'alpha', 0)
def get_version():
version = '%s.%s' % (VERSION[0], VERSION[1])
if VERSION[2]:
version = '%s.%s' % (version, VERSION[2])
if VERSION[3:] == ('alpha', 0):
version = '%s pre-alpha' % version
else:
version = '%s %s' % (version, VERSION[3])
if ... | VERSION = (1, 0, 'post-release-SVN')
def get_version():
"Returns the version as a human-format string."
v = '.'.join([str(i) for i in VERSION[:-1]])
if VERSION[-1]:
from django.utils.version import get_svn_revision
v = '%s-%s-%s' % (v, VERSION[-1], get_svn_revision())
return v
Update dj... | <commit_before>VERSION = (1, 0, 'post-release-SVN')
def get_version():
"Returns the version as a human-format string."
v = '.'.join([str(i) for i in VERSION[:-1]])
if VERSION[-1]:
from django.utils.version import get_svn_revision
v = '%s-%s-%s' % (v, VERSION[-1], get_svn_revision())
ret... |
a3b31e3ad7358709b27f91a249ac0a622f9661cb | server/python_django/file_uploader/__init__.py | server/python_django/file_uploader/__init__.py | """
@author: Ferdinand E. Silva
@email: [email protected]
@website: http://ferdinandsilva.com
"""
import os
from django.utils import simplejson as json
class qqFileUploader(object):
def __init__(self, allowedExtensions=None, sizeLimit=1024):
self.allowedExtensions = allowedExtensions or [... | """
@author: Ferdinand E. Silva
@email: [email protected]
@website: http://ferdinandsilva.com
"""
import os
from django.utils import simplejson as json
class qqFileUploader(object):
def __init__(self, allowedExtensions=None, sizeLimit=1024):
self.allowedExtensions = allowedExtensions or [... | Read the file content, if it is not read when the request is multipart then the client get an error | Read the file content, if it is not read when the request is multipart then the client get an error
| Python | mit | SimonWaldherr/uploader,SimonWaldherr/uploader,FineUploader/fine-uploader,FineUploader/fine-uploader,SimonWaldherr/uploader,SimonWaldherr/uploader,SimonWaldherr/uploader,FineUploader/fine-uploader,SimonWaldherr/uploader,SimonWaldherr/uploader | """
@author: Ferdinand E. Silva
@email: [email protected]
@website: http://ferdinandsilva.com
"""
import os
from django.utils import simplejson as json
class qqFileUploader(object):
def __init__(self, allowedExtensions=None, sizeLimit=1024):
self.allowedExtensions = allowedExtensions or [... | """
@author: Ferdinand E. Silva
@email: [email protected]
@website: http://ferdinandsilva.com
"""
import os
from django.utils import simplejson as json
class qqFileUploader(object):
def __init__(self, allowedExtensions=None, sizeLimit=1024):
self.allowedExtensions = allowedExtensions or [... | <commit_before>"""
@author: Ferdinand E. Silva
@email: [email protected]
@website: http://ferdinandsilva.com
"""
import os
from django.utils import simplejson as json
class qqFileUploader(object):
def __init__(self, allowedExtensions=None, sizeLimit=1024):
self.allowedExtensions = allowed... | """
@author: Ferdinand E. Silva
@email: [email protected]
@website: http://ferdinandsilva.com
"""
import os
from django.utils import simplejson as json
class qqFileUploader(object):
def __init__(self, allowedExtensions=None, sizeLimit=1024):
self.allowedExtensions = allowedExtensions or [... | """
@author: Ferdinand E. Silva
@email: [email protected]
@website: http://ferdinandsilva.com
"""
import os
from django.utils import simplejson as json
class qqFileUploader(object):
def __init__(self, allowedExtensions=None, sizeLimit=1024):
self.allowedExtensions = allowedExtensions or [... | <commit_before>"""
@author: Ferdinand E. Silva
@email: [email protected]
@website: http://ferdinandsilva.com
"""
import os
from django.utils import simplejson as json
class qqFileUploader(object):
def __init__(self, allowedExtensions=None, sizeLimit=1024):
self.allowedExtensions = allowed... |
073b55113ac91b2f6fcfbebe9550f0740f8149d4 | jxaas/utils.py | jxaas/utils.py | import logging
from cliff.command import Command
import jujuxaas.client
def get_jxaas_client(command):
tenant = 'abcdef'
username = '123'
password= '123'
client = jujuxaas.client.Client(url="http://127.0.0.1:8080/xaas", tenant=tenant, username=username, password=password)
return client
| import logging
import os
from cliff.command import Command
import jujuxaas.client
def get_jxaas_client(command):
tenant = 'abcdef'
username = '123'
password= '123'
url = os.getenv('JXAAS_URL', "http://127.0.0.1:8080/xaas")
client = jujuxaas.client.Client(url=url, tenant=tenant, username=username, password... | Allow JXAAS_URL to be configured as an env var | Allow JXAAS_URL to be configured as an env var
| Python | apache-2.0 | jxaas/cli | import logging
from cliff.command import Command
import jujuxaas.client
def get_jxaas_client(command):
tenant = 'abcdef'
username = '123'
password= '123'
client = jujuxaas.client.Client(url="http://127.0.0.1:8080/xaas", tenant=tenant, username=username, password=password)
return client
Allow JXAAS_URL to ... | import logging
import os
from cliff.command import Command
import jujuxaas.client
def get_jxaas_client(command):
tenant = 'abcdef'
username = '123'
password= '123'
url = os.getenv('JXAAS_URL', "http://127.0.0.1:8080/xaas")
client = jujuxaas.client.Client(url=url, tenant=tenant, username=username, password... | <commit_before>import logging
from cliff.command import Command
import jujuxaas.client
def get_jxaas_client(command):
tenant = 'abcdef'
username = '123'
password= '123'
client = jujuxaas.client.Client(url="http://127.0.0.1:8080/xaas", tenant=tenant, username=username, password=password)
return client
<com... | import logging
import os
from cliff.command import Command
import jujuxaas.client
def get_jxaas_client(command):
tenant = 'abcdef'
username = '123'
password= '123'
url = os.getenv('JXAAS_URL', "http://127.0.0.1:8080/xaas")
client = jujuxaas.client.Client(url=url, tenant=tenant, username=username, password... | import logging
from cliff.command import Command
import jujuxaas.client
def get_jxaas_client(command):
tenant = 'abcdef'
username = '123'
password= '123'
client = jujuxaas.client.Client(url="http://127.0.0.1:8080/xaas", tenant=tenant, username=username, password=password)
return client
Allow JXAAS_URL to ... | <commit_before>import logging
from cliff.command import Command
import jujuxaas.client
def get_jxaas_client(command):
tenant = 'abcdef'
username = '123'
password= '123'
client = jujuxaas.client.Client(url="http://127.0.0.1:8080/xaas", tenant=tenant, username=username, password=password)
return client
<com... |
c27d799ad81f1a11799c217eae9872880246a24e | selenium_screenshot.py | selenium_screenshot.py | from threading import RLock, local
from multiprocessing.pool import ThreadPool
from os import environ as ENV
import logging.config
from flask import Flask, request
from selenium import webdriver
logging.basicConfig()
app = Flask(__name__)
Driver = getattr(webdriver, ENV.get("WEBDRIVER", "Chrome"))
class Retry... | from threading import RLock, local
from multiprocessing.pool import ThreadPool
from os import environ as ENV
import logging.config
from flask import Flask, request
from selenium import webdriver
logging.basicConfig()
app = Flask(__name__)
Driver = getattr(webdriver, ENV.get("WEBDRIVER", "Firefox"))
class Retr... | Revert default webdriver to Firefox | Revert default webdriver to Firefox
Chrome doesn't yet work, anyway... :-(
| Python | mit | ei-grad/docker-selenium-screenshot,ei-grad/docker-selenium-screenshot | from threading import RLock, local
from multiprocessing.pool import ThreadPool
from os import environ as ENV
import logging.config
from flask import Flask, request
from selenium import webdriver
logging.basicConfig()
app = Flask(__name__)
Driver = getattr(webdriver, ENV.get("WEBDRIVER", "Chrome"))
class Retry... | from threading import RLock, local
from multiprocessing.pool import ThreadPool
from os import environ as ENV
import logging.config
from flask import Flask, request
from selenium import webdriver
logging.basicConfig()
app = Flask(__name__)
Driver = getattr(webdriver, ENV.get("WEBDRIVER", "Firefox"))
class Retr... | <commit_before>from threading import RLock, local
from multiprocessing.pool import ThreadPool
from os import environ as ENV
import logging.config
from flask import Flask, request
from selenium import webdriver
logging.basicConfig()
app = Flask(__name__)
Driver = getattr(webdriver, ENV.get("WEBDRIVER", "Chrome")... | from threading import RLock, local
from multiprocessing.pool import ThreadPool
from os import environ as ENV
import logging.config
from flask import Flask, request
from selenium import webdriver
logging.basicConfig()
app = Flask(__name__)
Driver = getattr(webdriver, ENV.get("WEBDRIVER", "Firefox"))
class Retr... | from threading import RLock, local
from multiprocessing.pool import ThreadPool
from os import environ as ENV
import logging.config
from flask import Flask, request
from selenium import webdriver
logging.basicConfig()
app = Flask(__name__)
Driver = getattr(webdriver, ENV.get("WEBDRIVER", "Chrome"))
class Retry... | <commit_before>from threading import RLock, local
from multiprocessing.pool import ThreadPool
from os import environ as ENV
import logging.config
from flask import Flask, request
from selenium import webdriver
logging.basicConfig()
app = Flask(__name__)
Driver = getattr(webdriver, ENV.get("WEBDRIVER", "Chrome")... |
507a4f7f931c12c9883ff1644f5d0cc44270d5c2 | salt/thorium/status.py | salt/thorium/status.py | # -*- coding: utf-8 -*-
'''
This thorium state is used to track the status beacon events and keep track of
the active status of minions
.. versionadded:: 2016.11.0
'''
# Import python libs
from __future__ import absolute_import
import time
import fnmatch
def reg(name):
'''
Activate this register to turn on a... | # -*- coding: utf-8 -*-
'''
This thorium state is used to track the status beacon events and keep track of
the active status of minions
.. versionadded:: 2016.11.0
'''
# Import python libs
from __future__ import absolute_import
import time
import fnmatch
def reg(name):
'''
Activate this register to turn on a... | Reorder keys that were being declared in the wrong place | Reorder keys that were being declared in the wrong place
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | # -*- coding: utf-8 -*-
'''
This thorium state is used to track the status beacon events and keep track of
the active status of minions
.. versionadded:: 2016.11.0
'''
# Import python libs
from __future__ import absolute_import
import time
import fnmatch
def reg(name):
'''
Activate this register to turn on a... | # -*- coding: utf-8 -*-
'''
This thorium state is used to track the status beacon events and keep track of
the active status of minions
.. versionadded:: 2016.11.0
'''
# Import python libs
from __future__ import absolute_import
import time
import fnmatch
def reg(name):
'''
Activate this register to turn on a... | <commit_before># -*- coding: utf-8 -*-
'''
This thorium state is used to track the status beacon events and keep track of
the active status of minions
.. versionadded:: 2016.11.0
'''
# Import python libs
from __future__ import absolute_import
import time
import fnmatch
def reg(name):
'''
Activate this regist... | # -*- coding: utf-8 -*-
'''
This thorium state is used to track the status beacon events and keep track of
the active status of minions
.. versionadded:: 2016.11.0
'''
# Import python libs
from __future__ import absolute_import
import time
import fnmatch
def reg(name):
'''
Activate this register to turn on a... | # -*- coding: utf-8 -*-
'''
This thorium state is used to track the status beacon events and keep track of
the active status of minions
.. versionadded:: 2016.11.0
'''
# Import python libs
from __future__ import absolute_import
import time
import fnmatch
def reg(name):
'''
Activate this register to turn on a... | <commit_before># -*- coding: utf-8 -*-
'''
This thorium state is used to track the status beacon events and keep track of
the active status of minions
.. versionadded:: 2016.11.0
'''
# Import python libs
from __future__ import absolute_import
import time
import fnmatch
def reg(name):
'''
Activate this regist... |
37d160825b458b466421d2946a3549e7b519976c | src/siamese_network_bw/siamese_utils.py | src/siamese_network_bw/siamese_utils.py | import numpy as np
import constants
def mean_normalize(entry):
"""
Mean normalizes a pixel vector. Entry is a numpy array of unrolled pixel vectors with
two side by side facial images for each entry.
"""
entry -= np.mean(entry, axis=0)
return entry
def get_key(idx):
"""
Each image pai... | import numpy as np
import constants
def mean_normalize(entry):
"""
Mean normalizes a pixel vector. Entry is a numpy array of unrolled pixel vectors with
two side by side facial images for each entry.
"""
entry -= np.mean(entry, axis=0)
return entry
def get_key(idx):
"""
Each image pai... | Increase key length for larger datasets. | Increase key length for larger datasets. | Python | apache-2.0 | BradNeuberg/personal-photos-model | import numpy as np
import constants
def mean_normalize(entry):
"""
Mean normalizes a pixel vector. Entry is a numpy array of unrolled pixel vectors with
two side by side facial images for each entry.
"""
entry -= np.mean(entry, axis=0)
return entry
def get_key(idx):
"""
Each image pai... | import numpy as np
import constants
def mean_normalize(entry):
"""
Mean normalizes a pixel vector. Entry is a numpy array of unrolled pixel vectors with
two side by side facial images for each entry.
"""
entry -= np.mean(entry, axis=0)
return entry
def get_key(idx):
"""
Each image pai... | <commit_before>import numpy as np
import constants
def mean_normalize(entry):
"""
Mean normalizes a pixel vector. Entry is a numpy array of unrolled pixel vectors with
two side by side facial images for each entry.
"""
entry -= np.mean(entry, axis=0)
return entry
def get_key(idx):
"""
... | import numpy as np
import constants
def mean_normalize(entry):
"""
Mean normalizes a pixel vector. Entry is a numpy array of unrolled pixel vectors with
two side by side facial images for each entry.
"""
entry -= np.mean(entry, axis=0)
return entry
def get_key(idx):
"""
Each image pai... | import numpy as np
import constants
def mean_normalize(entry):
"""
Mean normalizes a pixel vector. Entry is a numpy array of unrolled pixel vectors with
two side by side facial images for each entry.
"""
entry -= np.mean(entry, axis=0)
return entry
def get_key(idx):
"""
Each image pai... | <commit_before>import numpy as np
import constants
def mean_normalize(entry):
"""
Mean normalizes a pixel vector. Entry is a numpy array of unrolled pixel vectors with
two side by side facial images for each entry.
"""
entry -= np.mean(entry, axis=0)
return entry
def get_key(idx):
"""
... |
e5a397033c5720cd7d0ab321c05a8f1d12f4dc99 | tm/tmux_wrapper.py | tm/tmux_wrapper.py | # -*- coding: utf-8 -*-
import subprocess
class SessionExists(Exception):
description = "Session already exists."
pass
class ServerConnectionError(Exception):
description = "tmux server is not currently running."
pass
class SessionDoesNotExist(Exception):
description = "Session does not exist... | # -*- coding: utf-8 -*-
import subprocess
class SessionExists(Exception):
description = "Session already exists."
pass
class ServerConnectionError(Exception):
description = "tmux server is not currently running."
pass
class SessionDoesNotExist(Exception):
description = "Session does not exist... | Use raw command method to run all commands in wrapper | Use raw command method to run all commands in wrapper
| Python | mit | ethanal/tm | # -*- coding: utf-8 -*-
import subprocess
class SessionExists(Exception):
description = "Session already exists."
pass
class ServerConnectionError(Exception):
description = "tmux server is not currently running."
pass
class SessionDoesNotExist(Exception):
description = "Session does not exist... | # -*- coding: utf-8 -*-
import subprocess
class SessionExists(Exception):
description = "Session already exists."
pass
class ServerConnectionError(Exception):
description = "tmux server is not currently running."
pass
class SessionDoesNotExist(Exception):
description = "Session does not exist... | <commit_before># -*- coding: utf-8 -*-
import subprocess
class SessionExists(Exception):
description = "Session already exists."
pass
class ServerConnectionError(Exception):
description = "tmux server is not currently running."
pass
class SessionDoesNotExist(Exception):
description = "Session... | # -*- coding: utf-8 -*-
import subprocess
class SessionExists(Exception):
description = "Session already exists."
pass
class ServerConnectionError(Exception):
description = "tmux server is not currently running."
pass
class SessionDoesNotExist(Exception):
description = "Session does not exist... | # -*- coding: utf-8 -*-
import subprocess
class SessionExists(Exception):
description = "Session already exists."
pass
class ServerConnectionError(Exception):
description = "tmux server is not currently running."
pass
class SessionDoesNotExist(Exception):
description = "Session does not exist... | <commit_before># -*- coding: utf-8 -*-
import subprocess
class SessionExists(Exception):
description = "Session already exists."
pass
class ServerConnectionError(Exception):
description = "tmux server is not currently running."
pass
class SessionDoesNotExist(Exception):
description = "Session... |
cd22543319e4c21b693f91768adcc1cd42aa08a3 | calexicon/fn/overflow.py | calexicon/fn/overflow.py | class OverflowDate(object):
def __init__(self, **info):
self.info = info
def isocalendar(self):
if 'isocalendar' in self.info:
return self.info['isocalendar']
return None
| class OverflowDate(object):
def __init__(self, **info):
self.info = info
def isocalendar(self):
if 'isocalendar' in self.info:
return self.info['isocalendar']
| Remove this line - it is redundant and missing code coverage. | Remove this line - it is redundant and missing code coverage.
| Python | apache-2.0 | jwg4/qual,jwg4/calexicon | class OverflowDate(object):
def __init__(self, **info):
self.info = info
def isocalendar(self):
if 'isocalendar' in self.info:
return self.info['isocalendar']
return None
Remove this line - it is redundant and missing code coverage. | class OverflowDate(object):
def __init__(self, **info):
self.info = info
def isocalendar(self):
if 'isocalendar' in self.info:
return self.info['isocalendar']
| <commit_before>class OverflowDate(object):
def __init__(self, **info):
self.info = info
def isocalendar(self):
if 'isocalendar' in self.info:
return self.info['isocalendar']
return None
<commit_msg>Remove this line - it is redundant and missing code coverage.<commit_after> | class OverflowDate(object):
def __init__(self, **info):
self.info = info
def isocalendar(self):
if 'isocalendar' in self.info:
return self.info['isocalendar']
| class OverflowDate(object):
def __init__(self, **info):
self.info = info
def isocalendar(self):
if 'isocalendar' in self.info:
return self.info['isocalendar']
return None
Remove this line - it is redundant and missing code coverage.class OverflowDate(object):
def __init... | <commit_before>class OverflowDate(object):
def __init__(self, **info):
self.info = info
def isocalendar(self):
if 'isocalendar' in self.info:
return self.info['isocalendar']
return None
<commit_msg>Remove this line - it is redundant and missing code coverage.<commit_after>c... |
e201f3179388414d0ac6fc9d3a641dda3a5930be | snafu/installations.py | snafu/installations.py | import contextlib
import itertools
import os
import pathlib
import re
import subprocess
import attr
@attr.s
class Installation:
path = attr.ib(convert=pathlib.Path)
@property
def python(self):
return self.path.joinpath('python.exe')
@property
def scripts_dir(self):
return self.... | import contextlib
import itertools
import os
import pathlib
import re
import subprocess
import attr
@attr.s
class Installation:
path = attr.ib(convert=pathlib.Path)
@property
def python(self):
return self.path.joinpath('python.exe')
@property
def scripts_dir(self):
return self.... | Fix installation version info type | Fix installation version info type
| Python | isc | uranusjr/snafu,uranusjr/snafu | import contextlib
import itertools
import os
import pathlib
import re
import subprocess
import attr
@attr.s
class Installation:
path = attr.ib(convert=pathlib.Path)
@property
def python(self):
return self.path.joinpath('python.exe')
@property
def scripts_dir(self):
return self.... | import contextlib
import itertools
import os
import pathlib
import re
import subprocess
import attr
@attr.s
class Installation:
path = attr.ib(convert=pathlib.Path)
@property
def python(self):
return self.path.joinpath('python.exe')
@property
def scripts_dir(self):
return self.... | <commit_before>import contextlib
import itertools
import os
import pathlib
import re
import subprocess
import attr
@attr.s
class Installation:
path = attr.ib(convert=pathlib.Path)
@property
def python(self):
return self.path.joinpath('python.exe')
@property
def scripts_dir(self):
... | import contextlib
import itertools
import os
import pathlib
import re
import subprocess
import attr
@attr.s
class Installation:
path = attr.ib(convert=pathlib.Path)
@property
def python(self):
return self.path.joinpath('python.exe')
@property
def scripts_dir(self):
return self.... | import contextlib
import itertools
import os
import pathlib
import re
import subprocess
import attr
@attr.s
class Installation:
path = attr.ib(convert=pathlib.Path)
@property
def python(self):
return self.path.joinpath('python.exe')
@property
def scripts_dir(self):
return self.... | <commit_before>import contextlib
import itertools
import os
import pathlib
import re
import subprocess
import attr
@attr.s
class Installation:
path = attr.ib(convert=pathlib.Path)
@property
def python(self):
return self.path.joinpath('python.exe')
@property
def scripts_dir(self):
... |
5702672ab40ef23089c7a2dfee22aaf539b19a54 | dpaste/settings/tests.py | dpaste/settings/tests.py | """
Settings for the test suite
"""
from .base import *
| """
Settings for the test suite
"""
from .base import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
| Use in-memory sqlite db for testing. | Use in-memory sqlite db for testing.
| Python | mit | bartTC/dpaste,bartTC/dpaste,bartTC/dpaste | """
Settings for the test suite
"""
from .base import *
Use in-memory sqlite db for testing. | """
Settings for the test suite
"""
from .base import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
| <commit_before>"""
Settings for the test suite
"""
from .base import *
<commit_msg>Use in-memory sqlite db for testing.<commit_after> | """
Settings for the test suite
"""
from .base import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
| """
Settings for the test suite
"""
from .base import *
Use in-memory sqlite db for testing."""
Settings for the test suite
"""
from .base import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
| <commit_before>"""
Settings for the test suite
"""
from .base import *
<commit_msg>Use in-memory sqlite db for testing.<commit_after>"""
Settings for the test suite
"""
from .base import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
|
ab6293bbe039cb0c939493c3b921f114ad68645b | tests/test_plugin_execute.py | tests/test_plugin_execute.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
test_onebot_execute
----------------------------------
Tests for Execute plugin
"""
from irc3.testing import BotTestCase
class ExecutePluginTestCase(BotTestCase):
config = {
'includes': [
'onebot.plugins.execute'
],
'onebot... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
test_onebot_execute
----------------------------------
Tests for Execute plugin
"""
from irc3.testing import BotTestCase
class ExecutePluginTestCase(BotTestCase):
config = {
'includes': [
'onebot.plugins.execute'
],
'onebot... | Fix test for connection made | Fix test for connection made
| Python | bsd-3-clause | thomwiggers/onebot | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
test_onebot_execute
----------------------------------
Tests for Execute plugin
"""
from irc3.testing import BotTestCase
class ExecutePluginTestCase(BotTestCase):
config = {
'includes': [
'onebot.plugins.execute'
],
'onebot... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
test_onebot_execute
----------------------------------
Tests for Execute plugin
"""
from irc3.testing import BotTestCase
class ExecutePluginTestCase(BotTestCase):
config = {
'includes': [
'onebot.plugins.execute'
],
'onebot... | <commit_before>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
test_onebot_execute
----------------------------------
Tests for Execute plugin
"""
from irc3.testing import BotTestCase
class ExecutePluginTestCase(BotTestCase):
config = {
'includes': [
'onebot.plugins.execute'
],
... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
test_onebot_execute
----------------------------------
Tests for Execute plugin
"""
from irc3.testing import BotTestCase
class ExecutePluginTestCase(BotTestCase):
config = {
'includes': [
'onebot.plugins.execute'
],
'onebot... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
test_onebot_execute
----------------------------------
Tests for Execute plugin
"""
from irc3.testing import BotTestCase
class ExecutePluginTestCase(BotTestCase):
config = {
'includes': [
'onebot.plugins.execute'
],
'onebot... | <commit_before>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
test_onebot_execute
----------------------------------
Tests for Execute plugin
"""
from irc3.testing import BotTestCase
class ExecutePluginTestCase(BotTestCase):
config = {
'includes': [
'onebot.plugins.execute'
],
... |
dbf1298d3adec2f2aab56bbbccec5de98cbaf15c | tools/examples/check-modified.py | tools/examples/check-modified.py | #!/usr/bin/python
#
# USAGE: check-modified.py FILE_OR_DIR1 FILE_OR_DIR2 ...
#
# prints out the URL associated with each item
#
import sys
import os
import os.path
import svn.util
import svn.client
import svn.wc
def usage():
print "Usage: " + sys.argv[0] + " FILE_OR_DIR1 FILE_OR_DIR2\n"
sys.exit(0)
def run(files... | #!/usr/bin/python
#
# USAGE: check-modified.py FILE_OR_DIR1 FILE_OR_DIR2 ...
#
# prints out the URL associated with each item
#
import sys
import os
import os.path
import svn.util
import svn.client
import svn.wc
FORCE_COMPARISON = 0
def usage():
print "Usage: " + sys.argv[0] + " FILE_OR_DIR1 FILE_OR_DIR2\n"
sys.... | Fix a broken example script. | Fix a broken example script.
* check-modified.py (FORCE_COMPARISON): New variable.
(run): Add FORCE_COMPARISON arg to call to svn_wc_text_modified_p.
git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@850428 13f79535-47bb-0310-9956-ffa450edef68
| Python | apache-2.0 | wbond/subversion,wbond/subversion,YueLinHo/Subversion,YueLinHo/Subversion,wbond/subversion,YueLinHo/Subversion,YueLinHo/Subversion,wbond/subversion,wbond/subversion,YueLinHo/Subversion,YueLinHo/Subversion,YueLinHo/Subversion,wbond/subversion,YueLinHo/Subversion,wbond/subversion | #!/usr/bin/python
#
# USAGE: check-modified.py FILE_OR_DIR1 FILE_OR_DIR2 ...
#
# prints out the URL associated with each item
#
import sys
import os
import os.path
import svn.util
import svn.client
import svn.wc
def usage():
print "Usage: " + sys.argv[0] + " FILE_OR_DIR1 FILE_OR_DIR2\n"
sys.exit(0)
def run(files... | #!/usr/bin/python
#
# USAGE: check-modified.py FILE_OR_DIR1 FILE_OR_DIR2 ...
#
# prints out the URL associated with each item
#
import sys
import os
import os.path
import svn.util
import svn.client
import svn.wc
FORCE_COMPARISON = 0
def usage():
print "Usage: " + sys.argv[0] + " FILE_OR_DIR1 FILE_OR_DIR2\n"
sys.... | <commit_before>#!/usr/bin/python
#
# USAGE: check-modified.py FILE_OR_DIR1 FILE_OR_DIR2 ...
#
# prints out the URL associated with each item
#
import sys
import os
import os.path
import svn.util
import svn.client
import svn.wc
def usage():
print "Usage: " + sys.argv[0] + " FILE_OR_DIR1 FILE_OR_DIR2\n"
sys.exit(0)... | #!/usr/bin/python
#
# USAGE: check-modified.py FILE_OR_DIR1 FILE_OR_DIR2 ...
#
# prints out the URL associated with each item
#
import sys
import os
import os.path
import svn.util
import svn.client
import svn.wc
FORCE_COMPARISON = 0
def usage():
print "Usage: " + sys.argv[0] + " FILE_OR_DIR1 FILE_OR_DIR2\n"
sys.... | #!/usr/bin/python
#
# USAGE: check-modified.py FILE_OR_DIR1 FILE_OR_DIR2 ...
#
# prints out the URL associated with each item
#
import sys
import os
import os.path
import svn.util
import svn.client
import svn.wc
def usage():
print "Usage: " + sys.argv[0] + " FILE_OR_DIR1 FILE_OR_DIR2\n"
sys.exit(0)
def run(files... | <commit_before>#!/usr/bin/python
#
# USAGE: check-modified.py FILE_OR_DIR1 FILE_OR_DIR2 ...
#
# prints out the URL associated with each item
#
import sys
import os
import os.path
import svn.util
import svn.client
import svn.wc
def usage():
print "Usage: " + sys.argv[0] + " FILE_OR_DIR1 FILE_OR_DIR2\n"
sys.exit(0)... |
9df3f3a2d0660b8e8166aa944bf45f261a51d987 | ies_base/serializers.py | ies_base/serializers.py | from rest_framework import serializers
class Tag(object):
def __init__(self, name, related_tags, equivalent_names):
self.name = name
self.related_tags = related_tags
self.equivalent_names = equivalent_names
class TagSerializer(serializers.Serializer):
name = serializers.CharField()
... | from rest_framework import serializers
class Tag(object):
def __init__(self, name, related_tags, equivalent_names):
self.name = name
self.related_tags = related_tags
self.equivalent_names = equivalent_names
class TagSerializer(serializers.Serializer):
name = serializers.CharField()
... | Make default color not required | Make default color not required
| Python | mit | InstanteSports/ies-django-base | from rest_framework import serializers
class Tag(object):
def __init__(self, name, related_tags, equivalent_names):
self.name = name
self.related_tags = related_tags
self.equivalent_names = equivalent_names
class TagSerializer(serializers.Serializer):
name = serializers.CharField()
... | from rest_framework import serializers
class Tag(object):
def __init__(self, name, related_tags, equivalent_names):
self.name = name
self.related_tags = related_tags
self.equivalent_names = equivalent_names
class TagSerializer(serializers.Serializer):
name = serializers.CharField()
... | <commit_before>from rest_framework import serializers
class Tag(object):
def __init__(self, name, related_tags, equivalent_names):
self.name = name
self.related_tags = related_tags
self.equivalent_names = equivalent_names
class TagSerializer(serializers.Serializer):
name = serializer... | from rest_framework import serializers
class Tag(object):
def __init__(self, name, related_tags, equivalent_names):
self.name = name
self.related_tags = related_tags
self.equivalent_names = equivalent_names
class TagSerializer(serializers.Serializer):
name = serializers.CharField()
... | from rest_framework import serializers
class Tag(object):
def __init__(self, name, related_tags, equivalent_names):
self.name = name
self.related_tags = related_tags
self.equivalent_names = equivalent_names
class TagSerializer(serializers.Serializer):
name = serializers.CharField()
... | <commit_before>from rest_framework import serializers
class Tag(object):
def __init__(self, name, related_tags, equivalent_names):
self.name = name
self.related_tags = related_tags
self.equivalent_names = equivalent_names
class TagSerializer(serializers.Serializer):
name = serializer... |
218265d65695e777cd3e010c6a0108fad6fea5f6 | beavy/common/including_hyperlink_related.py | beavy/common/including_hyperlink_related.py |
from marshmallow_jsonapi.fields import HyperlinkRelated
from marshmallow_jsonapi.utils import get_value_or_raise
class IncludingHyperlinkRelated(HyperlinkRelated):
def __init__(self, nestedObj, *args, **kwargs):
if callable(nestedObj):
nestedObj = nestedObj(many=False)
self.nestedOb... |
from marshmallow_jsonapi.fields import HyperlinkRelated
from marshmallow_jsonapi.utils import get_value_or_raise
class IncludingHyperlinkRelated(HyperlinkRelated):
def __init__(self, nestedObj, *args, **kwargs):
if callable(nestedObj):
nestedObj = nestedObj(many=False)
self.nestedOb... | Enforce that our Including Hyperlink includes | Enforce that our Including Hyperlink includes
| Python | mpl-2.0 | beavyHQ/beavy,beavyHQ/beavy,beavyHQ/beavy,beavyHQ/beavy |
from marshmallow_jsonapi.fields import HyperlinkRelated
from marshmallow_jsonapi.utils import get_value_or_raise
class IncludingHyperlinkRelated(HyperlinkRelated):
def __init__(self, nestedObj, *args, **kwargs):
if callable(nestedObj):
nestedObj = nestedObj(many=False)
self.nestedOb... |
from marshmallow_jsonapi.fields import HyperlinkRelated
from marshmallow_jsonapi.utils import get_value_or_raise
class IncludingHyperlinkRelated(HyperlinkRelated):
def __init__(self, nestedObj, *args, **kwargs):
if callable(nestedObj):
nestedObj = nestedObj(many=False)
self.nestedOb... | <commit_before>
from marshmallow_jsonapi.fields import HyperlinkRelated
from marshmallow_jsonapi.utils import get_value_or_raise
class IncludingHyperlinkRelated(HyperlinkRelated):
def __init__(self, nestedObj, *args, **kwargs):
if callable(nestedObj):
nestedObj = nestedObj(many=False)
... |
from marshmallow_jsonapi.fields import HyperlinkRelated
from marshmallow_jsonapi.utils import get_value_or_raise
class IncludingHyperlinkRelated(HyperlinkRelated):
def __init__(self, nestedObj, *args, **kwargs):
if callable(nestedObj):
nestedObj = nestedObj(many=False)
self.nestedOb... |
from marshmallow_jsonapi.fields import HyperlinkRelated
from marshmallow_jsonapi.utils import get_value_or_raise
class IncludingHyperlinkRelated(HyperlinkRelated):
def __init__(self, nestedObj, *args, **kwargs):
if callable(nestedObj):
nestedObj = nestedObj(many=False)
self.nestedOb... | <commit_before>
from marshmallow_jsonapi.fields import HyperlinkRelated
from marshmallow_jsonapi.utils import get_value_or_raise
class IncludingHyperlinkRelated(HyperlinkRelated):
def __init__(self, nestedObj, *args, **kwargs):
if callable(nestedObj):
nestedObj = nestedObj(many=False)
... |
c9f21a389028ed3b831286dc6c3991f48faa6e81 | app/soc/mapreduce/convert_project_mentors.py | app/soc/mapreduce/convert_project_mentors.py | #!/usr/bin/python2.5
#
# Copyright 2011 the Melange 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | #!/usr/bin/python2.5
#
# Copyright 2011 the Melange 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | Remove the check for existence of project since mapreduce API guarantees that. | Remove the check for existence of project since mapreduce API guarantees that.
Also remove unused imports.
| Python | apache-2.0 | rhyolight/nupic.son,rhyolight/nupic.son,rhyolight/nupic.son | #!/usr/bin/python2.5
#
# Copyright 2011 the Melange 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | #!/usr/bin/python2.5
#
# Copyright 2011 the Melange 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | <commit_before>#!/usr/bin/python2.5
#
# Copyright 2011 the Melange 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | #!/usr/bin/python2.5
#
# Copyright 2011 the Melange 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | #!/usr/bin/python2.5
#
# Copyright 2011 the Melange 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | <commit_before>#!/usr/bin/python2.5
#
# Copyright 2011 the Melange 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... |
d056d0e140e05953aaf496aa268e65e642ce3b73 | ninja/files.py | ninja/files.py | from typing import Any, Callable, Dict, Iterable, Optional, Type
from django.core.files.uploadedfile import UploadedFile as DjangoUploadedFile
from pydantic.fields import ModelField
__all__ = ["UploadedFile"]
class UploadedFile(DjangoUploadedFile):
@classmethod
def __get_validators__(cls: Type["UploadedFile... | from typing import Any, Callable, Dict, Iterable, Optional, Type
from django.core.files.uploadedfile import UploadedFile as DjangoUploadedFile
from pydantic.fields import ModelField
__all__ = ["UploadedFile"]
class UploadedFile(DjangoUploadedFile):
@classmethod
def __get_validators__(cls: Type["UploadedFile... | Add missing return value type hint | Add missing return value type hint | Python | mit | vitalik/django-ninja,vitalik/django-ninja,vitalik/django-ninja | from typing import Any, Callable, Dict, Iterable, Optional, Type
from django.core.files.uploadedfile import UploadedFile as DjangoUploadedFile
from pydantic.fields import ModelField
__all__ = ["UploadedFile"]
class UploadedFile(DjangoUploadedFile):
@classmethod
def __get_validators__(cls: Type["UploadedFile... | from typing import Any, Callable, Dict, Iterable, Optional, Type
from django.core.files.uploadedfile import UploadedFile as DjangoUploadedFile
from pydantic.fields import ModelField
__all__ = ["UploadedFile"]
class UploadedFile(DjangoUploadedFile):
@classmethod
def __get_validators__(cls: Type["UploadedFile... | <commit_before>from typing import Any, Callable, Dict, Iterable, Optional, Type
from django.core.files.uploadedfile import UploadedFile as DjangoUploadedFile
from pydantic.fields import ModelField
__all__ = ["UploadedFile"]
class UploadedFile(DjangoUploadedFile):
@classmethod
def __get_validators__(cls: Typ... | from typing import Any, Callable, Dict, Iterable, Optional, Type
from django.core.files.uploadedfile import UploadedFile as DjangoUploadedFile
from pydantic.fields import ModelField
__all__ = ["UploadedFile"]
class UploadedFile(DjangoUploadedFile):
@classmethod
def __get_validators__(cls: Type["UploadedFile... | from typing import Any, Callable, Dict, Iterable, Optional, Type
from django.core.files.uploadedfile import UploadedFile as DjangoUploadedFile
from pydantic.fields import ModelField
__all__ = ["UploadedFile"]
class UploadedFile(DjangoUploadedFile):
@classmethod
def __get_validators__(cls: Type["UploadedFile... | <commit_before>from typing import Any, Callable, Dict, Iterable, Optional, Type
from django.core.files.uploadedfile import UploadedFile as DjangoUploadedFile
from pydantic.fields import ModelField
__all__ = ["UploadedFile"]
class UploadedFile(DjangoUploadedFile):
@classmethod
def __get_validators__(cls: Typ... |
71a2cc9a036cee2b541b149e57d162004500bfbb | wagtaildraftail/wagtail_hooks.py | wagtaildraftail/wagtail_hooks.py | from django.utils.html import format_html
from django.contrib.staticfiles.templatetags.staticfiles import static
from wagtail.wagtailcore import hooks
@hooks.register('insert_editor_js')
def draftail_editor_js():
return format_html('<script src="{0}"></script>',
static('wagtaildraftail/wagt... | from django.utils.html import format_html
from django.contrib.staticfiles.templatetags.staticfiles import static
from wagtail.wagtailcore import hooks
@hooks.register('insert_editor_js')
def draftail_editor_js():
return format_html('<script src="{0}"></script>', static('wagtaildraftail/wagtaildraftail.js'))
@ho... | Add hook to load CSS | Add hook to load CSS
| Python | mit | springload/wagtaildraftail,gasman/wagtaildraftail,gasman/wagtaildraftail,springload/wagtaildraftail,springload/wagtaildraftail,springload/wagtaildraftail,gasman/wagtaildraftail,gasman/wagtaildraftail | from django.utils.html import format_html
from django.contrib.staticfiles.templatetags.staticfiles import static
from wagtail.wagtailcore import hooks
@hooks.register('insert_editor_js')
def draftail_editor_js():
return format_html('<script src="{0}"></script>',
static('wagtaildraftail/wagt... | from django.utils.html import format_html
from django.contrib.staticfiles.templatetags.staticfiles import static
from wagtail.wagtailcore import hooks
@hooks.register('insert_editor_js')
def draftail_editor_js():
return format_html('<script src="{0}"></script>', static('wagtaildraftail/wagtaildraftail.js'))
@ho... | <commit_before>from django.utils.html import format_html
from django.contrib.staticfiles.templatetags.staticfiles import static
from wagtail.wagtailcore import hooks
@hooks.register('insert_editor_js')
def draftail_editor_js():
return format_html('<script src="{0}"></script>',
static('wagta... | from django.utils.html import format_html
from django.contrib.staticfiles.templatetags.staticfiles import static
from wagtail.wagtailcore import hooks
@hooks.register('insert_editor_js')
def draftail_editor_js():
return format_html('<script src="{0}"></script>', static('wagtaildraftail/wagtaildraftail.js'))
@ho... | from django.utils.html import format_html
from django.contrib.staticfiles.templatetags.staticfiles import static
from wagtail.wagtailcore import hooks
@hooks.register('insert_editor_js')
def draftail_editor_js():
return format_html('<script src="{0}"></script>',
static('wagtaildraftail/wagt... | <commit_before>from django.utils.html import format_html
from django.contrib.staticfiles.templatetags.staticfiles import static
from wagtail.wagtailcore import hooks
@hooks.register('insert_editor_js')
def draftail_editor_js():
return format_html('<script src="{0}"></script>',
static('wagta... |
494d35234e30d368a9539910ff3ad6d45ed73125 | containers/containers.py | containers/containers.py | try:
from urllib import urlretrieve
except ImportError:
from urllib.request import urlretrieve
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
import os
def simple_discovery(path, var=None, secure=True):
if secure:
protocol = 'https'
else:
... | try:
from urllib import urlretrieve
except ImportError:
from urllib.request import urlretrieve
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
import os
def simple_discovery(name, var=None, secure=True):
'''Perform simple discovery and save the discovered... | Add better docstring to simple_discovery | Add better docstring to simple_discovery
| Python | mit | kragniz/containers | try:
from urllib import urlretrieve
except ImportError:
from urllib.request import urlretrieve
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
import os
def simple_discovery(path, var=None, secure=True):
if secure:
protocol = 'https'
else:
... | try:
from urllib import urlretrieve
except ImportError:
from urllib.request import urlretrieve
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
import os
def simple_discovery(name, var=None, secure=True):
'''Perform simple discovery and save the discovered... | <commit_before>try:
from urllib import urlretrieve
except ImportError:
from urllib.request import urlretrieve
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
import os
def simple_discovery(path, var=None, secure=True):
if secure:
protocol = 'https... | try:
from urllib import urlretrieve
except ImportError:
from urllib.request import urlretrieve
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
import os
def simple_discovery(name, var=None, secure=True):
'''Perform simple discovery and save the discovered... | try:
from urllib import urlretrieve
except ImportError:
from urllib.request import urlretrieve
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
import os
def simple_discovery(path, var=None, secure=True):
if secure:
protocol = 'https'
else:
... | <commit_before>try:
from urllib import urlretrieve
except ImportError:
from urllib.request import urlretrieve
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
import os
def simple_discovery(path, var=None, secure=True):
if secure:
protocol = 'https... |
999d7a337c0bb2b55da85019abba26edbf5f467a | ceviche/__init__.py | ceviche/__init__.py | # used for setup.py
name = "ceviche"
__version__ = '0.0.1'
from .fdtd import fdtd
from .fdfd import fdfd_ez, fdfd_hz, fdfd_ez_nl
from .jacobians import jacobian
from . import viz
| # used for setup.py
name = "ceviche"
__version__ = '0.0.1'
from .fdtd import fdtd
from .fdfd import fdfd_ez, fdfd_hz, fdfd_ez_nl
from .jacobians import jacobian
from . import viz
from . import modes
from . import utils
| Add modes and utils submodules | Add modes and utils submodules
| Python | mit | fancompute/ceviche,fancompute/ceviche | # used for setup.py
name = "ceviche"
__version__ = '0.0.1'
from .fdtd import fdtd
from .fdfd import fdfd_ez, fdfd_hz, fdfd_ez_nl
from .jacobians import jacobian
from . import viz
Add modes and utils submodules | # used for setup.py
name = "ceviche"
__version__ = '0.0.1'
from .fdtd import fdtd
from .fdfd import fdfd_ez, fdfd_hz, fdfd_ez_nl
from .jacobians import jacobian
from . import viz
from . import modes
from . import utils
| <commit_before># used for setup.py
name = "ceviche"
__version__ = '0.0.1'
from .fdtd import fdtd
from .fdfd import fdfd_ez, fdfd_hz, fdfd_ez_nl
from .jacobians import jacobian
from . import viz
<commit_msg>Add modes and utils submodules<commit_after> | # used for setup.py
name = "ceviche"
__version__ = '0.0.1'
from .fdtd import fdtd
from .fdfd import fdfd_ez, fdfd_hz, fdfd_ez_nl
from .jacobians import jacobian
from . import viz
from . import modes
from . import utils
| # used for setup.py
name = "ceviche"
__version__ = '0.0.1'
from .fdtd import fdtd
from .fdfd import fdfd_ez, fdfd_hz, fdfd_ez_nl
from .jacobians import jacobian
from . import viz
Add modes and utils submodules# used for setup.py
name = "ceviche"
__version__ = '0.0.1'
from .fdtd import fdtd
from .fdfd import fdfd_e... | <commit_before># used for setup.py
name = "ceviche"
__version__ = '0.0.1'
from .fdtd import fdtd
from .fdfd import fdfd_ez, fdfd_hz, fdfd_ez_nl
from .jacobians import jacobian
from . import viz
<commit_msg>Add modes and utils submodules<commit_after># used for setup.py
name = "ceviche"
__version__ = '0.0.1'
from .... |
fc1b14989453cfac9ae42116ac4ba5ef3c00f573 | dashboard/templatetags/datetime_duration.py | dashboard/templatetags/datetime_duration.py | from django import template
import datetime
register = template.Library()
# Turn a datetime.timedelta into a string
@register.filter(name='timedelta')
def timedelta(value):
if not value:
return "0"
time = value / 1000000
delta = datetime.timedelta(0, time)
return str(delta)
| from django import template
import datetime
register = template.Library()
# Turn a datetime.timedelta into a string
@register.filter(name='timedelta')
def timedelta(value):
if not value:
return "0"
int(time = value / 1000000)
delta = datetime.timedelta(0, time)
return str(delta)
| Fix int() error in datetime value | Fix int() error in datetime value
| Python | mit | ethanperez/t4k-rms,ethanperez/t4k-rms | from django import template
import datetime
register = template.Library()
# Turn a datetime.timedelta into a string
@register.filter(name='timedelta')
def timedelta(value):
if not value:
return "0"
time = value / 1000000
delta = datetime.timedelta(0, time)
return str(delta)
Fix int() error in ... | from django import template
import datetime
register = template.Library()
# Turn a datetime.timedelta into a string
@register.filter(name='timedelta')
def timedelta(value):
if not value:
return "0"
int(time = value / 1000000)
delta = datetime.timedelta(0, time)
return str(delta)
| <commit_before>from django import template
import datetime
register = template.Library()
# Turn a datetime.timedelta into a string
@register.filter(name='timedelta')
def timedelta(value):
if not value:
return "0"
time = value / 1000000
delta = datetime.timedelta(0, time)
return str(delta)
<com... | from django import template
import datetime
register = template.Library()
# Turn a datetime.timedelta into a string
@register.filter(name='timedelta')
def timedelta(value):
if not value:
return "0"
int(time = value / 1000000)
delta = datetime.timedelta(0, time)
return str(delta)
| from django import template
import datetime
register = template.Library()
# Turn a datetime.timedelta into a string
@register.filter(name='timedelta')
def timedelta(value):
if not value:
return "0"
time = value / 1000000
delta = datetime.timedelta(0, time)
return str(delta)
Fix int() error in ... | <commit_before>from django import template
import datetime
register = template.Library()
# Turn a datetime.timedelta into a string
@register.filter(name='timedelta')
def timedelta(value):
if not value:
return "0"
time = value / 1000000
delta = datetime.timedelta(0, time)
return str(delta)
<com... |
388c138950412d309b481d93378266c802b8e98c | deploy/deploy.py | deploy/deploy.py | import json
MAINJS_PATH = 'js/common.js'
MANIFEST_PATH = 'manifest.json'
DEV_URL = 'http://localhost:8000'
PROD_URL = 'http://eyebrowse.csail.mit.edu'
def rewriteBaseUrl():
with open(MAINJS_PATH, 'r+') as f:
text = f.read()
text = text.replace(DEV_URL, PROD_URL)
f.seek(0)
f.write(text)
f.trunca... | import json
MAINJS_PATH = 'js/common.js'
MANIFEST_PATH = 'manifest.json'
DEV_URL = 'http://localhost:8000'
PROD_URL = 'https://eyebrowse.csail.mit.edu'
def rewriteBaseUrl():
with open(MAINJS_PATH, 'r+') as f:
text = f.read()
text = text.replace(DEV_URL, PROD_URL)
f.seek(0)
f.write(text)
f.trunc... | Change prod url to https | Change prod url to https
| Python | mit | haystack/eyebrowse-chrome-ext,haystack/eyebrowse-chrome-ext,haystack/eyebrowse-chrome-ext,haystack/eyebrowse-chrome-ext | import json
MAINJS_PATH = 'js/common.js'
MANIFEST_PATH = 'manifest.json'
DEV_URL = 'http://localhost:8000'
PROD_URL = 'http://eyebrowse.csail.mit.edu'
def rewriteBaseUrl():
with open(MAINJS_PATH, 'r+') as f:
text = f.read()
text = text.replace(DEV_URL, PROD_URL)
f.seek(0)
f.write(text)
f.trunca... | import json
MAINJS_PATH = 'js/common.js'
MANIFEST_PATH = 'manifest.json'
DEV_URL = 'http://localhost:8000'
PROD_URL = 'https://eyebrowse.csail.mit.edu'
def rewriteBaseUrl():
with open(MAINJS_PATH, 'r+') as f:
text = f.read()
text = text.replace(DEV_URL, PROD_URL)
f.seek(0)
f.write(text)
f.trunc... | <commit_before>import json
MAINJS_PATH = 'js/common.js'
MANIFEST_PATH = 'manifest.json'
DEV_URL = 'http://localhost:8000'
PROD_URL = 'http://eyebrowse.csail.mit.edu'
def rewriteBaseUrl():
with open(MAINJS_PATH, 'r+') as f:
text = f.read()
text = text.replace(DEV_URL, PROD_URL)
f.seek(0)
f.write(tex... | import json
MAINJS_PATH = 'js/common.js'
MANIFEST_PATH = 'manifest.json'
DEV_URL = 'http://localhost:8000'
PROD_URL = 'https://eyebrowse.csail.mit.edu'
def rewriteBaseUrl():
with open(MAINJS_PATH, 'r+') as f:
text = f.read()
text = text.replace(DEV_URL, PROD_URL)
f.seek(0)
f.write(text)
f.trunc... | import json
MAINJS_PATH = 'js/common.js'
MANIFEST_PATH = 'manifest.json'
DEV_URL = 'http://localhost:8000'
PROD_URL = 'http://eyebrowse.csail.mit.edu'
def rewriteBaseUrl():
with open(MAINJS_PATH, 'r+') as f:
text = f.read()
text = text.replace(DEV_URL, PROD_URL)
f.seek(0)
f.write(text)
f.trunca... | <commit_before>import json
MAINJS_PATH = 'js/common.js'
MANIFEST_PATH = 'manifest.json'
DEV_URL = 'http://localhost:8000'
PROD_URL = 'http://eyebrowse.csail.mit.edu'
def rewriteBaseUrl():
with open(MAINJS_PATH, 'r+') as f:
text = f.read()
text = text.replace(DEV_URL, PROD_URL)
f.seek(0)
f.write(tex... |
1ba4d84fb72a343cdf288d905d2029f1d2fbee12 | wagtail/api/v2/pagination.py | wagtail/api/v2/pagination.py | from collections import OrderedDict
from django.conf import settings
from rest_framework.pagination import BasePagination
from rest_framework.response import Response
from .utils import BadRequestError
class WagtailPagination(BasePagination):
def paginate_queryset(self, queryset, request, view=None):
li... | from collections import OrderedDict
from django.conf import settings
from rest_framework.pagination import BasePagination
from rest_framework.response import Response
from .utils import BadRequestError
class WagtailPagination(BasePagination):
def paginate_queryset(self, queryset, request, view=None):
li... | Remove assert from WagtailPagination.paginate_queryset method | Remove assert from WagtailPagination.paginate_queryset method
| Python | bsd-3-clause | mikedingjan/wagtail,rsalmaso/wagtail,rsalmaso/wagtail,jnns/wagtail,mixxorz/wagtail,wagtail/wagtail,mixxorz/wagtail,FlipperPA/wagtail,wagtail/wagtail,gasman/wagtail,zerolab/wagtail,torchbox/wagtail,mikedingjan/wagtail,timorieber/wagtail,zerolab/wagtail,gasman/wagtail,jnns/wagtail,zerolab/wagtail,kaedroho/wagtail,thenewg... | from collections import OrderedDict
from django.conf import settings
from rest_framework.pagination import BasePagination
from rest_framework.response import Response
from .utils import BadRequestError
class WagtailPagination(BasePagination):
def paginate_queryset(self, queryset, request, view=None):
li... | from collections import OrderedDict
from django.conf import settings
from rest_framework.pagination import BasePagination
from rest_framework.response import Response
from .utils import BadRequestError
class WagtailPagination(BasePagination):
def paginate_queryset(self, queryset, request, view=None):
li... | <commit_before>from collections import OrderedDict
from django.conf import settings
from rest_framework.pagination import BasePagination
from rest_framework.response import Response
from .utils import BadRequestError
class WagtailPagination(BasePagination):
def paginate_queryset(self, queryset, request, view=No... | from collections import OrderedDict
from django.conf import settings
from rest_framework.pagination import BasePagination
from rest_framework.response import Response
from .utils import BadRequestError
class WagtailPagination(BasePagination):
def paginate_queryset(self, queryset, request, view=None):
li... | from collections import OrderedDict
from django.conf import settings
from rest_framework.pagination import BasePagination
from rest_framework.response import Response
from .utils import BadRequestError
class WagtailPagination(BasePagination):
def paginate_queryset(self, queryset, request, view=None):
li... | <commit_before>from collections import OrderedDict
from django.conf import settings
from rest_framework.pagination import BasePagination
from rest_framework.response import Response
from .utils import BadRequestError
class WagtailPagination(BasePagination):
def paginate_queryset(self, queryset, request, view=No... |
75dc15e5c4a9cf6e442dbe9e14d3f78f977b2e68 | diesel/logmod.py | diesel/logmod.py | # vim:ts=4:sw=4:expandtab
'''A simple logging module that supports various verbosity
levels and component-specific subloggers.
'''
import sys
import time
from twiggy import log as olog, add_emitters, levels, outputs, formats, emitters
from functools import partial
diesel_format = formats.line_format
diesel_format.tra... | # vim:ts=4:sw=4:expandtab
'''A simple logging module that supports various verbosity
levels and component-specific subloggers.
'''
import sys
import time
from twiggy import log as olog, levels, outputs, formats, emitters
try:
from twiggy import add_emitters
except ImportError:
from twiggy import addEmitters as... | Support Twiggy 0.2 and 0.4 APIs | Support Twiggy 0.2 and 0.4 APIs
| Python | bsd-3-clause | dieseldev/diesel | # vim:ts=4:sw=4:expandtab
'''A simple logging module that supports various verbosity
levels and component-specific subloggers.
'''
import sys
import time
from twiggy import log as olog, add_emitters, levels, outputs, formats, emitters
from functools import partial
diesel_format = formats.line_format
diesel_format.tra... | # vim:ts=4:sw=4:expandtab
'''A simple logging module that supports various verbosity
levels and component-specific subloggers.
'''
import sys
import time
from twiggy import log as olog, levels, outputs, formats, emitters
try:
from twiggy import add_emitters
except ImportError:
from twiggy import addEmitters as... | <commit_before># vim:ts=4:sw=4:expandtab
'''A simple logging module that supports various verbosity
levels and component-specific subloggers.
'''
import sys
import time
from twiggy import log as olog, add_emitters, levels, outputs, formats, emitters
from functools import partial
diesel_format = formats.line_format
di... | # vim:ts=4:sw=4:expandtab
'''A simple logging module that supports various verbosity
levels and component-specific subloggers.
'''
import sys
import time
from twiggy import log as olog, levels, outputs, formats, emitters
try:
from twiggy import add_emitters
except ImportError:
from twiggy import addEmitters as... | # vim:ts=4:sw=4:expandtab
'''A simple logging module that supports various verbosity
levels and component-specific subloggers.
'''
import sys
import time
from twiggy import log as olog, add_emitters, levels, outputs, formats, emitters
from functools import partial
diesel_format = formats.line_format
diesel_format.tra... | <commit_before># vim:ts=4:sw=4:expandtab
'''A simple logging module that supports various verbosity
levels and component-specific subloggers.
'''
import sys
import time
from twiggy import log as olog, add_emitters, levels, outputs, formats, emitters
from functools import partial
diesel_format = formats.line_format
di... |
690f771ac17bb1b81aaf3b4ae06fd8eac0735ac8 | myflaskapp/tests/test_unit.py | myflaskapp/tests/test_unit.py | import unittest
import requests
class SmokeTest(unittest.TestCase):
def test_maths(self):
self.assertEquals(6, 2 + 4)
def test_home_page_is_about_todo_lists(self):
request = requests.get('http://localhost:5000')
self.assertTrue(
request.content.startswith(bytes('\n\n<!doct... | import unittest
import requests
class SmokeTest(unittest.TestCase):
def test_maths(self):
self.assertEquals(6, 2 + 4)
def test_home_page_is_about_todo_lists(self):
request = requests.get('http://localhost:5000')
self.assertTrue(
request.content.startswith(bytes('\n\n<!doct... | Add TestMainPage using WebTest module | Add TestMainPage using WebTest module
| Python | mit | terryjbates/test-driven-development-with-python,terryjbates/test-driven-development-with-python,terryjbates/test-driven-development-with-python,terryjbates/test-driven-development-with-python,terryjbates/test-driven-development-with-python | import unittest
import requests
class SmokeTest(unittest.TestCase):
def test_maths(self):
self.assertEquals(6, 2 + 4)
def test_home_page_is_about_todo_lists(self):
request = requests.get('http://localhost:5000')
self.assertTrue(
request.content.startswith(bytes('\n\n<!doct... | import unittest
import requests
class SmokeTest(unittest.TestCase):
def test_maths(self):
self.assertEquals(6, 2 + 4)
def test_home_page_is_about_todo_lists(self):
request = requests.get('http://localhost:5000')
self.assertTrue(
request.content.startswith(bytes('\n\n<!doct... | <commit_before>import unittest
import requests
class SmokeTest(unittest.TestCase):
def test_maths(self):
self.assertEquals(6, 2 + 4)
def test_home_page_is_about_todo_lists(self):
request = requests.get('http://localhost:5000')
self.assertTrue(
request.content.startswith(by... | import unittest
import requests
class SmokeTest(unittest.TestCase):
def test_maths(self):
self.assertEquals(6, 2 + 4)
def test_home_page_is_about_todo_lists(self):
request = requests.get('http://localhost:5000')
self.assertTrue(
request.content.startswith(bytes('\n\n<!doct... | import unittest
import requests
class SmokeTest(unittest.TestCase):
def test_maths(self):
self.assertEquals(6, 2 + 4)
def test_home_page_is_about_todo_lists(self):
request = requests.get('http://localhost:5000')
self.assertTrue(
request.content.startswith(bytes('\n\n<!doct... | <commit_before>import unittest
import requests
class SmokeTest(unittest.TestCase):
def test_maths(self):
self.assertEquals(6, 2 + 4)
def test_home_page_is_about_todo_lists(self):
request = requests.get('http://localhost:5000')
self.assertTrue(
request.content.startswith(by... |
1494bc56008f50f24d9046f7713b27a250b54eeb | skimage/transform/setup.py | skimage/transform/setup.py | #!/usr/bin/env python
import os
from skimage._build import cython
base_path = os.path.abspath(os.path.dirname(__file__))
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration, get_numpy_include_dirs
config = Configuration('transform', parent_package, top_... | #!/usr/bin/env python
import os
from skimage._build import cython
base_path = os.path.abspath(os.path.dirname(__file__))
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration, get_numpy_include_dirs
config = Configuration('transform', parent_package, top_... | Remove unused fopenmp compile args | Remove unused fopenmp compile args
| Python | bsd-3-clause | bennlich/scikit-image,rjeli/scikit-image,SamHames/scikit-image,dpshelio/scikit-image,ClinicalGraphics/scikit-image,Hiyorimi/scikit-image,pratapvardhan/scikit-image,emon10005/scikit-image,chintak/scikit-image,michaelaye/scikit-image,newville/scikit-image,ofgulban/scikit-image,chintak/scikit-image,blink1073/scikit-image,... | #!/usr/bin/env python
import os
from skimage._build import cython
base_path = os.path.abspath(os.path.dirname(__file__))
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration, get_numpy_include_dirs
config = Configuration('transform', parent_package, top_... | #!/usr/bin/env python
import os
from skimage._build import cython
base_path = os.path.abspath(os.path.dirname(__file__))
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration, get_numpy_include_dirs
config = Configuration('transform', parent_package, top_... | <commit_before>#!/usr/bin/env python
import os
from skimage._build import cython
base_path = os.path.abspath(os.path.dirname(__file__))
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration, get_numpy_include_dirs
config = Configuration('transform', paren... | #!/usr/bin/env python
import os
from skimage._build import cython
base_path = os.path.abspath(os.path.dirname(__file__))
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration, get_numpy_include_dirs
config = Configuration('transform', parent_package, top_... | #!/usr/bin/env python
import os
from skimage._build import cython
base_path = os.path.abspath(os.path.dirname(__file__))
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration, get_numpy_include_dirs
config = Configuration('transform', parent_package, top_... | <commit_before>#!/usr/bin/env python
import os
from skimage._build import cython
base_path = os.path.abspath(os.path.dirname(__file__))
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration, get_numpy_include_dirs
config = Configuration('transform', paren... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.