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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e289c48727573a43a062213fd52bc43a2781bd8b | indra/trips/trips_api.py | indra/trips/trips_api.py | import sys
import trips_client
from processor import TripsProcessor
def process_text(text):
html = trips_client.send_query(text)
xml = trips_client.get_xml(html)
trips_client.save_xml(xml, 'test.xml')
return process_xml(xml)
def process_xml(xml_string):
tp = TripsProcessor(xml_string)
tp.get... | import sys
import trips_client
from processor import TripsProcessor
def process_text(text, save_xml_name='trips_output.xml'):
html = trips_client.send_query(text)
xml = trips_client.get_xml(html)
if save_xml_name:
trips_client.save_xml(xml, save_xml_name)
return process_xml(xml)
def process_... | Add save xml name argument to TRIPS API | Add save xml name argument to TRIPS API
| Python | bsd-2-clause | jmuhlich/indra,pvtodorov/indra,bgyori/indra,sorgerlab/indra,johnbachman/indra,sorgerlab/indra,sorgerlab/belpy,pvtodorov/indra,sorgerlab/indra,johnbachman/belpy,pvtodorov/indra,bgyori/indra,johnbachman/indra,jmuhlich/indra,jmuhlich/indra,johnbachman/indra,bgyori/indra,sorgerlab/belpy,sorgerlab/belpy,johnbachman/belpy,jo... | import sys
import trips_client
from processor import TripsProcessor
def process_text(text):
html = trips_client.send_query(text)
xml = trips_client.get_xml(html)
trips_client.save_xml(xml, 'test.xml')
return process_xml(xml)
def process_xml(xml_string):
tp = TripsProcessor(xml_string)
tp.get... | import sys
import trips_client
from processor import TripsProcessor
def process_text(text, save_xml_name='trips_output.xml'):
html = trips_client.send_query(text)
xml = trips_client.get_xml(html)
if save_xml_name:
trips_client.save_xml(xml, save_xml_name)
return process_xml(xml)
def process_... | <commit_before>import sys
import trips_client
from processor import TripsProcessor
def process_text(text):
html = trips_client.send_query(text)
xml = trips_client.get_xml(html)
trips_client.save_xml(xml, 'test.xml')
return process_xml(xml)
def process_xml(xml_string):
tp = TripsProcessor(xml_str... | import sys
import trips_client
from processor import TripsProcessor
def process_text(text, save_xml_name='trips_output.xml'):
html = trips_client.send_query(text)
xml = trips_client.get_xml(html)
if save_xml_name:
trips_client.save_xml(xml, save_xml_name)
return process_xml(xml)
def process_... | import sys
import trips_client
from processor import TripsProcessor
def process_text(text):
html = trips_client.send_query(text)
xml = trips_client.get_xml(html)
trips_client.save_xml(xml, 'test.xml')
return process_xml(xml)
def process_xml(xml_string):
tp = TripsProcessor(xml_string)
tp.get... | <commit_before>import sys
import trips_client
from processor import TripsProcessor
def process_text(text):
html = trips_client.send_query(text)
xml = trips_client.get_xml(html)
trips_client.save_xml(xml, 'test.xml')
return process_xml(xml)
def process_xml(xml_string):
tp = TripsProcessor(xml_str... |
62e5867f9dc5a758e3803e66043255881c8250c2 | democracy_club/apps/dc_members/forms.py | democracy_club/apps/dc_members/forms.py | from django.forms import ModelForm
from localflavor.gb.forms import GBPostcodeField
from .models import Member
class MemberUpdateForm(ModelForm):
class Meta:
model = Member
exclude = ['token', 'user', 'constituency', 'mapit_json']
postcode = GBPostcodeField(required=True) | from django.forms import ModelForm
from localflavor.gb.forms import GBPostcodeField
from .models import Member
class MemberUpdateForm(ModelForm):
class Meta:
model = Member
exclude = [
'token',
'user',
'constituency',
'mapit_json',
'sour... | Exclude most fields from User Profiles | Exclude most fields from User Profiles
| Python | bsd-3-clause | DemocracyClub/Website,DemocracyClub/Website,DemocracyClub/Website,DemocracyClub/Website | from django.forms import ModelForm
from localflavor.gb.forms import GBPostcodeField
from .models import Member
class MemberUpdateForm(ModelForm):
class Meta:
model = Member
exclude = ['token', 'user', 'constituency', 'mapit_json']
postcode = GBPostcodeField(required=True)Exclude most fields ... | from django.forms import ModelForm
from localflavor.gb.forms import GBPostcodeField
from .models import Member
class MemberUpdateForm(ModelForm):
class Meta:
model = Member
exclude = [
'token',
'user',
'constituency',
'mapit_json',
'sour... | <commit_before>from django.forms import ModelForm
from localflavor.gb.forms import GBPostcodeField
from .models import Member
class MemberUpdateForm(ModelForm):
class Meta:
model = Member
exclude = ['token', 'user', 'constituency', 'mapit_json']
postcode = GBPostcodeField(required=True)<comm... | from django.forms import ModelForm
from localflavor.gb.forms import GBPostcodeField
from .models import Member
class MemberUpdateForm(ModelForm):
class Meta:
model = Member
exclude = [
'token',
'user',
'constituency',
'mapit_json',
'sour... | from django.forms import ModelForm
from localflavor.gb.forms import GBPostcodeField
from .models import Member
class MemberUpdateForm(ModelForm):
class Meta:
model = Member
exclude = ['token', 'user', 'constituency', 'mapit_json']
postcode = GBPostcodeField(required=True)Exclude most fields ... | <commit_before>from django.forms import ModelForm
from localflavor.gb.forms import GBPostcodeField
from .models import Member
class MemberUpdateForm(ModelForm):
class Meta:
model = Member
exclude = ['token', 'user', 'constituency', 'mapit_json']
postcode = GBPostcodeField(required=True)<comm... |
c608e7c88c4971e647171014ac5c8e77ecb0df34 | braid/info.py | braid/info.py | from fabric.api import run, quiet
from braid import succeeds, cacheInEnvironment
@cacheInEnvironment
def distroName():
"""
Get the name of the distro.
"""
with quiet():
lsb = run('/usr/bin/lsb_release --id --short', warn_only=True)
if lsb.succeeded:
return lsb.lower()
... | from fabric.api import run, quiet
from braid import succeeds, cacheInEnvironment
@cacheInEnvironment
def distroName():
"""
Get the name of the distro.
"""
with quiet():
lsb = run('/usr/bin/lsb_release --id --short', warn_only=True)
if lsb.succeeded:
return lsb.lower()
... | Add a helper to detect the architecture. | Add a helper to detect the architecture.
| Python | mit | alex/braid,alex/braid | from fabric.api import run, quiet
from braid import succeeds, cacheInEnvironment
@cacheInEnvironment
def distroName():
"""
Get the name of the distro.
"""
with quiet():
lsb = run('/usr/bin/lsb_release --id --short', warn_only=True)
if lsb.succeeded:
return lsb.lower()
... | from fabric.api import run, quiet
from braid import succeeds, cacheInEnvironment
@cacheInEnvironment
def distroName():
"""
Get the name of the distro.
"""
with quiet():
lsb = run('/usr/bin/lsb_release --id --short', warn_only=True)
if lsb.succeeded:
return lsb.lower()
... | <commit_before>from fabric.api import run, quiet
from braid import succeeds, cacheInEnvironment
@cacheInEnvironment
def distroName():
"""
Get the name of the distro.
"""
with quiet():
lsb = run('/usr/bin/lsb_release --id --short', warn_only=True)
if lsb.succeeded:
return lsb... | from fabric.api import run, quiet
from braid import succeeds, cacheInEnvironment
@cacheInEnvironment
def distroName():
"""
Get the name of the distro.
"""
with quiet():
lsb = run('/usr/bin/lsb_release --id --short', warn_only=True)
if lsb.succeeded:
return lsb.lower()
... | from fabric.api import run, quiet
from braid import succeeds, cacheInEnvironment
@cacheInEnvironment
def distroName():
"""
Get the name of the distro.
"""
with quiet():
lsb = run('/usr/bin/lsb_release --id --short', warn_only=True)
if lsb.succeeded:
return lsb.lower()
... | <commit_before>from fabric.api import run, quiet
from braid import succeeds, cacheInEnvironment
@cacheInEnvironment
def distroName():
"""
Get the name of the distro.
"""
with quiet():
lsb = run('/usr/bin/lsb_release --id --short', warn_only=True)
if lsb.succeeded:
return lsb... |
8026e6b21aacffc6f08d634103bc32b1775882ae | devicehive/transports/base_transport.py | devicehive/transports/base_transport.py | class BaseTransport(object):
"""Base transport class."""
def __init__(self, name, data_format_class, data_format_options,
handler_class, handler_options):
self._name = name
self._data_format = data_format_class(**data_format_options)
self._handler = handler_class(**hand... | class BaseTransport(object):
"""Base transport class."""
def __init__(self, name, data_format_class, data_format_options,
handler_class, handler_options):
self._name = name
self._data_format = data_format_class(**data_format_options)
self._handler = handler_class(self, ... | Remove transport from handler methods | Remove transport from handler methods
| Python | apache-2.0 | devicehive/devicehive-python | class BaseTransport(object):
"""Base transport class."""
def __init__(self, name, data_format_class, data_format_options,
handler_class, handler_options):
self._name = name
self._data_format = data_format_class(**data_format_options)
self._handler = handler_class(**hand... | class BaseTransport(object):
"""Base transport class."""
def __init__(self, name, data_format_class, data_format_options,
handler_class, handler_options):
self._name = name
self._data_format = data_format_class(**data_format_options)
self._handler = handler_class(self, ... | <commit_before>class BaseTransport(object):
"""Base transport class."""
def __init__(self, name, data_format_class, data_format_options,
handler_class, handler_options):
self._name = name
self._data_format = data_format_class(**data_format_options)
self._handler = handl... | class BaseTransport(object):
"""Base transport class."""
def __init__(self, name, data_format_class, data_format_options,
handler_class, handler_options):
self._name = name
self._data_format = data_format_class(**data_format_options)
self._handler = handler_class(self, ... | class BaseTransport(object):
"""Base transport class."""
def __init__(self, name, data_format_class, data_format_options,
handler_class, handler_options):
self._name = name
self._data_format = data_format_class(**data_format_options)
self._handler = handler_class(**hand... | <commit_before>class BaseTransport(object):
"""Base transport class."""
def __init__(self, name, data_format_class, data_format_options,
handler_class, handler_options):
self._name = name
self._data_format = data_format_class(**data_format_options)
self._handler = handl... |
22dcc9ee23841ecfbb23f76f2f8fd5c5c5bfb8cb | app/models.py | app/models.py | from app import db
class Base(db.Model):
__abstract__ = True
id = db.Column(db.Integer, primary_key=True)
created_at = db.Column(db.DateTime, default=db.func.current_timestamp())
updated_at = db.Column(db.DateTime, default=db.func.current_timestamp())
class Route(Base):
__tablename__ = 'route... | from app import db
class Base(db.Model):
__abstract__ = True
id = db.Column(db.Integer, primary_key=True)
created_at = db.Column(db.DateTime, default=db.func.current_timestamp())
updated_at = db.Column(db.DateTime, default=db.func.current_timestamp())
class Route(Base):
__tablename__ = 'route... | Remove unecessary initialization from Route model | Remove unecessary initialization from Route model
| Python | mit | mdsrosa/routes_api_python | from app import db
class Base(db.Model):
__abstract__ = True
id = db.Column(db.Integer, primary_key=True)
created_at = db.Column(db.DateTime, default=db.func.current_timestamp())
updated_at = db.Column(db.DateTime, default=db.func.current_timestamp())
class Route(Base):
__tablename__ = 'route... | from app import db
class Base(db.Model):
__abstract__ = True
id = db.Column(db.Integer, primary_key=True)
created_at = db.Column(db.DateTime, default=db.func.current_timestamp())
updated_at = db.Column(db.DateTime, default=db.func.current_timestamp())
class Route(Base):
__tablename__ = 'route... | <commit_before>from app import db
class Base(db.Model):
__abstract__ = True
id = db.Column(db.Integer, primary_key=True)
created_at = db.Column(db.DateTime, default=db.func.current_timestamp())
updated_at = db.Column(db.DateTime, default=db.func.current_timestamp())
class Route(Base):
__table... | from app import db
class Base(db.Model):
__abstract__ = True
id = db.Column(db.Integer, primary_key=True)
created_at = db.Column(db.DateTime, default=db.func.current_timestamp())
updated_at = db.Column(db.DateTime, default=db.func.current_timestamp())
class Route(Base):
__tablename__ = 'route... | from app import db
class Base(db.Model):
__abstract__ = True
id = db.Column(db.Integer, primary_key=True)
created_at = db.Column(db.DateTime, default=db.func.current_timestamp())
updated_at = db.Column(db.DateTime, default=db.func.current_timestamp())
class Route(Base):
__tablename__ = 'route... | <commit_before>from app import db
class Base(db.Model):
__abstract__ = True
id = db.Column(db.Integer, primary_key=True)
created_at = db.Column(db.DateTime, default=db.func.current_timestamp())
updated_at = db.Column(db.DateTime, default=db.func.current_timestamp())
class Route(Base):
__table... |
424fc74377ba4385e4c25fe90f888d39d5f14abd | runtests.py | runtests.py | #!/usr/bin/env python
from os.path import dirname, abspath
import sys
from django.conf import settings
if not settings.configured:
from django import VERSION
settings_dict = dict(
INSTALLED_APPS=(
'localeurl',
'localeurl.tests',
'django.contrib.sites', # for sitema... | #!/usr/bin/env python
from os.path import dirname, abspath
import sys
from django.conf import settings
if not settings.configured:
from django import VERSION
settings_dict = dict(
INSTALLED_APPS=(
'localeurl',
'localeurl.tests',
'django.contrib.sites', # for sitema... | Add SITE_ID to test settings since contrib.sites is in INSTALLED_APPS. | Add SITE_ID to test settings since contrib.sites is in INSTALLED_APPS.
| Python | mit | extertioner/django-localeurl,carljm/django-localeurl,gonnado/django-localeurl | #!/usr/bin/env python
from os.path import dirname, abspath
import sys
from django.conf import settings
if not settings.configured:
from django import VERSION
settings_dict = dict(
INSTALLED_APPS=(
'localeurl',
'localeurl.tests',
'django.contrib.sites', # for sitema... | #!/usr/bin/env python
from os.path import dirname, abspath
import sys
from django.conf import settings
if not settings.configured:
from django import VERSION
settings_dict = dict(
INSTALLED_APPS=(
'localeurl',
'localeurl.tests',
'django.contrib.sites', # for sitema... | <commit_before>#!/usr/bin/env python
from os.path import dirname, abspath
import sys
from django.conf import settings
if not settings.configured:
from django import VERSION
settings_dict = dict(
INSTALLED_APPS=(
'localeurl',
'localeurl.tests',
'django.contrib.sites... | #!/usr/bin/env python
from os.path import dirname, abspath
import sys
from django.conf import settings
if not settings.configured:
from django import VERSION
settings_dict = dict(
INSTALLED_APPS=(
'localeurl',
'localeurl.tests',
'django.contrib.sites', # for sitema... | #!/usr/bin/env python
from os.path import dirname, abspath
import sys
from django.conf import settings
if not settings.configured:
from django import VERSION
settings_dict = dict(
INSTALLED_APPS=(
'localeurl',
'localeurl.tests',
'django.contrib.sites', # for sitema... | <commit_before>#!/usr/bin/env python
from os.path import dirname, abspath
import sys
from django.conf import settings
if not settings.configured:
from django import VERSION
settings_dict = dict(
INSTALLED_APPS=(
'localeurl',
'localeurl.tests',
'django.contrib.sites... |
fe5d330fd809285576b1696ccb9807910f5778ce | numscons/__init__.py | numscons/__init__.py | from core.misc import get_scons_path, get_scons_build_dir, \
get_scons_configres_dir, get_scons_configres_filename
from core.numpyenv import GetNumpyEnvironment
from core.libinfo_scons import NumpyCheckLibAndHeader
from checkers import CheckF77BLAS, CheckCBLAS, CheckCLAPACK, CheckF77LAPACK, Chec... | # XXX those are needed by the scons command only...
from core.misc import get_scons_path, get_scons_build_dir, \
get_scons_configres_dir, get_scons_configres_filename
# XXX those should not be needed by the scons command only...
from core.extension import get_python_inc, get_pythonlib_dir
# Thos... | Mark things to clean up later in global import | Mark things to clean up later in global import | Python | bsd-3-clause | cournape/numscons,cournape/numscons,cournape/numscons | from core.misc import get_scons_path, get_scons_build_dir, \
get_scons_configres_dir, get_scons_configres_filename
from core.numpyenv import GetNumpyEnvironment
from core.libinfo_scons import NumpyCheckLibAndHeader
from checkers import CheckF77BLAS, CheckCBLAS, CheckCLAPACK, CheckF77LAPACK, Chec... | # XXX those are needed by the scons command only...
from core.misc import get_scons_path, get_scons_build_dir, \
get_scons_configres_dir, get_scons_configres_filename
# XXX those should not be needed by the scons command only...
from core.extension import get_python_inc, get_pythonlib_dir
# Thos... | <commit_before>from core.misc import get_scons_path, get_scons_build_dir, \
get_scons_configres_dir, get_scons_configres_filename
from core.numpyenv import GetNumpyEnvironment
from core.libinfo_scons import NumpyCheckLibAndHeader
from checkers import CheckF77BLAS, CheckCBLAS, CheckCLAPACK, Check... | # XXX those are needed by the scons command only...
from core.misc import get_scons_path, get_scons_build_dir, \
get_scons_configres_dir, get_scons_configres_filename
# XXX those should not be needed by the scons command only...
from core.extension import get_python_inc, get_pythonlib_dir
# Thos... | from core.misc import get_scons_path, get_scons_build_dir, \
get_scons_configres_dir, get_scons_configres_filename
from core.numpyenv import GetNumpyEnvironment
from core.libinfo_scons import NumpyCheckLibAndHeader
from checkers import CheckF77BLAS, CheckCBLAS, CheckCLAPACK, CheckF77LAPACK, Chec... | <commit_before>from core.misc import get_scons_path, get_scons_build_dir, \
get_scons_configres_dir, get_scons_configres_filename
from core.numpyenv import GetNumpyEnvironment
from core.libinfo_scons import NumpyCheckLibAndHeader
from checkers import CheckF77BLAS, CheckCBLAS, CheckCLAPACK, Check... |
b2ccc1b8144bf54f9e1416c187f9b5670e5d234d | src/librement/registration/forms.py | src/librement/registration/forms.py | from django import forms
from django.contrib.auth.models import User
from librement.profile.enums import AccountEnum
from librement.profile.models import Profile
class RegistrationForm(forms.ModelForm):
email = forms.EmailField()
password = forms.CharField()
password_confirm = forms.CharField()
cla... | from django import forms
from django.contrib.auth.models import User
from librement.profile.enums import AccountEnum
from librement.account.models import Email
from librement.profile.models import Profile
class RegistrationForm(forms.ModelForm):
email = forms.EmailField()
password = forms.CharField()
pa... | Check email address is not already used. | Check email address is not already used.
Signed-off-by: Chris Lamb <[email protected]>
| Python | agpl-3.0 | rhertzog/librement,rhertzog/librement,rhertzog/librement | from django import forms
from django.contrib.auth.models import User
from librement.profile.enums import AccountEnum
from librement.profile.models import Profile
class RegistrationForm(forms.ModelForm):
email = forms.EmailField()
password = forms.CharField()
password_confirm = forms.CharField()
cla... | from django import forms
from django.contrib.auth.models import User
from librement.profile.enums import AccountEnum
from librement.account.models import Email
from librement.profile.models import Profile
class RegistrationForm(forms.ModelForm):
email = forms.EmailField()
password = forms.CharField()
pa... | <commit_before>from django import forms
from django.contrib.auth.models import User
from librement.profile.enums import AccountEnum
from librement.profile.models import Profile
class RegistrationForm(forms.ModelForm):
email = forms.EmailField()
password = forms.CharField()
password_confirm = forms.CharF... | from django import forms
from django.contrib.auth.models import User
from librement.profile.enums import AccountEnum
from librement.account.models import Email
from librement.profile.models import Profile
class RegistrationForm(forms.ModelForm):
email = forms.EmailField()
password = forms.CharField()
pa... | from django import forms
from django.contrib.auth.models import User
from librement.profile.enums import AccountEnum
from librement.profile.models import Profile
class RegistrationForm(forms.ModelForm):
email = forms.EmailField()
password = forms.CharField()
password_confirm = forms.CharField()
cla... | <commit_before>from django import forms
from django.contrib.auth.models import User
from librement.profile.enums import AccountEnum
from librement.profile.models import Profile
class RegistrationForm(forms.ModelForm):
email = forms.EmailField()
password = forms.CharField()
password_confirm = forms.CharF... |
adfe28a11fea94b207eea0417123a4155c909f05 | gpiocrust/__init__.py | gpiocrust/__init__.py | """
Object oriented wrapper around RPi.GPIO. Falls back to mock objects if RPi.GPIO
is not found.
"""
try:
import RPi.GPIO
from .raspberry_pi import *
except RuntimeError:
print(
'----------------------------------------------------------------------------')
print(
' WARNING: RPi.GPIO can only ... | """
Object oriented wrapper around RPi.GPIO. Falls back to mock objects if RPi.GPIO
is not found.
"""
try:
import RPi.GPIO
from .raspberry_pi import *
except RuntimeError:
print(
'----------------------------------------------------------------------------')
print(
' WARNING: RPi.GPIO can only ... | Fix import errors on non-RPi platforms | Fix import errors on non-RPi platforms
| Python | mit | zourtney/gpiocrust | """
Object oriented wrapper around RPi.GPIO. Falls back to mock objects if RPi.GPIO
is not found.
"""
try:
import RPi.GPIO
from .raspberry_pi import *
except RuntimeError:
print(
'----------------------------------------------------------------------------')
print(
' WARNING: RPi.GPIO can only ... | """
Object oriented wrapper around RPi.GPIO. Falls back to mock objects if RPi.GPIO
is not found.
"""
try:
import RPi.GPIO
from .raspberry_pi import *
except RuntimeError:
print(
'----------------------------------------------------------------------------')
print(
' WARNING: RPi.GPIO can only ... | <commit_before>"""
Object oriented wrapper around RPi.GPIO. Falls back to mock objects if RPi.GPIO
is not found.
"""
try:
import RPi.GPIO
from .raspberry_pi import *
except RuntimeError:
print(
'----------------------------------------------------------------------------')
print(
' WARNING: RPi... | """
Object oriented wrapper around RPi.GPIO. Falls back to mock objects if RPi.GPIO
is not found.
"""
try:
import RPi.GPIO
from .raspberry_pi import *
except RuntimeError:
print(
'----------------------------------------------------------------------------')
print(
' WARNING: RPi.GPIO can only ... | """
Object oriented wrapper around RPi.GPIO. Falls back to mock objects if RPi.GPIO
is not found.
"""
try:
import RPi.GPIO
from .raspberry_pi import *
except RuntimeError:
print(
'----------------------------------------------------------------------------')
print(
' WARNING: RPi.GPIO can only ... | <commit_before>"""
Object oriented wrapper around RPi.GPIO. Falls back to mock objects if RPi.GPIO
is not found.
"""
try:
import RPi.GPIO
from .raspberry_pi import *
except RuntimeError:
print(
'----------------------------------------------------------------------------')
print(
' WARNING: RPi... |
da2dc4e6f905356a705e2f75701f9d23c4b008ba | signac/contrib/errors.py | signac/contrib/errors.py | # Copyright (c) 2017 The Regents of the University of Michigan
# All rights reserved.
# This software is licensed under the BSD 3-Clause License.
from ..core.errors import Error
class WorkspaceError(Error, OSError):
"Raised when there is an issue to create or access the workspace."
def __init__(self, error):
... | # Copyright (c) 2017 The Regents of the University of Michigan
# All rights reserved.
# This software is licensed under the BSD 3-Clause License.
from ..core.errors import Error
class WorkspaceError(Error, OSError):
"Raised when there is an issue to create or access the workspace."
def __init__(self, error):
... | Fix OSError not printing bug | Fix OSError not printing bug
| Python | bsd-3-clause | csadorf/signac,csadorf/signac | # Copyright (c) 2017 The Regents of the University of Michigan
# All rights reserved.
# This software is licensed under the BSD 3-Clause License.
from ..core.errors import Error
class WorkspaceError(Error, OSError):
"Raised when there is an issue to create or access the workspace."
def __init__(self, error):
... | # Copyright (c) 2017 The Regents of the University of Michigan
# All rights reserved.
# This software is licensed under the BSD 3-Clause License.
from ..core.errors import Error
class WorkspaceError(Error, OSError):
"Raised when there is an issue to create or access the workspace."
def __init__(self, error):
... | <commit_before># Copyright (c) 2017 The Regents of the University of Michigan
# All rights reserved.
# This software is licensed under the BSD 3-Clause License.
from ..core.errors import Error
class WorkspaceError(Error, OSError):
"Raised when there is an issue to create or access the workspace."
def __init__... | # Copyright (c) 2017 The Regents of the University of Michigan
# All rights reserved.
# This software is licensed under the BSD 3-Clause License.
from ..core.errors import Error
class WorkspaceError(Error, OSError):
"Raised when there is an issue to create or access the workspace."
def __init__(self, error):
... | # Copyright (c) 2017 The Regents of the University of Michigan
# All rights reserved.
# This software is licensed under the BSD 3-Clause License.
from ..core.errors import Error
class WorkspaceError(Error, OSError):
"Raised when there is an issue to create or access the workspace."
def __init__(self, error):
... | <commit_before># Copyright (c) 2017 The Regents of the University of Michigan
# All rights reserved.
# This software is licensed under the BSD 3-Clause License.
from ..core.errors import Error
class WorkspaceError(Error, OSError):
"Raised when there is an issue to create or access the workspace."
def __init__... |
24da68c145750ae230a7a855a1daf3cd97a813d8 | config.py | config.py | # 4chThreadArchiver
# Copyright (C) 2016, Sebastian "Chloride Cull" Johansson
#
# 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... | # 4chThreadArchiver
# Copyright (C) 2016, Sebastian "Chloride Cull" Johansson
#
# 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... | Change desustorage URL to desuarchive | Change desustorage URL to desuarchive
| Python | agpl-3.0 | ChlorideCull/4chThreadArchiver | # 4chThreadArchiver
# Copyright (C) 2016, Sebastian "Chloride Cull" Johansson
#
# 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... | # 4chThreadArchiver
# Copyright (C) 2016, Sebastian "Chloride Cull" Johansson
#
# 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... | <commit_before># 4chThreadArchiver
# Copyright (C) 2016, Sebastian "Chloride Cull" Johansson
#
# 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 y... | # 4chThreadArchiver
# Copyright (C) 2016, Sebastian "Chloride Cull" Johansson
#
# 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... | # 4chThreadArchiver
# Copyright (C) 2016, Sebastian "Chloride Cull" Johansson
#
# 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... | <commit_before># 4chThreadArchiver
# Copyright (C) 2016, Sebastian "Chloride Cull" Johansson
#
# 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 y... |
dad58aa0162290627e9d96a5047a507237a49b76 | calculate.py | calculate.py |
operators = {'+', '-', '*', '/', '(', ')'}
def parse_formula(text):
tokens = []
buffer = ''
for c in text:
if '0' <= c <= '9':
buffer += c
elif c in operators:
if buffer:
tokens.append(int(buffer))
tokens.append(c)
buffer =... | # List of operators along with their associated precedence
operators = {None: 100, '+': 3, '-': 3, '*': 2, '/': 2, '(': 1, ')': 1}
def operation(v1, v2, operator):
if item == '+':
return v1 + v2
elif item == '-':
return v1 - v2
elif item == '*':
return v1 * v2
elif item == '/':... | Add support for basic binary operations | Add support for basic binary operations
| Python | mit | MichaelAquilina/Simple-Calculator |
operators = {'+', '-', '*', '/', '(', ')'}
def parse_formula(text):
tokens = []
buffer = ''
for c in text:
if '0' <= c <= '9':
buffer += c
elif c in operators:
if buffer:
tokens.append(int(buffer))
tokens.append(c)
buffer =... | # List of operators along with their associated precedence
operators = {None: 100, '+': 3, '-': 3, '*': 2, '/': 2, '(': 1, ')': 1}
def operation(v1, v2, operator):
if item == '+':
return v1 + v2
elif item == '-':
return v1 - v2
elif item == '*':
return v1 * v2
elif item == '/':... | <commit_before>
operators = {'+', '-', '*', '/', '(', ')'}
def parse_formula(text):
tokens = []
buffer = ''
for c in text:
if '0' <= c <= '9':
buffer += c
elif c in operators:
if buffer:
tokens.append(int(buffer))
tokens.append(c)
... | # List of operators along with their associated precedence
operators = {None: 100, '+': 3, '-': 3, '*': 2, '/': 2, '(': 1, ')': 1}
def operation(v1, v2, operator):
if item == '+':
return v1 + v2
elif item == '-':
return v1 - v2
elif item == '*':
return v1 * v2
elif item == '/':... |
operators = {'+', '-', '*', '/', '(', ')'}
def parse_formula(text):
tokens = []
buffer = ''
for c in text:
if '0' <= c <= '9':
buffer += c
elif c in operators:
if buffer:
tokens.append(int(buffer))
tokens.append(c)
buffer =... | <commit_before>
operators = {'+', '-', '*', '/', '(', ')'}
def parse_formula(text):
tokens = []
buffer = ''
for c in text:
if '0' <= c <= '9':
buffer += c
elif c in operators:
if buffer:
tokens.append(int(buffer))
tokens.append(c)
... |
b6b1117df271dae8adefa8cb8d3413b73fb393ce | touchpad_listener/touchpad_listener.py | touchpad_listener/touchpad_listener.py |
import serial
import sonic
sonic_pi = sonic.SonicPi()
connection = serial.Serial('/dev/tty.usbmodem1421', 115200)
while True:
line = connection.readline()
command, argument = line.strip().split(' ', 1)
if command == 'pad':
number = int(argument)
sonic_pi.run('cue :pad, number: {}'.format... |
import serial
import sonic
import glob
sonic_pi = sonic.SonicPi()
connection = serial.Serial(glob.glob('/dev/tty.usbmodem*')[0], 115200)
while True:
line = connection.readline()
command, argument = line.strip().split(' ', 1)
if command == 'pad':
number = int(argument)
sonic_pi.run('cue :... | Use `glob` to find an appropriate serial ttry | Use `glob` to find an appropriate serial ttry | Python | bsd-2-clause | CoderDojoScotland/coderdojo-sequencer,jonathanhogg/coderdojo-sequencer |
import serial
import sonic
sonic_pi = sonic.SonicPi()
connection = serial.Serial('/dev/tty.usbmodem1421', 115200)
while True:
line = connection.readline()
command, argument = line.strip().split(' ', 1)
if command == 'pad':
number = int(argument)
sonic_pi.run('cue :pad, number: {}'.format... |
import serial
import sonic
import glob
sonic_pi = sonic.SonicPi()
connection = serial.Serial(glob.glob('/dev/tty.usbmodem*')[0], 115200)
while True:
line = connection.readline()
command, argument = line.strip().split(' ', 1)
if command == 'pad':
number = int(argument)
sonic_pi.run('cue :... | <commit_before>
import serial
import sonic
sonic_pi = sonic.SonicPi()
connection = serial.Serial('/dev/tty.usbmodem1421', 115200)
while True:
line = connection.readline()
command, argument = line.strip().split(' ', 1)
if command == 'pad':
number = int(argument)
sonic_pi.run('cue :pad, num... |
import serial
import sonic
import glob
sonic_pi = sonic.SonicPi()
connection = serial.Serial(glob.glob('/dev/tty.usbmodem*')[0], 115200)
while True:
line = connection.readline()
command, argument = line.strip().split(' ', 1)
if command == 'pad':
number = int(argument)
sonic_pi.run('cue :... |
import serial
import sonic
sonic_pi = sonic.SonicPi()
connection = serial.Serial('/dev/tty.usbmodem1421', 115200)
while True:
line = connection.readline()
command, argument = line.strip().split(' ', 1)
if command == 'pad':
number = int(argument)
sonic_pi.run('cue :pad, number: {}'.format... | <commit_before>
import serial
import sonic
sonic_pi = sonic.SonicPi()
connection = serial.Serial('/dev/tty.usbmodem1421', 115200)
while True:
line = connection.readline()
command, argument = line.strip().split(' ', 1)
if command == 'pad':
number = int(argument)
sonic_pi.run('cue :pad, num... |
3372bade0c5aee8c30c507832c842d6533608f61 | porunga/tests/test_main.py | porunga/tests/test_main.py | import unittest
from porunga import get_manager
from porunga.commands.test import PorungaTestCommand
class TestManager(unittest.TestCase):
def test_manager_has_proper_commands(self):
manager = get_manager()
commands = manager.get_commands()
self.assertIn('test', commands)
test_co... | import unittest
from porunga import get_manager
from porunga.commands.test import PorungaTestCommand
class TestManager(unittest.TestCase):
def test_manager_has_proper_commands(self):
manager = get_manager()
commands = manager.get_commands()
self.assertTrue('test' in commands)
tes... | Test updated to work with Python 2.6 | Test updated to work with Python 2.6
| Python | bsd-2-clause | lukaszb/porunga,lukaszb/porunga | import unittest
from porunga import get_manager
from porunga.commands.test import PorungaTestCommand
class TestManager(unittest.TestCase):
def test_manager_has_proper_commands(self):
manager = get_manager()
commands = manager.get_commands()
self.assertIn('test', commands)
test_co... | import unittest
from porunga import get_manager
from porunga.commands.test import PorungaTestCommand
class TestManager(unittest.TestCase):
def test_manager_has_proper_commands(self):
manager = get_manager()
commands = manager.get_commands()
self.assertTrue('test' in commands)
tes... | <commit_before>import unittest
from porunga import get_manager
from porunga.commands.test import PorungaTestCommand
class TestManager(unittest.TestCase):
def test_manager_has_proper_commands(self):
manager = get_manager()
commands = manager.get_commands()
self.assertIn('test', commands)
... | import unittest
from porunga import get_manager
from porunga.commands.test import PorungaTestCommand
class TestManager(unittest.TestCase):
def test_manager_has_proper_commands(self):
manager = get_manager()
commands = manager.get_commands()
self.assertTrue('test' in commands)
tes... | import unittest
from porunga import get_manager
from porunga.commands.test import PorungaTestCommand
class TestManager(unittest.TestCase):
def test_manager_has_proper_commands(self):
manager = get_manager()
commands = manager.get_commands()
self.assertIn('test', commands)
test_co... | <commit_before>import unittest
from porunga import get_manager
from porunga.commands.test import PorungaTestCommand
class TestManager(unittest.TestCase):
def test_manager_has_proper_commands(self):
manager = get_manager()
commands = manager.get_commands()
self.assertIn('test', commands)
... |
71e73f19fcf9770f6b79092e3af66c9f27ecdc61 | eduid_dashboard_amp/__init__.py | eduid_dashboard_amp/__init__.py | from eduid_am.exceptions import UserDoesNotExist
def attribute_fetcher(db, user_id):
attributes = {}
user = db.profiles.find_one({'_id': user_id})
if user is None:
raise UserDoesNotExist("No user matching _id='%s'" % user_id)
else:
# white list of valid attributes for security reason... | from eduid_am.exceptions import UserDoesNotExist
WHITELIST_SET_ATTRS = (
'givenName',
'sn',
'displayName',
'photo',
'preferredLanguage',
'mail',
# TODO: Arrays must use put or pop, not set, but need more deep refacts
'norEduPersonNIN',
'eduPersonEntitlement',
'mobile',
'ma... | Add the new schema, now the $set modifier is used | Add the new schema, now the $set modifier is used
| Python | bsd-3-clause | SUNET/eduid-dashboard-amp | from eduid_am.exceptions import UserDoesNotExist
def attribute_fetcher(db, user_id):
attributes = {}
user = db.profiles.find_one({'_id': user_id})
if user is None:
raise UserDoesNotExist("No user matching _id='%s'" % user_id)
else:
# white list of valid attributes for security reason... | from eduid_am.exceptions import UserDoesNotExist
WHITELIST_SET_ATTRS = (
'givenName',
'sn',
'displayName',
'photo',
'preferredLanguage',
'mail',
# TODO: Arrays must use put or pop, not set, but need more deep refacts
'norEduPersonNIN',
'eduPersonEntitlement',
'mobile',
'ma... | <commit_before>from eduid_am.exceptions import UserDoesNotExist
def attribute_fetcher(db, user_id):
attributes = {}
user = db.profiles.find_one({'_id': user_id})
if user is None:
raise UserDoesNotExist("No user matching _id='%s'" % user_id)
else:
# white list of valid attributes for ... | from eduid_am.exceptions import UserDoesNotExist
WHITELIST_SET_ATTRS = (
'givenName',
'sn',
'displayName',
'photo',
'preferredLanguage',
'mail',
# TODO: Arrays must use put or pop, not set, but need more deep refacts
'norEduPersonNIN',
'eduPersonEntitlement',
'mobile',
'ma... | from eduid_am.exceptions import UserDoesNotExist
def attribute_fetcher(db, user_id):
attributes = {}
user = db.profiles.find_one({'_id': user_id})
if user is None:
raise UserDoesNotExist("No user matching _id='%s'" % user_id)
else:
# white list of valid attributes for security reason... | <commit_before>from eduid_am.exceptions import UserDoesNotExist
def attribute_fetcher(db, user_id):
attributes = {}
user = db.profiles.find_one({'_id': user_id})
if user is None:
raise UserDoesNotExist("No user matching _id='%s'" % user_id)
else:
# white list of valid attributes for ... |
805c52698b3fed8df98462c15045f5de3822e241 | edx_repo_tools/dev/clone_org.py | edx_repo_tools/dev/clone_org.py | """Clone an entire GitHub organization."""
import os.path
import click
from git.repo.base import Repo
from edx_repo_tools.auth import pass_github
@click.command()
@click.option(
'--forks/--no-forks', is_flag=True, default=False,
help="Should forks be included?"
)
@click.option(
'--depth', type=int, def... | """Clone an entire GitHub organization."""
import os.path
import click
from git.repo.base import Repo
from edx_repo_tools.auth import pass_github
@click.command()
@click.option(
'--forks/--no-forks', is_flag=True, default=False,
help="Should forks be included?"
)
@click.option(
'--depth', type=int, defa... | Fix to work in python 3. | Fix to work in python 3.
| Python | apache-2.0 | edx/repo-tools,edx/repo-tools | """Clone an entire GitHub organization."""
import os.path
import click
from git.repo.base import Repo
from edx_repo_tools.auth import pass_github
@click.command()
@click.option(
'--forks/--no-forks', is_flag=True, default=False,
help="Should forks be included?"
)
@click.option(
'--depth', type=int, def... | """Clone an entire GitHub organization."""
import os.path
import click
from git.repo.base import Repo
from edx_repo_tools.auth import pass_github
@click.command()
@click.option(
'--forks/--no-forks', is_flag=True, default=False,
help="Should forks be included?"
)
@click.option(
'--depth', type=int, defa... | <commit_before>"""Clone an entire GitHub organization."""
import os.path
import click
from git.repo.base import Repo
from edx_repo_tools.auth import pass_github
@click.command()
@click.option(
'--forks/--no-forks', is_flag=True, default=False,
help="Should forks be included?"
)
@click.option(
'--depth'... | """Clone an entire GitHub organization."""
import os.path
import click
from git.repo.base import Repo
from edx_repo_tools.auth import pass_github
@click.command()
@click.option(
'--forks/--no-forks', is_flag=True, default=False,
help="Should forks be included?"
)
@click.option(
'--depth', type=int, defa... | """Clone an entire GitHub organization."""
import os.path
import click
from git.repo.base import Repo
from edx_repo_tools.auth import pass_github
@click.command()
@click.option(
'--forks/--no-forks', is_flag=True, default=False,
help="Should forks be included?"
)
@click.option(
'--depth', type=int, def... | <commit_before>"""Clone an entire GitHub organization."""
import os.path
import click
from git.repo.base import Repo
from edx_repo_tools.auth import pass_github
@click.command()
@click.option(
'--forks/--no-forks', is_flag=True, default=False,
help="Should forks be included?"
)
@click.option(
'--depth'... |
40edb65ee751dfe4cf6e04ee59891266d8b14f30 | spacy/tests/regression/test_issue1380.py | spacy/tests/regression/test_issue1380.py | import pytest
from ...language import Language
def test_issue1380_empty_string():
nlp = Language()
doc = nlp('')
assert len(doc) == 0
@pytest.mark.models('en')
def test_issue1380_en(EN):
doc = EN('')
assert len(doc) == 0
| from __future__ import unicode_literals
import pytest
from ...language import Language
def test_issue1380_empty_string():
nlp = Language()
doc = nlp('')
assert len(doc) == 0
@pytest.mark.models('en')
def test_issue1380_en(EN):
doc = EN('')
assert len(doc) == 0
| Make test work for Python 2.7 | Make test work for Python 2.7
| Python | mit | recognai/spaCy,aikramer2/spaCy,honnibal/spaCy,aikramer2/spaCy,recognai/spaCy,aikramer2/spaCy,spacy-io/spaCy,explosion/spaCy,aikramer2/spaCy,explosion/spaCy,recognai/spaCy,recognai/spaCy,honnibal/spaCy,explosion/spaCy,spacy-io/spaCy,aikramer2/spaCy,recognai/spaCy,honnibal/spaCy,spacy-io/spaCy,honnibal/spaCy,spacy-io/spa... | import pytest
from ...language import Language
def test_issue1380_empty_string():
nlp = Language()
doc = nlp('')
assert len(doc) == 0
@pytest.mark.models('en')
def test_issue1380_en(EN):
doc = EN('')
assert len(doc) == 0
Make test work for Python 2.7 | from __future__ import unicode_literals
import pytest
from ...language import Language
def test_issue1380_empty_string():
nlp = Language()
doc = nlp('')
assert len(doc) == 0
@pytest.mark.models('en')
def test_issue1380_en(EN):
doc = EN('')
assert len(doc) == 0
| <commit_before>import pytest
from ...language import Language
def test_issue1380_empty_string():
nlp = Language()
doc = nlp('')
assert len(doc) == 0
@pytest.mark.models('en')
def test_issue1380_en(EN):
doc = EN('')
assert len(doc) == 0
<commit_msg>Make test work for Python 2.7<commit_after> | from __future__ import unicode_literals
import pytest
from ...language import Language
def test_issue1380_empty_string():
nlp = Language()
doc = nlp('')
assert len(doc) == 0
@pytest.mark.models('en')
def test_issue1380_en(EN):
doc = EN('')
assert len(doc) == 0
| import pytest
from ...language import Language
def test_issue1380_empty_string():
nlp = Language()
doc = nlp('')
assert len(doc) == 0
@pytest.mark.models('en')
def test_issue1380_en(EN):
doc = EN('')
assert len(doc) == 0
Make test work for Python 2.7from __future__ import unicode_literals
import ... | <commit_before>import pytest
from ...language import Language
def test_issue1380_empty_string():
nlp = Language()
doc = nlp('')
assert len(doc) == 0
@pytest.mark.models('en')
def test_issue1380_en(EN):
doc = EN('')
assert len(doc) == 0
<commit_msg>Make test work for Python 2.7<commit_after>from _... |
66cb548c0d609e6364f9ec934814911760023d92 | ehriportal/urls.py | ehriportal/urls.py | from django.conf import settings
from django.conf.urls.defaults import *
from django.views.generic.simple import direct_to_template
from django.contrib import admin
admin.autodiscover()
from pinax.apps.account.openid_consumer import PinaxConsumer
handler500 = "pinax.views.server_error"
urlpatterns = patterns("",
... | from django.conf import settings
from django.conf.urls.defaults import *
from django.views.generic.simple import direct_to_template
from django.contrib import admin
admin.autodiscover()
from pinax.apps.account.openid_consumer import PinaxConsumer
handler500 = "pinax.views.server_error"
urlpatterns = patterns("",
... | Allow site_media/media to be served by staticfiles | Allow site_media/media to be served by staticfiles
| Python | mit | mikesname/ehri-collections,mikesname/ehri-collections,mikesname/ehri-collections | from django.conf import settings
from django.conf.urls.defaults import *
from django.views.generic.simple import direct_to_template
from django.contrib import admin
admin.autodiscover()
from pinax.apps.account.openid_consumer import PinaxConsumer
handler500 = "pinax.views.server_error"
urlpatterns = patterns("",
... | from django.conf import settings
from django.conf.urls.defaults import *
from django.views.generic.simple import direct_to_template
from django.contrib import admin
admin.autodiscover()
from pinax.apps.account.openid_consumer import PinaxConsumer
handler500 = "pinax.views.server_error"
urlpatterns = patterns("",
... | <commit_before>from django.conf import settings
from django.conf.urls.defaults import *
from django.views.generic.simple import direct_to_template
from django.contrib import admin
admin.autodiscover()
from pinax.apps.account.openid_consumer import PinaxConsumer
handler500 = "pinax.views.server_error"
urlpatterns ... | from django.conf import settings
from django.conf.urls.defaults import *
from django.views.generic.simple import direct_to_template
from django.contrib import admin
admin.autodiscover()
from pinax.apps.account.openid_consumer import PinaxConsumer
handler500 = "pinax.views.server_error"
urlpatterns = patterns("",
... | from django.conf import settings
from django.conf.urls.defaults import *
from django.views.generic.simple import direct_to_template
from django.contrib import admin
admin.autodiscover()
from pinax.apps.account.openid_consumer import PinaxConsumer
handler500 = "pinax.views.server_error"
urlpatterns = patterns("",
... | <commit_before>from django.conf import settings
from django.conf.urls.defaults import *
from django.views.generic.simple import direct_to_template
from django.contrib import admin
admin.autodiscover()
from pinax.apps.account.openid_consumer import PinaxConsumer
handler500 = "pinax.views.server_error"
urlpatterns ... |
e442d59dc58f7d6eeea3a3786d806af07b2ccb6a | fixtures/generate_random_network.py | fixtures/generate_random_network.py | from factory import fuzzy
from users.tests.factories import UserFactory
RANDOM_SEED = 1024
def create_profiles(num_profiles):
fuzzy.reseed_random(RANDOM_SEED)
return [user.profile
for user in (UserFactory.create() for x in range(num_profiles))]
| from factory import fuzzy
from users.tests.factories import UserFactory
RANDOM_SEED = 1024
def create_profiles(num_profiles):
# This seed does nothing because I'm using fake-factory instead of
# factory.fuzzy. TODO fix it
fuzzy.reseed_random(RANDOM_SEED)
return [user.profile
for user in... | Add todo to fix randomness | Add todo to fix randomness
| Python | mit | sbuss/voteswap,sbuss/voteswap,sbuss/voteswap,sbuss/voteswap | from factory import fuzzy
from users.tests.factories import UserFactory
RANDOM_SEED = 1024
def create_profiles(num_profiles):
fuzzy.reseed_random(RANDOM_SEED)
return [user.profile
for user in (UserFactory.create() for x in range(num_profiles))]
Add todo to fix randomness | from factory import fuzzy
from users.tests.factories import UserFactory
RANDOM_SEED = 1024
def create_profiles(num_profiles):
# This seed does nothing because I'm using fake-factory instead of
# factory.fuzzy. TODO fix it
fuzzy.reseed_random(RANDOM_SEED)
return [user.profile
for user in... | <commit_before>from factory import fuzzy
from users.tests.factories import UserFactory
RANDOM_SEED = 1024
def create_profiles(num_profiles):
fuzzy.reseed_random(RANDOM_SEED)
return [user.profile
for user in (UserFactory.create() for x in range(num_profiles))]
<commit_msg>Add todo to fix randomn... | from factory import fuzzy
from users.tests.factories import UserFactory
RANDOM_SEED = 1024
def create_profiles(num_profiles):
# This seed does nothing because I'm using fake-factory instead of
# factory.fuzzy. TODO fix it
fuzzy.reseed_random(RANDOM_SEED)
return [user.profile
for user in... | from factory import fuzzy
from users.tests.factories import UserFactory
RANDOM_SEED = 1024
def create_profiles(num_profiles):
fuzzy.reseed_random(RANDOM_SEED)
return [user.profile
for user in (UserFactory.create() for x in range(num_profiles))]
Add todo to fix randomnessfrom factory import fuzz... | <commit_before>from factory import fuzzy
from users.tests.factories import UserFactory
RANDOM_SEED = 1024
def create_profiles(num_profiles):
fuzzy.reseed_random(RANDOM_SEED)
return [user.profile
for user in (UserFactory.create() for x in range(num_profiles))]
<commit_msg>Add todo to fix randomn... |
f40da1b097d900c0c435d7550e891b0ece99bd91 | lib/torque_accounting.py | lib/torque_accounting.py | # torque_accounting.py
# Functions for working with Torque accounting files
def parse_line(line):
event = line.split(';')
job_name = event[2]
event_type = event[1]
event_time = event[0]
properties={}
prop_strings = event.split(" ")
for p in prop_strings:
prop=p.split("=")
... | # torque_accounting.py
# Functions for working with Torque accounting files
def parse_line(line):
event = line.split(';')
job_name = event[2]
event_type = event[1]
event_time = event[0]
properties={}
prop_strings = event.split(" ")
for p in prop_strings:
prop=p.split("=")
... | Add parse_files method to loop through a bunch of files | Add parse_files method to loop through a bunch of files
| Python | mit | ajdecon/torque_qhistory,ajdecon/torque_qhistory | # torque_accounting.py
# Functions for working with Torque accounting files
def parse_line(line):
event = line.split(';')
job_name = event[2]
event_type = event[1]
event_time = event[0]
properties={}
prop_strings = event.split(" ")
for p in prop_strings:
prop=p.split("=")
... | # torque_accounting.py
# Functions for working with Torque accounting files
def parse_line(line):
event = line.split(';')
job_name = event[2]
event_type = event[1]
event_time = event[0]
properties={}
prop_strings = event.split(" ")
for p in prop_strings:
prop=p.split("=")
... | <commit_before># torque_accounting.py
# Functions for working with Torque accounting files
def parse_line(line):
event = line.split(';')
job_name = event[2]
event_type = event[1]
event_time = event[0]
properties={}
prop_strings = event.split(" ")
for p in prop_strings:
prop=p... | # torque_accounting.py
# Functions for working with Torque accounting files
def parse_line(line):
event = line.split(';')
job_name = event[2]
event_type = event[1]
event_time = event[0]
properties={}
prop_strings = event.split(" ")
for p in prop_strings:
prop=p.split("=")
... | # torque_accounting.py
# Functions for working with Torque accounting files
def parse_line(line):
event = line.split(';')
job_name = event[2]
event_type = event[1]
event_time = event[0]
properties={}
prop_strings = event.split(" ")
for p in prop_strings:
prop=p.split("=")
... | <commit_before># torque_accounting.py
# Functions for working with Torque accounting files
def parse_line(line):
event = line.split(';')
job_name = event[2]
event_type = event[1]
event_time = event[0]
properties={}
prop_strings = event.split(" ")
for p in prop_strings:
prop=p... |
62e40ee27413b170d40791912d8509e26b981398 | examples/tools/print_devices.py | examples/tools/print_devices.py | # import PyOpenCL and Numpy. An OpenCL-enabled GPU is not required,
# OpenCL kernels can be compiled on most CPUs thanks to the Intel SDK for OpenCL
# or the AMD APP SDK.
import pyopencl as cl
def main():
dev_type_str = {}
for dev_type in ['ACCELERATOR', 'ALL', 'CPU', 'CUSTOM', 'DEFAULT', 'GPU']:
dev_t... | # import PyOpenCL and Numpy. An OpenCL-enabled GPU is not required,
# OpenCL kernels can be compiled on most CPUs thanks to the Intel SDK for OpenCL
# or the AMD APP SDK.
import pyopencl as cl
def main():
dev_type_str = {}
for dev_type in ['ACCELERATOR', 'ALL', 'CPU', 'CUSTOM', 'DEFAULT', 'GPU']:
dev_t... | Print devices example - change out format | Print devices example - change out format
| Python | mit | openre/openre,openre/openre | # import PyOpenCL and Numpy. An OpenCL-enabled GPU is not required,
# OpenCL kernels can be compiled on most CPUs thanks to the Intel SDK for OpenCL
# or the AMD APP SDK.
import pyopencl as cl
def main():
dev_type_str = {}
for dev_type in ['ACCELERATOR', 'ALL', 'CPU', 'CUSTOM', 'DEFAULT', 'GPU']:
dev_t... | # import PyOpenCL and Numpy. An OpenCL-enabled GPU is not required,
# OpenCL kernels can be compiled on most CPUs thanks to the Intel SDK for OpenCL
# or the AMD APP SDK.
import pyopencl as cl
def main():
dev_type_str = {}
for dev_type in ['ACCELERATOR', 'ALL', 'CPU', 'CUSTOM', 'DEFAULT', 'GPU']:
dev_t... | <commit_before># import PyOpenCL and Numpy. An OpenCL-enabled GPU is not required,
# OpenCL kernels can be compiled on most CPUs thanks to the Intel SDK for OpenCL
# or the AMD APP SDK.
import pyopencl as cl
def main():
dev_type_str = {}
for dev_type in ['ACCELERATOR', 'ALL', 'CPU', 'CUSTOM', 'DEFAULT', 'GPU']... | # import PyOpenCL and Numpy. An OpenCL-enabled GPU is not required,
# OpenCL kernels can be compiled on most CPUs thanks to the Intel SDK for OpenCL
# or the AMD APP SDK.
import pyopencl as cl
def main():
dev_type_str = {}
for dev_type in ['ACCELERATOR', 'ALL', 'CPU', 'CUSTOM', 'DEFAULT', 'GPU']:
dev_t... | # import PyOpenCL and Numpy. An OpenCL-enabled GPU is not required,
# OpenCL kernels can be compiled on most CPUs thanks to the Intel SDK for OpenCL
# or the AMD APP SDK.
import pyopencl as cl
def main():
dev_type_str = {}
for dev_type in ['ACCELERATOR', 'ALL', 'CPU', 'CUSTOM', 'DEFAULT', 'GPU']:
dev_t... | <commit_before># import PyOpenCL and Numpy. An OpenCL-enabled GPU is not required,
# OpenCL kernels can be compiled on most CPUs thanks to the Intel SDK for OpenCL
# or the AMD APP SDK.
import pyopencl as cl
def main():
dev_type_str = {}
for dev_type in ['ACCELERATOR', 'ALL', 'CPU', 'CUSTOM', 'DEFAULT', 'GPU']... |
139675bc644b796f4b472b3a8d9abd90205204c4 | bands_inspect/__init__.py | bands_inspect/__init__.py | # -*- coding: utf-8 -*-
# (c) 2017-2019, ETH Zurich, Institut fuer Theoretische Physik
# Author: Dominik Gresch <[email protected]>
"""
A tool for modifying, comparing and plotting electronic bandstructures.
"""
from . import kpoints
from . import eigenvals
from . import compare
from . import lattice
from . import plot
... | # -*- coding: utf-8 -*-
# (c) 2017-2019, ETH Zurich, Institut fuer Theoretische Physik
# Author: Dominik Gresch <[email protected]>
"""
A tool for modifying, comparing and plotting electronic bandstructures.
"""
from . import kpoints
from . import eigenvals
from . import compare
from . import lattice
from . import plot
... | Change version number to 0.2.2. | Change version number to 0.2.2.
| Python | apache-2.0 | Z2PackDev/bands_inspect,Z2PackDev/bands_inspect | # -*- coding: utf-8 -*-
# (c) 2017-2019, ETH Zurich, Institut fuer Theoretische Physik
# Author: Dominik Gresch <[email protected]>
"""
A tool for modifying, comparing and plotting electronic bandstructures.
"""
from . import kpoints
from . import eigenvals
from . import compare
from . import lattice
from . import plot
... | # -*- coding: utf-8 -*-
# (c) 2017-2019, ETH Zurich, Institut fuer Theoretische Physik
# Author: Dominik Gresch <[email protected]>
"""
A tool for modifying, comparing and plotting electronic bandstructures.
"""
from . import kpoints
from . import eigenvals
from . import compare
from . import lattice
from . import plot
... | <commit_before># -*- coding: utf-8 -*-
# (c) 2017-2019, ETH Zurich, Institut fuer Theoretische Physik
# Author: Dominik Gresch <[email protected]>
"""
A tool for modifying, comparing and plotting electronic bandstructures.
"""
from . import kpoints
from . import eigenvals
from . import compare
from . import lattice
from... | # -*- coding: utf-8 -*-
# (c) 2017-2019, ETH Zurich, Institut fuer Theoretische Physik
# Author: Dominik Gresch <[email protected]>
"""
A tool for modifying, comparing and plotting electronic bandstructures.
"""
from . import kpoints
from . import eigenvals
from . import compare
from . import lattice
from . import plot
... | # -*- coding: utf-8 -*-
# (c) 2017-2019, ETH Zurich, Institut fuer Theoretische Physik
# Author: Dominik Gresch <[email protected]>
"""
A tool for modifying, comparing and plotting electronic bandstructures.
"""
from . import kpoints
from . import eigenvals
from . import compare
from . import lattice
from . import plot
... | <commit_before># -*- coding: utf-8 -*-
# (c) 2017-2019, ETH Zurich, Institut fuer Theoretische Physik
# Author: Dominik Gresch <[email protected]>
"""
A tool for modifying, comparing and plotting electronic bandstructures.
"""
from . import kpoints
from . import eigenvals
from . import compare
from . import lattice
from... |
0f0a9eda5be7cfe0a2076dc2dd8a4d24068f75e0 | benchmarks/step_detect.py | benchmarks/step_detect.py | try:
from asv import step_detect
except ImportError:
pass
class Simple:
def setup(self):
self.y = ([1]*20 + [2]*30)*50
def time_detect_regressions(self):
step_detect.detect_regressions(self.y)
def time_solve_potts_approx(self):
step_detect.solve_potts_approx(self.y, 0.3, ... | try:
from asv import step_detect
except ImportError:
pass
class Simple:
def setup(self):
self.y = ([1]*20 + [2]*30)*50
if hasattr(step_detect, 'detect_steps'):
def time_detect_regressions(self):
steps = step_detect.detect_steps(self.y)
step_detect.detect_regres... | Fix benchmarks vs. changes in b1cc0a9aa5107 | Fix benchmarks vs. changes in b1cc0a9aa5107
| Python | bsd-3-clause | qwhelan/asv,qwhelan/asv,pv/asv,pv/asv,spacetelescope/asv,spacetelescope/asv,airspeed-velocity/asv,spacetelescope/asv,airspeed-velocity/asv,airspeed-velocity/asv,qwhelan/asv,pv/asv,airspeed-velocity/asv,spacetelescope/asv,qwhelan/asv,pv/asv | try:
from asv import step_detect
except ImportError:
pass
class Simple:
def setup(self):
self.y = ([1]*20 + [2]*30)*50
def time_detect_regressions(self):
step_detect.detect_regressions(self.y)
def time_solve_potts_approx(self):
step_detect.solve_potts_approx(self.y, 0.3, ... | try:
from asv import step_detect
except ImportError:
pass
class Simple:
def setup(self):
self.y = ([1]*20 + [2]*30)*50
if hasattr(step_detect, 'detect_steps'):
def time_detect_regressions(self):
steps = step_detect.detect_steps(self.y)
step_detect.detect_regres... | <commit_before>try:
from asv import step_detect
except ImportError:
pass
class Simple:
def setup(self):
self.y = ([1]*20 + [2]*30)*50
def time_detect_regressions(self):
step_detect.detect_regressions(self.y)
def time_solve_potts_approx(self):
step_detect.solve_potts_appro... | try:
from asv import step_detect
except ImportError:
pass
class Simple:
def setup(self):
self.y = ([1]*20 + [2]*30)*50
if hasattr(step_detect, 'detect_steps'):
def time_detect_regressions(self):
steps = step_detect.detect_steps(self.y)
step_detect.detect_regres... | try:
from asv import step_detect
except ImportError:
pass
class Simple:
def setup(self):
self.y = ([1]*20 + [2]*30)*50
def time_detect_regressions(self):
step_detect.detect_regressions(self.y)
def time_solve_potts_approx(self):
step_detect.solve_potts_approx(self.y, 0.3, ... | <commit_before>try:
from asv import step_detect
except ImportError:
pass
class Simple:
def setup(self):
self.y = ([1]*20 + [2]*30)*50
def time_detect_regressions(self):
step_detect.detect_regressions(self.y)
def time_solve_potts_approx(self):
step_detect.solve_potts_appro... |
89975de83d82695ba4615c72d17ac85baa39593d | invar/utils/ocr.py | invar/utils/ocr.py | # -*- coding: utf-8 -*-
from baluhn import generate as baluhn_generate, verify as baluhn_verify
from django.conf import settings
def generate(reference, check_length=settings.INVAR_OCR_CHECK_LENGTH):
reference = str(reference)
assert check_length == 1 or check_length == 2
if check_length == 1:
re... | # -*- coding: utf-8 -*-
from baluhn import generate as baluhn_generate, verify as baluhn_verify
from django.conf import settings
def generate(reference, check_length=settings.INVAR_OCR_CHECK_LENGTH):
reference = str(reference)
assert check_length == 1 or check_length == 2
if check_length == 1:
re... | Fix for empty reference bug | Fix for empty reference bug
| Python | mit | ovidner/bitket,ovidner/bitket,ovidner/bitket,ovidner/bitket | # -*- coding: utf-8 -*-
from baluhn import generate as baluhn_generate, verify as baluhn_verify
from django.conf import settings
def generate(reference, check_length=settings.INVAR_OCR_CHECK_LENGTH):
reference = str(reference)
assert check_length == 1 or check_length == 2
if check_length == 1:
re... | # -*- coding: utf-8 -*-
from baluhn import generate as baluhn_generate, verify as baluhn_verify
from django.conf import settings
def generate(reference, check_length=settings.INVAR_OCR_CHECK_LENGTH):
reference = str(reference)
assert check_length == 1 or check_length == 2
if check_length == 1:
re... | <commit_before># -*- coding: utf-8 -*-
from baluhn import generate as baluhn_generate, verify as baluhn_verify
from django.conf import settings
def generate(reference, check_length=settings.INVAR_OCR_CHECK_LENGTH):
reference = str(reference)
assert check_length == 1 or check_length == 2
if check_length =... | # -*- coding: utf-8 -*-
from baluhn import generate as baluhn_generate, verify as baluhn_verify
from django.conf import settings
def generate(reference, check_length=settings.INVAR_OCR_CHECK_LENGTH):
reference = str(reference)
assert check_length == 1 or check_length == 2
if check_length == 1:
re... | # -*- coding: utf-8 -*-
from baluhn import generate as baluhn_generate, verify as baluhn_verify
from django.conf import settings
def generate(reference, check_length=settings.INVAR_OCR_CHECK_LENGTH):
reference = str(reference)
assert check_length == 1 or check_length == 2
if check_length == 1:
re... | <commit_before># -*- coding: utf-8 -*-
from baluhn import generate as baluhn_generate, verify as baluhn_verify
from django.conf import settings
def generate(reference, check_length=settings.INVAR_OCR_CHECK_LENGTH):
reference = str(reference)
assert check_length == 1 or check_length == 2
if check_length =... |
860ef2b11774bc6acab848a6b37b808938086973 | pylibui/core.py | pylibui/core.py | """
Python wrapper for libui.
"""
from . import libui
class App:
def __init__(self):
"""
Creates a new pylibui app.
"""
options = libui.uiInitOptions()
libui.uiInit(options)
def __enter__(self):
self.start()
def start(self):
"""
S... | """
Python wrapper for libui.
"""
from . import libui
class App:
def __init__(self):
"""
Creates a new pylibui app.
"""
options = libui.uiInitOptions()
libui.uiInit(options)
def start(self):
"""
Starts the application main loop.
:return: N... | Revert "Make App a context manager" | Revert "Make App a context manager"
| Python | mit | superzazu/pylibui,superzazu/pylibui,joaoventura/pylibui,joaoventura/pylibui | """
Python wrapper for libui.
"""
from . import libui
class App:
def __init__(self):
"""
Creates a new pylibui app.
"""
options = libui.uiInitOptions()
libui.uiInit(options)
def __enter__(self):
self.start()
def start(self):
"""
S... | """
Python wrapper for libui.
"""
from . import libui
class App:
def __init__(self):
"""
Creates a new pylibui app.
"""
options = libui.uiInitOptions()
libui.uiInit(options)
def start(self):
"""
Starts the application main loop.
:return: N... | <commit_before>"""
Python wrapper for libui.
"""
from . import libui
class App:
def __init__(self):
"""
Creates a new pylibui app.
"""
options = libui.uiInitOptions()
libui.uiInit(options)
def __enter__(self):
self.start()
def start(self):
... | """
Python wrapper for libui.
"""
from . import libui
class App:
def __init__(self):
"""
Creates a new pylibui app.
"""
options = libui.uiInitOptions()
libui.uiInit(options)
def start(self):
"""
Starts the application main loop.
:return: N... | """
Python wrapper for libui.
"""
from . import libui
class App:
def __init__(self):
"""
Creates a new pylibui app.
"""
options = libui.uiInitOptions()
libui.uiInit(options)
def __enter__(self):
self.start()
def start(self):
"""
S... | <commit_before>"""
Python wrapper for libui.
"""
from . import libui
class App:
def __init__(self):
"""
Creates a new pylibui app.
"""
options = libui.uiInitOptions()
libui.uiInit(options)
def __enter__(self):
self.start()
def start(self):
... |
d8c21c06f93f479fbbabaf02e4993499bd147e94 | python/setup.py | python/setup.py | #!/usr/bin/env python
from setuptools import setup, Extension
import string
import sys
import os
sys.path.append('./test')
with open("README.md") as f:
long_description = f.read()
def cmd(line):
return os.popen(line).readlines()[0][:-1].split()
setup(name = 'sentencepiece',
author = 'Taku Kudo',
... | #!/usr/bin/env python
from setuptools import setup, Extension
import string
import subprocess
import sys
sys.path.append('./test')
with open("README.md") as f:
long_description = f.read()
def cmd(line):
try:
output = subprocess.check_output(line, shell=True)
except subprocess.CalledProcessError:... | Call sys.exit when pkg-config fails | Call sys.exit when pkg-config fails
| Python | apache-2.0 | google/sentencepiece,google/sentencepiece,google/sentencepiece,google/sentencepiece | #!/usr/bin/env python
from setuptools import setup, Extension
import string
import sys
import os
sys.path.append('./test')
with open("README.md") as f:
long_description = f.read()
def cmd(line):
return os.popen(line).readlines()[0][:-1].split()
setup(name = 'sentencepiece',
author = 'Taku Kudo',
... | #!/usr/bin/env python
from setuptools import setup, Extension
import string
import subprocess
import sys
sys.path.append('./test')
with open("README.md") as f:
long_description = f.read()
def cmd(line):
try:
output = subprocess.check_output(line, shell=True)
except subprocess.CalledProcessError:... | <commit_before>#!/usr/bin/env python
from setuptools import setup, Extension
import string
import sys
import os
sys.path.append('./test')
with open("README.md") as f:
long_description = f.read()
def cmd(line):
return os.popen(line).readlines()[0][:-1].split()
setup(name = 'sentencepiece',
author = 'T... | #!/usr/bin/env python
from setuptools import setup, Extension
import string
import subprocess
import sys
sys.path.append('./test')
with open("README.md") as f:
long_description = f.read()
def cmd(line):
try:
output = subprocess.check_output(line, shell=True)
except subprocess.CalledProcessError:... | #!/usr/bin/env python
from setuptools import setup, Extension
import string
import sys
import os
sys.path.append('./test')
with open("README.md") as f:
long_description = f.read()
def cmd(line):
return os.popen(line).readlines()[0][:-1].split()
setup(name = 'sentencepiece',
author = 'Taku Kudo',
... | <commit_before>#!/usr/bin/env python
from setuptools import setup, Extension
import string
import sys
import os
sys.path.append('./test')
with open("README.md") as f:
long_description = f.read()
def cmd(line):
return os.popen(line).readlines()[0][:-1].split()
setup(name = 'sentencepiece',
author = 'T... |
d84f42d45bb16820fb0077c9f0f92ba88e24d5de | cabot/cabotapp/jenkins.py | cabot/cabotapp/jenkins.py | from os import environ as env
from django.conf import settings
import requests
from datetime import datetime
from django.utils import timezone
from celery.utils.log import get_task_logger
logger = get_task_logger(__name__)
auth = (settings.JENKINS_USER, settings.JENKINS_PASS)
def get_job_status(jobname):
ret =... | from os import environ as env
from django.conf import settings
import requests
from datetime import datetime
from django.utils import timezone
from celery.utils.log import get_task_logger
logger = get_task_logger(__name__)
if settings.JENKINS_USER:
auth = (settings.JENKINS_USER, settings.JENKINS_PASS)
else:
... | Fix Jenkins tests when no user is set | Fix Jenkins tests when no user is set
| Python | mit | Affirm/cabot,Affirm/cabot,Affirm/cabot,Affirm/cabot | from os import environ as env
from django.conf import settings
import requests
from datetime import datetime
from django.utils import timezone
from celery.utils.log import get_task_logger
logger = get_task_logger(__name__)
auth = (settings.JENKINS_USER, settings.JENKINS_PASS)
def get_job_status(jobname):
ret =... | from os import environ as env
from django.conf import settings
import requests
from datetime import datetime
from django.utils import timezone
from celery.utils.log import get_task_logger
logger = get_task_logger(__name__)
if settings.JENKINS_USER:
auth = (settings.JENKINS_USER, settings.JENKINS_PASS)
else:
... | <commit_before>from os import environ as env
from django.conf import settings
import requests
from datetime import datetime
from django.utils import timezone
from celery.utils.log import get_task_logger
logger = get_task_logger(__name__)
auth = (settings.JENKINS_USER, settings.JENKINS_PASS)
def get_job_status(jobn... | from os import environ as env
from django.conf import settings
import requests
from datetime import datetime
from django.utils import timezone
from celery.utils.log import get_task_logger
logger = get_task_logger(__name__)
if settings.JENKINS_USER:
auth = (settings.JENKINS_USER, settings.JENKINS_PASS)
else:
... | from os import environ as env
from django.conf import settings
import requests
from datetime import datetime
from django.utils import timezone
from celery.utils.log import get_task_logger
logger = get_task_logger(__name__)
auth = (settings.JENKINS_USER, settings.JENKINS_PASS)
def get_job_status(jobname):
ret =... | <commit_before>from os import environ as env
from django.conf import settings
import requests
from datetime import datetime
from django.utils import timezone
from celery.utils.log import get_task_logger
logger = get_task_logger(__name__)
auth = (settings.JENKINS_USER, settings.JENKINS_PASS)
def get_job_status(jobn... |
51059ae476ca0dd553220cf25c73a0eb14a099de | RecorderFactory.py | RecorderFactory.py | from Recorders import Recorder, PrintRecorder, FileRecorder
factory = dict([
('print', create_print_recorder),
('file', create_file_recorder)])
def create_recorder(config):
return factory[config.type](config.config)
def create_print_recorder(config):
return PrintRecorder(config)
def create_file_reco... | from Recorders import Recorder, PrintRecorder, FileRecorder
def create_print_recorder(config):
return PrintRecorder(config)
def create_file_recorder(config):
return FileRecorder(config)
recorderInitializers = dict([
('print', create_print_recorder),
('file', create_file_recorder)])
def create_record... | Define initializers before use them | Define initializers before use them
| Python | mit | hectortosa/py-temperature-recorder | from Recorders import Recorder, PrintRecorder, FileRecorder
factory = dict([
('print', create_print_recorder),
('file', create_file_recorder)])
def create_recorder(config):
return factory[config.type](config.config)
def create_print_recorder(config):
return PrintRecorder(config)
def create_file_reco... | from Recorders import Recorder, PrintRecorder, FileRecorder
def create_print_recorder(config):
return PrintRecorder(config)
def create_file_recorder(config):
return FileRecorder(config)
recorderInitializers = dict([
('print', create_print_recorder),
('file', create_file_recorder)])
def create_record... | <commit_before>from Recorders import Recorder, PrintRecorder, FileRecorder
factory = dict([
('print', create_print_recorder),
('file', create_file_recorder)])
def create_recorder(config):
return factory[config.type](config.config)
def create_print_recorder(config):
return PrintRecorder(config)
def c... | from Recorders import Recorder, PrintRecorder, FileRecorder
def create_print_recorder(config):
return PrintRecorder(config)
def create_file_recorder(config):
return FileRecorder(config)
recorderInitializers = dict([
('print', create_print_recorder),
('file', create_file_recorder)])
def create_record... | from Recorders import Recorder, PrintRecorder, FileRecorder
factory = dict([
('print', create_print_recorder),
('file', create_file_recorder)])
def create_recorder(config):
return factory[config.type](config.config)
def create_print_recorder(config):
return PrintRecorder(config)
def create_file_reco... | <commit_before>from Recorders import Recorder, PrintRecorder, FileRecorder
factory = dict([
('print', create_print_recorder),
('file', create_file_recorder)])
def create_recorder(config):
return factory[config.type](config.config)
def create_print_recorder(config):
return PrintRecorder(config)
def c... |
e40985c1ecba1529987ed9551210677ea93b9614 | test/unit/builtins/test_install.py | test/unit/builtins/test_install.py | from .common import BuiltinTest
from bfg9000.builtins import default, install # noqa
from bfg9000 import file_types
from bfg9000.path import Path, Root
class TestInstall(BuiltinTest):
def test_install_none(self):
self.assertEqual(self.builtin_dict['install'](), None)
def test_install_single(self):
... | import mock
from .common import BuiltinTest
from bfg9000.builtins import default, install # noqa
from bfg9000 import file_types
from bfg9000.path import Path, Root
class TestInstall(BuiltinTest):
def test_install_none(self):
self.assertEqual(self.builtin_dict['install'](), None)
def test_install_s... | Add tests for unset installation dirs | Add tests for unset installation dirs
| Python | bsd-3-clause | jimporter/bfg9000,jimporter/bfg9000,jimporter/bfg9000,jimporter/bfg9000 | from .common import BuiltinTest
from bfg9000.builtins import default, install # noqa
from bfg9000 import file_types
from bfg9000.path import Path, Root
class TestInstall(BuiltinTest):
def test_install_none(self):
self.assertEqual(self.builtin_dict['install'](), None)
def test_install_single(self):
... | import mock
from .common import BuiltinTest
from bfg9000.builtins import default, install # noqa
from bfg9000 import file_types
from bfg9000.path import Path, Root
class TestInstall(BuiltinTest):
def test_install_none(self):
self.assertEqual(self.builtin_dict['install'](), None)
def test_install_s... | <commit_before>from .common import BuiltinTest
from bfg9000.builtins import default, install # noqa
from bfg9000 import file_types
from bfg9000.path import Path, Root
class TestInstall(BuiltinTest):
def test_install_none(self):
self.assertEqual(self.builtin_dict['install'](), None)
def test_install... | import mock
from .common import BuiltinTest
from bfg9000.builtins import default, install # noqa
from bfg9000 import file_types
from bfg9000.path import Path, Root
class TestInstall(BuiltinTest):
def test_install_none(self):
self.assertEqual(self.builtin_dict['install'](), None)
def test_install_s... | from .common import BuiltinTest
from bfg9000.builtins import default, install # noqa
from bfg9000 import file_types
from bfg9000.path import Path, Root
class TestInstall(BuiltinTest):
def test_install_none(self):
self.assertEqual(self.builtin_dict['install'](), None)
def test_install_single(self):
... | <commit_before>from .common import BuiltinTest
from bfg9000.builtins import default, install # noqa
from bfg9000 import file_types
from bfg9000.path import Path, Root
class TestInstall(BuiltinTest):
def test_install_none(self):
self.assertEqual(self.builtin_dict['install'](), None)
def test_install... |
260cd3b96df3a4746560db0032d7b6042c55d7fc | integration-test/976-fractional-pois.py | integration-test/976-fractional-pois.py | # https://www.openstreetmap.org/way/147689077
# Apple Store, SF
assert_has_feature(
15, 5242, 12664, 'pois',
{ 'id': 147689077, 'min_zoom': 15.68 })
| # https://www.openstreetmap.org/way/147689077
# Apple Store, SF
assert_has_feature(
15, 5242, 12664, 'pois',
{ 'id': 147689077, 'min_zoom': 15.68 })
# Test that source and min_zoom are set properly for boundaries, roads, transit, and water
assert_has_feature(
5, 9, 12, 'boundaries',
{ 'min_zoom': 0 , '... | Add tests for source and min_zoom | Add tests for source and min_zoom
| Python | mit | mapzen/vector-datasource,mapzen/vector-datasource,mapzen/vector-datasource | # https://www.openstreetmap.org/way/147689077
# Apple Store, SF
assert_has_feature(
15, 5242, 12664, 'pois',
{ 'id': 147689077, 'min_zoom': 15.68 })
Add tests for source and min_zoom | # https://www.openstreetmap.org/way/147689077
# Apple Store, SF
assert_has_feature(
15, 5242, 12664, 'pois',
{ 'id': 147689077, 'min_zoom': 15.68 })
# Test that source and min_zoom are set properly for boundaries, roads, transit, and water
assert_has_feature(
5, 9, 12, 'boundaries',
{ 'min_zoom': 0 , '... | <commit_before># https://www.openstreetmap.org/way/147689077
# Apple Store, SF
assert_has_feature(
15, 5242, 12664, 'pois',
{ 'id': 147689077, 'min_zoom': 15.68 })
<commit_msg>Add tests for source and min_zoom<commit_after> | # https://www.openstreetmap.org/way/147689077
# Apple Store, SF
assert_has_feature(
15, 5242, 12664, 'pois',
{ 'id': 147689077, 'min_zoom': 15.68 })
# Test that source and min_zoom are set properly for boundaries, roads, transit, and water
assert_has_feature(
5, 9, 12, 'boundaries',
{ 'min_zoom': 0 , '... | # https://www.openstreetmap.org/way/147689077
# Apple Store, SF
assert_has_feature(
15, 5242, 12664, 'pois',
{ 'id': 147689077, 'min_zoom': 15.68 })
Add tests for source and min_zoom# https://www.openstreetmap.org/way/147689077
# Apple Store, SF
assert_has_feature(
15, 5242, 12664, 'pois',
{ 'id': 14768... | <commit_before># https://www.openstreetmap.org/way/147689077
# Apple Store, SF
assert_has_feature(
15, 5242, 12664, 'pois',
{ 'id': 147689077, 'min_zoom': 15.68 })
<commit_msg>Add tests for source and min_zoom<commit_after># https://www.openstreetmap.org/way/147689077
# Apple Store, SF
assert_has_feature(
1... |
633969d8d53d28db48bb2478820e90315329542c | tiddlywebplugins/prettyerror/instance.py | tiddlywebplugins/prettyerror/instance.py |
store_contents = {}
store_structure = {}
store_contents['_default_errors'] = [
'src/_errors/index.recipe',
]
store_structure['recipes'] = {}
store_structure['bags'] = {}
store_structure['recipes']['_errors'] = {
'desc': 'Pretty Errors Error Tiddlers',
'recipe': [
('_defau... | """
Establish the data structures representing the bags and recipes needed
by this plugin.
"""
store_contents = {}
store_structure = {}
store_contents['_default_errors'] = [
'src/_errors/index.recipe',
]
store_structure['recipes'] = {}
store_structure['bags'] = {}
store_structure['recipes']['_errors... | Correct set policy on bag. | Correct set policy on bag.
Had been missing create constraint.
| Python | bsd-3-clause | tiddlyweb/tiddlywebplugins.prettyerror |
store_contents = {}
store_structure = {}
store_contents['_default_errors'] = [
'src/_errors/index.recipe',
]
store_structure['recipes'] = {}
store_structure['bags'] = {}
store_structure['recipes']['_errors'] = {
'desc': 'Pretty Errors Error Tiddlers',
'recipe': [
('_defau... | """
Establish the data structures representing the bags and recipes needed
by this plugin.
"""
store_contents = {}
store_structure = {}
store_contents['_default_errors'] = [
'src/_errors/index.recipe',
]
store_structure['recipes'] = {}
store_structure['bags'] = {}
store_structure['recipes']['_errors... | <commit_before>
store_contents = {}
store_structure = {}
store_contents['_default_errors'] = [
'src/_errors/index.recipe',
]
store_structure['recipes'] = {}
store_structure['bags'] = {}
store_structure['recipes']['_errors'] = {
'desc': 'Pretty Errors Error Tiddlers',
'recipe': [
... | """
Establish the data structures representing the bags and recipes needed
by this plugin.
"""
store_contents = {}
store_structure = {}
store_contents['_default_errors'] = [
'src/_errors/index.recipe',
]
store_structure['recipes'] = {}
store_structure['bags'] = {}
store_structure['recipes']['_errors... |
store_contents = {}
store_structure = {}
store_contents['_default_errors'] = [
'src/_errors/index.recipe',
]
store_structure['recipes'] = {}
store_structure['bags'] = {}
store_structure['recipes']['_errors'] = {
'desc': 'Pretty Errors Error Tiddlers',
'recipe': [
('_defau... | <commit_before>
store_contents = {}
store_structure = {}
store_contents['_default_errors'] = [
'src/_errors/index.recipe',
]
store_structure['recipes'] = {}
store_structure['bags'] = {}
store_structure['recipes']['_errors'] = {
'desc': 'Pretty Errors Error Tiddlers',
'recipe': [
... |
fe37ef9248f8658296e6f465d380d639d6047a5d | aspen/server/diesel_.py | aspen/server/diesel_.py | import diesel
from aspen.server import BaseEngine
from diesel.protocols import wsgi
class Engine(BaseEngine):
app = None # a diesel app instance
def bind(self):
self.app = wsgi.WSGIApplication( self.website
, self.website.address[1]
... | import diesel
from aspen.server import BaseEngine
from diesel.protocols import wsgi
class Engine(BaseEngine):
diesel_app = None # a diesel diesel_app instance
def bind(self):
self.diesel_app = wsgi.WSGIApplication( self.website
, self.website.address[1]
... | Reduce log spam from diesel. | Reduce log spam from diesel.
| Python | mit | gratipay/aspen.py,gratipay/aspen.py | import diesel
from aspen.server import BaseEngine
from diesel.protocols import wsgi
class Engine(BaseEngine):
app = None # a diesel app instance
def bind(self):
self.app = wsgi.WSGIApplication( self.website
, self.website.address[1]
... | import diesel
from aspen.server import BaseEngine
from diesel.protocols import wsgi
class Engine(BaseEngine):
diesel_app = None # a diesel diesel_app instance
def bind(self):
self.diesel_app = wsgi.WSGIApplication( self.website
, self.website.address[1]
... | <commit_before>import diesel
from aspen.server import BaseEngine
from diesel.protocols import wsgi
class Engine(BaseEngine):
app = None # a diesel app instance
def bind(self):
self.app = wsgi.WSGIApplication( self.website
, self.website.address[1]
... | import diesel
from aspen.server import BaseEngine
from diesel.protocols import wsgi
class Engine(BaseEngine):
diesel_app = None # a diesel diesel_app instance
def bind(self):
self.diesel_app = wsgi.WSGIApplication( self.website
, self.website.address[1]
... | import diesel
from aspen.server import BaseEngine
from diesel.protocols import wsgi
class Engine(BaseEngine):
app = None # a diesel app instance
def bind(self):
self.app = wsgi.WSGIApplication( self.website
, self.website.address[1]
... | <commit_before>import diesel
from aspen.server import BaseEngine
from diesel.protocols import wsgi
class Engine(BaseEngine):
app = None # a diesel app instance
def bind(self):
self.app = wsgi.WSGIApplication( self.website
, self.website.address[1]
... |
cc08fcbb513224aafe6c04143a150d1019c032ef | setup_py2exe.py | setup_py2exe.py | #!/usr/bin/env python
# C:\Python27_32\python.exe setup_py2exe.py py2exe
from distutils.core import setup
from glob import glob
import os
import py2exe
from setup import SSLYZE_SETUP
data_files = [("Microsoft.VC90.CRT", glob(r'C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\*.*'))]
# T... | #!/usr/bin/env python
# C:\Python27_32\python.exe setup_py2exe.py py2exe
from distutils.core import setup
from glob import glob
import os
import py2exe
from setup import SSLYZE_SETUP
data_files = [("Microsoft.VC90.CRT", glob(r'C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\*.*'))]
# T... | Fix trust stores paths for py2exe builds | Fix trust stores paths for py2exe builds
| Python | agpl-3.0 | nabla-c0d3/sslyze | #!/usr/bin/env python
# C:\Python27_32\python.exe setup_py2exe.py py2exe
from distutils.core import setup
from glob import glob
import os
import py2exe
from setup import SSLYZE_SETUP
data_files = [("Microsoft.VC90.CRT", glob(r'C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\*.*'))]
# T... | #!/usr/bin/env python
# C:\Python27_32\python.exe setup_py2exe.py py2exe
from distutils.core import setup
from glob import glob
import os
import py2exe
from setup import SSLYZE_SETUP
data_files = [("Microsoft.VC90.CRT", glob(r'C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\*.*'))]
# T... | <commit_before>#!/usr/bin/env python
# C:\Python27_32\python.exe setup_py2exe.py py2exe
from distutils.core import setup
from glob import glob
import os
import py2exe
from setup import SSLYZE_SETUP
data_files = [("Microsoft.VC90.CRT", glob(r'C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.C... | #!/usr/bin/env python
# C:\Python27_32\python.exe setup_py2exe.py py2exe
from distutils.core import setup
from glob import glob
import os
import py2exe
from setup import SSLYZE_SETUP
data_files = [("Microsoft.VC90.CRT", glob(r'C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\*.*'))]
# T... | #!/usr/bin/env python
# C:\Python27_32\python.exe setup_py2exe.py py2exe
from distutils.core import setup
from glob import glob
import os
import py2exe
from setup import SSLYZE_SETUP
data_files = [("Microsoft.VC90.CRT", glob(r'C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\*.*'))]
# T... | <commit_before>#!/usr/bin/env python
# C:\Python27_32\python.exe setup_py2exe.py py2exe
from distutils.core import setup
from glob import glob
import os
import py2exe
from setup import SSLYZE_SETUP
data_files = [("Microsoft.VC90.CRT", glob(r'C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.C... |
013d0e3b2d8fdc212ae63f635a1e8def988672fa | tests/structures/test_sequences.py | tests/structures/test_sequences.py | import unittest
from ..utils import TranspileTestCase
class SequenceTests(TranspileTestCase):
def test_unpack_sequence(self):
self.assertCodeExecution("""
x = [1, 2, 3]
a, b, c = x
print(a)
print(b)
print(c)
""")
@unittest.skip(... | import unittest
from ..utils import TranspileTestCase
class SequenceTests(TranspileTestCase):
def test_unpack_sequence(self):
self.assertCodeExecution("""
x = [1, 2, 3]
a, b, c = x
print(a)
print(b)
print(c)
""")
@unittest.expec... | Convert some skips to expected failures. | Convert some skips to expected failures.
| Python | bsd-3-clause | glasnt/voc,freakboy3742/voc,ASP1234/voc,ASP1234/voc,Felix5721/voc,pombredanne/voc,pombredanne/voc,Felix5721/voc,cflee/voc,cflee/voc,gEt-rIgHt-jR/voc,glasnt/voc,gEt-rIgHt-jR/voc,freakboy3742/voc | import unittest
from ..utils import TranspileTestCase
class SequenceTests(TranspileTestCase):
def test_unpack_sequence(self):
self.assertCodeExecution("""
x = [1, 2, 3]
a, b, c = x
print(a)
print(b)
print(c)
""")
@unittest.skip(... | import unittest
from ..utils import TranspileTestCase
class SequenceTests(TranspileTestCase):
def test_unpack_sequence(self):
self.assertCodeExecution("""
x = [1, 2, 3]
a, b, c = x
print(a)
print(b)
print(c)
""")
@unittest.expec... | <commit_before>import unittest
from ..utils import TranspileTestCase
class SequenceTests(TranspileTestCase):
def test_unpack_sequence(self):
self.assertCodeExecution("""
x = [1, 2, 3]
a, b, c = x
print(a)
print(b)
print(c)
""")
... | import unittest
from ..utils import TranspileTestCase
class SequenceTests(TranspileTestCase):
def test_unpack_sequence(self):
self.assertCodeExecution("""
x = [1, 2, 3]
a, b, c = x
print(a)
print(b)
print(c)
""")
@unittest.expec... | import unittest
from ..utils import TranspileTestCase
class SequenceTests(TranspileTestCase):
def test_unpack_sequence(self):
self.assertCodeExecution("""
x = [1, 2, 3]
a, b, c = x
print(a)
print(b)
print(c)
""")
@unittest.skip(... | <commit_before>import unittest
from ..utils import TranspileTestCase
class SequenceTests(TranspileTestCase):
def test_unpack_sequence(self):
self.assertCodeExecution("""
x = [1, 2, 3]
a, b, c = x
print(a)
print(b)
print(c)
""")
... |
9639cb7607d301abbc7ad6c8b22aa97e6a0eb5cb | tests/examples/test_examples_run.py | tests/examples/test_examples_run.py | import pytest
from os.path import abspath, basename, dirname, join
import subprocess
import glob
import sys
cwd = abspath(dirname(__file__))
examples_dir = join(cwd, "..", "..", "examples")
example_files = glob.glob("%s/*.py" % examples_dir)
@pytest.fixture(params=[pytest.param(f, marks=pytest.mark.xfail(reason="un... | import pytest
from os.path import abspath, basename, dirname, join
import subprocess
import glob
import sys
cwd = abspath(dirname(__file__))
examples_dir = join(cwd, "..", "..", "examples")
example_files = glob.glob("%s/*.py" % examples_dir)
@pytest.fixture(params=glob.glob("%s/*.py" % examples_dir),
... | Remove pytest flag for xfails | Remove pytest flag for xfails
| Python | mit | firedrakeproject/gusto,firedrakeproject/dcore | import pytest
from os.path import abspath, basename, dirname, join
import subprocess
import glob
import sys
cwd = abspath(dirname(__file__))
examples_dir = join(cwd, "..", "..", "examples")
example_files = glob.glob("%s/*.py" % examples_dir)
@pytest.fixture(params=[pytest.param(f, marks=pytest.mark.xfail(reason="un... | import pytest
from os.path import abspath, basename, dirname, join
import subprocess
import glob
import sys
cwd = abspath(dirname(__file__))
examples_dir = join(cwd, "..", "..", "examples")
example_files = glob.glob("%s/*.py" % examples_dir)
@pytest.fixture(params=glob.glob("%s/*.py" % examples_dir),
... | <commit_before>import pytest
from os.path import abspath, basename, dirname, join
import subprocess
import glob
import sys
cwd = abspath(dirname(__file__))
examples_dir = join(cwd, "..", "..", "examples")
example_files = glob.glob("%s/*.py" % examples_dir)
@pytest.fixture(params=[pytest.param(f, marks=pytest.mark.x... | import pytest
from os.path import abspath, basename, dirname, join
import subprocess
import glob
import sys
cwd = abspath(dirname(__file__))
examples_dir = join(cwd, "..", "..", "examples")
example_files = glob.glob("%s/*.py" % examples_dir)
@pytest.fixture(params=glob.glob("%s/*.py" % examples_dir),
... | import pytest
from os.path import abspath, basename, dirname, join
import subprocess
import glob
import sys
cwd = abspath(dirname(__file__))
examples_dir = join(cwd, "..", "..", "examples")
example_files = glob.glob("%s/*.py" % examples_dir)
@pytest.fixture(params=[pytest.param(f, marks=pytest.mark.xfail(reason="un... | <commit_before>import pytest
from os.path import abspath, basename, dirname, join
import subprocess
import glob
import sys
cwd = abspath(dirname(__file__))
examples_dir = join(cwd, "..", "..", "examples")
example_files = glob.glob("%s/*.py" % examples_dir)
@pytest.fixture(params=[pytest.param(f, marks=pytest.mark.x... |
e783dfef25eb1e3b06064fb2bd125cef4f56ec08 | linter.py | linter.py | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Aparajita Fishman
# Copyright (c) 2013 Aparajita Fishman
#
# Project: https://github.com/SublimeLinter/SublimeLinter-contrib-gjslint
# License: MIT
#
"""This module exports the GJSLint plugin linter class."""
from S... | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Aparajita Fishman
# Copyright (c) 2013 Aparajita Fishman
#
# Project: https://github.com/SublimeLinter/SublimeLinter-contrib-gjslint
# License: MIT
#
"""This module exports the GJSLint plugin linter class."""
from S... | Change 'language' to 'syntax', that is more precise terminology. | Change 'language' to 'syntax', that is more precise terminology.
| Python | mit | SublimeLinter/SublimeLinter-gjslint | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Aparajita Fishman
# Copyright (c) 2013 Aparajita Fishman
#
# Project: https://github.com/SublimeLinter/SublimeLinter-contrib-gjslint
# License: MIT
#
"""This module exports the GJSLint plugin linter class."""
from S... | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Aparajita Fishman
# Copyright (c) 2013 Aparajita Fishman
#
# Project: https://github.com/SublimeLinter/SublimeLinter-contrib-gjslint
# License: MIT
#
"""This module exports the GJSLint plugin linter class."""
from S... | <commit_before>#
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Aparajita Fishman
# Copyright (c) 2013 Aparajita Fishman
#
# Project: https://github.com/SublimeLinter/SublimeLinter-contrib-gjslint
# License: MIT
#
"""This module exports the GJSLint plugin linter cl... | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Aparajita Fishman
# Copyright (c) 2013 Aparajita Fishman
#
# Project: https://github.com/SublimeLinter/SublimeLinter-contrib-gjslint
# License: MIT
#
"""This module exports the GJSLint plugin linter class."""
from S... | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Aparajita Fishman
# Copyright (c) 2013 Aparajita Fishman
#
# Project: https://github.com/SublimeLinter/SublimeLinter-contrib-gjslint
# License: MIT
#
"""This module exports the GJSLint plugin linter class."""
from S... | <commit_before>#
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Aparajita Fishman
# Copyright (c) 2013 Aparajita Fishman
#
# Project: https://github.com/SublimeLinter/SublimeLinter-contrib-gjslint
# License: MIT
#
"""This module exports the GJSLint plugin linter cl... |
ce6685d18492fe0787ded92939f52916e0d9cbaa | lc046_permutations.py | lc046_permutations.py | """Leetcode 46. Permutations
Medium
URL: https://leetcode.com/problems/permutations/
Given a collection of distinct integers, return all possible permutations.
Example:
Input: [1,2,3]
Output:
[
[1,2,3],
[1,3,2],
[2,1,3],
[2,3,1],
[3,1,2],
[3,2,1]
]
"""
class Solution(object):
def _backtrack(self, pe... | """Leetcode 46. Permutations
Medium
URL: https://leetcode.com/problems/permutations/
Given a collection of distinct integers, return all possible permutations.
Example:
Input: [1,2,3]
Output:
[
[1,2,3],
[1,3,2],
[2,1,3],
[2,3,1],
[3,1,2],
[3,2,1]
]
"""
class Solution(object):
def _backtrack(self, pe... | Refactor adding temp to permutations | Refactor adding temp to permutations
| Python | bsd-2-clause | bowen0701/algorithms_data_structures | """Leetcode 46. Permutations
Medium
URL: https://leetcode.com/problems/permutations/
Given a collection of distinct integers, return all possible permutations.
Example:
Input: [1,2,3]
Output:
[
[1,2,3],
[1,3,2],
[2,1,3],
[2,3,1],
[3,1,2],
[3,2,1]
]
"""
class Solution(object):
def _backtrack(self, pe... | """Leetcode 46. Permutations
Medium
URL: https://leetcode.com/problems/permutations/
Given a collection of distinct integers, return all possible permutations.
Example:
Input: [1,2,3]
Output:
[
[1,2,3],
[1,3,2],
[2,1,3],
[2,3,1],
[3,1,2],
[3,2,1]
]
"""
class Solution(object):
def _backtrack(self, pe... | <commit_before>"""Leetcode 46. Permutations
Medium
URL: https://leetcode.com/problems/permutations/
Given a collection of distinct integers, return all possible permutations.
Example:
Input: [1,2,3]
Output:
[
[1,2,3],
[1,3,2],
[2,1,3],
[2,3,1],
[3,1,2],
[3,2,1]
]
"""
class Solution(object):
def _bac... | """Leetcode 46. Permutations
Medium
URL: https://leetcode.com/problems/permutations/
Given a collection of distinct integers, return all possible permutations.
Example:
Input: [1,2,3]
Output:
[
[1,2,3],
[1,3,2],
[2,1,3],
[2,3,1],
[3,1,2],
[3,2,1]
]
"""
class Solution(object):
def _backtrack(self, pe... | """Leetcode 46. Permutations
Medium
URL: https://leetcode.com/problems/permutations/
Given a collection of distinct integers, return all possible permutations.
Example:
Input: [1,2,3]
Output:
[
[1,2,3],
[1,3,2],
[2,1,3],
[2,3,1],
[3,1,2],
[3,2,1]
]
"""
class Solution(object):
def _backtrack(self, pe... | <commit_before>"""Leetcode 46. Permutations
Medium
URL: https://leetcode.com/problems/permutations/
Given a collection of distinct integers, return all possible permutations.
Example:
Input: [1,2,3]
Output:
[
[1,2,3],
[1,3,2],
[2,1,3],
[2,3,1],
[3,1,2],
[3,2,1]
]
"""
class Solution(object):
def _bac... |
6ba67b7090bbbb7a19e3a6c5623c1e63c0452428 | dmoj/executors/OCTAVE.py | dmoj/executors/OCTAVE.py | from .base_executor import ScriptExecutor
class Executor(ScriptExecutor):
ext = '.m'
name = 'OCTAVE'
command = 'octave'
address_grace = 131072
test_program = "disp(input('', 's'))"
fs = ['.*\.m', '/lib/', '/etc/nsswitch\.conf$', '/etc/passwd$', '/usr/share/', '/etc/fltk/']
def get_cmdlin... | from .base_executor import ScriptExecutor
class Executor(ScriptExecutor):
ext = '.m'
name = 'OCTAVE'
command = 'octave'
address_grace = 131072
test_program = "disp(input('', 's'))"
fs = ['.*\.m', '/lib/', '/etc/nsswitch\.conf$', '/etc/passwd$', '/usr/share/', '/etc/fltk/']
def get_cmdlin... | Address execve protection fault in Octave autoconfig | Address execve protection fault in Octave autoconfig
`octave-cli` is what we really want
| Python | agpl-3.0 | DMOJ/judge,DMOJ/judge,DMOJ/judge | from .base_executor import ScriptExecutor
class Executor(ScriptExecutor):
ext = '.m'
name = 'OCTAVE'
command = 'octave'
address_grace = 131072
test_program = "disp(input('', 's'))"
fs = ['.*\.m', '/lib/', '/etc/nsswitch\.conf$', '/etc/passwd$', '/usr/share/', '/etc/fltk/']
def get_cmdlin... | from .base_executor import ScriptExecutor
class Executor(ScriptExecutor):
ext = '.m'
name = 'OCTAVE'
command = 'octave'
address_grace = 131072
test_program = "disp(input('', 's'))"
fs = ['.*\.m', '/lib/', '/etc/nsswitch\.conf$', '/etc/passwd$', '/usr/share/', '/etc/fltk/']
def get_cmdlin... | <commit_before>from .base_executor import ScriptExecutor
class Executor(ScriptExecutor):
ext = '.m'
name = 'OCTAVE'
command = 'octave'
address_grace = 131072
test_program = "disp(input('', 's'))"
fs = ['.*\.m', '/lib/', '/etc/nsswitch\.conf$', '/etc/passwd$', '/usr/share/', '/etc/fltk/']
... | from .base_executor import ScriptExecutor
class Executor(ScriptExecutor):
ext = '.m'
name = 'OCTAVE'
command = 'octave'
address_grace = 131072
test_program = "disp(input('', 's'))"
fs = ['.*\.m', '/lib/', '/etc/nsswitch\.conf$', '/etc/passwd$', '/usr/share/', '/etc/fltk/']
def get_cmdlin... | from .base_executor import ScriptExecutor
class Executor(ScriptExecutor):
ext = '.m'
name = 'OCTAVE'
command = 'octave'
address_grace = 131072
test_program = "disp(input('', 's'))"
fs = ['.*\.m', '/lib/', '/etc/nsswitch\.conf$', '/etc/passwd$', '/usr/share/', '/etc/fltk/']
def get_cmdlin... | <commit_before>from .base_executor import ScriptExecutor
class Executor(ScriptExecutor):
ext = '.m'
name = 'OCTAVE'
command = 'octave'
address_grace = 131072
test_program = "disp(input('', 's'))"
fs = ['.*\.m', '/lib/', '/etc/nsswitch\.conf$', '/etc/passwd$', '/usr/share/', '/etc/fltk/']
... |
a962b38f6e36e8d06feee5fed5fcacaa69ef6761 | dnzo/admin/migrations.py | dnzo/admin/migrations.py | from google.appengine.ext import db
def update_context_indexes(start_key = None):
def fn(task):
task.contexts_index = " ".join(task.contexts)
task.put()
return True
from tasks_data.models import Task
return do_for_all(Task, start_key, fn, 50)
def do_for_all(model_klass, start_key, callbac... | from google.appengine.ext import db
def update_context_indexes(start_key = None):
def fn(task):
task.contexts_index = " ".join(task.contexts)
task.put()
return True
from tasks_data.models import Task
return do_for_all(Task, start_key, fn, 20)
def do_for_all(model_klass, start_key, callbac... | Change to 20 records at a time instead of 50. | Change to 20 records at a time instead of 50.
git-svn-id: 062a66634e56759c7c3cc44955c32d2ce0012d25@256 c02d1e6f-6a35-45f2-ab14-3b6f79a691ff
| Python | mit | taylorhughes/done-zo,taylorhughes/done-zo,taylorhughes/done-zo,taylorhughes/done-zo | from google.appengine.ext import db
def update_context_indexes(start_key = None):
def fn(task):
task.contexts_index = " ".join(task.contexts)
task.put()
return True
from tasks_data.models import Task
return do_for_all(Task, start_key, fn, 50)
def do_for_all(model_klass, start_key, callbac... | from google.appengine.ext import db
def update_context_indexes(start_key = None):
def fn(task):
task.contexts_index = " ".join(task.contexts)
task.put()
return True
from tasks_data.models import Task
return do_for_all(Task, start_key, fn, 20)
def do_for_all(model_klass, start_key, callbac... | <commit_before>from google.appengine.ext import db
def update_context_indexes(start_key = None):
def fn(task):
task.contexts_index = " ".join(task.contexts)
task.put()
return True
from tasks_data.models import Task
return do_for_all(Task, start_key, fn, 50)
def do_for_all(model_klass, sta... | from google.appengine.ext import db
def update_context_indexes(start_key = None):
def fn(task):
task.contexts_index = " ".join(task.contexts)
task.put()
return True
from tasks_data.models import Task
return do_for_all(Task, start_key, fn, 20)
def do_for_all(model_klass, start_key, callbac... | from google.appengine.ext import db
def update_context_indexes(start_key = None):
def fn(task):
task.contexts_index = " ".join(task.contexts)
task.put()
return True
from tasks_data.models import Task
return do_for_all(Task, start_key, fn, 50)
def do_for_all(model_klass, start_key, callbac... | <commit_before>from google.appengine.ext import db
def update_context_indexes(start_key = None):
def fn(task):
task.contexts_index = " ".join(task.contexts)
task.put()
return True
from tasks_data.models import Task
return do_for_all(Task, start_key, fn, 50)
def do_for_all(model_klass, sta... |
011f7fbe66cc226cdd2be2e2eeef44df11733251 | scrapyard/kickass.py | scrapyard/kickass.py | import cache
import network
import scraper
import urllib
KICKASS_URL = 'http://kickass.so'
################################################################################
def movie(movie_info):
return __search('category:{0} imdb:{1}'.format('movies', movie_info['imdb_id'][2:]))
#################################... | import cache
import network
import scraper
import urllib
KICKASS_URL = 'http://kickass.so'
################################################################################
def movie(movie_info):
return __search('category:{0} imdb:{1}'.format('movies', movie_info['imdb_id'][2:]))
#################################... | Remove ? from show title when searching | Kickass: Remove ? from show title when searching
| Python | mit | sharkone/scrapyard | import cache
import network
import scraper
import urllib
KICKASS_URL = 'http://kickass.so'
################################################################################
def movie(movie_info):
return __search('category:{0} imdb:{1}'.format('movies', movie_info['imdb_id'][2:]))
#################################... | import cache
import network
import scraper
import urllib
KICKASS_URL = 'http://kickass.so'
################################################################################
def movie(movie_info):
return __search('category:{0} imdb:{1}'.format('movies', movie_info['imdb_id'][2:]))
#################################... | <commit_before>import cache
import network
import scraper
import urllib
KICKASS_URL = 'http://kickass.so'
################################################################################
def movie(movie_info):
return __search('category:{0} imdb:{1}'.format('movies', movie_info['imdb_id'][2:]))
##################... | import cache
import network
import scraper
import urllib
KICKASS_URL = 'http://kickass.so'
################################################################################
def movie(movie_info):
return __search('category:{0} imdb:{1}'.format('movies', movie_info['imdb_id'][2:]))
#################################... | import cache
import network
import scraper
import urllib
KICKASS_URL = 'http://kickass.so'
################################################################################
def movie(movie_info):
return __search('category:{0} imdb:{1}'.format('movies', movie_info['imdb_id'][2:]))
#################################... | <commit_before>import cache
import network
import scraper
import urllib
KICKASS_URL = 'http://kickass.so'
################################################################################
def movie(movie_info):
return __search('category:{0} imdb:{1}'.format('movies', movie_info['imdb_id'][2:]))
##################... |
21bcb3105c9c3884f2a369a75408d91cdca5992e | tests/core/test_extensions.py | tests/core/test_extensions.py | from __future__ import unicode_literals, print_function, division, absolute_import
from nose.tools import raises
from openfisca_core.parameters import ParameterNode
from openfisca_country_template import CountryTaxBenefitSystem
tbs = CountryTaxBenefitSystem()
def test_extension_not_already_loaded():
assert tbs... | from __future__ import unicode_literals, print_function, division, absolute_import
from nose.tools import raises
from openfisca_core.parameters import ParameterNode
from openfisca_country_template import CountryTaxBenefitSystem
tbs = CountryTaxBenefitSystem()
def test_extension_not_already_loaded():
assert tbs... | Test extension's parameter access for a given period | Test extension's parameter access for a given period
| Python | agpl-3.0 | openfisca/openfisca-core,openfisca/openfisca-core | from __future__ import unicode_literals, print_function, division, absolute_import
from nose.tools import raises
from openfisca_core.parameters import ParameterNode
from openfisca_country_template import CountryTaxBenefitSystem
tbs = CountryTaxBenefitSystem()
def test_extension_not_already_loaded():
assert tbs... | from __future__ import unicode_literals, print_function, division, absolute_import
from nose.tools import raises
from openfisca_core.parameters import ParameterNode
from openfisca_country_template import CountryTaxBenefitSystem
tbs = CountryTaxBenefitSystem()
def test_extension_not_already_loaded():
assert tbs... | <commit_before>from __future__ import unicode_literals, print_function, division, absolute_import
from nose.tools import raises
from openfisca_core.parameters import ParameterNode
from openfisca_country_template import CountryTaxBenefitSystem
tbs = CountryTaxBenefitSystem()
def test_extension_not_already_loaded():... | from __future__ import unicode_literals, print_function, division, absolute_import
from nose.tools import raises
from openfisca_core.parameters import ParameterNode
from openfisca_country_template import CountryTaxBenefitSystem
tbs = CountryTaxBenefitSystem()
def test_extension_not_already_loaded():
assert tbs... | from __future__ import unicode_literals, print_function, division, absolute_import
from nose.tools import raises
from openfisca_core.parameters import ParameterNode
from openfisca_country_template import CountryTaxBenefitSystem
tbs = CountryTaxBenefitSystem()
def test_extension_not_already_loaded():
assert tbs... | <commit_before>from __future__ import unicode_literals, print_function, division, absolute_import
from nose.tools import raises
from openfisca_core.parameters import ParameterNode
from openfisca_country_template import CountryTaxBenefitSystem
tbs = CountryTaxBenefitSystem()
def test_extension_not_already_loaded():... |
513244c067713a9b87f322c50be43643fdcca056 | test/api/test_api.py | test/api/test_api.py | import time
import subprocess
import pytest
import sys
SOURCE = "**"
if len(sys.argv) == 2:
SOURCE = str(sys.argv[1])
start = subprocess.Popen(['make', 'backend'])
time.sleep(5)
process = subprocess.run("pytest augur/datasources/{}/test_{}_routes.py".format(SOURCE, SOURCE), shell=True)
time.sleep(2)
subprocess.Po... | import time
import subprocess
import os
import pytest
import sys
SOURCE = "**"
if len(sys.argv) == 2:
SOURCE = str(sys.argv[1])
FNULL = open(os.devnull, 'w')
start = subprocess.Popen(['augur', 'run'], stdout=FNULL, stderr=subprocess.STDOUT)
time.sleep(20)
process = subprocess.run("pytest augur/datasources/{}/tes... | Refactor API testing script to be consistent with Travis build | Refactor API testing script to be consistent with Travis build
Signed-off-by: Carter Landis <[email protected]>
| Python | mit | OSSHealth/ghdata,OSSHealth/ghdata,OSSHealth/ghdata | import time
import subprocess
import pytest
import sys
SOURCE = "**"
if len(sys.argv) == 2:
SOURCE = str(sys.argv[1])
start = subprocess.Popen(['make', 'backend'])
time.sleep(5)
process = subprocess.run("pytest augur/datasources/{}/test_{}_routes.py".format(SOURCE, SOURCE), shell=True)
time.sleep(2)
subprocess.Po... | import time
import subprocess
import os
import pytest
import sys
SOURCE = "**"
if len(sys.argv) == 2:
SOURCE = str(sys.argv[1])
FNULL = open(os.devnull, 'w')
start = subprocess.Popen(['augur', 'run'], stdout=FNULL, stderr=subprocess.STDOUT)
time.sleep(20)
process = subprocess.run("pytest augur/datasources/{}/tes... | <commit_before>import time
import subprocess
import pytest
import sys
SOURCE = "**"
if len(sys.argv) == 2:
SOURCE = str(sys.argv[1])
start = subprocess.Popen(['make', 'backend'])
time.sleep(5)
process = subprocess.run("pytest augur/datasources/{}/test_{}_routes.py".format(SOURCE, SOURCE), shell=True)
time.sleep(2... | import time
import subprocess
import os
import pytest
import sys
SOURCE = "**"
if len(sys.argv) == 2:
SOURCE = str(sys.argv[1])
FNULL = open(os.devnull, 'w')
start = subprocess.Popen(['augur', 'run'], stdout=FNULL, stderr=subprocess.STDOUT)
time.sleep(20)
process = subprocess.run("pytest augur/datasources/{}/tes... | import time
import subprocess
import pytest
import sys
SOURCE = "**"
if len(sys.argv) == 2:
SOURCE = str(sys.argv[1])
start = subprocess.Popen(['make', 'backend'])
time.sleep(5)
process = subprocess.run("pytest augur/datasources/{}/test_{}_routes.py".format(SOURCE, SOURCE), shell=True)
time.sleep(2)
subprocess.Po... | <commit_before>import time
import subprocess
import pytest
import sys
SOURCE = "**"
if len(sys.argv) == 2:
SOURCE = str(sys.argv[1])
start = subprocess.Popen(['make', 'backend'])
time.sleep(5)
process = subprocess.run("pytest augur/datasources/{}/test_{}_routes.py".format(SOURCE, SOURCE), shell=True)
time.sleep(2... |
c8f1d40f97e0e6be633acec8533f890287ef5200 | server/systeminfo.py | server/systeminfo.py | #!/bin/python3
""" This script contains functions to access various system's info.
Author: Julien Delplanque
"""
import subprocess
def get_uptime():
""" Return the uptime of the system as a str using the command: $ uptime
"""
proc = subprocess.Popen(["uptime"], stdout=subprocess.PIPE, shell=True)
... | #!/bin/python3
""" This script contains functions to access various system's info.
Author: Julien Delplanque
"""
import subprocess
def get_uptime():
""" Return the uptime of the system as a str using the command: $ uptime
"""
proc = subprocess.Popen(["uptime"], stdout=subprocess.PIPE, shell=True)
... | Correct get_uptime function. It didn't extract the uptime correctly. Now it does. | Correct get_uptime function. It didn't extract the uptime correctly. Now it does.
| Python | mit | juliendelplanque/raspirestmonitor | #!/bin/python3
""" This script contains functions to access various system's info.
Author: Julien Delplanque
"""
import subprocess
def get_uptime():
""" Return the uptime of the system as a str using the command: $ uptime
"""
proc = subprocess.Popen(["uptime"], stdout=subprocess.PIPE, shell=True)
... | #!/bin/python3
""" This script contains functions to access various system's info.
Author: Julien Delplanque
"""
import subprocess
def get_uptime():
""" Return the uptime of the system as a str using the command: $ uptime
"""
proc = subprocess.Popen(["uptime"], stdout=subprocess.PIPE, shell=True)
... | <commit_before>#!/bin/python3
""" This script contains functions to access various system's info.
Author: Julien Delplanque
"""
import subprocess
def get_uptime():
""" Return the uptime of the system as a str using the command: $ uptime
"""
proc = subprocess.Popen(["uptime"], stdout=subprocess.PIPE, s... | #!/bin/python3
""" This script contains functions to access various system's info.
Author: Julien Delplanque
"""
import subprocess
def get_uptime():
""" Return the uptime of the system as a str using the command: $ uptime
"""
proc = subprocess.Popen(["uptime"], stdout=subprocess.PIPE, shell=True)
... | #!/bin/python3
""" This script contains functions to access various system's info.
Author: Julien Delplanque
"""
import subprocess
def get_uptime():
""" Return the uptime of the system as a str using the command: $ uptime
"""
proc = subprocess.Popen(["uptime"], stdout=subprocess.PIPE, shell=True)
... | <commit_before>#!/bin/python3
""" This script contains functions to access various system's info.
Author: Julien Delplanque
"""
import subprocess
def get_uptime():
""" Return the uptime of the system as a str using the command: $ uptime
"""
proc = subprocess.Popen(["uptime"], stdout=subprocess.PIPE, s... |
aae2a298d0f5b6e94d4c7041b1cef0df424666a9 | bench_bin.py | bench_bin.py | import socket
import time
import random
import struct
NUM = 1024 * 1024 * 4
KEYS = ["test", "foobar", "zipzap"]
VALS = [32, 100, 82, 101, 5, 6, 42, 73]
BINARY_HEADER = struct.Struct("<BBHd")
BIN_TYPES = {"kv": 1, "c": 2, "ms": 3}
def format(key, type, val):
"Formats a binary message for statsite"
key = str(... | import socket
import time
import random
import struct
NUM = 1024 * 1024
KEYS = ["test", "foobar", "zipzap"]
VALS = [32, 100, 82, 101, 5, 6, 42, 73]
BINARY_HEADER = struct.Struct("<BBHd")
BIN_TYPES = {"kv": 1, "c": 2, "ms": 3}
def format(key, type, val):
"Formats a binary message for statsite"
key = str(key)... | Change binary benchmark to loop forever too | Change binary benchmark to loop forever too
| Python | bsd-3-clause | u-s-p/statsite,statsite/statsite,Instagram/statsite,kuba--/statsite,zeedunk/statsite,nwangtw/statsite,theatrus/statsite,lazybios/statsite,zeedunk/statsite,Instagram/statsite,statsite/statsite,tsunli/statsite,kuba--/statsite,armon/statsite,nspragg/statsite,nspragg/statsite,sleepybishop/statsite,theatrus/statsite,u-s-p/s... | import socket
import time
import random
import struct
NUM = 1024 * 1024 * 4
KEYS = ["test", "foobar", "zipzap"]
VALS = [32, 100, 82, 101, 5, 6, 42, 73]
BINARY_HEADER = struct.Struct("<BBHd")
BIN_TYPES = {"kv": 1, "c": 2, "ms": 3}
def format(key, type, val):
"Formats a binary message for statsite"
key = str(... | import socket
import time
import random
import struct
NUM = 1024 * 1024
KEYS = ["test", "foobar", "zipzap"]
VALS = [32, 100, 82, 101, 5, 6, 42, 73]
BINARY_HEADER = struct.Struct("<BBHd")
BIN_TYPES = {"kv": 1, "c": 2, "ms": 3}
def format(key, type, val):
"Formats a binary message for statsite"
key = str(key)... | <commit_before>import socket
import time
import random
import struct
NUM = 1024 * 1024 * 4
KEYS = ["test", "foobar", "zipzap"]
VALS = [32, 100, 82, 101, 5, 6, 42, 73]
BINARY_HEADER = struct.Struct("<BBHd")
BIN_TYPES = {"kv": 1, "c": 2, "ms": 3}
def format(key, type, val):
"Formats a binary message for statsite"... | import socket
import time
import random
import struct
NUM = 1024 * 1024
KEYS = ["test", "foobar", "zipzap"]
VALS = [32, 100, 82, 101, 5, 6, 42, 73]
BINARY_HEADER = struct.Struct("<BBHd")
BIN_TYPES = {"kv": 1, "c": 2, "ms": 3}
def format(key, type, val):
"Formats a binary message for statsite"
key = str(key)... | import socket
import time
import random
import struct
NUM = 1024 * 1024 * 4
KEYS = ["test", "foobar", "zipzap"]
VALS = [32, 100, 82, 101, 5, 6, 42, 73]
BINARY_HEADER = struct.Struct("<BBHd")
BIN_TYPES = {"kv": 1, "c": 2, "ms": 3}
def format(key, type, val):
"Formats a binary message for statsite"
key = str(... | <commit_before>import socket
import time
import random
import struct
NUM = 1024 * 1024 * 4
KEYS = ["test", "foobar", "zipzap"]
VALS = [32, 100, 82, 101, 5, 6, 42, 73]
BINARY_HEADER = struct.Struct("<BBHd")
BIN_TYPES = {"kv": 1, "c": 2, "ms": 3}
def format(key, type, val):
"Formats a binary message for statsite"... |
be3824f150fc96f10a485b24a93290c6c87afc46 | sotu/github.py | sotu/github.py | import os
import urllib
import requests
GITHUB_BASE_URI = os.environ.get('GITHUB_BASE_URI', 'https://github.com')
GITHUB_API_BASE_URI = os.environ.get('GITHUB_API_BASE_URI', 'https://api.github.com')
GITHUB_CLIENT_ID = os.environ['GITHUB_CLIENT_ID']
GITHUB_CLIENT_SECRET = os.environ['GITHUB_CLIENT_SECRET']
GITHUB_CAL... | import os
import urllib
import requests
GITHUB_BASE_URI = os.environ.get('GITHUB_BASE_URI', 'https://github.com')
GITHUB_API_BASE_URI = os.environ.get('GITHUB_API_BASE_URI', 'https://api.github.com')
GITHUB_CLIENT_ID = os.environ['GITHUB_CLIENT_ID']
GITHUB_CLIENT_SECRET = os.environ['GITHUB_CLIENT_SECRET']
GITHUB_CAL... | Use correct URL for API | [GitHub] Use correct URL for API
| Python | mit | CocoaPods/sotu.cocoapods.org,CocoaPods/sotu.cocoapods.org | import os
import urllib
import requests
GITHUB_BASE_URI = os.environ.get('GITHUB_BASE_URI', 'https://github.com')
GITHUB_API_BASE_URI = os.environ.get('GITHUB_API_BASE_URI', 'https://api.github.com')
GITHUB_CLIENT_ID = os.environ['GITHUB_CLIENT_ID']
GITHUB_CLIENT_SECRET = os.environ['GITHUB_CLIENT_SECRET']
GITHUB_CAL... | import os
import urllib
import requests
GITHUB_BASE_URI = os.environ.get('GITHUB_BASE_URI', 'https://github.com')
GITHUB_API_BASE_URI = os.environ.get('GITHUB_API_BASE_URI', 'https://api.github.com')
GITHUB_CLIENT_ID = os.environ['GITHUB_CLIENT_ID']
GITHUB_CLIENT_SECRET = os.environ['GITHUB_CLIENT_SECRET']
GITHUB_CAL... | <commit_before>import os
import urllib
import requests
GITHUB_BASE_URI = os.environ.get('GITHUB_BASE_URI', 'https://github.com')
GITHUB_API_BASE_URI = os.environ.get('GITHUB_API_BASE_URI', 'https://api.github.com')
GITHUB_CLIENT_ID = os.environ['GITHUB_CLIENT_ID']
GITHUB_CLIENT_SECRET = os.environ['GITHUB_CLIENT_SECR... | import os
import urllib
import requests
GITHUB_BASE_URI = os.environ.get('GITHUB_BASE_URI', 'https://github.com')
GITHUB_API_BASE_URI = os.environ.get('GITHUB_API_BASE_URI', 'https://api.github.com')
GITHUB_CLIENT_ID = os.environ['GITHUB_CLIENT_ID']
GITHUB_CLIENT_SECRET = os.environ['GITHUB_CLIENT_SECRET']
GITHUB_CAL... | import os
import urllib
import requests
GITHUB_BASE_URI = os.environ.get('GITHUB_BASE_URI', 'https://github.com')
GITHUB_API_BASE_URI = os.environ.get('GITHUB_API_BASE_URI', 'https://api.github.com')
GITHUB_CLIENT_ID = os.environ['GITHUB_CLIENT_ID']
GITHUB_CLIENT_SECRET = os.environ['GITHUB_CLIENT_SECRET']
GITHUB_CAL... | <commit_before>import os
import urllib
import requests
GITHUB_BASE_URI = os.environ.get('GITHUB_BASE_URI', 'https://github.com')
GITHUB_API_BASE_URI = os.environ.get('GITHUB_API_BASE_URI', 'https://api.github.com')
GITHUB_CLIENT_ID = os.environ['GITHUB_CLIENT_ID']
GITHUB_CLIENT_SECRET = os.environ['GITHUB_CLIENT_SECR... |
552166a61e66f305b3729718361078558298883b | couchdb/tests/testutil.py | couchdb/tests/testutil.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2009 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
import uuid
from couchdb import client
class TempDatabaseMixin(object):
temp_dbs = None
_d... | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2009 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
import random
import sys
from couchdb import client
class TempDatabaseMixin(object):
temp_dbs ... | Use a random number instead of uuid for temp database name. | Use a random number instead of uuid for temp database name.
| Python | bsd-3-clause | ssaavedra/couchdb-python,oliora/couchdb-python,hdmessaging/couchbase-mapping-python | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2009 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
import uuid
from couchdb import client
class TempDatabaseMixin(object):
temp_dbs = None
_d... | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2009 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
import random
import sys
from couchdb import client
class TempDatabaseMixin(object):
temp_dbs ... | <commit_before># -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2009 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
import uuid
from couchdb import client
class TempDatabaseMixin(object):
temp_db... | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2009 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
import random
import sys
from couchdb import client
class TempDatabaseMixin(object):
temp_dbs ... | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2009 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
import uuid
from couchdb import client
class TempDatabaseMixin(object):
temp_dbs = None
_d... | <commit_before># -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2009 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
import uuid
from couchdb import client
class TempDatabaseMixin(object):
temp_db... |
bd11c37a8669bdae2d4561483f50da0891b82627 | monsetup/detection/plugins/zookeeper.py | monsetup/detection/plugins/zookeeper.py | import logging
import os
import yaml
import monsetup.agent_config
import monsetup.detection
log = logging.getLogger(__name__)
class Zookeeper(monsetup.detection.Plugin):
"""Detect Zookeeper daemons and setup configuration to monitor them.
"""
def _detect(self):
"""Run detection, set self.ava... | import logging
import os
import yaml
import monsetup.agent_config
import monsetup.detection
log = logging.getLogger(__name__)
class Zookeeper(monsetup.detection.Plugin):
"""Detect Zookeeper daemons and setup configuration to monitor them.
"""
def _detect(self):
"""Run detection, set self.ava... | Fix detection of Zookeeper in monasca-setup | Fix detection of Zookeeper in monasca-setup
The Zookeeper detection plugin was looking for zookeeper in the process
command-line. This was producing false positives in the detection
process because storm uses the zookeeper library and it shows up
the command-line for storm.
Change-Id: I764a3064003beec55f0e589272855d... | Python | bsd-3-clause | sapcc/monasca-agent,sapcc/monasca-agent,sapcc/monasca-agent | import logging
import os
import yaml
import monsetup.agent_config
import monsetup.detection
log = logging.getLogger(__name__)
class Zookeeper(monsetup.detection.Plugin):
"""Detect Zookeeper daemons and setup configuration to monitor them.
"""
def _detect(self):
"""Run detection, set self.ava... | import logging
import os
import yaml
import monsetup.agent_config
import monsetup.detection
log = logging.getLogger(__name__)
class Zookeeper(monsetup.detection.Plugin):
"""Detect Zookeeper daemons and setup configuration to monitor them.
"""
def _detect(self):
"""Run detection, set self.ava... | <commit_before>import logging
import os
import yaml
import monsetup.agent_config
import monsetup.detection
log = logging.getLogger(__name__)
class Zookeeper(monsetup.detection.Plugin):
"""Detect Zookeeper daemons and setup configuration to monitor them.
"""
def _detect(self):
"""Run detectio... | import logging
import os
import yaml
import monsetup.agent_config
import monsetup.detection
log = logging.getLogger(__name__)
class Zookeeper(monsetup.detection.Plugin):
"""Detect Zookeeper daemons and setup configuration to monitor them.
"""
def _detect(self):
"""Run detection, set self.ava... | import logging
import os
import yaml
import monsetup.agent_config
import monsetup.detection
log = logging.getLogger(__name__)
class Zookeeper(monsetup.detection.Plugin):
"""Detect Zookeeper daemons and setup configuration to monitor them.
"""
def _detect(self):
"""Run detection, set self.ava... | <commit_before>import logging
import os
import yaml
import monsetup.agent_config
import monsetup.detection
log = logging.getLogger(__name__)
class Zookeeper(monsetup.detection.Plugin):
"""Detect Zookeeper daemons and setup configuration to monitor them.
"""
def _detect(self):
"""Run detectio... |
16703454a9334b6667a761bd52b0a5029e5976b2 | tests/test_api_views.py | tests/test_api_views.py | import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.api.settings")
import django
from django.test import TestCase
from rest_framework.test import APIRequestFactory
from api.webview.views import DocumentList
django.setup()
class APIViewTests(TestCase):
def setUp(self):
self.factory = APIRequ... | import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.api.settings")
import pytest
import django
from django.test import TestCase
from rest_framework.test import APIRequestFactory
from api.webview.views import DocumentList
django.setup()
class APIViewTests(TestCase):
def setUp(self):
self.fac... | Add pytest mark database setup for test | Add pytest mark database setup for test
| Python | apache-2.0 | erinspace/scrapi,felliott/scrapi,fabianvf/scrapi,CenterForOpenScience/scrapi,erinspace/scrapi,fabianvf/scrapi,mehanig/scrapi,CenterForOpenScience/scrapi,mehanig/scrapi,felliott/scrapi | import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.api.settings")
import django
from django.test import TestCase
from rest_framework.test import APIRequestFactory
from api.webview.views import DocumentList
django.setup()
class APIViewTests(TestCase):
def setUp(self):
self.factory = APIRequ... | import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.api.settings")
import pytest
import django
from django.test import TestCase
from rest_framework.test import APIRequestFactory
from api.webview.views import DocumentList
django.setup()
class APIViewTests(TestCase):
def setUp(self):
self.fac... | <commit_before>import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.api.settings")
import django
from django.test import TestCase
from rest_framework.test import APIRequestFactory
from api.webview.views import DocumentList
django.setup()
class APIViewTests(TestCase):
def setUp(self):
self.fa... | import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.api.settings")
import pytest
import django
from django.test import TestCase
from rest_framework.test import APIRequestFactory
from api.webview.views import DocumentList
django.setup()
class APIViewTests(TestCase):
def setUp(self):
self.fac... | import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.api.settings")
import django
from django.test import TestCase
from rest_framework.test import APIRequestFactory
from api.webview.views import DocumentList
django.setup()
class APIViewTests(TestCase):
def setUp(self):
self.factory = APIRequ... | <commit_before>import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.api.settings")
import django
from django.test import TestCase
from rest_framework.test import APIRequestFactory
from api.webview.views import DocumentList
django.setup()
class APIViewTests(TestCase):
def setUp(self):
self.fa... |
7cff4344538c59763560a9a86fda0f464f208b66 | nightreads/user_manager/user_service.py | nightreads/user_manager/user_service.py | from django.contrib.auth.models import User
from nightreads.posts.models import Tag
from .models import UserTag
def update_user_tags(user, tags):
tags_objs = Tag.objects.filter(name__in=tags)
user.usertag.tags.add(*tags_objs)
user.save()
def get_user(email):
user, created = User.objects.get_or_crea... | from django.contrib.auth.models import User
from nightreads.posts.models import Tag
from .models import UserTag
def update_user_tags(user, tags):
tags_objs = Tag.objects.filter(name__in=tags)
if tags_objs:
user.usertag.tags.clear()
user.usertag.tags.add(*tags_objs)
user.save()
def get_u... | Clear existing tags before updating | Clear existing tags before updating
| Python | mit | avinassh/nightreads,avinassh/nightreads | from django.contrib.auth.models import User
from nightreads.posts.models import Tag
from .models import UserTag
def update_user_tags(user, tags):
tags_objs = Tag.objects.filter(name__in=tags)
user.usertag.tags.add(*tags_objs)
user.save()
def get_user(email):
user, created = User.objects.get_or_crea... | from django.contrib.auth.models import User
from nightreads.posts.models import Tag
from .models import UserTag
def update_user_tags(user, tags):
tags_objs = Tag.objects.filter(name__in=tags)
if tags_objs:
user.usertag.tags.clear()
user.usertag.tags.add(*tags_objs)
user.save()
def get_u... | <commit_before>from django.contrib.auth.models import User
from nightreads.posts.models import Tag
from .models import UserTag
def update_user_tags(user, tags):
tags_objs = Tag.objects.filter(name__in=tags)
user.usertag.tags.add(*tags_objs)
user.save()
def get_user(email):
user, created = User.obje... | from django.contrib.auth.models import User
from nightreads.posts.models import Tag
from .models import UserTag
def update_user_tags(user, tags):
tags_objs = Tag.objects.filter(name__in=tags)
if tags_objs:
user.usertag.tags.clear()
user.usertag.tags.add(*tags_objs)
user.save()
def get_u... | from django.contrib.auth.models import User
from nightreads.posts.models import Tag
from .models import UserTag
def update_user_tags(user, tags):
tags_objs = Tag.objects.filter(name__in=tags)
user.usertag.tags.add(*tags_objs)
user.save()
def get_user(email):
user, created = User.objects.get_or_crea... | <commit_before>from django.contrib.auth.models import User
from nightreads.posts.models import Tag
from .models import UserTag
def update_user_tags(user, tags):
tags_objs = Tag.objects.filter(name__in=tags)
user.usertag.tags.add(*tags_objs)
user.save()
def get_user(email):
user, created = User.obje... |
c31d1b9a50452ae1906eca9735cbfb9acd2580dd | src/parse_user_history/history_parser.py | src/parse_user_history/history_parser.py | import os.path
import json
import urlparse
ACCEPTED_FILETYPES = [
'json',
# 'csv'
]
class HistoryParser():
def __init__(self, path):
if not os.path.isfile(path):
raise Exception("File not found.")
if path.split(".")[-1] not in ACCEPTED_FILETYPES:
raise Excep... | import os.path
import json
import urlparse
ACCEPTED_FILETYPES = [
'json',
# 'csv'
]
class HistoryParser():
def __init__(self, path):
if not os.path.isfile(path):
raise Exception("File not found.")
if path.split(".")[-1] not in ACCEPTED_FILETYPES:
raise Excep... | Prepend http to urls in user history | Prepend http to urls in user history
| Python | mit | piatra/ssl-project | import os.path
import json
import urlparse
ACCEPTED_FILETYPES = [
'json',
# 'csv'
]
class HistoryParser():
def __init__(self, path):
if not os.path.isfile(path):
raise Exception("File not found.")
if path.split(".")[-1] not in ACCEPTED_FILETYPES:
raise Excep... | import os.path
import json
import urlparse
ACCEPTED_FILETYPES = [
'json',
# 'csv'
]
class HistoryParser():
def __init__(self, path):
if not os.path.isfile(path):
raise Exception("File not found.")
if path.split(".")[-1] not in ACCEPTED_FILETYPES:
raise Excep... | <commit_before>import os.path
import json
import urlparse
ACCEPTED_FILETYPES = [
'json',
# 'csv'
]
class HistoryParser():
def __init__(self, path):
if not os.path.isfile(path):
raise Exception("File not found.")
if path.split(".")[-1] not in ACCEPTED_FILETYPES:
... | import os.path
import json
import urlparse
ACCEPTED_FILETYPES = [
'json',
# 'csv'
]
class HistoryParser():
def __init__(self, path):
if not os.path.isfile(path):
raise Exception("File not found.")
if path.split(".")[-1] not in ACCEPTED_FILETYPES:
raise Excep... | import os.path
import json
import urlparse
ACCEPTED_FILETYPES = [
'json',
# 'csv'
]
class HistoryParser():
def __init__(self, path):
if not os.path.isfile(path):
raise Exception("File not found.")
if path.split(".")[-1] not in ACCEPTED_FILETYPES:
raise Excep... | <commit_before>import os.path
import json
import urlparse
ACCEPTED_FILETYPES = [
'json',
# 'csv'
]
class HistoryParser():
def __init__(self, path):
if not os.path.isfile(path):
raise Exception("File not found.")
if path.split(".")[-1] not in ACCEPTED_FILETYPES:
... |
1cafb39b6204010d3e17b059254af6042f4a9efc | apts/__init__.py | apts/__init__.py | import os
import shutil
import configparser
from .equipment import Equipment
from .observations import Observation
from .place import Place
from .weather import Weather
from .notify import Notify
from .catalogs import Catalogs
from .utils import Utils
user_config = os.path.expanduser("~") + "/.config/apts/apts.ini"
... | import os
import shutil
import configparser
from .equipment import Equipment
from .observations import Observation
from .place import Place
from .weather import Weather
from .notify import Notify
from .catalogs import Catalogs
from .utils import Utils
# Default values for configuration values
DEFAULTS = {
'weathe... | Add default values for config | Add default values for config
| Python | apache-2.0 | pozar87/apts | import os
import shutil
import configparser
from .equipment import Equipment
from .observations import Observation
from .place import Place
from .weather import Weather
from .notify import Notify
from .catalogs import Catalogs
from .utils import Utils
user_config = os.path.expanduser("~") + "/.config/apts/apts.ini"
... | import os
import shutil
import configparser
from .equipment import Equipment
from .observations import Observation
from .place import Place
from .weather import Weather
from .notify import Notify
from .catalogs import Catalogs
from .utils import Utils
# Default values for configuration values
DEFAULTS = {
'weathe... | <commit_before>import os
import shutil
import configparser
from .equipment import Equipment
from .observations import Observation
from .place import Place
from .weather import Weather
from .notify import Notify
from .catalogs import Catalogs
from .utils import Utils
user_config = os.path.expanduser("~") + "/.config/a... | import os
import shutil
import configparser
from .equipment import Equipment
from .observations import Observation
from .place import Place
from .weather import Weather
from .notify import Notify
from .catalogs import Catalogs
from .utils import Utils
# Default values for configuration values
DEFAULTS = {
'weathe... | import os
import shutil
import configparser
from .equipment import Equipment
from .observations import Observation
from .place import Place
from .weather import Weather
from .notify import Notify
from .catalogs import Catalogs
from .utils import Utils
user_config = os.path.expanduser("~") + "/.config/apts/apts.ini"
... | <commit_before>import os
import shutil
import configparser
from .equipment import Equipment
from .observations import Observation
from .place import Place
from .weather import Weather
from .notify import Notify
from .catalogs import Catalogs
from .utils import Utils
user_config = os.path.expanduser("~") + "/.config/a... |
52648b65d5920e3c87cfbdd0d71d4d91302b3991 | calaccess_raw/admin/tracking.py | calaccess_raw/admin/tracking.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Custom administration panels for tracking models.
"""
from __future__ import unicode_literals
from django.contrib import admin
from calaccess_raw import models
from .base import BaseAdmin
@admin.register(models.RawDataVersion)
class RawDataVersionAdmin(BaseAdmin):
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Custom administration panels for tracking models.
"""
from __future__ import unicode_literals
from django.contrib import admin
from calaccess_raw import models
from .base import BaseAdmin
@admin.register(models.RawDataVersion)
class RawDataVersionAdmin(BaseAdmin):
... | Update count fields on RawDataVersionAdmin | Update count fields on RawDataVersionAdmin
| Python | mit | california-civic-data-coalition/django-calaccess-raw-data | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Custom administration panels for tracking models.
"""
from __future__ import unicode_literals
from django.contrib import admin
from calaccess_raw import models
from .base import BaseAdmin
@admin.register(models.RawDataVersion)
class RawDataVersionAdmin(BaseAdmin):
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Custom administration panels for tracking models.
"""
from __future__ import unicode_literals
from django.contrib import admin
from calaccess_raw import models
from .base import BaseAdmin
@admin.register(models.RawDataVersion)
class RawDataVersionAdmin(BaseAdmin):
... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Custom administration panels for tracking models.
"""
from __future__ import unicode_literals
from django.contrib import admin
from calaccess_raw import models
from .base import BaseAdmin
@admin.register(models.RawDataVersion)
class RawDataVersionAdmin(... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Custom administration panels for tracking models.
"""
from __future__ import unicode_literals
from django.contrib import admin
from calaccess_raw import models
from .base import BaseAdmin
@admin.register(models.RawDataVersion)
class RawDataVersionAdmin(BaseAdmin):
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Custom administration panels for tracking models.
"""
from __future__ import unicode_literals
from django.contrib import admin
from calaccess_raw import models
from .base import BaseAdmin
@admin.register(models.RawDataVersion)
class RawDataVersionAdmin(BaseAdmin):
... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Custom administration panels for tracking models.
"""
from __future__ import unicode_literals
from django.contrib import admin
from calaccess_raw import models
from .base import BaseAdmin
@admin.register(models.RawDataVersion)
class RawDataVersionAdmin(... |
d4c0a8d0077439adb1e074e6f6e1a1e8b751a804 | serfnode/handler/config.py | serfnode/handler/config.py | import os
import uuid
from mischief.actors.pipe import get_local_ip
import yaml
def read_serfnode_yml():
with open('/serfnode.yml') as input:
conf = yaml.load(input) or {}
return conf['serfnode']
yml = read_serfnode_yml()
role = os.environ.get('ROLE') or yml.get('ROLE') or 'no_role'
peer = os... | import os
import uuid
from mischief.actors.pipe import get_local_ip
import yaml
def read_serfnode_yml():
with open('/serfnode.yml') as input:
conf = yaml.load(input) or {}
return conf.get('serfnode', {})
yml = read_serfnode_yml()
role = os.environ.get('ROLE') or yml.get('ROLE') or 'no_role'
p... | Fix handling of empty file | Fix handling of empty file | Python | mit | waltermoreira/serfnode,waltermoreira/serfnode,waltermoreira/serfnode | import os
import uuid
from mischief.actors.pipe import get_local_ip
import yaml
def read_serfnode_yml():
with open('/serfnode.yml') as input:
conf = yaml.load(input) or {}
return conf['serfnode']
yml = read_serfnode_yml()
role = os.environ.get('ROLE') or yml.get('ROLE') or 'no_role'
peer = os... | import os
import uuid
from mischief.actors.pipe import get_local_ip
import yaml
def read_serfnode_yml():
with open('/serfnode.yml') as input:
conf = yaml.load(input) or {}
return conf.get('serfnode', {})
yml = read_serfnode_yml()
role = os.environ.get('ROLE') or yml.get('ROLE') or 'no_role'
p... | <commit_before>import os
import uuid
from mischief.actors.pipe import get_local_ip
import yaml
def read_serfnode_yml():
with open('/serfnode.yml') as input:
conf = yaml.load(input) or {}
return conf['serfnode']
yml = read_serfnode_yml()
role = os.environ.get('ROLE') or yml.get('ROLE') or 'no_... | import os
import uuid
from mischief.actors.pipe import get_local_ip
import yaml
def read_serfnode_yml():
with open('/serfnode.yml') as input:
conf = yaml.load(input) or {}
return conf.get('serfnode', {})
yml = read_serfnode_yml()
role = os.environ.get('ROLE') or yml.get('ROLE') or 'no_role'
p... | import os
import uuid
from mischief.actors.pipe import get_local_ip
import yaml
def read_serfnode_yml():
with open('/serfnode.yml') as input:
conf = yaml.load(input) or {}
return conf['serfnode']
yml = read_serfnode_yml()
role = os.environ.get('ROLE') or yml.get('ROLE') or 'no_role'
peer = os... | <commit_before>import os
import uuid
from mischief.actors.pipe import get_local_ip
import yaml
def read_serfnode_yml():
with open('/serfnode.yml') as input:
conf = yaml.load(input) or {}
return conf['serfnode']
yml = read_serfnode_yml()
role = os.environ.get('ROLE') or yml.get('ROLE') or 'no_... |
e033fa49673cdc1b682edcc2aaf1e140a73ab1b4 | src/wirecloud/platform/context/models.py | src/wirecloud/platform/context/models.py | # -*- coding: utf-8 -*-
# Copyright 2013 Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... | # -*- coding: utf-8 -*-
# Copyright 2013 Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... | Remove scope attribute from Constant | Remove scope attribute from Constant
| Python | agpl-3.0 | rockneurotiko/wirecloud,rockneurotiko/wirecloud,jpajuelo/wirecloud,jpajuelo/wirecloud,rockneurotiko/wirecloud,jpajuelo/wirecloud,jpajuelo/wirecloud,rockneurotiko/wirecloud | # -*- coding: utf-8 -*-
# Copyright 2013 Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... | # -*- coding: utf-8 -*-
# Copyright 2013 Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... | <commit_before># -*- coding: utf-8 -*-
# Copyright 2013 Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of th... | # -*- coding: utf-8 -*-
# Copyright 2013 Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... | # -*- coding: utf-8 -*-
# Copyright 2013 Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... | <commit_before># -*- coding: utf-8 -*-
# Copyright 2013 Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of th... |
53cae8a7d95832a0f95a537468552254028a0668 | tests/system/test_auth.py | tests/system/test_auth.py | import pytest
from inbox.models.session import session_scope
from client import InboxTestClient
from conftest import (timeout_loop, credentials, create_account, API_BASE)
@timeout_loop('sync_start')
def wait_for_sync_start(client):
return True if client.messages.first() else False
@timeout_loop('auth')
def wai... | import pytest
from inbox.models.session import session_scope
from client import InboxTestClient
from conftest import (timeout_loop, credentials, create_account, API_BASE)
from accounts import broken_credentials
@timeout_loop('sync_start')
def wait_for_sync_start(client):
return True if client.messages.first() el... | Add a system test to check for expected broken accounts | Add a system test to check for expected broken accounts
Summary:
This is the system test for D765 and finishes up the sync engine side
of T495 - checking for All Mail folder and failing gracefully if it's
absent.
This test specifically adds another check in `test_auth` based on a
new list of live, bad credentials in ... | Python | agpl-3.0 | gale320/sync-engine,Eagles2F/sync-engine,wakermahmud/sync-engine,nylas/sync-engine,ErinCall/sync-engine,wakermahmud/sync-engine,EthanBlackburn/sync-engine,closeio/nylas,jobscore/sync-engine,jobscore/sync-engine,Eagles2F/sync-engine,wakermahmud/sync-engine,closeio/nylas,nylas/sync-engine,EthanBlackburn/sync-engine,waker... | import pytest
from inbox.models.session import session_scope
from client import InboxTestClient
from conftest import (timeout_loop, credentials, create_account, API_BASE)
@timeout_loop('sync_start')
def wait_for_sync_start(client):
return True if client.messages.first() else False
@timeout_loop('auth')
def wai... | import pytest
from inbox.models.session import session_scope
from client import InboxTestClient
from conftest import (timeout_loop, credentials, create_account, API_BASE)
from accounts import broken_credentials
@timeout_loop('sync_start')
def wait_for_sync_start(client):
return True if client.messages.first() el... | <commit_before>import pytest
from inbox.models.session import session_scope
from client import InboxTestClient
from conftest import (timeout_loop, credentials, create_account, API_BASE)
@timeout_loop('sync_start')
def wait_for_sync_start(client):
return True if client.messages.first() else False
@timeout_loop(... | import pytest
from inbox.models.session import session_scope
from client import InboxTestClient
from conftest import (timeout_loop, credentials, create_account, API_BASE)
from accounts import broken_credentials
@timeout_loop('sync_start')
def wait_for_sync_start(client):
return True if client.messages.first() el... | import pytest
from inbox.models.session import session_scope
from client import InboxTestClient
from conftest import (timeout_loop, credentials, create_account, API_BASE)
@timeout_loop('sync_start')
def wait_for_sync_start(client):
return True if client.messages.first() else False
@timeout_loop('auth')
def wai... | <commit_before>import pytest
from inbox.models.session import session_scope
from client import InboxTestClient
from conftest import (timeout_loop, credentials, create_account, API_BASE)
@timeout_loop('sync_start')
def wait_for_sync_start(client):
return True if client.messages.first() else False
@timeout_loop(... |
8d9b163b73da8c498793cce2f22f6a7cbe524d94 | bucketcache/__init__.py | bucketcache/__init__.py | from __future__ import absolute_import, division, print_function
from .backends import *
from .buckets import *
from .config import *
from .exceptions import *
from .keymakers import *
from .log import logger, logger_config
from .utilities import *
__all__ = (backends.__all__ + buckets.__all__ + config.__all__ +
... | from __future__ import absolute_import, division, print_function
from .backends import *
from .buckets import *
from .config import *
from .exceptions import *
from .keymakers import *
from .log import logger, logger_config
from .utilities import *
__all__ = (backends.__all__ + buckets.__all__ + config.__all__ +
... | BUmp version number to 0.12.1 | BUmp version number to 0.12.1
| Python | mit | RazerM/bucketcache | from __future__ import absolute_import, division, print_function
from .backends import *
from .buckets import *
from .config import *
from .exceptions import *
from .keymakers import *
from .log import logger, logger_config
from .utilities import *
__all__ = (backends.__all__ + buckets.__all__ + config.__all__ +
... | from __future__ import absolute_import, division, print_function
from .backends import *
from .buckets import *
from .config import *
from .exceptions import *
from .keymakers import *
from .log import logger, logger_config
from .utilities import *
__all__ = (backends.__all__ + buckets.__all__ + config.__all__ +
... | <commit_before>from __future__ import absolute_import, division, print_function
from .backends import *
from .buckets import *
from .config import *
from .exceptions import *
from .keymakers import *
from .log import logger, logger_config
from .utilities import *
__all__ = (backends.__all__ + buckets.__all__ + config... | from __future__ import absolute_import, division, print_function
from .backends import *
from .buckets import *
from .config import *
from .exceptions import *
from .keymakers import *
from .log import logger, logger_config
from .utilities import *
__all__ = (backends.__all__ + buckets.__all__ + config.__all__ +
... | from __future__ import absolute_import, division, print_function
from .backends import *
from .buckets import *
from .config import *
from .exceptions import *
from .keymakers import *
from .log import logger, logger_config
from .utilities import *
__all__ = (backends.__all__ + buckets.__all__ + config.__all__ +
... | <commit_before>from __future__ import absolute_import, division, print_function
from .backends import *
from .buckets import *
from .config import *
from .exceptions import *
from .keymakers import *
from .log import logger, logger_config
from .utilities import *
__all__ = (backends.__all__ + buckets.__all__ + config... |
b777c8268ec661539f868937478c3bbc204f2fb3 | tests/test_RI_response.py | tests/test_RI_response.py | from addons import *
from utils import *
tdir = 'Response-Theory'
def test_beta(workspace):
exe_py(workspace, tdir, 'Self-Consistent-Field/beta')
def test_CPHF(workspace):
exe_py(workspace, tdir, 'Self-Consistent-Field/CPHF')
def test_helper_CPHF(workspace):
exe_py(workspace, tdir, 'Self-Consistent-... | from addons import *
from utils import *
tdir = 'Response-Theory'
def test_beta(workspace):
exe_py(workspace, tdir, 'Self-Consistent-Field/beta')
def test_CPHF(workspace):
exe_py(workspace, tdir, 'Self-Consistent-Field/CPHF')
def test_helper_CPHF(workspace):
exe_py(workspace, tdir, 'Self-Consistent-... | Use integral derivative decorator for test | Use integral derivative decorator for test
| Python | bsd-3-clause | dsirianni/psi4numpy,psi4/psi4numpy | from addons import *
from utils import *
tdir = 'Response-Theory'
def test_beta(workspace):
exe_py(workspace, tdir, 'Self-Consistent-Field/beta')
def test_CPHF(workspace):
exe_py(workspace, tdir, 'Self-Consistent-Field/CPHF')
def test_helper_CPHF(workspace):
exe_py(workspace, tdir, 'Self-Consistent-... | from addons import *
from utils import *
tdir = 'Response-Theory'
def test_beta(workspace):
exe_py(workspace, tdir, 'Self-Consistent-Field/beta')
def test_CPHF(workspace):
exe_py(workspace, tdir, 'Self-Consistent-Field/CPHF')
def test_helper_CPHF(workspace):
exe_py(workspace, tdir, 'Self-Consistent-... | <commit_before>from addons import *
from utils import *
tdir = 'Response-Theory'
def test_beta(workspace):
exe_py(workspace, tdir, 'Self-Consistent-Field/beta')
def test_CPHF(workspace):
exe_py(workspace, tdir, 'Self-Consistent-Field/CPHF')
def test_helper_CPHF(workspace):
exe_py(workspace, tdir, 'S... | from addons import *
from utils import *
tdir = 'Response-Theory'
def test_beta(workspace):
exe_py(workspace, tdir, 'Self-Consistent-Field/beta')
def test_CPHF(workspace):
exe_py(workspace, tdir, 'Self-Consistent-Field/CPHF')
def test_helper_CPHF(workspace):
exe_py(workspace, tdir, 'Self-Consistent-... | from addons import *
from utils import *
tdir = 'Response-Theory'
def test_beta(workspace):
exe_py(workspace, tdir, 'Self-Consistent-Field/beta')
def test_CPHF(workspace):
exe_py(workspace, tdir, 'Self-Consistent-Field/CPHF')
def test_helper_CPHF(workspace):
exe_py(workspace, tdir, 'Self-Consistent-... | <commit_before>from addons import *
from utils import *
tdir = 'Response-Theory'
def test_beta(workspace):
exe_py(workspace, tdir, 'Self-Consistent-Field/beta')
def test_CPHF(workspace):
exe_py(workspace, tdir, 'Self-Consistent-Field/CPHF')
def test_helper_CPHF(workspace):
exe_py(workspace, tdir, 'S... |
f5227b573588f6258b22c15583dc1d0ee259a9db | aiopg/__init__.py | aiopg/__init__.py | import re
import sys
from collections import namedtuple
from .connection import connect, Connection, TIMEOUT as DEFAULT_TIMEOUT
from .cursor import Cursor
from .pool import create_pool, Pool
__all__ = ('connect', 'create_pool', 'Connection', 'Cursor', 'Pool',
'version', 'version_info', 'DEFAULT_TIMEOUT')
... | import re
import sys
from collections import namedtuple
from .connection import connect, Connection, TIMEOUT as DEFAULT_TIMEOUT
from .cursor import Cursor
from .pool import create_pool, Pool
__all__ = ('connect', 'create_pool', 'Connection', 'Cursor', 'Pool',
'version', 'version_info', 'DEFAULT_TIMEOUT')
... | Make version format PEP 440 compatible | Make version format PEP 440 compatible
| Python | bsd-2-clause | nerandell/aiopg,hyzhak/aiopg,luhn/aiopg,aio-libs/aiopg,eirnym/aiopg,graingert/aiopg | import re
import sys
from collections import namedtuple
from .connection import connect, Connection, TIMEOUT as DEFAULT_TIMEOUT
from .cursor import Cursor
from .pool import create_pool, Pool
__all__ = ('connect', 'create_pool', 'Connection', 'Cursor', 'Pool',
'version', 'version_info', 'DEFAULT_TIMEOUT')
... | import re
import sys
from collections import namedtuple
from .connection import connect, Connection, TIMEOUT as DEFAULT_TIMEOUT
from .cursor import Cursor
from .pool import create_pool, Pool
__all__ = ('connect', 'create_pool', 'Connection', 'Cursor', 'Pool',
'version', 'version_info', 'DEFAULT_TIMEOUT')
... | <commit_before>import re
import sys
from collections import namedtuple
from .connection import connect, Connection, TIMEOUT as DEFAULT_TIMEOUT
from .cursor import Cursor
from .pool import create_pool, Pool
__all__ = ('connect', 'create_pool', 'Connection', 'Cursor', 'Pool',
'version', 'version_info', 'DEF... | import re
import sys
from collections import namedtuple
from .connection import connect, Connection, TIMEOUT as DEFAULT_TIMEOUT
from .cursor import Cursor
from .pool import create_pool, Pool
__all__ = ('connect', 'create_pool', 'Connection', 'Cursor', 'Pool',
'version', 'version_info', 'DEFAULT_TIMEOUT')
... | import re
import sys
from collections import namedtuple
from .connection import connect, Connection, TIMEOUT as DEFAULT_TIMEOUT
from .cursor import Cursor
from .pool import create_pool, Pool
__all__ = ('connect', 'create_pool', 'Connection', 'Cursor', 'Pool',
'version', 'version_info', 'DEFAULT_TIMEOUT')
... | <commit_before>import re
import sys
from collections import namedtuple
from .connection import connect, Connection, TIMEOUT as DEFAULT_TIMEOUT
from .cursor import Cursor
from .pool import create_pool, Pool
__all__ = ('connect', 'create_pool', 'Connection', 'Cursor', 'Pool',
'version', 'version_info', 'DEF... |
78cfcc7520bc2b2006f22ac4ef4fb432770c835c | bootstrap.py | bootstrap.py | #!/usr/bin/env python
"""
Bootstrap and serve your application. This file also serves to not make your
application completely reliant upon DotCloud's hosting service.
If you're in a development environment, envoke the script with:
$ python bootstrap.py
In a production environment, your application can be run wit... | #!/usr/bin/env python
"""
Bootstrap and serve your application. This file also serves to not make your
application completely reliant upon DotCloud's hosting service.
If you're in a development environment, envoke the script with:
$ python bootstrap.py
In a production environment, your application can be run wit... | Allow Flask to get port from heroku environment | Allow Flask to get port from heroku environment
| Python | mit | Leonnash21/flask_heroku,Leonnash21/flask_heroku,QueryControl/querycontrol,Leonnash21/flask_heroku,bryanyang0528/ubike_api,pmrowla/goonbcs,QueryControl/querycontrol,Leonnash21/flask_heroku,bryanyang0528/ubike_api,Leonnash21/flask_heroku,pmrowla/goonbcs,QueryControl/querycontrol,bryanyang0528/ubike_api | #!/usr/bin/env python
"""
Bootstrap and serve your application. This file also serves to not make your
application completely reliant upon DotCloud's hosting service.
If you're in a development environment, envoke the script with:
$ python bootstrap.py
In a production environment, your application can be run wit... | #!/usr/bin/env python
"""
Bootstrap and serve your application. This file also serves to not make your
application completely reliant upon DotCloud's hosting service.
If you're in a development environment, envoke the script with:
$ python bootstrap.py
In a production environment, your application can be run wit... | <commit_before>#!/usr/bin/env python
"""
Bootstrap and serve your application. This file also serves to not make your
application completely reliant upon DotCloud's hosting service.
If you're in a development environment, envoke the script with:
$ python bootstrap.py
In a production environment, your application... | #!/usr/bin/env python
"""
Bootstrap and serve your application. This file also serves to not make your
application completely reliant upon DotCloud's hosting service.
If you're in a development environment, envoke the script with:
$ python bootstrap.py
In a production environment, your application can be run wit... | #!/usr/bin/env python
"""
Bootstrap and serve your application. This file also serves to not make your
application completely reliant upon DotCloud's hosting service.
If you're in a development environment, envoke the script with:
$ python bootstrap.py
In a production environment, your application can be run wit... | <commit_before>#!/usr/bin/env python
"""
Bootstrap and serve your application. This file also serves to not make your
application completely reliant upon DotCloud's hosting service.
If you're in a development environment, envoke the script with:
$ python bootstrap.py
In a production environment, your application... |
429ffd7f41dda00f662167f179aea73b7d018807 | pi_setup/system.py | pi_setup/system.py | #!/usr/bin/env python
import subprocess
def main():
subprocess.call(["apt-get", "update"])
subprocess.call(["apt-get", "-y", "upgrade"])
subprocess.call(["apt-get", "-y", "install", "python-dev"])
subprocess.call(["apt-get", "-y", "install", "python-pip"])
subprocess.call(["apt-get", "-y", "instal... | #!/usr/bin/env python
import subprocess
from utils.installation import OptionalInstall
def main():
subprocess.call(["apt-get", "update"])
subprocess.call(["apt-get", "-y", "upgrade"])
subprocess.call(["apt-get", "-y", "install", "python-dev"])
subprocess.call(["apt-get", "-y", "install", "python-pip"]... | Make upstart an optional install | Make upstart an optional install
| Python | mit | projectweekend/Pi-Setup,projectweekend/Pi-Setup | #!/usr/bin/env python
import subprocess
def main():
subprocess.call(["apt-get", "update"])
subprocess.call(["apt-get", "-y", "upgrade"])
subprocess.call(["apt-get", "-y", "install", "python-dev"])
subprocess.call(["apt-get", "-y", "install", "python-pip"])
subprocess.call(["apt-get", "-y", "instal... | #!/usr/bin/env python
import subprocess
from utils.installation import OptionalInstall
def main():
subprocess.call(["apt-get", "update"])
subprocess.call(["apt-get", "-y", "upgrade"])
subprocess.call(["apt-get", "-y", "install", "python-dev"])
subprocess.call(["apt-get", "-y", "install", "python-pip"]... | <commit_before>#!/usr/bin/env python
import subprocess
def main():
subprocess.call(["apt-get", "update"])
subprocess.call(["apt-get", "-y", "upgrade"])
subprocess.call(["apt-get", "-y", "install", "python-dev"])
subprocess.call(["apt-get", "-y", "install", "python-pip"])
subprocess.call(["apt-get"... | #!/usr/bin/env python
import subprocess
from utils.installation import OptionalInstall
def main():
subprocess.call(["apt-get", "update"])
subprocess.call(["apt-get", "-y", "upgrade"])
subprocess.call(["apt-get", "-y", "install", "python-dev"])
subprocess.call(["apt-get", "-y", "install", "python-pip"]... | #!/usr/bin/env python
import subprocess
def main():
subprocess.call(["apt-get", "update"])
subprocess.call(["apt-get", "-y", "upgrade"])
subprocess.call(["apt-get", "-y", "install", "python-dev"])
subprocess.call(["apt-get", "-y", "install", "python-pip"])
subprocess.call(["apt-get", "-y", "instal... | <commit_before>#!/usr/bin/env python
import subprocess
def main():
subprocess.call(["apt-get", "update"])
subprocess.call(["apt-get", "-y", "upgrade"])
subprocess.call(["apt-get", "-y", "install", "python-dev"])
subprocess.call(["apt-get", "-y", "install", "python-pip"])
subprocess.call(["apt-get"... |
6d6394dd9917bdc97988818d7eb358b7d92d53c4 | pythonforandroid/recipes/android/src/setup.py | pythonforandroid/recipes/android/src/setup.py | from distutils.core import setup, Extension
import os
library_dirs = ['libs/' + os.environ['ARCH']]
lib_dict = {
'pygame': ['sdl'],
'sdl2': ['SDL2', 'SDL2_image', 'SDL2_mixer', 'SDL2_ttf']
}
sdl_libs = lib_dict[os.environ['BOOTSTRAP']]
renpy_sound = Extension('android._android_sound',
... | from distutils.core import setup, Extension
import os
library_dirs = ['libs/' + os.environ['ARCH']]
lib_dict = {
'pygame': ['sdl'],
'sdl2': ['SDL2', 'SDL2_image', 'SDL2_mixer', 'SDL2_ttf']
}
sdl_libs = lib_dict.get(os.environ['BOOTSTRAP'], [])
renpy_sound = Extension('android._android_sound',
... | Fix compile error of recipe "android" for non-sdl bootstrap build | Fix compile error of recipe "android" for non-sdl bootstrap build
| Python | mit | rnixx/python-for-android,kronenpj/python-for-android,rnixx/python-for-android,PKRoma/python-for-android,kronenpj/python-for-android,kronenpj/python-for-android,rnixx/python-for-android,kivy/python-for-android,PKRoma/python-for-android,PKRoma/python-for-android,rnixx/python-for-android,kivy/python-for-android,rnixx/pyth... | from distutils.core import setup, Extension
import os
library_dirs = ['libs/' + os.environ['ARCH']]
lib_dict = {
'pygame': ['sdl'],
'sdl2': ['SDL2', 'SDL2_image', 'SDL2_mixer', 'SDL2_ttf']
}
sdl_libs = lib_dict[os.environ['BOOTSTRAP']]
renpy_sound = Extension('android._android_sound',
... | from distutils.core import setup, Extension
import os
library_dirs = ['libs/' + os.environ['ARCH']]
lib_dict = {
'pygame': ['sdl'],
'sdl2': ['SDL2', 'SDL2_image', 'SDL2_mixer', 'SDL2_ttf']
}
sdl_libs = lib_dict.get(os.environ['BOOTSTRAP'], [])
renpy_sound = Extension('android._android_sound',
... | <commit_before>from distutils.core import setup, Extension
import os
library_dirs = ['libs/' + os.environ['ARCH']]
lib_dict = {
'pygame': ['sdl'],
'sdl2': ['SDL2', 'SDL2_image', 'SDL2_mixer', 'SDL2_ttf']
}
sdl_libs = lib_dict[os.environ['BOOTSTRAP']]
renpy_sound = Extension('android._android_sound',
... | from distutils.core import setup, Extension
import os
library_dirs = ['libs/' + os.environ['ARCH']]
lib_dict = {
'pygame': ['sdl'],
'sdl2': ['SDL2', 'SDL2_image', 'SDL2_mixer', 'SDL2_ttf']
}
sdl_libs = lib_dict.get(os.environ['BOOTSTRAP'], [])
renpy_sound = Extension('android._android_sound',
... | from distutils.core import setup, Extension
import os
library_dirs = ['libs/' + os.environ['ARCH']]
lib_dict = {
'pygame': ['sdl'],
'sdl2': ['SDL2', 'SDL2_image', 'SDL2_mixer', 'SDL2_ttf']
}
sdl_libs = lib_dict[os.environ['BOOTSTRAP']]
renpy_sound = Extension('android._android_sound',
... | <commit_before>from distutils.core import setup, Extension
import os
library_dirs = ['libs/' + os.environ['ARCH']]
lib_dict = {
'pygame': ['sdl'],
'sdl2': ['SDL2', 'SDL2_image', 'SDL2_mixer', 'SDL2_ttf']
}
sdl_libs = lib_dict[os.environ['BOOTSTRAP']]
renpy_sound = Extension('android._android_sound',
... |
b6ab579fa65f816704142716fbd68645ac5f2ff8 | zenaida/contrib/feedback/models.py | zenaida/contrib/feedback/models.py | from django.conf import settings
from django.db import models
class FeedbackItem(models.Model):
timestamp = models.DateTimeField(auto_now_add=True)
user = models.ForeignKey(settings.AUTH_USER_MODEL)
resolved = models.BooleanField(default=False)
content = models.TextField()
screenshot = models.File... | from django.conf import settings
from django.db import models
class FeedbackItem(models.Model):
timestamp = models.DateTimeField(auto_now_add=True)
user = models.ForeignKey(settings.AUTH_USER_MODEL)
resolved = models.BooleanField(default=False)
content = models.TextField()
screenshot = models.File... | Order feedback items by their timestamp. | Order feedback items by their timestamp.
| Python | bsd-3-clause | littleweaver/django-zenaida,littleweaver/django-zenaida,littleweaver/django-zenaida,littleweaver/django-zenaida | from django.conf import settings
from django.db import models
class FeedbackItem(models.Model):
timestamp = models.DateTimeField(auto_now_add=True)
user = models.ForeignKey(settings.AUTH_USER_MODEL)
resolved = models.BooleanField(default=False)
content = models.TextField()
screenshot = models.File... | from django.conf import settings
from django.db import models
class FeedbackItem(models.Model):
timestamp = models.DateTimeField(auto_now_add=True)
user = models.ForeignKey(settings.AUTH_USER_MODEL)
resolved = models.BooleanField(default=False)
content = models.TextField()
screenshot = models.File... | <commit_before>from django.conf import settings
from django.db import models
class FeedbackItem(models.Model):
timestamp = models.DateTimeField(auto_now_add=True)
user = models.ForeignKey(settings.AUTH_USER_MODEL)
resolved = models.BooleanField(default=False)
content = models.TextField()
screensho... | from django.conf import settings
from django.db import models
class FeedbackItem(models.Model):
timestamp = models.DateTimeField(auto_now_add=True)
user = models.ForeignKey(settings.AUTH_USER_MODEL)
resolved = models.BooleanField(default=False)
content = models.TextField()
screenshot = models.File... | from django.conf import settings
from django.db import models
class FeedbackItem(models.Model):
timestamp = models.DateTimeField(auto_now_add=True)
user = models.ForeignKey(settings.AUTH_USER_MODEL)
resolved = models.BooleanField(default=False)
content = models.TextField()
screenshot = models.File... | <commit_before>from django.conf import settings
from django.db import models
class FeedbackItem(models.Model):
timestamp = models.DateTimeField(auto_now_add=True)
user = models.ForeignKey(settings.AUTH_USER_MODEL)
resolved = models.BooleanField(default=False)
content = models.TextField()
screensho... |
9ac802f89f8c00dc3f0c4534d234c1dd1dc7a203 | c3py/chart_component.py | c3py/chart_component.py | class ChartComponent(object):
def __init__(self):
self.config = {}
def __string_wrap__(self, string_to_wrap):
return "'" + string_to_wrap + "'"
class ChartComponentDict(ChartComponent):
def __init__(self):
super(ChartComponentDict, self).__init__()
class ChartCompon... | class ChartComponent(object):
def __init__(self):
self.config = {}
def __string_wrap__(self, string_to_wrap):
return "'" + str(string_to_wrap) + "'"
class ChartComponentDict(ChartComponent):
def __init__(self):
super(ChartComponentDict, self).__init__()
class ChartC... | Enforce string before wrapping in quotation marks | Enforce string before wrapping in quotation marks
| Python | mit | h0s/c3py,harshil-shah/c3py,harshil-shah/c3py,h0s/c3py | class ChartComponent(object):
def __init__(self):
self.config = {}
def __string_wrap__(self, string_to_wrap):
return "'" + string_to_wrap + "'"
class ChartComponentDict(ChartComponent):
def __init__(self):
super(ChartComponentDict, self).__init__()
class ChartCompon... | class ChartComponent(object):
def __init__(self):
self.config = {}
def __string_wrap__(self, string_to_wrap):
return "'" + str(string_to_wrap) + "'"
class ChartComponentDict(ChartComponent):
def __init__(self):
super(ChartComponentDict, self).__init__()
class ChartC... | <commit_before>class ChartComponent(object):
def __init__(self):
self.config = {}
def __string_wrap__(self, string_to_wrap):
return "'" + string_to_wrap + "'"
class ChartComponentDict(ChartComponent):
def __init__(self):
super(ChartComponentDict, self).__init__()
cl... | class ChartComponent(object):
def __init__(self):
self.config = {}
def __string_wrap__(self, string_to_wrap):
return "'" + str(string_to_wrap) + "'"
class ChartComponentDict(ChartComponent):
def __init__(self):
super(ChartComponentDict, self).__init__()
class ChartC... | class ChartComponent(object):
def __init__(self):
self.config = {}
def __string_wrap__(self, string_to_wrap):
return "'" + string_to_wrap + "'"
class ChartComponentDict(ChartComponent):
def __init__(self):
super(ChartComponentDict, self).__init__()
class ChartCompon... | <commit_before>class ChartComponent(object):
def __init__(self):
self.config = {}
def __string_wrap__(self, string_to_wrap):
return "'" + string_to_wrap + "'"
class ChartComponentDict(ChartComponent):
def __init__(self):
super(ChartComponentDict, self).__init__()
cl... |
fccf1d6562e8d5e1349d1f0826993ec799a5fc07 | app/timetables/tests/test_models.py | app/timetables/tests/test_models.py | from django.test import TestCase
from django.db import IntegrityError
from app.timetables.models import Weekday, Meal
class WeekdayTest(TestCase):
"""Tests the Weekday model."""
def setUp(self):
Weekday.objects.create(name='monday')
def test_weekday_name_should_be_capitalized_on_save(self):
... | from datetime import datetime
from django.test import TestCase
from django.db import IntegrityError
from app.timetables.models import Weekday, Meal
class WeekdayTest(TestCase):
"""Tests the Weekday model."""
def setUp(self):
Weekday.objects.create(name='monday')
def test_weekday_name_should_be... | Use time object for model test | Use time object for model test
| Python | mit | teamtaverna/core | from django.test import TestCase
from django.db import IntegrityError
from app.timetables.models import Weekday, Meal
class WeekdayTest(TestCase):
"""Tests the Weekday model."""
def setUp(self):
Weekday.objects.create(name='monday')
def test_weekday_name_should_be_capitalized_on_save(self):
... | from datetime import datetime
from django.test import TestCase
from django.db import IntegrityError
from app.timetables.models import Weekday, Meal
class WeekdayTest(TestCase):
"""Tests the Weekday model."""
def setUp(self):
Weekday.objects.create(name='monday')
def test_weekday_name_should_be... | <commit_before>from django.test import TestCase
from django.db import IntegrityError
from app.timetables.models import Weekday, Meal
class WeekdayTest(TestCase):
"""Tests the Weekday model."""
def setUp(self):
Weekday.objects.create(name='monday')
def test_weekday_name_should_be_capitalized_on_... | from datetime import datetime
from django.test import TestCase
from django.db import IntegrityError
from app.timetables.models import Weekday, Meal
class WeekdayTest(TestCase):
"""Tests the Weekday model."""
def setUp(self):
Weekday.objects.create(name='monday')
def test_weekday_name_should_be... | from django.test import TestCase
from django.db import IntegrityError
from app.timetables.models import Weekday, Meal
class WeekdayTest(TestCase):
"""Tests the Weekday model."""
def setUp(self):
Weekday.objects.create(name='monday')
def test_weekday_name_should_be_capitalized_on_save(self):
... | <commit_before>from django.test import TestCase
from django.db import IntegrityError
from app.timetables.models import Weekday, Meal
class WeekdayTest(TestCase):
"""Tests the Weekday model."""
def setUp(self):
Weekday.objects.create(name='monday')
def test_weekday_name_should_be_capitalized_on_... |
3be244ab1d7b03648350356dd3d9b6025516def5 | capstone/rl/tabularf.py | capstone/rl/tabularf.py | import random
class TabularF(dict):
'''
Tabular representation for any of the two types of value functions:
1. state value function (V-Functions).
e.g.
vf = TabularF()
vf[state] = 1
2. state-action value functions (Q-functions)
e.g.
qf = TabularF()
qf[(state... | import random
_MEAN = 0.0
_STD = 0.3
class TabularF(dict):
'''
Tabular representation for any of the two types of value functions:
1. state value function (V-Functions).
e.g.
vf = TabularF()
vf[state] = 1
2. state-action value functions (Q-functions)
e.g.
qf = Tabu... | Initialize values using a gaussian distribution with mean = 0 and std = 0.3 | Initialize values using a gaussian distribution with mean = 0 and std = 0.3
| Python | mit | davidrobles/mlnd-capstone-code | import random
class TabularF(dict):
'''
Tabular representation for any of the two types of value functions:
1. state value function (V-Functions).
e.g.
vf = TabularF()
vf[state] = 1
2. state-action value functions (Q-functions)
e.g.
qf = TabularF()
qf[(state... | import random
_MEAN = 0.0
_STD = 0.3
class TabularF(dict):
'''
Tabular representation for any of the two types of value functions:
1. state value function (V-Functions).
e.g.
vf = TabularF()
vf[state] = 1
2. state-action value functions (Q-functions)
e.g.
qf = Tabu... | <commit_before>import random
class TabularF(dict):
'''
Tabular representation for any of the two types of value functions:
1. state value function (V-Functions).
e.g.
vf = TabularF()
vf[state] = 1
2. state-action value functions (Q-functions)
e.g.
qf = TabularF()
... | import random
_MEAN = 0.0
_STD = 0.3
class TabularF(dict):
'''
Tabular representation for any of the two types of value functions:
1. state value function (V-Functions).
e.g.
vf = TabularF()
vf[state] = 1
2. state-action value functions (Q-functions)
e.g.
qf = Tabu... | import random
class TabularF(dict):
'''
Tabular representation for any of the two types of value functions:
1. state value function (V-Functions).
e.g.
vf = TabularF()
vf[state] = 1
2. state-action value functions (Q-functions)
e.g.
qf = TabularF()
qf[(state... | <commit_before>import random
class TabularF(dict):
'''
Tabular representation for any of the two types of value functions:
1. state value function (V-Functions).
e.g.
vf = TabularF()
vf[state] = 1
2. state-action value functions (Q-functions)
e.g.
qf = TabularF()
... |
a6ac83978cfab99fbe1e2fc9715a0cdea3d7b472 | coss/urls.py | coss/urls.py | from __future__ import absolute_import, unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from wagtail.wagtailadmin import urls as wagtailadmin_urls
from wagtail.wagtailcore import urls as wagtail_urls
from wagtail.wagtaildocs import urls as w... | from __future__ import absolute_import, unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from wagtail.wagtailadmin import urls as wagtailadmin_urls
from wagtail.wagtailcore import urls as wagtail_urls
from wagtail.wagtaildocs import urls as w... | Move CMS admin panel to /cms. | Move CMS admin panel to /cms.
| Python | mpl-2.0 | akatsoulas/coss,akatsoulas/coss,akatsoulas/coss,akatsoulas/coss | from __future__ import absolute_import, unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from wagtail.wagtailadmin import urls as wagtailadmin_urls
from wagtail.wagtailcore import urls as wagtail_urls
from wagtail.wagtaildocs import urls as w... | from __future__ import absolute_import, unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from wagtail.wagtailadmin import urls as wagtailadmin_urls
from wagtail.wagtailcore import urls as wagtail_urls
from wagtail.wagtaildocs import urls as w... | <commit_before>from __future__ import absolute_import, unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from wagtail.wagtailadmin import urls as wagtailadmin_urls
from wagtail.wagtailcore import urls as wagtail_urls
from wagtail.wagtaildocs i... | from __future__ import absolute_import, unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from wagtail.wagtailadmin import urls as wagtailadmin_urls
from wagtail.wagtailcore import urls as wagtail_urls
from wagtail.wagtaildocs import urls as w... | from __future__ import absolute_import, unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from wagtail.wagtailadmin import urls as wagtailadmin_urls
from wagtail.wagtailcore import urls as wagtail_urls
from wagtail.wagtaildocs import urls as w... | <commit_before>from __future__ import absolute_import, unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from wagtail.wagtailadmin import urls as wagtailadmin_urls
from wagtail.wagtailcore import urls as wagtail_urls
from wagtail.wagtaildocs i... |
11cf68b017f1feccc27fcfacea2c67aafc8e682d | tools/contributer_list.py | tools/contributer_list.py | #!/usr/bin/env python
"""Print a list of contributors for a particular milestone.
Usage:
python tools/contributor_list.py MILESTONE
"""
import sys
from gh_api import (
get_milestone_id,
get_issues_list,
)
if __name__ == "__main__":
if len(sys.argv) != 2:
print(__doc__)
sys.exit(1)
... | #!/usr/bin/env python
"""Print a list of contributors for a particular milestone.
Usage:
python tools/contributor_list.py [MILESTONE] [MILESTONE] ...
"""
import sys
from gh_api import (
get_milestones,
get_milestone_id,
get_issues_list,
)
if __name__ == "__main__":
if len(sys.argv) < 2:
... | Include multiple milestones and open issues in contributor list | Include multiple milestones and open issues in contributor list [ci skip]
| Python | bsd-3-clause | jhamrick/nbgrader,jhamrick/nbgrader,jupyter/nbgrader,jhamrick/nbgrader,jhamrick/nbgrader,jupyter/nbgrader,jupyter/nbgrader,jupyter/nbgrader,jupyter/nbgrader | #!/usr/bin/env python
"""Print a list of contributors for a particular milestone.
Usage:
python tools/contributor_list.py MILESTONE
"""
import sys
from gh_api import (
get_milestone_id,
get_issues_list,
)
if __name__ == "__main__":
if len(sys.argv) != 2:
print(__doc__)
sys.exit(1)
... | #!/usr/bin/env python
"""Print a list of contributors for a particular milestone.
Usage:
python tools/contributor_list.py [MILESTONE] [MILESTONE] ...
"""
import sys
from gh_api import (
get_milestones,
get_milestone_id,
get_issues_list,
)
if __name__ == "__main__":
if len(sys.argv) < 2:
... | <commit_before>#!/usr/bin/env python
"""Print a list of contributors for a particular milestone.
Usage:
python tools/contributor_list.py MILESTONE
"""
import sys
from gh_api import (
get_milestone_id,
get_issues_list,
)
if __name__ == "__main__":
if len(sys.argv) != 2:
print(__doc__)
... | #!/usr/bin/env python
"""Print a list of contributors for a particular milestone.
Usage:
python tools/contributor_list.py [MILESTONE] [MILESTONE] ...
"""
import sys
from gh_api import (
get_milestones,
get_milestone_id,
get_issues_list,
)
if __name__ == "__main__":
if len(sys.argv) < 2:
... | #!/usr/bin/env python
"""Print a list of contributors for a particular milestone.
Usage:
python tools/contributor_list.py MILESTONE
"""
import sys
from gh_api import (
get_milestone_id,
get_issues_list,
)
if __name__ == "__main__":
if len(sys.argv) != 2:
print(__doc__)
sys.exit(1)
... | <commit_before>#!/usr/bin/env python
"""Print a list of contributors for a particular milestone.
Usage:
python tools/contributor_list.py MILESTONE
"""
import sys
from gh_api import (
get_milestone_id,
get_issues_list,
)
if __name__ == "__main__":
if len(sys.argv) != 2:
print(__doc__)
... |
3b22d14a3f20159d2f334002738d4e7fcfa7b09c | bitHopper/Tracking/getwork_store.py | bitHopper/Tracking/getwork_store.py | #Copyright (C) 2011,2012 Colin Rice
#This software is licensed under an included MIT license.
#See the file entitled LICENSE
#If you were not provided with a copy of the license please contact:
# Colin Rice [email protected]
import gevent, time, logging
class Getwork_Store:
"""
Class that stores getworks so ... | #Copyright (C) 2011,2012 Colin Rice
#This software is licensed under an included MIT license.
#See the file entitled LICENSE
#If you were not provided with a copy of the license please contact:
# Colin Rice [email protected]
import gevent, time, logging
class Getwork_Store:
"""
Class that stores getworks so w... | Store merkle roots for 10 minutes | Store merkle roots for 10 minutes
| Python | mit | c00w/bitHopper,c00w/bitHopper | #Copyright (C) 2011,2012 Colin Rice
#This software is licensed under an included MIT license.
#See the file entitled LICENSE
#If you were not provided with a copy of the license please contact:
# Colin Rice [email protected]
import gevent, time, logging
class Getwork_Store:
"""
Class that stores getworks so ... | #Copyright (C) 2011,2012 Colin Rice
#This software is licensed under an included MIT license.
#See the file entitled LICENSE
#If you were not provided with a copy of the license please contact:
# Colin Rice [email protected]
import gevent, time, logging
class Getwork_Store:
"""
Class that stores getworks so w... | <commit_before>#Copyright (C) 2011,2012 Colin Rice
#This software is licensed under an included MIT license.
#See the file entitled LICENSE
#If you were not provided with a copy of the license please contact:
# Colin Rice [email protected]
import gevent, time, logging
class Getwork_Store:
"""
Class that stor... | #Copyright (C) 2011,2012 Colin Rice
#This software is licensed under an included MIT license.
#See the file entitled LICENSE
#If you were not provided with a copy of the license please contact:
# Colin Rice [email protected]
import gevent, time, logging
class Getwork_Store:
"""
Class that stores getworks so w... | #Copyright (C) 2011,2012 Colin Rice
#This software is licensed under an included MIT license.
#See the file entitled LICENSE
#If you were not provided with a copy of the license please contact:
# Colin Rice [email protected]
import gevent, time, logging
class Getwork_Store:
"""
Class that stores getworks so ... | <commit_before>#Copyright (C) 2011,2012 Colin Rice
#This software is licensed under an included MIT license.
#See the file entitled LICENSE
#If you were not provided with a copy of the license please contact:
# Colin Rice [email protected]
import gevent, time, logging
class Getwork_Store:
"""
Class that stor... |
94b37ba0abacbff53da342574b61c87810f6a5d4 | bulletin/tools/plugins/forms/job.py | bulletin/tools/plugins/forms/job.py | from datetimewidget.widgets import DateTimeWidget
from django.forms import ModelForm
from form_utils.widgets import ImageWidget
from ..models import Job
job_field_labels = {
'image': 'Image (10Mb Limit)',
'url': 'URL'
}
job_help_texts = {
'url': 'Provide a full url, e.g., "http://www.example.com/page.htm... | from datetimewidget.widgets import DateTimeWidget
from django.forms import ModelForm
from form_utils.widgets import ImageWidget
from ..models import Job
job_field_labels = {
'image': 'Image (10Mb Limit)',
'url': 'URL'
}
job_help_texts = {
'url': 'Provide a full url, e.g., "http://www.example.com/page.htm... | Make image required on Job submit form. | Make image required on Job submit form.
| Python | mit | AASHE/django-bulletin,AASHE/django-bulletin,AASHE/django-bulletin | from datetimewidget.widgets import DateTimeWidget
from django.forms import ModelForm
from form_utils.widgets import ImageWidget
from ..models import Job
job_field_labels = {
'image': 'Image (10Mb Limit)',
'url': 'URL'
}
job_help_texts = {
'url': 'Provide a full url, e.g., "http://www.example.com/page.htm... | from datetimewidget.widgets import DateTimeWidget
from django.forms import ModelForm
from form_utils.widgets import ImageWidget
from ..models import Job
job_field_labels = {
'image': 'Image (10Mb Limit)',
'url': 'URL'
}
job_help_texts = {
'url': 'Provide a full url, e.g., "http://www.example.com/page.htm... | <commit_before>from datetimewidget.widgets import DateTimeWidget
from django.forms import ModelForm
from form_utils.widgets import ImageWidget
from ..models import Job
job_field_labels = {
'image': 'Image (10Mb Limit)',
'url': 'URL'
}
job_help_texts = {
'url': 'Provide a full url, e.g., "http://www.examp... | from datetimewidget.widgets import DateTimeWidget
from django.forms import ModelForm
from form_utils.widgets import ImageWidget
from ..models import Job
job_field_labels = {
'image': 'Image (10Mb Limit)',
'url': 'URL'
}
job_help_texts = {
'url': 'Provide a full url, e.g., "http://www.example.com/page.htm... | from datetimewidget.widgets import DateTimeWidget
from django.forms import ModelForm
from form_utils.widgets import ImageWidget
from ..models import Job
job_field_labels = {
'image': 'Image (10Mb Limit)',
'url': 'URL'
}
job_help_texts = {
'url': 'Provide a full url, e.g., "http://www.example.com/page.htm... | <commit_before>from datetimewidget.widgets import DateTimeWidget
from django.forms import ModelForm
from form_utils.widgets import ImageWidget
from ..models import Job
job_field_labels = {
'image': 'Image (10Mb Limit)',
'url': 'URL'
}
job_help_texts = {
'url': 'Provide a full url, e.g., "http://www.examp... |
7a4a3d76f89c14426191a6f0c4dfe09371416a0e | lib/pegasus/python/Pegasus/__init__.py | lib/pegasus/python/Pegasus/__init__.py | # Copyright 2009 University Of Southern California
#
# 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 o... | # Copyright 2009 University Of Southern California
#
# 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 o... | Add TRACE level to Pegasus logging | Add TRACE level to Pegasus logging
| Python | apache-2.0 | pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus | # Copyright 2009 University Of Southern California
#
# 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 o... | # Copyright 2009 University Of Southern California
#
# 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 o... | <commit_before># Copyright 2009 University Of Southern California
#
# 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 a... | # Copyright 2009 University Of Southern California
#
# 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 o... | # Copyright 2009 University Of Southern California
#
# 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 o... | <commit_before># Copyright 2009 University Of Southern California
#
# 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 a... |
9a4ea40b2eb164f8c18e9812c27aa430c3c27772 | api/serializers.py | api/serializers.py | from django.contrib.auth.models import User
from rest_framework import serializers
from api.models import UserPreferences
class UserPreferencesSummarySerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = UserPreferences
fields = (
'id',
'url'
)
... | from django.contrib.auth.models import User
from rest_framework import serializers
from api.models import UserPreferences
class UserPreferencesSummarySerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = UserPreferences
fields = (
'id',
'url'
)
... | Include new airport_ui preference in serializer for view | Include new airport_ui preference in serializer for view
| Python | apache-2.0 | CCI-MOC/GUI-Frontend,CCI-MOC/GUI-Frontend,CCI-MOC/GUI-Frontend,CCI-MOC/GUI-Frontend,CCI-MOC/GUI-Frontend | from django.contrib.auth.models import User
from rest_framework import serializers
from api.models import UserPreferences
class UserPreferencesSummarySerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = UserPreferences
fields = (
'id',
'url'
)
... | from django.contrib.auth.models import User
from rest_framework import serializers
from api.models import UserPreferences
class UserPreferencesSummarySerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = UserPreferences
fields = (
'id',
'url'
)
... | <commit_before>from django.contrib.auth.models import User
from rest_framework import serializers
from api.models import UserPreferences
class UserPreferencesSummarySerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = UserPreferences
fields = (
'id',
'ur... | from django.contrib.auth.models import User
from rest_framework import serializers
from api.models import UserPreferences
class UserPreferencesSummarySerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = UserPreferences
fields = (
'id',
'url'
)
... | from django.contrib.auth.models import User
from rest_framework import serializers
from api.models import UserPreferences
class UserPreferencesSummarySerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = UserPreferences
fields = (
'id',
'url'
)
... | <commit_before>from django.contrib.auth.models import User
from rest_framework import serializers
from api.models import UserPreferences
class UserPreferencesSummarySerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = UserPreferences
fields = (
'id',
'ur... |
1dac2942eb9a15517392eebc9aa96dcb658ebfee | src/passgen.py | src/passgen.py | import string
import random
import argparse
def passgen(length=12):
"""Generate a strong password with *length* characters"""
pool = string.ascii_uppercase + string.ascii_lowercase + string.digits
return ''.join(random.SystemRandom().choice(pool) for _ in range(length))
def main():
parser = argparse... | import string
import random
import argparse
def passgen(length=12):
"""Generate a strong password with *length* characters"""
pool = string.ascii_uppercase + string.ascii_lowercase + string.digits
# Using technique from Stack Overflow answer
# http://stackoverflow.com/a/23728630
chars = [random.S... | Make it more clear how password is generated | Make it more clear how password is generated
| Python | mit | soslan/passgen | import string
import random
import argparse
def passgen(length=12):
"""Generate a strong password with *length* characters"""
pool = string.ascii_uppercase + string.ascii_lowercase + string.digits
return ''.join(random.SystemRandom().choice(pool) for _ in range(length))
def main():
parser = argparse... | import string
import random
import argparse
def passgen(length=12):
"""Generate a strong password with *length* characters"""
pool = string.ascii_uppercase + string.ascii_lowercase + string.digits
# Using technique from Stack Overflow answer
# http://stackoverflow.com/a/23728630
chars = [random.S... | <commit_before>import string
import random
import argparse
def passgen(length=12):
"""Generate a strong password with *length* characters"""
pool = string.ascii_uppercase + string.ascii_lowercase + string.digits
return ''.join(random.SystemRandom().choice(pool) for _ in range(length))
def main():
pa... | import string
import random
import argparse
def passgen(length=12):
"""Generate a strong password with *length* characters"""
pool = string.ascii_uppercase + string.ascii_lowercase + string.digits
# Using technique from Stack Overflow answer
# http://stackoverflow.com/a/23728630
chars = [random.S... | import string
import random
import argparse
def passgen(length=12):
"""Generate a strong password with *length* characters"""
pool = string.ascii_uppercase + string.ascii_lowercase + string.digits
return ''.join(random.SystemRandom().choice(pool) for _ in range(length))
def main():
parser = argparse... | <commit_before>import string
import random
import argparse
def passgen(length=12):
"""Generate a strong password with *length* characters"""
pool = string.ascii_uppercase + string.ascii_lowercase + string.digits
return ''.join(random.SystemRandom().choice(pool) for _ in range(length))
def main():
pa... |
0c22486320b064c078fe009faf41e2d0c7f5e272 | passwordless/views.py | passwordless/views.py | from django.shortcuts import render
from django.views.generic.edit import FormView
from . import forms
# Create your views here.
def logout(request):
return render(request, 'passwordless/logout.html')
def authn(request, token):
return render(request, 'passwordless/authn.html')
class LoginView(FormView):
... | from django.shortcuts import render
from django.views.generic.edit import FormView
from . import forms
# Create your views here.
def logout(request):
return render(request, 'passwordless/logout.html')
def authn(request, token):
return render(request, 'passwordless/authn.html')
class LoginView(FormView):
... | Refactor RegisterView as subclass of LoginView | Refactor RegisterView as subclass of LoginView
They share much of the work, they should share the code as well
| Python | mit | Kromey/fbxnano,Kromey/akwriters,Kromey/fbxnano,Kromey/akwriters,Kromey/akwriters,Kromey/fbxnano,Kromey/fbxnano,Kromey/akwriters | from django.shortcuts import render
from django.views.generic.edit import FormView
from . import forms
# Create your views here.
def logout(request):
return render(request, 'passwordless/logout.html')
def authn(request, token):
return render(request, 'passwordless/authn.html')
class LoginView(FormView):
... | from django.shortcuts import render
from django.views.generic.edit import FormView
from . import forms
# Create your views here.
def logout(request):
return render(request, 'passwordless/logout.html')
def authn(request, token):
return render(request, 'passwordless/authn.html')
class LoginView(FormView):
... | <commit_before>from django.shortcuts import render
from django.views.generic.edit import FormView
from . import forms
# Create your views here.
def logout(request):
return render(request, 'passwordless/logout.html')
def authn(request, token):
return render(request, 'passwordless/authn.html')
class LoginVi... | from django.shortcuts import render
from django.views.generic.edit import FormView
from . import forms
# Create your views here.
def logout(request):
return render(request, 'passwordless/logout.html')
def authn(request, token):
return render(request, 'passwordless/authn.html')
class LoginView(FormView):
... | from django.shortcuts import render
from django.views.generic.edit import FormView
from . import forms
# Create your views here.
def logout(request):
return render(request, 'passwordless/logout.html')
def authn(request, token):
return render(request, 'passwordless/authn.html')
class LoginView(FormView):
... | <commit_before>from django.shortcuts import render
from django.views.generic.edit import FormView
from . import forms
# Create your views here.
def logout(request):
return render(request, 'passwordless/logout.html')
def authn(request, token):
return render(request, 'passwordless/authn.html')
class LoginVi... |
1d5b3630d372d763ad445b969eaad97fd569db52 | examples/cross_thread.py | examples/cross_thread.py | #!/usr/bin/python
"""
Example of an Eliot action context spanning multiple threads.
"""
from threading import Thread
from sys import stdout
from eliot import to_file, preserve_context, start_action
to_file(stdout)
def add_in_thread(x, y):
with start_action(action_type="in_thread", x=x, y=y) as context:
... | #!/usr/bin/env python
"""
Example of an Eliot action context spanning multiple threads.
"""
from __future__ import unicode_literals
from threading import Thread
from sys import stdout
from eliot import to_file, preserve_context, start_action
to_file(stdout)
def add_in_thread(x, y):
with start_action(action_ty... | Fix hashbang, add future import. | Fix hashbang, add future import.
| Python | apache-2.0 | ScatterHQ/eliot,ScatterHQ/eliot,ScatterHQ/eliot,ClusterHQ/eliot | #!/usr/bin/python
"""
Example of an Eliot action context spanning multiple threads.
"""
from threading import Thread
from sys import stdout
from eliot import to_file, preserve_context, start_action
to_file(stdout)
def add_in_thread(x, y):
with start_action(action_type="in_thread", x=x, y=y) as context:
... | #!/usr/bin/env python
"""
Example of an Eliot action context spanning multiple threads.
"""
from __future__ import unicode_literals
from threading import Thread
from sys import stdout
from eliot import to_file, preserve_context, start_action
to_file(stdout)
def add_in_thread(x, y):
with start_action(action_ty... | <commit_before>#!/usr/bin/python
"""
Example of an Eliot action context spanning multiple threads.
"""
from threading import Thread
from sys import stdout
from eliot import to_file, preserve_context, start_action
to_file(stdout)
def add_in_thread(x, y):
with start_action(action_type="in_thread", x=x, y=y) as c... | #!/usr/bin/env python
"""
Example of an Eliot action context spanning multiple threads.
"""
from __future__ import unicode_literals
from threading import Thread
from sys import stdout
from eliot import to_file, preserve_context, start_action
to_file(stdout)
def add_in_thread(x, y):
with start_action(action_ty... | #!/usr/bin/python
"""
Example of an Eliot action context spanning multiple threads.
"""
from threading import Thread
from sys import stdout
from eliot import to_file, preserve_context, start_action
to_file(stdout)
def add_in_thread(x, y):
with start_action(action_type="in_thread", x=x, y=y) as context:
... | <commit_before>#!/usr/bin/python
"""
Example of an Eliot action context spanning multiple threads.
"""
from threading import Thread
from sys import stdout
from eliot import to_file, preserve_context, start_action
to_file(stdout)
def add_in_thread(x, y):
with start_action(action_type="in_thread", x=x, y=y) as c... |
0f844e44f0b1b8873aa777becf7e7a8fcc48483b | virtool/indexes/models.py | virtool/indexes/models.py | import enum
from sqlalchemy import Column, Integer, String, Enum
from virtool.pg.utils import Base, SQLEnum
class IndexType(str, SQLEnum):
"""
Enumerated type for index file types
"""
json = "json"
fasta = "fasta"
bowtie2 = "bowtie2"
class IndexFile(Base):
"""
SQL model to store n... | import enum
from sqlalchemy import Column, Integer, String, Enum
from virtool.pg.utils import Base, SQLEnum
class IndexType(str, SQLEnum):
"""
Enumerated type for index file types
"""
json = "json"
fasta = "fasta"
bowtie2 = "bowtie2"
class IndexFile(Base):
"""
SQL model to store n... | Make 'name' and 'index' columns non-nullable for IndexFile model | Make 'name' and 'index' columns non-nullable for IndexFile model
| Python | mit | virtool/virtool,virtool/virtool,igboyes/virtool,igboyes/virtool | import enum
from sqlalchemy import Column, Integer, String, Enum
from virtool.pg.utils import Base, SQLEnum
class IndexType(str, SQLEnum):
"""
Enumerated type for index file types
"""
json = "json"
fasta = "fasta"
bowtie2 = "bowtie2"
class IndexFile(Base):
"""
SQL model to store n... | import enum
from sqlalchemy import Column, Integer, String, Enum
from virtool.pg.utils import Base, SQLEnum
class IndexType(str, SQLEnum):
"""
Enumerated type for index file types
"""
json = "json"
fasta = "fasta"
bowtie2 = "bowtie2"
class IndexFile(Base):
"""
SQL model to store n... | <commit_before>import enum
from sqlalchemy import Column, Integer, String, Enum
from virtool.pg.utils import Base, SQLEnum
class IndexType(str, SQLEnum):
"""
Enumerated type for index file types
"""
json = "json"
fasta = "fasta"
bowtie2 = "bowtie2"
class IndexFile(Base):
"""
SQL m... | import enum
from sqlalchemy import Column, Integer, String, Enum
from virtool.pg.utils import Base, SQLEnum
class IndexType(str, SQLEnum):
"""
Enumerated type for index file types
"""
json = "json"
fasta = "fasta"
bowtie2 = "bowtie2"
class IndexFile(Base):
"""
SQL model to store n... | import enum
from sqlalchemy import Column, Integer, String, Enum
from virtool.pg.utils import Base, SQLEnum
class IndexType(str, SQLEnum):
"""
Enumerated type for index file types
"""
json = "json"
fasta = "fasta"
bowtie2 = "bowtie2"
class IndexFile(Base):
"""
SQL model to store n... | <commit_before>import enum
from sqlalchemy import Column, Integer, String, Enum
from virtool.pg.utils import Base, SQLEnum
class IndexType(str, SQLEnum):
"""
Enumerated type for index file types
"""
json = "json"
fasta = "fasta"
bowtie2 = "bowtie2"
class IndexFile(Base):
"""
SQL m... |
e01571fb8c29b78f16c34bfcd2d806b183224047 | opps/containers/forms.py | opps/containers/forms.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django import forms
from django.conf import settings
from opps.db.models.fields.jsonf import JSONFormField
from opps.fields.widgets import JSONField
from opps.fields.models import Field, FieldOption
class ContainerAdminForm(forms.ModelForm):
def __init__(self, *... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django import forms
from django.conf import settings
from opps.db.models.fields.jsonf import JSONFormField
from opps.fields.widgets import JSONField
from opps.fields.models import Field, FieldOption
class ContainerAdminForm(forms.ModelForm):
def __init__(self, *... | Fix mirror_channel widget on OPPS_MIRROR_CHANNEL false | Fix mirror_channel widget on OPPS_MIRROR_CHANNEL false
| Python | mit | opps/opps,YACOWS/opps,YACOWS/opps,YACOWS/opps,jeanmask/opps,williamroot/opps,YACOWS/opps,jeanmask/opps,williamroot/opps,opps/opps,williamroot/opps,opps/opps,jeanmask/opps,opps/opps,jeanmask/opps,williamroot/opps | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django import forms
from django.conf import settings
from opps.db.models.fields.jsonf import JSONFormField
from opps.fields.widgets import JSONField
from opps.fields.models import Field, FieldOption
class ContainerAdminForm(forms.ModelForm):
def __init__(self, *... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django import forms
from django.conf import settings
from opps.db.models.fields.jsonf import JSONFormField
from opps.fields.widgets import JSONField
from opps.fields.models import Field, FieldOption
class ContainerAdminForm(forms.ModelForm):
def __init__(self, *... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django import forms
from django.conf import settings
from opps.db.models.fields.jsonf import JSONFormField
from opps.fields.widgets import JSONField
from opps.fields.models import Field, FieldOption
class ContainerAdminForm(forms.ModelForm):
def _... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django import forms
from django.conf import settings
from opps.db.models.fields.jsonf import JSONFormField
from opps.fields.widgets import JSONField
from opps.fields.models import Field, FieldOption
class ContainerAdminForm(forms.ModelForm):
def __init__(self, *... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django import forms
from django.conf import settings
from opps.db.models.fields.jsonf import JSONFormField
from opps.fields.widgets import JSONField
from opps.fields.models import Field, FieldOption
class ContainerAdminForm(forms.ModelForm):
def __init__(self, *... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django import forms
from django.conf import settings
from opps.db.models.fields.jsonf import JSONFormField
from opps.fields.widgets import JSONField
from opps.fields.models import Field, FieldOption
class ContainerAdminForm(forms.ModelForm):
def _... |
9ada81a111c0b5c8d523bbb532a7be3873f603fe | __init__.py | __init__.py | from flask import Flask, request, redirect
import twilio.twiml
app = Flask(__name__)
@app.route("/", methods=['GET', 'POST'])
def hello():
""" Respond to incoming calls with a SMS """
body = request.values.get('Body', None)
resp = twilio.twiml.Response()
if body == '#bff':
resp.message('#a... | from flask import Flask, request, redirect
import twilio.twiml
app = Flask(__name__)
@app.route("/", methods=['GET', 'POST'])
def hello():
""" Respond to incoming calls with a SMS """
body = request.values.get('Body', None)
resp = twilio.twiml.Response()
if body == '#bff':
resp.message('#a... | Add more conversation into the mix. | Add more conversation into the mix.
| Python | mit | patrickbeeson/text-me | from flask import Flask, request, redirect
import twilio.twiml
app = Flask(__name__)
@app.route("/", methods=['GET', 'POST'])
def hello():
""" Respond to incoming calls with a SMS """
body = request.values.get('Body', None)
resp = twilio.twiml.Response()
if body == '#bff':
resp.message('#a... | from flask import Flask, request, redirect
import twilio.twiml
app = Flask(__name__)
@app.route("/", methods=['GET', 'POST'])
def hello():
""" Respond to incoming calls with a SMS """
body = request.values.get('Body', None)
resp = twilio.twiml.Response()
if body == '#bff':
resp.message('#a... | <commit_before>from flask import Flask, request, redirect
import twilio.twiml
app = Flask(__name__)
@app.route("/", methods=['GET', 'POST'])
def hello():
""" Respond to incoming calls with a SMS """
body = request.values.get('Body', None)
resp = twilio.twiml.Response()
if body == '#bff':
r... | from flask import Flask, request, redirect
import twilio.twiml
app = Flask(__name__)
@app.route("/", methods=['GET', 'POST'])
def hello():
""" Respond to incoming calls with a SMS """
body = request.values.get('Body', None)
resp = twilio.twiml.Response()
if body == '#bff':
resp.message('#a... | from flask import Flask, request, redirect
import twilio.twiml
app = Flask(__name__)
@app.route("/", methods=['GET', 'POST'])
def hello():
""" Respond to incoming calls with a SMS """
body = request.values.get('Body', None)
resp = twilio.twiml.Response()
if body == '#bff':
resp.message('#a... | <commit_before>from flask import Flask, request, redirect
import twilio.twiml
app = Flask(__name__)
@app.route("/", methods=['GET', 'POST'])
def hello():
""" Respond to incoming calls with a SMS """
body = request.values.get('Body', None)
resp = twilio.twiml.Response()
if body == '#bff':
r... |
d672cbc84ced1af4f7e5f0cf97c5d087a477717c | tools/sharding_supervisor/sharding_supervisor.py | tools/sharding_supervisor/sharding_supervisor.py | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from sharding_supervisor_old import * # pylint: disable=W0401,W0614
if __name__ == "__main__":
sys.exit(main())
| #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Defer to run_test_cases.py."""
import os
import optparse
import sys
ROOT_DIR = os.path.dirname(
os.path.dirname(os.path.di... | Switch over to run_test_cases.py, take 2. | Switch over to run_test_cases.py, take 2.
Instead of doing a "Revert r168479 'Revert r168478'", it's using a simpler version based on renaming sharding_supervisor first.
Try to enable run_test_cases.py again.
[email protected]
BUG=164886
Review URL: https://codereview.chromium.org/11472024
git-svn-id: de01... | Python | bsd-3-clause | markYoungH/chromium.src,mohamed--abdel-maksoud/chromium.src,dednal/chromium.src,anirudhSK/chromium,anirudhSK/chromium,Fireblend/chromium-crosswalk,mogoweb/chromium-crosswalk,hujiajie/pa-chromium,zcbenz/cefode-chromium,dushu1203/chromium.src,hujiajie/pa-chromium,dushu1203/chromium.src,M4sse/chromium.src,mogoweb/chromium... | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from sharding_supervisor_old import * # pylint: disable=W0401,W0614
if __name__ == "__main__":
sys.exit(main())
Switch over to... | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Defer to run_test_cases.py."""
import os
import optparse
import sys
ROOT_DIR = os.path.dirname(
os.path.dirname(os.path.di... | <commit_before>#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from sharding_supervisor_old import * # pylint: disable=W0401,W0614
if __name__ == "__main__":
sys.exit(main())... | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Defer to run_test_cases.py."""
import os
import optparse
import sys
ROOT_DIR = os.path.dirname(
os.path.dirname(os.path.di... | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from sharding_supervisor_old import * # pylint: disable=W0401,W0614
if __name__ == "__main__":
sys.exit(main())
Switch over to... | <commit_before>#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from sharding_supervisor_old import * # pylint: disable=W0401,W0614
if __name__ == "__main__":
sys.exit(main())... |
7e70f6deb9e66a43c37241bc4e86ec2f85d81b4a | api/radar_api/serializers/sources.py | api/radar_api/serializers/sources.py | from radar_api.serializers.groups import GroupReferenceField
from radar_api.serializers.source_types import SourceTypeReferenceField
class SourceGroupSerializerMixin(object):
source_group = GroupReferenceField()
source_type = SourceTypeReferenceField()
def get_model_exclude(self):
attrs = super(S... | from radar_api.serializers.groups import TinyGroupReferenceField
from radar_api.serializers.source_types import SourceTypeReferenceField
class SourceGroupSerializerMixin(object):
source_group = TinyGroupReferenceField()
source_type = SourceTypeReferenceField()
def get_model_exclude(self):
attrs =... | Use tiny serializer for source group | Use tiny serializer for source group
| Python | agpl-3.0 | renalreg/radar,renalreg/radar,renalreg/radar,renalreg/radar | from radar_api.serializers.groups import GroupReferenceField
from radar_api.serializers.source_types import SourceTypeReferenceField
class SourceGroupSerializerMixin(object):
source_group = GroupReferenceField()
source_type = SourceTypeReferenceField()
def get_model_exclude(self):
attrs = super(S... | from radar_api.serializers.groups import TinyGroupReferenceField
from radar_api.serializers.source_types import SourceTypeReferenceField
class SourceGroupSerializerMixin(object):
source_group = TinyGroupReferenceField()
source_type = SourceTypeReferenceField()
def get_model_exclude(self):
attrs =... | <commit_before>from radar_api.serializers.groups import GroupReferenceField
from radar_api.serializers.source_types import SourceTypeReferenceField
class SourceGroupSerializerMixin(object):
source_group = GroupReferenceField()
source_type = SourceTypeReferenceField()
def get_model_exclude(self):
... | from radar_api.serializers.groups import TinyGroupReferenceField
from radar_api.serializers.source_types import SourceTypeReferenceField
class SourceGroupSerializerMixin(object):
source_group = TinyGroupReferenceField()
source_type = SourceTypeReferenceField()
def get_model_exclude(self):
attrs =... | from radar_api.serializers.groups import GroupReferenceField
from radar_api.serializers.source_types import SourceTypeReferenceField
class SourceGroupSerializerMixin(object):
source_group = GroupReferenceField()
source_type = SourceTypeReferenceField()
def get_model_exclude(self):
attrs = super(S... | <commit_before>from radar_api.serializers.groups import GroupReferenceField
from radar_api.serializers.source_types import SourceTypeReferenceField
class SourceGroupSerializerMixin(object):
source_group = GroupReferenceField()
source_type = SourceTypeReferenceField()
def get_model_exclude(self):
... |
a42997458baa1c6a1648896ff50f44e79525f8a1 | ognskylines/commands/devices/insert.py | ognskylines/commands/devices/insert.py | from ognskylines.dbutils import session
from ognskylines.model import Device
from ogn.utils import get_ddb, get_trackable
from manager import Manager
manager = Manager()
@manager.command
def import_ddb():
"""Import registered devices from the DDB (discards all devices before import)."""
session.query(Device... | from ognskylines.dbutils import session
from ognskylines.model import Device
import requests
from manager import Manager
manager = Manager()
DDB_URL = "http://ddb.glidernet.org/download/?j=1"
def get_ddb():
devices = requests.get(DDB_URL).json()
for device in devices['devices']:
device.update({'ide... | Add function to fetch devices from the DDB | Add function to fetch devices from the DDB
| Python | agpl-3.0 | kerel-fs/ogn-skylines-gateway,kerel-fs/ogn-skylines-gateway | from ognskylines.dbutils import session
from ognskylines.model import Device
from ogn.utils import get_ddb, get_trackable
from manager import Manager
manager = Manager()
@manager.command
def import_ddb():
"""Import registered devices from the DDB (discards all devices before import)."""
session.query(Device... | from ognskylines.dbutils import session
from ognskylines.model import Device
import requests
from manager import Manager
manager = Manager()
DDB_URL = "http://ddb.glidernet.org/download/?j=1"
def get_ddb():
devices = requests.get(DDB_URL).json()
for device in devices['devices']:
device.update({'ide... | <commit_before>from ognskylines.dbutils import session
from ognskylines.model import Device
from ogn.utils import get_ddb, get_trackable
from manager import Manager
manager = Manager()
@manager.command
def import_ddb():
"""Import registered devices from the DDB (discards all devices before import)."""
sessi... | from ognskylines.dbutils import session
from ognskylines.model import Device
import requests
from manager import Manager
manager = Manager()
DDB_URL = "http://ddb.glidernet.org/download/?j=1"
def get_ddb():
devices = requests.get(DDB_URL).json()
for device in devices['devices']:
device.update({'ide... | from ognskylines.dbutils import session
from ognskylines.model import Device
from ogn.utils import get_ddb, get_trackable
from manager import Manager
manager = Manager()
@manager.command
def import_ddb():
"""Import registered devices from the DDB (discards all devices before import)."""
session.query(Device... | <commit_before>from ognskylines.dbutils import session
from ognskylines.model import Device
from ogn.utils import get_ddb, get_trackable
from manager import Manager
manager = Manager()
@manager.command
def import_ddb():
"""Import registered devices from the DDB (discards all devices before import)."""
sessi... |
0ac3ab3278e81aebe4717e0f599f752b4fda06d3 | examples/swat-s1/tests.py | examples/swat-s1/tests.py | """
swat-s1 tests.
"""
# from mininet.cli import CLI
from mininet.net import Mininet
from nose.plugins.skip import SkipTest
from utils import STATE, RWT_INIT_LEVEL
from utils import TANK_SECTION
from topo import SwatTopo
from physical_process import RawWaterTank
# import subprocess
# import sys
@SkipTest
def tes... | """
swat-s1 tests.
"""
# from mininet.cli import CLI
from mininet.net import Mininet
from utils import STATE, RWT_INIT_LEVEL
from utils import TANK_SECTION
from topo import SwatTopo
from physical_process import RawWaterTank
# import subprocess
# import sys
def test_init():
pass
def test_topo():
topo =... | Remove examples dep from nose | Remove examples dep from nose
| Python | mit | remmihsorp/minicps,scy-phy/minicps,remmihsorp/minicps,scy-phy/minicps | """
swat-s1 tests.
"""
# from mininet.cli import CLI
from mininet.net import Mininet
from nose.plugins.skip import SkipTest
from utils import STATE, RWT_INIT_LEVEL
from utils import TANK_SECTION
from topo import SwatTopo
from physical_process import RawWaterTank
# import subprocess
# import sys
@SkipTest
def tes... | """
swat-s1 tests.
"""
# from mininet.cli import CLI
from mininet.net import Mininet
from utils import STATE, RWT_INIT_LEVEL
from utils import TANK_SECTION
from topo import SwatTopo
from physical_process import RawWaterTank
# import subprocess
# import sys
def test_init():
pass
def test_topo():
topo =... | <commit_before>"""
swat-s1 tests.
"""
# from mininet.cli import CLI
from mininet.net import Mininet
from nose.plugins.skip import SkipTest
from utils import STATE, RWT_INIT_LEVEL
from utils import TANK_SECTION
from topo import SwatTopo
from physical_process import RawWaterTank
# import subprocess
# import sys
@S... | """
swat-s1 tests.
"""
# from mininet.cli import CLI
from mininet.net import Mininet
from utils import STATE, RWT_INIT_LEVEL
from utils import TANK_SECTION
from topo import SwatTopo
from physical_process import RawWaterTank
# import subprocess
# import sys
def test_init():
pass
def test_topo():
topo =... | """
swat-s1 tests.
"""
# from mininet.cli import CLI
from mininet.net import Mininet
from nose.plugins.skip import SkipTest
from utils import STATE, RWT_INIT_LEVEL
from utils import TANK_SECTION
from topo import SwatTopo
from physical_process import RawWaterTank
# import subprocess
# import sys
@SkipTest
def tes... | <commit_before>"""
swat-s1 tests.
"""
# from mininet.cli import CLI
from mininet.net import Mininet
from nose.plugins.skip import SkipTest
from utils import STATE, RWT_INIT_LEVEL
from utils import TANK_SECTION
from topo import SwatTopo
from physical_process import RawWaterTank
# import subprocess
# import sys
@S... |
d5ed26ebbd84ed16d8d39607ef138581aa3b9d75 | osf/migrations/0145_add_preprint_contenttype_to_collections.py | osf/migrations/0145_add_preprint_contenttype_to_collections.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-11-08 16:56
from __future__ import unicode_literals
from django.db import migrations
from osf.models import Collection
from django.contrib.contenttypes.models import ContentType
def reverse_func(state, schema):
preprint_content_type = ContentType.obje... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-11-08 16:56
from __future__ import unicode_literals
from django.db import migrations
from osf.models import Collection
from django.contrib.contenttypes.models import ContentType
def reverse_func(state, schema):
preprint_content_type = ContentType.obje... | Use the Collection.collected_types through table to bulk add preprints as a valid collected_type for existing collections. | Use the Collection.collected_types through table to bulk add preprints as a valid collected_type for existing collections.
- Use the Collection - collected_types through table to remove preprints from collected_types.
| Python | apache-2.0 | CenterForOpenScience/osf.io,Johnetordoff/osf.io,pattisdr/osf.io,adlius/osf.io,baylee-d/osf.io,brianjgeiger/osf.io,felliott/osf.io,mattclark/osf.io,mfraezz/osf.io,felliott/osf.io,aaxelb/osf.io,brianjgeiger/osf.io,mfraezz/osf.io,CenterForOpenScience/osf.io,brianjgeiger/osf.io,mfraezz/osf.io,CenterForOpenScience/osf.io,aa... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-11-08 16:56
from __future__ import unicode_literals
from django.db import migrations
from osf.models import Collection
from django.contrib.contenttypes.models import ContentType
def reverse_func(state, schema):
preprint_content_type = ContentType.obje... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-11-08 16:56
from __future__ import unicode_literals
from django.db import migrations
from osf.models import Collection
from django.contrib.contenttypes.models import ContentType
def reverse_func(state, schema):
preprint_content_type = ContentType.obje... | <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-11-08 16:56
from __future__ import unicode_literals
from django.db import migrations
from osf.models import Collection
from django.contrib.contenttypes.models import ContentType
def reverse_func(state, schema):
preprint_content_type = C... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-11-08 16:56
from __future__ import unicode_literals
from django.db import migrations
from osf.models import Collection
from django.contrib.contenttypes.models import ContentType
def reverse_func(state, schema):
preprint_content_type = ContentType.obje... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-11-08 16:56
from __future__ import unicode_literals
from django.db import migrations
from osf.models import Collection
from django.contrib.contenttypes.models import ContentType
def reverse_func(state, schema):
preprint_content_type = ContentType.obje... | <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-11-08 16:56
from __future__ import unicode_literals
from django.db import migrations
from osf.models import Collection
from django.contrib.contenttypes.models import ContentType
def reverse_func(state, schema):
preprint_content_type = C... |
68b86aff3c9004b12dbd05cd1861229e73883e38 | quickstart/python/understand/example-2/create_joke_task.6.x.py | quickstart/python/understand/example-2/create_joke_task.6.x.py | # Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client
# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)
# Create a new task named 't... | # Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client
# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)
# Provide actions for the ne... | Update to include actions in Create | Update to include actions in Create | Python | mit | TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets | # Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client
# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)
# Create a new task named 't... | # Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client
# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)
# Provide actions for the ne... | <commit_before># Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client
# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)
# Create a ne... | # Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client
# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)
# Provide actions for the ne... | # Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client
# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)
# Create a new task named 't... | <commit_before># Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client
# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)
# Create a ne... |
4349e65c1c353f8808e139c57439a3dfe2e2846e | armstrong/core/arm_sections/views.py | armstrong/core/arm_sections/views.py | from django.core.urlresolvers import reverse
from django.views.generic import DetailView
from django.contrib.syndication.views import Feed
from django.shortcuts import get_object_or_404
from .models import Section
class SimpleSectionView(DetailView):
context_object_name = 'section'
model = Section
def g... | from django.core.urlresolvers import reverse
from django.views.generic import DetailView
from django.contrib.syndication.views import Feed
from django.shortcuts import get_object_or_404
from .models import Section
class SimpleSectionView(DetailView):
context_object_name = 'section'
model = Section
def g... | Call get_section from get_object for backwards compatibility | Call get_section from get_object for backwards compatibility | Python | apache-2.0 | texastribune/armstrong.core.tt_sections,armstrong/armstrong.core.arm_sections,texastribune/armstrong.core.tt_sections,texastribune/armstrong.core.tt_sections,armstrong/armstrong.core.arm_sections | from django.core.urlresolvers import reverse
from django.views.generic import DetailView
from django.contrib.syndication.views import Feed
from django.shortcuts import get_object_or_404
from .models import Section
class SimpleSectionView(DetailView):
context_object_name = 'section'
model = Section
def g... | from django.core.urlresolvers import reverse
from django.views.generic import DetailView
from django.contrib.syndication.views import Feed
from django.shortcuts import get_object_or_404
from .models import Section
class SimpleSectionView(DetailView):
context_object_name = 'section'
model = Section
def g... | <commit_before>from django.core.urlresolvers import reverse
from django.views.generic import DetailView
from django.contrib.syndication.views import Feed
from django.shortcuts import get_object_or_404
from .models import Section
class SimpleSectionView(DetailView):
context_object_name = 'section'
model = Sec... | from django.core.urlresolvers import reverse
from django.views.generic import DetailView
from django.contrib.syndication.views import Feed
from django.shortcuts import get_object_or_404
from .models import Section
class SimpleSectionView(DetailView):
context_object_name = 'section'
model = Section
def g... | from django.core.urlresolvers import reverse
from django.views.generic import DetailView
from django.contrib.syndication.views import Feed
from django.shortcuts import get_object_or_404
from .models import Section
class SimpleSectionView(DetailView):
context_object_name = 'section'
model = Section
def g... | <commit_before>from django.core.urlresolvers import reverse
from django.views.generic import DetailView
from django.contrib.syndication.views import Feed
from django.shortcuts import get_object_or_404
from .models import Section
class SimpleSectionView(DetailView):
context_object_name = 'section'
model = Sec... |
7e0030eb22671897a80633d57056ba0f26f15a77 | src/coordinators/models.py | src/coordinators/models.py | from __future__ import unicode_literals
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from locations.models import District
class Coordinator(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
is_manage... | from __future__ import unicode_literals
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from locations.models import District
class Coordinator(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
is_manage... | Make filter_by_district more strict - don't show anything to unconfigured users | Make filter_by_district more strict - don't show anything to unconfigured users
| Python | mit | mrts/foodbank-campaign,mrts/foodbank-campaign,mrts/foodbank-campaign,mrts/foodbank-campaign | from __future__ import unicode_literals
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from locations.models import District
class Coordinator(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
is_manage... | from __future__ import unicode_literals
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from locations.models import District
class Coordinator(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
is_manage... | <commit_before>from __future__ import unicode_literals
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from locations.models import District
class Coordinator(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE... | from __future__ import unicode_literals
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from locations.models import District
class Coordinator(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
is_manage... | from __future__ import unicode_literals
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from locations.models import District
class Coordinator(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
is_manage... | <commit_before>from __future__ import unicode_literals
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from locations.models import District
class Coordinator(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE... |
347038c528b07f2553f09daab6915828ab2a6113 | tests/__init__.py | tests/__init__.py | # -*- coding: utf-8 -*-
# Copyright 2011-2012 Antoine Bertin <[email protected]>
#
# This file is part of subliminal.
#
# subliminal is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 3 of... | # -*- coding: utf-8 -*-
# Copyright 2011-2012 Antoine Bertin <[email protected]>
#
# This file is part of subliminal.
#
# subliminal is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 3 of... | Add test_videos to the main test suite | Add test_videos to the main test suite
| Python | mit | oxan/subliminal,t4lwh/subliminal,h3llrais3r/subliminal,getzze/subliminal,bogdal/subliminal,hpsbranco/subliminal,ravselj/subliminal,nvbn/subliminal,fernandog/subliminal,goll/subliminal,ratoaq2/subliminal,Elettronik/subliminal,neo1691/subliminal,juanmhidalgo/subliminal,SickRage/subliminal,Diaoul/subliminal,kbkailashbagar... | # -*- coding: utf-8 -*-
# Copyright 2011-2012 Antoine Bertin <[email protected]>
#
# This file is part of subliminal.
#
# subliminal is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 3 of... | # -*- coding: utf-8 -*-
# Copyright 2011-2012 Antoine Bertin <[email protected]>
#
# This file is part of subliminal.
#
# subliminal is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 3 of... | <commit_before># -*- coding: utf-8 -*-
# Copyright 2011-2012 Antoine Bertin <[email protected]>
#
# This file is part of subliminal.
#
# subliminal is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; eith... | # -*- coding: utf-8 -*-
# Copyright 2011-2012 Antoine Bertin <[email protected]>
#
# This file is part of subliminal.
#
# subliminal is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 3 of... | # -*- coding: utf-8 -*-
# Copyright 2011-2012 Antoine Bertin <[email protected]>
#
# This file is part of subliminal.
#
# subliminal is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 3 of... | <commit_before># -*- coding: utf-8 -*-
# Copyright 2011-2012 Antoine Bertin <[email protected]>
#
# This file is part of subliminal.
#
# subliminal is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; eith... |
a18e29b492cefaac64b2bd217a897aff7ebd8466 | tests/__init__.py | tests/__init__.py | # tests.__init__
import os
import os.path
import shutil
import tempfile
import yvs.shared as yvs
temp_dir = tempfile.gettempdir()
yvs.LOCAL_DATA_DIR_PATH = os.path.join(temp_dir, 'yvs-data')
yvs.LOCAL_CACHE_DIR_PATH = os.path.join(temp_dir, 'yvs-cache')
def set_up():
try:
os.mkdir(yvs.LOCAL_DATA_DIR_PA... | # tests.__init__
import os
import os.path
import shutil
import tempfile
import yvs.shared as yvs
from mock import patch
temp_dir = tempfile.gettempdir()
local_data_dir_patcher = patch(
'yvs.shared.LOCAL_DATA_DIR_PATH',
os.path.join(temp_dir, 'yvs-data'))
local_cache_dir_patcher = patch(
'yvs.shared.LOCAL... | Use patchers for overriding data/cache directories | Use patchers for overriding data/cache directories
| Python | mit | caleb531/youversion-suggest,caleb531/youversion-suggest | # tests.__init__
import os
import os.path
import shutil
import tempfile
import yvs.shared as yvs
temp_dir = tempfile.gettempdir()
yvs.LOCAL_DATA_DIR_PATH = os.path.join(temp_dir, 'yvs-data')
yvs.LOCAL_CACHE_DIR_PATH = os.path.join(temp_dir, 'yvs-cache')
def set_up():
try:
os.mkdir(yvs.LOCAL_DATA_DIR_PA... | # tests.__init__
import os
import os.path
import shutil
import tempfile
import yvs.shared as yvs
from mock import patch
temp_dir = tempfile.gettempdir()
local_data_dir_patcher = patch(
'yvs.shared.LOCAL_DATA_DIR_PATH',
os.path.join(temp_dir, 'yvs-data'))
local_cache_dir_patcher = patch(
'yvs.shared.LOCAL... | <commit_before># tests.__init__
import os
import os.path
import shutil
import tempfile
import yvs.shared as yvs
temp_dir = tempfile.gettempdir()
yvs.LOCAL_DATA_DIR_PATH = os.path.join(temp_dir, 'yvs-data')
yvs.LOCAL_CACHE_DIR_PATH = os.path.join(temp_dir, 'yvs-cache')
def set_up():
try:
os.mkdir(yvs.LO... | # tests.__init__
import os
import os.path
import shutil
import tempfile
import yvs.shared as yvs
from mock import patch
temp_dir = tempfile.gettempdir()
local_data_dir_patcher = patch(
'yvs.shared.LOCAL_DATA_DIR_PATH',
os.path.join(temp_dir, 'yvs-data'))
local_cache_dir_patcher = patch(
'yvs.shared.LOCAL... | # tests.__init__
import os
import os.path
import shutil
import tempfile
import yvs.shared as yvs
temp_dir = tempfile.gettempdir()
yvs.LOCAL_DATA_DIR_PATH = os.path.join(temp_dir, 'yvs-data')
yvs.LOCAL_CACHE_DIR_PATH = os.path.join(temp_dir, 'yvs-cache')
def set_up():
try:
os.mkdir(yvs.LOCAL_DATA_DIR_PA... | <commit_before># tests.__init__
import os
import os.path
import shutil
import tempfile
import yvs.shared as yvs
temp_dir = tempfile.gettempdir()
yvs.LOCAL_DATA_DIR_PATH = os.path.join(temp_dir, 'yvs-data')
yvs.LOCAL_CACHE_DIR_PATH = os.path.join(temp_dir, 'yvs-cache')
def set_up():
try:
os.mkdir(yvs.LO... |
341dcac3331a21c1b747075ab73601cb08d4868d | compliance_checker/tests/helpers.py | compliance_checker/tests/helpers.py | from netCDF4 import Dataset
import tempfile
class MockNetCDF(Dataset):
"""
Wrapper object around NetCDF Dataset to write data only to memory.
"""
def __init__(self):
# taken from test/tst_diskless.py NetCDF library
# even though we aren't persisting data to disk, the constructor
... | from netCDF4 import Dataset
import tempfile
class MockNetCDF(Dataset):
"""
Wrapper object around NetCDF Dataset to write data only to memory.
"""
def __init__(self):
# taken from test/tst_diskless.py NetCDF library
# even though we aren't persisting data to disk, the constructor
... | Add name and dimensions attributes to MockVariable class | Add name and dimensions attributes to MockVariable class
| Python | apache-2.0 | DanielJMaher/compliance-checker,aodn/compliance-checker,ioos/compliance-checker,lukecampbell/compliance-checker,ocefpaf/compliance-checker | from netCDF4 import Dataset
import tempfile
class MockNetCDF(Dataset):
"""
Wrapper object around NetCDF Dataset to write data only to memory.
"""
def __init__(self):
# taken from test/tst_diskless.py NetCDF library
# even though we aren't persisting data to disk, the constructor
... | from netCDF4 import Dataset
import tempfile
class MockNetCDF(Dataset):
"""
Wrapper object around NetCDF Dataset to write data only to memory.
"""
def __init__(self):
# taken from test/tst_diskless.py NetCDF library
# even though we aren't persisting data to disk, the constructor
... | <commit_before>from netCDF4 import Dataset
import tempfile
class MockNetCDF(Dataset):
"""
Wrapper object around NetCDF Dataset to write data only to memory.
"""
def __init__(self):
# taken from test/tst_diskless.py NetCDF library
# even though we aren't persisting data to disk, the con... | from netCDF4 import Dataset
import tempfile
class MockNetCDF(Dataset):
"""
Wrapper object around NetCDF Dataset to write data only to memory.
"""
def __init__(self):
# taken from test/tst_diskless.py NetCDF library
# even though we aren't persisting data to disk, the constructor
... | from netCDF4 import Dataset
import tempfile
class MockNetCDF(Dataset):
"""
Wrapper object around NetCDF Dataset to write data only to memory.
"""
def __init__(self):
# taken from test/tst_diskless.py NetCDF library
# even though we aren't persisting data to disk, the constructor
... | <commit_before>from netCDF4 import Dataset
import tempfile
class MockNetCDF(Dataset):
"""
Wrapper object around NetCDF Dataset to write data only to memory.
"""
def __init__(self):
# taken from test/tst_diskless.py NetCDF library
# even though we aren't persisting data to disk, the con... |
70d2a1cd5363b0a40cc488e9f12eca59bb307a0e | pyamf/adapters/_django_contrib_auth_models.py | pyamf/adapters/_django_contrib_auth_models.py | """
"""
from django.contrib.auth import models
import pyamf.adapters
models.User.__amf__ = {
'exclude': ('message_set', 'password'),
'readonly': ('username',)
}
# ensure that the adapter that we depend on is loaded ..
pyamf.adapters.get_adapter('django.db.models.base')
pyamf.register_package(models, model... | """
"""
from django.contrib.auth import models
import pyamf.adapters
models.User.__amf__ = {
'exclude': ('message_set', 'password'),
'readonly': ('username',)
}
# ensure that the adapter that we depend on is loaded ..
pyamf.get_adapter('django.db.models.base')
pyamf.register_package(models, models.__name_... | Use the new get_adapter api | Use the new get_adapter api
| Python | mit | thijstriemstra/pyamf,hydralabs/pyamf,hydralabs/pyamf,thijstriemstra/pyamf | """
"""
from django.contrib.auth import models
import pyamf.adapters
models.User.__amf__ = {
'exclude': ('message_set', 'password'),
'readonly': ('username',)
}
# ensure that the adapter that we depend on is loaded ..
pyamf.adapters.get_adapter('django.db.models.base')
pyamf.register_package(models, model... | """
"""
from django.contrib.auth import models
import pyamf.adapters
models.User.__amf__ = {
'exclude': ('message_set', 'password'),
'readonly': ('username',)
}
# ensure that the adapter that we depend on is loaded ..
pyamf.get_adapter('django.db.models.base')
pyamf.register_package(models, models.__name_... | <commit_before>"""
"""
from django.contrib.auth import models
import pyamf.adapters
models.User.__amf__ = {
'exclude': ('message_set', 'password'),
'readonly': ('username',)
}
# ensure that the adapter that we depend on is loaded ..
pyamf.adapters.get_adapter('django.db.models.base')
pyamf.register_packag... | """
"""
from django.contrib.auth import models
import pyamf.adapters
models.User.__amf__ = {
'exclude': ('message_set', 'password'),
'readonly': ('username',)
}
# ensure that the adapter that we depend on is loaded ..
pyamf.get_adapter('django.db.models.base')
pyamf.register_package(models, models.__name_... | """
"""
from django.contrib.auth import models
import pyamf.adapters
models.User.__amf__ = {
'exclude': ('message_set', 'password'),
'readonly': ('username',)
}
# ensure that the adapter that we depend on is loaded ..
pyamf.adapters.get_adapter('django.db.models.base')
pyamf.register_package(models, model... | <commit_before>"""
"""
from django.contrib.auth import models
import pyamf.adapters
models.User.__amf__ = {
'exclude': ('message_set', 'password'),
'readonly': ('username',)
}
# ensure that the adapter that we depend on is loaded ..
pyamf.adapters.get_adapter('django.db.models.base')
pyamf.register_packag... |
7aa341cc37f480717a3b2c42a20f44b5d174e0eb | create_sample.py | create_sample.py | # importing modules/ libraries
import pandas as pd
import random
import numpy as np
# create a sample of prior orders
orders_df = pd.read_csv("Data/orders.csv")
s = round(3214874 * 0.1)
i = sorted(random.sample(list(orders_df[orders_df["eval_set"]=="prior"].index), s))
orders_df.loc[i,:].to_csv("Data/orders_prior_samp... | # importing modules/ libraries
import pandas as pd
import random
import numpy as np
# create a sample of prior orders
orders_df = pd.read_csv("Data/orders.csv")
s = round(3214874 * 0.01)
i = sorted(random.sample(list(orders_df[orders_df["eval_set"]=="prior"].index), s))
orders_df.loc[i,:].to_csv("Data/orders_prior_sam... | Reduce sample size for faster processing | fix: Reduce sample size for faster processing
| Python | mit | rjegankumar/instacart_prediction_model | # importing modules/ libraries
import pandas as pd
import random
import numpy as np
# create a sample of prior orders
orders_df = pd.read_csv("Data/orders.csv")
s = round(3214874 * 0.1)
i = sorted(random.sample(list(orders_df[orders_df["eval_set"]=="prior"].index), s))
orders_df.loc[i,:].to_csv("Data/orders_prior_samp... | # importing modules/ libraries
import pandas as pd
import random
import numpy as np
# create a sample of prior orders
orders_df = pd.read_csv("Data/orders.csv")
s = round(3214874 * 0.01)
i = sorted(random.sample(list(orders_df[orders_df["eval_set"]=="prior"].index), s))
orders_df.loc[i,:].to_csv("Data/orders_prior_sam... | <commit_before># importing modules/ libraries
import pandas as pd
import random
import numpy as np
# create a sample of prior orders
orders_df = pd.read_csv("Data/orders.csv")
s = round(3214874 * 0.1)
i = sorted(random.sample(list(orders_df[orders_df["eval_set"]=="prior"].index), s))
orders_df.loc[i,:].to_csv("Data/or... | # importing modules/ libraries
import pandas as pd
import random
import numpy as np
# create a sample of prior orders
orders_df = pd.read_csv("Data/orders.csv")
s = round(3214874 * 0.01)
i = sorted(random.sample(list(orders_df[orders_df["eval_set"]=="prior"].index), s))
orders_df.loc[i,:].to_csv("Data/orders_prior_sam... | # importing modules/ libraries
import pandas as pd
import random
import numpy as np
# create a sample of prior orders
orders_df = pd.read_csv("Data/orders.csv")
s = round(3214874 * 0.1)
i = sorted(random.sample(list(orders_df[orders_df["eval_set"]=="prior"].index), s))
orders_df.loc[i,:].to_csv("Data/orders_prior_samp... | <commit_before># importing modules/ libraries
import pandas as pd
import random
import numpy as np
# create a sample of prior orders
orders_df = pd.read_csv("Data/orders.csv")
s = round(3214874 * 0.1)
i = sorted(random.sample(list(orders_df[orders_df["eval_set"]=="prior"].index), s))
orders_df.loc[i,:].to_csv("Data/or... |
316066b2415861b65d540b822df1b2afea906207 | regulations/management/commands/setup_cors.py | regulations/management/commands/setup_cors.py | import boto3
from django.conf import settings
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = 'Set CORS rules on the Notice and Comment attachment bucket'
def handle(self, *args, **options):
session = boto3.Session(
aws_access_key_id=settings.ATTACHM... | import boto3
from django.conf import settings
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = 'Set CORS rules on the Notice and Comment attachment bucket'
def handle(self, *args, **options):
hosts = settings.ALLOWED_HOSTS
origins = ['http://' + host for ... | Add protocol to hosts for CORS | Add protocol to hosts for CORS
| Python | cc0-1.0 | 18F/regulations-site,tadhg-ohiggins/regulations-site,eregs/regulations-site,18F/regulations-site,eregs/regulations-site,eregs/regulations-site,tadhg-ohiggins/regulations-site,tadhg-ohiggins/regulations-site,18F/regulations-site,eregs/regulations-site,18F/regulations-site,tadhg-ohiggins/regulations-site | import boto3
from django.conf import settings
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = 'Set CORS rules on the Notice and Comment attachment bucket'
def handle(self, *args, **options):
session = boto3.Session(
aws_access_key_id=settings.ATTACHM... | import boto3
from django.conf import settings
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = 'Set CORS rules on the Notice and Comment attachment bucket'
def handle(self, *args, **options):
hosts = settings.ALLOWED_HOSTS
origins = ['http://' + host for ... | <commit_before>import boto3
from django.conf import settings
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = 'Set CORS rules on the Notice and Comment attachment bucket'
def handle(self, *args, **options):
session = boto3.Session(
aws_access_key_id=s... | import boto3
from django.conf import settings
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = 'Set CORS rules on the Notice and Comment attachment bucket'
def handle(self, *args, **options):
hosts = settings.ALLOWED_HOSTS
origins = ['http://' + host for ... | import boto3
from django.conf import settings
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = 'Set CORS rules on the Notice and Comment attachment bucket'
def handle(self, *args, **options):
session = boto3.Session(
aws_access_key_id=settings.ATTACHM... | <commit_before>import boto3
from django.conf import settings
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = 'Set CORS rules on the Notice and Comment attachment bucket'
def handle(self, *args, **options):
session = boto3.Session(
aws_access_key_id=s... |
cdfa65efbb9c97f060a51aa5613a2788c437e0a1 | pal/services/__init__.py | pal/services/__init__.py | from pal.services.bonapp_service import BonAppService
from pal.services.dictionary_service import DictionaryService
from pal.services.directory_service import DirectoryService
from pal.services.joke_service import JokeService
from pal.services.movie_service import MovieService
from pal.services.service import wrap_resp... | from pal.services.bonapp_service import BonAppService
from pal.services.dictionary_service import DictionaryService
from pal.services.directory_service import DirectoryService
from pal.services.joke_service import JokeService
from pal.services.movie_service import MovieService
from pal.services.service import wrap_resp... | Put JokeService in the right place alphabetically | Put JokeService in the right place alphabetically
| Python | bsd-3-clause | Machyne/pal,Machyne/pal,Machyne/pal,Machyne/pal | from pal.services.bonapp_service import BonAppService
from pal.services.dictionary_service import DictionaryService
from pal.services.directory_service import DirectoryService
from pal.services.joke_service import JokeService
from pal.services.movie_service import MovieService
from pal.services.service import wrap_resp... | from pal.services.bonapp_service import BonAppService
from pal.services.dictionary_service import DictionaryService
from pal.services.directory_service import DirectoryService
from pal.services.joke_service import JokeService
from pal.services.movie_service import MovieService
from pal.services.service import wrap_resp... | <commit_before>from pal.services.bonapp_service import BonAppService
from pal.services.dictionary_service import DictionaryService
from pal.services.directory_service import DirectoryService
from pal.services.joke_service import JokeService
from pal.services.movie_service import MovieService
from pal.services.service i... | from pal.services.bonapp_service import BonAppService
from pal.services.dictionary_service import DictionaryService
from pal.services.directory_service import DirectoryService
from pal.services.joke_service import JokeService
from pal.services.movie_service import MovieService
from pal.services.service import wrap_resp... | from pal.services.bonapp_service import BonAppService
from pal.services.dictionary_service import DictionaryService
from pal.services.directory_service import DirectoryService
from pal.services.joke_service import JokeService
from pal.services.movie_service import MovieService
from pal.services.service import wrap_resp... | <commit_before>from pal.services.bonapp_service import BonAppService
from pal.services.dictionary_service import DictionaryService
from pal.services.directory_service import DirectoryService
from pal.services.joke_service import JokeService
from pal.services.movie_service import MovieService
from pal.services.service i... |
6fe588ea915d65fdab00b53f883b0a72ef6cf564 | tests/test_apd.py | tests/test_apd.py | import json
from sforparser.apd import scraper
INPUT_FILE = 'data/apd/input.txt'
def test_output_strips_email_spaces():
json_str = scraper(open(INPUT_FILE))
data = json.loads(json_str)
offensive_field = data[70]["locations"][0]["emails"]
expected = [
"[email protected]",
"jua... | import json
import os
import pytest
from sforparser.apd import scraper
INPUT_FILE = 'data/apd/input.txt'
@pytest.fixture
def data():
json_str = scraper(open(INPUT_FILE))
artifact_dir = os.getenv('CIRCLE_ARTIFACTS')
if artifact_dir:
artifact_file = os.path.join(artifact_dir, 'apd.json')
... | Switch to pytest fixture and generate artifact for circle ci | Switch to pytest fixture and generate artifact for circle ci
| Python | mit | sfbrigade/sf-openreferral-datalib | import json
from sforparser.apd import scraper
INPUT_FILE = 'data/apd/input.txt'
def test_output_strips_email_spaces():
json_str = scraper(open(INPUT_FILE))
data = json.loads(json_str)
offensive_field = data[70]["locations"][0]["emails"]
expected = [
"[email protected]",
"jua... | import json
import os
import pytest
from sforparser.apd import scraper
INPUT_FILE = 'data/apd/input.txt'
@pytest.fixture
def data():
json_str = scraper(open(INPUT_FILE))
artifact_dir = os.getenv('CIRCLE_ARTIFACTS')
if artifact_dir:
artifact_file = os.path.join(artifact_dir, 'apd.json')
... | <commit_before>import json
from sforparser.apd import scraper
INPUT_FILE = 'data/apd/input.txt'
def test_output_strips_email_spaces():
json_str = scraper(open(INPUT_FILE))
data = json.loads(json_str)
offensive_field = data[70]["locations"][0]["emails"]
expected = [
"[email protected]... | import json
import os
import pytest
from sforparser.apd import scraper
INPUT_FILE = 'data/apd/input.txt'
@pytest.fixture
def data():
json_str = scraper(open(INPUT_FILE))
artifact_dir = os.getenv('CIRCLE_ARTIFACTS')
if artifact_dir:
artifact_file = os.path.join(artifact_dir, 'apd.json')
... | import json
from sforparser.apd import scraper
INPUT_FILE = 'data/apd/input.txt'
def test_output_strips_email_spaces():
json_str = scraper(open(INPUT_FILE))
data = json.loads(json_str)
offensive_field = data[70]["locations"][0]["emails"]
expected = [
"[email protected]",
"jua... | <commit_before>import json
from sforparser.apd import scraper
INPUT_FILE = 'data/apd/input.txt'
def test_output_strips_email_spaces():
json_str = scraper(open(INPUT_FILE))
data = json.loads(json_str)
offensive_field = data[70]["locations"][0]["emails"]
expected = [
"[email protected]... |
c67864e50b92c38cbcc0e4e8ae630ff9e7194a55 | profiles/views.py | profiles/views.py | from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse
from django.utils.datastructures import MultiValueDictKeyError
from django.views.generic import TemplateView, UpdateView
from incuna.utils ... | from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse
from django.views.generic import TemplateView, UpdateView
from incuna.utils import get_class_from_path
from profiles.models import Profile... | Remove the exception handling code for getting the success url | Remove the exception handling code for getting the success url
| Python | bsd-2-clause | incuna/django-extensible-profiles | from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse
from django.utils.datastructures import MultiValueDictKeyError
from django.views.generic import TemplateView, UpdateView
from incuna.utils ... | from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse
from django.views.generic import TemplateView, UpdateView
from incuna.utils import get_class_from_path
from profiles.models import Profile... | <commit_before>from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse
from django.utils.datastructures import MultiValueDictKeyError
from django.views.generic import TemplateView, UpdateView
fro... | from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse
from django.views.generic import TemplateView, UpdateView
from incuna.utils import get_class_from_path
from profiles.models import Profile... | from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse
from django.utils.datastructures import MultiValueDictKeyError
from django.views.generic import TemplateView, UpdateView
from incuna.utils ... | <commit_before>from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse
from django.utils.datastructures import MultiValueDictKeyError
from django.views.generic import TemplateView, UpdateView
fro... |
48902df1fb9b8b299155cd7e2f9a2bf3444abdc8 | awsom/__init__.py | awsom/__init__.py | #!/usr/bin/python
from awsom.entity import Entity, Factory
from awsom.config import AccountEntity, config
class ModelRootFactory(Factory):
def __init__(self, entity):
super(ModelRootFactory, self).__init__(entity)
def populate(self):
# Attach all configuration-defined accounts as children of th... | #!/usr/bin/python
from awsom.entity import Entity, Factory
from awsom.config import AccountEntity, config
class ModelRootFactory(Factory):
def __init__(self, entity):
super(ModelRootFactory, self).__init__(entity)
def populate(self):
# Attach all configuration-defined accounts as children of th... | Fix bug with account additions using old Entity API | Fix bug with account additions using old Entity API
| Python | mit | tuxpiper/awsom | #!/usr/bin/python
from awsom.entity import Entity, Factory
from awsom.config import AccountEntity, config
class ModelRootFactory(Factory):
def __init__(self, entity):
super(ModelRootFactory, self).__init__(entity)
def populate(self):
# Attach all configuration-defined accounts as children of th... | #!/usr/bin/python
from awsom.entity import Entity, Factory
from awsom.config import AccountEntity, config
class ModelRootFactory(Factory):
def __init__(self, entity):
super(ModelRootFactory, self).__init__(entity)
def populate(self):
# Attach all configuration-defined accounts as children of th... | <commit_before>#!/usr/bin/python
from awsom.entity import Entity, Factory
from awsom.config import AccountEntity, config
class ModelRootFactory(Factory):
def __init__(self, entity):
super(ModelRootFactory, self).__init__(entity)
def populate(self):
# Attach all configuration-defined accounts as... | #!/usr/bin/python
from awsom.entity import Entity, Factory
from awsom.config import AccountEntity, config
class ModelRootFactory(Factory):
def __init__(self, entity):
super(ModelRootFactory, self).__init__(entity)
def populate(self):
# Attach all configuration-defined accounts as children of th... | #!/usr/bin/python
from awsom.entity import Entity, Factory
from awsom.config import AccountEntity, config
class ModelRootFactory(Factory):
def __init__(self, entity):
super(ModelRootFactory, self).__init__(entity)
def populate(self):
# Attach all configuration-defined accounts as children of th... | <commit_before>#!/usr/bin/python
from awsom.entity import Entity, Factory
from awsom.config import AccountEntity, config
class ModelRootFactory(Factory):
def __init__(self, entity):
super(ModelRootFactory, self).__init__(entity)
def populate(self):
# Attach all configuration-defined accounts as... |
dff2b0cb2b425217435deaa7c33d54f168f1a9d7 | playground/testing.py | playground/testing.py | import numpy as np
import matplotlib.pyplot as plt
def takeFFT(data):
data = data / np.linalg.norm(data)
data_squared = np.square(data)
fft_out = np.fft.fft(data_squared)
fft_shape = np.fft.fftfreq(data_squared.shape[-1])
plt.stem(fft_shape, fft_out)
#plt.stem(fft_shape, np.fft.fftshift(fft_ou... | import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
def takeFFT(data):
data = data / np.linalg.norm(data)
data_squared = np.square(data)
fft_out = np.fft.fft(data_squared)
fft_shape = np.fft.fftfreq(data_squared.shape[-1])
a = np.absolute(fft_out).argmax()
print(fft_out[a]... | Fix frequency and phase offset | Fix frequency and phase offset
| Python | mit | williamalu/mimo_usrp | import numpy as np
import matplotlib.pyplot as plt
def takeFFT(data):
data = data / np.linalg.norm(data)
data_squared = np.square(data)
fft_out = np.fft.fft(data_squared)
fft_shape = np.fft.fftfreq(data_squared.shape[-1])
plt.stem(fft_shape, fft_out)
#plt.stem(fft_shape, np.fft.fftshift(fft_ou... | import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
def takeFFT(data):
data = data / np.linalg.norm(data)
data_squared = np.square(data)
fft_out = np.fft.fft(data_squared)
fft_shape = np.fft.fftfreq(data_squared.shape[-1])
a = np.absolute(fft_out).argmax()
print(fft_out[a]... | <commit_before>import numpy as np
import matplotlib.pyplot as plt
def takeFFT(data):
data = data / np.linalg.norm(data)
data_squared = np.square(data)
fft_out = np.fft.fft(data_squared)
fft_shape = np.fft.fftfreq(data_squared.shape[-1])
plt.stem(fft_shape, fft_out)
#plt.stem(fft_shape, np.fft.... | import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
def takeFFT(data):
data = data / np.linalg.norm(data)
data_squared = np.square(data)
fft_out = np.fft.fft(data_squared)
fft_shape = np.fft.fftfreq(data_squared.shape[-1])
a = np.absolute(fft_out).argmax()
print(fft_out[a]... | import numpy as np
import matplotlib.pyplot as plt
def takeFFT(data):
data = data / np.linalg.norm(data)
data_squared = np.square(data)
fft_out = np.fft.fft(data_squared)
fft_shape = np.fft.fftfreq(data_squared.shape[-1])
plt.stem(fft_shape, fft_out)
#plt.stem(fft_shape, np.fft.fftshift(fft_ou... | <commit_before>import numpy as np
import matplotlib.pyplot as plt
def takeFFT(data):
data = data / np.linalg.norm(data)
data_squared = np.square(data)
fft_out = np.fft.fft(data_squared)
fft_shape = np.fft.fftfreq(data_squared.shape[-1])
plt.stem(fft_shape, fft_out)
#plt.stem(fft_shape, np.fft.... |
4c23e08172f3a1dfc64e32fce53f8f7188a0bf0c | pubsubpull/api.py | pubsubpull/api.py | """
APIs exposed by pubsubpull.
"""
from __future__ import absolute_import
from async.api import schedule
from django.db import connection
from pubsubpull import _join_with_project_path
def add_trigger_function():
"""Used for older versions of Postres, or test runs where there are no
migrations.
... | """
APIs exposed by pubsubpull.
"""
from __future__ import absolute_import
from async.api import schedule
from django.db import connection
from pubsubpull import _join_with_project_path
def add_trigger_function():
"""Used for older versions of Postres, or test runs where there are no
migrations.
... | Return the SQL we've just tried to run | Return the SQL we've just tried to run
| Python | mit | KayEss/django-pubsubpull,KayEss/django-pubsubpull,KayEss/django-pubsubpull | """
APIs exposed by pubsubpull.
"""
from __future__ import absolute_import
from async.api import schedule
from django.db import connection
from pubsubpull import _join_with_project_path
def add_trigger_function():
"""Used for older versions of Postres, or test runs where there are no
migrations.
... | """
APIs exposed by pubsubpull.
"""
from __future__ import absolute_import
from async.api import schedule
from django.db import connection
from pubsubpull import _join_with_project_path
def add_trigger_function():
"""Used for older versions of Postres, or test runs where there are no
migrations.
... | <commit_before>"""
APIs exposed by pubsubpull.
"""
from __future__ import absolute_import
from async.api import schedule
from django.db import connection
from pubsubpull import _join_with_project_path
def add_trigger_function():
"""Used for older versions of Postres, or test runs where there are no
... | """
APIs exposed by pubsubpull.
"""
from __future__ import absolute_import
from async.api import schedule
from django.db import connection
from pubsubpull import _join_with_project_path
def add_trigger_function():
"""Used for older versions of Postres, or test runs where there are no
migrations.
... | """
APIs exposed by pubsubpull.
"""
from __future__ import absolute_import
from async.api import schedule
from django.db import connection
from pubsubpull import _join_with_project_path
def add_trigger_function():
"""Used for older versions of Postres, or test runs where there are no
migrations.
... | <commit_before>"""
APIs exposed by pubsubpull.
"""
from __future__ import absolute_import
from async.api import schedule
from django.db import connection
from pubsubpull import _join_with_project_path
def add_trigger_function():
"""Used for older versions of Postres, or test runs where there are no
... |
c39c362e949a7d89f92207d0b26bc9f6d61eacae | ibmcnx/doc/DataSources.py | ibmcnx/doc/DataSources.py | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: [email protected]
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: [email protected]
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | Create script to save documentation to a file | 4: Create script to save documentation to a file
Task-Url: http://github.com/stoeps13/ibmcnx2/issues/issue/4 | Python | apache-2.0 | stoeps13/ibmcnx2,stoeps13/ibmcnx2 | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: [email protected]
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: [email protected]
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | <commit_before>######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: [email protected]
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Co... | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: [email protected]
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: [email protected]
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | <commit_before>######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: [email protected]
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Co... |
c825373971d0ad24e4ca71fd4da88e55e62a6b17 | productmd/__init__.py | productmd/__init__.py | # -*- coding: utf-8 -*-
# Copyright (C) 2015 Red Hat, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
... | Allow importing major classes directly from productmd | Allow importing major classes directly from productmd
This should simplify things for most users: just import productmd module
and Compose (the one for metadata loading), Rpms and Images classes are
directly available as well as ComposeInfo, DiscInfo and TreeInfo.
| Python | lgpl-2.1 | release-engineering/productmd,lubomir/productmd,release-engineering/productmd,lubomir/productmd | Allow importing major classes directly from productmd
This should simplify things for most users: just import productmd module
and Compose (the one for metadata loading), Rpms and Images classes are
directly available as well as ComposeInfo, DiscInfo and TreeInfo. | # -*- coding: utf-8 -*-
# Copyright (C) 2015 Red Hat, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
... | <commit_before><commit_msg>Allow importing major classes directly from productmd
This should simplify things for most users: just import productmd module
and Compose (the one for metadata loading), Rpms and Images classes are
directly available as well as ComposeInfo, DiscInfo and TreeInfo.<commit_after> | # -*- coding: utf-8 -*-
# Copyright (C) 2015 Red Hat, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
... | Allow importing major classes directly from productmd
This should simplify things for most users: just import productmd module
and Compose (the one for metadata loading), Rpms and Images classes are
directly available as well as ComposeInfo, DiscInfo and TreeInfo.# -*- coding: utf-8 -*-
# Copyright (C) 2015 Red Hat,... | <commit_before><commit_msg>Allow importing major classes directly from productmd
This should simplify things for most users: just import productmd module
and Compose (the one for metadata loading), Rpms and Images classes are
directly available as well as ComposeInfo, DiscInfo and TreeInfo.<commit_after># -*- coding: ... | |
ceda6bd7388df744e3ffd93118919ae67c55fe97 | unittest-build.py | unittest-build.py | #!/usr/bin/python
import sys
import os
if sys.platform == 'win32':
os.system ( 'devenv /build libSequantoAutomation.sln' )
else:
os.system ( 'make' )
| #!/usr/bin/python
import sys
import os
if sys.platform == 'win32':
os.system ( 'devenv libSequantoAutomation.sln /build Debug' )
else:
os.system ( 'make' )
| Fix devenv call in unittesting script. | Fix devenv call in unittesting script.
| Python | apache-2.0 | seqzap/sequanto-automation,seqzap/sequanto-automation,rasmus-toftdahl-olesen/sequanto-automation,rasmus-toftdahl-olesen/sequanto-automation,micronpn/sequanto-automation,micronpn/sequanto-automation,rasmus-toftdahl-olesen/sequanto-automation,seqzap/sequanto-automation,seqzap/sequanto-automation,seqzap/sequanto-automatio... | #!/usr/bin/python
import sys
import os
if sys.platform == 'win32':
os.system ( 'devenv /build libSequantoAutomation.sln' )
else:
os.system ( 'make' )
Fix devenv call in unittesting script. | #!/usr/bin/python
import sys
import os
if sys.platform == 'win32':
os.system ( 'devenv libSequantoAutomation.sln /build Debug' )
else:
os.system ( 'make' )
| <commit_before>#!/usr/bin/python
import sys
import os
if sys.platform == 'win32':
os.system ( 'devenv /build libSequantoAutomation.sln' )
else:
os.system ( 'make' )
<commit_msg>Fix devenv call in unittesting script.<commit_after> | #!/usr/bin/python
import sys
import os
if sys.platform == 'win32':
os.system ( 'devenv libSequantoAutomation.sln /build Debug' )
else:
os.system ( 'make' )
| #!/usr/bin/python
import sys
import os
if sys.platform == 'win32':
os.system ( 'devenv /build libSequantoAutomation.sln' )
else:
os.system ( 'make' )
Fix devenv call in unittesting script.#!/usr/bin/python
import sys
import os
if sys.platform == 'win32':
os.system ( 'devenv libSequantoAutomation.sln /bu... | <commit_before>#!/usr/bin/python
import sys
import os
if sys.platform == 'win32':
os.system ( 'devenv /build libSequantoAutomation.sln' )
else:
os.system ( 'make' )
<commit_msg>Fix devenv call in unittesting script.<commit_after>#!/usr/bin/python
import sys
import os
if sys.platform == 'win32':
os.syste... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.