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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
891e9e05f8c3fde75bb217d8d8132cdf6003e827 | locust/shape.py | locust/shape.py | from __future__ import annotations
import time
from typing import Optional, Tuple, List, Type
from . import User
from .runners import Runner
class LoadTestShape:
"""
A simple load test shape class used to control the shape of load generated
during a load test.
"""
runner: Optional[Runner] = None... | from __future__ import annotations
import time
from typing import Optional, Tuple, List, Type
from abc import ABC, abstractmethod
from . import User
from .runners import Runner
class LoadTestShape(ABC):
"""
Base class for custom load shapes.
"""
runner: Optional[Runner] = None
"""Reference to th... | Make LoadTestShape a proper abstract class. | Make LoadTestShape a proper abstract class.
| Python | mit | locustio/locust,locustio/locust,locustio/locust,locustio/locust | from __future__ import annotations
import time
from typing import Optional, Tuple, List, Type
from . import User
from .runners import Runner
class LoadTestShape:
"""
A simple load test shape class used to control the shape of load generated
during a load test.
"""
runner: Optional[Runner] = None... | from __future__ import annotations
import time
from typing import Optional, Tuple, List, Type
from abc import ABC, abstractmethod
from . import User
from .runners import Runner
class LoadTestShape(ABC):
"""
Base class for custom load shapes.
"""
runner: Optional[Runner] = None
"""Reference to th... | <commit_before>from __future__ import annotations
import time
from typing import Optional, Tuple, List, Type
from . import User
from .runners import Runner
class LoadTestShape:
"""
A simple load test shape class used to control the shape of load generated
during a load test.
"""
runner: Optional... | from __future__ import annotations
import time
from typing import Optional, Tuple, List, Type
from abc import ABC, abstractmethod
from . import User
from .runners import Runner
class LoadTestShape(ABC):
"""
Base class for custom load shapes.
"""
runner: Optional[Runner] = None
"""Reference to th... | from __future__ import annotations
import time
from typing import Optional, Tuple, List, Type
from . import User
from .runners import Runner
class LoadTestShape:
"""
A simple load test shape class used to control the shape of load generated
during a load test.
"""
runner: Optional[Runner] = None... | <commit_before>from __future__ import annotations
import time
from typing import Optional, Tuple, List, Type
from . import User
from .runners import Runner
class LoadTestShape:
"""
A simple load test shape class used to control the shape of load generated
during a load test.
"""
runner: Optional... |
4bdaf4d2e29da71a1bf00e1bfc5caad6d3647372 | search/views.py | search/views.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.core.management import call_command
from django.shortcuts import render
@login_required(login_url='/accounts/login/')
def search_index(request):
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.core.management import call_command
from django.shortcuts import render
@login_required(login_url='/accounts/login/')
def search_index(request):
... | Fix error in search index not updating on view call. | Fix error in search index not updating on view call.
| Python | apache-2.0 | toladata/TolaActivity,toladata/TolaActivity,toladata/TolaActivity,toladata/TolaActivity | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.core.management import call_command
from django.shortcuts import render
@login_required(login_url='/accounts/login/')
def search_index(request):
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.core.management import call_command
from django.shortcuts import render
@login_required(login_url='/accounts/login/')
def search_index(request):
... | <commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.core.management import call_command
from django.shortcuts import render
@login_required(login_url='/accounts/login/')
def search_ind... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.core.management import call_command
from django.shortcuts import render
@login_required(login_url='/accounts/login/')
def search_index(request):
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.core.management import call_command
from django.shortcuts import render
@login_required(login_url='/accounts/login/')
def search_index(request):
... | <commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.core.management import call_command
from django.shortcuts import render
@login_required(login_url='/accounts/login/')
def search_ind... |
1f0e5b7e65914ec5c3fb0a6617f72ea2f466bbdc | server/admin.py | server/admin.py | from django.contrib import admin
from server.models import *
class MachineGroupAdmin(admin.ModelAdmin):
readonly_fields = ('key',)
class MachineAdmin(admin.ModelAdmin):
list_display = ('hostname', 'serial')
admin.site.register(UserProfile)
admin.site.register(BusinessUnit)
admin.site.register(MachineGroup... | from django.contrib import admin
from server.models import *
class ApiKeyAdmin(admin.ModelAdmin):
list_display = ('name', 'public_key', 'private_key')
class MachineAdmin(admin.ModelAdmin):
list_display = ('hostname', 'serial')
class MachineGroupAdmin(admin.ModelAdmin):
readonly_fields = ('key',)
ad... | Sort registrations. Separate classes of imports. Add API key display. | Sort registrations. Separate classes of imports. Add API key display.
| Python | apache-2.0 | salopensource/sal,salopensource/sal,sheagcraig/sal,salopensource/sal,sheagcraig/sal,sheagcraig/sal,salopensource/sal,sheagcraig/sal | from django.contrib import admin
from server.models import *
class MachineGroupAdmin(admin.ModelAdmin):
readonly_fields = ('key',)
class MachineAdmin(admin.ModelAdmin):
list_display = ('hostname', 'serial')
admin.site.register(UserProfile)
admin.site.register(BusinessUnit)
admin.site.register(MachineGroup... | from django.contrib import admin
from server.models import *
class ApiKeyAdmin(admin.ModelAdmin):
list_display = ('name', 'public_key', 'private_key')
class MachineAdmin(admin.ModelAdmin):
list_display = ('hostname', 'serial')
class MachineGroupAdmin(admin.ModelAdmin):
readonly_fields = ('key',)
ad... | <commit_before>from django.contrib import admin
from server.models import *
class MachineGroupAdmin(admin.ModelAdmin):
readonly_fields = ('key',)
class MachineAdmin(admin.ModelAdmin):
list_display = ('hostname', 'serial')
admin.site.register(UserProfile)
admin.site.register(BusinessUnit)
admin.site.regist... | from django.contrib import admin
from server.models import *
class ApiKeyAdmin(admin.ModelAdmin):
list_display = ('name', 'public_key', 'private_key')
class MachineAdmin(admin.ModelAdmin):
list_display = ('hostname', 'serial')
class MachineGroupAdmin(admin.ModelAdmin):
readonly_fields = ('key',)
ad... | from django.contrib import admin
from server.models import *
class MachineGroupAdmin(admin.ModelAdmin):
readonly_fields = ('key',)
class MachineAdmin(admin.ModelAdmin):
list_display = ('hostname', 'serial')
admin.site.register(UserProfile)
admin.site.register(BusinessUnit)
admin.site.register(MachineGroup... | <commit_before>from django.contrib import admin
from server.models import *
class MachineGroupAdmin(admin.ModelAdmin):
readonly_fields = ('key',)
class MachineAdmin(admin.ModelAdmin):
list_display = ('hostname', 'serial')
admin.site.register(UserProfile)
admin.site.register(BusinessUnit)
admin.site.regist... |
51076b9d21679b1198931e2517afbf7c6d2e573a | src/competition/forms/team_forms.py | src/competition/forms/team_forms.py | from django import forms
from django.template.defaultfilters import slugify
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Fieldset, Submit
from crispy_forms.bootstrap import FormActions
from competition.models.team_model import Team
class TeamForm(forms.ModelForm):
class Met... | from django import forms
from django.template.defaultfilters import slugify
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Fieldset, Submit
from crispy_forms.bootstrap import FormActions
from competition.models.team_model import Team
class TeamForm(forms.ModelForm):
class Met... | Update forms to bootstrap 3 | Update forms to bootstrap 3
form-horizontal needs additional helper classes in BS3
| Python | bsd-3-clause | michaelwisely/django-competition,michaelwisely/django-competition,michaelwisely/django-competition | from django import forms
from django.template.defaultfilters import slugify
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Fieldset, Submit
from crispy_forms.bootstrap import FormActions
from competition.models.team_model import Team
class TeamForm(forms.ModelForm):
class Met... | from django import forms
from django.template.defaultfilters import slugify
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Fieldset, Submit
from crispy_forms.bootstrap import FormActions
from competition.models.team_model import Team
class TeamForm(forms.ModelForm):
class Met... | <commit_before>from django import forms
from django.template.defaultfilters import slugify
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Fieldset, Submit
from crispy_forms.bootstrap import FormActions
from competition.models.team_model import Team
class TeamForm(forms.ModelForm)... | from django import forms
from django.template.defaultfilters import slugify
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Fieldset, Submit
from crispy_forms.bootstrap import FormActions
from competition.models.team_model import Team
class TeamForm(forms.ModelForm):
class Met... | from django import forms
from django.template.defaultfilters import slugify
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Fieldset, Submit
from crispy_forms.bootstrap import FormActions
from competition.models.team_model import Team
class TeamForm(forms.ModelForm):
class Met... | <commit_before>from django import forms
from django.template.defaultfilters import slugify
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Fieldset, Submit
from crispy_forms.bootstrap import FormActions
from competition.models.team_model import Team
class TeamForm(forms.ModelForm)... |
07e780a27253c4108c96e232ffbb975e88d23f8d | src/pygrapes/serializer/__init__.py | src/pygrapes/serializer/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from abstract import Abstract
__all__ = ['Abstract']
| #!/usr/bin/env python
# -*- coding: utf-8 -*-
from abstract import Abstract
from json import Json
__all__ = ['Abstract', 'Json']
| Load pygrapes.serializer.json.Json right inside pygrapes.serializer | Load pygrapes.serializer.json.Json right inside pygrapes.serializer
| Python | bsd-3-clause | michalbachowski/pygrapes,michalbachowski/pygrapes,michalbachowski/pygrapes | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from abstract import Abstract
__all__ = ['Abstract']
Load pygrapes.serializer.json.Json right inside pygrapes.serializer | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from abstract import Abstract
from json import Json
__all__ = ['Abstract', 'Json']
| <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from abstract import Abstract
__all__ = ['Abstract']
<commit_msg>Load pygrapes.serializer.json.Json right inside pygrapes.serializer<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from abstract import Abstract
from json import Json
__all__ = ['Abstract', 'Json']
| #!/usr/bin/env python
# -*- coding: utf-8 -*-
from abstract import Abstract
__all__ = ['Abstract']
Load pygrapes.serializer.json.Json right inside pygrapes.serializer#!/usr/bin/env python
# -*- coding: utf-8 -*-
from abstract import Abstract
from json import Json
__all__ = ['Abstract', 'Json']
| <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from abstract import Abstract
__all__ = ['Abstract']
<commit_msg>Load pygrapes.serializer.json.Json right inside pygrapes.serializer<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from abstract import Abstract
from json import Json
__all__ = ['... |
384c2f34fcdefd26a928254e70a9ed6d15ffd069 | dimod/reference/samplers/random_sampler.py | dimod/reference/samplers/random_sampler.py | """
RandomSampler
-------------
A random sampler that can be used for unit testing and debugging.
"""
import numpy as np
from dimod.core.sampler import Sampler
from dimod.response import Response, SampleView
__all__ = ['RandomSampler']
class RandomSampler(Sampler):
"""Gives random samples.
Note that this ... | """
RandomSampler
-------------
A random sampler that can be used for unit testing and debugging.
"""
import numpy as np
from dimod.core.sampler import Sampler
from dimod.response import Response, SampleView
__all__ = ['RandomSampler']
class RandomSampler(Sampler):
"""Gives random samples.
Note that this ... | Update RandomSampler to use the new Sampler abc | Update RandomSampler to use the new Sampler abc
| Python | apache-2.0 | dwavesystems/dimod,dwavesystems/dimod | """
RandomSampler
-------------
A random sampler that can be used for unit testing and debugging.
"""
import numpy as np
from dimod.core.sampler import Sampler
from dimod.response import Response, SampleView
__all__ = ['RandomSampler']
class RandomSampler(Sampler):
"""Gives random samples.
Note that this ... | """
RandomSampler
-------------
A random sampler that can be used for unit testing and debugging.
"""
import numpy as np
from dimod.core.sampler import Sampler
from dimod.response import Response, SampleView
__all__ = ['RandomSampler']
class RandomSampler(Sampler):
"""Gives random samples.
Note that this ... | <commit_before>"""
RandomSampler
-------------
A random sampler that can be used for unit testing and debugging.
"""
import numpy as np
from dimod.core.sampler import Sampler
from dimod.response import Response, SampleView
__all__ = ['RandomSampler']
class RandomSampler(Sampler):
"""Gives random samples.
... | """
RandomSampler
-------------
A random sampler that can be used for unit testing and debugging.
"""
import numpy as np
from dimod.core.sampler import Sampler
from dimod.response import Response, SampleView
__all__ = ['RandomSampler']
class RandomSampler(Sampler):
"""Gives random samples.
Note that this ... | """
RandomSampler
-------------
A random sampler that can be used for unit testing and debugging.
"""
import numpy as np
from dimod.core.sampler import Sampler
from dimod.response import Response, SampleView
__all__ = ['RandomSampler']
class RandomSampler(Sampler):
"""Gives random samples.
Note that this ... | <commit_before>"""
RandomSampler
-------------
A random sampler that can be used for unit testing and debugging.
"""
import numpy as np
from dimod.core.sampler import Sampler
from dimod.response import Response, SampleView
__all__ = ['RandomSampler']
class RandomSampler(Sampler):
"""Gives random samples.
... |
0aa5741ce05dcd4926be9c74af18f6fe46f4aded | etl_framework/utilities/DatetimeConverter.py | etl_framework/utilities/DatetimeConverter.py | """class to convert datetime values"""
import datetime
class DatetimeConverter(object):
"""stuff"""
_EPOCH_0 = datetime.datetime(1970, 1, 1)
def __init__(self):
"""stuff"""
pass
@staticmethod
def get_tomorrow():
"""stuff"""
return datetime.datetime.today() + da... | """class to convert datetime values"""
import datetime
class DatetimeConverter(object):
"""stuff"""
_EPOCH_0 = datetime.datetime(1970, 1, 1)
def __init__(self):
"""stuff"""
pass
@staticmethod
def get_tomorrow():
"""stuff"""
return datetime.datetime.today() + da... | Add utility methods for yesterday's date | Add utility methods for yesterday's date
| Python | mit | pantheon-systems/etl-framework | """class to convert datetime values"""
import datetime
class DatetimeConverter(object):
"""stuff"""
_EPOCH_0 = datetime.datetime(1970, 1, 1)
def __init__(self):
"""stuff"""
pass
@staticmethod
def get_tomorrow():
"""stuff"""
return datetime.datetime.today() + da... | """class to convert datetime values"""
import datetime
class DatetimeConverter(object):
"""stuff"""
_EPOCH_0 = datetime.datetime(1970, 1, 1)
def __init__(self):
"""stuff"""
pass
@staticmethod
def get_tomorrow():
"""stuff"""
return datetime.datetime.today() + da... | <commit_before>"""class to convert datetime values"""
import datetime
class DatetimeConverter(object):
"""stuff"""
_EPOCH_0 = datetime.datetime(1970, 1, 1)
def __init__(self):
"""stuff"""
pass
@staticmethod
def get_tomorrow():
"""stuff"""
return datetime.dateti... | """class to convert datetime values"""
import datetime
class DatetimeConverter(object):
"""stuff"""
_EPOCH_0 = datetime.datetime(1970, 1, 1)
def __init__(self):
"""stuff"""
pass
@staticmethod
def get_tomorrow():
"""stuff"""
return datetime.datetime.today() + da... | """class to convert datetime values"""
import datetime
class DatetimeConverter(object):
"""stuff"""
_EPOCH_0 = datetime.datetime(1970, 1, 1)
def __init__(self):
"""stuff"""
pass
@staticmethod
def get_tomorrow():
"""stuff"""
return datetime.datetime.today() + da... | <commit_before>"""class to convert datetime values"""
import datetime
class DatetimeConverter(object):
"""stuff"""
_EPOCH_0 = datetime.datetime(1970, 1, 1)
def __init__(self):
"""stuff"""
pass
@staticmethod
def get_tomorrow():
"""stuff"""
return datetime.dateti... |
26bb374b00d667de00a080c4b32e102ac69a0e23 | asn1crypto/version.py | asn1crypto/version.py | # coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
__version__ = '0.24.0'
__version_info__ = (0, 24, 0)
| # coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
__version__ = '0.25.0-alpha'
__version_info__ = (0, 25, 0, 'alpha')
| Mark master as working towards 0.25.0 | Mark master as working towards 0.25.0
| Python | mit | wbond/asn1crypto | # coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
__version__ = '0.24.0'
__version_info__ = (0, 24, 0)
Mark master as working towards 0.25.0 | # coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
__version__ = '0.25.0-alpha'
__version_info__ = (0, 25, 0, 'alpha')
| <commit_before># coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
__version__ = '0.24.0'
__version_info__ = (0, 24, 0)
<commit_msg>Mark master as working towards 0.25.0<commit_after> | # coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
__version__ = '0.25.0-alpha'
__version_info__ = (0, 25, 0, 'alpha')
| # coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
__version__ = '0.24.0'
__version_info__ = (0, 24, 0)
Mark master as working towards 0.25.0# coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
__version__ = '0.25.0-alpha'... | <commit_before># coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
__version__ = '0.24.0'
__version_info__ = (0, 24, 0)
<commit_msg>Mark master as working towards 0.25.0<commit_after># coding: utf-8
from __future__ import unicode_literals, division, absolute_import, prin... |
c52a959896c345b57fdd28e2ae8cbd75ab2e3c71 | fuzzinator/call/file_reader_decorator.py | fuzzinator/call/file_reader_decorator.py | # Copyright (c) 2017-2018 Renata Hodovan, Akos Kiss.
#
# Licensed under the BSD 3-Clause License
# <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>.
# This file may not be copied, modified, or distributed except
# according to those terms.
import os
from . import CallableDecorator
class FileReaderDecor... | # Copyright (c) 2017-2018 Renata Hodovan, Akos Kiss.
#
# Licensed under the BSD 3-Clause License
# <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>.
# This file may not be copied, modified, or distributed except
# according to those terms.
import os
from . import CallableDecorator
class FileReaderDecor... | Fix a typo in the documentation of FileReaderDecorator. | Fix a typo in the documentation of FileReaderDecorator.
| Python | bsd-3-clause | renatahodovan/fuzzinator,akosthekiss/fuzzinator,renatahodovan/fuzzinator,akosthekiss/fuzzinator,akosthekiss/fuzzinator,renatahodovan/fuzzinator,renatahodovan/fuzzinator,akosthekiss/fuzzinator | # Copyright (c) 2017-2018 Renata Hodovan, Akos Kiss.
#
# Licensed under the BSD 3-Clause License
# <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>.
# This file may not be copied, modified, or distributed except
# according to those terms.
import os
from . import CallableDecorator
class FileReaderDecor... | # Copyright (c) 2017-2018 Renata Hodovan, Akos Kiss.
#
# Licensed under the BSD 3-Clause License
# <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>.
# This file may not be copied, modified, or distributed except
# according to those terms.
import os
from . import CallableDecorator
class FileReaderDecor... | <commit_before># Copyright (c) 2017-2018 Renata Hodovan, Akos Kiss.
#
# Licensed under the BSD 3-Clause License
# <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>.
# This file may not be copied, modified, or distributed except
# according to those terms.
import os
from . import CallableDecorator
class ... | # Copyright (c) 2017-2018 Renata Hodovan, Akos Kiss.
#
# Licensed under the BSD 3-Clause License
# <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>.
# This file may not be copied, modified, or distributed except
# according to those terms.
import os
from . import CallableDecorator
class FileReaderDecor... | # Copyright (c) 2017-2018 Renata Hodovan, Akos Kiss.
#
# Licensed under the BSD 3-Clause License
# <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>.
# This file may not be copied, modified, or distributed except
# according to those terms.
import os
from . import CallableDecorator
class FileReaderDecor... | <commit_before># Copyright (c) 2017-2018 Renata Hodovan, Akos Kiss.
#
# Licensed under the BSD 3-Clause License
# <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>.
# This file may not be copied, modified, or distributed except
# according to those terms.
import os
from . import CallableDecorator
class ... |
cbd913af9013926ca7f08ab56023d7242e783698 | ad-hoc-scripts/latex-adjust.py | ad-hoc-scripts/latex-adjust.py | #! /usr/bin/env python3
import sys
import json
for arg in sys.argv[1:]:
with open(arg) as f:
equajson = json.load(f)
try:
latex = equajson["markup-languages"]["LaTeX"][0]["markup"]
except KeyError:
continue
if 'documentclass' not in latex:
with_boilerplate = "\\docume... | #! /usr/bin/env python3
import sys
import json
for arg in sys.argv[1:]:
with open(arg) as f:
equajson = json.load(f)
try:
latex = equajson["markup-languages"]["LaTeX"][0]["markup"]
except KeyError:
continue
if 'documentclass' not in latex:
with_boilerplate = "\\docume... | Add trailing newline to make round-tripping without diffs possible. | Add trailing newline to make round-tripping without diffs possible.
| Python | mit | nbeaver/equajson | #! /usr/bin/env python3
import sys
import json
for arg in sys.argv[1:]:
with open(arg) as f:
equajson = json.load(f)
try:
latex = equajson["markup-languages"]["LaTeX"][0]["markup"]
except KeyError:
continue
if 'documentclass' not in latex:
with_boilerplate = "\\docume... | #! /usr/bin/env python3
import sys
import json
for arg in sys.argv[1:]:
with open(arg) as f:
equajson = json.load(f)
try:
latex = equajson["markup-languages"]["LaTeX"][0]["markup"]
except KeyError:
continue
if 'documentclass' not in latex:
with_boilerplate = "\\docume... | <commit_before>#! /usr/bin/env python3
import sys
import json
for arg in sys.argv[1:]:
with open(arg) as f:
equajson = json.load(f)
try:
latex = equajson["markup-languages"]["LaTeX"][0]["markup"]
except KeyError:
continue
if 'documentclass' not in latex:
with_boilerpl... | #! /usr/bin/env python3
import sys
import json
for arg in sys.argv[1:]:
with open(arg) as f:
equajson = json.load(f)
try:
latex = equajson["markup-languages"]["LaTeX"][0]["markup"]
except KeyError:
continue
if 'documentclass' not in latex:
with_boilerplate = "\\docume... | #! /usr/bin/env python3
import sys
import json
for arg in sys.argv[1:]:
with open(arg) as f:
equajson = json.load(f)
try:
latex = equajson["markup-languages"]["LaTeX"][0]["markup"]
except KeyError:
continue
if 'documentclass' not in latex:
with_boilerplate = "\\docume... | <commit_before>#! /usr/bin/env python3
import sys
import json
for arg in sys.argv[1:]:
with open(arg) as f:
equajson = json.load(f)
try:
latex = equajson["markup-languages"]["LaTeX"][0]["markup"]
except KeyError:
continue
if 'documentclass' not in latex:
with_boilerpl... |
ace54e86e9462b25acd1636e0e9905ba6decfe9b | admin_tools/dashboard/views.py | admin_tools/dashboard/views.py | from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.contrib import messages
try:
from django.views.decorators.csrf import csrf_exempt
except ImportError:
from django... | from django.contrib.admin.views.decorators import staff_member_required
from django.http import HttpResponse
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.contrib import messages
try:
from django.views.decorators.csrf import csrf_exempt
except ImportError:
... | Use @staff_member_required decorator for the dashboard view as well | Use @staff_member_required decorator for the dashboard view as well
| Python | mit | django-admin-tools/django-admin-tools,django-admin-tools/django-admin-tools,django-admin-tools/django-admin-tools | from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.contrib import messages
try:
from django.views.decorators.csrf import csrf_exempt
except ImportError:
from django... | from django.contrib.admin.views.decorators import staff_member_required
from django.http import HttpResponse
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.contrib import messages
try:
from django.views.decorators.csrf import csrf_exempt
except ImportError:
... | <commit_before>from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.contrib import messages
try:
from django.views.decorators.csrf import csrf_exempt
except ImportError:
... | from django.contrib.admin.views.decorators import staff_member_required
from django.http import HttpResponse
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.contrib import messages
try:
from django.views.decorators.csrf import csrf_exempt
except ImportError:
... | from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.contrib import messages
try:
from django.views.decorators.csrf import csrf_exempt
except ImportError:
from django... | <commit_before>from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.contrib import messages
try:
from django.views.decorators.csrf import csrf_exempt
except ImportError:
... |
3219a925ecddbacb39e4adc484d94eaed6bddd0b | yolk/__init__.py | yolk/__init__.py | """yolk.
Author: Rob Cakebread <cakebread at gmail>
License : BSD
"""
__version__ = '0.8.6'
| """yolk.
Author: Rob Cakebread <cakebread at gmail>
License : BSD
"""
__version__ = '0.8.7'
| Increment patch version to 0.8.7 | Increment patch version to 0.8.7
| Python | bsd-3-clause | myint/yolk,myint/yolk | """yolk.
Author: Rob Cakebread <cakebread at gmail>
License : BSD
"""
__version__ = '0.8.6'
Increment patch version to 0.8.7 | """yolk.
Author: Rob Cakebread <cakebread at gmail>
License : BSD
"""
__version__ = '0.8.7'
| <commit_before>"""yolk.
Author: Rob Cakebread <cakebread at gmail>
License : BSD
"""
__version__ = '0.8.6'
<commit_msg>Increment patch version to 0.8.7<commit_after> | """yolk.
Author: Rob Cakebread <cakebread at gmail>
License : BSD
"""
__version__ = '0.8.7'
| """yolk.
Author: Rob Cakebread <cakebread at gmail>
License : BSD
"""
__version__ = '0.8.6'
Increment patch version to 0.8.7"""yolk.
Author: Rob Cakebread <cakebread at gmail>
License : BSD
"""
__version__ = '0.8.7'
| <commit_before>"""yolk.
Author: Rob Cakebread <cakebread at gmail>
License : BSD
"""
__version__ = '0.8.6'
<commit_msg>Increment patch version to 0.8.7<commit_after>"""yolk.
Author: Rob Cakebread <cakebread at gmail>
License : BSD
"""
__version__ = '0.8.7'
|
badcdcc03517aaf705975676a5d37488b38c9738 | foomodules/link_harvester/common_handlers.py | foomodules/link_harvester/common_handlers.py | import logging
import re
import socket
import urllib
from bs4 import BeautifulSoup
logger = logging.getLogger(__name__)
WURSTBALL_RE = re.compile(r"^https?://(www\.)?wurstball\.de/[0-9]+/")
def default_handler(metadata):
return {key: getattr(metadata, key) for key in
["original_url", "url", "title", ... | import logging
import re
import socket
import urllib
import http.client
from bs4 import BeautifulSoup
logger = logging.getLogger(__name__)
WURSTBALL_RE = re.compile(r"^https?://(www\.)?wurstball\.de/[0-9]+/")
def default_handler(metadata):
return {key: getattr(metadata, key) for key in
["original_url... | Add image_handler for link harvester | Add image_handler for link harvester
| Python | mit | horazont/xmpp-crowd | import logging
import re
import socket
import urllib
from bs4 import BeautifulSoup
logger = logging.getLogger(__name__)
WURSTBALL_RE = re.compile(r"^https?://(www\.)?wurstball\.de/[0-9]+/")
def default_handler(metadata):
return {key: getattr(metadata, key) for key in
["original_url", "url", "title", ... | import logging
import re
import socket
import urllib
import http.client
from bs4 import BeautifulSoup
logger = logging.getLogger(__name__)
WURSTBALL_RE = re.compile(r"^https?://(www\.)?wurstball\.de/[0-9]+/")
def default_handler(metadata):
return {key: getattr(metadata, key) for key in
["original_url... | <commit_before>import logging
import re
import socket
import urllib
from bs4 import BeautifulSoup
logger = logging.getLogger(__name__)
WURSTBALL_RE = re.compile(r"^https?://(www\.)?wurstball\.de/[0-9]+/")
def default_handler(metadata):
return {key: getattr(metadata, key) for key in
["original_url", "... | import logging
import re
import socket
import urllib
import http.client
from bs4 import BeautifulSoup
logger = logging.getLogger(__name__)
WURSTBALL_RE = re.compile(r"^https?://(www\.)?wurstball\.de/[0-9]+/")
def default_handler(metadata):
return {key: getattr(metadata, key) for key in
["original_url... | import logging
import re
import socket
import urllib
from bs4 import BeautifulSoup
logger = logging.getLogger(__name__)
WURSTBALL_RE = re.compile(r"^https?://(www\.)?wurstball\.de/[0-9]+/")
def default_handler(metadata):
return {key: getattr(metadata, key) for key in
["original_url", "url", "title", ... | <commit_before>import logging
import re
import socket
import urllib
from bs4 import BeautifulSoup
logger = logging.getLogger(__name__)
WURSTBALL_RE = re.compile(r"^https?://(www\.)?wurstball\.de/[0-9]+/")
def default_handler(metadata):
return {key: getattr(metadata, key) for key in
["original_url", "... |
ee31e6c0302c6840d522666b1f724d0ec429d562 | monasca_setup/detection/plugins/neutron.py | monasca_setup/detection/plugins/neutron.py | import monasca_setup.detection
class Neutron(monasca_setup.detection.ServicePlugin):
"""Detect Neutron daemons and setup configuration to monitor them.
"""
def __init__(self, template_dir, overwrite=True, args=None):
service_params = {
'args': args,
'template_dir': templ... | import monasca_setup.detection
class Neutron(monasca_setup.detection.ServicePlugin):
"""Detect Neutron daemons and setup configuration to monitor them.
"""
def __init__(self, template_dir, overwrite=True, args=None):
service_params = {
'args': args,
'template_dir': templ... | Add process monitoring for LBaaS agents | Add process monitoring for LBaaS agents
Add neutron-lbaas-agent (LBaaS V1) and neutron-lbaasv2-agent (LBaaS
V2) to the neutron detection plugin. Because the string
"neutron-lbaas-agent" can be both a process name and log file name,
the process monitor is susceptible to false positive matching on that
string. Use a lo... | Python | bsd-3-clause | sapcc/monasca-agent,sapcc/monasca-agent,sapcc/monasca-agent | import monasca_setup.detection
class Neutron(monasca_setup.detection.ServicePlugin):
"""Detect Neutron daemons and setup configuration to monitor them.
"""
def __init__(self, template_dir, overwrite=True, args=None):
service_params = {
'args': args,
'template_dir': templ... | import monasca_setup.detection
class Neutron(monasca_setup.detection.ServicePlugin):
"""Detect Neutron daemons and setup configuration to monitor them.
"""
def __init__(self, template_dir, overwrite=True, args=None):
service_params = {
'args': args,
'template_dir': templ... | <commit_before>import monasca_setup.detection
class Neutron(monasca_setup.detection.ServicePlugin):
"""Detect Neutron daemons and setup configuration to monitor them.
"""
def __init__(self, template_dir, overwrite=True, args=None):
service_params = {
'args': args,
'templ... | import monasca_setup.detection
class Neutron(monasca_setup.detection.ServicePlugin):
"""Detect Neutron daemons and setup configuration to monitor them.
"""
def __init__(self, template_dir, overwrite=True, args=None):
service_params = {
'args': args,
'template_dir': templ... | import monasca_setup.detection
class Neutron(monasca_setup.detection.ServicePlugin):
"""Detect Neutron daemons and setup configuration to monitor them.
"""
def __init__(self, template_dir, overwrite=True, args=None):
service_params = {
'args': args,
'template_dir': templ... | <commit_before>import monasca_setup.detection
class Neutron(monasca_setup.detection.ServicePlugin):
"""Detect Neutron daemons and setup configuration to monitor them.
"""
def __init__(self, template_dir, overwrite=True, args=None):
service_params = {
'args': args,
'templ... |
8769224d8dbe73e177d19012d54c9bb7e114a3fa | recipes/webrtc.py | recipes/webrtc.py | # Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
import recipe_util # pylint: disable=F0401
# This class doesn't need an __init__ method, so we disable the warning
# pylint: disable=W0232... | # Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
import recipe_util # pylint: disable=F0401
# This class doesn't need an __init__ method, so we disable the warning
# pylint: disable=W0232... | Switch WebRTC recipe to Git. | Switch WebRTC recipe to Git.
BUG=412012
Review URL: https://codereview.chromium.org/765373002
git-svn-id: fd409f4bdeea2bb50a5d34bb4d4bfc2046a5a3dd@294546 0039d316-1c4b-4281-b951-d872f2087c98
| Python | bsd-3-clause | sarvex/depot-tools,fracting/depot_tools,sarvex/depot-tools,azunite/chrome_build,disigma/depot_tools,duongbaoduy/gtools,fracting/depot_tools,hsharsha/depot_tools,Midrya/chromium,hsharsha/depot_tools,ajohnson23/depot_tools,gcodetogit/depot_tools,npe9/depot_tools,mlufei/depot_tools,primiano/depot_tools,chinmaygarde/depot_... | # Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
import recipe_util # pylint: disable=F0401
# This class doesn't need an __init__ method, so we disable the warning
# pylint: disable=W0232... | # Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
import recipe_util # pylint: disable=F0401
# This class doesn't need an __init__ method, so we disable the warning
# pylint: disable=W0232... | <commit_before># Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
import recipe_util # pylint: disable=F0401
# This class doesn't need an __init__ method, so we disable the warning
# pylint... | # Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
import recipe_util # pylint: disable=F0401
# This class doesn't need an __init__ method, so we disable the warning
# pylint: disable=W0232... | # Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
import recipe_util # pylint: disable=F0401
# This class doesn't need an __init__ method, so we disable the warning
# pylint: disable=W0232... | <commit_before># Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
import recipe_util # pylint: disable=F0401
# This class doesn't need an __init__ method, so we disable the warning
# pylint... |
2393b066fbb0fc88d9e9a1918485cf57c40aecc2 | opps/articles/templatetags/article_tags.py | opps/articles/templatetags/article_tags.py | # -*- coding: utf-8 -*-
from django import template
from django.conf import settings
from opps.articles.models import ArticleBox
register = template.Library()
@register.simple_tag
def get_articlebox(slug, channel_slug=None, template_name=None):
if channel_slug:
slug = slug + '-' + channel_slug
try:... | # -*- coding: utf-8 -*-
from django import template
from django.conf import settings
from django.utils import timezone
from opps.articles.models import ArticleBox
register = template.Library()
@register.simple_tag
def get_articlebox(slug, channel_slug=None, template_name=None):
if channel_slug:
slug = s... | Add validate published on templatetag get articlebox | Add validate published on templatetag get articlebox
| Python | mit | jeanmask/opps,williamroot/opps,opps/opps,jeanmask/opps,jeanmask/opps,YACOWS/opps,williamroot/opps,YACOWS/opps,jeanmask/opps,opps/opps,opps/opps,YACOWS/opps,opps/opps,williamroot/opps,williamroot/opps,YACOWS/opps | # -*- coding: utf-8 -*-
from django import template
from django.conf import settings
from opps.articles.models import ArticleBox
register = template.Library()
@register.simple_tag
def get_articlebox(slug, channel_slug=None, template_name=None):
if channel_slug:
slug = slug + '-' + channel_slug
try:... | # -*- coding: utf-8 -*-
from django import template
from django.conf import settings
from django.utils import timezone
from opps.articles.models import ArticleBox
register = template.Library()
@register.simple_tag
def get_articlebox(slug, channel_slug=None, template_name=None):
if channel_slug:
slug = s... | <commit_before># -*- coding: utf-8 -*-
from django import template
from django.conf import settings
from opps.articles.models import ArticleBox
register = template.Library()
@register.simple_tag
def get_articlebox(slug, channel_slug=None, template_name=None):
if channel_slug:
slug = slug + '-' + channel... | # -*- coding: utf-8 -*-
from django import template
from django.conf import settings
from django.utils import timezone
from opps.articles.models import ArticleBox
register = template.Library()
@register.simple_tag
def get_articlebox(slug, channel_slug=None, template_name=None):
if channel_slug:
slug = s... | # -*- coding: utf-8 -*-
from django import template
from django.conf import settings
from opps.articles.models import ArticleBox
register = template.Library()
@register.simple_tag
def get_articlebox(slug, channel_slug=None, template_name=None):
if channel_slug:
slug = slug + '-' + channel_slug
try:... | <commit_before># -*- coding: utf-8 -*-
from django import template
from django.conf import settings
from opps.articles.models import ArticleBox
register = template.Library()
@register.simple_tag
def get_articlebox(slug, channel_slug=None, template_name=None):
if channel_slug:
slug = slug + '-' + channel... |
8f9dc9a241515f9cab633f33b9d2243f76df55bd | emencia_paste_djangocms_3/django_buildout/project/utils/templatetags/utils_addons.py | emencia_paste_djangocms_3/django_buildout/project/utils/templatetags/utils_addons.py | # -*- coding: utf-8 -*-
"""
Various usefull tags
"""
from django import template
register = template.Library()
@register.filter(name='split', is_safe=True)
def split_string(value, arg=None):
"""
A simple string splitter
So you can do that : ::
{% if LANGUAGE_CODE in "fr,en-ca,en-gb,zh-hk... | # -*- coding: utf-8 -*-
"""
Various usefull tags
"""
from django import template
register = template.Library()
@register.filter(name='split', is_safe=False)
def split_string(value, arg=None):
"""
A simple string splitter
So you can do that : ::
{% if LANGUAGE_CODE in "fr,en-ca,en-gb,zh-h... | Fix split filter in emencia_utils templatetags that was returning a string instead of a list | Fix split filter in emencia_utils templatetags that was returning a string instead of a list
| Python | mit | emencia/emencia_paste_djangocms_3,emencia/emencia_paste_djangocms_3,emencia/emencia_paste_djangocms_3,emencia/emencia_paste_djangocms_3 | # -*- coding: utf-8 -*-
"""
Various usefull tags
"""
from django import template
register = template.Library()
@register.filter(name='split', is_safe=True)
def split_string(value, arg=None):
"""
A simple string splitter
So you can do that : ::
{% if LANGUAGE_CODE in "fr,en-ca,en-gb,zh-hk... | # -*- coding: utf-8 -*-
"""
Various usefull tags
"""
from django import template
register = template.Library()
@register.filter(name='split', is_safe=False)
def split_string(value, arg=None):
"""
A simple string splitter
So you can do that : ::
{% if LANGUAGE_CODE in "fr,en-ca,en-gb,zh-h... | <commit_before># -*- coding: utf-8 -*-
"""
Various usefull tags
"""
from django import template
register = template.Library()
@register.filter(name='split', is_safe=True)
def split_string(value, arg=None):
"""
A simple string splitter
So you can do that : ::
{% if LANGUAGE_CODE in "fr,en... | # -*- coding: utf-8 -*-
"""
Various usefull tags
"""
from django import template
register = template.Library()
@register.filter(name='split', is_safe=False)
def split_string(value, arg=None):
"""
A simple string splitter
So you can do that : ::
{% if LANGUAGE_CODE in "fr,en-ca,en-gb,zh-h... | # -*- coding: utf-8 -*-
"""
Various usefull tags
"""
from django import template
register = template.Library()
@register.filter(name='split', is_safe=True)
def split_string(value, arg=None):
"""
A simple string splitter
So you can do that : ::
{% if LANGUAGE_CODE in "fr,en-ca,en-gb,zh-hk... | <commit_before># -*- coding: utf-8 -*-
"""
Various usefull tags
"""
from django import template
register = template.Library()
@register.filter(name='split', is_safe=True)
def split_string(value, arg=None):
"""
A simple string splitter
So you can do that : ::
{% if LANGUAGE_CODE in "fr,en... |
d7878a798d8208bcd9221babcd3ac1a5c12aa9f7 | drivnal/object.py | drivnal/object.py | from constants import *
import os
import urllib
import mimetypes
import logging
class Object:
def __init__(self, path):
self.name = os.path.basename(path)
self.path = path
if os.path.isdir(self.path):
self.type = DIR_MIME_TYPE
self.size = None
self.time ... | from constants import *
import os
import urllib
import subprocess
import logging
logger = logging.getLogger(APP_NAME)
class Object:
def __init__(self, path):
self.name = os.path.basename(path)
self.path = path
if os.path.isdir(self.path):
self.type = DIR_MIME_TYPE
... | Improve file mime type detection | Improve file mime type detection
| Python | agpl-3.0 | drivnal/drivnal,drivnal/drivnal,drivnal/drivnal | from constants import *
import os
import urllib
import mimetypes
import logging
class Object:
def __init__(self, path):
self.name = os.path.basename(path)
self.path = path
if os.path.isdir(self.path):
self.type = DIR_MIME_TYPE
self.size = None
self.time ... | from constants import *
import os
import urllib
import subprocess
import logging
logger = logging.getLogger(APP_NAME)
class Object:
def __init__(self, path):
self.name = os.path.basename(path)
self.path = path
if os.path.isdir(self.path):
self.type = DIR_MIME_TYPE
... | <commit_before>from constants import *
import os
import urllib
import mimetypes
import logging
class Object:
def __init__(self, path):
self.name = os.path.basename(path)
self.path = path
if os.path.isdir(self.path):
self.type = DIR_MIME_TYPE
self.size = None
... | from constants import *
import os
import urllib
import subprocess
import logging
logger = logging.getLogger(APP_NAME)
class Object:
def __init__(self, path):
self.name = os.path.basename(path)
self.path = path
if os.path.isdir(self.path):
self.type = DIR_MIME_TYPE
... | from constants import *
import os
import urllib
import mimetypes
import logging
class Object:
def __init__(self, path):
self.name = os.path.basename(path)
self.path = path
if os.path.isdir(self.path):
self.type = DIR_MIME_TYPE
self.size = None
self.time ... | <commit_before>from constants import *
import os
import urllib
import mimetypes
import logging
class Object:
def __init__(self, path):
self.name = os.path.basename(path)
self.path = path
if os.path.isdir(self.path):
self.type = DIR_MIME_TYPE
self.size = None
... |
3ddeeccabb09f11fdfb60d9ddbddce406a054e50 | settings.py | settings.py | from settings_common import *
PACKAGE_VERSION = 0.5
DEBUG = TEMPLATE_DEBUG = True
DATABASE_ENGINE = 'postgresql_psycopg2'
DATABASE_NAME = 'daisyproducer_dev'
DATABASE_USER = 'eglic'
DATABASE_PASSWORD = ''
DAISY_PIPELINE_PATH = os.path.join(PROJECT_DIR, '..', '..', 'tmp', 'pipeline-20100301')
DTBOOK2SBSFORM_PATH = o... | from settings_common import *
PACKAGE_VERSION = 0.5
DEBUG = TEMPLATE_DEBUG = True
DATABASE_ENGINE = 'postgresql_psycopg2'
DATABASE_NAME = 'daisyproducer_dev'
DATABASE_USER = 'eglic'
DATABASE_PASSWORD = ''
DAISY_PIPELINE_PATH = os.path.join(PROJECT_DIR, '..', '..', 'tmp', 'pipeline-20110106')
DTBOOK2SBSFORM_PATH = o... | Upgrade to a newer pipeline release | Upgrade to a newer pipeline release
| Python | agpl-3.0 | sbsdev/daisyproducer,sbsdev/daisyproducer,sbsdev/daisyproducer,sbsdev/daisyproducer | from settings_common import *
PACKAGE_VERSION = 0.5
DEBUG = TEMPLATE_DEBUG = True
DATABASE_ENGINE = 'postgresql_psycopg2'
DATABASE_NAME = 'daisyproducer_dev'
DATABASE_USER = 'eglic'
DATABASE_PASSWORD = ''
DAISY_PIPELINE_PATH = os.path.join(PROJECT_DIR, '..', '..', 'tmp', 'pipeline-20100301')
DTBOOK2SBSFORM_PATH = o... | from settings_common import *
PACKAGE_VERSION = 0.5
DEBUG = TEMPLATE_DEBUG = True
DATABASE_ENGINE = 'postgresql_psycopg2'
DATABASE_NAME = 'daisyproducer_dev'
DATABASE_USER = 'eglic'
DATABASE_PASSWORD = ''
DAISY_PIPELINE_PATH = os.path.join(PROJECT_DIR, '..', '..', 'tmp', 'pipeline-20110106')
DTBOOK2SBSFORM_PATH = o... | <commit_before>from settings_common import *
PACKAGE_VERSION = 0.5
DEBUG = TEMPLATE_DEBUG = True
DATABASE_ENGINE = 'postgresql_psycopg2'
DATABASE_NAME = 'daisyproducer_dev'
DATABASE_USER = 'eglic'
DATABASE_PASSWORD = ''
DAISY_PIPELINE_PATH = os.path.join(PROJECT_DIR, '..', '..', 'tmp', 'pipeline-20100301')
DTBOOK2S... | from settings_common import *
PACKAGE_VERSION = 0.5
DEBUG = TEMPLATE_DEBUG = True
DATABASE_ENGINE = 'postgresql_psycopg2'
DATABASE_NAME = 'daisyproducer_dev'
DATABASE_USER = 'eglic'
DATABASE_PASSWORD = ''
DAISY_PIPELINE_PATH = os.path.join(PROJECT_DIR, '..', '..', 'tmp', 'pipeline-20110106')
DTBOOK2SBSFORM_PATH = o... | from settings_common import *
PACKAGE_VERSION = 0.5
DEBUG = TEMPLATE_DEBUG = True
DATABASE_ENGINE = 'postgresql_psycopg2'
DATABASE_NAME = 'daisyproducer_dev'
DATABASE_USER = 'eglic'
DATABASE_PASSWORD = ''
DAISY_PIPELINE_PATH = os.path.join(PROJECT_DIR, '..', '..', 'tmp', 'pipeline-20100301')
DTBOOK2SBSFORM_PATH = o... | <commit_before>from settings_common import *
PACKAGE_VERSION = 0.5
DEBUG = TEMPLATE_DEBUG = True
DATABASE_ENGINE = 'postgresql_psycopg2'
DATABASE_NAME = 'daisyproducer_dev'
DATABASE_USER = 'eglic'
DATABASE_PASSWORD = ''
DAISY_PIPELINE_PATH = os.path.join(PROJECT_DIR, '..', '..', 'tmp', 'pipeline-20100301')
DTBOOK2S... |
109fc84cb307083f6a01317bb5b5bea0578088d3 | bloop/__init__.py | bloop/__init__.py | from bloop.engine import Engine, ObjectsNotFound, ConstraintViolation
from bloop.column import Column, GlobalSecondaryIndex, LocalSecondaryIndex
from bloop.types import (
String, Float, Integer, Binary, StringSet, FloatSet,
IntegerSet, BinarySet, Null, Boolean, Map, List
)
__all__ = [
"Engine", "ObjectsNot... | from bloop.engine import Engine, ObjectsNotFound, ConstraintViolation
from bloop.column import Column, GlobalSecondaryIndex, LocalSecondaryIndex
from bloop.types import (
String, UUID, Float, Integer, Binary, StringSet, FloatSet,
IntegerSet, BinarySet, Null, Boolean, Map, List
)
__all__ = [
"Engine", "Obje... | Add UUID to bloop __all__ | Add UUID to bloop __all__ | Python | mit | numberoverzero/bloop,numberoverzero/bloop | from bloop.engine import Engine, ObjectsNotFound, ConstraintViolation
from bloop.column import Column, GlobalSecondaryIndex, LocalSecondaryIndex
from bloop.types import (
String, Float, Integer, Binary, StringSet, FloatSet,
IntegerSet, BinarySet, Null, Boolean, Map, List
)
__all__ = [
"Engine", "ObjectsNot... | from bloop.engine import Engine, ObjectsNotFound, ConstraintViolation
from bloop.column import Column, GlobalSecondaryIndex, LocalSecondaryIndex
from bloop.types import (
String, UUID, Float, Integer, Binary, StringSet, FloatSet,
IntegerSet, BinarySet, Null, Boolean, Map, List
)
__all__ = [
"Engine", "Obje... | <commit_before>from bloop.engine import Engine, ObjectsNotFound, ConstraintViolation
from bloop.column import Column, GlobalSecondaryIndex, LocalSecondaryIndex
from bloop.types import (
String, Float, Integer, Binary, StringSet, FloatSet,
IntegerSet, BinarySet, Null, Boolean, Map, List
)
__all__ = [
"Engin... | from bloop.engine import Engine, ObjectsNotFound, ConstraintViolation
from bloop.column import Column, GlobalSecondaryIndex, LocalSecondaryIndex
from bloop.types import (
String, UUID, Float, Integer, Binary, StringSet, FloatSet,
IntegerSet, BinarySet, Null, Boolean, Map, List
)
__all__ = [
"Engine", "Obje... | from bloop.engine import Engine, ObjectsNotFound, ConstraintViolation
from bloop.column import Column, GlobalSecondaryIndex, LocalSecondaryIndex
from bloop.types import (
String, Float, Integer, Binary, StringSet, FloatSet,
IntegerSet, BinarySet, Null, Boolean, Map, List
)
__all__ = [
"Engine", "ObjectsNot... | <commit_before>from bloop.engine import Engine, ObjectsNotFound, ConstraintViolation
from bloop.column import Column, GlobalSecondaryIndex, LocalSecondaryIndex
from bloop.types import (
String, Float, Integer, Binary, StringSet, FloatSet,
IntegerSet, BinarySet, Null, Boolean, Map, List
)
__all__ = [
"Engin... |
5c11731b445df04e1b4ec92df4ff6b7e6681915b | testMail.py | testMail.py | #!/usr/local/bin/python
import smtplib, time, threading, sys
from email.mime.text import MIMEText
fromaddr = sys.argv[0]
toaddr = sys.argv[1]
def createMessage(fromaddr, toaddr, subject, msgtxt):
msg = MIMEText(msgtxt)
msg['Subject'] = subject
msg['From'] = fromaddr
msg['To'] = toaddr
return msg
... | #!/usr/local/bin/python
import smtplib, time, threading, sys
from email.mime.text import MIMEText
fromaddr = sys.argv[1]
toaddr = sys.argv[2]
def createMessage(fromaddr, toaddr, subject, msgtxt):
msg = MIMEText(msgtxt)
msg['Subject'] = subject
msg['From'] = fromaddr
msg['To'] = toaddr
return msg
... | Change the arg values so not to use the script name as the fromaddr | Change the arg values so not to use the script name as the fromaddr | Python | bsd-3-clause | bobbynewmark/mailthrottler,bobbynewmark/mailthrottler | #!/usr/local/bin/python
import smtplib, time, threading, sys
from email.mime.text import MIMEText
fromaddr = sys.argv[0]
toaddr = sys.argv[1]
def createMessage(fromaddr, toaddr, subject, msgtxt):
msg = MIMEText(msgtxt)
msg['Subject'] = subject
msg['From'] = fromaddr
msg['To'] = toaddr
return msg
... | #!/usr/local/bin/python
import smtplib, time, threading, sys
from email.mime.text import MIMEText
fromaddr = sys.argv[1]
toaddr = sys.argv[2]
def createMessage(fromaddr, toaddr, subject, msgtxt):
msg = MIMEText(msgtxt)
msg['Subject'] = subject
msg['From'] = fromaddr
msg['To'] = toaddr
return msg
... | <commit_before>#!/usr/local/bin/python
import smtplib, time, threading, sys
from email.mime.text import MIMEText
fromaddr = sys.argv[0]
toaddr = sys.argv[1]
def createMessage(fromaddr, toaddr, subject, msgtxt):
msg = MIMEText(msgtxt)
msg['Subject'] = subject
msg['From'] = fromaddr
msg['To'] = toaddr
... | #!/usr/local/bin/python
import smtplib, time, threading, sys
from email.mime.text import MIMEText
fromaddr = sys.argv[1]
toaddr = sys.argv[2]
def createMessage(fromaddr, toaddr, subject, msgtxt):
msg = MIMEText(msgtxt)
msg['Subject'] = subject
msg['From'] = fromaddr
msg['To'] = toaddr
return msg
... | #!/usr/local/bin/python
import smtplib, time, threading, sys
from email.mime.text import MIMEText
fromaddr = sys.argv[0]
toaddr = sys.argv[1]
def createMessage(fromaddr, toaddr, subject, msgtxt):
msg = MIMEText(msgtxt)
msg['Subject'] = subject
msg['From'] = fromaddr
msg['To'] = toaddr
return msg
... | <commit_before>#!/usr/local/bin/python
import smtplib, time, threading, sys
from email.mime.text import MIMEText
fromaddr = sys.argv[0]
toaddr = sys.argv[1]
def createMessage(fromaddr, toaddr, subject, msgtxt):
msg = MIMEText(msgtxt)
msg['Subject'] = subject
msg['From'] = fromaddr
msg['To'] = toaddr
... |
6c32e39e2e51a80ebc9e31e88e22cc4aa39f7466 | chainer/functions/copy.py | chainer/functions/copy.py | from chainer import cuda
from chainer import function
class Copy(function.Function):
"""Copy an input GPUArray onto another device."""
def __init__(self, out_device):
self.out_device = out_device
def forward_cpu(self, x):
return x[0].copy(),
def forward_gpu(self, x):
return... | import numpy
from chainer import cuda
from chainer import function
from chainer.utils import type_check
class Copy(function.Function):
"""Copy an input GPUArray onto another device."""
def __init__(self, out_device):
self.out_device = out_device
def check_type_forward(self, in_types):
... | Add unittest(cpu-only) and typecheck for Copy | Add unittest(cpu-only) and typecheck for Copy
| Python | mit | chainer/chainer,sinhrks/chainer,ronekko/chainer,ktnyt/chainer,chainer/chainer,jnishi/chainer,niboshi/chainer,tkerola/chainer,elviswf/chainer,tscohen/chainer,muupan/chainer,keisuke-umezawa/chainer,Kaisuke5/chainer,woodshop/chainer,jnishi/chainer,keisuke-umezawa/chainer,tigerneil/chainer,cupy/cupy,niboshi/chainer,chainer... | from chainer import cuda
from chainer import function
class Copy(function.Function):
"""Copy an input GPUArray onto another device."""
def __init__(self, out_device):
self.out_device = out_device
def forward_cpu(self, x):
return x[0].copy(),
def forward_gpu(self, x):
return... | import numpy
from chainer import cuda
from chainer import function
from chainer.utils import type_check
class Copy(function.Function):
"""Copy an input GPUArray onto another device."""
def __init__(self, out_device):
self.out_device = out_device
def check_type_forward(self, in_types):
... | <commit_before>from chainer import cuda
from chainer import function
class Copy(function.Function):
"""Copy an input GPUArray onto another device."""
def __init__(self, out_device):
self.out_device = out_device
def forward_cpu(self, x):
return x[0].copy(),
def forward_gpu(self, x):... | import numpy
from chainer import cuda
from chainer import function
from chainer.utils import type_check
class Copy(function.Function):
"""Copy an input GPUArray onto another device."""
def __init__(self, out_device):
self.out_device = out_device
def check_type_forward(self, in_types):
... | from chainer import cuda
from chainer import function
class Copy(function.Function):
"""Copy an input GPUArray onto another device."""
def __init__(self, out_device):
self.out_device = out_device
def forward_cpu(self, x):
return x[0].copy(),
def forward_gpu(self, x):
return... | <commit_before>from chainer import cuda
from chainer import function
class Copy(function.Function):
"""Copy an input GPUArray onto another device."""
def __init__(self, out_device):
self.out_device = out_device
def forward_cpu(self, x):
return x[0].copy(),
def forward_gpu(self, x):... |
6fbd752b1343c2e5085c3d060dbc7cc11a839728 | sympy/utilities/tests/test_code_quality.py | sympy/utilities/tests/test_code_quality.py | from os import walk, sep, chdir, pardir
from os.path import split, join, abspath
from glob import glob
# System path separator (usually slash or backslash)
sepd = {"sep": sep}
# Files having at least one of these in their path will be excluded
EXCLUDE = set([
"%(sep)sthirdparty%(sep)s" % sepd,
"%(sep)sprintin... | from os import walk, sep, chdir, pardir
from os.path import split, join, abspath
from glob import glob
# System path separator (usually slash or backslash)
sepd = {"sep": sep}
# Files having at least one of these in their path will be excluded
EXCLUDE = set([
"%(sep)sthirdparty%(sep)s" % sepd,
# "%(sep)sprinti... | Test whitespace in pretty printing tests. | Test whitespace in pretty printing tests.
| Python | bsd-3-clause | toolforger/sympy,atsao72/sympy,lindsayad/sympy,fperez/sympy,abhiii5459/sympy,chaffra/sympy,abhiii5459/sympy,farhaanbukhsh/sympy,wanglongqi/sympy,bukzor/sympy,ga7g08/sympy,sahmed95/sympy,sunny94/temp,Shaswat27/sympy,Titan-C/sympy,lidavidm/sympy,hargup/sympy,ryanGT/sympy,Curious72/sympy,mcdaniel67/sympy,emon10005/sympy,r... | from os import walk, sep, chdir, pardir
from os.path import split, join, abspath
from glob import glob
# System path separator (usually slash or backslash)
sepd = {"sep": sep}
# Files having at least one of these in their path will be excluded
EXCLUDE = set([
"%(sep)sthirdparty%(sep)s" % sepd,
"%(sep)sprintin... | from os import walk, sep, chdir, pardir
from os.path import split, join, abspath
from glob import glob
# System path separator (usually slash or backslash)
sepd = {"sep": sep}
# Files having at least one of these in their path will be excluded
EXCLUDE = set([
"%(sep)sthirdparty%(sep)s" % sepd,
# "%(sep)sprinti... | <commit_before>from os import walk, sep, chdir, pardir
from os.path import split, join, abspath
from glob import glob
# System path separator (usually slash or backslash)
sepd = {"sep": sep}
# Files having at least one of these in their path will be excluded
EXCLUDE = set([
"%(sep)sthirdparty%(sep)s" % sepd,
... | from os import walk, sep, chdir, pardir
from os.path import split, join, abspath
from glob import glob
# System path separator (usually slash or backslash)
sepd = {"sep": sep}
# Files having at least one of these in their path will be excluded
EXCLUDE = set([
"%(sep)sthirdparty%(sep)s" % sepd,
# "%(sep)sprinti... | from os import walk, sep, chdir, pardir
from os.path import split, join, abspath
from glob import glob
# System path separator (usually slash or backslash)
sepd = {"sep": sep}
# Files having at least one of these in their path will be excluded
EXCLUDE = set([
"%(sep)sthirdparty%(sep)s" % sepd,
"%(sep)sprintin... | <commit_before>from os import walk, sep, chdir, pardir
from os.path import split, join, abspath
from glob import glob
# System path separator (usually slash or backslash)
sepd = {"sep": sep}
# Files having at least one of these in their path will be excluded
EXCLUDE = set([
"%(sep)sthirdparty%(sep)s" % sepd,
... |
f01222f021f277805492e3f539609f6b64be0b7e | blanc_basic_news/news/views.py | blanc_basic_news/news/views.py | from django.views.generic import ListView, DateDetailView
from django.shortcuts import get_object_or_404
from django.utils import timezone
from django.conf import settings
from .models import Category, Post
class PostListView(ListView):
paginate_by = getattr(settings, 'NEWS_PER_PAGE', 10)
def get_queryset(se... | from django.views.generic import ListView, DateDetailView
from django.shortcuts import get_object_or_404
from django.utils import timezone
from django.conf import settings
from .models import Category, Post
class PostListView(ListView):
paginate_by = getattr(settings, 'NEWS_PER_PAGE', 10)
def get_queryset(se... | Use select_related to help with category foreign keys | Use select_related to help with category foreign keys
| Python | bsd-3-clause | blancltd/blanc-basic-news | from django.views.generic import ListView, DateDetailView
from django.shortcuts import get_object_or_404
from django.utils import timezone
from django.conf import settings
from .models import Category, Post
class PostListView(ListView):
paginate_by = getattr(settings, 'NEWS_PER_PAGE', 10)
def get_queryset(se... | from django.views.generic import ListView, DateDetailView
from django.shortcuts import get_object_or_404
from django.utils import timezone
from django.conf import settings
from .models import Category, Post
class PostListView(ListView):
paginate_by = getattr(settings, 'NEWS_PER_PAGE', 10)
def get_queryset(se... | <commit_before>from django.views.generic import ListView, DateDetailView
from django.shortcuts import get_object_or_404
from django.utils import timezone
from django.conf import settings
from .models import Category, Post
class PostListView(ListView):
paginate_by = getattr(settings, 'NEWS_PER_PAGE', 10)
def ... | from django.views.generic import ListView, DateDetailView
from django.shortcuts import get_object_or_404
from django.utils import timezone
from django.conf import settings
from .models import Category, Post
class PostListView(ListView):
paginate_by = getattr(settings, 'NEWS_PER_PAGE', 10)
def get_queryset(se... | from django.views.generic import ListView, DateDetailView
from django.shortcuts import get_object_or_404
from django.utils import timezone
from django.conf import settings
from .models import Category, Post
class PostListView(ListView):
paginate_by = getattr(settings, 'NEWS_PER_PAGE', 10)
def get_queryset(se... | <commit_before>from django.views.generic import ListView, DateDetailView
from django.shortcuts import get_object_or_404
from django.utils import timezone
from django.conf import settings
from .models import Category, Post
class PostListView(ListView):
paginate_by = getattr(settings, 'NEWS_PER_PAGE', 10)
def ... |
19cd84480a739f9550258dc959637fe85f43af50 | fedora/release.py | fedora/release.py | '''
Information about this python-fedora release
'''
from fedora import _
NAME = 'python-fedora'
VERSION = '0.3.6'
DESCRIPTION = _('Python modules for interacting with Fedora services')
LONG_DESCRIPTION = _('''
The Fedora Project runs many different services. These services help us to
package software, develop new p... | '''
Information about this python-fedora release
'''
from fedora import _
NAME = 'python-fedora'
VERSION = '0.3.6'
DESCRIPTION = _('Python modules for interacting with Fedora Services')
LONG_DESCRIPTION = _('''
The Fedora Project runs many different services. These services help us to
package software, develop new p... | Correct minor typo in a string. | Correct minor typo in a string.
| Python | lgpl-2.1 | fedora-infra/python-fedora | '''
Information about this python-fedora release
'''
from fedora import _
NAME = 'python-fedora'
VERSION = '0.3.6'
DESCRIPTION = _('Python modules for interacting with Fedora services')
LONG_DESCRIPTION = _('''
The Fedora Project runs many different services. These services help us to
package software, develop new p... | '''
Information about this python-fedora release
'''
from fedora import _
NAME = 'python-fedora'
VERSION = '0.3.6'
DESCRIPTION = _('Python modules for interacting with Fedora Services')
LONG_DESCRIPTION = _('''
The Fedora Project runs many different services. These services help us to
package software, develop new p... | <commit_before>'''
Information about this python-fedora release
'''
from fedora import _
NAME = 'python-fedora'
VERSION = '0.3.6'
DESCRIPTION = _('Python modules for interacting with Fedora services')
LONG_DESCRIPTION = _('''
The Fedora Project runs many different services. These services help us to
package software... | '''
Information about this python-fedora release
'''
from fedora import _
NAME = 'python-fedora'
VERSION = '0.3.6'
DESCRIPTION = _('Python modules for interacting with Fedora Services')
LONG_DESCRIPTION = _('''
The Fedora Project runs many different services. These services help us to
package software, develop new p... | '''
Information about this python-fedora release
'''
from fedora import _
NAME = 'python-fedora'
VERSION = '0.3.6'
DESCRIPTION = _('Python modules for interacting with Fedora services')
LONG_DESCRIPTION = _('''
The Fedora Project runs many different services. These services help us to
package software, develop new p... | <commit_before>'''
Information about this python-fedora release
'''
from fedora import _
NAME = 'python-fedora'
VERSION = '0.3.6'
DESCRIPTION = _('Python modules for interacting with Fedora services')
LONG_DESCRIPTION = _('''
The Fedora Project runs many different services. These services help us to
package software... |
db37b195ea47cd18969ad482e1dae301903da092 | pyOutlook/__init__.py | pyOutlook/__init__.py | from .core import *
__all__ = ['OutlookAccount', 'Message', 'Contact', 'Folder']
__version__ = '1.0.0'
__release__ = '1.0.0'
| from .core import *
__all__ = ['OutlookAccount', 'Message', 'Contact', 'Folder']
__version__ = '1.0.0dev'
__release__ = '1.0.0dev'
| Package development version of upcoming v1 release for testing. | Package development version of upcoming v1 release for testing.
| Python | mit | JensAstrup/pyOutlook | from .core import *
__all__ = ['OutlookAccount', 'Message', 'Contact', 'Folder']
__version__ = '1.0.0'
__release__ = '1.0.0'
Package development version of upcoming v1 release for testing. | from .core import *
__all__ = ['OutlookAccount', 'Message', 'Contact', 'Folder']
__version__ = '1.0.0dev'
__release__ = '1.0.0dev'
| <commit_before>from .core import *
__all__ = ['OutlookAccount', 'Message', 'Contact', 'Folder']
__version__ = '1.0.0'
__release__ = '1.0.0'
<commit_msg>Package development version of upcoming v1 release for testing.<commit_after> | from .core import *
__all__ = ['OutlookAccount', 'Message', 'Contact', 'Folder']
__version__ = '1.0.0dev'
__release__ = '1.0.0dev'
| from .core import *
__all__ = ['OutlookAccount', 'Message', 'Contact', 'Folder']
__version__ = '1.0.0'
__release__ = '1.0.0'
Package development version of upcoming v1 release for testing.from .core import *
__all__ = ['OutlookAccount', 'Message', 'Contact', 'Folder']
__version__ = '1.0.0dev'
__release__ = '1.0.0dev'... | <commit_before>from .core import *
__all__ = ['OutlookAccount', 'Message', 'Contact', 'Folder']
__version__ = '1.0.0'
__release__ = '1.0.0'
<commit_msg>Package development version of upcoming v1 release for testing.<commit_after>from .core import *
__all__ = ['OutlookAccount', 'Message', 'Contact', 'Folder']
__versio... |
c5f10b2e5ea10dd17c8c19f87dcdfd2584f8e431 | comics/accounts/models.py | comics/accounts/models.py | import uuid
from django.contrib.auth.models import User
from django.db import models
from django.dispatch import receiver
@receiver(models.signals.post_save, sender=User)
def create_user_profile(sender, instance, created, **kwargs):
UserProfile.objects.get_or_create(user=instance)
class UserProfile(models.Mode... | import uuid
from django.contrib.auth.models import User
from django.db import models
from django.dispatch import receiver
@receiver(models.signals.post_save, sender=User)
def create_user_profile(sender, instance, created, **kwargs):
if created:
UserProfile.objects.create(user=instance)
class UserProfile... | Remove conditional sql-select on new user creation | Remove conditional sql-select on new user creation
Only create a user profile if a new user is actually
created.
| Python | agpl-3.0 | datagutten/comics,jodal/comics,datagutten/comics,jodal/comics,datagutten/comics,datagutten/comics,jodal/comics,jodal/comics | import uuid
from django.contrib.auth.models import User
from django.db import models
from django.dispatch import receiver
@receiver(models.signals.post_save, sender=User)
def create_user_profile(sender, instance, created, **kwargs):
UserProfile.objects.get_or_create(user=instance)
class UserProfile(models.Mode... | import uuid
from django.contrib.auth.models import User
from django.db import models
from django.dispatch import receiver
@receiver(models.signals.post_save, sender=User)
def create_user_profile(sender, instance, created, **kwargs):
if created:
UserProfile.objects.create(user=instance)
class UserProfile... | <commit_before>import uuid
from django.contrib.auth.models import User
from django.db import models
from django.dispatch import receiver
@receiver(models.signals.post_save, sender=User)
def create_user_profile(sender, instance, created, **kwargs):
UserProfile.objects.get_or_create(user=instance)
class UserProf... | import uuid
from django.contrib.auth.models import User
from django.db import models
from django.dispatch import receiver
@receiver(models.signals.post_save, sender=User)
def create_user_profile(sender, instance, created, **kwargs):
if created:
UserProfile.objects.create(user=instance)
class UserProfile... | import uuid
from django.contrib.auth.models import User
from django.db import models
from django.dispatch import receiver
@receiver(models.signals.post_save, sender=User)
def create_user_profile(sender, instance, created, **kwargs):
UserProfile.objects.get_or_create(user=instance)
class UserProfile(models.Mode... | <commit_before>import uuid
from django.contrib.auth.models import User
from django.db import models
from django.dispatch import receiver
@receiver(models.signals.post_save, sender=User)
def create_user_profile(sender, instance, created, **kwargs):
UserProfile.objects.get_or_create(user=instance)
class UserProf... |
fd6c7386cfdaa5fb97a428b323fc1f9b17f9f02c | tests/test_helpers.py | tests/test_helpers.py | import pandas
from sharepa.helpers import pretty_print
from sharepa.helpers import source_counts
def test_pretty_print():
some_stuff = '{"Dusty": "Rhodes"}'
pretty_print(some_stuff)
def test_source_counts():
all_counts = source_counts()
assert isinstance(all_counts, pandas.core.frame.DataFrame)
| import vcr
import pandas
import pytest
from sharepa.search import ShareSearch
from sharepa.helpers import pretty_print
from sharepa.helpers import source_counts
@vcr.use_cassette('tests/vcr/simple_execute.yaml')
def test_pretty_print():
my_search = ShareSearch()
result = my_search.execute()
the_dict = re... | Add pytest fail check on raising pretty print exeption | Add pytest fail check on raising pretty print exeption
| Python | mit | CenterForOpenScience/sharepa,fabianvf/sharepa,samanehsan/sharepa,erinspace/sharepa | import pandas
from sharepa.helpers import pretty_print
from sharepa.helpers import source_counts
def test_pretty_print():
some_stuff = '{"Dusty": "Rhodes"}'
pretty_print(some_stuff)
def test_source_counts():
all_counts = source_counts()
assert isinstance(all_counts, pandas.core.frame.DataFrame)
Add... | import vcr
import pandas
import pytest
from sharepa.search import ShareSearch
from sharepa.helpers import pretty_print
from sharepa.helpers import source_counts
@vcr.use_cassette('tests/vcr/simple_execute.yaml')
def test_pretty_print():
my_search = ShareSearch()
result = my_search.execute()
the_dict = re... | <commit_before>import pandas
from sharepa.helpers import pretty_print
from sharepa.helpers import source_counts
def test_pretty_print():
some_stuff = '{"Dusty": "Rhodes"}'
pretty_print(some_stuff)
def test_source_counts():
all_counts = source_counts()
assert isinstance(all_counts, pandas.core.frame... | import vcr
import pandas
import pytest
from sharepa.search import ShareSearch
from sharepa.helpers import pretty_print
from sharepa.helpers import source_counts
@vcr.use_cassette('tests/vcr/simple_execute.yaml')
def test_pretty_print():
my_search = ShareSearch()
result = my_search.execute()
the_dict = re... | import pandas
from sharepa.helpers import pretty_print
from sharepa.helpers import source_counts
def test_pretty_print():
some_stuff = '{"Dusty": "Rhodes"}'
pretty_print(some_stuff)
def test_source_counts():
all_counts = source_counts()
assert isinstance(all_counts, pandas.core.frame.DataFrame)
Add... | <commit_before>import pandas
from sharepa.helpers import pretty_print
from sharepa.helpers import source_counts
def test_pretty_print():
some_stuff = '{"Dusty": "Rhodes"}'
pretty_print(some_stuff)
def test_source_counts():
all_counts = source_counts()
assert isinstance(all_counts, pandas.core.frame... |
0a9e3fb387c61f2c7cb32502f5c50eaa5b950169 | tests/test_process.py | tests/test_process.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
import pytest
from wamopacker.process import run_command, ProcessException
import os
import uuid
def test_run_command():
cwd = os.getcwd()
output_cmd = run_command('ls -1A', working_dir = cwd)
output_py ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
import pytest
from wamopacker.process import run_command, ProcessException
import os
import uuid
def test_run_command():
cwd = os.getcwd()
output_cmd = run_command('ls -1A', working_dir = cwd)
output_py ... | Fix intermittent travis build error. | Fix intermittent travis build error.
| Python | mit | wamonite/packermate | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
import pytest
from wamopacker.process import run_command, ProcessException
import os
import uuid
def test_run_command():
cwd = os.getcwd()
output_cmd = run_command('ls -1A', working_dir = cwd)
output_py ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
import pytest
from wamopacker.process import run_command, ProcessException
import os
import uuid
def test_run_command():
cwd = os.getcwd()
output_cmd = run_command('ls -1A', working_dir = cwd)
output_py ... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
import pytest
from wamopacker.process import run_command, ProcessException
import os
import uuid
def test_run_command():
cwd = os.getcwd()
output_cmd = run_command('ls -1A', working_dir = cwd)... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
import pytest
from wamopacker.process import run_command, ProcessException
import os
import uuid
def test_run_command():
cwd = os.getcwd()
output_cmd = run_command('ls -1A', working_dir = cwd)
output_py ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
import pytest
from wamopacker.process import run_command, ProcessException
import os
import uuid
def test_run_command():
cwd = os.getcwd()
output_cmd = run_command('ls -1A', working_dir = cwd)
output_py ... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
import pytest
from wamopacker.process import run_command, ProcessException
import os
import uuid
def test_run_command():
cwd = os.getcwd()
output_cmd = run_command('ls -1A', working_dir = cwd)... |
e79c90db5dcda56ff9b2b154659984db9c6f7663 | src/main.py | src/main.py | # -*- encoding: utf-8 -*-
import pygame
from scenes import director
from scenes import intro_scene
pygame.init()
def main():
game_director = director.Director()
scene = intro_scene.IntroScene(game_director)
game_director.change_scene(scene)
game_director.loop()
if __name__ == '__main__':
pygam... | # -*- encoding: utf-8 -*-
import pygame
from scenes import director
from scenes import intro_scene
from game_logic import settings
pygame.init()
def main():
initial_settings = settings.Settings(
trials=1000, player='O', oponent='Computer')
game_director = director.Director()
scene = intro_scene.... | Create initial config when starting game | Create initial config when starting game
| Python | mit | juangallostra/TicTacToe | # -*- encoding: utf-8 -*-
import pygame
from scenes import director
from scenes import intro_scene
pygame.init()
def main():
game_director = director.Director()
scene = intro_scene.IntroScene(game_director)
game_director.change_scene(scene)
game_director.loop()
if __name__ == '__main__':
pygam... | # -*- encoding: utf-8 -*-
import pygame
from scenes import director
from scenes import intro_scene
from game_logic import settings
pygame.init()
def main():
initial_settings = settings.Settings(
trials=1000, player='O', oponent='Computer')
game_director = director.Director()
scene = intro_scene.... | <commit_before># -*- encoding: utf-8 -*-
import pygame
from scenes import director
from scenes import intro_scene
pygame.init()
def main():
game_director = director.Director()
scene = intro_scene.IntroScene(game_director)
game_director.change_scene(scene)
game_director.loop()
if __name__ == '__mai... | # -*- encoding: utf-8 -*-
import pygame
from scenes import director
from scenes import intro_scene
from game_logic import settings
pygame.init()
def main():
initial_settings = settings.Settings(
trials=1000, player='O', oponent='Computer')
game_director = director.Director()
scene = intro_scene.... | # -*- encoding: utf-8 -*-
import pygame
from scenes import director
from scenes import intro_scene
pygame.init()
def main():
game_director = director.Director()
scene = intro_scene.IntroScene(game_director)
game_director.change_scene(scene)
game_director.loop()
if __name__ == '__main__':
pygam... | <commit_before># -*- encoding: utf-8 -*-
import pygame
from scenes import director
from scenes import intro_scene
pygame.init()
def main():
game_director = director.Director()
scene = intro_scene.IntroScene(game_director)
game_director.change_scene(scene)
game_director.loop()
if __name__ == '__mai... |
7dd228d7eaad6b1f37ff3c4d954aebe0ffa99170 | tests/test_targets/test_targets.py | tests/test_targets/test_targets.py | # Copyright 2015 0xc0170
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | # Copyright 2015 0xc0170
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | Test - targets test fix mcu validity indexes | Test - targets test fix mcu validity indexes
| Python | apache-2.0 | project-generator/project_generator_definitions,0xc0170/project_generator_definitions,ohagendorf/project_generator_definitions | # Copyright 2015 0xc0170
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | # Copyright 2015 0xc0170
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | <commit_before># Copyright 2015 0xc0170
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | # Copyright 2015 0xc0170
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | # Copyright 2015 0xc0170
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | <commit_before># Copyright 2015 0xc0170
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... |
bd2c0efa6b0205ff0d24cf335f65f755f18566f2 | modernrpc/__init__.py | modernrpc/__init__.py | # coding: utf-8
# default_app_config was deprecated in Django 3.2. Maybe set it only when detected django version is older?
default_app_config = "modernrpc.apps.ModernRpcConfig"
# Package version is now stored in pyproject.toml only. To retrieve it from code, use:
# import pkg_resources; version = pkg_resources.get_d... | # coding: utf-8
from packaging.version import Version
import django
# Set default_app_config only with Django up to 3.1. This prevents a Warning on newer releases
# See https://docs.djangoproject.com/fr/3.2/releases/3.2/#automatic-appconfig-discovery
if Version(django.get_version()) < Version("3.2"):
default_app_c... | Stop defining default_app_config on Django 3.2+ | Stop defining default_app_config on Django 3.2+ | Python | mit | alorence/django-modern-rpc,alorence/django-modern-rpc | # coding: utf-8
# default_app_config was deprecated in Django 3.2. Maybe set it only when detected django version is older?
default_app_config = "modernrpc.apps.ModernRpcConfig"
# Package version is now stored in pyproject.toml only. To retrieve it from code, use:
# import pkg_resources; version = pkg_resources.get_d... | # coding: utf-8
from packaging.version import Version
import django
# Set default_app_config only with Django up to 3.1. This prevents a Warning on newer releases
# See https://docs.djangoproject.com/fr/3.2/releases/3.2/#automatic-appconfig-discovery
if Version(django.get_version()) < Version("3.2"):
default_app_c... | <commit_before># coding: utf-8
# default_app_config was deprecated in Django 3.2. Maybe set it only when detected django version is older?
default_app_config = "modernrpc.apps.ModernRpcConfig"
# Package version is now stored in pyproject.toml only. To retrieve it from code, use:
# import pkg_resources; version = pkg_... | # coding: utf-8
from packaging.version import Version
import django
# Set default_app_config only with Django up to 3.1. This prevents a Warning on newer releases
# See https://docs.djangoproject.com/fr/3.2/releases/3.2/#automatic-appconfig-discovery
if Version(django.get_version()) < Version("3.2"):
default_app_c... | # coding: utf-8
# default_app_config was deprecated in Django 3.2. Maybe set it only when detected django version is older?
default_app_config = "modernrpc.apps.ModernRpcConfig"
# Package version is now stored in pyproject.toml only. To retrieve it from code, use:
# import pkg_resources; version = pkg_resources.get_d... | <commit_before># coding: utf-8
# default_app_config was deprecated in Django 3.2. Maybe set it only when detected django version is older?
default_app_config = "modernrpc.apps.ModernRpcConfig"
# Package version is now stored in pyproject.toml only. To retrieve it from code, use:
# import pkg_resources; version = pkg_... |
77a1ee839da665fc1f97dabed1bf5639c980a17a | src/api/controller/ServerListController.py | src/api/controller/ServerListController.py | from BaseController import BaseController
from api.util import settings
class ServerListController(BaseController):
def get(self):
servers = {"servers": self.read_server_config()}
self.write(servers)
def read_server_config(self):
"""Returns a list of servers with the 'id' field added.... | from BaseController import BaseController
from api.util import settings
class ServerListController(BaseController):
def get(self):
servers = {"servers": self.read_server_config()}
self.write(servers)
def read_server_config(self):
"""Returns a list of servers with the 'id' field added.... | Allow servers command to work without a password. | Allow servers command to work without a password.
| Python | mit | YongMan/RedisLive,merlian/RedisLive,heamon7/RedisLive,fengshao0907/RedisLive,heamon7/RedisLive,udomsak/RedisLive,merlian/RedisLive,jacklee0810/RedisLive,YongMan/RedisLive,jacklee0810/RedisLive,udomsak/RedisLive,jiejieling/RdsMonitor,udomsak/RedisLive,fengshao0907/RedisLive,nkrode/RedisLive,jacklee0810/RedisLive,jiejiel... | from BaseController import BaseController
from api.util import settings
class ServerListController(BaseController):
def get(self):
servers = {"servers": self.read_server_config()}
self.write(servers)
def read_server_config(self):
"""Returns a list of servers with the 'id' field added.... | from BaseController import BaseController
from api.util import settings
class ServerListController(BaseController):
def get(self):
servers = {"servers": self.read_server_config()}
self.write(servers)
def read_server_config(self):
"""Returns a list of servers with the 'id' field added.... | <commit_before>from BaseController import BaseController
from api.util import settings
class ServerListController(BaseController):
def get(self):
servers = {"servers": self.read_server_config()}
self.write(servers)
def read_server_config(self):
"""Returns a list of servers with the 'i... | from BaseController import BaseController
from api.util import settings
class ServerListController(BaseController):
def get(self):
servers = {"servers": self.read_server_config()}
self.write(servers)
def read_server_config(self):
"""Returns a list of servers with the 'id' field added.... | from BaseController import BaseController
from api.util import settings
class ServerListController(BaseController):
def get(self):
servers = {"servers": self.read_server_config()}
self.write(servers)
def read_server_config(self):
"""Returns a list of servers with the 'id' field added.... | <commit_before>from BaseController import BaseController
from api.util import settings
class ServerListController(BaseController):
def get(self):
servers = {"servers": self.read_server_config()}
self.write(servers)
def read_server_config(self):
"""Returns a list of servers with the 'i... |
271bb9de8f0f3674b1f6f47bc3519f1297c87abf | examples/linechannel.py | examples/linechannel.py | # -*- coding: utf-8 -*-
from linepy import *
client = LineClient()
#client = LineClient(authToken='AUTHTOKEN')
client.log("Auth Token : " + str(client.authToken))
# Initialize LineChannel with LineClient
# This channel id is Timeline channel
channel = LineChannel(client, channel_id="1341209950")
client.lo... | # -*- coding: utf-8 -*-
from linepy import *
client = LineClient()
#client = LineClient(authToken='AUTHTOKEN')
client.log("Auth Token : " + str(client.authToken))
# Initialize LineChannel with LineClient
# This channel id is Timeline channel
channel = LineChannel(client, channelId="1341209950")
client.log... | Change channel_id to new channelId param | Change channel_id to new channelId param | Python | bsd-3-clause | fadhiilrachman/line-py | # -*- coding: utf-8 -*-
from linepy import *
client = LineClient()
#client = LineClient(authToken='AUTHTOKEN')
client.log("Auth Token : " + str(client.authToken))
# Initialize LineChannel with LineClient
# This channel id is Timeline channel
channel = LineChannel(client, channel_id="1341209950")
client.lo... | # -*- coding: utf-8 -*-
from linepy import *
client = LineClient()
#client = LineClient(authToken='AUTHTOKEN')
client.log("Auth Token : " + str(client.authToken))
# Initialize LineChannel with LineClient
# This channel id is Timeline channel
channel = LineChannel(client, channelId="1341209950")
client.log... | <commit_before># -*- coding: utf-8 -*-
from linepy import *
client = LineClient()
#client = LineClient(authToken='AUTHTOKEN')
client.log("Auth Token : " + str(client.authToken))
# Initialize LineChannel with LineClient
# This channel id is Timeline channel
channel = LineChannel(client, channel_id="13412099... | # -*- coding: utf-8 -*-
from linepy import *
client = LineClient()
#client = LineClient(authToken='AUTHTOKEN')
client.log("Auth Token : " + str(client.authToken))
# Initialize LineChannel with LineClient
# This channel id is Timeline channel
channel = LineChannel(client, channelId="1341209950")
client.log... | # -*- coding: utf-8 -*-
from linepy import *
client = LineClient()
#client = LineClient(authToken='AUTHTOKEN')
client.log("Auth Token : " + str(client.authToken))
# Initialize LineChannel with LineClient
# This channel id is Timeline channel
channel = LineChannel(client, channel_id="1341209950")
client.lo... | <commit_before># -*- coding: utf-8 -*-
from linepy import *
client = LineClient()
#client = LineClient(authToken='AUTHTOKEN')
client.log("Auth Token : " + str(client.authToken))
# Initialize LineChannel with LineClient
# This channel id is Timeline channel
channel = LineChannel(client, channel_id="13412099... |
bc5d678937e69fe00e206b6a80c9a2f6dfb1a3a2 | examples/worker_rush.py | examples/worker_rush.py | import sc2
from sc2 import run_game, maps, Race, Difficulty
from sc2.player import Bot, Computer
class WorkerRushBot(sc2.BotAI):
async def on_step(self, state, iteration):
if iteration == 0:
for probe in self.workers:
await self.do(probe.attack(self.enemy_start_locations[0]))
d... | import sc2
from sc2 import run_game, maps, Race, Difficulty
from sc2.player import Bot, Computer
class WorkerRushBot(sc2.BotAI):
async def on_step(self, state, iteration):
if iteration == 0:
for worker in self.workers:
await self.do(worker.attack(self.enemy_start_locations[0]))
... | Use generic names in the worker rush example | Use generic names in the worker rush example
| Python | mit | Dentosal/python-sc2 | import sc2
from sc2 import run_game, maps, Race, Difficulty
from sc2.player import Bot, Computer
class WorkerRushBot(sc2.BotAI):
async def on_step(self, state, iteration):
if iteration == 0:
for probe in self.workers:
await self.do(probe.attack(self.enemy_start_locations[0]))
d... | import sc2
from sc2 import run_game, maps, Race, Difficulty
from sc2.player import Bot, Computer
class WorkerRushBot(sc2.BotAI):
async def on_step(self, state, iteration):
if iteration == 0:
for worker in self.workers:
await self.do(worker.attack(self.enemy_start_locations[0]))
... | <commit_before>import sc2
from sc2 import run_game, maps, Race, Difficulty
from sc2.player import Bot, Computer
class WorkerRushBot(sc2.BotAI):
async def on_step(self, state, iteration):
if iteration == 0:
for probe in self.workers:
await self.do(probe.attack(self.enemy_start_lo... | import sc2
from sc2 import run_game, maps, Race, Difficulty
from sc2.player import Bot, Computer
class WorkerRushBot(sc2.BotAI):
async def on_step(self, state, iteration):
if iteration == 0:
for worker in self.workers:
await self.do(worker.attack(self.enemy_start_locations[0]))
... | import sc2
from sc2 import run_game, maps, Race, Difficulty
from sc2.player import Bot, Computer
class WorkerRushBot(sc2.BotAI):
async def on_step(self, state, iteration):
if iteration == 0:
for probe in self.workers:
await self.do(probe.attack(self.enemy_start_locations[0]))
d... | <commit_before>import sc2
from sc2 import run_game, maps, Race, Difficulty
from sc2.player import Bot, Computer
class WorkerRushBot(sc2.BotAI):
async def on_step(self, state, iteration):
if iteration == 0:
for probe in self.workers:
await self.do(probe.attack(self.enemy_start_lo... |
a6a2ee870840730f99ad475e02956c49fe2e7ed3 | common/authapp.py | common/authapp.py | import ConfigParser
from common.application import Application
from keystonemiddleware.auth_token import filter_factory as auth_filter_factory
class KeystoneApplication(Application):
"""
An Application which uses Keystone for authorisation using RBAC
"""
def __init__(self, configuration):
sup... | import ConfigParser
from common.application import Application
from keystonemiddleware.auth_token import filter_factory as auth_filter_factory
class KeystoneApplication(Application):
"""
An Application which uses Keystone for authorisation using RBAC
"""
INI_SECTION = 'keystone_authtoken'
def __... | Remove hardcoded default filename. Raise an error if no app config file was specified, or it is unreadable, or it doesn't contain the section we need. | Remove hardcoded default filename. Raise an error if no app config file was specified, or it is unreadable, or it doesn't contain the section we need.
| Python | apache-2.0 | NCI-Cloud/reporting-api,NeCTAR-RC/reporting-api,NCI-Cloud/reporting-api,NeCTAR-RC/reporting-api | import ConfigParser
from common.application import Application
from keystonemiddleware.auth_token import filter_factory as auth_filter_factory
class KeystoneApplication(Application):
"""
An Application which uses Keystone for authorisation using RBAC
"""
def __init__(self, configuration):
sup... | import ConfigParser
from common.application import Application
from keystonemiddleware.auth_token import filter_factory as auth_filter_factory
class KeystoneApplication(Application):
"""
An Application which uses Keystone for authorisation using RBAC
"""
INI_SECTION = 'keystone_authtoken'
def __... | <commit_before>import ConfigParser
from common.application import Application
from keystonemiddleware.auth_token import filter_factory as auth_filter_factory
class KeystoneApplication(Application):
"""
An Application which uses Keystone for authorisation using RBAC
"""
def __init__(self, configuratio... | import ConfigParser
from common.application import Application
from keystonemiddleware.auth_token import filter_factory as auth_filter_factory
class KeystoneApplication(Application):
"""
An Application which uses Keystone for authorisation using RBAC
"""
INI_SECTION = 'keystone_authtoken'
def __... | import ConfigParser
from common.application import Application
from keystonemiddleware.auth_token import filter_factory as auth_filter_factory
class KeystoneApplication(Application):
"""
An Application which uses Keystone for authorisation using RBAC
"""
def __init__(self, configuration):
sup... | <commit_before>import ConfigParser
from common.application import Application
from keystonemiddleware.auth_token import filter_factory as auth_filter_factory
class KeystoneApplication(Application):
"""
An Application which uses Keystone for authorisation using RBAC
"""
def __init__(self, configuratio... |
66462c231011f6418fc246789ce4feed10a74a66 | web/whim/core/time.py | web/whim/core/time.py | from datetime import datetime, timezone, time
def zero_time_with_timezone(date, tz=timezone.utc):
return datetime.combine(date, time(tzinfo=tz)) | from datetime import datetime, timezone, time
import dateparser
def zero_time_with_timezone(date, tz=timezone.utc):
return datetime.combine(date, time(tzinfo=tz))
def attempt_parse_date(val):
parsed_date = dateparser.parse(val, languages=['en'])
if parsed_date is None:
# try other strategies?
... | Use dateparser for parsing scraped dates | Use dateparser for parsing scraped dates
| Python | mit | andrewgleave/whim,andrewgleave/whim,andrewgleave/whim | from datetime import datetime, timezone, time
def zero_time_with_timezone(date, tz=timezone.utc):
return datetime.combine(date, time(tzinfo=tz))Use dateparser for parsing scraped dates | from datetime import datetime, timezone, time
import dateparser
def zero_time_with_timezone(date, tz=timezone.utc):
return datetime.combine(date, time(tzinfo=tz))
def attempt_parse_date(val):
parsed_date = dateparser.parse(val, languages=['en'])
if parsed_date is None:
# try other strategies?
... | <commit_before>from datetime import datetime, timezone, time
def zero_time_with_timezone(date, tz=timezone.utc):
return datetime.combine(date, time(tzinfo=tz))<commit_msg>Use dateparser for parsing scraped dates<commit_after> | from datetime import datetime, timezone, time
import dateparser
def zero_time_with_timezone(date, tz=timezone.utc):
return datetime.combine(date, time(tzinfo=tz))
def attempt_parse_date(val):
parsed_date = dateparser.parse(val, languages=['en'])
if parsed_date is None:
# try other strategies?
... | from datetime import datetime, timezone, time
def zero_time_with_timezone(date, tz=timezone.utc):
return datetime.combine(date, time(tzinfo=tz))Use dateparser for parsing scraped datesfrom datetime import datetime, timezone, time
import dateparser
def zero_time_with_timezone(date, tz=timezone.utc):
return ... | <commit_before>from datetime import datetime, timezone, time
def zero_time_with_timezone(date, tz=timezone.utc):
return datetime.combine(date, time(tzinfo=tz))<commit_msg>Use dateparser for parsing scraped dates<commit_after>from datetime import datetime, timezone, time
import dateparser
def zero_time_with_tim... |
57a37c4a87e9757a109dfb5f3169fb8264d0795e | neutron/server/rpc_eventlet.py | neutron/server/rpc_eventlet.py | #!/usr/bin/env python
# Copyright 2011 VMware, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | #!/usr/bin/env python
# Copyright 2011 VMware, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | Switch to start_all_workers in RPC server | Switch to start_all_workers in RPC server
This does the same as the logic present but it emits
the registry callback event for resources.PROCESS AFTER_SPAWN
that some plugins may be expecting.
Change-Id: I6f9aeca753a5d3c0052f553a2ac46786ca113e1e
Related-Bug: #1687896
| Python | apache-2.0 | mahak/neutron,noironetworks/neutron,openstack/neutron,openstack/neutron,openstack/neutron,eayunstack/neutron,mahak/neutron,huntxu/neutron,eayunstack/neutron,noironetworks/neutron,huntxu/neutron,mahak/neutron | #!/usr/bin/env python
# Copyright 2011 VMware, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | #!/usr/bin/env python
# Copyright 2011 VMware, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | <commit_before>#!/usr/bin/env python
# Copyright 2011 VMware, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/... | #!/usr/bin/env python
# Copyright 2011 VMware, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | #!/usr/bin/env python
# Copyright 2011 VMware, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | <commit_before>#!/usr/bin/env python
# Copyright 2011 VMware, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/... |
bc961992afeae978e95209606e0e7b1a9b73719f | jesusmtnez/python/kata/game.py | jesusmtnez/python/kata/game.py | class Game():
def __init__(self):
self._score = 0
def roll(self, pins):
pass
def score(self):
return 0
| class Game():
def __init__(self):
self._score = 0
def roll(self, pins):
self._score += pins
def score(self):
return self._score
| Update score in Game class methods | [Python] Update score in Game class methods
| Python | mit | JesusMtnez/devexperto-challenge,JesusMtnez/devexperto-challenge | class Game():
def __init__(self):
self._score = 0
def roll(self, pins):
pass
def score(self):
return 0
[Python] Update score in Game class methods | class Game():
def __init__(self):
self._score = 0
def roll(self, pins):
self._score += pins
def score(self):
return self._score
| <commit_before>class Game():
def __init__(self):
self._score = 0
def roll(self, pins):
pass
def score(self):
return 0
<commit_msg>[Python] Update score in Game class methods<commit_after> | class Game():
def __init__(self):
self._score = 0
def roll(self, pins):
self._score += pins
def score(self):
return self._score
| class Game():
def __init__(self):
self._score = 0
def roll(self, pins):
pass
def score(self):
return 0
[Python] Update score in Game class methodsclass Game():
def __init__(self):
self._score = 0
def roll(self, pins):
self._score += pins
def score(self... | <commit_before>class Game():
def __init__(self):
self._score = 0
def roll(self, pins):
pass
def score(self):
return 0
<commit_msg>[Python] Update score in Game class methods<commit_after>class Game():
def __init__(self):
self._score = 0
def roll(self, pins):
... |
69c72d47ebf57932b6e20e2c22a5f1c84d07d3eb | pyqode/core/api/__init__.py | pyqode/core/api/__init__.py | """
This package contains the bases classes of pyqode and some utility
functions.
"""
from .code_edit import CodeEdit
from .decoration import TextDecoration
from .encodings import ENCODINGS_MAP, convert_to_codec_key
from .manager import Manager
from .mode import Mode
from .panel import Panel
from .syntax_highlighter i... | """
This package contains the bases classes of pyqode and some utility
functions.
"""
from .code_edit import CodeEdit
from .decoration import TextDecoration
from .encodings import ENCODINGS_MAP, convert_to_codec_key
from .manager import Manager
from .mode import Mode
from .panel import Panel
from .syntax_highlighter i... | Add missing PYGMENTS_STYLES list to pyqode.core.api | Add missing PYGMENTS_STYLES list to pyqode.core.api
| Python | mit | zwadar/pyqode.core,pyQode/pyqode.core,pyQode/pyqode.core | """
This package contains the bases classes of pyqode and some utility
functions.
"""
from .code_edit import CodeEdit
from .decoration import TextDecoration
from .encodings import ENCODINGS_MAP, convert_to_codec_key
from .manager import Manager
from .mode import Mode
from .panel import Panel
from .syntax_highlighter i... | """
This package contains the bases classes of pyqode and some utility
functions.
"""
from .code_edit import CodeEdit
from .decoration import TextDecoration
from .encodings import ENCODINGS_MAP, convert_to_codec_key
from .manager import Manager
from .mode import Mode
from .panel import Panel
from .syntax_highlighter i... | <commit_before>"""
This package contains the bases classes of pyqode and some utility
functions.
"""
from .code_edit import CodeEdit
from .decoration import TextDecoration
from .encodings import ENCODINGS_MAP, convert_to_codec_key
from .manager import Manager
from .mode import Mode
from .panel import Panel
from .synta... | """
This package contains the bases classes of pyqode and some utility
functions.
"""
from .code_edit import CodeEdit
from .decoration import TextDecoration
from .encodings import ENCODINGS_MAP, convert_to_codec_key
from .manager import Manager
from .mode import Mode
from .panel import Panel
from .syntax_highlighter i... | """
This package contains the bases classes of pyqode and some utility
functions.
"""
from .code_edit import CodeEdit
from .decoration import TextDecoration
from .encodings import ENCODINGS_MAP, convert_to_codec_key
from .manager import Manager
from .mode import Mode
from .panel import Panel
from .syntax_highlighter i... | <commit_before>"""
This package contains the bases classes of pyqode and some utility
functions.
"""
from .code_edit import CodeEdit
from .decoration import TextDecoration
from .encodings import ENCODINGS_MAP, convert_to_codec_key
from .manager import Manager
from .mode import Mode
from .panel import Panel
from .synta... |
23d8942ffeeee72e21330bd8ecc5bfb5e91bbc3b | certidude/push.py | certidude/push.py |
import click
import json
import logging
import requests
from datetime import datetime
from certidude import config
def publish(event_type, event_data):
"""
Publish event on push server
"""
if not isinstance(event_data, basestring):
from certidude.decorators import MyEncoder
event_data... |
import click
import json
import logging
import requests
from datetime import datetime
from certidude import config
def publish(event_type, event_data):
"""
Publish event on push server
"""
if not config.PUSH_PUBLISH:
# Push server disabled
return
if not isinstance(event_data, bas... | Add fallbacks for e-mail handling if outbox is not defined | Add fallbacks for e-mail handling if outbox is not defined
| Python | mit | laurivosandi/certidude,laurivosandi/certidude,plaes/certidude,laurivosandi/certidude,plaes/certidude,plaes/certidude,laurivosandi/certidude,plaes/certidude |
import click
import json
import logging
import requests
from datetime import datetime
from certidude import config
def publish(event_type, event_data):
"""
Publish event on push server
"""
if not isinstance(event_data, basestring):
from certidude.decorators import MyEncoder
event_data... |
import click
import json
import logging
import requests
from datetime import datetime
from certidude import config
def publish(event_type, event_data):
"""
Publish event on push server
"""
if not config.PUSH_PUBLISH:
# Push server disabled
return
if not isinstance(event_data, bas... | <commit_before>
import click
import json
import logging
import requests
from datetime import datetime
from certidude import config
def publish(event_type, event_data):
"""
Publish event on push server
"""
if not isinstance(event_data, basestring):
from certidude.decorators import MyEncoder
... |
import click
import json
import logging
import requests
from datetime import datetime
from certidude import config
def publish(event_type, event_data):
"""
Publish event on push server
"""
if not config.PUSH_PUBLISH:
# Push server disabled
return
if not isinstance(event_data, bas... |
import click
import json
import logging
import requests
from datetime import datetime
from certidude import config
def publish(event_type, event_data):
"""
Publish event on push server
"""
if not isinstance(event_data, basestring):
from certidude.decorators import MyEncoder
event_data... | <commit_before>
import click
import json
import logging
import requests
from datetime import datetime
from certidude import config
def publish(event_type, event_data):
"""
Publish event on push server
"""
if not isinstance(event_data, basestring):
from certidude.decorators import MyEncoder
... |
78515c7bbb81263fa339a67c2aabfa1a4f3c9af9 | thefuck/rules/ifconfig_device_not_found.py | thefuck/rules/ifconfig_device_not_found.py | import subprocess
from thefuck.utils import for_app, replace_command, eager
@for_app('ifconfig')
def match(command):
return 'error fetching interface information: Device not found' \
in command.stderr
@eager
def _get_possible_interfaces():
proc = subprocess.Popen(['ifconfig', '-a'], stdout=subpro... | import subprocess
from thefuck.utils import for_app, replace_command, eager
@for_app('ifconfig')
def match(command):
return 'error fetching interface information: Device not found' \
in command.stderr
@eager
def _get_possible_interfaces():
proc = subprocess.Popen(['ifconfig', '-a'], stdout=subpro... | Fix flake8 errors: W391 blank line at end of file | Fix flake8 errors: W391 blank line at end of file
| Python | mit | nvbn/thefuck,scorphus/thefuck,Clpsplug/thefuck,mlk/thefuck,nvbn/thefuck,SimenB/thefuck,mlk/thefuck,SimenB/thefuck,Clpsplug/thefuck,scorphus/thefuck | import subprocess
from thefuck.utils import for_app, replace_command, eager
@for_app('ifconfig')
def match(command):
return 'error fetching interface information: Device not found' \
in command.stderr
@eager
def _get_possible_interfaces():
proc = subprocess.Popen(['ifconfig', '-a'], stdout=subpro... | import subprocess
from thefuck.utils import for_app, replace_command, eager
@for_app('ifconfig')
def match(command):
return 'error fetching interface information: Device not found' \
in command.stderr
@eager
def _get_possible_interfaces():
proc = subprocess.Popen(['ifconfig', '-a'], stdout=subpro... | <commit_before>import subprocess
from thefuck.utils import for_app, replace_command, eager
@for_app('ifconfig')
def match(command):
return 'error fetching interface information: Device not found' \
in command.stderr
@eager
def _get_possible_interfaces():
proc = subprocess.Popen(['ifconfig', '-a']... | import subprocess
from thefuck.utils import for_app, replace_command, eager
@for_app('ifconfig')
def match(command):
return 'error fetching interface information: Device not found' \
in command.stderr
@eager
def _get_possible_interfaces():
proc = subprocess.Popen(['ifconfig', '-a'], stdout=subpro... | import subprocess
from thefuck.utils import for_app, replace_command, eager
@for_app('ifconfig')
def match(command):
return 'error fetching interface information: Device not found' \
in command.stderr
@eager
def _get_possible_interfaces():
proc = subprocess.Popen(['ifconfig', '-a'], stdout=subpro... | <commit_before>import subprocess
from thefuck.utils import for_app, replace_command, eager
@for_app('ifconfig')
def match(command):
return 'error fetching interface information: Device not found' \
in command.stderr
@eager
def _get_possible_interfaces():
proc = subprocess.Popen(['ifconfig', '-a']... |
e7e8972124d3336834f1c177f655e12528a49624 | cosmo/monitors/osm_data_models.py | cosmo/monitors/osm_data_models.py | import pandas as pd
from monitorframe.monitor import BaseDataModel
from cosmo.filesystem import FileDataFinder
from cosmo import FILES_SOURCE
from cosmo.monitor_helpers import explode_df
class OSMDataModel(BaseDataModel):
def get_data(self):
header_keys = (
'ROOTNAME', 'EXPSTART', 'DETECTOR... | import pandas as pd
from monitorframe.monitor import BaseDataModel
from cosmo.filesystem import FileDataFinder
from cosmo import FILES_SOURCE
from cosmo.monitor_helpers import explode_df
class OSMDataModel(BaseDataModel):
"""Data model for all OSM Shift monitors."""
def get_data(self):
header_keys ... | Add comments and docstring to OSMDataModel | Add comments and docstring to OSMDataModel
| Python | bsd-3-clause | justincely/cos_monitoring | import pandas as pd
from monitorframe.monitor import BaseDataModel
from cosmo.filesystem import FileDataFinder
from cosmo import FILES_SOURCE
from cosmo.monitor_helpers import explode_df
class OSMDataModel(BaseDataModel):
def get_data(self):
header_keys = (
'ROOTNAME', 'EXPSTART', 'DETECTOR... | import pandas as pd
from monitorframe.monitor import BaseDataModel
from cosmo.filesystem import FileDataFinder
from cosmo import FILES_SOURCE
from cosmo.monitor_helpers import explode_df
class OSMDataModel(BaseDataModel):
"""Data model for all OSM Shift monitors."""
def get_data(self):
header_keys ... | <commit_before>import pandas as pd
from monitorframe.monitor import BaseDataModel
from cosmo.filesystem import FileDataFinder
from cosmo import FILES_SOURCE
from cosmo.monitor_helpers import explode_df
class OSMDataModel(BaseDataModel):
def get_data(self):
header_keys = (
'ROOTNAME', 'EXPST... | import pandas as pd
from monitorframe.monitor import BaseDataModel
from cosmo.filesystem import FileDataFinder
from cosmo import FILES_SOURCE
from cosmo.monitor_helpers import explode_df
class OSMDataModel(BaseDataModel):
"""Data model for all OSM Shift monitors."""
def get_data(self):
header_keys ... | import pandas as pd
from monitorframe.monitor import BaseDataModel
from cosmo.filesystem import FileDataFinder
from cosmo import FILES_SOURCE
from cosmo.monitor_helpers import explode_df
class OSMDataModel(BaseDataModel):
def get_data(self):
header_keys = (
'ROOTNAME', 'EXPSTART', 'DETECTOR... | <commit_before>import pandas as pd
from monitorframe.monitor import BaseDataModel
from cosmo.filesystem import FileDataFinder
from cosmo import FILES_SOURCE
from cosmo.monitor_helpers import explode_df
class OSMDataModel(BaseDataModel):
def get_data(self):
header_keys = (
'ROOTNAME', 'EXPST... |
3e67993eb17aca7571381d59b7fd65eab53dac98 | day19/part2.py | day19/part2.py | inp = 3004953
elves = list(range(1, inp + 1))
i = 0
while len(elves) > 1:
index = (i + int(len(elves) / 2)) % len(elves)
elves.pop(index)
if index < i:
i -= 1
i = (i + 1) % len(elves)
print(elves[0])
input()
| inp = 3004953
class Elf:
def __init__(self, num):
self.num = num
self.prev = None
self.next = None
def remove(self):
self.prev.next = self.next
self.next.prev = self.prev
elves = list(map(Elf, range(1, inp + 1)))
for i in range(inp):
elves[i].prev = elves[(i - 1) %... | Replace list with a linked list for much better performance | Replace list with a linked list for much better performance
| Python | unlicense | ultramega/adventofcode2016 | inp = 3004953
elves = list(range(1, inp + 1))
i = 0
while len(elves) > 1:
index = (i + int(len(elves) / 2)) % len(elves)
elves.pop(index)
if index < i:
i -= 1
i = (i + 1) % len(elves)
print(elves[0])
input()
Replace list with a linked list for much better performance | inp = 3004953
class Elf:
def __init__(self, num):
self.num = num
self.prev = None
self.next = None
def remove(self):
self.prev.next = self.next
self.next.prev = self.prev
elves = list(map(Elf, range(1, inp + 1)))
for i in range(inp):
elves[i].prev = elves[(i - 1) %... | <commit_before>inp = 3004953
elves = list(range(1, inp + 1))
i = 0
while len(elves) > 1:
index = (i + int(len(elves) / 2)) % len(elves)
elves.pop(index)
if index < i:
i -= 1
i = (i + 1) % len(elves)
print(elves[0])
input()
<commit_msg>Replace list with a linked list for much better performance... | inp = 3004953
class Elf:
def __init__(self, num):
self.num = num
self.prev = None
self.next = None
def remove(self):
self.prev.next = self.next
self.next.prev = self.prev
elves = list(map(Elf, range(1, inp + 1)))
for i in range(inp):
elves[i].prev = elves[(i - 1) %... | inp = 3004953
elves = list(range(1, inp + 1))
i = 0
while len(elves) > 1:
index = (i + int(len(elves) / 2)) % len(elves)
elves.pop(index)
if index < i:
i -= 1
i = (i + 1) % len(elves)
print(elves[0])
input()
Replace list with a linked list for much better performanceinp = 3004953
class Elf:
... | <commit_before>inp = 3004953
elves = list(range(1, inp + 1))
i = 0
while len(elves) > 1:
index = (i + int(len(elves) / 2)) % len(elves)
elves.pop(index)
if index < i:
i -= 1
i = (i + 1) % len(elves)
print(elves[0])
input()
<commit_msg>Replace list with a linked list for much better performance... |
561d98e59ea46b56d50341e06578b5c9fe95c73a | perfbucket/watcher.py | perfbucket/watcher.py | import os
import sys
import pyinotify
import analyzer
wm = pyinotify.WatchManager()
class ProcessProfilerEvent(pyinotify.ProcessEvent):
def process_IN_CLOSE_WRITE(self, event):
if event.name.endswith(".json"):
base = os.path.splitext(os.path.join(event.path, event.name))[0]
analyze... | import os
import sys
import pyinotify
import analyzer
class ProcessProfilerEvent(pyinotify.ProcessEvent):
def process_IN_CLOSE_WRITE(self, event):
if event.name.endswith(".json"):
base = os.path.splitext(os.path.join(event.path, event.name))[0]
analyzer.analyze_profiling_result(base... | Change scope of watch manager. | Change scope of watch manager.
| Python | agpl-3.0 | davidstrauss/perfbucket,davidstrauss/perfbucket,davidstrauss/perfbucket | import os
import sys
import pyinotify
import analyzer
wm = pyinotify.WatchManager()
class ProcessProfilerEvent(pyinotify.ProcessEvent):
def process_IN_CLOSE_WRITE(self, event):
if event.name.endswith(".json"):
base = os.path.splitext(os.path.join(event.path, event.name))[0]
analyze... | import os
import sys
import pyinotify
import analyzer
class ProcessProfilerEvent(pyinotify.ProcessEvent):
def process_IN_CLOSE_WRITE(self, event):
if event.name.endswith(".json"):
base = os.path.splitext(os.path.join(event.path, event.name))[0]
analyzer.analyze_profiling_result(base... | <commit_before>import os
import sys
import pyinotify
import analyzer
wm = pyinotify.WatchManager()
class ProcessProfilerEvent(pyinotify.ProcessEvent):
def process_IN_CLOSE_WRITE(self, event):
if event.name.endswith(".json"):
base = os.path.splitext(os.path.join(event.path, event.name))[0]
... | import os
import sys
import pyinotify
import analyzer
class ProcessProfilerEvent(pyinotify.ProcessEvent):
def process_IN_CLOSE_WRITE(self, event):
if event.name.endswith(".json"):
base = os.path.splitext(os.path.join(event.path, event.name))[0]
analyzer.analyze_profiling_result(base... | import os
import sys
import pyinotify
import analyzer
wm = pyinotify.WatchManager()
class ProcessProfilerEvent(pyinotify.ProcessEvent):
def process_IN_CLOSE_WRITE(self, event):
if event.name.endswith(".json"):
base = os.path.splitext(os.path.join(event.path, event.name))[0]
analyze... | <commit_before>import os
import sys
import pyinotify
import analyzer
wm = pyinotify.WatchManager()
class ProcessProfilerEvent(pyinotify.ProcessEvent):
def process_IN_CLOSE_WRITE(self, event):
if event.name.endswith(".json"):
base = os.path.splitext(os.path.join(event.path, event.name))[0]
... |
2497f494f0e3e7fb57aa8cb1deed0c05fd6b74b1 | handler/FilesService.py | handler/FilesService.py | import tornado
import time
from bson.json_util import dumps
from tornado.options import options
class FilesServiceHandler(tornado.web.RequestHandler):
def initialize(self, logger, mongodb):
self.logger = logger
self.mongodb = mongodb
@tornado.web.asynchronous
@tornado.gen.coroutine
de... | import tornado
import time
from bson.json_util import dumps
from tornado.options import options
class FilesServiceHandler(tornado.web.RequestHandler):
def initialize(self, logger, mongodb):
self.logger = logger
self.mongodb = mongodb[options.db_name]['Files']
@tornado.web.asynchronous
@to... | Save file info in DB | Save file info in DB
| Python | apache-2.0 | jiss-software/jiss-file-service,jiss-software/jiss-file-service,jiss-software/jiss-file-service | import tornado
import time
from bson.json_util import dumps
from tornado.options import options
class FilesServiceHandler(tornado.web.RequestHandler):
def initialize(self, logger, mongodb):
self.logger = logger
self.mongodb = mongodb
@tornado.web.asynchronous
@tornado.gen.coroutine
de... | import tornado
import time
from bson.json_util import dumps
from tornado.options import options
class FilesServiceHandler(tornado.web.RequestHandler):
def initialize(self, logger, mongodb):
self.logger = logger
self.mongodb = mongodb[options.db_name]['Files']
@tornado.web.asynchronous
@to... | <commit_before>import tornado
import time
from bson.json_util import dumps
from tornado.options import options
class FilesServiceHandler(tornado.web.RequestHandler):
def initialize(self, logger, mongodb):
self.logger = logger
self.mongodb = mongodb
@tornado.web.asynchronous
@tornado.gen.c... | import tornado
import time
from bson.json_util import dumps
from tornado.options import options
class FilesServiceHandler(tornado.web.RequestHandler):
def initialize(self, logger, mongodb):
self.logger = logger
self.mongodb = mongodb[options.db_name]['Files']
@tornado.web.asynchronous
@to... | import tornado
import time
from bson.json_util import dumps
from tornado.options import options
class FilesServiceHandler(tornado.web.RequestHandler):
def initialize(self, logger, mongodb):
self.logger = logger
self.mongodb = mongodb
@tornado.web.asynchronous
@tornado.gen.coroutine
de... | <commit_before>import tornado
import time
from bson.json_util import dumps
from tornado.options import options
class FilesServiceHandler(tornado.web.RequestHandler):
def initialize(self, logger, mongodb):
self.logger = logger
self.mongodb = mongodb
@tornado.web.asynchronous
@tornado.gen.c... |
996713fc6aefe20b28c729c46532ae566d5160a1 | paratemp/sim_setup/__init__.py | paratemp/sim_setup/__init__.py | """This module has functions and classes useful for setting up simulations"""
########################################################################
# #
# This test was written by Thomas Heavey in 2019. #
# theavey@bu.ed... | """This module has functions and classes useful for setting up simulations"""
########################################################################
# #
# This test was written by Thomas Heavey in 2019. #
# theavey@bu.ed... | Fix import order (some somewhat cyclic dependencies; should fix) | Fix import order (some somewhat cyclic dependencies; should fix)
| Python | apache-2.0 | theavey/ParaTemp,theavey/ParaTemp | """This module has functions and classes useful for setting up simulations"""
########################################################################
# #
# This test was written by Thomas Heavey in 2019. #
# theavey@bu.ed... | """This module has functions and classes useful for setting up simulations"""
########################################################################
# #
# This test was written by Thomas Heavey in 2019. #
# theavey@bu.ed... | <commit_before>"""This module has functions and classes useful for setting up simulations"""
########################################################################
# #
# This test was written by Thomas Heavey in 2019. #
# ... | """This module has functions and classes useful for setting up simulations"""
########################################################################
# #
# This test was written by Thomas Heavey in 2019. #
# theavey@bu.ed... | """This module has functions and classes useful for setting up simulations"""
########################################################################
# #
# This test was written by Thomas Heavey in 2019. #
# theavey@bu.ed... | <commit_before>"""This module has functions and classes useful for setting up simulations"""
########################################################################
# #
# This test was written by Thomas Heavey in 2019. #
# ... |
d787039a58d63cd85068da996a12fc36c1d63804 | ixxy_admin_utils/admin_actions.py | ixxy_admin_utils/admin_actions.py | def xlsx_export_action(modeladmin, request, queryset):
from django.http import HttpResponse
from import_export.formats import base_formats
formats = modeladmin.get_export_formats()
file_format = base_formats.XLSX()
export_data = modeladmin.get_export_data(file_format, queryset, request=request)
... | from django.http import HttpResponse
from import_export.formats import base_formats
def xlsx_export_action(modeladmin, request, queryset):
formats = modeladmin.get_export_formats()
file_format = base_formats.XLSX()
export_data = modeladmin.get_export_data(file_format, queryset, request=request)
cont... | Undo previous commit. It didn't work. | Undo previous commit. It didn't work.
| Python | mit | DjangoAdminHackers/ixxy-admin-utils,DjangoAdminHackers/ixxy-admin-utils | def xlsx_export_action(modeladmin, request, queryset):
from django.http import HttpResponse
from import_export.formats import base_formats
formats = modeladmin.get_export_formats()
file_format = base_formats.XLSX()
export_data = modeladmin.get_export_data(file_format, queryset, request=request)
... | from django.http import HttpResponse
from import_export.formats import base_formats
def xlsx_export_action(modeladmin, request, queryset):
formats = modeladmin.get_export_formats()
file_format = base_formats.XLSX()
export_data = modeladmin.get_export_data(file_format, queryset, request=request)
cont... | <commit_before>def xlsx_export_action(modeladmin, request, queryset):
from django.http import HttpResponse
from import_export.formats import base_formats
formats = modeladmin.get_export_formats()
file_format = base_formats.XLSX()
export_data = modeladmin.get_export_data(file_format, queryset, requ... | from django.http import HttpResponse
from import_export.formats import base_formats
def xlsx_export_action(modeladmin, request, queryset):
formats = modeladmin.get_export_formats()
file_format = base_formats.XLSX()
export_data = modeladmin.get_export_data(file_format, queryset, request=request)
cont... | def xlsx_export_action(modeladmin, request, queryset):
from django.http import HttpResponse
from import_export.formats import base_formats
formats = modeladmin.get_export_formats()
file_format = base_formats.XLSX()
export_data = modeladmin.get_export_data(file_format, queryset, request=request)
... | <commit_before>def xlsx_export_action(modeladmin, request, queryset):
from django.http import HttpResponse
from import_export.formats import base_formats
formats = modeladmin.get_export_formats()
file_format = base_formats.XLSX()
export_data = modeladmin.get_export_data(file_format, queryset, requ... |
7dfe4381ecd252530cb7dc274b2dc6aaa39f81cc | deps/pyextensibletype/extensibletype/test/test_interning.py | deps/pyextensibletype/extensibletype/test/test_interning.py | from .. import intern
def test_global_interning():
try:
intern.global_intern("hello")
except AssertionError as e:
pass
else:
raise Exception("Expects complaint about uninitialized table")
intern.global_intern_initialize()
id1 = intern.global_intern("hello")
id2 = intern... | from .. import intern
def test_global_interning():
# Can't really test for this with nose...
# try:
# intern.global_intern("hello")
# except AssertionError as e:
# pass
# else:
# raise Exception("Expects complaint about uninitialized table")
intern.global_intern_initialize(... | Disable global intern exception test | Disable global intern exception test
| Python | bsd-2-clause | stuartarchibald/numba,pitrou/numba,pitrou/numba,shiquanwang/numba,seibert/numba,jriehl/numba,shiquanwang/numba,stefanseefeld/numba,stuartarchibald/numba,cpcloud/numba,cpcloud/numba,gdementen/numba,seibert/numba,numba/numba,sklam/numba,ssarangi/numba,gmarkall/numba,cpcloud/numba,sklam/numba,pitrou/numba,IntelLabs/numba,... | from .. import intern
def test_global_interning():
try:
intern.global_intern("hello")
except AssertionError as e:
pass
else:
raise Exception("Expects complaint about uninitialized table")
intern.global_intern_initialize()
id1 = intern.global_intern("hello")
id2 = intern... | from .. import intern
def test_global_interning():
# Can't really test for this with nose...
# try:
# intern.global_intern("hello")
# except AssertionError as e:
# pass
# else:
# raise Exception("Expects complaint about uninitialized table")
intern.global_intern_initialize(... | <commit_before>from .. import intern
def test_global_interning():
try:
intern.global_intern("hello")
except AssertionError as e:
pass
else:
raise Exception("Expects complaint about uninitialized table")
intern.global_intern_initialize()
id1 = intern.global_intern("hello")
... | from .. import intern
def test_global_interning():
# Can't really test for this with nose...
# try:
# intern.global_intern("hello")
# except AssertionError as e:
# pass
# else:
# raise Exception("Expects complaint about uninitialized table")
intern.global_intern_initialize(... | from .. import intern
def test_global_interning():
try:
intern.global_intern("hello")
except AssertionError as e:
pass
else:
raise Exception("Expects complaint about uninitialized table")
intern.global_intern_initialize()
id1 = intern.global_intern("hello")
id2 = intern... | <commit_before>from .. import intern
def test_global_interning():
try:
intern.global_intern("hello")
except AssertionError as e:
pass
else:
raise Exception("Expects complaint about uninitialized table")
intern.global_intern_initialize()
id1 = intern.global_intern("hello")
... |
5bece700c7ebbb2c9ea3ce2781863baf189e2fc0 | cybox/test/objects/__init__.py | cybox/test/objects/__init__.py | # Copyright (c) 2013, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
import cybox.utils
class ObjectTestCase(object):
"""A base class for testing all subclasses of ObjectProperties.
Each subclass of ObjectTestCase should subclass both unittest.TestCase
and ObjectTestCa... | # Copyright (c) 2013, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
import cybox.test
import cybox.utils
class ObjectTestCase(object):
"""A base class for testing all subclasses of ObjectProperties.
Each subclass of ObjectTestCase should subclass both unittest.TestCase
... | Add (failing) test of object_reference on all ObjectProperties subclasses | Add (failing) test of object_reference on all ObjectProperties subclasses
| Python | bsd-3-clause | CybOXProject/python-cybox | # Copyright (c) 2013, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
import cybox.utils
class ObjectTestCase(object):
"""A base class for testing all subclasses of ObjectProperties.
Each subclass of ObjectTestCase should subclass both unittest.TestCase
and ObjectTestCa... | # Copyright (c) 2013, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
import cybox.test
import cybox.utils
class ObjectTestCase(object):
"""A base class for testing all subclasses of ObjectProperties.
Each subclass of ObjectTestCase should subclass both unittest.TestCase
... | <commit_before># Copyright (c) 2013, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
import cybox.utils
class ObjectTestCase(object):
"""A base class for testing all subclasses of ObjectProperties.
Each subclass of ObjectTestCase should subclass both unittest.TestCase
a... | # Copyright (c) 2013, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
import cybox.test
import cybox.utils
class ObjectTestCase(object):
"""A base class for testing all subclasses of ObjectProperties.
Each subclass of ObjectTestCase should subclass both unittest.TestCase
... | # Copyright (c) 2013, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
import cybox.utils
class ObjectTestCase(object):
"""A base class for testing all subclasses of ObjectProperties.
Each subclass of ObjectTestCase should subclass both unittest.TestCase
and ObjectTestCa... | <commit_before># Copyright (c) 2013, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
import cybox.utils
class ObjectTestCase(object):
"""A base class for testing all subclasses of ObjectProperties.
Each subclass of ObjectTestCase should subclass both unittest.TestCase
a... |
a354a4f52bce3c3063678b046ba76a694c076652 | web/celSearch/api/scripts/query_wikipedia.py | web/celSearch/api/scripts/query_wikipedia.py | '''
Script used to query Wikipedia for summary of object
'''
import sys
import wikipedia
def main():
# Check that we have the right number of arguments
if (len(sys.argv) != 2):
print 'Incorrect number of arguments; please pass in only one string that contains the subject'
return 'Banana'
print wikipedia... | '''
Script used to query Wikipedia for summary of object
'''
import sys
import wikipedia
import nltk
def main():
# Check that we have the right number of arguments
if (len(sys.argv) != 2):
print 'Incorrect number of arguments; please pass in only one string that contains the query'
return 'Banana'
# Ge... | Add nltk part to script | Add nltk part to script
| Python | apache-2.0 | christopher18/Celsearch,christopher18/Celsearch,christopher18/Celsearch | '''
Script used to query Wikipedia for summary of object
'''
import sys
import wikipedia
def main():
# Check that we have the right number of arguments
if (len(sys.argv) != 2):
print 'Incorrect number of arguments; please pass in only one string that contains the subject'
return 'Banana'
print wikipedia... | '''
Script used to query Wikipedia for summary of object
'''
import sys
import wikipedia
import nltk
def main():
# Check that we have the right number of arguments
if (len(sys.argv) != 2):
print 'Incorrect number of arguments; please pass in only one string that contains the query'
return 'Banana'
# Ge... | <commit_before>'''
Script used to query Wikipedia for summary of object
'''
import sys
import wikipedia
def main():
# Check that we have the right number of arguments
if (len(sys.argv) != 2):
print 'Incorrect number of arguments; please pass in only one string that contains the subject'
return 'Banana'
... | '''
Script used to query Wikipedia for summary of object
'''
import sys
import wikipedia
import nltk
def main():
# Check that we have the right number of arguments
if (len(sys.argv) != 2):
print 'Incorrect number of arguments; please pass in only one string that contains the query'
return 'Banana'
# Ge... | '''
Script used to query Wikipedia for summary of object
'''
import sys
import wikipedia
def main():
# Check that we have the right number of arguments
if (len(sys.argv) != 2):
print 'Incorrect number of arguments; please pass in only one string that contains the subject'
return 'Banana'
print wikipedia... | <commit_before>'''
Script used to query Wikipedia for summary of object
'''
import sys
import wikipedia
def main():
# Check that we have the right number of arguments
if (len(sys.argv) != 2):
print 'Incorrect number of arguments; please pass in only one string that contains the subject'
return 'Banana'
... |
2a7ce1ac70f8767e9d2b2a9f1d335cfcc63a92b6 | rplugin/python3/LanguageClient/logger.py | rplugin/python3/LanguageClient/logger.py | import logging
import tempfile
logger = logging.getLogger("LanguageClient")
with tempfile.NamedTemporaryFile(
prefix="LanguageClient-",
suffix=".log", delete=False) as tmp:
tmpname = tmp.name
fileHandler = logging.FileHandler(filename=tmpname)
fileHandler.setFormatter(
logging.Formatter(
... | import logging
logger = logging.getLogger("LanguageClient")
fileHandler = logging.FileHandler(filename="/tmp/LanguageClient.log")
fileHandler.setFormatter(
logging.Formatter(
"%(asctime)s %(levelname)-8s %(message)s",
"%H:%M:%S"))
logger.addHandler(fileHandler)
logger.setLevel(logging.WARN)
| Revert "Use tempfile lib for log file" | Revert "Use tempfile lib for log file"
This reverts commit 6e8f35b83fc563c8349cb3be040c61a0588ca745.
The commit caused severer issue than it fixed. In case one need to check
the content of log file, there is no way to tell where the log file
location/name is.
| Python | mit | autozimu/LanguageClient-neovim,autozimu/LanguageClient-neovim,autozimu/LanguageClient-neovim,autozimu/LanguageClient-neovim,autozimu/LanguageClient-neovim,autozimu/LanguageClient-neovim,autozimu/LanguageClient-neovim,autozimu/LanguageClient-neovim,autozimu/LanguageClient-neovim,autozimu/LanguageClient-neovim,autozimu/L... | import logging
import tempfile
logger = logging.getLogger("LanguageClient")
with tempfile.NamedTemporaryFile(
prefix="LanguageClient-",
suffix=".log", delete=False) as tmp:
tmpname = tmp.name
fileHandler = logging.FileHandler(filename=tmpname)
fileHandler.setFormatter(
logging.Formatter(
... | import logging
logger = logging.getLogger("LanguageClient")
fileHandler = logging.FileHandler(filename="/tmp/LanguageClient.log")
fileHandler.setFormatter(
logging.Formatter(
"%(asctime)s %(levelname)-8s %(message)s",
"%H:%M:%S"))
logger.addHandler(fileHandler)
logger.setLevel(logging.WARN)
| <commit_before>import logging
import tempfile
logger = logging.getLogger("LanguageClient")
with tempfile.NamedTemporaryFile(
prefix="LanguageClient-",
suffix=".log", delete=False) as tmp:
tmpname = tmp.name
fileHandler = logging.FileHandler(filename=tmpname)
fileHandler.setFormatter(
logging.Fo... | import logging
logger = logging.getLogger("LanguageClient")
fileHandler = logging.FileHandler(filename="/tmp/LanguageClient.log")
fileHandler.setFormatter(
logging.Formatter(
"%(asctime)s %(levelname)-8s %(message)s",
"%H:%M:%S"))
logger.addHandler(fileHandler)
logger.setLevel(logging.WARN)
| import logging
import tempfile
logger = logging.getLogger("LanguageClient")
with tempfile.NamedTemporaryFile(
prefix="LanguageClient-",
suffix=".log", delete=False) as tmp:
tmpname = tmp.name
fileHandler = logging.FileHandler(filename=tmpname)
fileHandler.setFormatter(
logging.Formatter(
... | <commit_before>import logging
import tempfile
logger = logging.getLogger("LanguageClient")
with tempfile.NamedTemporaryFile(
prefix="LanguageClient-",
suffix=".log", delete=False) as tmp:
tmpname = tmp.name
fileHandler = logging.FileHandler(filename=tmpname)
fileHandler.setFormatter(
logging.Fo... |
21a392df73324f111fa80e2fd8ce88b0e32c954c | python/algorithms/fibonacci.py | python/algorithms/fibonacci.py | def fib1(amount):
"""
Fibonacci generator example. The second variable is used to store
the result.
:param amount: Amount of numbers to produce.
:return: Generator.
>>> list(fib1(0))
[]
>>> list(fib1(1))
[0]
>>> list(fib1(3))
[0, 1, 1]
>>> list(fib1(9))
[0, 1, 1, 2, ... | """Implementations calculation of Fibonacci numbers."""
def fib1(amount):
"""
Calculate Fibonacci numbers.
The second variable is used to store the result.
:param amount: Amount of numbers to produce.
:return: Generator.
>>> list(fib1(0))
[]
>>> list(fib1(1))
[0]
>>> list(fib... | Adjust doc strings in Fibonacci numbers implementation | Adjust doc strings in Fibonacci numbers implementation
| Python | mit | pesh1983/exercises,pesh1983/exercises | def fib1(amount):
"""
Fibonacci generator example. The second variable is used to store
the result.
:param amount: Amount of numbers to produce.
:return: Generator.
>>> list(fib1(0))
[]
>>> list(fib1(1))
[0]
>>> list(fib1(3))
[0, 1, 1]
>>> list(fib1(9))
[0, 1, 1, 2, ... | """Implementations calculation of Fibonacci numbers."""
def fib1(amount):
"""
Calculate Fibonacci numbers.
The second variable is used to store the result.
:param amount: Amount of numbers to produce.
:return: Generator.
>>> list(fib1(0))
[]
>>> list(fib1(1))
[0]
>>> list(fib... | <commit_before>def fib1(amount):
"""
Fibonacci generator example. The second variable is used to store
the result.
:param amount: Amount of numbers to produce.
:return: Generator.
>>> list(fib1(0))
[]
>>> list(fib1(1))
[0]
>>> list(fib1(3))
[0, 1, 1]
>>> list(fib1(9))
... | """Implementations calculation of Fibonacci numbers."""
def fib1(amount):
"""
Calculate Fibonacci numbers.
The second variable is used to store the result.
:param amount: Amount of numbers to produce.
:return: Generator.
>>> list(fib1(0))
[]
>>> list(fib1(1))
[0]
>>> list(fib... | def fib1(amount):
"""
Fibonacci generator example. The second variable is used to store
the result.
:param amount: Amount of numbers to produce.
:return: Generator.
>>> list(fib1(0))
[]
>>> list(fib1(1))
[0]
>>> list(fib1(3))
[0, 1, 1]
>>> list(fib1(9))
[0, 1, 1, 2, ... | <commit_before>def fib1(amount):
"""
Fibonacci generator example. The second variable is used to store
the result.
:param amount: Amount of numbers to produce.
:return: Generator.
>>> list(fib1(0))
[]
>>> list(fib1(1))
[0]
>>> list(fib1(3))
[0, 1, 1]
>>> list(fib1(9))
... |
9c1190133a680717850a4d0f46a96591b7be4e33 | autoencoder/api.py | autoencoder/api.py | from .io import preprocess
from .train import train
from .encode import encode
def autoencode(count_matrix, kfold=None, reduced=False,
censor_matrix=None, type='normal',
learning_rate=1e-2,
hidden_size=10,
epochs=10):
x = preprocess(count_matrix, kfold=... | from .io import preprocess
from .train import train
from .encode import encode
def autoencode(count_matrix, kfold=None, reduced=False,
mask=None, type='normal',
learning_rate=1e-2,
hidden_size=10,
epochs=10):
x = preprocess(count_matrix, kfold=kfold, ma... | Change mask parameter in API. | Change mask parameter in API.
| Python | apache-2.0 | theislab/dca,theislab/dca,theislab/dca | from .io import preprocess
from .train import train
from .encode import encode
def autoencode(count_matrix, kfold=None, reduced=False,
censor_matrix=None, type='normal',
learning_rate=1e-2,
hidden_size=10,
epochs=10):
x = preprocess(count_matrix, kfold=... | from .io import preprocess
from .train import train
from .encode import encode
def autoencode(count_matrix, kfold=None, reduced=False,
mask=None, type='normal',
learning_rate=1e-2,
hidden_size=10,
epochs=10):
x = preprocess(count_matrix, kfold=kfold, ma... | <commit_before>from .io import preprocess
from .train import train
from .encode import encode
def autoencode(count_matrix, kfold=None, reduced=False,
censor_matrix=None, type='normal',
learning_rate=1e-2,
hidden_size=10,
epochs=10):
x = preprocess(count... | from .io import preprocess
from .train import train
from .encode import encode
def autoencode(count_matrix, kfold=None, reduced=False,
mask=None, type='normal',
learning_rate=1e-2,
hidden_size=10,
epochs=10):
x = preprocess(count_matrix, kfold=kfold, ma... | from .io import preprocess
from .train import train
from .encode import encode
def autoencode(count_matrix, kfold=None, reduced=False,
censor_matrix=None, type='normal',
learning_rate=1e-2,
hidden_size=10,
epochs=10):
x = preprocess(count_matrix, kfold=... | <commit_before>from .io import preprocess
from .train import train
from .encode import encode
def autoencode(count_matrix, kfold=None, reduced=False,
censor_matrix=None, type='normal',
learning_rate=1e-2,
hidden_size=10,
epochs=10):
x = preprocess(count... |
8d7e4cf37e73c1ff9827e94a06327921f553e2f4 | learntools/computer_vision/ex4.py | learntools/computer_vision/ex4.py | from learntools.core import *
import tensorflow as tf
class Q1A(ThoughtExperiment):
_solution = ""
class Q1B(ThoughtExperiment):
_solution = ""
Q1 = MultipartProblem(Q1A, Q1B)
class Q2A(ThoughtExperiment):
_hint = r"Stacking the second layer expanded the receptive field by one neuron on each side, giv... | from learntools.core import *
import tensorflow as tf
# Free
class Q1(CodingProblem):
_solution = ""
def check(self):
pass
class Q2A(ThoughtExperiment):
_hint = r"Stacking the second layer expanded the receptive field by one neuron on each side, giving $3+1+1=5$ for each dimension. If you expande... | Change exercise 4 question 1 | Change exercise 4 question 1
| Python | apache-2.0 | Kaggle/learntools,Kaggle/learntools | from learntools.core import *
import tensorflow as tf
class Q1A(ThoughtExperiment):
_solution = ""
class Q1B(ThoughtExperiment):
_solution = ""
Q1 = MultipartProblem(Q1A, Q1B)
class Q2A(ThoughtExperiment):
_hint = r"Stacking the second layer expanded the receptive field by one neuron on each side, giv... | from learntools.core import *
import tensorflow as tf
# Free
class Q1(CodingProblem):
_solution = ""
def check(self):
pass
class Q2A(ThoughtExperiment):
_hint = r"Stacking the second layer expanded the receptive field by one neuron on each side, giving $3+1+1=5$ for each dimension. If you expande... | <commit_before>from learntools.core import *
import tensorflow as tf
class Q1A(ThoughtExperiment):
_solution = ""
class Q1B(ThoughtExperiment):
_solution = ""
Q1 = MultipartProblem(Q1A, Q1B)
class Q2A(ThoughtExperiment):
_hint = r"Stacking the second layer expanded the receptive field by one neuron on... | from learntools.core import *
import tensorflow as tf
# Free
class Q1(CodingProblem):
_solution = ""
def check(self):
pass
class Q2A(ThoughtExperiment):
_hint = r"Stacking the second layer expanded the receptive field by one neuron on each side, giving $3+1+1=5$ for each dimension. If you expande... | from learntools.core import *
import tensorflow as tf
class Q1A(ThoughtExperiment):
_solution = ""
class Q1B(ThoughtExperiment):
_solution = ""
Q1 = MultipartProblem(Q1A, Q1B)
class Q2A(ThoughtExperiment):
_hint = r"Stacking the second layer expanded the receptive field by one neuron on each side, giv... | <commit_before>from learntools.core import *
import tensorflow as tf
class Q1A(ThoughtExperiment):
_solution = ""
class Q1B(ThoughtExperiment):
_solution = ""
Q1 = MultipartProblem(Q1A, Q1B)
class Q2A(ThoughtExperiment):
_hint = r"Stacking the second layer expanded the receptive field by one neuron on... |
2ee895c61f546f83f4b7fa0c6a2ba72578c378be | problem_2/solution.py | problem_2/solution.py | f1, f2, s, n = 0, 1, 0, 4000000
while f2 < n:
f2, f1 = f1, f1 + f2
if f2 % 2 == 0:
s += f2
print s
| def sum_even_fibonacci_numbers_1():
f1, f2, s, = 0, 1, 0,
while f2 < 4000000:
f2, f1 = f1, f1 + f2
if f2 % 2 == 0:
s += f2
return s
def sum_even_fibonacci_numbers_2():
s, a, b = 0, 1, 1
c = a + b
while c < 4000000:
s += c
a = b + c
b = a + c
... | Add a second Python implementation of problem 2 | Add a second Python implementation of problem 2
| Python | mit | mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler | f1, f2, s, n = 0, 1, 0, 4000000
while f2 < n:
f2, f1 = f1, f1 + f2
if f2 % 2 == 0:
s += f2
print s
Add a second Python implementation of problem 2 | def sum_even_fibonacci_numbers_1():
f1, f2, s, = 0, 1, 0,
while f2 < 4000000:
f2, f1 = f1, f1 + f2
if f2 % 2 == 0:
s += f2
return s
def sum_even_fibonacci_numbers_2():
s, a, b = 0, 1, 1
c = a + b
while c < 4000000:
s += c
a = b + c
b = a + c
... | <commit_before>f1, f2, s, n = 0, 1, 0, 4000000
while f2 < n:
f2, f1 = f1, f1 + f2
if f2 % 2 == 0:
s += f2
print s
<commit_msg>Add a second Python implementation of problem 2<commit_after> | def sum_even_fibonacci_numbers_1():
f1, f2, s, = 0, 1, 0,
while f2 < 4000000:
f2, f1 = f1, f1 + f2
if f2 % 2 == 0:
s += f2
return s
def sum_even_fibonacci_numbers_2():
s, a, b = 0, 1, 1
c = a + b
while c < 4000000:
s += c
a = b + c
b = a + c
... | f1, f2, s, n = 0, 1, 0, 4000000
while f2 < n:
f2, f1 = f1, f1 + f2
if f2 % 2 == 0:
s += f2
print s
Add a second Python implementation of problem 2def sum_even_fibonacci_numbers_1():
f1, f2, s, = 0, 1, 0,
while f2 < 4000000:
f2, f1 = f1, f1 + f2
if f2 % 2 == 0:
s += f2... | <commit_before>f1, f2, s, n = 0, 1, 0, 4000000
while f2 < n:
f2, f1 = f1, f1 + f2
if f2 % 2 == 0:
s += f2
print s
<commit_msg>Add a second Python implementation of problem 2<commit_after>def sum_even_fibonacci_numbers_1():
f1, f2, s, = 0, 1, 0,
while f2 < 4000000:
f2, f1 = f1, f1 + f2
... |
5523ae2278bb0ca055ef7a6e218ac40ed4172bf3 | webapp/byceps/blueprints/ticket/service.py | webapp/byceps/blueprints/ticket/service.py | # -*- coding: utf-8 -*-
"""
byceps.blueprints.ticket.service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2015 Jochen Kupperschmidt
"""
from ..party.models import Party
from ..seating.models import Category
from .models import Ticket
def find_ticket_for_user(user, party):
"""Return the ticket used by the... | # -*- coding: utf-8 -*-
"""
byceps.blueprints.ticket.service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2015 Jochen Kupperschmidt
"""
from ...database import db
from ..party.models import Party
from ..seating.models import Category
from .models import Ticket
def find_ticket_for_user(user, party):
"""R... | Save a few SQL queries. | Save a few SQL queries.
| Python | bsd-3-clause | m-ober/byceps,homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps,m-ober/byceps,m-ober/byceps | # -*- coding: utf-8 -*-
"""
byceps.blueprints.ticket.service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2015 Jochen Kupperschmidt
"""
from ..party.models import Party
from ..seating.models import Category
from .models import Ticket
def find_ticket_for_user(user, party):
"""Return the ticket used by the... | # -*- coding: utf-8 -*-
"""
byceps.blueprints.ticket.service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2015 Jochen Kupperschmidt
"""
from ...database import db
from ..party.models import Party
from ..seating.models import Category
from .models import Ticket
def find_ticket_for_user(user, party):
"""R... | <commit_before># -*- coding: utf-8 -*-
"""
byceps.blueprints.ticket.service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2015 Jochen Kupperschmidt
"""
from ..party.models import Party
from ..seating.models import Category
from .models import Ticket
def find_ticket_for_user(user, party):
"""Return the tic... | # -*- coding: utf-8 -*-
"""
byceps.blueprints.ticket.service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2015 Jochen Kupperschmidt
"""
from ...database import db
from ..party.models import Party
from ..seating.models import Category
from .models import Ticket
def find_ticket_for_user(user, party):
"""R... | # -*- coding: utf-8 -*-
"""
byceps.blueprints.ticket.service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2015 Jochen Kupperschmidt
"""
from ..party.models import Party
from ..seating.models import Category
from .models import Ticket
def find_ticket_for_user(user, party):
"""Return the ticket used by the... | <commit_before># -*- coding: utf-8 -*-
"""
byceps.blueprints.ticket.service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2015 Jochen Kupperschmidt
"""
from ..party.models import Party
from ..seating.models import Category
from .models import Ticket
def find_ticket_for_user(user, party):
"""Return the tic... |
7dc08364cbe513ce4b81483d9330789f5893fcee | Challenges/chall_03.py | Challenges/chall_03.py | #!/usr/local/bin/python3
# Python challenge - 3
# http://www.pythonchallenge.com/pc/def/equality.html
import re
'''
Hint:
One small letter surrounded by EXACTLY three big bodyguards on each of
its sides.
'''
def main():
with open('bodyguard.txt', 'r') as bodyguard:
pattern = re.compile(r'[^A-Z][A-Z]{3}... | #!/usr/local/bin/python3
# Python challenge - 3
# http://www.pythonchallenge.com/pc/def/equality.html
# Keyword: linkedlist
import re
def main():
'''
Hint:
One small letter surrounded by EXACTLY three big bodyguards on each of
its sides.
Page source text saved in bodyguard.txt
'''
with op... | Refactor code, add hints from page | Refactor code, add hints from page
| Python | mit | HKuz/PythonChallenge | #!/usr/local/bin/python3
# Python challenge - 3
# http://www.pythonchallenge.com/pc/def/equality.html
import re
'''
Hint:
One small letter surrounded by EXACTLY three big bodyguards on each of
its sides.
'''
def main():
with open('bodyguard.txt', 'r') as bodyguard:
pattern = re.compile(r'[^A-Z][A-Z]{3}... | #!/usr/local/bin/python3
# Python challenge - 3
# http://www.pythonchallenge.com/pc/def/equality.html
# Keyword: linkedlist
import re
def main():
'''
Hint:
One small letter surrounded by EXACTLY three big bodyguards on each of
its sides.
Page source text saved in bodyguard.txt
'''
with op... | <commit_before>#!/usr/local/bin/python3
# Python challenge - 3
# http://www.pythonchallenge.com/pc/def/equality.html
import re
'''
Hint:
One small letter surrounded by EXACTLY three big bodyguards on each of
its sides.
'''
def main():
with open('bodyguard.txt', 'r') as bodyguard:
pattern = re.compile(r... | #!/usr/local/bin/python3
# Python challenge - 3
# http://www.pythonchallenge.com/pc/def/equality.html
# Keyword: linkedlist
import re
def main():
'''
Hint:
One small letter surrounded by EXACTLY three big bodyguards on each of
its sides.
Page source text saved in bodyguard.txt
'''
with op... | #!/usr/local/bin/python3
# Python challenge - 3
# http://www.pythonchallenge.com/pc/def/equality.html
import re
'''
Hint:
One small letter surrounded by EXACTLY three big bodyguards on each of
its sides.
'''
def main():
with open('bodyguard.txt', 'r') as bodyguard:
pattern = re.compile(r'[^A-Z][A-Z]{3}... | <commit_before>#!/usr/local/bin/python3
# Python challenge - 3
# http://www.pythonchallenge.com/pc/def/equality.html
import re
'''
Hint:
One small letter surrounded by EXACTLY three big bodyguards on each of
its sides.
'''
def main():
with open('bodyguard.txt', 'r') as bodyguard:
pattern = re.compile(r... |
da85d9660166f67133b10953104ccd81b89d0b92 | micawber/cache.py | micawber/cache.py | from __future__ import with_statement
import os
import pickle
from contextlib import closing
try:
from redis import Redis
except ImportError:
Redis = None
class Cache(object):
def __init__(self):
self._cache = {}
def get(self, k):
return self._cache.get(k)
def set(self, k, v):
... | from __future__ import with_statement
import os
import pickle
try:
from redis import Redis
except ImportError:
Redis = None
class Cache(object):
def __init__(self):
self._cache = {}
def get(self, k):
return self._cache.get(k)
def set(self, k, v):
self._cache[k] = v
clas... | Remove a redundant use of contextlib.closing() decorator | Remove a redundant use of contextlib.closing() decorator
Remove the unnecessary contextlib.closing() decorators from open()
calls. The file objects returned by open() provide context manager API
themselves and closing() is only necessary for external file-like
objects that do not support it.
This should work even in... | Python | mit | coleifer/micawber,coleifer/micawber | from __future__ import with_statement
import os
import pickle
from contextlib import closing
try:
from redis import Redis
except ImportError:
Redis = None
class Cache(object):
def __init__(self):
self._cache = {}
def get(self, k):
return self._cache.get(k)
def set(self, k, v):
... | from __future__ import with_statement
import os
import pickle
try:
from redis import Redis
except ImportError:
Redis = None
class Cache(object):
def __init__(self):
self._cache = {}
def get(self, k):
return self._cache.get(k)
def set(self, k, v):
self._cache[k] = v
clas... | <commit_before>from __future__ import with_statement
import os
import pickle
from contextlib import closing
try:
from redis import Redis
except ImportError:
Redis = None
class Cache(object):
def __init__(self):
self._cache = {}
def get(self, k):
return self._cache.get(k)
def set(... | from __future__ import with_statement
import os
import pickle
try:
from redis import Redis
except ImportError:
Redis = None
class Cache(object):
def __init__(self):
self._cache = {}
def get(self, k):
return self._cache.get(k)
def set(self, k, v):
self._cache[k] = v
clas... | from __future__ import with_statement
import os
import pickle
from contextlib import closing
try:
from redis import Redis
except ImportError:
Redis = None
class Cache(object):
def __init__(self):
self._cache = {}
def get(self, k):
return self._cache.get(k)
def set(self, k, v):
... | <commit_before>from __future__ import with_statement
import os
import pickle
from contextlib import closing
try:
from redis import Redis
except ImportError:
Redis = None
class Cache(object):
def __init__(self):
self._cache = {}
def get(self, k):
return self._cache.get(k)
def set(... |
2c7dc769874766b230bc11c7ec6f67d3c1157005 | duplicatefiledir/__init__.py | duplicatefiledir/__init__.py | from fman import DirectoryPaneCommand, show_alert
import distutils
from distutils import dir_util, file_util
import os.path
class DuplicateFileDir(DirectoryPaneCommand):
def __call__(self):
selected_files = self.pane.get_selected_files()
if len(selected_files) >= 1 or (len(selected_files) =... | from fman import DirectoryPaneCommand, show_alert
from urllib.parse import urlparse
import os.path
from shutil import copytree, copyfile
class DuplicateFileDir(DirectoryPaneCommand):
def __call__(self):
selected_files = self.pane.get_selected_files()
if len(selected_files) >= 1 or (len(sele... | Make it work with last fman version (0.7) on linux | Make it work with last fman version (0.7) on linux
| Python | mit | raguay/DuplicateFileDir | from fman import DirectoryPaneCommand, show_alert
import distutils
from distutils import dir_util, file_util
import os.path
class DuplicateFileDir(DirectoryPaneCommand):
def __call__(self):
selected_files = self.pane.get_selected_files()
if len(selected_files) >= 1 or (len(selected_files) =... | from fman import DirectoryPaneCommand, show_alert
from urllib.parse import urlparse
import os.path
from shutil import copytree, copyfile
class DuplicateFileDir(DirectoryPaneCommand):
def __call__(self):
selected_files = self.pane.get_selected_files()
if len(selected_files) >= 1 or (len(sele... | <commit_before>from fman import DirectoryPaneCommand, show_alert
import distutils
from distutils import dir_util, file_util
import os.path
class DuplicateFileDir(DirectoryPaneCommand):
def __call__(self):
selected_files = self.pane.get_selected_files()
if len(selected_files) >= 1 or (len(se... | from fman import DirectoryPaneCommand, show_alert
from urllib.parse import urlparse
import os.path
from shutil import copytree, copyfile
class DuplicateFileDir(DirectoryPaneCommand):
def __call__(self):
selected_files = self.pane.get_selected_files()
if len(selected_files) >= 1 or (len(sele... | from fman import DirectoryPaneCommand, show_alert
import distutils
from distutils import dir_util, file_util
import os.path
class DuplicateFileDir(DirectoryPaneCommand):
def __call__(self):
selected_files = self.pane.get_selected_files()
if len(selected_files) >= 1 or (len(selected_files) =... | <commit_before>from fman import DirectoryPaneCommand, show_alert
import distutils
from distutils import dir_util, file_util
import os.path
class DuplicateFileDir(DirectoryPaneCommand):
def __call__(self):
selected_files = self.pane.get_selected_files()
if len(selected_files) >= 1 or (len(se... |
2f80f786be8e0d235dcb98c4fa562bfe2b9e783f | jobs/spiders/visir.py | jobs/spiders/visir.py | import dateutil.parser
import scrapy
from jobs.items import JobsItem
class VisirSpider(scrapy.Spider):
name = "visir"
start_urls = ['https://job.visir.is/search-results-jobs/']
def parse(self, response):
for job in response.css('.thebox'):
info = job.css('a')[1]
item = J... | import dateutil.parser
import scrapy
from jobs.items import JobsItem
class VisirSpider(scrapy.Spider):
name = "visir"
start_urls = ['https://job.visir.is/search-results-jobs/']
def parse(self, response):
for job in response.css('.thebox'):
info = job.css('a')[1]
item = J... | Fix parsing of dates for Visir. | Fix parsing of dates for Visir.
Some dates are being wrongly parsed, so we need to specify some information about the order of things.
| Python | apache-2.0 | multiplechoice/workplace | import dateutil.parser
import scrapy
from jobs.items import JobsItem
class VisirSpider(scrapy.Spider):
name = "visir"
start_urls = ['https://job.visir.is/search-results-jobs/']
def parse(self, response):
for job in response.css('.thebox'):
info = job.css('a')[1]
item = J... | import dateutil.parser
import scrapy
from jobs.items import JobsItem
class VisirSpider(scrapy.Spider):
name = "visir"
start_urls = ['https://job.visir.is/search-results-jobs/']
def parse(self, response):
for job in response.css('.thebox'):
info = job.css('a')[1]
item = J... | <commit_before>import dateutil.parser
import scrapy
from jobs.items import JobsItem
class VisirSpider(scrapy.Spider):
name = "visir"
start_urls = ['https://job.visir.is/search-results-jobs/']
def parse(self, response):
for job in response.css('.thebox'):
info = job.css('a')[1]
... | import dateutil.parser
import scrapy
from jobs.items import JobsItem
class VisirSpider(scrapy.Spider):
name = "visir"
start_urls = ['https://job.visir.is/search-results-jobs/']
def parse(self, response):
for job in response.css('.thebox'):
info = job.css('a')[1]
item = J... | import dateutil.parser
import scrapy
from jobs.items import JobsItem
class VisirSpider(scrapy.Spider):
name = "visir"
start_urls = ['https://job.visir.is/search-results-jobs/']
def parse(self, response):
for job in response.css('.thebox'):
info = job.css('a')[1]
item = J... | <commit_before>import dateutil.parser
import scrapy
from jobs.items import JobsItem
class VisirSpider(scrapy.Spider):
name = "visir"
start_urls = ['https://job.visir.is/search-results-jobs/']
def parse(self, response):
for job in response.css('.thebox'):
info = job.css('a')[1]
... |
a24d6a25cb7ee5101e8131a9719744f79b23c11b | examples/quotes/quotes.py | examples/quotes/quotes.py | import sys
print(sys.version_info)
import random
import time
import networkzero as nw0
quotes = [
"Humpty Dumpty sat on a wall",
"Hickory Dickory Dock",
"Baa Baa Black Sheep",
"Old King Cole was a merry old sould",
]
def main(address_pattern=None):
my_name = input("Name: ")
my_address = nw0.a... | import sys
print(sys.version_info)
import random
import time
import networkzero as nw0
quotes = [
"Humpty Dumpty sat on a wall",
"Hickory Dickory Dock",
"Baa Baa Black Sheep",
"Old King Cole was a merry old sould",
]
def main(address_pattern=None):
my_name = input("Name: ")
my_address = nw0.a... | Send notification to the correct address | Send notification to the correct address
| Python | mit | tjguk/networkzero,tjguk/networkzero,tjguk/networkzero | import sys
print(sys.version_info)
import random
import time
import networkzero as nw0
quotes = [
"Humpty Dumpty sat on a wall",
"Hickory Dickory Dock",
"Baa Baa Black Sheep",
"Old King Cole was a merry old sould",
]
def main(address_pattern=None):
my_name = input("Name: ")
my_address = nw0.a... | import sys
print(sys.version_info)
import random
import time
import networkzero as nw0
quotes = [
"Humpty Dumpty sat on a wall",
"Hickory Dickory Dock",
"Baa Baa Black Sheep",
"Old King Cole was a merry old sould",
]
def main(address_pattern=None):
my_name = input("Name: ")
my_address = nw0.a... | <commit_before>import sys
print(sys.version_info)
import random
import time
import networkzero as nw0
quotes = [
"Humpty Dumpty sat on a wall",
"Hickory Dickory Dock",
"Baa Baa Black Sheep",
"Old King Cole was a merry old sould",
]
def main(address_pattern=None):
my_name = input("Name: ")
my_... | import sys
print(sys.version_info)
import random
import time
import networkzero as nw0
quotes = [
"Humpty Dumpty sat on a wall",
"Hickory Dickory Dock",
"Baa Baa Black Sheep",
"Old King Cole was a merry old sould",
]
def main(address_pattern=None):
my_name = input("Name: ")
my_address = nw0.a... | import sys
print(sys.version_info)
import random
import time
import networkzero as nw0
quotes = [
"Humpty Dumpty sat on a wall",
"Hickory Dickory Dock",
"Baa Baa Black Sheep",
"Old King Cole was a merry old sould",
]
def main(address_pattern=None):
my_name = input("Name: ")
my_address = nw0.a... | <commit_before>import sys
print(sys.version_info)
import random
import time
import networkzero as nw0
quotes = [
"Humpty Dumpty sat on a wall",
"Hickory Dickory Dock",
"Baa Baa Black Sheep",
"Old King Cole was a merry old sould",
]
def main(address_pattern=None):
my_name = input("Name: ")
my_... |
0f95070880f40456fbb6d7b7ccd6e999cc6fb95a | dropbox_conflict_resolver.py | dropbox_conflict_resolver.py | import os
import re
'''
This is used to revert back a Dropbox conflict. So in this case I want to keep all the files that where
converted to conflict copies. So I just strip out the conflict string ie (some computer names's conflict copy some date) .ext
and remove that conflict part of the string, and over... | import os
import re
'''
This is used to revert back a Dropbox conflict. So in this case I want to keep all the files that were
converted to conflict copies. So I just strip out the conflict string ie (some computer names's conflict copy some date) .ext
and remove that conflict part of the string, and overr... | Fix a couple of typos in the program description | Fix a couple of typos in the program description
| Python | apache-2.0 | alexwhb/Dropbox-bulk-conflict-resolver | import os
import re
'''
This is used to revert back a Dropbox conflict. So in this case I want to keep all the files that where
converted to conflict copies. So I just strip out the conflict string ie (some computer names's conflict copy some date) .ext
and remove that conflict part of the string, and over... | import os
import re
'''
This is used to revert back a Dropbox conflict. So in this case I want to keep all the files that were
converted to conflict copies. So I just strip out the conflict string ie (some computer names's conflict copy some date) .ext
and remove that conflict part of the string, and overr... | <commit_before>import os
import re
'''
This is used to revert back a Dropbox conflict. So in this case I want to keep all the files that where
converted to conflict copies. So I just strip out the conflict string ie (some computer names's conflict copy some date) .ext
and remove that conflict part of the s... | import os
import re
'''
This is used to revert back a Dropbox conflict. So in this case I want to keep all the files that were
converted to conflict copies. So I just strip out the conflict string ie (some computer names's conflict copy some date) .ext
and remove that conflict part of the string, and overr... | import os
import re
'''
This is used to revert back a Dropbox conflict. So in this case I want to keep all the files that where
converted to conflict copies. So I just strip out the conflict string ie (some computer names's conflict copy some date) .ext
and remove that conflict part of the string, and over... | <commit_before>import os
import re
'''
This is used to revert back a Dropbox conflict. So in this case I want to keep all the files that where
converted to conflict copies. So I just strip out the conflict string ie (some computer names's conflict copy some date) .ext
and remove that conflict part of the s... |
be07a935d041a6c2d1c641f9beebe1bb49891682 | cooler/cli/__init__.py | cooler/cli/__init__.py | # -*- coding: utf-8 -*-
from __future__ import division, print_function
import logging
import sys
import click
from .. import __version__, get_logger
logging.basicConfig(stream=sys.stderr)
logger = get_logger()
logger.setLevel(logging.INFO)
# Monkey patch
click.core._verify_python3_env = lambda: None
CONTEXT_SETT... | # -*- coding: utf-8 -*-
from __future__ import division, print_function
import logging
import sys
import click
from .. import __version__, get_logger
logging.basicConfig(stream=sys.stderr)
logger = get_logger()
logger.setLevel(logging.INFO)
# Monkey patch
click.core._verify_python3_env = lambda: None
CONTEXT_SETT... | Add postmortem debugging option to CLI | Add postmortem debugging option to CLI
| Python | bsd-3-clause | mirnylab/cooler | # -*- coding: utf-8 -*-
from __future__ import division, print_function
import logging
import sys
import click
from .. import __version__, get_logger
logging.basicConfig(stream=sys.stderr)
logger = get_logger()
logger.setLevel(logging.INFO)
# Monkey patch
click.core._verify_python3_env = lambda: None
CONTEXT_SETT... | # -*- coding: utf-8 -*-
from __future__ import division, print_function
import logging
import sys
import click
from .. import __version__, get_logger
logging.basicConfig(stream=sys.stderr)
logger = get_logger()
logger.setLevel(logging.INFO)
# Monkey patch
click.core._verify_python3_env = lambda: None
CONTEXT_SETT... | <commit_before># -*- coding: utf-8 -*-
from __future__ import division, print_function
import logging
import sys
import click
from .. import __version__, get_logger
logging.basicConfig(stream=sys.stderr)
logger = get_logger()
logger.setLevel(logging.INFO)
# Monkey patch
click.core._verify_python3_env = lambda: None... | # -*- coding: utf-8 -*-
from __future__ import division, print_function
import logging
import sys
import click
from .. import __version__, get_logger
logging.basicConfig(stream=sys.stderr)
logger = get_logger()
logger.setLevel(logging.INFO)
# Monkey patch
click.core._verify_python3_env = lambda: None
CONTEXT_SETT... | # -*- coding: utf-8 -*-
from __future__ import division, print_function
import logging
import sys
import click
from .. import __version__, get_logger
logging.basicConfig(stream=sys.stderr)
logger = get_logger()
logger.setLevel(logging.INFO)
# Monkey patch
click.core._verify_python3_env = lambda: None
CONTEXT_SETT... | <commit_before># -*- coding: utf-8 -*-
from __future__ import division, print_function
import logging
import sys
import click
from .. import __version__, get_logger
logging.basicConfig(stream=sys.stderr)
logger = get_logger()
logger.setLevel(logging.INFO)
# Monkey patch
click.core._verify_python3_env = lambda: None... |
723ae54f260284aad442f076772189cb5820d62e | devtools/ci/push-docs-to-s3.py | devtools/ci/push-docs-to-s3.py | import os
import pip
import tempfile
import subprocess
import opentis.version
BUCKET_NAME = 'openpathsampling.org'
if not opentis.version.release:
PREFIX = 'latest'
else:
PREFIX = opentis.version.short_version
PREFIX = ''
if not any(d.project_name == 's3cmd' for d in pip.get_installed_distributions()):
... | import os
import pip
import tempfile
import subprocess
import opentis.version
BUCKET_NAME = 'openpathsampling.org'
if not opentis.version.release:
PREFIX = 'latest'
else:
PREFIX = opentis.version.short_version
PREFIX = ''
if not any(d.project_name == 's3cmd' for d in pip.get_installed_distributions()):
... | Fix for PREFIX omission in S3 push | Fix for PREFIX omission in S3 push
| Python | mit | dwhswenson/openpathsampling,jhprinz/openpathsampling,choderalab/openpathsampling,openpathsampling/openpathsampling,choderalab/openpathsampling,dwhswenson/openpathsampling,jhprinz/openpathsampling,openpathsampling/openpathsampling,openpathsampling/openpathsampling,dwhswenson/openpathsampling,openpathsampling/openpathsam... | import os
import pip
import tempfile
import subprocess
import opentis.version
BUCKET_NAME = 'openpathsampling.org'
if not opentis.version.release:
PREFIX = 'latest'
else:
PREFIX = opentis.version.short_version
PREFIX = ''
if not any(d.project_name == 's3cmd' for d in pip.get_installed_distributions()):
... | import os
import pip
import tempfile
import subprocess
import opentis.version
BUCKET_NAME = 'openpathsampling.org'
if not opentis.version.release:
PREFIX = 'latest'
else:
PREFIX = opentis.version.short_version
PREFIX = ''
if not any(d.project_name == 's3cmd' for d in pip.get_installed_distributions()):
... | <commit_before>import os
import pip
import tempfile
import subprocess
import opentis.version
BUCKET_NAME = 'openpathsampling.org'
if not opentis.version.release:
PREFIX = 'latest'
else:
PREFIX = opentis.version.short_version
PREFIX = ''
if not any(d.project_name == 's3cmd' for d in pip.get_installed_distrib... | import os
import pip
import tempfile
import subprocess
import opentis.version
BUCKET_NAME = 'openpathsampling.org'
if not opentis.version.release:
PREFIX = 'latest'
else:
PREFIX = opentis.version.short_version
PREFIX = ''
if not any(d.project_name == 's3cmd' for d in pip.get_installed_distributions()):
... | import os
import pip
import tempfile
import subprocess
import opentis.version
BUCKET_NAME = 'openpathsampling.org'
if not opentis.version.release:
PREFIX = 'latest'
else:
PREFIX = opentis.version.short_version
PREFIX = ''
if not any(d.project_name == 's3cmd' for d in pip.get_installed_distributions()):
... | <commit_before>import os
import pip
import tempfile
import subprocess
import opentis.version
BUCKET_NAME = 'openpathsampling.org'
if not opentis.version.release:
PREFIX = 'latest'
else:
PREFIX = opentis.version.short_version
PREFIX = ''
if not any(d.project_name == 's3cmd' for d in pip.get_installed_distrib... |
eb391dde8a157252a98fc9bb9b617bc821f7285a | email_from_template/utils.py | email_from_template/utils.py | from django.utils.functional import memoize
from . import app_settings
def get_render_method():
return from_dotted_path(app_settings.EMAIL_RENDER_METHOD)
get_render_method = memoize(get_render_method, {}, 0)
def get_context_processors():
return [from_dotted_path(x) for x in app_settings.EMAIL_CONTEXT_PROCESS... | from django.utils.lru_cache import lru_cache
from . import app_settings
@lru_cache
def get_render_method():
return from_dotted_path(app_settings.EMAIL_RENDER_METHOD)
@lru_cache
def get_context_processors():
return [from_dotted_path(x) for x in app_settings.EMAIL_CONTEXT_PROCESSORS]
def from_dotted_path(full... | Use @lru_cache now that memoize is gone. | Use @lru_cache now that memoize is gone.
| Python | bsd-3-clause | lamby/django-email-from-template | from django.utils.functional import memoize
from . import app_settings
def get_render_method():
return from_dotted_path(app_settings.EMAIL_RENDER_METHOD)
get_render_method = memoize(get_render_method, {}, 0)
def get_context_processors():
return [from_dotted_path(x) for x in app_settings.EMAIL_CONTEXT_PROCESS... | from django.utils.lru_cache import lru_cache
from . import app_settings
@lru_cache
def get_render_method():
return from_dotted_path(app_settings.EMAIL_RENDER_METHOD)
@lru_cache
def get_context_processors():
return [from_dotted_path(x) for x in app_settings.EMAIL_CONTEXT_PROCESSORS]
def from_dotted_path(full... | <commit_before>from django.utils.functional import memoize
from . import app_settings
def get_render_method():
return from_dotted_path(app_settings.EMAIL_RENDER_METHOD)
get_render_method = memoize(get_render_method, {}, 0)
def get_context_processors():
return [from_dotted_path(x) for x in app_settings.EMAIL_... | from django.utils.lru_cache import lru_cache
from . import app_settings
@lru_cache
def get_render_method():
return from_dotted_path(app_settings.EMAIL_RENDER_METHOD)
@lru_cache
def get_context_processors():
return [from_dotted_path(x) for x in app_settings.EMAIL_CONTEXT_PROCESSORS]
def from_dotted_path(full... | from django.utils.functional import memoize
from . import app_settings
def get_render_method():
return from_dotted_path(app_settings.EMAIL_RENDER_METHOD)
get_render_method = memoize(get_render_method, {}, 0)
def get_context_processors():
return [from_dotted_path(x) for x in app_settings.EMAIL_CONTEXT_PROCESS... | <commit_before>from django.utils.functional import memoize
from . import app_settings
def get_render_method():
return from_dotted_path(app_settings.EMAIL_RENDER_METHOD)
get_render_method = memoize(get_render_method, {}, 0)
def get_context_processors():
return [from_dotted_path(x) for x in app_settings.EMAIL_... |
75af7171d0245b528018c8e0d0d581916a9dc67d | examples/profilealignment.py | examples/profilealignment.py | # Create sequences to be aligned.
from alignment.sequence import Sequence
a = Sequence("what a beautiful day".split())
b = Sequence("what a disappointingly bad day".split())
print "Sequence A:", a
print "Sequence B:", b
print
# Create a vocabulary and encode the sequences.
from alignment.vocabulary import Vocabulary
v... | from alignment.sequence import Sequence
from alignment.vocabulary import Vocabulary
from alignment.sequencealigner import SimpleScoring, GlobalSequenceAligner
from alignment.profile import Profile
from alignment.profilealigner import SoftScoring, GlobalProfileAligner
# Create sequences to be aligned.
a = Sequence('wh... | Update the profile alignment example. | Update the profile alignment example.
| Python | bsd-3-clause | eseraygun/python-entities,eseraygun/python-alignment | # Create sequences to be aligned.
from alignment.sequence import Sequence
a = Sequence("what a beautiful day".split())
b = Sequence("what a disappointingly bad day".split())
print "Sequence A:", a
print "Sequence B:", b
print
# Create a vocabulary and encode the sequences.
from alignment.vocabulary import Vocabulary
v... | from alignment.sequence import Sequence
from alignment.vocabulary import Vocabulary
from alignment.sequencealigner import SimpleScoring, GlobalSequenceAligner
from alignment.profile import Profile
from alignment.profilealigner import SoftScoring, GlobalProfileAligner
# Create sequences to be aligned.
a = Sequence('wh... | <commit_before># Create sequences to be aligned.
from alignment.sequence import Sequence
a = Sequence("what a beautiful day".split())
b = Sequence("what a disappointingly bad day".split())
print "Sequence A:", a
print "Sequence B:", b
print
# Create a vocabulary and encode the sequences.
from alignment.vocabulary impo... | from alignment.sequence import Sequence
from alignment.vocabulary import Vocabulary
from alignment.sequencealigner import SimpleScoring, GlobalSequenceAligner
from alignment.profile import Profile
from alignment.profilealigner import SoftScoring, GlobalProfileAligner
# Create sequences to be aligned.
a = Sequence('wh... | # Create sequences to be aligned.
from alignment.sequence import Sequence
a = Sequence("what a beautiful day".split())
b = Sequence("what a disappointingly bad day".split())
print "Sequence A:", a
print "Sequence B:", b
print
# Create a vocabulary and encode the sequences.
from alignment.vocabulary import Vocabulary
v... | <commit_before># Create sequences to be aligned.
from alignment.sequence import Sequence
a = Sequence("what a beautiful day".split())
b = Sequence("what a disappointingly bad day".split())
print "Sequence A:", a
print "Sequence B:", b
print
# Create a vocabulary and encode the sequences.
from alignment.vocabulary impo... |
4bef46ef98591d47d653eeb4f74bf00a8a1d5d69 | correios/utils.py | correios/utils.py | from itertools import chain
from typing import Sized, Iterable, Container, Set
class RangeSet(Sized, Iterable, Container):
def __init__(self, *ranges):
self.ranges = []
for r in ranges:
if isinstance(r, range):
r = [r]
elif isinstance(r, RangeSet):
... | from itertools import chain
from typing import Container, Iterable, Sized
class RangeSet(Sized, Iterable, Container):
def __init__(self, *ranges):
self.ranges = []
for r in ranges:
if isinstance(r, range):
self.ranges.append(r)
continue
try... | Use duck typing when creating a RangeSet | Use duck typing when creating a RangeSet
| Python | apache-2.0 | osantana/correios,solidarium/correios,olist/correios | from itertools import chain
from typing import Sized, Iterable, Container, Set
class RangeSet(Sized, Iterable, Container):
def __init__(self, *ranges):
self.ranges = []
for r in ranges:
if isinstance(r, range):
r = [r]
elif isinstance(r, RangeSet):
... | from itertools import chain
from typing import Container, Iterable, Sized
class RangeSet(Sized, Iterable, Container):
def __init__(self, *ranges):
self.ranges = []
for r in ranges:
if isinstance(r, range):
self.ranges.append(r)
continue
try... | <commit_before>from itertools import chain
from typing import Sized, Iterable, Container, Set
class RangeSet(Sized, Iterable, Container):
def __init__(self, *ranges):
self.ranges = []
for r in ranges:
if isinstance(r, range):
r = [r]
elif isinstance(r, Rang... | from itertools import chain
from typing import Container, Iterable, Sized
class RangeSet(Sized, Iterable, Container):
def __init__(self, *ranges):
self.ranges = []
for r in ranges:
if isinstance(r, range):
self.ranges.append(r)
continue
try... | from itertools import chain
from typing import Sized, Iterable, Container, Set
class RangeSet(Sized, Iterable, Container):
def __init__(self, *ranges):
self.ranges = []
for r in ranges:
if isinstance(r, range):
r = [r]
elif isinstance(r, RangeSet):
... | <commit_before>from itertools import chain
from typing import Sized, Iterable, Container, Set
class RangeSet(Sized, Iterable, Container):
def __init__(self, *ranges):
self.ranges = []
for r in ranges:
if isinstance(r, range):
r = [r]
elif isinstance(r, Rang... |
55a4680bb07896f0bab06d836ade056d115f004f | dsub/_dsub_version.py | dsub/_dsub_version.py | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | Update version number to 0.1.10.dev0. | Update version number to 0.1.10.dev0.
PiperOrigin-RevId: 202663603
| Python | apache-2.0 | DataBiosphere/dsub,DataBiosphere/dsub | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | <commit_before># Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | <commit_before># Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... |
3fbbdec51cfd93217705adcae37b1bf22d5661fa | backend/playlist/serializers.py | backend/playlist/serializers.py | from rest_framework import serializers
from .models import Cd, Cdtrack, Show, Playlist, PlaylistEntry
class TrackSerializer(serializers.ModelSerializer):
album = serializers.StringRelatedField(
read_only=True
)
class Meta:
model = Cdtrack
fields = ('trackid', 'url', 'tracknum', 't... | from rest_framework import serializers
from .models import Cd, Cdtrack, Show, Playlist, PlaylistEntry
class TrackSerializer(serializers.ModelSerializer):
album = serializers.StringRelatedField(
read_only=True
)
class Meta:
model = Cdtrack
fields = ('trackid', 'url', 'tracknum', 't... | Add showname to playlist API view. | Add showname to playlist API view.
* Even though it's obsolete now, we need it for old shows.
| Python | mit | ThreeDRadio/playlists,ThreeDRadio/playlists,ThreeDRadio/playlists | from rest_framework import serializers
from .models import Cd, Cdtrack, Show, Playlist, PlaylistEntry
class TrackSerializer(serializers.ModelSerializer):
album = serializers.StringRelatedField(
read_only=True
)
class Meta:
model = Cdtrack
fields = ('trackid', 'url', 'tracknum', 't... | from rest_framework import serializers
from .models import Cd, Cdtrack, Show, Playlist, PlaylistEntry
class TrackSerializer(serializers.ModelSerializer):
album = serializers.StringRelatedField(
read_only=True
)
class Meta:
model = Cdtrack
fields = ('trackid', 'url', 'tracknum', 't... | <commit_before>from rest_framework import serializers
from .models import Cd, Cdtrack, Show, Playlist, PlaylistEntry
class TrackSerializer(serializers.ModelSerializer):
album = serializers.StringRelatedField(
read_only=True
)
class Meta:
model = Cdtrack
fields = ('trackid', 'url',... | from rest_framework import serializers
from .models import Cd, Cdtrack, Show, Playlist, PlaylistEntry
class TrackSerializer(serializers.ModelSerializer):
album = serializers.StringRelatedField(
read_only=True
)
class Meta:
model = Cdtrack
fields = ('trackid', 'url', 'tracknum', 't... | from rest_framework import serializers
from .models import Cd, Cdtrack, Show, Playlist, PlaylistEntry
class TrackSerializer(serializers.ModelSerializer):
album = serializers.StringRelatedField(
read_only=True
)
class Meta:
model = Cdtrack
fields = ('trackid', 'url', 'tracknum', 't... | <commit_before>from rest_framework import serializers
from .models import Cd, Cdtrack, Show, Playlist, PlaylistEntry
class TrackSerializer(serializers.ModelSerializer):
album = serializers.StringRelatedField(
read_only=True
)
class Meta:
model = Cdtrack
fields = ('trackid', 'url',... |
56aa0448fb3cd1df1a0fd43abc9a0e37e8ddf55b | trans_sync/management/commands/save_trans.py | trans_sync/management/commands/save_trans.py | # coding: utf-8
from __future__ import unicode_literals
from optparse import make_option
from django.core.management.base import NoArgsCommand
class Command(NoArgsCommand):
option_list = NoArgsCommand.option_list + (
make_option(
'--dry-run',
action='store_true',
dest... | # coding: utf-8
from __future__ import unicode_literals
import os
from os.path import join, isdir
from optparse import make_option
from django.core.management.base import NoArgsCommand
from django.conf import settings
from modeltranslation.translator import translator
from babel.messages.catalog import Catalog
from ba... | Save trans to .po files | Save trans to .po files
| Python | mit | djentlemen/django-modeltranslation-sync | # coding: utf-8
from __future__ import unicode_literals
from optparse import make_option
from django.core.management.base import NoArgsCommand
class Command(NoArgsCommand):
option_list = NoArgsCommand.option_list + (
make_option(
'--dry-run',
action='store_true',
dest... | # coding: utf-8
from __future__ import unicode_literals
import os
from os.path import join, isdir
from optparse import make_option
from django.core.management.base import NoArgsCommand
from django.conf import settings
from modeltranslation.translator import translator
from babel.messages.catalog import Catalog
from ba... | <commit_before># coding: utf-8
from __future__ import unicode_literals
from optparse import make_option
from django.core.management.base import NoArgsCommand
class Command(NoArgsCommand):
option_list = NoArgsCommand.option_list + (
make_option(
'--dry-run',
action='store_true',
... | # coding: utf-8
from __future__ import unicode_literals
import os
from os.path import join, isdir
from optparse import make_option
from django.core.management.base import NoArgsCommand
from django.conf import settings
from modeltranslation.translator import translator
from babel.messages.catalog import Catalog
from ba... | # coding: utf-8
from __future__ import unicode_literals
from optparse import make_option
from django.core.management.base import NoArgsCommand
class Command(NoArgsCommand):
option_list = NoArgsCommand.option_list + (
make_option(
'--dry-run',
action='store_true',
dest... | <commit_before># coding: utf-8
from __future__ import unicode_literals
from optparse import make_option
from django.core.management.base import NoArgsCommand
class Command(NoArgsCommand):
option_list = NoArgsCommand.option_list + (
make_option(
'--dry-run',
action='store_true',
... |
e2495040277fafdac4c0e060517cf667baa27c02 | chinup/__init__.py | chinup/__init__.py | try:
from .allauth import *
except ImportError:
from .chinup import *
from .exceptions import *
__version__ = '0.1'
| from __future__ import absolute_import, unicode_literals
try:
from .allauth import *
except ImportError:
from .chinup import *
from .exceptions import *
__version__ = '0.1'
# Configure logging to avoid warning.
# https://docs.python.org/2/howto/logging.html#configuring-logging-for-a-library
import logging... | Configure package-level logging to avoid warning. | Configure package-level logging to avoid warning.
| Python | mit | pagepart/chinup | try:
from .allauth import *
except ImportError:
from .chinup import *
from .exceptions import *
__version__ = '0.1'
Configure package-level logging to avoid warning. | from __future__ import absolute_import, unicode_literals
try:
from .allauth import *
except ImportError:
from .chinup import *
from .exceptions import *
__version__ = '0.1'
# Configure logging to avoid warning.
# https://docs.python.org/2/howto/logging.html#configuring-logging-for-a-library
import logging... | <commit_before>try:
from .allauth import *
except ImportError:
from .chinup import *
from .exceptions import *
__version__ = '0.1'
<commit_msg>Configure package-level logging to avoid warning.<commit_after> | from __future__ import absolute_import, unicode_literals
try:
from .allauth import *
except ImportError:
from .chinup import *
from .exceptions import *
__version__ = '0.1'
# Configure logging to avoid warning.
# https://docs.python.org/2/howto/logging.html#configuring-logging-for-a-library
import logging... | try:
from .allauth import *
except ImportError:
from .chinup import *
from .exceptions import *
__version__ = '0.1'
Configure package-level logging to avoid warning.from __future__ import absolute_import, unicode_literals
try:
from .allauth import *
except ImportError:
from .chinup import *
from .e... | <commit_before>try:
from .allauth import *
except ImportError:
from .chinup import *
from .exceptions import *
__version__ = '0.1'
<commit_msg>Configure package-level logging to avoid warning.<commit_after>from __future__ import absolute_import, unicode_literals
try:
from .allauth import *
except Import... |
fc36b9bc2970c611a4fb5063463f27cfd96df21d | moksha/hub/messaging.py | moksha/hub/messaging.py | # This file is part of Moksha.
# Copyright (C) 2008-2010 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | # This file is part of Moksha.
# Copyright (C) 2008-2010 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | Update our MessagingHub.subscribe method arguments | Update our MessagingHub.subscribe method arguments
| Python | apache-2.0 | ralphbean/moksha,pombredanne/moksha,mokshaproject/moksha,lmacken/moksha,mokshaproject/moksha,lmacken/moksha,ralphbean/moksha,pombredanne/moksha,pombredanne/moksha,mokshaproject/moksha,mokshaproject/moksha,ralphbean/moksha,pombredanne/moksha,lmacken/moksha | # This file is part of Moksha.
# Copyright (C) 2008-2010 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | # This file is part of Moksha.
# Copyright (C) 2008-2010 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | <commit_before># This file is part of Moksha.
# Copyright (C) 2008-2010 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... | # This file is part of Moksha.
# Copyright (C) 2008-2010 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | # This file is part of Moksha.
# Copyright (C) 2008-2010 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | <commit_before># This file is part of Moksha.
# Copyright (C) 2008-2010 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... |
a7fcc89755e01bf3dbe7090e2bf7f1211ce9af84 | test/test_property.py | test/test_property.py | import unittest
from odml import Property, Section, Document
class TestProperty(unittest.TestCase):
def setUp(self):
pass
def test_value(self):
p = Property("property", 100)
assert(p.value[0] == 100)
def test_name(self):
pass
def test_parent(self):
pass
... | import unittest
from odml import Property, Section, Document
from odml.doc import BaseDocument
from odml.section import BaseSection
class TestProperty(unittest.TestCase):
def setUp(self):
pass
def test_value(self):
p = Property("property", 100)
self.assertEqual(p.value[0], 100)
... | Add tests to cover update parent functionality. | Add tests to cover update parent functionality.
| Python | bsd-3-clause | lzehl/python-odml | import unittest
from odml import Property, Section, Document
class TestProperty(unittest.TestCase):
def setUp(self):
pass
def test_value(self):
p = Property("property", 100)
assert(p.value[0] == 100)
def test_name(self):
pass
def test_parent(self):
pass
... | import unittest
from odml import Property, Section, Document
from odml.doc import BaseDocument
from odml.section import BaseSection
class TestProperty(unittest.TestCase):
def setUp(self):
pass
def test_value(self):
p = Property("property", 100)
self.assertEqual(p.value[0], 100)
... | <commit_before>import unittest
from odml import Property, Section, Document
class TestProperty(unittest.TestCase):
def setUp(self):
pass
def test_value(self):
p = Property("property", 100)
assert(p.value[0] == 100)
def test_name(self):
pass
def test_parent(self):
... | import unittest
from odml import Property, Section, Document
from odml.doc import BaseDocument
from odml.section import BaseSection
class TestProperty(unittest.TestCase):
def setUp(self):
pass
def test_value(self):
p = Property("property", 100)
self.assertEqual(p.value[0], 100)
... | import unittest
from odml import Property, Section, Document
class TestProperty(unittest.TestCase):
def setUp(self):
pass
def test_value(self):
p = Property("property", 100)
assert(p.value[0] == 100)
def test_name(self):
pass
def test_parent(self):
pass
... | <commit_before>import unittest
from odml import Property, Section, Document
class TestProperty(unittest.TestCase):
def setUp(self):
pass
def test_value(self):
p = Property("property", 100)
assert(p.value[0] == 100)
def test_name(self):
pass
def test_parent(self):
... |
bee93012144e033b02c05a1e586620dfa7f4c883 | words/models.py | words/models.py | from django.db import models
class Word(models.Model):
word = models.CharField(max_length=255)
date_retired = models.DateTimeField(null=True, blank=True)
date_active = models.DateTimeField(null=True, blank=True)
views = models.IntegerField(default=0)
@property
def is_active(self):
if ... | from django.db import models
class Word(models.Model):
word = models.CharField(max_length=255)
date_retired = models.DateTimeField(null=True, blank=True)
date_active = models.DateTimeField(null=True, blank=True)
views = models.IntegerField(default=0)
@property
def is_active(self):
if ... | Make the word display nice | Make the word display nice
| Python | bsd-2-clause | kylegibson/how_to_teach_your_baby_tracker | from django.db import models
class Word(models.Model):
word = models.CharField(max_length=255)
date_retired = models.DateTimeField(null=True, blank=True)
date_active = models.DateTimeField(null=True, blank=True)
views = models.IntegerField(default=0)
@property
def is_active(self):
if ... | from django.db import models
class Word(models.Model):
word = models.CharField(max_length=255)
date_retired = models.DateTimeField(null=True, blank=True)
date_active = models.DateTimeField(null=True, blank=True)
views = models.IntegerField(default=0)
@property
def is_active(self):
if ... | <commit_before>from django.db import models
class Word(models.Model):
word = models.CharField(max_length=255)
date_retired = models.DateTimeField(null=True, blank=True)
date_active = models.DateTimeField(null=True, blank=True)
views = models.IntegerField(default=0)
@property
def is_active(sel... | from django.db import models
class Word(models.Model):
word = models.CharField(max_length=255)
date_retired = models.DateTimeField(null=True, blank=True)
date_active = models.DateTimeField(null=True, blank=True)
views = models.IntegerField(default=0)
@property
def is_active(self):
if ... | from django.db import models
class Word(models.Model):
word = models.CharField(max_length=255)
date_retired = models.DateTimeField(null=True, blank=True)
date_active = models.DateTimeField(null=True, blank=True)
views = models.IntegerField(default=0)
@property
def is_active(self):
if ... | <commit_before>from django.db import models
class Word(models.Model):
word = models.CharField(max_length=255)
date_retired = models.DateTimeField(null=True, blank=True)
date_active = models.DateTimeField(null=True, blank=True)
views = models.IntegerField(default=0)
@property
def is_active(sel... |
6765cefc1a5a928b3cff16c0f1014096f82c3d3b | test/test_services.py | test/test_services.py | import pytest
@pytest.mark.parametrize("name, enabled, running", [
("cron", "enabled", "running"),
("docker", "enabled", "running"),
("firewalld", "enabled", "running"),
("haveged", "enabled", "running"),
("ssh", "enabled", "running"),
])
def test_services(Service, name, enabled, running):
is_enabled = Se... | import pytest
@pytest.mark.parametrize("name, enabled, running", [
("cron", "enabled", "running"),
("docker", "enabled", "running"),
("firewalld", "enabled", "running"),
("haveged", "enabled", "running"),
("ssh", "enabled", "running"),
])
def test_services(host, name, enabled, running):
svc = host.servic... | Change test function as existing method deprecated | Change test function as existing method deprecated
| Python | mit | wicksy/laptop-build,wicksy/laptop-build,wicksy/laptop-build,wicksy/laptop-build | import pytest
@pytest.mark.parametrize("name, enabled, running", [
("cron", "enabled", "running"),
("docker", "enabled", "running"),
("firewalld", "enabled", "running"),
("haveged", "enabled", "running"),
("ssh", "enabled", "running"),
])
def test_services(Service, name, enabled, running):
is_enabled = Se... | import pytest
@pytest.mark.parametrize("name, enabled, running", [
("cron", "enabled", "running"),
("docker", "enabled", "running"),
("firewalld", "enabled", "running"),
("haveged", "enabled", "running"),
("ssh", "enabled", "running"),
])
def test_services(host, name, enabled, running):
svc = host.servic... | <commit_before>import pytest
@pytest.mark.parametrize("name, enabled, running", [
("cron", "enabled", "running"),
("docker", "enabled", "running"),
("firewalld", "enabled", "running"),
("haveged", "enabled", "running"),
("ssh", "enabled", "running"),
])
def test_services(Service, name, enabled, running):
... | import pytest
@pytest.mark.parametrize("name, enabled, running", [
("cron", "enabled", "running"),
("docker", "enabled", "running"),
("firewalld", "enabled", "running"),
("haveged", "enabled", "running"),
("ssh", "enabled", "running"),
])
def test_services(host, name, enabled, running):
svc = host.servic... | import pytest
@pytest.mark.parametrize("name, enabled, running", [
("cron", "enabled", "running"),
("docker", "enabled", "running"),
("firewalld", "enabled", "running"),
("haveged", "enabled", "running"),
("ssh", "enabled", "running"),
])
def test_services(Service, name, enabled, running):
is_enabled = Se... | <commit_before>import pytest
@pytest.mark.parametrize("name, enabled, running", [
("cron", "enabled", "running"),
("docker", "enabled", "running"),
("firewalld", "enabled", "running"),
("haveged", "enabled", "running"),
("ssh", "enabled", "running"),
])
def test_services(Service, name, enabled, running):
... |
eea647cf05d7143d800f834dd77aeafc32522100 | groundstation/settings.py | groundstation/settings.py | PORT=1248
BEACON_TIMEOUT=5
DEFAULT_BUFSIZE=8192
| PORT=1248
BEACON_TIMEOUT=5
DEFAULT_BUFSIZE=8192
DEFAULT_CACHE_LIFETIME=900
| Add config key for default cache lifetime | Add config key for default cache lifetime
| Python | mit | richo/groundstation,richo/groundstation,richo/groundstation,richo/groundstation,richo/groundstation | PORT=1248
BEACON_TIMEOUT=5
DEFAULT_BUFSIZE=8192
Add config key for default cache lifetime | PORT=1248
BEACON_TIMEOUT=5
DEFAULT_BUFSIZE=8192
DEFAULT_CACHE_LIFETIME=900
| <commit_before>PORT=1248
BEACON_TIMEOUT=5
DEFAULT_BUFSIZE=8192
<commit_msg>Add config key for default cache lifetime<commit_after> | PORT=1248
BEACON_TIMEOUT=5
DEFAULT_BUFSIZE=8192
DEFAULT_CACHE_LIFETIME=900
| PORT=1248
BEACON_TIMEOUT=5
DEFAULT_BUFSIZE=8192
Add config key for default cache lifetimePORT=1248
BEACON_TIMEOUT=5
DEFAULT_BUFSIZE=8192
DEFAULT_CACHE_LIFETIME=900
| <commit_before>PORT=1248
BEACON_TIMEOUT=5
DEFAULT_BUFSIZE=8192
<commit_msg>Add config key for default cache lifetime<commit_after>PORT=1248
BEACON_TIMEOUT=5
DEFAULT_BUFSIZE=8192
DEFAULT_CACHE_LIFETIME=900
|
81f3e4f10243cb31b600666a19112acee7c13f55 | signac/db/__init__.py | signac/db/__init__.py | import warnings
try:
import pymongo # noqa
except ImportError:
warnings.warn("Failed to import pymongo. "
"get_database will not be available.", ImportWarning)
def get_database(*args, **kwargs):
"""Get a database handle.
This function is only available if pymongo is inst... | import logging
import warnings
try:
import pymongo # noqa
except ImportError:
warnings.warn("Failed to import pymongo. "
"get_database will not be available.", ImportWarning)
def get_database(*args, **kwargs):
"""Get a database handle.
This function is only available if ... | Add warning about outdated pymongo versions. | Add warning about outdated pymongo versions.
signac currently only supports pymongo versions 3.x.
| Python | bsd-3-clause | csadorf/signac,csadorf/signac | import warnings
try:
import pymongo # noqa
except ImportError:
warnings.warn("Failed to import pymongo. "
"get_database will not be available.", ImportWarning)
def get_database(*args, **kwargs):
"""Get a database handle.
This function is only available if pymongo is inst... | import logging
import warnings
try:
import pymongo # noqa
except ImportError:
warnings.warn("Failed to import pymongo. "
"get_database will not be available.", ImportWarning)
def get_database(*args, **kwargs):
"""Get a database handle.
This function is only available if ... | <commit_before>import warnings
try:
import pymongo # noqa
except ImportError:
warnings.warn("Failed to import pymongo. "
"get_database will not be available.", ImportWarning)
def get_database(*args, **kwargs):
"""Get a database handle.
This function is only available if ... | import logging
import warnings
try:
import pymongo # noqa
except ImportError:
warnings.warn("Failed to import pymongo. "
"get_database will not be available.", ImportWarning)
def get_database(*args, **kwargs):
"""Get a database handle.
This function is only available if ... | import warnings
try:
import pymongo # noqa
except ImportError:
warnings.warn("Failed to import pymongo. "
"get_database will not be available.", ImportWarning)
def get_database(*args, **kwargs):
"""Get a database handle.
This function is only available if pymongo is inst... | <commit_before>import warnings
try:
import pymongo # noqa
except ImportError:
warnings.warn("Failed to import pymongo. "
"get_database will not be available.", ImportWarning)
def get_database(*args, **kwargs):
"""Get a database handle.
This function is only available if ... |
ee4f8264d942d7af5f5b71ff6cd162f3ae1fe515 | django_hash_filter/templatetags/hash_filter.py | django_hash_filter/templatetags/hash_filter.py | from django import template
from django.template.defaultfilters import stringfilter
from django.template.base import TemplateSyntaxError
import hashlib
from django_hash_filter.templatetags import get_available_hashes
register = template.Library()
@register.filter
@stringfilter
def hash(value, arg):
"""
Return... | import hashlib
import sys
from django import template
from django.template.defaultfilters import stringfilter
from django.template.base import TemplateSyntaxError
from django_hash_filter.templatetags import get_available_hashes
register = template.Library()
@register.filter
@stringfilter
def hash(value, arg):
""... | Convert unicode string to byte array on Python 3 | Convert unicode string to byte array on Python 3
| Python | mit | andrewjsledge/django-hash-filter | from django import template
from django.template.defaultfilters import stringfilter
from django.template.base import TemplateSyntaxError
import hashlib
from django_hash_filter.templatetags import get_available_hashes
register = template.Library()
@register.filter
@stringfilter
def hash(value, arg):
"""
Return... | import hashlib
import sys
from django import template
from django.template.defaultfilters import stringfilter
from django.template.base import TemplateSyntaxError
from django_hash_filter.templatetags import get_available_hashes
register = template.Library()
@register.filter
@stringfilter
def hash(value, arg):
""... | <commit_before>from django import template
from django.template.defaultfilters import stringfilter
from django.template.base import TemplateSyntaxError
import hashlib
from django_hash_filter.templatetags import get_available_hashes
register = template.Library()
@register.filter
@stringfilter
def hash(value, arg):
... | import hashlib
import sys
from django import template
from django.template.defaultfilters import stringfilter
from django.template.base import TemplateSyntaxError
from django_hash_filter.templatetags import get_available_hashes
register = template.Library()
@register.filter
@stringfilter
def hash(value, arg):
""... | from django import template
from django.template.defaultfilters import stringfilter
from django.template.base import TemplateSyntaxError
import hashlib
from django_hash_filter.templatetags import get_available_hashes
register = template.Library()
@register.filter
@stringfilter
def hash(value, arg):
"""
Return... | <commit_before>from django import template
from django.template.defaultfilters import stringfilter
from django.template.base import TemplateSyntaxError
import hashlib
from django_hash_filter.templatetags import get_available_hashes
register = template.Library()
@register.filter
@stringfilter
def hash(value, arg):
... |
df216bdc25ef29da821f577a517ccdca61448cf4 | django_lightweight_queue/middleware/logging.py | django_lightweight_queue/middleware/logging.py | from __future__ import absolute_import
import logging
import traceback
log = logging.getLogger(__name__)
class LoggingMiddleware(object):
def process_job(self, job):
log.info("Running job %s", job)
def process_result(self, job, result, duration):
log.info("Finished job %s => %r (Time taken: ... | from __future__ import absolute_import
import logging
import traceback
log = logging.getLogger(__name__)
class LoggingMiddleware(object):
def process_job(self, job):
log.info("Running job %s", job)
def process_result(self, job, result, duration):
log.info("Finished job => %r (Time taken: %.2... | Save over 50% of logfile 'bloat' by not repeating all args on success/failure | Save over 50% of logfile 'bloat' by not repeating all args on success/failure
The data will be right above it just before we run the job.
| Python | bsd-3-clause | prophile/django-lightweight-queue,prophile/django-lightweight-queue,thread/django-lightweight-queue,lamby/django-lightweight-queue,thread/django-lightweight-queue | from __future__ import absolute_import
import logging
import traceback
log = logging.getLogger(__name__)
class LoggingMiddleware(object):
def process_job(self, job):
log.info("Running job %s", job)
def process_result(self, job, result, duration):
log.info("Finished job %s => %r (Time taken: ... | from __future__ import absolute_import
import logging
import traceback
log = logging.getLogger(__name__)
class LoggingMiddleware(object):
def process_job(self, job):
log.info("Running job %s", job)
def process_result(self, job, result, duration):
log.info("Finished job => %r (Time taken: %.2... | <commit_before>from __future__ import absolute_import
import logging
import traceback
log = logging.getLogger(__name__)
class LoggingMiddleware(object):
def process_job(self, job):
log.info("Running job %s", job)
def process_result(self, job, result, duration):
log.info("Finished job %s => %... | from __future__ import absolute_import
import logging
import traceback
log = logging.getLogger(__name__)
class LoggingMiddleware(object):
def process_job(self, job):
log.info("Running job %s", job)
def process_result(self, job, result, duration):
log.info("Finished job => %r (Time taken: %.2... | from __future__ import absolute_import
import logging
import traceback
log = logging.getLogger(__name__)
class LoggingMiddleware(object):
def process_job(self, job):
log.info("Running job %s", job)
def process_result(self, job, result, duration):
log.info("Finished job %s => %r (Time taken: ... | <commit_before>from __future__ import absolute_import
import logging
import traceback
log = logging.getLogger(__name__)
class LoggingMiddleware(object):
def process_job(self, job):
log.info("Running job %s", job)
def process_result(self, job, result, duration):
log.info("Finished job %s => %... |
802b9c2df754b3acf78e9e1facc1802a901e97a2 | furry/furry.py | furry/furry.py | import discord
from discord.ext import commands
class Furry:
"""A cog that adds weird furry commands or something"""
def __init__(self, bot):
self.bot = bot
@commands.command()
async def owo(self):
"""OwO what's this?"""
await self.bot.say("*Notices " + user.... | import discord
from discord.ext import commands
class Furry:
"""A cog that adds weird furry commands or something"""
def __init__(self, bot):
self.bot = bot
@commands.command()
async def owo(self, user : discord.Member):
"""OwO what's this?"""
await self.bot.... | Fix the command and make it actually work | Fix the command and make it actually work
Pass discord.Member as user
| Python | apache-2.0 | KazroFox/Kaz-Cogs | import discord
from discord.ext import commands
class Furry:
"""A cog that adds weird furry commands or something"""
def __init__(self, bot):
self.bot = bot
@commands.command()
async def owo(self):
"""OwO what's this?"""
await self.bot.say("*Notices " + user.... | import discord
from discord.ext import commands
class Furry:
"""A cog that adds weird furry commands or something"""
def __init__(self, bot):
self.bot = bot
@commands.command()
async def owo(self, user : discord.Member):
"""OwO what's this?"""
await self.bot.... | <commit_before>import discord
from discord.ext import commands
class Furry:
"""A cog that adds weird furry commands or something"""
def __init__(self, bot):
self.bot = bot
@commands.command()
async def owo(self):
"""OwO what's this?"""
await self.bot.say("*No... | import discord
from discord.ext import commands
class Furry:
"""A cog that adds weird furry commands or something"""
def __init__(self, bot):
self.bot = bot
@commands.command()
async def owo(self, user : discord.Member):
"""OwO what's this?"""
await self.bot.... | import discord
from discord.ext import commands
class Furry:
"""A cog that adds weird furry commands or something"""
def __init__(self, bot):
self.bot = bot
@commands.command()
async def owo(self):
"""OwO what's this?"""
await self.bot.say("*Notices " + user.... | <commit_before>import discord
from discord.ext import commands
class Furry:
"""A cog that adds weird furry commands or something"""
def __init__(self, bot):
self.bot = bot
@commands.command()
async def owo(self):
"""OwO what's this?"""
await self.bot.say("*No... |
6a508d01fa3fa0d4084406fcb2b5e41d1b614b7c | datalogger/__main__.py | datalogger/__main__.py | import sys
from PyQt5.QtWidgets import QApplication
from datalogger.api.workspace import Workspace
from datalogger.analysis_window import AnalysisWindow
from datalogger import __version__
def run_datalogger_full():
print("CUED DataLogger {}".format(__version__))
app = 0
app = QApplication(sys.argv)
... | import sys
from PyQt5.QtWidgets import QApplication
from datalogger.api.workspace import Workspace
from datalogger.analysis_window import AnalysisWindow
from datalogger import __version__
def run_datalogger_full():
print("CUED DataLogger {}".format(__version__))
app = 0
app = QApplication(sys.argv)
... | Move workspace before window creation so config set for window | Move workspace before window creation so config set for window
| Python | bsd-3-clause | torebutlin/cued_datalogger | import sys
from PyQt5.QtWidgets import QApplication
from datalogger.api.workspace import Workspace
from datalogger.analysis_window import AnalysisWindow
from datalogger import __version__
def run_datalogger_full():
print("CUED DataLogger {}".format(__version__))
app = 0
app = QApplication(sys.argv)
... | import sys
from PyQt5.QtWidgets import QApplication
from datalogger.api.workspace import Workspace
from datalogger.analysis_window import AnalysisWindow
from datalogger import __version__
def run_datalogger_full():
print("CUED DataLogger {}".format(__version__))
app = 0
app = QApplication(sys.argv)
... | <commit_before>import sys
from PyQt5.QtWidgets import QApplication
from datalogger.api.workspace import Workspace
from datalogger.analysis_window import AnalysisWindow
from datalogger import __version__
def run_datalogger_full():
print("CUED DataLogger {}".format(__version__))
app = 0
app = QApplication(... | import sys
from PyQt5.QtWidgets import QApplication
from datalogger.api.workspace import Workspace
from datalogger.analysis_window import AnalysisWindow
from datalogger import __version__
def run_datalogger_full():
print("CUED DataLogger {}".format(__version__))
app = 0
app = QApplication(sys.argv)
... | import sys
from PyQt5.QtWidgets import QApplication
from datalogger.api.workspace import Workspace
from datalogger.analysis_window import AnalysisWindow
from datalogger import __version__
def run_datalogger_full():
print("CUED DataLogger {}".format(__version__))
app = 0
app = QApplication(sys.argv)
... | <commit_before>import sys
from PyQt5.QtWidgets import QApplication
from datalogger.api.workspace import Workspace
from datalogger.analysis_window import AnalysisWindow
from datalogger import __version__
def run_datalogger_full():
print("CUED DataLogger {}".format(__version__))
app = 0
app = QApplication(... |
15f0a2e67fe942760707694370cc652f17e1c6b3 | demo/tests/conftest.py | demo/tests/conftest.py | """Unit tests configuration file."""
def pytest_configure(config):
"""Disable verbose output when running tests."""
terminal = config.pluginmanager.getplugin('terminal')
base = terminal.TerminalReporter
class QuietReporter(base):
"""A py.test reporting that only shows dots when running tests.... | """Unit tests configuration file."""
import logging
def pytest_configure(config):
"""Disable verbose output when running tests."""
logging.basicConfig(level=logging.DEBUG)
terminal = config.pluginmanager.getplugin('terminal')
base = terminal.TerminalReporter
class QuietReporter(base):
"... | Deploy Travis CI build 834 to GitHub | Deploy Travis CI build 834 to GitHub
| Python | mit | jacebrowning/template-python-demo | """Unit tests configuration file."""
def pytest_configure(config):
"""Disable verbose output when running tests."""
terminal = config.pluginmanager.getplugin('terminal')
base = terminal.TerminalReporter
class QuietReporter(base):
"""A py.test reporting that only shows dots when running tests.... | """Unit tests configuration file."""
import logging
def pytest_configure(config):
"""Disable verbose output when running tests."""
logging.basicConfig(level=logging.DEBUG)
terminal = config.pluginmanager.getplugin('terminal')
base = terminal.TerminalReporter
class QuietReporter(base):
"... | <commit_before>"""Unit tests configuration file."""
def pytest_configure(config):
"""Disable verbose output when running tests."""
terminal = config.pluginmanager.getplugin('terminal')
base = terminal.TerminalReporter
class QuietReporter(base):
"""A py.test reporting that only shows dots when... | """Unit tests configuration file."""
import logging
def pytest_configure(config):
"""Disable verbose output when running tests."""
logging.basicConfig(level=logging.DEBUG)
terminal = config.pluginmanager.getplugin('terminal')
base = terminal.TerminalReporter
class QuietReporter(base):
"... | """Unit tests configuration file."""
def pytest_configure(config):
"""Disable verbose output when running tests."""
terminal = config.pluginmanager.getplugin('terminal')
base = terminal.TerminalReporter
class QuietReporter(base):
"""A py.test reporting that only shows dots when running tests.... | <commit_before>"""Unit tests configuration file."""
def pytest_configure(config):
"""Disable verbose output when running tests."""
terminal = config.pluginmanager.getplugin('terminal')
base = terminal.TerminalReporter
class QuietReporter(base):
"""A py.test reporting that only shows dots when... |
70808a2243ebf04aa86d5b4539950b22cd96cc7d | maras/utils/__init__.py | maras/utils/__init__.py | '''
Misc utilities
'''
# Import python libs
import os
import binascii
def rand_hex_str(size):
'''
Return a random string of the passed size using hex encoding
'''
return binascii.hexlify(os.urandom(size/2))
def rand_raw_str(size):
'''
Return a raw byte string of the given size
'''
r... | '''
Misc utilities
'''
# Import python libs
import os
import time
import struct
import binascii
import datetime
# create a standard epoch so all platforms will count revs from
# a standard epoch of jan 1 2014
STD_EPOCH = time.mktime(datetime.datetime(2014, 1, 1).timetuple())
def rand_hex_str(size):
'''
Retu... | Add rev generation via normalized timestamps | Add rev generation via normalized timestamps
| Python | apache-2.0 | thatch45/maras | '''
Misc utilities
'''
# Import python libs
import os
import binascii
def rand_hex_str(size):
'''
Return a random string of the passed size using hex encoding
'''
return binascii.hexlify(os.urandom(size/2))
def rand_raw_str(size):
'''
Return a raw byte string of the given size
'''
r... | '''
Misc utilities
'''
# Import python libs
import os
import time
import struct
import binascii
import datetime
# create a standard epoch so all platforms will count revs from
# a standard epoch of jan 1 2014
STD_EPOCH = time.mktime(datetime.datetime(2014, 1, 1).timetuple())
def rand_hex_str(size):
'''
Retu... | <commit_before>'''
Misc utilities
'''
# Import python libs
import os
import binascii
def rand_hex_str(size):
'''
Return a random string of the passed size using hex encoding
'''
return binascii.hexlify(os.urandom(size/2))
def rand_raw_str(size):
'''
Return a raw byte string of the given siz... | '''
Misc utilities
'''
# Import python libs
import os
import time
import struct
import binascii
import datetime
# create a standard epoch so all platforms will count revs from
# a standard epoch of jan 1 2014
STD_EPOCH = time.mktime(datetime.datetime(2014, 1, 1).timetuple())
def rand_hex_str(size):
'''
Retu... | '''
Misc utilities
'''
# Import python libs
import os
import binascii
def rand_hex_str(size):
'''
Return a random string of the passed size using hex encoding
'''
return binascii.hexlify(os.urandom(size/2))
def rand_raw_str(size):
'''
Return a raw byte string of the given size
'''
r... | <commit_before>'''
Misc utilities
'''
# Import python libs
import os
import binascii
def rand_hex_str(size):
'''
Return a random string of the passed size using hex encoding
'''
return binascii.hexlify(os.urandom(size/2))
def rand_raw_str(size):
'''
Return a raw byte string of the given siz... |
ae2d52e323ea8959caf474d23de857d59b5b6ca8 | spacy/tests/regression/test_issue3625.py | spacy/tests/regression/test_issue3625.py | from __future__ import unicode_literals
from spacy.lang.hi import Hindi
def test_issue3625():
"""Test that default punctuation rules applies to hindi unicode characters"""
nlp = Hindi()
doc = nlp(u"hi. how हुए. होटल, होटल")
assert [token.text for token in doc] == ['hi', '.', 'how', 'हुए', '.', 'होटल',... | # coding: utf8
from __future__ import unicode_literals
from spacy.lang.hi import Hindi
def test_issue3625():
"""Test that default punctuation rules applies to hindi unicode characters"""
nlp = Hindi()
doc = nlp(u"hi. how हुए. होटल, होटल")
assert [token.text for token in doc] == ['hi', '.', 'how', 'हुए... | Add default encoding utf-8 for test file | Add default encoding utf-8 for test file
| Python | mit | honnibal/spaCy,spacy-io/spaCy,explosion/spaCy,honnibal/spaCy,explosion/spaCy,explosion/spaCy,honnibal/spaCy,spacy-io/spaCy,spacy-io/spaCy,explosion/spaCy,explosion/spaCy,honnibal/spaCy,spacy-io/spaCy,spacy-io/spaCy,spacy-io/spaCy,explosion/spaCy | from __future__ import unicode_literals
from spacy.lang.hi import Hindi
def test_issue3625():
"""Test that default punctuation rules applies to hindi unicode characters"""
nlp = Hindi()
doc = nlp(u"hi. how हुए. होटल, होटल")
assert [token.text for token in doc] == ['hi', '.', 'how', 'हुए', '.', 'होटल',... | # coding: utf8
from __future__ import unicode_literals
from spacy.lang.hi import Hindi
def test_issue3625():
"""Test that default punctuation rules applies to hindi unicode characters"""
nlp = Hindi()
doc = nlp(u"hi. how हुए. होटल, होटल")
assert [token.text for token in doc] == ['hi', '.', 'how', 'हुए... | <commit_before>from __future__ import unicode_literals
from spacy.lang.hi import Hindi
def test_issue3625():
"""Test that default punctuation rules applies to hindi unicode characters"""
nlp = Hindi()
doc = nlp(u"hi. how हुए. होटल, होटल")
assert [token.text for token in doc] == ['hi', '.', 'how', 'हुए... | # coding: utf8
from __future__ import unicode_literals
from spacy.lang.hi import Hindi
def test_issue3625():
"""Test that default punctuation rules applies to hindi unicode characters"""
nlp = Hindi()
doc = nlp(u"hi. how हुए. होटल, होटल")
assert [token.text for token in doc] == ['hi', '.', 'how', 'हुए... | from __future__ import unicode_literals
from spacy.lang.hi import Hindi
def test_issue3625():
"""Test that default punctuation rules applies to hindi unicode characters"""
nlp = Hindi()
doc = nlp(u"hi. how हुए. होटल, होटल")
assert [token.text for token in doc] == ['hi', '.', 'how', 'हुए', '.', 'होटल',... | <commit_before>from __future__ import unicode_literals
from spacy.lang.hi import Hindi
def test_issue3625():
"""Test that default punctuation rules applies to hindi unicode characters"""
nlp = Hindi()
doc = nlp(u"hi. how हुए. होटल, होटल")
assert [token.text for token in doc] == ['hi', '.', 'how', 'हुए... |
ce873b24318fd6493f570f370db1d2c2d244bdcc | joby/spiders/data_science_jobs.py | joby/spiders/data_science_jobs.py | # -*- coding: utf-8 -*-
from logging import getLogger
from scrapy.spiders import Rule, CrawlSpider
from scrapy.linkextractors import LinkExtractor
class DataScienceJobsSpider(CrawlSpider):
log = getLogger(__name__)
name = 'data-science-jobs'
allowed_domains = ['www.data-science-jobs.com', 'fonts.googleap... | # -*- coding: utf-8 -*-
from logging import getLogger
from scrapy.spiders import Rule, CrawlSpider
from scrapy.linkextractors import LinkExtractor
class DataScienceJobsSpider(CrawlSpider):
log = getLogger(__name__)
name = 'data-science-jobs'
allowed_domains = ['www.data-science-jobs.com']
start_urls ... | Rename the parser function to parse_jobs. | Rename the parser function to parse_jobs.
| Python | mit | cyberbikepunk/job-spiders | # -*- coding: utf-8 -*-
from logging import getLogger
from scrapy.spiders import Rule, CrawlSpider
from scrapy.linkextractors import LinkExtractor
class DataScienceJobsSpider(CrawlSpider):
log = getLogger(__name__)
name = 'data-science-jobs'
allowed_domains = ['www.data-science-jobs.com', 'fonts.googleap... | # -*- coding: utf-8 -*-
from logging import getLogger
from scrapy.spiders import Rule, CrawlSpider
from scrapy.linkextractors import LinkExtractor
class DataScienceJobsSpider(CrawlSpider):
log = getLogger(__name__)
name = 'data-science-jobs'
allowed_domains = ['www.data-science-jobs.com']
start_urls ... | <commit_before># -*- coding: utf-8 -*-
from logging import getLogger
from scrapy.spiders import Rule, CrawlSpider
from scrapy.linkextractors import LinkExtractor
class DataScienceJobsSpider(CrawlSpider):
log = getLogger(__name__)
name = 'data-science-jobs'
allowed_domains = ['www.data-science-jobs.com', ... | # -*- coding: utf-8 -*-
from logging import getLogger
from scrapy.spiders import Rule, CrawlSpider
from scrapy.linkextractors import LinkExtractor
class DataScienceJobsSpider(CrawlSpider):
log = getLogger(__name__)
name = 'data-science-jobs'
allowed_domains = ['www.data-science-jobs.com']
start_urls ... | # -*- coding: utf-8 -*-
from logging import getLogger
from scrapy.spiders import Rule, CrawlSpider
from scrapy.linkextractors import LinkExtractor
class DataScienceJobsSpider(CrawlSpider):
log = getLogger(__name__)
name = 'data-science-jobs'
allowed_domains = ['www.data-science-jobs.com', 'fonts.googleap... | <commit_before># -*- coding: utf-8 -*-
from logging import getLogger
from scrapy.spiders import Rule, CrawlSpider
from scrapy.linkextractors import LinkExtractor
class DataScienceJobsSpider(CrawlSpider):
log = getLogger(__name__)
name = 'data-science-jobs'
allowed_domains = ['www.data-science-jobs.com', ... |
b77e8f9a081517701cccf9f177c81eaca877e8c7 | pombola/images/admin.py | pombola/images/admin.py | from django.contrib import admin
from django.contrib.contenttypes.generic import GenericTabularInline
from sorl.thumbnail import get_thumbnail
from sorl.thumbnail.admin import AdminImageMixin
from pombola.images import models
class ImageAdmin(AdminImageMixin, admin.ModelAdmin):
list_display = [ 'thumbnail',... | from django.contrib import admin
from django.contrib.contenttypes.generic import GenericTabularInline
from sorl.thumbnail import get_thumbnail
from sorl.thumbnail.admin import AdminImageMixin
from pombola.images import models
class ImageAdmin(AdminImageMixin, admin.ModelAdmin):
list_display = [ 'thumbnail',... | Handle entries that have no image associated with them | Handle entries that have no image associated with them
| Python | agpl-3.0 | ken-muturi/pombola,mysociety/pombola,geoffkilpin/pombola,hzj123/56th,ken-muturi/pombola,patricmutwiri/pombola,geoffkilpin/pombola,ken-muturi/pombola,mysociety/pombola,ken-muturi/pombola,mysociety/pombola,hzj123/56th,mysociety/pombola,patricmutwiri/pombola,patricmutwiri/pombola,geoffkilpin/pombola,hzj123/56th,ken-muturi... | from django.contrib import admin
from django.contrib.contenttypes.generic import GenericTabularInline
from sorl.thumbnail import get_thumbnail
from sorl.thumbnail.admin import AdminImageMixin
from pombola.images import models
class ImageAdmin(AdminImageMixin, admin.ModelAdmin):
list_display = [ 'thumbnail',... | from django.contrib import admin
from django.contrib.contenttypes.generic import GenericTabularInline
from sorl.thumbnail import get_thumbnail
from sorl.thumbnail.admin import AdminImageMixin
from pombola.images import models
class ImageAdmin(AdminImageMixin, admin.ModelAdmin):
list_display = [ 'thumbnail',... | <commit_before>from django.contrib import admin
from django.contrib.contenttypes.generic import GenericTabularInline
from sorl.thumbnail import get_thumbnail
from sorl.thumbnail.admin import AdminImageMixin
from pombola.images import models
class ImageAdmin(AdminImageMixin, admin.ModelAdmin):
list_display =... | from django.contrib import admin
from django.contrib.contenttypes.generic import GenericTabularInline
from sorl.thumbnail import get_thumbnail
from sorl.thumbnail.admin import AdminImageMixin
from pombola.images import models
class ImageAdmin(AdminImageMixin, admin.ModelAdmin):
list_display = [ 'thumbnail',... | from django.contrib import admin
from django.contrib.contenttypes.generic import GenericTabularInline
from sorl.thumbnail import get_thumbnail
from sorl.thumbnail.admin import AdminImageMixin
from pombola.images import models
class ImageAdmin(AdminImageMixin, admin.ModelAdmin):
list_display = [ 'thumbnail',... | <commit_before>from django.contrib import admin
from django.contrib.contenttypes.generic import GenericTabularInline
from sorl.thumbnail import get_thumbnail
from sorl.thumbnail.admin import AdminImageMixin
from pombola.images import models
class ImageAdmin(AdminImageMixin, admin.ModelAdmin):
list_display =... |
a03b166f8297783819a43eeb78e5af4d52d11bcc | carbonate/list.py | carbonate/list.py | import os
import re
# Use the built-in version of scandir/walk if possible, otherwise
# use the scandir module version
try:
from os import scandir, walk
except ImportError:
from scandir import scandir, walk
def listMetrics(storage_dir, follow_sym_links=False, metric_suffix='wsp'):
metric_regex = re.compi... | import os
import re
# Use the built-in version of scandir/walk if possible, otherwise
# use the scandir module version
try:
from os import scandir, walk # noqa # pylint: disable=unused-import
except ImportError:
from scandir import scandir, walk # noqa # pylint: disable=unused-import
def listMetrics(storag... | Make pylint happy as per graphite-web example | Make pylint happy as per graphite-web example
| Python | mit | criteo-forks/carbonate,jssjr/carbonate,deniszh/carbonate,graphite-project/carbonate,jssjr/carbonate,graphite-project/carbonate,criteo-forks/carbonate,jssjr/carbonate,deniszh/carbonate,deniszh/carbonate,criteo-forks/carbonate,graphite-project/carbonate | import os
import re
# Use the built-in version of scandir/walk if possible, otherwise
# use the scandir module version
try:
from os import scandir, walk
except ImportError:
from scandir import scandir, walk
def listMetrics(storage_dir, follow_sym_links=False, metric_suffix='wsp'):
metric_regex = re.compi... | import os
import re
# Use the built-in version of scandir/walk if possible, otherwise
# use the scandir module version
try:
from os import scandir, walk # noqa # pylint: disable=unused-import
except ImportError:
from scandir import scandir, walk # noqa # pylint: disable=unused-import
def listMetrics(storag... | <commit_before>import os
import re
# Use the built-in version of scandir/walk if possible, otherwise
# use the scandir module version
try:
from os import scandir, walk
except ImportError:
from scandir import scandir, walk
def listMetrics(storage_dir, follow_sym_links=False, metric_suffix='wsp'):
metric_r... | import os
import re
# Use the built-in version of scandir/walk if possible, otherwise
# use the scandir module version
try:
from os import scandir, walk # noqa # pylint: disable=unused-import
except ImportError:
from scandir import scandir, walk # noqa # pylint: disable=unused-import
def listMetrics(storag... | import os
import re
# Use the built-in version of scandir/walk if possible, otherwise
# use the scandir module version
try:
from os import scandir, walk
except ImportError:
from scandir import scandir, walk
def listMetrics(storage_dir, follow_sym_links=False, metric_suffix='wsp'):
metric_regex = re.compi... | <commit_before>import os
import re
# Use the built-in version of scandir/walk if possible, otherwise
# use the scandir module version
try:
from os import scandir, walk
except ImportError:
from scandir import scandir, walk
def listMetrics(storage_dir, follow_sym_links=False, metric_suffix='wsp'):
metric_r... |
119e95dedaf6633e1ca6367bfd13fa08192033bd | pywinauto/unittests/testall.py | pywinauto/unittests/testall.py | import unittest
import os.path
import os
import sys
sys.path.append(".")
#from pywinauto.timings import Timings
#Timings.Fast()
excludes = ['test_sendkeys']
def run_tests():
testfolder = os.path.abspath(os.path.split(__file__)[0])
sys.path.append(testfolder)
for root, dirs, files in... | import os
import sys
import unittest
import coverage
# needs to be called before importing the modules
cov = coverage.coverage(branch = True)
cov.start()
testfolder = os.path.abspath(os.path.dirname(__file__))
package_root = os.path.abspath(os.path.join(testfolder, r"..\.."))
sys.path.append(package_root... | Synchronize testing module with BetterBatch one - and integrate Coverage reporting | Synchronize testing module with BetterBatch one - and integrate Coverage reporting
| Python | bsd-3-clause | cessor/pywinauto,bombilee/pywinauto,ohio813/pywinauto,nameoffnv/pywinauto,yongxin1029/pywinauto,clonly/pywinauto,vsajip/pywinauto,cessor/pywinauto,LogicalKnight/pywinauto,ohio813/pywinauto,nameoffnv/pywinauto,ldhwin/pywinauto,airelil/pywinauto,drinkertea/pywinauto,prasen-ftech/pywinauto,vsajip/pywinauto,wilsoc5/pywinau... | import unittest
import os.path
import os
import sys
sys.path.append(".")
#from pywinauto.timings import Timings
#Timings.Fast()
excludes = ['test_sendkeys']
def run_tests():
testfolder = os.path.abspath(os.path.split(__file__)[0])
sys.path.append(testfolder)
for root, dirs, files in... | import os
import sys
import unittest
import coverage
# needs to be called before importing the modules
cov = coverage.coverage(branch = True)
cov.start()
testfolder = os.path.abspath(os.path.dirname(__file__))
package_root = os.path.abspath(os.path.join(testfolder, r"..\.."))
sys.path.append(package_root... | <commit_before>import unittest
import os.path
import os
import sys
sys.path.append(".")
#from pywinauto.timings import Timings
#Timings.Fast()
excludes = ['test_sendkeys']
def run_tests():
testfolder = os.path.abspath(os.path.split(__file__)[0])
sys.path.append(testfolder)
for root,... | import os
import sys
import unittest
import coverage
# needs to be called before importing the modules
cov = coverage.coverage(branch = True)
cov.start()
testfolder = os.path.abspath(os.path.dirname(__file__))
package_root = os.path.abspath(os.path.join(testfolder, r"..\.."))
sys.path.append(package_root... | import unittest
import os.path
import os
import sys
sys.path.append(".")
#from pywinauto.timings import Timings
#Timings.Fast()
excludes = ['test_sendkeys']
def run_tests():
testfolder = os.path.abspath(os.path.split(__file__)[0])
sys.path.append(testfolder)
for root, dirs, files in... | <commit_before>import unittest
import os.path
import os
import sys
sys.path.append(".")
#from pywinauto.timings import Timings
#Timings.Fast()
excludes = ['test_sendkeys']
def run_tests():
testfolder = os.path.abspath(os.path.split(__file__)[0])
sys.path.append(testfolder)
for root,... |
29032ee9dc69b1f3226358c3a6b74a7e42d71f07 | generationkwh/amortizations.py | generationkwh/amortizations.py | # -*- coding:utf8 -*-
from plantmeter.isodates import isodate
from dateutil.relativedelta import relativedelta
waitYears = 1
expirationYears = 25
def previousAmortizationDate(purchase_date, current_date):
years = relativedelta(
isodate(current_date),
isodate(purchase_date),
).years
... | # -*- coding:utf8 -*-
from plantmeter.isodates import isodate
from dateutil.relativedelta import relativedelta
waitYears = 1
expirationYears = 25
def previousAmortizationDate(purchase_date, current_date):
years = relativedelta(
isodate(current_date),
isodate(purchase_date),
).years
... | Modify return variable and partenesis | Modify return variable and partenesis
| Python | agpl-3.0 | Som-Energia/somenergia-generationkwh,Som-Energia/somenergia-generationkwh | # -*- coding:utf8 -*-
from plantmeter.isodates import isodate
from dateutil.relativedelta import relativedelta
waitYears = 1
expirationYears = 25
def previousAmortizationDate(purchase_date, current_date):
years = relativedelta(
isodate(current_date),
isodate(purchase_date),
).years
... | # -*- coding:utf8 -*-
from plantmeter.isodates import isodate
from dateutil.relativedelta import relativedelta
waitYears = 1
expirationYears = 25
def previousAmortizationDate(purchase_date, current_date):
years = relativedelta(
isodate(current_date),
isodate(purchase_date),
).years
... | <commit_before># -*- coding:utf8 -*-
from plantmeter.isodates import isodate
from dateutil.relativedelta import relativedelta
waitYears = 1
expirationYears = 25
def previousAmortizationDate(purchase_date, current_date):
years = relativedelta(
isodate(current_date),
isodate(purchase_date),
... | # -*- coding:utf8 -*-
from plantmeter.isodates import isodate
from dateutil.relativedelta import relativedelta
waitYears = 1
expirationYears = 25
def previousAmortizationDate(purchase_date, current_date):
years = relativedelta(
isodate(current_date),
isodate(purchase_date),
).years
... | # -*- coding:utf8 -*-
from plantmeter.isodates import isodate
from dateutil.relativedelta import relativedelta
waitYears = 1
expirationYears = 25
def previousAmortizationDate(purchase_date, current_date):
years = relativedelta(
isodate(current_date),
isodate(purchase_date),
).years
... | <commit_before># -*- coding:utf8 -*-
from plantmeter.isodates import isodate
from dateutil.relativedelta import relativedelta
waitYears = 1
expirationYears = 25
def previousAmortizationDate(purchase_date, current_date):
years = relativedelta(
isodate(current_date),
isodate(purchase_date),
... |
9a879fb583f7f4190a4601a9a488ba61414395e0 | kivymd/card.py | kivymd/card.py | # -*- coding: utf-8 -*-
from kivy.lang import Builder
from kivy.properties import BoundedNumericProperty, ReferenceListProperty
from kivy.uix.boxlayout import BoxLayout
from kivymd.elevationbehavior import ElevationBehavior
from kivymd.theming import ThemableBehavior
from kivy.metrics import dp
Builder.load_string('''... | # -*- coding: utf-8 -*-
from kivy.lang import Builder
from kivy.properties import BoundedNumericProperty, ReferenceListProperty, ListProperty,BooleanProperty
from kivy.uix.boxlayout import BoxLayout
from kivymd.elevationbehavior import ElevationBehavior
from kivymd.theming import ThemableBehavior
from kivy.metrics impo... | Add border as option (set via alpha) | Add border as option (set via alpha) | Python | mit | cruor99/KivyMD | # -*- coding: utf-8 -*-
from kivy.lang import Builder
from kivy.properties import BoundedNumericProperty, ReferenceListProperty
from kivy.uix.boxlayout import BoxLayout
from kivymd.elevationbehavior import ElevationBehavior
from kivymd.theming import ThemableBehavior
from kivy.metrics import dp
Builder.load_string('''... | # -*- coding: utf-8 -*-
from kivy.lang import Builder
from kivy.properties import BoundedNumericProperty, ReferenceListProperty, ListProperty,BooleanProperty
from kivy.uix.boxlayout import BoxLayout
from kivymd.elevationbehavior import ElevationBehavior
from kivymd.theming import ThemableBehavior
from kivy.metrics impo... | <commit_before># -*- coding: utf-8 -*-
from kivy.lang import Builder
from kivy.properties import BoundedNumericProperty, ReferenceListProperty
from kivy.uix.boxlayout import BoxLayout
from kivymd.elevationbehavior import ElevationBehavior
from kivymd.theming import ThemableBehavior
from kivy.metrics import dp
Builder.... | # -*- coding: utf-8 -*-
from kivy.lang import Builder
from kivy.properties import BoundedNumericProperty, ReferenceListProperty, ListProperty,BooleanProperty
from kivy.uix.boxlayout import BoxLayout
from kivymd.elevationbehavior import ElevationBehavior
from kivymd.theming import ThemableBehavior
from kivy.metrics impo... | # -*- coding: utf-8 -*-
from kivy.lang import Builder
from kivy.properties import BoundedNumericProperty, ReferenceListProperty
from kivy.uix.boxlayout import BoxLayout
from kivymd.elevationbehavior import ElevationBehavior
from kivymd.theming import ThemableBehavior
from kivy.metrics import dp
Builder.load_string('''... | <commit_before># -*- coding: utf-8 -*-
from kivy.lang import Builder
from kivy.properties import BoundedNumericProperty, ReferenceListProperty
from kivy.uix.boxlayout import BoxLayout
from kivymd.elevationbehavior import ElevationBehavior
from kivymd.theming import ThemableBehavior
from kivy.metrics import dp
Builder.... |
7ea053bfc1b557ce4a4df4905af4a5491517490b | default_config.py | default_config.py | # Default Config
# Override these values in the instance/local_config.py file, not this one.
DEBUG = None
DOMAIN = 'localhost'
HOST = 'localhost'
PORT = 5000
| """\
Default Config
Override these values in the instance/local_config.py file, not this one.
"""
DEBUG = None
DOMAIN = 'localhost'
HOST = 'localhost'
PORT = 5000
| Use doc-string, not comments in default config. | Use doc-string, not comments in default config.
| Python | mit | joeyespo/tabhouse.org,joeyespo/tabhouse,joeyespo/tabhouse,joeyespo/tabhouse.org | # Default Config
# Override these values in the instance/local_config.py file, not this one.
DEBUG = None
DOMAIN = 'localhost'
HOST = 'localhost'
PORT = 5000
Use doc-string, not comments in default config. | """\
Default Config
Override these values in the instance/local_config.py file, not this one.
"""
DEBUG = None
DOMAIN = 'localhost'
HOST = 'localhost'
PORT = 5000
| <commit_before># Default Config
# Override these values in the instance/local_config.py file, not this one.
DEBUG = None
DOMAIN = 'localhost'
HOST = 'localhost'
PORT = 5000
<commit_msg>Use doc-string, not comments in default config.<commit_after> | """\
Default Config
Override these values in the instance/local_config.py file, not this one.
"""
DEBUG = None
DOMAIN = 'localhost'
HOST = 'localhost'
PORT = 5000
| # Default Config
# Override these values in the instance/local_config.py file, not this one.
DEBUG = None
DOMAIN = 'localhost'
HOST = 'localhost'
PORT = 5000
Use doc-string, not comments in default config."""\
Default Config
Override these values in the instance/local_config.py file, not this one.
"""
DEBUG = Non... | <commit_before># Default Config
# Override these values in the instance/local_config.py file, not this one.
DEBUG = None
DOMAIN = 'localhost'
HOST = 'localhost'
PORT = 5000
<commit_msg>Use doc-string, not comments in default config.<commit_after>"""\
Default Config
Override these values in the instance/local_config... |
1736d7b7aed3ce3049186ce97e24941de0187caf | oidc_provider/lib/utils/common.py | oidc_provider/lib/utils/common.py | from django.conf import settings as django_settings
from django.core.urlresolvers import reverse
from oidc_provider import settings
def get_issuer():
"""
Construct the issuer full url. Basically is the site url with some path
appended.
"""
site_url = settings.get('SITE_URL')
path = reverse('o... | from django.conf import settings as django_settings
from django.core.urlresolvers import reverse
from oidc_provider import settings
def get_issuer():
"""
Construct the issuer full url. Basically is the site url with some path
appended.
"""
site_url = settings.get('SITE_URL')
path = reverse('o... | Add IOError custom message when rsa key file is missing. | Add IOError custom message when rsa key file is missing.
| Python | mit | ByteInternet/django-oidc-provider,torreco/django-oidc-provider,juanifioren/django-oidc-provider,bunnyinc/django-oidc-provider,wayward710/django-oidc-provider,bunnyinc/django-oidc-provider,wayward710/django-oidc-provider,wojtek-fliposports/django-oidc-provider,nmohoric/django-oidc-provider,nmohoric/django-oidc-provider,... | from django.conf import settings as django_settings
from django.core.urlresolvers import reverse
from oidc_provider import settings
def get_issuer():
"""
Construct the issuer full url. Basically is the site url with some path
appended.
"""
site_url = settings.get('SITE_URL')
path = reverse('o... | from django.conf import settings as django_settings
from django.core.urlresolvers import reverse
from oidc_provider import settings
def get_issuer():
"""
Construct the issuer full url. Basically is the site url with some path
appended.
"""
site_url = settings.get('SITE_URL')
path = reverse('o... | <commit_before>from django.conf import settings as django_settings
from django.core.urlresolvers import reverse
from oidc_provider import settings
def get_issuer():
"""
Construct the issuer full url. Basically is the site url with some path
appended.
"""
site_url = settings.get('SITE_URL')
pa... | from django.conf import settings as django_settings
from django.core.urlresolvers import reverse
from oidc_provider import settings
def get_issuer():
"""
Construct the issuer full url. Basically is the site url with some path
appended.
"""
site_url = settings.get('SITE_URL')
path = reverse('o... | from django.conf import settings as django_settings
from django.core.urlresolvers import reverse
from oidc_provider import settings
def get_issuer():
"""
Construct the issuer full url. Basically is the site url with some path
appended.
"""
site_url = settings.get('SITE_URL')
path = reverse('o... | <commit_before>from django.conf import settings as django_settings
from django.core.urlresolvers import reverse
from oidc_provider import settings
def get_issuer():
"""
Construct the issuer full url. Basically is the site url with some path
appended.
"""
site_url = settings.get('SITE_URL')
pa... |
dc0129224dc01f4e9cdaa57ee2aff307a4f5d7d3 | project/utils/logger.py | project/utils/logger.py | # -*- coding: utf-8 -*-
import datetime
import logging
import os
def set_up_logging():
"""
Main logger for usual bot needs
"""
logs_directory = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'logs')
if not os.path.exists(logs_directory):
os.mkdir(logs_directory)
log... | # -*- coding: utf-8 -*-
import datetime
import logging
import os
import hashlib
from utils.settings_handler import settings
def set_up_logging():
"""
Logger for tenhou communication and AI output
"""
logs_directory = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'logs')
if not ... | Add hash from the bot name to the log name | Add hash from the bot name to the log name
| Python | mit | huangenyan/Lattish,MahjongRepository/tenhou-python-bot,MahjongRepository/tenhou-python-bot,huangenyan/Lattish | # -*- coding: utf-8 -*-
import datetime
import logging
import os
def set_up_logging():
"""
Main logger for usual bot needs
"""
logs_directory = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'logs')
if not os.path.exists(logs_directory):
os.mkdir(logs_directory)
log... | # -*- coding: utf-8 -*-
import datetime
import logging
import os
import hashlib
from utils.settings_handler import settings
def set_up_logging():
"""
Logger for tenhou communication and AI output
"""
logs_directory = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'logs')
if not ... | <commit_before># -*- coding: utf-8 -*-
import datetime
import logging
import os
def set_up_logging():
"""
Main logger for usual bot needs
"""
logs_directory = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'logs')
if not os.path.exists(logs_directory):
os.mkdir(logs_dire... | # -*- coding: utf-8 -*-
import datetime
import logging
import os
import hashlib
from utils.settings_handler import settings
def set_up_logging():
"""
Logger for tenhou communication and AI output
"""
logs_directory = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'logs')
if not ... | # -*- coding: utf-8 -*-
import datetime
import logging
import os
def set_up_logging():
"""
Main logger for usual bot needs
"""
logs_directory = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'logs')
if not os.path.exists(logs_directory):
os.mkdir(logs_directory)
log... | <commit_before># -*- coding: utf-8 -*-
import datetime
import logging
import os
def set_up_logging():
"""
Main logger for usual bot needs
"""
logs_directory = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'logs')
if not os.path.exists(logs_directory):
os.mkdir(logs_dire... |
a174fbd637bf9ccc7b8a97a251c016495f92f6a9 | eliot/__init__.py | eliot/__init__.py | """
Eliot: Logging as Storytelling
Suppose we turn from outside estimates of a man, to wonder, with keener
interest, what is the report of his own consciousness about his doings or
capacity: with what hindrances he is carrying on his daily labors; what
fading of hopes, or what deeper fixity of self-del... | """
Eliot: Logging as Storytelling
Suppose we turn from outside estimates of a man, to wonder, with keener
interest, what is the report of his own consciousness about his doings or
capacity: with what hindrances he is carrying on his daily labors; what
fading of hopes, or what deeper fixity of self-del... | Add fields to the public API. | Add fields to the public API.
| Python | apache-2.0 | ClusterHQ/eliot,ScatterHQ/eliot,iffy/eliot,ScatterHQ/eliot,ScatterHQ/eliot | """
Eliot: Logging as Storytelling
Suppose we turn from outside estimates of a man, to wonder, with keener
interest, what is the report of his own consciousness about his doings or
capacity: with what hindrances he is carrying on his daily labors; what
fading of hopes, or what deeper fixity of self-del... | """
Eliot: Logging as Storytelling
Suppose we turn from outside estimates of a man, to wonder, with keener
interest, what is the report of his own consciousness about his doings or
capacity: with what hindrances he is carrying on his daily labors; what
fading of hopes, or what deeper fixity of self-del... | <commit_before>"""
Eliot: Logging as Storytelling
Suppose we turn from outside estimates of a man, to wonder, with keener
interest, what is the report of his own consciousness about his doings or
capacity: with what hindrances he is carrying on his daily labors; what
fading of hopes, or what deeper fix... | """
Eliot: Logging as Storytelling
Suppose we turn from outside estimates of a man, to wonder, with keener
interest, what is the report of his own consciousness about his doings or
capacity: with what hindrances he is carrying on his daily labors; what
fading of hopes, or what deeper fixity of self-del... | """
Eliot: Logging as Storytelling
Suppose we turn from outside estimates of a man, to wonder, with keener
interest, what is the report of his own consciousness about his doings or
capacity: with what hindrances he is carrying on his daily labors; what
fading of hopes, or what deeper fixity of self-del... | <commit_before>"""
Eliot: Logging as Storytelling
Suppose we turn from outside estimates of a man, to wonder, with keener
interest, what is the report of his own consciousness about his doings or
capacity: with what hindrances he is carrying on his daily labors; what
fading of hopes, or what deeper fix... |
fb1f6f30fc7ba2d3dcce357168a05669c934c234 | build/oggm/run_test.py | build/oggm/run_test.py | #!/usr/bin/env python
import os
os.environ["MPLBACKEND"] = 'agg'
import matplotlib
matplotlib.use('agg')
import pytest
import oggm
import sys
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
initial_dir = os.getcwd()
oggm_file = os.path.abspath(oggm.__file__)
oggm_dir = os.path.dirname... | #!/usr/bin/env python
import os
os.environ["MPLBACKEND"] = 'agg'
import matplotlib
matplotlib.use('agg')
import pytest
import oggm
import sys
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
if os.name == 'nt':
sys.exit(0)
initial_dir = os.getcwd()
oggm_file = os.path.abspath(oggm... | Disable testing on Windows for now, it just takes too long for any CI service | Disable testing on Windows for now, it just takes too long for any CI service
| Python | mit | OGGM/OGGM-Anaconda | #!/usr/bin/env python
import os
os.environ["MPLBACKEND"] = 'agg'
import matplotlib
matplotlib.use('agg')
import pytest
import oggm
import sys
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
initial_dir = os.getcwd()
oggm_file = os.path.abspath(oggm.__file__)
oggm_dir = os.path.dirname... | #!/usr/bin/env python
import os
os.environ["MPLBACKEND"] = 'agg'
import matplotlib
matplotlib.use('agg')
import pytest
import oggm
import sys
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
if os.name == 'nt':
sys.exit(0)
initial_dir = os.getcwd()
oggm_file = os.path.abspath(oggm... | <commit_before>#!/usr/bin/env python
import os
os.environ["MPLBACKEND"] = 'agg'
import matplotlib
matplotlib.use('agg')
import pytest
import oggm
import sys
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
initial_dir = os.getcwd()
oggm_file = os.path.abspath(oggm.__file__)
oggm_dir = ... | #!/usr/bin/env python
import os
os.environ["MPLBACKEND"] = 'agg'
import matplotlib
matplotlib.use('agg')
import pytest
import oggm
import sys
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
if os.name == 'nt':
sys.exit(0)
initial_dir = os.getcwd()
oggm_file = os.path.abspath(oggm... | #!/usr/bin/env python
import os
os.environ["MPLBACKEND"] = 'agg'
import matplotlib
matplotlib.use('agg')
import pytest
import oggm
import sys
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
initial_dir = os.getcwd()
oggm_file = os.path.abspath(oggm.__file__)
oggm_dir = os.path.dirname... | <commit_before>#!/usr/bin/env python
import os
os.environ["MPLBACKEND"] = 'agg'
import matplotlib
matplotlib.use('agg')
import pytest
import oggm
import sys
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
initial_dir = os.getcwd()
oggm_file = os.path.abspath(oggm.__file__)
oggm_dir = ... |
b1cc99458d22b8ed54326de6b4eafececb3a8093 | jobs/telemetry_aggregator.py | jobs/telemetry_aggregator.py | #!/home/hadoop/anaconda2/bin/ipython
import logging
from os import environ
from mozaggregator.aggregator import aggregate_metrics
from mozaggregator.db import submit_aggregates
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
logger.addHandler(logging.StreamHandler())
date = environ['date']
logger... | #!/home/hadoop/anaconda2/bin/ipython
import logging
from os import environ
from mozaggregator.aggregator import aggregate_metrics
from mozaggregator.db import submit_aggregates
date = environ['date']
print "Running job for {}".format(date)
aggregates = aggregate_metrics(sc, ("nightly", "aurora", "beta", "release"), d... | Use simple prints for logging. | Use simple prints for logging.
| Python | mpl-2.0 | opentrials/opentrials-airflow,opentrials/opentrials-airflow | #!/home/hadoop/anaconda2/bin/ipython
import logging
from os import environ
from mozaggregator.aggregator import aggregate_metrics
from mozaggregator.db import submit_aggregates
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
logger.addHandler(logging.StreamHandler())
date = environ['date']
logger... | #!/home/hadoop/anaconda2/bin/ipython
import logging
from os import environ
from mozaggregator.aggregator import aggregate_metrics
from mozaggregator.db import submit_aggregates
date = environ['date']
print "Running job for {}".format(date)
aggregates = aggregate_metrics(sc, ("nightly", "aurora", "beta", "release"), d... | <commit_before>#!/home/hadoop/anaconda2/bin/ipython
import logging
from os import environ
from mozaggregator.aggregator import aggregate_metrics
from mozaggregator.db import submit_aggregates
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
logger.addHandler(logging.StreamHandler())
date = environ[... | #!/home/hadoop/anaconda2/bin/ipython
import logging
from os import environ
from mozaggregator.aggregator import aggregate_metrics
from mozaggregator.db import submit_aggregates
date = environ['date']
print "Running job for {}".format(date)
aggregates = aggregate_metrics(sc, ("nightly", "aurora", "beta", "release"), d... | #!/home/hadoop/anaconda2/bin/ipython
import logging
from os import environ
from mozaggregator.aggregator import aggregate_metrics
from mozaggregator.db import submit_aggregates
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
logger.addHandler(logging.StreamHandler())
date = environ['date']
logger... | <commit_before>#!/home/hadoop/anaconda2/bin/ipython
import logging
from os import environ
from mozaggregator.aggregator import aggregate_metrics
from mozaggregator.db import submit_aggregates
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
logger.addHandler(logging.StreamHandler())
date = environ[... |
1983885acfccfe4ffa010401fd9ef0971bb6c12c | etcd3/__init__.py | etcd3/__init__.py | from __future__ import absolute_import
from etcd3.client import Etcd3Client
from etcd3.client import client
from etcd3.client import Transactions
__author__ = 'Louis Taylor'
__email__ = 'louis@kragniz.eu'
__version__ = '0.1.0'
__all__ = ['Etcd3Client', 'client', 'etcdrpc', 'utils', 'Transactions']
| from __future__ import absolute_import
from etcd3.client import Etcd3Client
from etcd3.client import client
from etcd3.client import Transactions
from etcd3.members import Member
__author__ = 'Louis Taylor'
__email__ = 'louis@kragniz.eu'
__version__ = '0.1.0'
__all__ = ['Etcd3Client', 'client', 'etcdrpc', 'utils', '... | Make Member part of the public api | Make Member part of the public api
| Python | apache-2.0 | kragniz/python-etcd3 | from __future__ import absolute_import
from etcd3.client import Etcd3Client
from etcd3.client import client
from etcd3.client import Transactions
__author__ = 'Louis Taylor'
__email__ = 'louis@kragniz.eu'
__version__ = '0.1.0'
__all__ = ['Etcd3Client', 'client', 'etcdrpc', 'utils', 'Transactions']
Make Member part o... | from __future__ import absolute_import
from etcd3.client import Etcd3Client
from etcd3.client import client
from etcd3.client import Transactions
from etcd3.members import Member
__author__ = 'Louis Taylor'
__email__ = 'louis@kragniz.eu'
__version__ = '0.1.0'
__all__ = ['Etcd3Client', 'client', 'etcdrpc', 'utils', '... | <commit_before>from __future__ import absolute_import
from etcd3.client import Etcd3Client
from etcd3.client import client
from etcd3.client import Transactions
__author__ = 'Louis Taylor'
__email__ = 'louis@kragniz.eu'
__version__ = '0.1.0'
__all__ = ['Etcd3Client', 'client', 'etcdrpc', 'utils', 'Transactions']
<co... | from __future__ import absolute_import
from etcd3.client import Etcd3Client
from etcd3.client import client
from etcd3.client import Transactions
from etcd3.members import Member
__author__ = 'Louis Taylor'
__email__ = 'louis@kragniz.eu'
__version__ = '0.1.0'
__all__ = ['Etcd3Client', 'client', 'etcdrpc', 'utils', '... | from __future__ import absolute_import
from etcd3.client import Etcd3Client
from etcd3.client import client
from etcd3.client import Transactions
__author__ = 'Louis Taylor'
__email__ = 'louis@kragniz.eu'
__version__ = '0.1.0'
__all__ = ['Etcd3Client', 'client', 'etcdrpc', 'utils', 'Transactions']
Make Member part o... | <commit_before>from __future__ import absolute_import
from etcd3.client import Etcd3Client
from etcd3.client import client
from etcd3.client import Transactions
__author__ = 'Louis Taylor'
__email__ = 'louis@kragniz.eu'
__version__ = '0.1.0'
__all__ = ['Etcd3Client', 'client', 'etcdrpc', 'utils', 'Transactions']
<co... |
fb1db28198b54b6288a9e7d499b43f6f1a51284c | partner_deduplicate_by_website/__manifest__.py | partner_deduplicate_by_website/__manifest__.py | # Copyright 2016 Tecnativa - Pedro M. Baeza
# Copyright 2017 Tecnativa - Vicent Cubells
# Copyright 2018 Tecnativa - Cristina Martin
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Deduplicate Contacts by Website",
"version": "13.0.1.0.0",
"category": "Tools",
"website"... | # Copyright 2016 Tecnativa - Pedro M. Baeza
# Copyright 2017 Tecnativa - Vicent Cubells
# Copyright 2018 Tecnativa - Cristina Martin
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Deduplicate Contacts by Website",
"version": "13.0.1.0.0",
"category": "Tools",
"website"... | Fix website attribute in manifest | Fix website attribute in manifest
| Python | agpl-3.0 | OCA/partner-contact,OCA/partner-contact | # Copyright 2016 Tecnativa - Pedro M. Baeza
# Copyright 2017 Tecnativa - Vicent Cubells
# Copyright 2018 Tecnativa - Cristina Martin
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Deduplicate Contacts by Website",
"version": "13.0.1.0.0",
"category": "Tools",
"website"... | # Copyright 2016 Tecnativa - Pedro M. Baeza
# Copyright 2017 Tecnativa - Vicent Cubells
# Copyright 2018 Tecnativa - Cristina Martin
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Deduplicate Contacts by Website",
"version": "13.0.1.0.0",
"category": "Tools",
"website"... | <commit_before># Copyright 2016 Tecnativa - Pedro M. Baeza
# Copyright 2017 Tecnativa - Vicent Cubells
# Copyright 2018 Tecnativa - Cristina Martin
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Deduplicate Contacts by Website",
"version": "13.0.1.0.0",
"category": "Tools"... | # Copyright 2016 Tecnativa - Pedro M. Baeza
# Copyright 2017 Tecnativa - Vicent Cubells
# Copyright 2018 Tecnativa - Cristina Martin
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Deduplicate Contacts by Website",
"version": "13.0.1.0.0",
"category": "Tools",
"website"... | # Copyright 2016 Tecnativa - Pedro M. Baeza
# Copyright 2017 Tecnativa - Vicent Cubells
# Copyright 2018 Tecnativa - Cristina Martin
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Deduplicate Contacts by Website",
"version": "13.0.1.0.0",
"category": "Tools",
"website"... | <commit_before># Copyright 2016 Tecnativa - Pedro M. Baeza
# Copyright 2017 Tecnativa - Vicent Cubells
# Copyright 2018 Tecnativa - Cristina Martin
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Deduplicate Contacts by Website",
"version": "13.0.1.0.0",
"category": "Tools"... |
db84de91e665a131ad82be3ed49eb291afd5342d | oratioignoreparser.py | oratioignoreparser.py | import os
import re
class OratioIgnoreParser():
def __init__(self):
self.ignored_paths = ["oratiomodule.tar.gz"]
def load(self, oratio_ignore_path):
with open(oratio_ignore_path, "r") as f:
self.ignored_paths.extend([line.strip() for line in f])
def should_be_ignored(self, fi... | import os
import re
class OratioIgnoreParser():
def __init__(self):
self.ignored_paths = ["oratiomodule.tar.gz"]
def load(self, oratio_ignore_path):
with open(oratio_ignore_path, "r") as f:
self.ignored_paths.extend([line.strip() for line in f])
def should_be_ignored(self, fi... | Make all lines shorter than 80 characters | Make all lines shorter than 80 characters
| Python | mit | oratio-io/oratio-cli,oratio-io/oratio-cli | import os
import re
class OratioIgnoreParser():
def __init__(self):
self.ignored_paths = ["oratiomodule.tar.gz"]
def load(self, oratio_ignore_path):
with open(oratio_ignore_path, "r") as f:
self.ignored_paths.extend([line.strip() for line in f])
def should_be_ignored(self, fi... | import os
import re
class OratioIgnoreParser():
def __init__(self):
self.ignored_paths = ["oratiomodule.tar.gz"]
def load(self, oratio_ignore_path):
with open(oratio_ignore_path, "r") as f:
self.ignored_paths.extend([line.strip() for line in f])
def should_be_ignored(self, fi... | <commit_before>import os
import re
class OratioIgnoreParser():
def __init__(self):
self.ignored_paths = ["oratiomodule.tar.gz"]
def load(self, oratio_ignore_path):
with open(oratio_ignore_path, "r") as f:
self.ignored_paths.extend([line.strip() for line in f])
def should_be_i... | import os
import re
class OratioIgnoreParser():
def __init__(self):
self.ignored_paths = ["oratiomodule.tar.gz"]
def load(self, oratio_ignore_path):
with open(oratio_ignore_path, "r") as f:
self.ignored_paths.extend([line.strip() for line in f])
def should_be_ignored(self, fi... | import os
import re
class OratioIgnoreParser():
def __init__(self):
self.ignored_paths = ["oratiomodule.tar.gz"]
def load(self, oratio_ignore_path):
with open(oratio_ignore_path, "r") as f:
self.ignored_paths.extend([line.strip() for line in f])
def should_be_ignored(self, fi... | <commit_before>import os
import re
class OratioIgnoreParser():
def __init__(self):
self.ignored_paths = ["oratiomodule.tar.gz"]
def load(self, oratio_ignore_path):
with open(oratio_ignore_path, "r") as f:
self.ignored_paths.extend([line.strip() for line in f])
def should_be_i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.