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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1cfdf9b1c11da15adb1e1603c815b76a4a286b1a | searchlogger/searchlogger/settings/production.py | searchlogger/searchlogger/settings/production.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from defaults import * # noqa
import json
DEBUG = False
TEMPLATE_DEBUG = False
ALLOWED_HOSTS = ['.searchlogger.tutorons.com']
# Read in the Postgres database configuration from a file
DATABASE_CONFIG_FILENAME = os.path.join(
os.path.abspath(os.sep), # root direct... | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from defaults import * # noqa
import json
DEBUG = False
TEMPLATE_DEBUG = False
ALLOWED_HOSTS = ['.searchlogger.tutorons.com']
# Read in the Postgres database configuration from a file
DATABASE_CONFIG_FILENAME = os.path.join(BASE_DIR, 'database_config.json')
with open(... | Read database configuration from base directory | Settings: Read database configuration from base directory
| Python | mit | andrewhead/Search-Task-Logger,andrewhead/Search-Task-Logger,andrewhead/Search-Task-Logger | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from defaults import * # noqa
import json
DEBUG = False
TEMPLATE_DEBUG = False
ALLOWED_HOSTS = ['.searchlogger.tutorons.com']
# Read in the Postgres database configuration from a file
DATABASE_CONFIG_FILENAME = os.path.join(
os.path.abspath(os.sep), # root direct... | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from defaults import * # noqa
import json
DEBUG = False
TEMPLATE_DEBUG = False
ALLOWED_HOSTS = ['.searchlogger.tutorons.com']
# Read in the Postgres database configuration from a file
DATABASE_CONFIG_FILENAME = os.path.join(BASE_DIR, 'database_config.json')
with open(... | <commit_before>#! /usr/bin/env python
# -*- coding: utf-8 -*-
from defaults import * # noqa
import json
DEBUG = False
TEMPLATE_DEBUG = False
ALLOWED_HOSTS = ['.searchlogger.tutorons.com']
# Read in the Postgres database configuration from a file
DATABASE_CONFIG_FILENAME = os.path.join(
os.path.abspath(os.sep),... | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from defaults import * # noqa
import json
DEBUG = False
TEMPLATE_DEBUG = False
ALLOWED_HOSTS = ['.searchlogger.tutorons.com']
# Read in the Postgres database configuration from a file
DATABASE_CONFIG_FILENAME = os.path.join(BASE_DIR, 'database_config.json')
with open(... | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from defaults import * # noqa
import json
DEBUG = False
TEMPLATE_DEBUG = False
ALLOWED_HOSTS = ['.searchlogger.tutorons.com']
# Read in the Postgres database configuration from a file
DATABASE_CONFIG_FILENAME = os.path.join(
os.path.abspath(os.sep), # root direct... | <commit_before>#! /usr/bin/env python
# -*- coding: utf-8 -*-
from defaults import * # noqa
import json
DEBUG = False
TEMPLATE_DEBUG = False
ALLOWED_HOSTS = ['.searchlogger.tutorons.com']
# Read in the Postgres database configuration from a file
DATABASE_CONFIG_FILENAME = os.path.join(
os.path.abspath(os.sep),... |
14ff06097a72dc65a351bb6a8bf59963412d2f41 | semillas_backend/users/serializers.py | semillas_backend/users/serializers.py | #from phonenumber_field.serializerfields import PhoneNumberField
from rest_framework import serializers
from drf_extra_fields.geo_fields import PointField
from .models import User
class UserSerializer(serializers.ModelSerializer):
""" Usage:
from rest_framework.renderers import JSONRenderer
from ... | #from phonenumber_field.serializerfields import PhoneNumberField
from rest_framework import serializers
from drf_extra_fields.geo_fields import PointField
from .models import User
class UserSerializer(serializers.ModelSerializer):
""" Usage:
from rest_framework.renderers import JSONRenderer
from ... | Add phone to user serializer | Add phone to user serializer
| Python | mit | Semillas/semillas_platform,Semillas/semillas_backend,Semillas/semillas_backend,Semillas/semillas_backend,Semillas/semillas_platform,Semillas/semillas_platform,Semillas/semillas_platform,Semillas/semillas_backend | #from phonenumber_field.serializerfields import PhoneNumberField
from rest_framework import serializers
from drf_extra_fields.geo_fields import PointField
from .models import User
class UserSerializer(serializers.ModelSerializer):
""" Usage:
from rest_framework.renderers import JSONRenderer
from ... | #from phonenumber_field.serializerfields import PhoneNumberField
from rest_framework import serializers
from drf_extra_fields.geo_fields import PointField
from .models import User
class UserSerializer(serializers.ModelSerializer):
""" Usage:
from rest_framework.renderers import JSONRenderer
from ... | <commit_before>#from phonenumber_field.serializerfields import PhoneNumberField
from rest_framework import serializers
from drf_extra_fields.geo_fields import PointField
from .models import User
class UserSerializer(serializers.ModelSerializer):
""" Usage:
from rest_framework.renderers import JSONRendere... | #from phonenumber_field.serializerfields import PhoneNumberField
from rest_framework import serializers
from drf_extra_fields.geo_fields import PointField
from .models import User
class UserSerializer(serializers.ModelSerializer):
""" Usage:
from rest_framework.renderers import JSONRenderer
from ... | #from phonenumber_field.serializerfields import PhoneNumberField
from rest_framework import serializers
from drf_extra_fields.geo_fields import PointField
from .models import User
class UserSerializer(serializers.ModelSerializer):
""" Usage:
from rest_framework.renderers import JSONRenderer
from ... | <commit_before>#from phonenumber_field.serializerfields import PhoneNumberField
from rest_framework import serializers
from drf_extra_fields.geo_fields import PointField
from .models import User
class UserSerializer(serializers.ModelSerializer):
""" Usage:
from rest_framework.renderers import JSONRendere... |
23d12b1c4b755c7d35406bf2428eefbd682ef68f | examples/xor-classifier.py | examples/xor-classifier.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''Example using the theanets package for learning the XOR relation.'''
import climate
import logging
import numpy as np
import theanets
climate.enable_default_logging()
X = np.array([[0.0, 0.0], [0.0, 1.0], [1.0, 0.0], [1.0, 1.0]])
Y = np.array([0, 1, 1, 0, ])
Xi = np... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''Example using the theanets package for learning the XOR relation.'''
import climate
import logging
import numpy as np
import theanets
climate.enable_default_logging()
X = np.array([[0, 0], [0, 1], [1, 0], [1, 1]], dtype='f')
Y = np.array([[0], [1], [1], [0]], dtype='... | Use rprop for xor example. | Use rprop for xor example.
| Python | mit | lmjohns3/theanets,devdoer/theanets,chrinide/theanets | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''Example using the theanets package for learning the XOR relation.'''
import climate
import logging
import numpy as np
import theanets
climate.enable_default_logging()
X = np.array([[0.0, 0.0], [0.0, 1.0], [1.0, 0.0], [1.0, 1.0]])
Y = np.array([0, 1, 1, 0, ])
Xi = np... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''Example using the theanets package for learning the XOR relation.'''
import climate
import logging
import numpy as np
import theanets
climate.enable_default_logging()
X = np.array([[0, 0], [0, 1], [1, 0], [1, 1]], dtype='f')
Y = np.array([[0], [1], [1], [0]], dtype='... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''Example using the theanets package for learning the XOR relation.'''
import climate
import logging
import numpy as np
import theanets
climate.enable_default_logging()
X = np.array([[0.0, 0.0], [0.0, 1.0], [1.0, 0.0], [1.0, 1.0]])
Y = np.array([0, 1, 1,... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''Example using the theanets package for learning the XOR relation.'''
import climate
import logging
import numpy as np
import theanets
climate.enable_default_logging()
X = np.array([[0, 0], [0, 1], [1, 0], [1, 1]], dtype='f')
Y = np.array([[0], [1], [1], [0]], dtype='... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''Example using the theanets package for learning the XOR relation.'''
import climate
import logging
import numpy as np
import theanets
climate.enable_default_logging()
X = np.array([[0.0, 0.0], [0.0, 1.0], [1.0, 0.0], [1.0, 1.0]])
Y = np.array([0, 1, 1, 0, ])
Xi = np... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''Example using the theanets package for learning the XOR relation.'''
import climate
import logging
import numpy as np
import theanets
climate.enable_default_logging()
X = np.array([[0.0, 0.0], [0.0, 1.0], [1.0, 0.0], [1.0, 1.0]])
Y = np.array([0, 1, 1,... |
94796ca0107e6c676e3905675290bbe147169717 | hoppy/deploy.py | hoppy/deploy.py | from restkit import Resource
from hoppy import api_key
class Deploy(Resource):
def __init__(self, use_ssl=False):
self.api_key = api_key
super(Deploy, self).__init__(self.host, follow_redirect=True)
def check_configuration(self):
if not self.api_key:
raise HoptoadError('AP... | from hoppy.api import HoptoadResource
class Deploy(HoptoadResource):
def __init__(self, use_ssl=False):
from hoppy import api_key
self.api_key = api_key
super(Deploy, self).__init__(use_ssl)
def check_configuration(self):
if not self.api_key:
raise HoptoadError('API... | Test Deploy resource after reworking. | Test Deploy resource after reworking.
| Python | mit | peplin/hoppy | from restkit import Resource
from hoppy import api_key
class Deploy(Resource):
def __init__(self, use_ssl=False):
self.api_key = api_key
super(Deploy, self).__init__(self.host, follow_redirect=True)
def check_configuration(self):
if not self.api_key:
raise HoptoadError('AP... | from hoppy.api import HoptoadResource
class Deploy(HoptoadResource):
def __init__(self, use_ssl=False):
from hoppy import api_key
self.api_key = api_key
super(Deploy, self).__init__(use_ssl)
def check_configuration(self):
if not self.api_key:
raise HoptoadError('API... | <commit_before>from restkit import Resource
from hoppy import api_key
class Deploy(Resource):
def __init__(self, use_ssl=False):
self.api_key = api_key
super(Deploy, self).__init__(self.host, follow_redirect=True)
def check_configuration(self):
if not self.api_key:
raise H... | from hoppy.api import HoptoadResource
class Deploy(HoptoadResource):
def __init__(self, use_ssl=False):
from hoppy import api_key
self.api_key = api_key
super(Deploy, self).__init__(use_ssl)
def check_configuration(self):
if not self.api_key:
raise HoptoadError('API... | from restkit import Resource
from hoppy import api_key
class Deploy(Resource):
def __init__(self, use_ssl=False):
self.api_key = api_key
super(Deploy, self).__init__(self.host, follow_redirect=True)
def check_configuration(self):
if not self.api_key:
raise HoptoadError('AP... | <commit_before>from restkit import Resource
from hoppy import api_key
class Deploy(Resource):
def __init__(self, use_ssl=False):
self.api_key = api_key
super(Deploy, self).__init__(self.host, follow_redirect=True)
def check_configuration(self):
if not self.api_key:
raise H... |
9066d3e5bdbc95fb347b1a081d9b7db33ab68ea4 | src/autobot/src/stopsign.py | src/autobot/src/stopsign.py | #!/usr/bin/env python
import rospy
class StopStates(object):
NORMAL = 0
FULL_STOP = 1
IGNORE_STOP_SIGNS = 2
class StopSign(object):
def __init__(self):
self.state = StopStates.NORMAL
self.stopDuration = 2
self.ignoreDuration = 2
def stopSignDetected(self):
self... | #!/usr/bin/env python
import rospy
class StopStates(object):
NORMAL = 0
FULL_STOP = 1
IGNORE_STOP_SIGNS = 2
class StopSign(object):
def __init__(self):
self.state = StopStates.NORMAL
self.stopDuration = 2
self.ignoreDuration = 4
def stopSignDetected(self):
self... | Fix state machine using wrong variable | Fix state machine using wrong variable
| Python | mit | atkvo/masters-bot,atkvo/masters-bot,atkvo/masters-bot,atkvo/masters-bot,atkvo/masters-bot | #!/usr/bin/env python
import rospy
class StopStates(object):
NORMAL = 0
FULL_STOP = 1
IGNORE_STOP_SIGNS = 2
class StopSign(object):
def __init__(self):
self.state = StopStates.NORMAL
self.stopDuration = 2
self.ignoreDuration = 2
def stopSignDetected(self):
self... | #!/usr/bin/env python
import rospy
class StopStates(object):
NORMAL = 0
FULL_STOP = 1
IGNORE_STOP_SIGNS = 2
class StopSign(object):
def __init__(self):
self.state = StopStates.NORMAL
self.stopDuration = 2
self.ignoreDuration = 4
def stopSignDetected(self):
self... | <commit_before>#!/usr/bin/env python
import rospy
class StopStates(object):
NORMAL = 0
FULL_STOP = 1
IGNORE_STOP_SIGNS = 2
class StopSign(object):
def __init__(self):
self.state = StopStates.NORMAL
self.stopDuration = 2
self.ignoreDuration = 2
def stopSignDetected(self... | #!/usr/bin/env python
import rospy
class StopStates(object):
NORMAL = 0
FULL_STOP = 1
IGNORE_STOP_SIGNS = 2
class StopSign(object):
def __init__(self):
self.state = StopStates.NORMAL
self.stopDuration = 2
self.ignoreDuration = 4
def stopSignDetected(self):
self... | #!/usr/bin/env python
import rospy
class StopStates(object):
NORMAL = 0
FULL_STOP = 1
IGNORE_STOP_SIGNS = 2
class StopSign(object):
def __init__(self):
self.state = StopStates.NORMAL
self.stopDuration = 2
self.ignoreDuration = 2
def stopSignDetected(self):
self... | <commit_before>#!/usr/bin/env python
import rospy
class StopStates(object):
NORMAL = 0
FULL_STOP = 1
IGNORE_STOP_SIGNS = 2
class StopSign(object):
def __init__(self):
self.state = StopStates.NORMAL
self.stopDuration = 2
self.ignoreDuration = 2
def stopSignDetected(self... |
2c5a1bebf805c9bf5208fc75c32d8998b865eb32 | designate/objects/zone_transfer_request.py | designate/objects/zone_transfer_request.py | # Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# Author: Graham Hayes <graham.hayes@hp.com>
#
# 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/licens... | # Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# Author: Graham Hayes <graham.hayes@hp.com>
#
# 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/licens... | Remove duplicate fields from ZoneTransferRequest object | Remove duplicate fields from ZoneTransferRequest object
The fields id, version, created_at, updated_at are defined in the
PersistentObjectMixin which ZoneTransferRequest extends, so this
patch removes them from ZoneTransferRequest.
Change-Id: Iff20a31b4a208bff0bc879677a9901fedc43226b
Closes-Bug: #1403274
| Python | apache-2.0 | kiall/designate-py3,muraliselva10/designate,openstack/designate,kiall/designate-py3,ramsateesh/designate,kiall/designate-py3,openstack/designate,muraliselva10/designate,cneill/designate,tonyli71/designate,cneill/designate,cneill/designate-testing,cneill/designate-testing,cneill/designate,tonyli71/designate,muraliselva1... | # Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# Author: Graham Hayes <graham.hayes@hp.com>
#
# 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/licens... | # Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# Author: Graham Hayes <graham.hayes@hp.com>
#
# 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/licens... | <commit_before># Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# Author: Graham Hayes <graham.hayes@hp.com>
#
# 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.ap... | # Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# Author: Graham Hayes <graham.hayes@hp.com>
#
# 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/licens... | # Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# Author: Graham Hayes <graham.hayes@hp.com>
#
# 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/licens... | <commit_before># Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# Author: Graham Hayes <graham.hayes@hp.com>
#
# 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.ap... |
8441acfd5071e8b63fde816f67e167997045d510 | Lib/misc/setup.py | Lib/misc/setup.py |
import os
from numpy.distutils.misc_util import Configuration
def configuration(parent_package='',top_path=None):
config = Configuration('misc',parent_package, top_path)
config.add_data_files('lena.dat')
print "########", config
return config
if __name__ == '__main__':
from numpy.distutils.core i... |
import os
from numpy.distutils.misc_util import Configuration
def configuration(parent_package='',top_path=None):
config = Configuration('misc',parent_package, top_path)
config.add_data_files('lena.dat')
return config
if __name__ == '__main__':
from numpy.distutils.core import setup
setup(**confi... | Remove extra noise on install. | Remove extra noise on install.
| Python | bsd-3-clause | jseabold/scipy,richardotis/scipy,anntzer/scipy,fredrikw/scipy,behzadnouri/scipy,aman-iitj/scipy,mortada/scipy,njwilson23/scipy,trankmichael/scipy,trankmichael/scipy,apbard/scipy,niknow/scipy,aman-iitj/scipy,behzadnouri/scipy,FRidh/scipy,vanpact/scipy,Eric89GXL/scipy,rmcgibbo/scipy,larsmans/scipy,Shaswat27/scipy,ogrisel... |
import os
from numpy.distutils.misc_util import Configuration
def configuration(parent_package='',top_path=None):
config = Configuration('misc',parent_package, top_path)
config.add_data_files('lena.dat')
print "########", config
return config
if __name__ == '__main__':
from numpy.distutils.core i... |
import os
from numpy.distutils.misc_util import Configuration
def configuration(parent_package='',top_path=None):
config = Configuration('misc',parent_package, top_path)
config.add_data_files('lena.dat')
return config
if __name__ == '__main__':
from numpy.distutils.core import setup
setup(**confi... | <commit_before>
import os
from numpy.distutils.misc_util import Configuration
def configuration(parent_package='',top_path=None):
config = Configuration('misc',parent_package, top_path)
config.add_data_files('lena.dat')
print "########", config
return config
if __name__ == '__main__':
from numpy.d... |
import os
from numpy.distutils.misc_util import Configuration
def configuration(parent_package='',top_path=None):
config = Configuration('misc',parent_package, top_path)
config.add_data_files('lena.dat')
return config
if __name__ == '__main__':
from numpy.distutils.core import setup
setup(**confi... |
import os
from numpy.distutils.misc_util import Configuration
def configuration(parent_package='',top_path=None):
config = Configuration('misc',parent_package, top_path)
config.add_data_files('lena.dat')
print "########", config
return config
if __name__ == '__main__':
from numpy.distutils.core i... | <commit_before>
import os
from numpy.distutils.misc_util import Configuration
def configuration(parent_package='',top_path=None):
config = Configuration('misc',parent_package, top_path)
config.add_data_files('lena.dat')
print "########", config
return config
if __name__ == '__main__':
from numpy.d... |
758f73e1ecc34f52929595dfcf5db4a3a24fcbc6 | Python/views.py | Python/views.py | import requests
from django.shortcuts import render
from django.conf import settings
def oauthtest(request):
return render(request, 'oauthtest.html', {
'link': '{}o/authorize/?response_type=code&client_id={}&redirect_uri={}{}/oauthdone/'.format(
settings.API_URL,
settings.OAUTH_CLIE... | import requests
from django.shortcuts import render
from django.conf import settings
def oauthtest(request):
return render(request, 'oauthtest.html', {
'link': '{}o/authorize/?response_type=code&client_id={}&redirect_uri={}{}/oauthdone/'.format(
settings.API_URL,
settings.OAUTH_CLIE... | Fix redirect URI in oauthdone | Fix redirect URI in oauthdone
| Python | apache-2.0 | SchoolIdolTomodachi/SchoolIdolAPIOAuthExample,SchoolIdolTomodachi/SchoolIdolAPIOAuthExample,SchoolIdolTomodachi/SchoolIdolAPIOAuthExample | import requests
from django.shortcuts import render
from django.conf import settings
def oauthtest(request):
return render(request, 'oauthtest.html', {
'link': '{}o/authorize/?response_type=code&client_id={}&redirect_uri={}{}/oauthdone/'.format(
settings.API_URL,
settings.OAUTH_CLIE... | import requests
from django.shortcuts import render
from django.conf import settings
def oauthtest(request):
return render(request, 'oauthtest.html', {
'link': '{}o/authorize/?response_type=code&client_id={}&redirect_uri={}{}/oauthdone/'.format(
settings.API_URL,
settings.OAUTH_CLIE... | <commit_before>import requests
from django.shortcuts import render
from django.conf import settings
def oauthtest(request):
return render(request, 'oauthtest.html', {
'link': '{}o/authorize/?response_type=code&client_id={}&redirect_uri={}{}/oauthdone/'.format(
settings.API_URL,
sett... | import requests
from django.shortcuts import render
from django.conf import settings
def oauthtest(request):
return render(request, 'oauthtest.html', {
'link': '{}o/authorize/?response_type=code&client_id={}&redirect_uri={}{}/oauthdone/'.format(
settings.API_URL,
settings.OAUTH_CLIE... | import requests
from django.shortcuts import render
from django.conf import settings
def oauthtest(request):
return render(request, 'oauthtest.html', {
'link': '{}o/authorize/?response_type=code&client_id={}&redirect_uri={}{}/oauthdone/'.format(
settings.API_URL,
settings.OAUTH_CLIE... | <commit_before>import requests
from django.shortcuts import render
from django.conf import settings
def oauthtest(request):
return render(request, 'oauthtest.html', {
'link': '{}o/authorize/?response_type=code&client_id={}&redirect_uri={}{}/oauthdone/'.format(
settings.API_URL,
sett... |
68a1877bcd4511008aeff977cb45fa9edb5e9a8b | fusekiutils/__init__.py | fusekiutils/__init__.py | __author__ = 'adam'
import time
from subprocess import Popen
import shlex
import os
import urllib
def LaunchFuseki():
fuseki_url = "http://localhost:3030"
fuseki_dir = os.getcwd() + "/jena-fuseki"
fuseki_executable = fuseki_dir + "/fuseki-server"
f_log = open("fuseki.log","w")
fuseki = Popen( arg... | __author__ = 'adam'
import time
from subprocess import Popen
import shlex
import os
import urllib
import sys
def LaunchFuseki():
fuseki_dir = os.path.join(os.path.abspath(os.getcwd()), 'jena-fuseki')
if sys.platform == 'win32':
fuseki_executable = os.path.join(fuseki_dir, 'fuseki-server.bat')
els... | Support both windows and shell environments when launching fuseki | Support both windows and shell environments when launching fuseki
| Python | lgpl-2.1 | adamnagel/qudt-for-domain-tools,adamnagel/qudt-for-domain-tools,adamnagel/qudt-for-domain-tools | __author__ = 'adam'
import time
from subprocess import Popen
import shlex
import os
import urllib
def LaunchFuseki():
fuseki_url = "http://localhost:3030"
fuseki_dir = os.getcwd() + "/jena-fuseki"
fuseki_executable = fuseki_dir + "/fuseki-server"
f_log = open("fuseki.log","w")
fuseki = Popen( arg... | __author__ = 'adam'
import time
from subprocess import Popen
import shlex
import os
import urllib
import sys
def LaunchFuseki():
fuseki_dir = os.path.join(os.path.abspath(os.getcwd()), 'jena-fuseki')
if sys.platform == 'win32':
fuseki_executable = os.path.join(fuseki_dir, 'fuseki-server.bat')
els... | <commit_before>__author__ = 'adam'
import time
from subprocess import Popen
import shlex
import os
import urllib
def LaunchFuseki():
fuseki_url = "http://localhost:3030"
fuseki_dir = os.getcwd() + "/jena-fuseki"
fuseki_executable = fuseki_dir + "/fuseki-server"
f_log = open("fuseki.log","w")
fuse... | __author__ = 'adam'
import time
from subprocess import Popen
import shlex
import os
import urllib
import sys
def LaunchFuseki():
fuseki_dir = os.path.join(os.path.abspath(os.getcwd()), 'jena-fuseki')
if sys.platform == 'win32':
fuseki_executable = os.path.join(fuseki_dir, 'fuseki-server.bat')
els... | __author__ = 'adam'
import time
from subprocess import Popen
import shlex
import os
import urllib
def LaunchFuseki():
fuseki_url = "http://localhost:3030"
fuseki_dir = os.getcwd() + "/jena-fuseki"
fuseki_executable = fuseki_dir + "/fuseki-server"
f_log = open("fuseki.log","w")
fuseki = Popen( arg... | <commit_before>__author__ = 'adam'
import time
from subprocess import Popen
import shlex
import os
import urllib
def LaunchFuseki():
fuseki_url = "http://localhost:3030"
fuseki_dir = os.getcwd() + "/jena-fuseki"
fuseki_executable = fuseki_dir + "/fuseki-server"
f_log = open("fuseki.log","w")
fuse... |
94ff1527fb16c7a3557112f6e30cded4de99dda8 | fabtastic/fabric/commands/c_supervisord.py | fabtastic/fabric/commands/c_supervisord.py | from fabric.api import *
from fabtastic.fabric.util import _current_host_has_role
def supervisord_restart_all(roles='webapp_servers'):
"""
Restarts all of supervisord's managed programs.
"""
if _current_host_has_role(roles):
print("=== RESTARTING SUPERVISORD PROGRAMS ===")
with cd(env.R... | from fabric.api import *
from fabtastic.fabric.util import _current_host_has_role
def supervisord_restart_all(roles='webapp_servers'):
"""
Restarts all of supervisord's managed programs.
"""
if _current_host_has_role(roles):
print("=== RESTARTING SUPERVISORD PROGRAMS ===")
with cd(env.R... | Fix arg order for supervisord_restart_prog | Fix arg order for supervisord_restart_prog
| Python | bsd-3-clause | duointeractive/django-fabtastic | from fabric.api import *
from fabtastic.fabric.util import _current_host_has_role
def supervisord_restart_all(roles='webapp_servers'):
"""
Restarts all of supervisord's managed programs.
"""
if _current_host_has_role(roles):
print("=== RESTARTING SUPERVISORD PROGRAMS ===")
with cd(env.R... | from fabric.api import *
from fabtastic.fabric.util import _current_host_has_role
def supervisord_restart_all(roles='webapp_servers'):
"""
Restarts all of supervisord's managed programs.
"""
if _current_host_has_role(roles):
print("=== RESTARTING SUPERVISORD PROGRAMS ===")
with cd(env.R... | <commit_before>from fabric.api import *
from fabtastic.fabric.util import _current_host_has_role
def supervisord_restart_all(roles='webapp_servers'):
"""
Restarts all of supervisord's managed programs.
"""
if _current_host_has_role(roles):
print("=== RESTARTING SUPERVISORD PROGRAMS ===")
... | from fabric.api import *
from fabtastic.fabric.util import _current_host_has_role
def supervisord_restart_all(roles='webapp_servers'):
"""
Restarts all of supervisord's managed programs.
"""
if _current_host_has_role(roles):
print("=== RESTARTING SUPERVISORD PROGRAMS ===")
with cd(env.R... | from fabric.api import *
from fabtastic.fabric.util import _current_host_has_role
def supervisord_restart_all(roles='webapp_servers'):
"""
Restarts all of supervisord's managed programs.
"""
if _current_host_has_role(roles):
print("=== RESTARTING SUPERVISORD PROGRAMS ===")
with cd(env.R... | <commit_before>from fabric.api import *
from fabtastic.fabric.util import _current_host_has_role
def supervisord_restart_all(roles='webapp_servers'):
"""
Restarts all of supervisord's managed programs.
"""
if _current_host_has_role(roles):
print("=== RESTARTING SUPERVISORD PROGRAMS ===")
... |
2422e0eb14bc9ae0b79b88f9b02b7e9c7f6ee4fd | tests/window/window_util.py | tests/window/window_util.py | #!/usr/bin/python
# $Id:$
from pyglet.gl import *
def draw_client_border(window):
glClearColor(0, 0, 0, 1)
glClear(GL_COLOR_BUFFER_BIT)
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
glOrtho(0, window.width, 0, window.height, -1, 1)
glMatrixMode(GL_MODELVIEW)
glLoadIdentity()... | #!/usr/bin/python
# $Id:$
from pyglet.gl import *
def draw_client_border(window):
glClearColor(0, 0, 0, 1)
glClear(GL_COLOR_BUFFER_BIT)
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
glOrtho(0, window.width, 0, window.height, -1, 1)
glMatrixMode(GL_MODELVIEW)
glLoadIdentity()... | Fix window test border _again_ (more fixed). | Fix window test border _again_ (more fixed).
git-svn-id: d4fdfcd4de20a449196f78acc655f735742cd30d@1383 14d46d22-621c-0410-bb3d-6f67920f7d95
| Python | bsd-3-clause | regular/pyglet-avbin-optimizations,regular/pyglet-avbin-optimizations,regular/pyglet-avbin-optimizations,regular/pyglet-avbin-optimizations | #!/usr/bin/python
# $Id:$
from pyglet.gl import *
def draw_client_border(window):
glClearColor(0, 0, 0, 1)
glClear(GL_COLOR_BUFFER_BIT)
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
glOrtho(0, window.width, 0, window.height, -1, 1)
glMatrixMode(GL_MODELVIEW)
glLoadIdentity()... | #!/usr/bin/python
# $Id:$
from pyglet.gl import *
def draw_client_border(window):
glClearColor(0, 0, 0, 1)
glClear(GL_COLOR_BUFFER_BIT)
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
glOrtho(0, window.width, 0, window.height, -1, 1)
glMatrixMode(GL_MODELVIEW)
glLoadIdentity()... | <commit_before>#!/usr/bin/python
# $Id:$
from pyglet.gl import *
def draw_client_border(window):
glClearColor(0, 0, 0, 1)
glClear(GL_COLOR_BUFFER_BIT)
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
glOrtho(0, window.width, 0, window.height, -1, 1)
glMatrixMode(GL_MODELVIEW)
g... | #!/usr/bin/python
# $Id:$
from pyglet.gl import *
def draw_client_border(window):
glClearColor(0, 0, 0, 1)
glClear(GL_COLOR_BUFFER_BIT)
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
glOrtho(0, window.width, 0, window.height, -1, 1)
glMatrixMode(GL_MODELVIEW)
glLoadIdentity()... | #!/usr/bin/python
# $Id:$
from pyglet.gl import *
def draw_client_border(window):
glClearColor(0, 0, 0, 1)
glClear(GL_COLOR_BUFFER_BIT)
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
glOrtho(0, window.width, 0, window.height, -1, 1)
glMatrixMode(GL_MODELVIEW)
glLoadIdentity()... | <commit_before>#!/usr/bin/python
# $Id:$
from pyglet.gl import *
def draw_client_border(window):
glClearColor(0, 0, 0, 1)
glClear(GL_COLOR_BUFFER_BIT)
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
glOrtho(0, window.width, 0, window.height, -1, 1)
glMatrixMode(GL_MODELVIEW)
g... |
86008628f7bff187c956273fbf6f15376ab861d1 | src/sgeparse/query.py | src/sgeparse/query.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import subprocess as sp
from .parser import JobsParser
def get_jobs():
xml_text = fetch_xml()
parser = JobsParser(xml_text)
return parser.jobs
def fetch_xml(user=None):
cmd = ['qstat', '-xml']
if user is not None:
cmd.extend(['-u', user])
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import subprocess as sp
from .parser import JobsParser
def get_jobs(user=None):
xml_text = fetch_xml(user=user)
parser = JobsParser(xml_text)
return parser.jobs
def fetch_xml(user=None):
cmd = ['qstat', '-xml']
if user is not None:
cmd.exte... | Add user argument to get_jobs | Add user argument to get_jobs
| Python | mit | mindriot101/sgeparse | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import subprocess as sp
from .parser import JobsParser
def get_jobs():
xml_text = fetch_xml()
parser = JobsParser(xml_text)
return parser.jobs
def fetch_xml(user=None):
cmd = ['qstat', '-xml']
if user is not None:
cmd.extend(['-u', user])
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import subprocess as sp
from .parser import JobsParser
def get_jobs(user=None):
xml_text = fetch_xml(user=user)
parser = JobsParser(xml_text)
return parser.jobs
def fetch_xml(user=None):
cmd = ['qstat', '-xml']
if user is not None:
cmd.exte... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import subprocess as sp
from .parser import JobsParser
def get_jobs():
xml_text = fetch_xml()
parser = JobsParser(xml_text)
return parser.jobs
def fetch_xml(user=None):
cmd = ['qstat', '-xml']
if user is not None:
cmd.extend(... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import subprocess as sp
from .parser import JobsParser
def get_jobs(user=None):
xml_text = fetch_xml(user=user)
parser = JobsParser(xml_text)
return parser.jobs
def fetch_xml(user=None):
cmd = ['qstat', '-xml']
if user is not None:
cmd.exte... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import subprocess as sp
from .parser import JobsParser
def get_jobs():
xml_text = fetch_xml()
parser = JobsParser(xml_text)
return parser.jobs
def fetch_xml(user=None):
cmd = ['qstat', '-xml']
if user is not None:
cmd.extend(['-u', user])
... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import subprocess as sp
from .parser import JobsParser
def get_jobs():
xml_text = fetch_xml()
parser = JobsParser(xml_text)
return parser.jobs
def fetch_xml(user=None):
cmd = ['qstat', '-xml']
if user is not None:
cmd.extend(... |
43a209bd122329d5a70e5f0bdc2066e952676c6a | tests/unit/output/yaml_out_test.py | tests/unit/output/yaml_out_test.py | # -*- coding: utf-8 -*-
'''
unittests for yaml outputter
'''
# Import Python Libs
from __future__ import absolute_import
from StringIO import StringIO
import sys
# Import Salt Testing Libs
from salttesting import TestCase
from salttesting.helpers import ensure_in_syspath
ensure_in_syspath('../../')
# Import Salt Li... | # -*- coding: utf-8 -*-
'''
unittests for yaml outputter
'''
# Import Python Libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting import TestCase
from salttesting.helpers import ensure_in_syspath
ensure_in_syspath('../../')
# Import Salt Libs
from salt.output import yaml_out as ya... | Remove unused imports for lint | Remove unused imports for lint | Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | # -*- coding: utf-8 -*-
'''
unittests for yaml outputter
'''
# Import Python Libs
from __future__ import absolute_import
from StringIO import StringIO
import sys
# Import Salt Testing Libs
from salttesting import TestCase
from salttesting.helpers import ensure_in_syspath
ensure_in_syspath('../../')
# Import Salt Li... | # -*- coding: utf-8 -*-
'''
unittests for yaml outputter
'''
# Import Python Libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting import TestCase
from salttesting.helpers import ensure_in_syspath
ensure_in_syspath('../../')
# Import Salt Libs
from salt.output import yaml_out as ya... | <commit_before># -*- coding: utf-8 -*-
'''
unittests for yaml outputter
'''
# Import Python Libs
from __future__ import absolute_import
from StringIO import StringIO
import sys
# Import Salt Testing Libs
from salttesting import TestCase
from salttesting.helpers import ensure_in_syspath
ensure_in_syspath('../../')
#... | # -*- coding: utf-8 -*-
'''
unittests for yaml outputter
'''
# Import Python Libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting import TestCase
from salttesting.helpers import ensure_in_syspath
ensure_in_syspath('../../')
# Import Salt Libs
from salt.output import yaml_out as ya... | # -*- coding: utf-8 -*-
'''
unittests for yaml outputter
'''
# Import Python Libs
from __future__ import absolute_import
from StringIO import StringIO
import sys
# Import Salt Testing Libs
from salttesting import TestCase
from salttesting.helpers import ensure_in_syspath
ensure_in_syspath('../../')
# Import Salt Li... | <commit_before># -*- coding: utf-8 -*-
'''
unittests for yaml outputter
'''
# Import Python Libs
from __future__ import absolute_import
from StringIO import StringIO
import sys
# Import Salt Testing Libs
from salttesting import TestCase
from salttesting.helpers import ensure_in_syspath
ensure_in_syspath('../../')
#... |
b970f230864b40eaddb8e5faa76538c9f8e5c59c | txircd/modules/rfc/cmd_userhost.py | txircd/modules/rfc/cmd_userhost.py | from twisted.plugin import IPlugin
from twisted.words.protocols import irc
from txircd.module_interface import Command, ICommand, IModuleData, ModuleData
from zope.interface import implements
class UserhostCommand(ModuleData, Command):
implements(IPlugin, IModuleData, ICommand)
name = "UserhostCommand"
core = Tru... | from twisted.plugin import IPlugin
from twisted.words.protocols import irc
from txircd.module_interface import Command, ICommand, IModuleData, ModuleData
from zope.interface import implements
class UserhostCommand(ModuleData, Command):
implements(IPlugin, IModuleData, ICommand)
name = "UserhostCommand"
core = Tru... | Add affected users to userhasoperpermission call in USERHOST | Add affected users to userhasoperpermission call in USERHOST
| Python | bsd-3-clause | Heufneutje/txircd,ElementalAlchemist/txircd | from twisted.plugin import IPlugin
from twisted.words.protocols import irc
from txircd.module_interface import Command, ICommand, IModuleData, ModuleData
from zope.interface import implements
class UserhostCommand(ModuleData, Command):
implements(IPlugin, IModuleData, ICommand)
name = "UserhostCommand"
core = Tru... | from twisted.plugin import IPlugin
from twisted.words.protocols import irc
from txircd.module_interface import Command, ICommand, IModuleData, ModuleData
from zope.interface import implements
class UserhostCommand(ModuleData, Command):
implements(IPlugin, IModuleData, ICommand)
name = "UserhostCommand"
core = Tru... | <commit_before>from twisted.plugin import IPlugin
from twisted.words.protocols import irc
from txircd.module_interface import Command, ICommand, IModuleData, ModuleData
from zope.interface import implements
class UserhostCommand(ModuleData, Command):
implements(IPlugin, IModuleData, ICommand)
name = "UserhostComma... | from twisted.plugin import IPlugin
from twisted.words.protocols import irc
from txircd.module_interface import Command, ICommand, IModuleData, ModuleData
from zope.interface import implements
class UserhostCommand(ModuleData, Command):
implements(IPlugin, IModuleData, ICommand)
name = "UserhostCommand"
core = Tru... | from twisted.plugin import IPlugin
from twisted.words.protocols import irc
from txircd.module_interface import Command, ICommand, IModuleData, ModuleData
from zope.interface import implements
class UserhostCommand(ModuleData, Command):
implements(IPlugin, IModuleData, ICommand)
name = "UserhostCommand"
core = Tru... | <commit_before>from twisted.plugin import IPlugin
from twisted.words.protocols import irc
from txircd.module_interface import Command, ICommand, IModuleData, ModuleData
from zope.interface import implements
class UserhostCommand(ModuleData, Command):
implements(IPlugin, IModuleData, ICommand)
name = "UserhostComma... |
4c58426a88ba056841b1d1b44536f2f85de120cc | pythonx/completers/javascript/__init__.py | pythonx/completers/javascript/__init__.py | # -*- coding: utf-8 -*-
import json
import os.path
import re
from completor import Completor
from completor.compat import to_unicode
dirname = os.path.dirname(__file__)
class Tern(Completor):
filetype = 'javascript'
daemon = True
ident = re.compile(r"""(\w+)|(('|").+)""", re.U)
trigger = r"""\w+$|[... | # -*- coding: utf-8 -*-
import json
import os.path
import re
from completor import Completor
from completor.compat import to_unicode
dirname = os.path.dirname(__file__)
class Tern(Completor):
filetype = 'javascript'
daemon = True
ident = re.compile(r"""(\w+)|(["'][^"']*)""", re.U)
trigger = r"""\w+... | Fix regex for tern complete_strings plugin | Fix regex for tern complete_strings plugin
| Python | mit | maralla/completor.vim,maralla/completor.vim | # -*- coding: utf-8 -*-
import json
import os.path
import re
from completor import Completor
from completor.compat import to_unicode
dirname = os.path.dirname(__file__)
class Tern(Completor):
filetype = 'javascript'
daemon = True
ident = re.compile(r"""(\w+)|(('|").+)""", re.U)
trigger = r"""\w+$|[... | # -*- coding: utf-8 -*-
import json
import os.path
import re
from completor import Completor
from completor.compat import to_unicode
dirname = os.path.dirname(__file__)
class Tern(Completor):
filetype = 'javascript'
daemon = True
ident = re.compile(r"""(\w+)|(["'][^"']*)""", re.U)
trigger = r"""\w+... | <commit_before># -*- coding: utf-8 -*-
import json
import os.path
import re
from completor import Completor
from completor.compat import to_unicode
dirname = os.path.dirname(__file__)
class Tern(Completor):
filetype = 'javascript'
daemon = True
ident = re.compile(r"""(\w+)|(('|").+)""", re.U)
trigg... | # -*- coding: utf-8 -*-
import json
import os.path
import re
from completor import Completor
from completor.compat import to_unicode
dirname = os.path.dirname(__file__)
class Tern(Completor):
filetype = 'javascript'
daemon = True
ident = re.compile(r"""(\w+)|(["'][^"']*)""", re.U)
trigger = r"""\w+... | # -*- coding: utf-8 -*-
import json
import os.path
import re
from completor import Completor
from completor.compat import to_unicode
dirname = os.path.dirname(__file__)
class Tern(Completor):
filetype = 'javascript'
daemon = True
ident = re.compile(r"""(\w+)|(('|").+)""", re.U)
trigger = r"""\w+$|[... | <commit_before># -*- coding: utf-8 -*-
import json
import os.path
import re
from completor import Completor
from completor.compat import to_unicode
dirname = os.path.dirname(__file__)
class Tern(Completor):
filetype = 'javascript'
daemon = True
ident = re.compile(r"""(\w+)|(('|").+)""", re.U)
trigg... |
2890660ee3e87eb9af2c81caac0dc3131a264310 | app.py | app.py | from flask import Flask
from flask import jsonify
from red_api import get_suspect_mentions, get_tweet_count, get_suspect_tweets
from jsonp_flask import support_jsonp
app = Flask(__name__)
@app.route('/api/tweets/suspects/count', methods=['GET'])
@support_jsonp
def get_mentions():
return jsonify(results=get_suspec... | from flask import Flask
from flask import jsonify
from red_api import get_suspect_mentions, get_tweet_count, get_suspect_tweets
from jsonp_flask import support_jsonp
app = Flask(__name__)
@app.route('/api/tweets/suspects/count', methods=['GET'])
@support_jsonp
def get_mentions():
return jsonify(results=get_suspec... | Make sure the limit is an int | Make sure the limit is an int
| Python | mit | AnSavvides/redjohn,AnSavvides/redjohn | from flask import Flask
from flask import jsonify
from red_api import get_suspect_mentions, get_tweet_count, get_suspect_tweets
from jsonp_flask import support_jsonp
app = Flask(__name__)
@app.route('/api/tweets/suspects/count', methods=['GET'])
@support_jsonp
def get_mentions():
return jsonify(results=get_suspec... | from flask import Flask
from flask import jsonify
from red_api import get_suspect_mentions, get_tweet_count, get_suspect_tweets
from jsonp_flask import support_jsonp
app = Flask(__name__)
@app.route('/api/tweets/suspects/count', methods=['GET'])
@support_jsonp
def get_mentions():
return jsonify(results=get_suspec... | <commit_before>from flask import Flask
from flask import jsonify
from red_api import get_suspect_mentions, get_tweet_count, get_suspect_tweets
from jsonp_flask import support_jsonp
app = Flask(__name__)
@app.route('/api/tweets/suspects/count', methods=['GET'])
@support_jsonp
def get_mentions():
return jsonify(res... | from flask import Flask
from flask import jsonify
from red_api import get_suspect_mentions, get_tweet_count, get_suspect_tweets
from jsonp_flask import support_jsonp
app = Flask(__name__)
@app.route('/api/tweets/suspects/count', methods=['GET'])
@support_jsonp
def get_mentions():
return jsonify(results=get_suspec... | from flask import Flask
from flask import jsonify
from red_api import get_suspect_mentions, get_tweet_count, get_suspect_tweets
from jsonp_flask import support_jsonp
app = Flask(__name__)
@app.route('/api/tweets/suspects/count', methods=['GET'])
@support_jsonp
def get_mentions():
return jsonify(results=get_suspec... | <commit_before>from flask import Flask
from flask import jsonify
from red_api import get_suspect_mentions, get_tweet_count, get_suspect_tweets
from jsonp_flask import support_jsonp
app = Flask(__name__)
@app.route('/api/tweets/suspects/count', methods=['GET'])
@support_jsonp
def get_mentions():
return jsonify(res... |
7ac8ae993a30ce6ea221e2474df4a8eb7eada1ef | scrapy/trunk/scrapy/conf/core_settings.py | scrapy/trunk/scrapy/conf/core_settings.py | import scrapy
# Scrapy core settings
BOT_NAME = 'scrapy'
BOT_VERSION = scrapy.__version__
ENGINE_DEBUG = False
# Download configuration options
USER_AGENT = '%s/%s' % (BOT_NAME, BOT_VERSION)
DOWNLOAD_TIMEOUT = 180 # 3mins
CONCURRENT_DOMAINS = 8 # number of domains to scrape in parallel
REQUESTS_PER_DOMAIN = ... | import scrapy
# Scrapy core settings
BOT_NAME = 'scrapy'
BOT_VERSION = scrapy.__version__
ENGINE_DEBUG = False
# Download configuration options
USER_AGENT = '%s/%s' % (BOT_NAME, BOT_VERSION)
DOWNLOAD_TIMEOUT = 180 # 3mins
CONCURRENT_DOMAINS = 8 # number of domains to scrape in parallel
REQUESTS_PER_DOMAIN = ... | Revert "add 505 and 403 to retry status codes due to amazon s3 random fails while uploading images" | Revert "add 505 and 403 to retry status codes due to amazon s3 random fails while uploading images"
This reverts changeset r457
--HG--
extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%40461
| Python | bsd-3-clause | AaronTao1990/scrapy,yidongliu/scrapy,ArturGaspar/scrapy,tagatac/scrapy,URXtech/scrapy,olafdietsche/scrapy,w495/scrapy,agusc/scrapy,Preetwinder/scrapy,foromer4/scrapy,zorojean/scrapy,xiao26/scrapy,kmike/scrapy,w495/scrapy,ENjOyAbLE1991/scrapy,Digenis/scrapy,haiiiiiyun/scrapy,eLRuLL/scrapy,wujuguang/scrapy,scrapy/scrapy,... | import scrapy
# Scrapy core settings
BOT_NAME = 'scrapy'
BOT_VERSION = scrapy.__version__
ENGINE_DEBUG = False
# Download configuration options
USER_AGENT = '%s/%s' % (BOT_NAME, BOT_VERSION)
DOWNLOAD_TIMEOUT = 180 # 3mins
CONCURRENT_DOMAINS = 8 # number of domains to scrape in parallel
REQUESTS_PER_DOMAIN = ... | import scrapy
# Scrapy core settings
BOT_NAME = 'scrapy'
BOT_VERSION = scrapy.__version__
ENGINE_DEBUG = False
# Download configuration options
USER_AGENT = '%s/%s' % (BOT_NAME, BOT_VERSION)
DOWNLOAD_TIMEOUT = 180 # 3mins
CONCURRENT_DOMAINS = 8 # number of domains to scrape in parallel
REQUESTS_PER_DOMAIN = ... | <commit_before>import scrapy
# Scrapy core settings
BOT_NAME = 'scrapy'
BOT_VERSION = scrapy.__version__
ENGINE_DEBUG = False
# Download configuration options
USER_AGENT = '%s/%s' % (BOT_NAME, BOT_VERSION)
DOWNLOAD_TIMEOUT = 180 # 3mins
CONCURRENT_DOMAINS = 8 # number of domains to scrape in parallel
REQUEST... | import scrapy
# Scrapy core settings
BOT_NAME = 'scrapy'
BOT_VERSION = scrapy.__version__
ENGINE_DEBUG = False
# Download configuration options
USER_AGENT = '%s/%s' % (BOT_NAME, BOT_VERSION)
DOWNLOAD_TIMEOUT = 180 # 3mins
CONCURRENT_DOMAINS = 8 # number of domains to scrape in parallel
REQUESTS_PER_DOMAIN = ... | import scrapy
# Scrapy core settings
BOT_NAME = 'scrapy'
BOT_VERSION = scrapy.__version__
ENGINE_DEBUG = False
# Download configuration options
USER_AGENT = '%s/%s' % (BOT_NAME, BOT_VERSION)
DOWNLOAD_TIMEOUT = 180 # 3mins
CONCURRENT_DOMAINS = 8 # number of domains to scrape in parallel
REQUESTS_PER_DOMAIN = ... | <commit_before>import scrapy
# Scrapy core settings
BOT_NAME = 'scrapy'
BOT_VERSION = scrapy.__version__
ENGINE_DEBUG = False
# Download configuration options
USER_AGENT = '%s/%s' % (BOT_NAME, BOT_VERSION)
DOWNLOAD_TIMEOUT = 180 # 3mins
CONCURRENT_DOMAINS = 8 # number of domains to scrape in parallel
REQUEST... |
bad65df528da18293d38b0f50dbbb16390af465e | sphinx/source/docs/user_guide/source_examples/plotting_label.py | sphinx/source/docs/user_guide/source_examples/plotting_label.py | from bokeh.plotting import figure, show, output_file
from bokeh.models import ColumnDataSource, Range1d, Label
output_file("label.html", title="label.py example")
source = ColumnDataSource(data=dict(height=[66, 71, 72, 68, 58, 62],
weight=[165, 189, 220, 141, 260, 174],
... | from bokeh.plotting import figure, show, output_file
from bokeh.models import ColumnDataSource, Range1d, Label
output_file("label.html", title="label.py example")
source = ColumnDataSource(data=dict(height=[66, 71, 72, 68, 58, 62],
weight=[165, 189, 220, 141, 260, 174],
... | Include example of css render_mode | Include example of css render_mode
| Python | bsd-3-clause | clairetang6/bokeh,Karel-van-de-Plassche/bokeh,mindriot101/bokeh,aiguofer/bokeh,rs2/bokeh,Karel-van-de-Plassche/bokeh,KasperPRasmussen/bokeh,dennisobrien/bokeh,draperjames/bokeh,bokeh/bokeh,quasiben/bokeh,KasperPRasmussen/bokeh,philippjfr/bokeh,stonebig/bokeh,justacec/bokeh,KasperPRasmussen/bokeh,phobson/bokeh,phobson/b... | from bokeh.plotting import figure, show, output_file
from bokeh.models import ColumnDataSource, Range1d, Label
output_file("label.html", title="label.py example")
source = ColumnDataSource(data=dict(height=[66, 71, 72, 68, 58, 62],
weight=[165, 189, 220, 141, 260, 174],
... | from bokeh.plotting import figure, show, output_file
from bokeh.models import ColumnDataSource, Range1d, Label
output_file("label.html", title="label.py example")
source = ColumnDataSource(data=dict(height=[66, 71, 72, 68, 58, 62],
weight=[165, 189, 220, 141, 260, 174],
... | <commit_before>from bokeh.plotting import figure, show, output_file
from bokeh.models import ColumnDataSource, Range1d, Label
output_file("label.html", title="label.py example")
source = ColumnDataSource(data=dict(height=[66, 71, 72, 68, 58, 62],
weight=[165, 189, 220, 141, 260, 17... | from bokeh.plotting import figure, show, output_file
from bokeh.models import ColumnDataSource, Range1d, Label
output_file("label.html", title="label.py example")
source = ColumnDataSource(data=dict(height=[66, 71, 72, 68, 58, 62],
weight=[165, 189, 220, 141, 260, 174],
... | from bokeh.plotting import figure, show, output_file
from bokeh.models import ColumnDataSource, Range1d, Label
output_file("label.html", title="label.py example")
source = ColumnDataSource(data=dict(height=[66, 71, 72, 68, 58, 62],
weight=[165, 189, 220, 141, 260, 174],
... | <commit_before>from bokeh.plotting import figure, show, output_file
from bokeh.models import ColumnDataSource, Range1d, Label
output_file("label.html", title="label.py example")
source = ColumnDataSource(data=dict(height=[66, 71, 72, 68, 58, 62],
weight=[165, 189, 220, 141, 260, 17... |
c6cdf543f6bfd0049594eeb530551371bf21bae4 | test/test_scraping.py | test/test_scraping.py | from datetime import datetime
import sys
import unittest
import btceapi
class TestScraping(unittest.TestCase):
def test_scrape_main_page(self):
mainPage = btceapi.scrapeMainPage()
for message in mainPage.messages:
msgId, user, time, text = message
self.assertIs(type(time),... | from datetime import datetime
import sys
import unittest
import btceapi
class TestScraping(unittest.TestCase):
def test_scrape_main_page(self):
mainPage = btceapi.scrapeMainPage()
for message in mainPage.messages:
msgId, user, time, text = message
assert type(time) is date... | Fix for assertIs method not being present in Python 2.6. | Fix for assertIs method not being present in Python 2.6.
| Python | mit | lromanov/tidex-api,CodeReclaimers/btce-api,alanmcintyre/btce-api | from datetime import datetime
import sys
import unittest
import btceapi
class TestScraping(unittest.TestCase):
def test_scrape_main_page(self):
mainPage = btceapi.scrapeMainPage()
for message in mainPage.messages:
msgId, user, time, text = message
self.assertIs(type(time),... | from datetime import datetime
import sys
import unittest
import btceapi
class TestScraping(unittest.TestCase):
def test_scrape_main_page(self):
mainPage = btceapi.scrapeMainPage()
for message in mainPage.messages:
msgId, user, time, text = message
assert type(time) is date... | <commit_before>from datetime import datetime
import sys
import unittest
import btceapi
class TestScraping(unittest.TestCase):
def test_scrape_main_page(self):
mainPage = btceapi.scrapeMainPage()
for message in mainPage.messages:
msgId, user, time, text = message
self.asser... | from datetime import datetime
import sys
import unittest
import btceapi
class TestScraping(unittest.TestCase):
def test_scrape_main_page(self):
mainPage = btceapi.scrapeMainPage()
for message in mainPage.messages:
msgId, user, time, text = message
assert type(time) is date... | from datetime import datetime
import sys
import unittest
import btceapi
class TestScraping(unittest.TestCase):
def test_scrape_main_page(self):
mainPage = btceapi.scrapeMainPage()
for message in mainPage.messages:
msgId, user, time, text = message
self.assertIs(type(time),... | <commit_before>from datetime import datetime
import sys
import unittest
import btceapi
class TestScraping(unittest.TestCase):
def test_scrape_main_page(self):
mainPage = btceapi.scrapeMainPage()
for message in mainPage.messages:
msgId, user, time, text = message
self.asser... |
96076567bac3329cba55b61c59781c7670c7a02b | anybox/recipe/odoo/runtime/patch_odoo.py | anybox/recipe/odoo/runtime/patch_odoo.py | """Necessary monkey patches to make Odoo work in the buildout context.
"""
import subprocess
def do_patch(gevent_script_path):
"""
Patch odoo prefork so that --workers execute the correct gevent script.
This monkey patch could be safer, if the script path determination could be
isolated from the act... | """Necessary monkey patches to make Odoo work in the buildout context.
"""
import subprocess
def do_patch(gevent_script_path):
"""
Patch odoo prefork so that --workers execute the correct gevent script.
This monkey patch could be safer, if the script path determination could be
isolated from the act... | Maintain compatilbility with <10 version | Maintain compatilbility with <10 version | Python | agpl-3.0 | anybox/anybox.recipe.odoo | """Necessary monkey patches to make Odoo work in the buildout context.
"""
import subprocess
def do_patch(gevent_script_path):
"""
Patch odoo prefork so that --workers execute the correct gevent script.
This monkey patch could be safer, if the script path determination could be
isolated from the act... | """Necessary monkey patches to make Odoo work in the buildout context.
"""
import subprocess
def do_patch(gevent_script_path):
"""
Patch odoo prefork so that --workers execute the correct gevent script.
This monkey patch could be safer, if the script path determination could be
isolated from the act... | <commit_before>"""Necessary monkey patches to make Odoo work in the buildout context.
"""
import subprocess
def do_patch(gevent_script_path):
"""
Patch odoo prefork so that --workers execute the correct gevent script.
This monkey patch could be safer, if the script path determination could be
isolat... | """Necessary monkey patches to make Odoo work in the buildout context.
"""
import subprocess
def do_patch(gevent_script_path):
"""
Patch odoo prefork so that --workers execute the correct gevent script.
This monkey patch could be safer, if the script path determination could be
isolated from the act... | """Necessary monkey patches to make Odoo work in the buildout context.
"""
import subprocess
def do_patch(gevent_script_path):
"""
Patch odoo prefork so that --workers execute the correct gevent script.
This monkey patch could be safer, if the script path determination could be
isolated from the act... | <commit_before>"""Necessary monkey patches to make Odoo work in the buildout context.
"""
import subprocess
def do_patch(gevent_script_path):
"""
Patch odoo prefork so that --workers execute the correct gevent script.
This monkey patch could be safer, if the script path determination could be
isolat... |
3cc3c0b90714bbf7a2638b16faec69aba82a4050 | op_robot_tests/tests_files/brokers/openprocurement_client_helper.py | op_robot_tests/tests_files/brokers/openprocurement_client_helper.py | from openprocurement_client.client import Client
import sys
def prepare_api_wrapper(key='', host_url="https://api-sandbox.openprocurement.org", api_version='0.8' ):
return Client(key, host_url, api_version )
def get_internal_id(get_tenders_function, date):
result = get_tenders_function({"offset": date, "opt_fiel... | from openprocurement_client.client import Client
import sys
def prepare_api_wrapper(key='', host_url="https://api-sandbox.openprocurement.org", api_version='0.8'):
return Client(key, host_url, api_version)
def get_internal_id(get_tenders_function, date):
result = get_tenders_function({"offset": date, "opt_f... | Improve PEP8 compliance in op_client_helper.py | Improve PEP8 compliance in op_client_helper.py
| Python | apache-2.0 | SlaOne/robot_tests,kosaniak/robot_tests,selurvedu/robot_tests,Leits/robot_tests,cleardevice/robot_tests,VadimShurhal/robot_tests.broker.aps,mykhaly/robot_tests,Rzaporozhets/robot_tests,bubanoid/robot_tests,openprocurement/robot_tests | from openprocurement_client.client import Client
import sys
def prepare_api_wrapper(key='', host_url="https://api-sandbox.openprocurement.org", api_version='0.8' ):
return Client(key, host_url, api_version )
def get_internal_id(get_tenders_function, date):
result = get_tenders_function({"offset": date, "opt_fiel... | from openprocurement_client.client import Client
import sys
def prepare_api_wrapper(key='', host_url="https://api-sandbox.openprocurement.org", api_version='0.8'):
return Client(key, host_url, api_version)
def get_internal_id(get_tenders_function, date):
result = get_tenders_function({"offset": date, "opt_f... | <commit_before>from openprocurement_client.client import Client
import sys
def prepare_api_wrapper(key='', host_url="https://api-sandbox.openprocurement.org", api_version='0.8' ):
return Client(key, host_url, api_version )
def get_internal_id(get_tenders_function, date):
result = get_tenders_function({"offset": ... | from openprocurement_client.client import Client
import sys
def prepare_api_wrapper(key='', host_url="https://api-sandbox.openprocurement.org", api_version='0.8'):
return Client(key, host_url, api_version)
def get_internal_id(get_tenders_function, date):
result = get_tenders_function({"offset": date, "opt_f... | from openprocurement_client.client import Client
import sys
def prepare_api_wrapper(key='', host_url="https://api-sandbox.openprocurement.org", api_version='0.8' ):
return Client(key, host_url, api_version )
def get_internal_id(get_tenders_function, date):
result = get_tenders_function({"offset": date, "opt_fiel... | <commit_before>from openprocurement_client.client import Client
import sys
def prepare_api_wrapper(key='', host_url="https://api-sandbox.openprocurement.org", api_version='0.8' ):
return Client(key, host_url, api_version )
def get_internal_id(get_tenders_function, date):
result = get_tenders_function({"offset": ... |
27c54cfd5eaf180595e671c80bd7c39406c8a24c | databroker/__init__.py | databroker/__init__.py | # Import intake to run driver discovery first and avoid circular import issues.
import intake
del intake
import warnings
import logging
logger = logging.getLogger(__name__)
from ._core import (Broker, BrokerES, Header, ALL,
lookup_config, list_configs, describe_configs, temp_config,
... | # Import intake to run driver discovery first and avoid circular import issues.
import intake
del intake
import warnings
import logging
logger = logging.getLogger(__name__)
from .v1 import Broker, Header, ALL, temp, temp_config
from .utils import (lookup_config, list_configs, describe_configs,
... | Move top-level imports from v0 to v1. | Move top-level imports from v0 to v1.
| Python | bsd-3-clause | ericdill/databroker,ericdill/databroker | # Import intake to run driver discovery first and avoid circular import issues.
import intake
del intake
import warnings
import logging
logger = logging.getLogger(__name__)
from ._core import (Broker, BrokerES, Header, ALL,
lookup_config, list_configs, describe_configs, temp_config,
... | # Import intake to run driver discovery first and avoid circular import issues.
import intake
del intake
import warnings
import logging
logger = logging.getLogger(__name__)
from .v1 import Broker, Header, ALL, temp, temp_config
from .utils import (lookup_config, list_configs, describe_configs,
... | <commit_before># Import intake to run driver discovery first and avoid circular import issues.
import intake
del intake
import warnings
import logging
logger = logging.getLogger(__name__)
from ._core import (Broker, BrokerES, Header, ALL,
lookup_config, list_configs, describe_configs, temp_conf... | # Import intake to run driver discovery first and avoid circular import issues.
import intake
del intake
import warnings
import logging
logger = logging.getLogger(__name__)
from .v1 import Broker, Header, ALL, temp, temp_config
from .utils import (lookup_config, list_configs, describe_configs,
... | # Import intake to run driver discovery first and avoid circular import issues.
import intake
del intake
import warnings
import logging
logger = logging.getLogger(__name__)
from ._core import (Broker, BrokerES, Header, ALL,
lookup_config, list_configs, describe_configs, temp_config,
... | <commit_before># Import intake to run driver discovery first and avoid circular import issues.
import intake
del intake
import warnings
import logging
logger = logging.getLogger(__name__)
from ._core import (Broker, BrokerES, Header, ALL,
lookup_config, list_configs, describe_configs, temp_conf... |
09f86488096880870bbd3363e0a4c018f11e935d | lingcod/layers/urls.py | lingcod/layers/urls.py | from django.conf.urls.defaults import *
urlpatterns = patterns('lingcod.layers.views',
url(r'^public/',
'get_public_layers',
name='public-data-layers'),
url(r'^kml_file/(?P<session_key>\w+)/(?P<uid>[\w_]+).kml',
'get_kml_file',
name='kml-file'),
url(r'^privatekml/(?P<se... | from django.conf.urls.defaults import *
import time
urlpatterns = patterns('lingcod.layers.views',
url(r'^public/$',
'get_public_layers',
name='public-data-layers'),
# Useful for debugging, avoids GE caching interference
url(r'^public/cachebuster/%s' % str(time.time()),
'get_pu... | Add another url pattern for debugging public layers | Add another url pattern for debugging public layers
| Python | bsd-3-clause | Alwnikrotikz/marinemap,google-code-export/marinemap,Alwnikrotikz/marinemap,google-code-export/marinemap,Alwnikrotikz/marinemap,google-code-export/marinemap,google-code-export/marinemap,Alwnikrotikz/marinemap | from django.conf.urls.defaults import *
urlpatterns = patterns('lingcod.layers.views',
url(r'^public/',
'get_public_layers',
name='public-data-layers'),
url(r'^kml_file/(?P<session_key>\w+)/(?P<uid>[\w_]+).kml',
'get_kml_file',
name='kml-file'),
url(r'^privatekml/(?P<se... | from django.conf.urls.defaults import *
import time
urlpatterns = patterns('lingcod.layers.views',
url(r'^public/$',
'get_public_layers',
name='public-data-layers'),
# Useful for debugging, avoids GE caching interference
url(r'^public/cachebuster/%s' % str(time.time()),
'get_pu... | <commit_before>from django.conf.urls.defaults import *
urlpatterns = patterns('lingcod.layers.views',
url(r'^public/',
'get_public_layers',
name='public-data-layers'),
url(r'^kml_file/(?P<session_key>\w+)/(?P<uid>[\w_]+).kml',
'get_kml_file',
name='kml-file'),
url(r'^pr... | from django.conf.urls.defaults import *
import time
urlpatterns = patterns('lingcod.layers.views',
url(r'^public/$',
'get_public_layers',
name='public-data-layers'),
# Useful for debugging, avoids GE caching interference
url(r'^public/cachebuster/%s' % str(time.time()),
'get_pu... | from django.conf.urls.defaults import *
urlpatterns = patterns('lingcod.layers.views',
url(r'^public/',
'get_public_layers',
name='public-data-layers'),
url(r'^kml_file/(?P<session_key>\w+)/(?P<uid>[\w_]+).kml',
'get_kml_file',
name='kml-file'),
url(r'^privatekml/(?P<se... | <commit_before>from django.conf.urls.defaults import *
urlpatterns = patterns('lingcod.layers.views',
url(r'^public/',
'get_public_layers',
name='public-data-layers'),
url(r'^kml_file/(?P<session_key>\w+)/(?P<uid>[\w_]+).kml',
'get_kml_file',
name='kml-file'),
url(r'^pr... |
a2e7642034bf89bf1d7d513ef155da3375482373 | virtool/user_permissions.py | virtool/user_permissions.py | #: A list of the permission strings used by Virtool.
PERMISSIONS = [
"add_virus",
"modify_virus",
"remove_virus",
"modify_hmm",
"add_sample",
"add_host",
"remove_host",
"cancel_job",
"remove_job",
"archive_job",
"rebuild_index",
"modify_options",
"manage_users"
]
| #: A list of the permission strings used by Virtool.
PERMISSIONS = [
"add_virus",
"modify_virus",
"remove_virus",
"modify_hmm",
"create_sample",
"add_host",
"remove_host",
"cancel_job",
"remove_job",
"archive_job",
"rebuild_index",
"modify_options",
"manage_users"
]
| Change 'add_sample' permission to 'create_sample' | Change 'add_sample' permission to 'create_sample'
| Python | mit | igboyes/virtool,igboyes/virtool,virtool/virtool,virtool/virtool | #: A list of the permission strings used by Virtool.
PERMISSIONS = [
"add_virus",
"modify_virus",
"remove_virus",
"modify_hmm",
"add_sample",
"add_host",
"remove_host",
"cancel_job",
"remove_job",
"archive_job",
"rebuild_index",
"modify_options",
"manage_users"
]
Chan... | #: A list of the permission strings used by Virtool.
PERMISSIONS = [
"add_virus",
"modify_virus",
"remove_virus",
"modify_hmm",
"create_sample",
"add_host",
"remove_host",
"cancel_job",
"remove_job",
"archive_job",
"rebuild_index",
"modify_options",
"manage_users"
]
| <commit_before>#: A list of the permission strings used by Virtool.
PERMISSIONS = [
"add_virus",
"modify_virus",
"remove_virus",
"modify_hmm",
"add_sample",
"add_host",
"remove_host",
"cancel_job",
"remove_job",
"archive_job",
"rebuild_index",
"modify_options",
"manag... | #: A list of the permission strings used by Virtool.
PERMISSIONS = [
"add_virus",
"modify_virus",
"remove_virus",
"modify_hmm",
"create_sample",
"add_host",
"remove_host",
"cancel_job",
"remove_job",
"archive_job",
"rebuild_index",
"modify_options",
"manage_users"
]
| #: A list of the permission strings used by Virtool.
PERMISSIONS = [
"add_virus",
"modify_virus",
"remove_virus",
"modify_hmm",
"add_sample",
"add_host",
"remove_host",
"cancel_job",
"remove_job",
"archive_job",
"rebuild_index",
"modify_options",
"manage_users"
]
Chan... | <commit_before>#: A list of the permission strings used by Virtool.
PERMISSIONS = [
"add_virus",
"modify_virus",
"remove_virus",
"modify_hmm",
"add_sample",
"add_host",
"remove_host",
"cancel_job",
"remove_job",
"archive_job",
"rebuild_index",
"modify_options",
"manag... |
685116d1a2799399819ed780679403e7576e67b5 | keystone/tests/unit/common/test_manager.py | keystone/tests/unit/common/test_manager.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | Correct test to support changing N release name | Correct test to support changing N release name
oslo.log is going to change to use Newton rather than N so this test
should not make an assumption about the way that
versionutils.deprecated is calling report_deprecated_feature.
Change-Id: I06aa6d085232376811f73597b2d84b5174bc7a8d
Closes-Bug: 1561121
(cherry picked fr... | Python | apache-2.0 | openstack/keystone,openstack/keystone,cernops/keystone,klmitch/keystone,mahak/keystone,mahak/keystone,rajalokan/keystone,ilay09/keystone,openstack/keystone,ilay09/keystone,ilay09/keystone,cernops/keystone,klmitch/keystone,mahak/keystone,rajalokan/keystone,rajalokan/keystone | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | <commit_before># Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# dist... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | <commit_before># Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# dist... |
74bd9ffd412f22671232cb301b3762660a73d912 | lot/landmapper/urls.py | lot/landmapper/urls.py | from django.urls import include, re_path, path
from landmapper.views import *
urlpatterns = [
# What is difference between re_path and path?
# re_path(r'',
# home, name='landmapper-home'),
path('', home, name="home"),
path('/identify/', identify, name="identify"),
path('/report/', report, n... | from django.urls import include, re_path, path
from landmapper.views import *
urlpatterns = [
# What is difference between re_path and path?
# re_path(r'',
# home, name='landmapper-home'),
path('', home, name="home"),
path('/identify', identify, name="identify"),
path('/report', report, nam... | Fix get taxlot url and remove trailing slashes | Fix get taxlot url and remove trailing slashes
| Python | bsd-3-clause | Ecotrust/forestplanner,Ecotrust/forestplanner,Ecotrust/forestplanner,Ecotrust/forestplanner,Ecotrust/forestplanner,Ecotrust/forestplanner,Ecotrust/forestplanner,Ecotrust/forestplanner | from django.urls import include, re_path, path
from landmapper.views import *
urlpatterns = [
# What is difference between re_path and path?
# re_path(r'',
# home, name='landmapper-home'),
path('', home, name="home"),
path('/identify/', identify, name="identify"),
path('/report/', report, n... | from django.urls import include, re_path, path
from landmapper.views import *
urlpatterns = [
# What is difference between re_path and path?
# re_path(r'',
# home, name='landmapper-home'),
path('', home, name="home"),
path('/identify', identify, name="identify"),
path('/report', report, nam... | <commit_before>from django.urls import include, re_path, path
from landmapper.views import *
urlpatterns = [
# What is difference between re_path and path?
# re_path(r'',
# home, name='landmapper-home'),
path('', home, name="home"),
path('/identify/', identify, name="identify"),
path('/repo... | from django.urls import include, re_path, path
from landmapper.views import *
urlpatterns = [
# What is difference between re_path and path?
# re_path(r'',
# home, name='landmapper-home'),
path('', home, name="home"),
path('/identify', identify, name="identify"),
path('/report', report, nam... | from django.urls import include, re_path, path
from landmapper.views import *
urlpatterns = [
# What is difference between re_path and path?
# re_path(r'',
# home, name='landmapper-home'),
path('', home, name="home"),
path('/identify/', identify, name="identify"),
path('/report/', report, n... | <commit_before>from django.urls import include, re_path, path
from landmapper.views import *
urlpatterns = [
# What is difference between re_path and path?
# re_path(r'',
# home, name='landmapper-home'),
path('', home, name="home"),
path('/identify/', identify, name="identify"),
path('/repo... |
789b33f8c6d4ddad4c46e7a3815d9f9543485caa | usb/blueprints/api.py | usb/blueprints/api.py | from flask import Blueprint, jsonify, request
from usb.models import db, Redirect, DeviceType
from usb.shortener import get_short_id, get_short_url
api = Blueprint('api', __name__)
@api.route('/links')
def get_links():
return jsonify({}), 200
@api.route('/links', methods=['POST'])
def shorten_url():
short... | from flask import Blueprint, jsonify, request
from usb.models import db, Redirect, DeviceType
from usb.shortener import get_short_id, get_short_url
api = Blueprint('api', __name__)
@api.route('/links')
def get_links():
return jsonify({}), 200
@api.route('/links', methods=['POST'])
def shorten_url():
short... | Return short URL if it's already exists | Return short URL if it's already exists
| Python | mit | dizpers/usb | from flask import Blueprint, jsonify, request
from usb.models import db, Redirect, DeviceType
from usb.shortener import get_short_id, get_short_url
api = Blueprint('api', __name__)
@api.route('/links')
def get_links():
return jsonify({}), 200
@api.route('/links', methods=['POST'])
def shorten_url():
short... | from flask import Blueprint, jsonify, request
from usb.models import db, Redirect, DeviceType
from usb.shortener import get_short_id, get_short_url
api = Blueprint('api', __name__)
@api.route('/links')
def get_links():
return jsonify({}), 200
@api.route('/links', methods=['POST'])
def shorten_url():
short... | <commit_before>from flask import Blueprint, jsonify, request
from usb.models import db, Redirect, DeviceType
from usb.shortener import get_short_id, get_short_url
api = Blueprint('api', __name__)
@api.route('/links')
def get_links():
return jsonify({}), 200
@api.route('/links', methods=['POST'])
def shorten_u... | from flask import Blueprint, jsonify, request
from usb.models import db, Redirect, DeviceType
from usb.shortener import get_short_id, get_short_url
api = Blueprint('api', __name__)
@api.route('/links')
def get_links():
return jsonify({}), 200
@api.route('/links', methods=['POST'])
def shorten_url():
short... | from flask import Blueprint, jsonify, request
from usb.models import db, Redirect, DeviceType
from usb.shortener import get_short_id, get_short_url
api = Blueprint('api', __name__)
@api.route('/links')
def get_links():
return jsonify({}), 200
@api.route('/links', methods=['POST'])
def shorten_url():
short... | <commit_before>from flask import Blueprint, jsonify, request
from usb.models import db, Redirect, DeviceType
from usb.shortener import get_short_id, get_short_url
api = Blueprint('api', __name__)
@api.route('/links')
def get_links():
return jsonify({}), 200
@api.route('/links', methods=['POST'])
def shorten_u... |
9b4e7a06932d6ed6a5a9032619fa433629187d69 | utilkit/stringutil.py | utilkit/stringutil.py | """
String/unicode helper functions
"""
def safe_unicode(obj, *args):
""" return the unicode representation of obj """
try:
return unicode(obj, *args) # pylint:disable=undefined-variable
except UnicodeDecodeError:
# obj is byte string
ascii_text = str(obj).encode('string_escape')
... | """
String/unicode helper functions
"""
def safe_unicode(obj, *args):
""" return the unicode representation of obj """
try:
return unicode(obj, *args) # noqa for undefined-variable
except UnicodeDecodeError:
# obj is byte string
ascii_text = str(obj).encode('string_escape')
... | Disable error-checking that assumes Python 3 for these Python 2 helpers, landscape.io style | Disable error-checking that assumes Python 3 for these Python 2 helpers,
landscape.io style
| Python | mit | aquatix/python-utilkit | """
String/unicode helper functions
"""
def safe_unicode(obj, *args):
""" return the unicode representation of obj """
try:
return unicode(obj, *args) # pylint:disable=undefined-variable
except UnicodeDecodeError:
# obj is byte string
ascii_text = str(obj).encode('string_escape')
... | """
String/unicode helper functions
"""
def safe_unicode(obj, *args):
""" return the unicode representation of obj """
try:
return unicode(obj, *args) # noqa for undefined-variable
except UnicodeDecodeError:
# obj is byte string
ascii_text = str(obj).encode('string_escape')
... | <commit_before>"""
String/unicode helper functions
"""
def safe_unicode(obj, *args):
""" return the unicode representation of obj """
try:
return unicode(obj, *args) # pylint:disable=undefined-variable
except UnicodeDecodeError:
# obj is byte string
ascii_text = str(obj).encode('st... | """
String/unicode helper functions
"""
def safe_unicode(obj, *args):
""" return the unicode representation of obj """
try:
return unicode(obj, *args) # noqa for undefined-variable
except UnicodeDecodeError:
# obj is byte string
ascii_text = str(obj).encode('string_escape')
... | """
String/unicode helper functions
"""
def safe_unicode(obj, *args):
""" return the unicode representation of obj """
try:
return unicode(obj, *args) # pylint:disable=undefined-variable
except UnicodeDecodeError:
# obj is byte string
ascii_text = str(obj).encode('string_escape')
... | <commit_before>"""
String/unicode helper functions
"""
def safe_unicode(obj, *args):
""" return the unicode representation of obj """
try:
return unicode(obj, *args) # pylint:disable=undefined-variable
except UnicodeDecodeError:
# obj is byte string
ascii_text = str(obj).encode('st... |
8995cbf71454e3424e15913661ee659c48f7b8fa | volunteer_planner/settings/local_mysql.py | volunteer_planner/settings/local_mysql.py | # coding: utf-8
from volunteer_planner.settings.local import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'volunteer_planner',
'PASSWORD': os.environ.get('DATABASE_PW', 'volunteer_planner'),
'USER': os.environ.get('DB_USER', 'vp')
}
}
| # coding: utf-8
from volunteer_planner.settings.local import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': os.environ.get('DATABASE_NAME', 'volunteer_planner'),
'PASSWORD': os.environ.get('DATABASE_PW', 'volunteer_planner'),
'USER': os.environ.get('DB_U... | Make local mysql db name overridable with DATABASE_NAME environment variable | Make local mysql db name overridable with DATABASE_NAME environment variable
| Python | agpl-3.0 | christophmeissner/volunteer_planner,christophmeissner/volunteer_planner,coders4help/volunteer_planner,klinger/volunteer_planner,klinger/volunteer_planner,pitpalme/volunteer_planner,pitpalme/volunteer_planner,pitpalme/volunteer_planner,coders4help/volunteer_planner,pitpalme/volunteer_planner,coders4help/volunteer_planne... | # coding: utf-8
from volunteer_planner.settings.local import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'volunteer_planner',
'PASSWORD': os.environ.get('DATABASE_PW', 'volunteer_planner'),
'USER': os.environ.get('DB_USER', 'vp')
}
}
Make local my... | # coding: utf-8
from volunteer_planner.settings.local import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': os.environ.get('DATABASE_NAME', 'volunteer_planner'),
'PASSWORD': os.environ.get('DATABASE_PW', 'volunteer_planner'),
'USER': os.environ.get('DB_U... | <commit_before># coding: utf-8
from volunteer_planner.settings.local import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'volunteer_planner',
'PASSWORD': os.environ.get('DATABASE_PW', 'volunteer_planner'),
'USER': os.environ.get('DB_USER', 'vp')
}
... | # coding: utf-8
from volunteer_planner.settings.local import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': os.environ.get('DATABASE_NAME', 'volunteer_planner'),
'PASSWORD': os.environ.get('DATABASE_PW', 'volunteer_planner'),
'USER': os.environ.get('DB_U... | # coding: utf-8
from volunteer_planner.settings.local import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'volunteer_planner',
'PASSWORD': os.environ.get('DATABASE_PW', 'volunteer_planner'),
'USER': os.environ.get('DB_USER', 'vp')
}
}
Make local my... | <commit_before># coding: utf-8
from volunteer_planner.settings.local import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'volunteer_planner',
'PASSWORD': os.environ.get('DATABASE_PW', 'volunteer_planner'),
'USER': os.environ.get('DB_USER', 'vp')
}
... |
7fb1b95205de32ec27b4e5428928b1bba417c9c8 | build/fbcode_builder/specs/fbthrift.py | build/fbcode_builder/specs/fbthrift.py | #!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import specs.folly as folly
import specs.fizz as fizz
import specs.rsocket as rsocket
import spec... | #!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import specs.folly as folly
import specs.fizz as fizz
import specs.rsocket as rsocket
import spec... | Cut fbcode_builder dep for thrift on krb5 | Cut fbcode_builder dep for thrift on krb5
Summary: [Thrift] Cut `fbcode_builder` dep for `thrift` on `krb5`. In the past, Thrift depended on Kerberos and the `krb5` implementation for its transport-layer security. However, Thrift has since migrated fully to Transport Layer Security for its transport-layer security and... | Python | unknown | ReactiveSocket/reactivesocket-cpp,ReactiveSocket/reactivesocket-cpp,phoad/rsocket-cpp,phoad/rsocket-cpp,rsocket/rsocket-cpp,phoad/rsocket-cpp,rsocket/rsocket-cpp,rsocket/rsocket-cpp,ReactiveSocket/reactivesocket-cpp,rsocket/rsocket-cpp,phoad/rsocket-cpp,phoad/rsocket-cpp | #!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import specs.folly as folly
import specs.fizz as fizz
import specs.rsocket as rsocket
import spec... | #!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import specs.folly as folly
import specs.fizz as fizz
import specs.rsocket as rsocket
import spec... | <commit_before>#!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import specs.folly as folly
import specs.fizz as fizz
import specs.rsocket as rsoc... | #!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import specs.folly as folly
import specs.fizz as fizz
import specs.rsocket as rsocket
import spec... | #!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import specs.folly as folly
import specs.fizz as fizz
import specs.rsocket as rsocket
import spec... | <commit_before>#!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import specs.folly as folly
import specs.fizz as fizz
import specs.rsocket as rsoc... |
6ec13485a475aeabf8a7fc461b160bbc4a453a00 | windmill/server/__init__.py | windmill/server/__init__.py | # Copyright (c) 2006-2007 Open Source Applications Foundation
# Copyright (c) 2008-2009 Mikeal Rogers <mikeal.rogers@gmail.com>
#
# 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
#
# ... | # Copyright (c) 2006-2007 Open Source Applications Foundation
# Copyright (c) 2008-2009 Mikeal Rogers <mikeal.rogers@gmail.com>
#
# 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
#
# ... | Stop forwarding flash by default, it breaks more than it doesn't. | Stop forwarding flash by default, it breaks more than it doesn't.
git-svn-id: 87d19257dd11500985d055ec4730e446075a5f07@1279 78c7df6f-8922-0410-bcd3-9426b1ad491b
| Python | apache-2.0 | ept/windmill,ept/windmill,ept/windmill | # Copyright (c) 2006-2007 Open Source Applications Foundation
# Copyright (c) 2008-2009 Mikeal Rogers <mikeal.rogers@gmail.com>
#
# 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
#
# ... | # Copyright (c) 2006-2007 Open Source Applications Foundation
# Copyright (c) 2008-2009 Mikeal Rogers <mikeal.rogers@gmail.com>
#
# 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
#
# ... | <commit_before># Copyright (c) 2006-2007 Open Source Applications Foundation
# Copyright (c) 2008-2009 Mikeal Rogers <mikeal.rogers@gmail.com>
#
# 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 L... | # Copyright (c) 2006-2007 Open Source Applications Foundation
# Copyright (c) 2008-2009 Mikeal Rogers <mikeal.rogers@gmail.com>
#
# 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
#
# ... | # Copyright (c) 2006-2007 Open Source Applications Foundation
# Copyright (c) 2008-2009 Mikeal Rogers <mikeal.rogers@gmail.com>
#
# 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
#
# ... | <commit_before># Copyright (c) 2006-2007 Open Source Applications Foundation
# Copyright (c) 2008-2009 Mikeal Rogers <mikeal.rogers@gmail.com>
#
# 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 L... |
9b676c6a4945540a6b23333b43e75c3f539862ae | propertyfrontend/__init__.py | propertyfrontend/__init__.py | import os, logging
from flask import Flask
from flask.ext.basicauth import BasicAuth
from raven.contrib.flask import Sentry
app = Flask(__name__)
app.config.from_object(os.environ.get('SETTINGS'))
if app.config.get('BASIC_AUTH_USERNAME'):
app.config['BASIC_AUTH_FORCE'] = True
basic_auth = BasicAuth(app)
# S... | import os, logging
from flask import Flask
from flask.ext.basicauth import BasicAuth
from raven.contrib.flask import Sentry
app = Flask(__name__)
app.config.from_object(os.environ.get('SETTINGS'))
if app.config.get('BASIC_AUTH_USERNAME'):
app.config['BASIC_AUTH_FORCE'] = True
basic_auth = BasicAuth(app)
# S... | Set config logging in init to debug | Set config logging in init to debug
| Python | mit | LandRegistry/property-frontend-alpha,LandRegistry/property-frontend-alpha,LandRegistry/property-frontend-alpha,LandRegistry/property-frontend-alpha | import os, logging
from flask import Flask
from flask.ext.basicauth import BasicAuth
from raven.contrib.flask import Sentry
app = Flask(__name__)
app.config.from_object(os.environ.get('SETTINGS'))
if app.config.get('BASIC_AUTH_USERNAME'):
app.config['BASIC_AUTH_FORCE'] = True
basic_auth = BasicAuth(app)
# S... | import os, logging
from flask import Flask
from flask.ext.basicauth import BasicAuth
from raven.contrib.flask import Sentry
app = Flask(__name__)
app.config.from_object(os.environ.get('SETTINGS'))
if app.config.get('BASIC_AUTH_USERNAME'):
app.config['BASIC_AUTH_FORCE'] = True
basic_auth = BasicAuth(app)
# S... | <commit_before>import os, logging
from flask import Flask
from flask.ext.basicauth import BasicAuth
from raven.contrib.flask import Sentry
app = Flask(__name__)
app.config.from_object(os.environ.get('SETTINGS'))
if app.config.get('BASIC_AUTH_USERNAME'):
app.config['BASIC_AUTH_FORCE'] = True
basic_auth = Basi... | import os, logging
from flask import Flask
from flask.ext.basicauth import BasicAuth
from raven.contrib.flask import Sentry
app = Flask(__name__)
app.config.from_object(os.environ.get('SETTINGS'))
if app.config.get('BASIC_AUTH_USERNAME'):
app.config['BASIC_AUTH_FORCE'] = True
basic_auth = BasicAuth(app)
# S... | import os, logging
from flask import Flask
from flask.ext.basicauth import BasicAuth
from raven.contrib.flask import Sentry
app = Flask(__name__)
app.config.from_object(os.environ.get('SETTINGS'))
if app.config.get('BASIC_AUTH_USERNAME'):
app.config['BASIC_AUTH_FORCE'] = True
basic_auth = BasicAuth(app)
# S... | <commit_before>import os, logging
from flask import Flask
from flask.ext.basicauth import BasicAuth
from raven.contrib.flask import Sentry
app = Flask(__name__)
app.config.from_object(os.environ.get('SETTINGS'))
if app.config.get('BASIC_AUTH_USERNAME'):
app.config['BASIC_AUTH_FORCE'] = True
basic_auth = Basi... |
c57910adc6e907881a99e092837fc35e5f45518b | survey_creation/config/de_17.py | survey_creation/config/de_17.py | """
Config file specific to uk to create automated survey
"""
class config:
# To modify, just add the keys of the dictionary
header_to_modify = [{'class': 'S', 'name': 'sid', 'text': '421498'},
{'class': 'S', 'name': 'admin_email', 'text': 'olivier.philippe@soton.ac.uk'}]
# Same as... | """
Config file specific to uk to create automated survey
"""
class config:
# To modify, just add the keys of the dictionary
header_to_modify = [{'class': 'S', 'name': 'sid', 'text': '421498'},
{'class': 'S', 'name': 'admin_email', 'text': 'olivier.philippe@soton.ac.uk'}]
# Same as... | Fix issue with headers about additional language in description rather than header | Fix issue with headers about additional language in description rather than header
| Python | bsd-3-clause | softwaresaved/international-survey | """
Config file specific to uk to create automated survey
"""
class config:
# To modify, just add the keys of the dictionary
header_to_modify = [{'class': 'S', 'name': 'sid', 'text': '421498'},
{'class': 'S', 'name': 'admin_email', 'text': 'olivier.philippe@soton.ac.uk'}]
# Same as... | """
Config file specific to uk to create automated survey
"""
class config:
# To modify, just add the keys of the dictionary
header_to_modify = [{'class': 'S', 'name': 'sid', 'text': '421498'},
{'class': 'S', 'name': 'admin_email', 'text': 'olivier.philippe@soton.ac.uk'}]
# Same as... | <commit_before>"""
Config file specific to uk to create automated survey
"""
class config:
# To modify, just add the keys of the dictionary
header_to_modify = [{'class': 'S', 'name': 'sid', 'text': '421498'},
{'class': 'S', 'name': 'admin_email', 'text': 'olivier.philippe@soton.ac.uk'}... | """
Config file specific to uk to create automated survey
"""
class config:
# To modify, just add the keys of the dictionary
header_to_modify = [{'class': 'S', 'name': 'sid', 'text': '421498'},
{'class': 'S', 'name': 'admin_email', 'text': 'olivier.philippe@soton.ac.uk'}]
# Same as... | """
Config file specific to uk to create automated survey
"""
class config:
# To modify, just add the keys of the dictionary
header_to_modify = [{'class': 'S', 'name': 'sid', 'text': '421498'},
{'class': 'S', 'name': 'admin_email', 'text': 'olivier.philippe@soton.ac.uk'}]
# Same as... | <commit_before>"""
Config file specific to uk to create automated survey
"""
class config:
# To modify, just add the keys of the dictionary
header_to_modify = [{'class': 'S', 'name': 'sid', 'text': '421498'},
{'class': 'S', 'name': 'admin_email', 'text': 'olivier.philippe@soton.ac.uk'}... |
4de89e1d1cf258e903b469deff9d2a7df34a1db9 | dotfiles/.ipython/profile_default/startup/bytes.py | dotfiles/.ipython/profile_default/startup/bytes.py | def bytes(b):
""" Print bytes in a humanized way """
def humanize(b, base, suffices=[]):
bb = int(b)
for suffix in suffices:
if bb < base:
break
bb /= float(base)
return "%.2f %s" % (bb, suffix)
print "Base 1024: ", humanize(
b, 1024, ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB',... | def bytes(b):
""" Print bytes in a humanized way """
def humanize(b, base, suffices=[]):
bb = int(b)
for suffix in suffices:
if bb < base:
break
bb /= float(base)
return "%.2f %s" % (bb, suffix)
print("Base 1024: ", humanize(
b, 1024, ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB',... | Make ipython profile python3 compliant | Make ipython profile python3 compliant
| Python | mit | izidormatusov/dotfiles,izidormatusov/dotfiles | def bytes(b):
""" Print bytes in a humanized way """
def humanize(b, base, suffices=[]):
bb = int(b)
for suffix in suffices:
if bb < base:
break
bb /= float(base)
return "%.2f %s" % (bb, suffix)
print "Base 1024: ", humanize(
b, 1024, ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB',... | def bytes(b):
""" Print bytes in a humanized way """
def humanize(b, base, suffices=[]):
bb = int(b)
for suffix in suffices:
if bb < base:
break
bb /= float(base)
return "%.2f %s" % (bb, suffix)
print("Base 1024: ", humanize(
b, 1024, ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB',... | <commit_before>def bytes(b):
""" Print bytes in a humanized way """
def humanize(b, base, suffices=[]):
bb = int(b)
for suffix in suffices:
if bb < base:
break
bb /= float(base)
return "%.2f %s" % (bb, suffix)
print "Base 1024: ", humanize(
b, 1024, ['B', 'KiB', 'MiB', 'GiB'... | def bytes(b):
""" Print bytes in a humanized way """
def humanize(b, base, suffices=[]):
bb = int(b)
for suffix in suffices:
if bb < base:
break
bb /= float(base)
return "%.2f %s" % (bb, suffix)
print("Base 1024: ", humanize(
b, 1024, ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB',... | def bytes(b):
""" Print bytes in a humanized way """
def humanize(b, base, suffices=[]):
bb = int(b)
for suffix in suffices:
if bb < base:
break
bb /= float(base)
return "%.2f %s" % (bb, suffix)
print "Base 1024: ", humanize(
b, 1024, ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB',... | <commit_before>def bytes(b):
""" Print bytes in a humanized way """
def humanize(b, base, suffices=[]):
bb = int(b)
for suffix in suffices:
if bb < base:
break
bb /= float(base)
return "%.2f %s" % (bb, suffix)
print "Base 1024: ", humanize(
b, 1024, ['B', 'KiB', 'MiB', 'GiB'... |
bed671bdd7dc221e55b5f60c4f9daca3c338a737 | artists/views.py | artists/views.py | from django.shortcuts import get_object_or_404
from rest_framework import permissions, viewsets
from similarities.utils import get_similar
from .models import Artist
from similarities.models import UserSimilarity
from .serializers import ArtistSerializer, SimilaritySerializer
class ArtistViewSet(viewsets.ModelViewSe... | from django.shortcuts import get_object_or_404
from rest_framework import permissions, viewsets
from similarities.utils import get_similar
from .models import Artist
from similarities.models import UserSimilarity, Similarity, update_similarities
from .serializers import ArtistSerializer, SimilaritySerializer
class A... | Update cumulative similarities on save | Update cumulative similarities on save
| Python | bsd-3-clause | FreeMusicNinja/api.freemusic.ninja | from django.shortcuts import get_object_or_404
from rest_framework import permissions, viewsets
from similarities.utils import get_similar
from .models import Artist
from similarities.models import UserSimilarity
from .serializers import ArtistSerializer, SimilaritySerializer
class ArtistViewSet(viewsets.ModelViewSe... | from django.shortcuts import get_object_or_404
from rest_framework import permissions, viewsets
from similarities.utils import get_similar
from .models import Artist
from similarities.models import UserSimilarity, Similarity, update_similarities
from .serializers import ArtistSerializer, SimilaritySerializer
class A... | <commit_before>from django.shortcuts import get_object_or_404
from rest_framework import permissions, viewsets
from similarities.utils import get_similar
from .models import Artist
from similarities.models import UserSimilarity
from .serializers import ArtistSerializer, SimilaritySerializer
class ArtistViewSet(views... | from django.shortcuts import get_object_or_404
from rest_framework import permissions, viewsets
from similarities.utils import get_similar
from .models import Artist
from similarities.models import UserSimilarity, Similarity, update_similarities
from .serializers import ArtistSerializer, SimilaritySerializer
class A... | from django.shortcuts import get_object_or_404
from rest_framework import permissions, viewsets
from similarities.utils import get_similar
from .models import Artist
from similarities.models import UserSimilarity
from .serializers import ArtistSerializer, SimilaritySerializer
class ArtistViewSet(viewsets.ModelViewSe... | <commit_before>from django.shortcuts import get_object_or_404
from rest_framework import permissions, viewsets
from similarities.utils import get_similar
from .models import Artist
from similarities.models import UserSimilarity
from .serializers import ArtistSerializer, SimilaritySerializer
class ArtistViewSet(views... |
42560625d8f83a60320e111503521a9a17d8ae09 | mollie/api/objects/list.py | mollie/api/objects/list.py | from .base import Base
class List(Base):
def __init__(self, result, object_type):
Base.__init__(self, result)
self.object_type = object_type
def get_resource_name(self):
return self.object_type.__name__.lower() + 's'
def __iter__(self):
for item in self['_embedded'][self.... | from .base import Base
class List(Base):
def __init__(self, result, object_type):
Base.__init__(self, result)
self.object_type = object_type
def get_object_name(self):
return self.object_type.__name__.lower() + 's'
def __iter__(self):
for item in self['_embedded'][self.ge... | Rename method to be more logical | Rename method to be more logical
| Python | bsd-2-clause | mollie/mollie-api-python | from .base import Base
class List(Base):
def __init__(self, result, object_type):
Base.__init__(self, result)
self.object_type = object_type
def get_resource_name(self):
return self.object_type.__name__.lower() + 's'
def __iter__(self):
for item in self['_embedded'][self.... | from .base import Base
class List(Base):
def __init__(self, result, object_type):
Base.__init__(self, result)
self.object_type = object_type
def get_object_name(self):
return self.object_type.__name__.lower() + 's'
def __iter__(self):
for item in self['_embedded'][self.ge... | <commit_before>from .base import Base
class List(Base):
def __init__(self, result, object_type):
Base.__init__(self, result)
self.object_type = object_type
def get_resource_name(self):
return self.object_type.__name__.lower() + 's'
def __iter__(self):
for item in self['_e... | from .base import Base
class List(Base):
def __init__(self, result, object_type):
Base.__init__(self, result)
self.object_type = object_type
def get_object_name(self):
return self.object_type.__name__.lower() + 's'
def __iter__(self):
for item in self['_embedded'][self.ge... | from .base import Base
class List(Base):
def __init__(self, result, object_type):
Base.__init__(self, result)
self.object_type = object_type
def get_resource_name(self):
return self.object_type.__name__.lower() + 's'
def __iter__(self):
for item in self['_embedded'][self.... | <commit_before>from .base import Base
class List(Base):
def __init__(self, result, object_type):
Base.__init__(self, result)
self.object_type = object_type
def get_resource_name(self):
return self.object_type.__name__.lower() + 's'
def __iter__(self):
for item in self['_e... |
616d92fed79bbfe6ea70ed7e053622819d99088d | python/getmonotime.py | python/getmonotime.py | import getopt, sys
if __name__ == '__main__':
sippy_path = None
try:
opts, args = getopt.getopt(sys.argv[1:], 's:S:i:o:b')
except getopt.GetoptError:
usage()
for o, a in opts:
if o == '-S':
sippy_path = a.strip()
continue
if sippy_path != None:
... | import getopt, sys
if __name__ == '__main__':
sippy_path = None
try:
opts, args = getopt.getopt(sys.argv[1:], 'rS:')
except getopt.GetoptError:
usage()
out_realtime = False
for o, a in opts:
if o == '-S':
sippy_path = a.strip()
continue
if o... | Add an option to also output realtime along with monotime. | Add an option to also output realtime along with monotime.
| Python | bsd-2-clause | sippy/rtp_cluster,sippy/rtp_cluster | import getopt, sys
if __name__ == '__main__':
sippy_path = None
try:
opts, args = getopt.getopt(sys.argv[1:], 's:S:i:o:b')
except getopt.GetoptError:
usage()
for o, a in opts:
if o == '-S':
sippy_path = a.strip()
continue
if sippy_path != None:
... | import getopt, sys
if __name__ == '__main__':
sippy_path = None
try:
opts, args = getopt.getopt(sys.argv[1:], 'rS:')
except getopt.GetoptError:
usage()
out_realtime = False
for o, a in opts:
if o == '-S':
sippy_path = a.strip()
continue
if o... | <commit_before>import getopt, sys
if __name__ == '__main__':
sippy_path = None
try:
opts, args = getopt.getopt(sys.argv[1:], 's:S:i:o:b')
except getopt.GetoptError:
usage()
for o, a in opts:
if o == '-S':
sippy_path = a.strip()
continue
if sippy_pa... | import getopt, sys
if __name__ == '__main__':
sippy_path = None
try:
opts, args = getopt.getopt(sys.argv[1:], 'rS:')
except getopt.GetoptError:
usage()
out_realtime = False
for o, a in opts:
if o == '-S':
sippy_path = a.strip()
continue
if o... | import getopt, sys
if __name__ == '__main__':
sippy_path = None
try:
opts, args = getopt.getopt(sys.argv[1:], 's:S:i:o:b')
except getopt.GetoptError:
usage()
for o, a in opts:
if o == '-S':
sippy_path = a.strip()
continue
if sippy_path != None:
... | <commit_before>import getopt, sys
if __name__ == '__main__':
sippy_path = None
try:
opts, args = getopt.getopt(sys.argv[1:], 's:S:i:o:b')
except getopt.GetoptError:
usage()
for o, a in opts:
if o == '-S':
sippy_path = a.strip()
continue
if sippy_pa... |
ff45b8c21f99b20ed044e8b194bc84f21f4f15d7 | httpserver_with_post.py | httpserver_with_post.py | # Adapted from http://stackoverflow.com/questions/10017859/how-to-build-a-simple-http-post-server
# Thank you!
import sys
import BaseHTTPServer
import cgi
class MyHandler(BaseHTTPServer.BaseHTTPRequestHandler):
def do_POST(self):
ctype, pdict = cgi.parse_header(self.headers.getheader('content-type'))
... | # Adapted from http://stackoverflow.com/questions/10017859/how-to-build-a-simple-http-post-server
# Thank you!
import sys
import BaseHTTPServer
import cgi
class MyHandler(BaseHTTPServer.BaseHTTPRequestHandler):
def do_POST(self):
ctype, pdict = cgi.parse_header(self.headers.getheader('content-type'))
... | Print client-POSTed data, more verbose error handling | Print client-POSTed data, more verbose error handling
And less fiddling with the returned header. For the time being,
I don't care about correcting the bugs in that part of the code.
| Python | unlicense | aaaaalbert/repy-doodles | # Adapted from http://stackoverflow.com/questions/10017859/how-to-build-a-simple-http-post-server
# Thank you!
import sys
import BaseHTTPServer
import cgi
class MyHandler(BaseHTTPServer.BaseHTTPRequestHandler):
def do_POST(self):
ctype, pdict = cgi.parse_header(self.headers.getheader('content-type'))
... | # Adapted from http://stackoverflow.com/questions/10017859/how-to-build-a-simple-http-post-server
# Thank you!
import sys
import BaseHTTPServer
import cgi
class MyHandler(BaseHTTPServer.BaseHTTPRequestHandler):
def do_POST(self):
ctype, pdict = cgi.parse_header(self.headers.getheader('content-type'))
... | <commit_before># Adapted from http://stackoverflow.com/questions/10017859/how-to-build-a-simple-http-post-server
# Thank you!
import sys
import BaseHTTPServer
import cgi
class MyHandler(BaseHTTPServer.BaseHTTPRequestHandler):
def do_POST(self):
ctype, pdict = cgi.parse_header(self.headers.getheader('conte... | # Adapted from http://stackoverflow.com/questions/10017859/how-to-build-a-simple-http-post-server
# Thank you!
import sys
import BaseHTTPServer
import cgi
class MyHandler(BaseHTTPServer.BaseHTTPRequestHandler):
def do_POST(self):
ctype, pdict = cgi.parse_header(self.headers.getheader('content-type'))
... | # Adapted from http://stackoverflow.com/questions/10017859/how-to-build-a-simple-http-post-server
# Thank you!
import sys
import BaseHTTPServer
import cgi
class MyHandler(BaseHTTPServer.BaseHTTPRequestHandler):
def do_POST(self):
ctype, pdict = cgi.parse_header(self.headers.getheader('content-type'))
... | <commit_before># Adapted from http://stackoverflow.com/questions/10017859/how-to-build-a-simple-http-post-server
# Thank you!
import sys
import BaseHTTPServer
import cgi
class MyHandler(BaseHTTPServer.BaseHTTPRequestHandler):
def do_POST(self):
ctype, pdict = cgi.parse_header(self.headers.getheader('conte... |
5b54df50752b3f661ad43f2086734f90a8d1a11e | src/ggrc/migrations/versions/20150205020509_5254f4f31427_system_editable_object_state.py | src/ggrc/migrations/versions/20150205020509_5254f4f31427_system_editable_object_state.py |
"""System editable object state
Revision ID: 5254f4f31427
Revises: 512c71e4d93b
Create Date: 2015-02-05 02:05:09.351265
"""
# revision identifiers, used by Alembic.
revision = '5254f4f31427'
down_revision = '512c71e4d93b'
import sqlalchemy as sa
from sqlalchemy.sql import table, column
from alembic import op
from ... |
"""System editable object state
Revision ID: 5254f4f31427
Revises: 512c71e4d93b
Create Date: 2015-02-05 02:05:09.351265
"""
# revision identifiers, used by Alembic.
revision = '5254f4f31427'
down_revision = '512c71e4d93b'
import sqlalchemy as sa
from sqlalchemy.sql import table, column
from alembic import op
from ... | Fix db_downgrade for "System editable object state" | Fix db_downgrade for "System editable object state"
| Python | apache-2.0 | jmakov/ggrc-core,edofic/ggrc-core,uskudnik/ggrc-core,plamut/ggrc-core,vladan-m/ggrc-core,j0gurt/ggrc-core,selahssea/ggrc-core,andrei-karalionak/ggrc-core,edofic/ggrc-core,AleksNeStu/ggrc-core,selahssea/ggrc-core,j0gurt/ggrc-core,NejcZupec/ggrc-core,VinnieJohns/ggrc-core,hasanalom/ggrc-core,uskudnik/ggrc-core,j0gurt/ggr... |
"""System editable object state
Revision ID: 5254f4f31427
Revises: 512c71e4d93b
Create Date: 2015-02-05 02:05:09.351265
"""
# revision identifiers, used by Alembic.
revision = '5254f4f31427'
down_revision = '512c71e4d93b'
import sqlalchemy as sa
from sqlalchemy.sql import table, column
from alembic import op
from ... |
"""System editable object state
Revision ID: 5254f4f31427
Revises: 512c71e4d93b
Create Date: 2015-02-05 02:05:09.351265
"""
# revision identifiers, used by Alembic.
revision = '5254f4f31427'
down_revision = '512c71e4d93b'
import sqlalchemy as sa
from sqlalchemy.sql import table, column
from alembic import op
from ... | <commit_before>
"""System editable object state
Revision ID: 5254f4f31427
Revises: 512c71e4d93b
Create Date: 2015-02-05 02:05:09.351265
"""
# revision identifiers, used by Alembic.
revision = '5254f4f31427'
down_revision = '512c71e4d93b'
import sqlalchemy as sa
from sqlalchemy.sql import table, column
from alembic ... |
"""System editable object state
Revision ID: 5254f4f31427
Revises: 512c71e4d93b
Create Date: 2015-02-05 02:05:09.351265
"""
# revision identifiers, used by Alembic.
revision = '5254f4f31427'
down_revision = '512c71e4d93b'
import sqlalchemy as sa
from sqlalchemy.sql import table, column
from alembic import op
from ... |
"""System editable object state
Revision ID: 5254f4f31427
Revises: 512c71e4d93b
Create Date: 2015-02-05 02:05:09.351265
"""
# revision identifiers, used by Alembic.
revision = '5254f4f31427'
down_revision = '512c71e4d93b'
import sqlalchemy as sa
from sqlalchemy.sql import table, column
from alembic import op
from ... | <commit_before>
"""System editable object state
Revision ID: 5254f4f31427
Revises: 512c71e4d93b
Create Date: 2015-02-05 02:05:09.351265
"""
# revision identifiers, used by Alembic.
revision = '5254f4f31427'
down_revision = '512c71e4d93b'
import sqlalchemy as sa
from sqlalchemy.sql import table, column
from alembic ... |
877a3470044c98d3a938633479d38df6df6d26bd | boltiot/urls.py | boltiot/urls.py | #Creating a key value store for all the urls
BASE_URL = 'http://cloud.boltiot.com/remote/'
url_list = {
'digitalWrite' : '{}/digitalWrite?pin={}&state={}&deviceName={}',
'digitalRead' : '{}/digitalRead?pin={}&deviceName={}',
'analogWrite' : '{}/analogWrite?pin=1&value={}&state={}&deviceName={}',
'analo... | #Creating a key value store for all the urls
BASE_URL = 'http://cloud.boltiot.com/remote/'
url_list = {
'digitalWrite' : '{}/digitalWrite?pin={}&state={}&deviceName={}',
'digitalRead' : '{}/digitalRead?pin={}&deviceName={}',
'analogWrite' : '{}/analogWrite?pin={}&value={}&deviceName={}',
'analogRead' :... | Remove the static pin fir analog read | Remove the static pin fir analog read
| Python | mit | Inventrom/bolt-api-python | #Creating a key value store for all the urls
BASE_URL = 'http://cloud.boltiot.com/remote/'
url_list = {
'digitalWrite' : '{}/digitalWrite?pin={}&state={}&deviceName={}',
'digitalRead' : '{}/digitalRead?pin={}&deviceName={}',
'analogWrite' : '{}/analogWrite?pin=1&value={}&state={}&deviceName={}',
'analo... | #Creating a key value store for all the urls
BASE_URL = 'http://cloud.boltiot.com/remote/'
url_list = {
'digitalWrite' : '{}/digitalWrite?pin={}&state={}&deviceName={}',
'digitalRead' : '{}/digitalRead?pin={}&deviceName={}',
'analogWrite' : '{}/analogWrite?pin={}&value={}&deviceName={}',
'analogRead' :... | <commit_before>#Creating a key value store for all the urls
BASE_URL = 'http://cloud.boltiot.com/remote/'
url_list = {
'digitalWrite' : '{}/digitalWrite?pin={}&state={}&deviceName={}',
'digitalRead' : '{}/digitalRead?pin={}&deviceName={}',
'analogWrite' : '{}/analogWrite?pin=1&value={}&state={}&deviceName=... | #Creating a key value store for all the urls
BASE_URL = 'http://cloud.boltiot.com/remote/'
url_list = {
'digitalWrite' : '{}/digitalWrite?pin={}&state={}&deviceName={}',
'digitalRead' : '{}/digitalRead?pin={}&deviceName={}',
'analogWrite' : '{}/analogWrite?pin={}&value={}&deviceName={}',
'analogRead' :... | #Creating a key value store for all the urls
BASE_URL = 'http://cloud.boltiot.com/remote/'
url_list = {
'digitalWrite' : '{}/digitalWrite?pin={}&state={}&deviceName={}',
'digitalRead' : '{}/digitalRead?pin={}&deviceName={}',
'analogWrite' : '{}/analogWrite?pin=1&value={}&state={}&deviceName={}',
'analo... | <commit_before>#Creating a key value store for all the urls
BASE_URL = 'http://cloud.boltiot.com/remote/'
url_list = {
'digitalWrite' : '{}/digitalWrite?pin={}&state={}&deviceName={}',
'digitalRead' : '{}/digitalRead?pin={}&deviceName={}',
'analogWrite' : '{}/analogWrite?pin=1&value={}&state={}&deviceName=... |
ab5d570b92aca2c598d12fcdb0b063782ad4c871 | templates/root/appfiles/urls.py | templates/root/appfiles/urls.py | """template URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... | """template URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... | Fix Import error as a result of answering No to include Login | Fix Import error as a result of answering No to include Login
| Python | mit | dfurtado/generator-djangospa,dfurtado/generator-djangospa,dfurtado/generator-djangospa | """template URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... | """template URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... | <commit_before>"""template URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='h... | """template URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... | """template URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... | <commit_before>"""template URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='h... |
115615a2a183684eed4f11e98a7da12190059fb1 | armstrong/core/arm_layout/utils.py | armstrong/core/arm_layout/utils.py | # Here for backwards compatibility (deprecated)
from django.utils.safestring import mark_safe
from django.template.loader import render_to_string
from armstrong.utils.backends import GenericBackend
render_model = (GenericBackend("ARMSTRONG_RENDER_MODEL_BACKEND",
defaults="armstrong.core.arm_layout.backends.Ba... | import warnings
from armstrong.utils.backends import GenericBackend
render_model = (GenericBackend("ARMSTRONG_RENDER_MODEL_BACKEND",
defaults="armstrong.core.arm_layout.backends.BasicRenderModelBackend")
.get_backend())
# DEPRECATED: To be removed in ArmLayout 1.4. Here for backwards compatibility
from d... | Throw deprecation warnings for these imports, which will be removed in the next version. They've been deprecated for two years so we can make it happen. | Throw deprecation warnings for these imports, which will be removed in the next version. They've been deprecated for two years so we can make it happen.
| Python | apache-2.0 | armstrong/armstrong.core.arm_layout,armstrong/armstrong.core.arm_layout | # Here for backwards compatibility (deprecated)
from django.utils.safestring import mark_safe
from django.template.loader import render_to_string
from armstrong.utils.backends import GenericBackend
render_model = (GenericBackend("ARMSTRONG_RENDER_MODEL_BACKEND",
defaults="armstrong.core.arm_layout.backends.Ba... | import warnings
from armstrong.utils.backends import GenericBackend
render_model = (GenericBackend("ARMSTRONG_RENDER_MODEL_BACKEND",
defaults="armstrong.core.arm_layout.backends.BasicRenderModelBackend")
.get_backend())
# DEPRECATED: To be removed in ArmLayout 1.4. Here for backwards compatibility
from d... | <commit_before># Here for backwards compatibility (deprecated)
from django.utils.safestring import mark_safe
from django.template.loader import render_to_string
from armstrong.utils.backends import GenericBackend
render_model = (GenericBackend("ARMSTRONG_RENDER_MODEL_BACKEND",
defaults="armstrong.core.arm_lay... | import warnings
from armstrong.utils.backends import GenericBackend
render_model = (GenericBackend("ARMSTRONG_RENDER_MODEL_BACKEND",
defaults="armstrong.core.arm_layout.backends.BasicRenderModelBackend")
.get_backend())
# DEPRECATED: To be removed in ArmLayout 1.4. Here for backwards compatibility
from d... | # Here for backwards compatibility (deprecated)
from django.utils.safestring import mark_safe
from django.template.loader import render_to_string
from armstrong.utils.backends import GenericBackend
render_model = (GenericBackend("ARMSTRONG_RENDER_MODEL_BACKEND",
defaults="armstrong.core.arm_layout.backends.Ba... | <commit_before># Here for backwards compatibility (deprecated)
from django.utils.safestring import mark_safe
from django.template.loader import render_to_string
from armstrong.utils.backends import GenericBackend
render_model = (GenericBackend("ARMSTRONG_RENDER_MODEL_BACKEND",
defaults="armstrong.core.arm_lay... |
4753dffc6a1672dfa99a5a5da8f082d6554bbb8f | http_request_translator/templates/bash_template.py | http_request_translator/templates/bash_template.py | begin_code = """
#!/usr/bin/env bash
curl -s --request """
request_header = """ --header "{header} : {header_value}" """
code_search = " | egrep --color ' {search_string} |$' "
code_simple = "{method} {url} {headers} --include "
proxy_code = "-x {proxy}"
body_code = " --data '{body}' "
| begin_code = """
#!/usr/bin/env bash
curl"""
request_header = """ --header "{header} : {header_value}" """
code_search = " | egrep --color ' {search_string} |$'"
code_simple = " -s --request {method} {url} {headers} --include"
proxy_code = " -x {proxy}"
body_code = " --data '{body}'"
| Fix whitespace in bash script code template | Fix whitespace in bash script code template
Signed-off-by: Arun Sori <e3bf7af6e125f7de61de92cd66a64411bed42bee@gmail.com>
| Python | bsd-3-clause | owtf/http-request-translator,dhruvagarwal/http-request-translator | begin_code = """
#!/usr/bin/env bash
curl -s --request """
request_header = """ --header "{header} : {header_value}" """
code_search = " | egrep --color ' {search_string} |$' "
code_simple = "{method} {url} {headers} --include "
proxy_code = "-x {proxy}"
body_code = " --data '{body}' "
Fix whitespace in bash scrip... | begin_code = """
#!/usr/bin/env bash
curl"""
request_header = """ --header "{header} : {header_value}" """
code_search = " | egrep --color ' {search_string} |$'"
code_simple = " -s --request {method} {url} {headers} --include"
proxy_code = " -x {proxy}"
body_code = " --data '{body}'"
| <commit_before>begin_code = """
#!/usr/bin/env bash
curl -s --request """
request_header = """ --header "{header} : {header_value}" """
code_search = " | egrep --color ' {search_string} |$' "
code_simple = "{method} {url} {headers} --include "
proxy_code = "-x {proxy}"
body_code = " --data '{body}' "
<commit_msg>F... | begin_code = """
#!/usr/bin/env bash
curl"""
request_header = """ --header "{header} : {header_value}" """
code_search = " | egrep --color ' {search_string} |$'"
code_simple = " -s --request {method} {url} {headers} --include"
proxy_code = " -x {proxy}"
body_code = " --data '{body}'"
| begin_code = """
#!/usr/bin/env bash
curl -s --request """
request_header = """ --header "{header} : {header_value}" """
code_search = " | egrep --color ' {search_string} |$' "
code_simple = "{method} {url} {headers} --include "
proxy_code = "-x {proxy}"
body_code = " --data '{body}' "
Fix whitespace in bash scrip... | <commit_before>begin_code = """
#!/usr/bin/env bash
curl -s --request """
request_header = """ --header "{header} : {header_value}" """
code_search = " | egrep --color ' {search_string} |$' "
code_simple = "{method} {url} {headers} --include "
proxy_code = "-x {proxy}"
body_code = " --data '{body}' "
<commit_msg>F... |
f1760fe01ae82289d8de2bb9323271edb80d4c08 | f8a_jobs/graph_sync.py | f8a_jobs/graph_sync.py | """Functions to retrieve pending list and invoke Graph Sync."""
import f8a_jobs.defaults as configuration
import requests
import traceback
import logging
logger = logging.getLogger(__name__)
def _api_call(url, params={}):
url = "%s%s" % (configuration.DATA_IMPORTER_ENDPOINT, "/api/v1/pending")
try:
... | """Functions to retrieve pending list and invoke Graph Sync."""
import f8a_jobs.defaults as configuration
import requests
import traceback
import logging
logger = logging.getLogger(__name__)
def _api_call(url, params={}):
try:
logger.info("API Call for url: %s, params: %s" % (url, params))
r = ... | Use url from the parameters | Use url from the parameters
| Python | apache-2.0 | fabric8-analytics/fabric8-analytics-jobs,fabric8-analytics/fabric8-analytics-jobs | """Functions to retrieve pending list and invoke Graph Sync."""
import f8a_jobs.defaults as configuration
import requests
import traceback
import logging
logger = logging.getLogger(__name__)
def _api_call(url, params={}):
url = "%s%s" % (configuration.DATA_IMPORTER_ENDPOINT, "/api/v1/pending")
try:
... | """Functions to retrieve pending list and invoke Graph Sync."""
import f8a_jobs.defaults as configuration
import requests
import traceback
import logging
logger = logging.getLogger(__name__)
def _api_call(url, params={}):
try:
logger.info("API Call for url: %s, params: %s" % (url, params))
r = ... | <commit_before>"""Functions to retrieve pending list and invoke Graph Sync."""
import f8a_jobs.defaults as configuration
import requests
import traceback
import logging
logger = logging.getLogger(__name__)
def _api_call(url, params={}):
url = "%s%s" % (configuration.DATA_IMPORTER_ENDPOINT, "/api/v1/pending")
... | """Functions to retrieve pending list and invoke Graph Sync."""
import f8a_jobs.defaults as configuration
import requests
import traceback
import logging
logger = logging.getLogger(__name__)
def _api_call(url, params={}):
try:
logger.info("API Call for url: %s, params: %s" % (url, params))
r = ... | """Functions to retrieve pending list and invoke Graph Sync."""
import f8a_jobs.defaults as configuration
import requests
import traceback
import logging
logger = logging.getLogger(__name__)
def _api_call(url, params={}):
url = "%s%s" % (configuration.DATA_IMPORTER_ENDPOINT, "/api/v1/pending")
try:
... | <commit_before>"""Functions to retrieve pending list and invoke Graph Sync."""
import f8a_jobs.defaults as configuration
import requests
import traceback
import logging
logger = logging.getLogger(__name__)
def _api_call(url, params={}):
url = "%s%s" % (configuration.DATA_IMPORTER_ENDPOINT, "/api/v1/pending")
... |
d3af229c5c692fdb52c211cd8785bcb7c869090b | reobject/query.py | reobject/query.py | from reobject.utils import signed_attrgetter
class QuerySet(list):
def __init__(self, *args, **kwargs):
super(QuerySet, self).__init__(*args, **kwargs)
def count(self):
return len(self)
def delete(self):
for item in self:
item.delete()
def exists(self):
re... | from reobject.utils import signed_attrgetter
class QuerySet(list):
def __init__(self, *args, **kwargs):
super(QuerySet, self).__init__(*args, **kwargs)
def count(self):
return len(self)
def delete(self):
for item in self:
item.delete()
def exists(self):
re... | Allow QuerySet objects to be reversed | Allow QuerySet objects to be reversed
| Python | apache-2.0 | onyb/reobject,onyb/reobject | from reobject.utils import signed_attrgetter
class QuerySet(list):
def __init__(self, *args, **kwargs):
super(QuerySet, self).__init__(*args, **kwargs)
def count(self):
return len(self)
def delete(self):
for item in self:
item.delete()
def exists(self):
re... | from reobject.utils import signed_attrgetter
class QuerySet(list):
def __init__(self, *args, **kwargs):
super(QuerySet, self).__init__(*args, **kwargs)
def count(self):
return len(self)
def delete(self):
for item in self:
item.delete()
def exists(self):
re... | <commit_before>from reobject.utils import signed_attrgetter
class QuerySet(list):
def __init__(self, *args, **kwargs):
super(QuerySet, self).__init__(*args, **kwargs)
def count(self):
return len(self)
def delete(self):
for item in self:
item.delete()
def exists(se... | from reobject.utils import signed_attrgetter
class QuerySet(list):
def __init__(self, *args, **kwargs):
super(QuerySet, self).__init__(*args, **kwargs)
def count(self):
return len(self)
def delete(self):
for item in self:
item.delete()
def exists(self):
re... | from reobject.utils import signed_attrgetter
class QuerySet(list):
def __init__(self, *args, **kwargs):
super(QuerySet, self).__init__(*args, **kwargs)
def count(self):
return len(self)
def delete(self):
for item in self:
item.delete()
def exists(self):
re... | <commit_before>from reobject.utils import signed_attrgetter
class QuerySet(list):
def __init__(self, *args, **kwargs):
super(QuerySet, self).__init__(*args, **kwargs)
def count(self):
return len(self)
def delete(self):
for item in self:
item.delete()
def exists(se... |
06c5f27c04de9fa62f6ac4834e0a920349c27084 | rules/binutils.py | rules/binutils.py | import xyz
import os
import shutil
class Binutils(xyz.BuildProtocol):
pkg_name = 'binutils'
supported_targets = ['arm-none-eabi']
def check(self, builder):
if builder.target not in self.supported_targets:
raise xyz.UsageError("Invalid target ({}) for {}".format(builder.target, self.pkg... | import xyz
import os
import shutil
class Binutils(xyz.BuildProtocol):
pkg_name = 'binutils'
supported_targets = ['arm-none-eabi']
def check(self, builder):
if builder.target not in self.supported_targets:
raise xyz.UsageError("Invalid target ({}) for {}".format(builder.target, self.pkg... | Remove man pages post-install (for now) | Remove man pages post-install (for now)
| Python | mit | BreakawayConsulting/xyz | import xyz
import os
import shutil
class Binutils(xyz.BuildProtocol):
pkg_name = 'binutils'
supported_targets = ['arm-none-eabi']
def check(self, builder):
if builder.target not in self.supported_targets:
raise xyz.UsageError("Invalid target ({}) for {}".format(builder.target, self.pkg... | import xyz
import os
import shutil
class Binutils(xyz.BuildProtocol):
pkg_name = 'binutils'
supported_targets = ['arm-none-eabi']
def check(self, builder):
if builder.target not in self.supported_targets:
raise xyz.UsageError("Invalid target ({}) for {}".format(builder.target, self.pkg... | <commit_before>import xyz
import os
import shutil
class Binutils(xyz.BuildProtocol):
pkg_name = 'binutils'
supported_targets = ['arm-none-eabi']
def check(self, builder):
if builder.target not in self.supported_targets:
raise xyz.UsageError("Invalid target ({}) for {}".format(builder.t... | import xyz
import os
import shutil
class Binutils(xyz.BuildProtocol):
pkg_name = 'binutils'
supported_targets = ['arm-none-eabi']
def check(self, builder):
if builder.target not in self.supported_targets:
raise xyz.UsageError("Invalid target ({}) for {}".format(builder.target, self.pkg... | import xyz
import os
import shutil
class Binutils(xyz.BuildProtocol):
pkg_name = 'binutils'
supported_targets = ['arm-none-eabi']
def check(self, builder):
if builder.target not in self.supported_targets:
raise xyz.UsageError("Invalid target ({}) for {}".format(builder.target, self.pkg... | <commit_before>import xyz
import os
import shutil
class Binutils(xyz.BuildProtocol):
pkg_name = 'binutils'
supported_targets = ['arm-none-eabi']
def check(self, builder):
if builder.target not in self.supported_targets:
raise xyz.UsageError("Invalid target ({}) for {}".format(builder.t... |
7a5f2d0397f8ecda1c1b0517e844eec9d0e3e9d4 | geotrek/common/urls.py | geotrek/common/urls.py | from django.conf.urls import patterns, url
from .views import settings_json
urlpatterns += patterns('',
url(r'^api/settings.json', settings_json, name='settings_json'),
)
| from django.conf.urls import patterns, url
from .views import settings_json
urlpatterns = patterns('',
url(r'^api/settings.json', settings_json, name='settings_json'),
)
| Fix URL pattern after removing | Fix URL pattern after removing
| Python | bsd-2-clause | makinacorpus/Geotrek,mabhub/Geotrek,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,Anaethelion/Geotrek,johan--/Geotrek,Anaethelion/Geotrek,Anaethelion/Geotrek,GeotrekCE/Geotrek-admin,mabhub/Geotrek,GeotrekCE/Geotrek-admin,camillemonchicourt/Geotrek,makinacorpus/Geotrek,makinacorpus/Geotrek,mabhub/Geotrek,johan--/Geotrek,... | from django.conf.urls import patterns, url
from .views import settings_json
urlpatterns += patterns('',
url(r'^api/settings.json', settings_json, name='settings_json'),
)
Fix URL pattern after removing | from django.conf.urls import patterns, url
from .views import settings_json
urlpatterns = patterns('',
url(r'^api/settings.json', settings_json, name='settings_json'),
)
| <commit_before>from django.conf.urls import patterns, url
from .views import settings_json
urlpatterns += patterns('',
url(r'^api/settings.json', settings_json, name='settings_json'),
)
<commit_msg>Fix URL pattern after removing<commit_after> | from django.conf.urls import patterns, url
from .views import settings_json
urlpatterns = patterns('',
url(r'^api/settings.json', settings_json, name='settings_json'),
)
| from django.conf.urls import patterns, url
from .views import settings_json
urlpatterns += patterns('',
url(r'^api/settings.json', settings_json, name='settings_json'),
)
Fix URL pattern after removingfrom django.conf.urls import patterns, url
from .views import settings_json
urlpatterns = patterns('',
url(... | <commit_before>from django.conf.urls import patterns, url
from .views import settings_json
urlpatterns += patterns('',
url(r'^api/settings.json', settings_json, name='settings_json'),
)
<commit_msg>Fix URL pattern after removing<commit_after>from django.conf.urls import patterns, url
from .views import settings_j... |
9c0d88ba1681949c02f2cd136efc0de1c23d170d | simuvex/procedures/libc___so___6/fileno.py | simuvex/procedures/libc___so___6/fileno.py | import simuvex
from simuvex.s_type import SimTypeFd
import logging
l = logging.getLogger("simuvex.procedures.fileno")
######################################
# memset
######################################
class fileno(simuvex.SimProcedure):
#pylint:disable=arguments-differ
def run(self, f):
self.arg... | import simuvex
from simuvex.s_type import SimTypeFd, SimTypeTop
from . import io_file_data_for_arch
import logging
l = logging.getLogger("simuvex.procedures.fileno")
######################################
# fileno
######################################
class fileno(simuvex.SimProcedure):
#pylint:disable=argum... | Add logic for grabbing file descriptor from FILE struct | Add logic for grabbing file descriptor from FILE struct
| Python | bsd-2-clause | chubbymaggie/angr,angr/angr,schieb/angr,tyb0807/angr,axt/angr,f-prettyland/angr,axt/angr,iamahuman/angr,angr/angr,iamahuman/angr,axt/angr,iamahuman/angr,f-prettyland/angr,chubbymaggie/angr,schieb/angr,angr/angr,tyb0807/angr,tyb0807/angr,chubbymaggie/angr,f-prettyland/angr,angr/simuvex,schieb/angr | import simuvex
from simuvex.s_type import SimTypeFd
import logging
l = logging.getLogger("simuvex.procedures.fileno")
######################################
# memset
######################################
class fileno(simuvex.SimProcedure):
#pylint:disable=arguments-differ
def run(self, f):
self.arg... | import simuvex
from simuvex.s_type import SimTypeFd, SimTypeTop
from . import io_file_data_for_arch
import logging
l = logging.getLogger("simuvex.procedures.fileno")
######################################
# fileno
######################################
class fileno(simuvex.SimProcedure):
#pylint:disable=argum... | <commit_before>import simuvex
from simuvex.s_type import SimTypeFd
import logging
l = logging.getLogger("simuvex.procedures.fileno")
######################################
# memset
######################################
class fileno(simuvex.SimProcedure):
#pylint:disable=arguments-differ
def run(self, f):
... | import simuvex
from simuvex.s_type import SimTypeFd, SimTypeTop
from . import io_file_data_for_arch
import logging
l = logging.getLogger("simuvex.procedures.fileno")
######################################
# fileno
######################################
class fileno(simuvex.SimProcedure):
#pylint:disable=argum... | import simuvex
from simuvex.s_type import SimTypeFd
import logging
l = logging.getLogger("simuvex.procedures.fileno")
######################################
# memset
######################################
class fileno(simuvex.SimProcedure):
#pylint:disable=arguments-differ
def run(self, f):
self.arg... | <commit_before>import simuvex
from simuvex.s_type import SimTypeFd
import logging
l = logging.getLogger("simuvex.procedures.fileno")
######################################
# memset
######################################
class fileno(simuvex.SimProcedure):
#pylint:disable=arguments-differ
def run(self, f):
... |
d387ab236634f91186805dd114ee85455d1244f8 | pywikibot/echo.py | pywikibot/echo.py | # -*- coding: utf-8 -*-
"""Classes and functions for working with the Echo extension."""
from __future__ import absolute_import, unicode_literals
import pywikibot
class Notification(object):
"""A notification issued by the Echo extension."""
def __init__(self, site):
"""Construct an empty Notifica... | # -*- coding: utf-8 -*-
"""Classes and functions for working with the Echo extension."""
from __future__ import absolute_import, unicode_literals
import pywikibot
class Notification(object):
"""A notification issued by the Echo extension."""
def __init__(self, site):
"""Construct an empty Notifica... | Fix notifications building from JSON | Fix notifications building from JSON
Sometimes (like in welcome messages), notifications don't have a
'title' property, so we shouldn't assume there is one.
Bug: T139015
Change-Id: I83e480d04e8e09aa9bcb5edef4f56b47d150e199
| Python | mit | magul/pywikibot-core,hasteur/g13bot_tools_new,PersianWikipedia/pywikibot-core,npdoty/pywikibot,npdoty/pywikibot,wikimedia/pywikibot-core,happy5214/pywikibot-core,happy5214/pywikibot-core,wikimedia/pywikibot-core,Darkdadaah/pywikibot-core,jayvdb/pywikibot-core,hasteur/g13bot_tools_new,jayvdb/pywikibot-core,hasteur/g13bo... | # -*- coding: utf-8 -*-
"""Classes and functions for working with the Echo extension."""
from __future__ import absolute_import, unicode_literals
import pywikibot
class Notification(object):
"""A notification issued by the Echo extension."""
def __init__(self, site):
"""Construct an empty Notifica... | # -*- coding: utf-8 -*-
"""Classes and functions for working with the Echo extension."""
from __future__ import absolute_import, unicode_literals
import pywikibot
class Notification(object):
"""A notification issued by the Echo extension."""
def __init__(self, site):
"""Construct an empty Notifica... | <commit_before># -*- coding: utf-8 -*-
"""Classes and functions for working with the Echo extension."""
from __future__ import absolute_import, unicode_literals
import pywikibot
class Notification(object):
"""A notification issued by the Echo extension."""
def __init__(self, site):
"""Construct an... | # -*- coding: utf-8 -*-
"""Classes and functions for working with the Echo extension."""
from __future__ import absolute_import, unicode_literals
import pywikibot
class Notification(object):
"""A notification issued by the Echo extension."""
def __init__(self, site):
"""Construct an empty Notifica... | # -*- coding: utf-8 -*-
"""Classes and functions for working with the Echo extension."""
from __future__ import absolute_import, unicode_literals
import pywikibot
class Notification(object):
"""A notification issued by the Echo extension."""
def __init__(self, site):
"""Construct an empty Notifica... | <commit_before># -*- coding: utf-8 -*-
"""Classes and functions for working with the Echo extension."""
from __future__ import absolute_import, unicode_literals
import pywikibot
class Notification(object):
"""A notification issued by the Echo extension."""
def __init__(self, site):
"""Construct an... |
6664d075b4037ae40a91267afaca5731aa73ed3c | bluebottle/utils/widgets.py | bluebottle/utils/widgets.py | from __future__ import unicode_literals
from urlparse import urlparse
from django.contrib.admin.widgets import AdminURLFieldWidget
from django.forms.widgets import CheckboxFieldRenderer, CheckboxSelectMultiple, CheckboxChoiceInput
from django.utils.html import format_html
class NiceCheckboxChoiceInput(CheckboxChoic... | from __future__ import unicode_literals
from urlparse import urlparse
from django.contrib.admin.widgets import AdminURLFieldWidget
from django.forms.widgets import CheckboxFieldRenderer, CheckboxSelectMultiple, CheckboxChoiceInput
from django.utils.html import format_html
class NiceCheckboxChoiceInput(CheckboxChoic... | Fix url fields when no value is set | Fix url fields when no value is set
| Python | bsd-3-clause | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | from __future__ import unicode_literals
from urlparse import urlparse
from django.contrib.admin.widgets import AdminURLFieldWidget
from django.forms.widgets import CheckboxFieldRenderer, CheckboxSelectMultiple, CheckboxChoiceInput
from django.utils.html import format_html
class NiceCheckboxChoiceInput(CheckboxChoic... | from __future__ import unicode_literals
from urlparse import urlparse
from django.contrib.admin.widgets import AdminURLFieldWidget
from django.forms.widgets import CheckboxFieldRenderer, CheckboxSelectMultiple, CheckboxChoiceInput
from django.utils.html import format_html
class NiceCheckboxChoiceInput(CheckboxChoic... | <commit_before>from __future__ import unicode_literals
from urlparse import urlparse
from django.contrib.admin.widgets import AdminURLFieldWidget
from django.forms.widgets import CheckboxFieldRenderer, CheckboxSelectMultiple, CheckboxChoiceInput
from django.utils.html import format_html
class NiceCheckboxChoiceInpu... | from __future__ import unicode_literals
from urlparse import urlparse
from django.contrib.admin.widgets import AdminURLFieldWidget
from django.forms.widgets import CheckboxFieldRenderer, CheckboxSelectMultiple, CheckboxChoiceInput
from django.utils.html import format_html
class NiceCheckboxChoiceInput(CheckboxChoic... | from __future__ import unicode_literals
from urlparse import urlparse
from django.contrib.admin.widgets import AdminURLFieldWidget
from django.forms.widgets import CheckboxFieldRenderer, CheckboxSelectMultiple, CheckboxChoiceInput
from django.utils.html import format_html
class NiceCheckboxChoiceInput(CheckboxChoic... | <commit_before>from __future__ import unicode_literals
from urlparse import urlparse
from django.contrib.admin.widgets import AdminURLFieldWidget
from django.forms.widgets import CheckboxFieldRenderer, CheckboxSelectMultiple, CheckboxChoiceInput
from django.utils.html import format_html
class NiceCheckboxChoiceInpu... |
bfe45a24800817e7445fa12e7cd859679e6452c3 | porchlightapi/views.py | porchlightapi/views.py | # -*- coding: utf-8 -*-
from django.shortcuts import render
# Create your views here.
import django_filters
from rest_framework import viewsets
from rest_framework import filters
from porchlightapi.models import Repository, ValueDataPoint
from porchlightapi.serializers import RepositorySerializer, ValueDataPointSer... | # -*- coding: utf-8 -*-
from django.shortcuts import render
# Create your views here.
from rest_framework import viewsets
from rest_framework import filters
from porchlightapi.models import Repository, ValueDataPoint
from porchlightapi.serializers import RepositorySerializer, ValueDataPointSerializer
class Reposito... | Use DRF's built-in search filter | Use DRF's built-in search filter
| Python | cc0-1.0 | cfpb/porchlight,cfpb/porchlight,cfpb/porchlight | # -*- coding: utf-8 -*-
from django.shortcuts import render
# Create your views here.
import django_filters
from rest_framework import viewsets
from rest_framework import filters
from porchlightapi.models import Repository, ValueDataPoint
from porchlightapi.serializers import RepositorySerializer, ValueDataPointSer... | # -*- coding: utf-8 -*-
from django.shortcuts import render
# Create your views here.
from rest_framework import viewsets
from rest_framework import filters
from porchlightapi.models import Repository, ValueDataPoint
from porchlightapi.serializers import RepositorySerializer, ValueDataPointSerializer
class Reposito... | <commit_before># -*- coding: utf-8 -*-
from django.shortcuts import render
# Create your views here.
import django_filters
from rest_framework import viewsets
from rest_framework import filters
from porchlightapi.models import Repository, ValueDataPoint
from porchlightapi.serializers import RepositorySerializer, Va... | # -*- coding: utf-8 -*-
from django.shortcuts import render
# Create your views here.
from rest_framework import viewsets
from rest_framework import filters
from porchlightapi.models import Repository, ValueDataPoint
from porchlightapi.serializers import RepositorySerializer, ValueDataPointSerializer
class Reposito... | # -*- coding: utf-8 -*-
from django.shortcuts import render
# Create your views here.
import django_filters
from rest_framework import viewsets
from rest_framework import filters
from porchlightapi.models import Repository, ValueDataPoint
from porchlightapi.serializers import RepositorySerializer, ValueDataPointSer... | <commit_before># -*- coding: utf-8 -*-
from django.shortcuts import render
# Create your views here.
import django_filters
from rest_framework import viewsets
from rest_framework import filters
from porchlightapi.models import Repository, ValueDataPoint
from porchlightapi.serializers import RepositorySerializer, Va... |
1ecbd06083ac65a9520bcf0f87c5f5f1b4a4e532 | helloworld.py | helloworld.py |
#This is my hello world program
str1='Hello'
str2='Tarun'
print str1 +' '+ str2
# this is my hello world program
print 'Hello World!'
#This is my Hello world program
str1='Hello'
str2='Akash'
print str1 + ' ' + str2 + '!'
#this is a comment
str1='Hello'
str2='Priyanka'
print str1+' '+str2 |
print "helloworld" | Add strings to print hello world | Add strings to print hello world
| Python | apache-2.0 | ctsit/J.O.B-Training-Repo-1 |
#This is my hello world program
str1='Hello'
str2='Tarun'
print str1 +' '+ str2
# this is my hello world program
print 'Hello World!'
#This is my Hello world program
str1='Hello'
str2='Akash'
print str1 + ' ' + str2 + '!'
#this is a comment
str1='Hello'
str2='Priyanka'
print str1+' '+str2Add strings to print hello... |
print "helloworld" | <commit_before>
#This is my hello world program
str1='Hello'
str2='Tarun'
print str1 +' '+ str2
# this is my hello world program
print 'Hello World!'
#This is my Hello world program
str1='Hello'
str2='Akash'
print str1 + ' ' + str2 + '!'
#this is a comment
str1='Hello'
str2='Priyanka'
print str1+' '+str2<commit_msg... |
print "helloworld" |
#This is my hello world program
str1='Hello'
str2='Tarun'
print str1 +' '+ str2
# this is my hello world program
print 'Hello World!'
#This is my Hello world program
str1='Hello'
str2='Akash'
print str1 + ' ' + str2 + '!'
#this is a comment
str1='Hello'
str2='Priyanka'
print str1+' '+str2Add strings to print hello... | <commit_before>
#This is my hello world program
str1='Hello'
str2='Tarun'
print str1 +' '+ str2
# this is my hello world program
print 'Hello World!'
#This is my Hello world program
str1='Hello'
str2='Akash'
print str1 + ' ' + str2 + '!'
#this is a comment
str1='Hello'
str2='Priyanka'
print str1+' '+str2<commit_msg... |
14c473b8bef44ee5b521ce365ad89249c7f6e39e | linter.py | linter.py | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Jon Surrell
# Copyright (c) 2014 Jon Surrell
#
# License: MIT
#
"""This module exports the Gotype plugin class."""
from SublimeLinter.lint import Linter, util
class Gotype(Linter):
"""Provides an interface to... | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Jon Surrell
# Copyright (c) 2014 Jon Surrell
#
# License: MIT
#
"""This module exports the Gotype plugin class."""
from SublimeLinter.lint import Linter, util
class Gotype(Linter):
"""Provides an interface to... | Remove trailing $ from regex | Remove trailing $ from regex
| Python | mit | sirreal/SublimeLinter-contrib-gotype | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Jon Surrell
# Copyright (c) 2014 Jon Surrell
#
# License: MIT
#
"""This module exports the Gotype plugin class."""
from SublimeLinter.lint import Linter, util
class Gotype(Linter):
"""Provides an interface to... | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Jon Surrell
# Copyright (c) 2014 Jon Surrell
#
# License: MIT
#
"""This module exports the Gotype plugin class."""
from SublimeLinter.lint import Linter, util
class Gotype(Linter):
"""Provides an interface to... | <commit_before>#
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Jon Surrell
# Copyright (c) 2014 Jon Surrell
#
# License: MIT
#
"""This module exports the Gotype plugin class."""
from SublimeLinter.lint import Linter, util
class Gotype(Linter):
"""Provides ... | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Jon Surrell
# Copyright (c) 2014 Jon Surrell
#
# License: MIT
#
"""This module exports the Gotype plugin class."""
from SublimeLinter.lint import Linter, util
class Gotype(Linter):
"""Provides an interface to... | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Jon Surrell
# Copyright (c) 2014 Jon Surrell
#
# License: MIT
#
"""This module exports the Gotype plugin class."""
from SublimeLinter.lint import Linter, util
class Gotype(Linter):
"""Provides an interface to... | <commit_before>#
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Jon Surrell
# Copyright (c) 2014 Jon Surrell
#
# License: MIT
#
"""This module exports the Gotype plugin class."""
from SublimeLinter.lint import Linter, util
class Gotype(Linter):
"""Provides ... |
d1928f0b1c98093b977ae208613c2b7eeb9a3ce5 | carepoint/tests/models/cph/test_address.py | carepoint/tests/models/cph/test_address.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Dave Lasley <dave@laslabs.com>
# Copyright: 2015 LasLabs, Inc [https://laslabs.com]
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affe... | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Dave Lasley <dave@laslabs.com>
# Copyright: 2015 LasLabs, Inc [https://laslabs.com]
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affe... | Add instance assertion to table | Add instance assertion to table
| Python | mit | laslabs/Python-Carepoint | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Dave Lasley <dave@laslabs.com>
# Copyright: 2015 LasLabs, Inc [https://laslabs.com]
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affe... | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Dave Lasley <dave@laslabs.com>
# Copyright: 2015 LasLabs, Inc [https://laslabs.com]
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affe... | <commit_before># -*- coding: utf-8 -*-
##############################################################################
#
# Author: Dave Lasley <dave@laslabs.com>
# Copyright: 2015 LasLabs, Inc [https://laslabs.com]
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Dave Lasley <dave@laslabs.com>
# Copyright: 2015 LasLabs, Inc [https://laslabs.com]
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affe... | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Dave Lasley <dave@laslabs.com>
# Copyright: 2015 LasLabs, Inc [https://laslabs.com]
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affe... | <commit_before># -*- coding: utf-8 -*-
##############################################################################
#
# Author: Dave Lasley <dave@laslabs.com>
# Copyright: 2015 LasLabs, Inc [https://laslabs.com]
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
60951f30d8b5e2a450c13aa2b146be14ceb53c4d | rolldembones.py | rolldembones.py | #!/usr/bin/python
import argparse
import dice
def main():
roller = dice.Roller(args)
for repeat in range(args.repeats):
roller.do_roll()
for result in roller:
if isinstance(result, list):
print(' '.join(map(str, result)))
else:
... | #!/usr/bin/python3
import argparse
import dice
def main():
roller = dice.Roller(args)
for repeat in range(args.repeats):
roller.do_roll()
for result in roller:
if isinstance(result, list):
print(' '.join(map(str, result)))
else:
... | Update shebang to request python 3 | Update shebang to request python 3
| Python | mit | aurule/rolldembones | #!/usr/bin/python
import argparse
import dice
def main():
roller = dice.Roller(args)
for repeat in range(args.repeats):
roller.do_roll()
for result in roller:
if isinstance(result, list):
print(' '.join(map(str, result)))
else:
... | #!/usr/bin/python3
import argparse
import dice
def main():
roller = dice.Roller(args)
for repeat in range(args.repeats):
roller.do_roll()
for result in roller:
if isinstance(result, list):
print(' '.join(map(str, result)))
else:
... | <commit_before>#!/usr/bin/python
import argparse
import dice
def main():
roller = dice.Roller(args)
for repeat in range(args.repeats):
roller.do_roll()
for result in roller:
if isinstance(result, list):
print(' '.join(map(str, result)))
else:... | #!/usr/bin/python3
import argparse
import dice
def main():
roller = dice.Roller(args)
for repeat in range(args.repeats):
roller.do_roll()
for result in roller:
if isinstance(result, list):
print(' '.join(map(str, result)))
else:
... | #!/usr/bin/python
import argparse
import dice
def main():
roller = dice.Roller(args)
for repeat in range(args.repeats):
roller.do_roll()
for result in roller:
if isinstance(result, list):
print(' '.join(map(str, result)))
else:
... | <commit_before>#!/usr/bin/python
import argparse
import dice
def main():
roller = dice.Roller(args)
for repeat in range(args.repeats):
roller.do_roll()
for result in roller:
if isinstance(result, list):
print(' '.join(map(str, result)))
else:... |
0f67d19a2cc38d8781946e20f6cd17b5287848a4 | common/djangoapps/track/backends/logger.py | common/djangoapps/track/backends/logger.py | """Event tracker backend that saves events to a python logger."""
from __future__ import absolute_import
import logging
import json
from django.conf import settings
from track.backends import BaseBackend
from track.utils import DateTimeJSONEncoder
log = logging.getLogger('track.backends.logger')
class LoggerBack... | """Event tracker backend that saves events to a python logger."""
from __future__ import absolute_import
import logging
import json
from django.conf import settings
from track.backends import BaseBackend
from track.utils import DateTimeJSONEncoder
log = logging.getLogger('track.backends.logger')
application_log = ... | Add logging for UnicodeDecodeError excpetion LoggerBackend | Add logging for UnicodeDecodeError excpetion LoggerBackend
| Python | agpl-3.0 | cognitiveclass/edx-platform,jolyonb/edx-platform,miptliot/edx-platform,jjmiranda/edx-platform,ZLLab-Mooc/edx-platform,procangroup/edx-platform,edx-solutions/edx-platform,jjmiranda/edx-platform,synergeticsedx/deployment-wipro,edx/edx-platform,UOMx/edx-platform,defance/edx-platform,EDUlib/edx-platform,raccoongang/edx-pla... | """Event tracker backend that saves events to a python logger."""
from __future__ import absolute_import
import logging
import json
from django.conf import settings
from track.backends import BaseBackend
from track.utils import DateTimeJSONEncoder
log = logging.getLogger('track.backends.logger')
class LoggerBack... | """Event tracker backend that saves events to a python logger."""
from __future__ import absolute_import
import logging
import json
from django.conf import settings
from track.backends import BaseBackend
from track.utils import DateTimeJSONEncoder
log = logging.getLogger('track.backends.logger')
application_log = ... | <commit_before>"""Event tracker backend that saves events to a python logger."""
from __future__ import absolute_import
import logging
import json
from django.conf import settings
from track.backends import BaseBackend
from track.utils import DateTimeJSONEncoder
log = logging.getLogger('track.backends.logger')
c... | """Event tracker backend that saves events to a python logger."""
from __future__ import absolute_import
import logging
import json
from django.conf import settings
from track.backends import BaseBackend
from track.utils import DateTimeJSONEncoder
log = logging.getLogger('track.backends.logger')
application_log = ... | """Event tracker backend that saves events to a python logger."""
from __future__ import absolute_import
import logging
import json
from django.conf import settings
from track.backends import BaseBackend
from track.utils import DateTimeJSONEncoder
log = logging.getLogger('track.backends.logger')
class LoggerBack... | <commit_before>"""Event tracker backend that saves events to a python logger."""
from __future__ import absolute_import
import logging
import json
from django.conf import settings
from track.backends import BaseBackend
from track.utils import DateTimeJSONEncoder
log = logging.getLogger('track.backends.logger')
c... |
8fc274021a8c0813f3fc3568d1d7984112952b9c | pytilemap/qtsupport.py | pytilemap/qtsupport.py |
import sys
import sip
import qtpy
__all__ = [
'getQVariantValue',
'wheelAngleDelta',
]
try:
if qtpy.PYQT5:
QVARIANT_API = 2
else:
QVARIANT_API = sip.getapi('QVariant')
except ValueError:
QVARIANT_API = 1
if QVARIANT_API == 1:
def getQVariantValue(variant):
return ... |
import sys
import sip
import qtpy
__all__ = [
'getQVariantValue',
'wheelAngleDelta',
]
try:
if qtpy.PYQT5:
QVARIANT_API = 2
else:
QVARIANT_API = sip.getapi('QVariant')
except ValueError:
QVARIANT_API = 1
if QVARIANT_API == 1:
def getQVariantValue(variant):
return ... | Use Cache location instead of temp folder | Use Cache location instead of temp folder
| Python | mit | allebacco/PyTileMap |
import sys
import sip
import qtpy
__all__ = [
'getQVariantValue',
'wheelAngleDelta',
]
try:
if qtpy.PYQT5:
QVARIANT_API = 2
else:
QVARIANT_API = sip.getapi('QVariant')
except ValueError:
QVARIANT_API = 1
if QVARIANT_API == 1:
def getQVariantValue(variant):
return ... |
import sys
import sip
import qtpy
__all__ = [
'getQVariantValue',
'wheelAngleDelta',
]
try:
if qtpy.PYQT5:
QVARIANT_API = 2
else:
QVARIANT_API = sip.getapi('QVariant')
except ValueError:
QVARIANT_API = 1
if QVARIANT_API == 1:
def getQVariantValue(variant):
return ... | <commit_before>
import sys
import sip
import qtpy
__all__ = [
'getQVariantValue',
'wheelAngleDelta',
]
try:
if qtpy.PYQT5:
QVARIANT_API = 2
else:
QVARIANT_API = sip.getapi('QVariant')
except ValueError:
QVARIANT_API = 1
if QVARIANT_API == 1:
def getQVariantValue(variant):
... |
import sys
import sip
import qtpy
__all__ = [
'getQVariantValue',
'wheelAngleDelta',
]
try:
if qtpy.PYQT5:
QVARIANT_API = 2
else:
QVARIANT_API = sip.getapi('QVariant')
except ValueError:
QVARIANT_API = 1
if QVARIANT_API == 1:
def getQVariantValue(variant):
return ... |
import sys
import sip
import qtpy
__all__ = [
'getQVariantValue',
'wheelAngleDelta',
]
try:
if qtpy.PYQT5:
QVARIANT_API = 2
else:
QVARIANT_API = sip.getapi('QVariant')
except ValueError:
QVARIANT_API = 1
if QVARIANT_API == 1:
def getQVariantValue(variant):
return ... | <commit_before>
import sys
import sip
import qtpy
__all__ = [
'getQVariantValue',
'wheelAngleDelta',
]
try:
if qtpy.PYQT5:
QVARIANT_API = 2
else:
QVARIANT_API = sip.getapi('QVariant')
except ValueError:
QVARIANT_API = 1
if QVARIANT_API == 1:
def getQVariantValue(variant):
... |
4fd6abddcc3457e53046f5a1c1bcc277083a8b15 | entrypoint.py | entrypoint.py | #!/usr/bin/python3
#
# Define containerized environment for running Diosix on Qemu
#
# On Google Cloud Run: Creates HTTP server on port 8080
# or whatever was specified using the PORT system variable.
# Use this to signal the build was successful and the container\
# can be run via the command line.
#
# On all other en... | #!/usr/bin/python3
#
# Define containerized environment for running Diosix on Qemu
#
# On Google Cloud Run: Creates HTTP server on port 8080
# or whatever was specified using the PORT system variable.
# Outputs via the HTTP port. This requires K_SERVICE to be set.
#
# On all other environments: Log to stdout
#
# syntax... | Debug Google Cloud Run support | Debug Google Cloud Run support
| Python | mit | diodesign/diosix | #!/usr/bin/python3
#
# Define containerized environment for running Diosix on Qemu
#
# On Google Cloud Run: Creates HTTP server on port 8080
# or whatever was specified using the PORT system variable.
# Use this to signal the build was successful and the container\
# can be run via the command line.
#
# On all other en... | #!/usr/bin/python3
#
# Define containerized environment for running Diosix on Qemu
#
# On Google Cloud Run: Creates HTTP server on port 8080
# or whatever was specified using the PORT system variable.
# Outputs via the HTTP port. This requires K_SERVICE to be set.
#
# On all other environments: Log to stdout
#
# syntax... | <commit_before>#!/usr/bin/python3
#
# Define containerized environment for running Diosix on Qemu
#
# On Google Cloud Run: Creates HTTP server on port 8080
# or whatever was specified using the PORT system variable.
# Use this to signal the build was successful and the container\
# can be run via the command line.
#
# ... | #!/usr/bin/python3
#
# Define containerized environment for running Diosix on Qemu
#
# On Google Cloud Run: Creates HTTP server on port 8080
# or whatever was specified using the PORT system variable.
# Outputs via the HTTP port. This requires K_SERVICE to be set.
#
# On all other environments: Log to stdout
#
# syntax... | #!/usr/bin/python3
#
# Define containerized environment for running Diosix on Qemu
#
# On Google Cloud Run: Creates HTTP server on port 8080
# or whatever was specified using the PORT system variable.
# Use this to signal the build was successful and the container\
# can be run via the command line.
#
# On all other en... | <commit_before>#!/usr/bin/python3
#
# Define containerized environment for running Diosix on Qemu
#
# On Google Cloud Run: Creates HTTP server on port 8080
# or whatever was specified using the PORT system variable.
# Use this to signal the build was successful and the container\
# can be run via the command line.
#
# ... |
739cf9a93afd9c742675e24cc637634e67d2c3b9 | src/lavatory/utils/get_artifactory_info.py | src/lavatory/utils/get_artifactory_info.py | """Helper method for getting artifactory information."""
import logging
from .artifactory import Artifactory
def get_artifactory_info(repo_names=None, repo_type='local'):
"""Get storage info from Artifactory.
Args:
repo_names (tuple, optional): Name of artifactory repo.
repo_type (str): Type... | """Helper method for getting artifactory information."""
import logging
import requests
from .artifactory import Artifactory
def _artifactory(artifactory=None, repo_names=None):
if not artifactory:
artifactory = Artifactory(repo_name=repo_names)
return artifactory
def get_storage(repo_names=None, ... | Add storage and repo helper functions | feat: Add storage and repo helper functions
| Python | apache-2.0 | gogoair/lavatory | """Helper method for getting artifactory information."""
import logging
from .artifactory import Artifactory
def get_artifactory_info(repo_names=None, repo_type='local'):
"""Get storage info from Artifactory.
Args:
repo_names (tuple, optional): Name of artifactory repo.
repo_type (str): Type... | """Helper method for getting artifactory information."""
import logging
import requests
from .artifactory import Artifactory
def _artifactory(artifactory=None, repo_names=None):
if not artifactory:
artifactory = Artifactory(repo_name=repo_names)
return artifactory
def get_storage(repo_names=None, ... | <commit_before>"""Helper method for getting artifactory information."""
import logging
from .artifactory import Artifactory
def get_artifactory_info(repo_names=None, repo_type='local'):
"""Get storage info from Artifactory.
Args:
repo_names (tuple, optional): Name of artifactory repo.
repo_t... | """Helper method for getting artifactory information."""
import logging
import requests
from .artifactory import Artifactory
def _artifactory(artifactory=None, repo_names=None):
if not artifactory:
artifactory = Artifactory(repo_name=repo_names)
return artifactory
def get_storage(repo_names=None, ... | """Helper method for getting artifactory information."""
import logging
from .artifactory import Artifactory
def get_artifactory_info(repo_names=None, repo_type='local'):
"""Get storage info from Artifactory.
Args:
repo_names (tuple, optional): Name of artifactory repo.
repo_type (str): Type... | <commit_before>"""Helper method for getting artifactory information."""
import logging
from .artifactory import Artifactory
def get_artifactory_info(repo_names=None, repo_type='local'):
"""Get storage info from Artifactory.
Args:
repo_names (tuple, optional): Name of artifactory repo.
repo_t... |
06b99c4415a6605cbd6123271d44af96585fbb9d | conda_env/exceptions.py | conda_env/exceptions.py | class CondaEnvException(Exception):
pass
class EnvironmentFileNotFound(CondaEnvException):
def __init__(self, filename, *args, **kwargs):
msg = '{} file not found'.format(filename)
self.filename = filename
super(EnvironmentFileNotFound, self).__init__(msg, *args, **kwargs)
| class CondaEnvException(Exception):
pass
class EnvironmentFileNotFound(CondaEnvException):
def __init__(self, filename, *args, **kwargs):
msg = '{} file not found'.format(filename)
self.filename = filename
super(EnvironmentFileNotFound, self).__init__(msg, *args, **kwargs)
class Envi... | Add environment not found exception | Add environment not found exception
| Python | bsd-3-clause | nicoddemus/conda-env,mikecroucher/conda-env,dan-blanchard/conda-env,conda/conda-env,dan-blanchard/conda-env,phobson/conda-env,conda/conda-env,ESSS/conda-env,mikecroucher/conda-env,asmeurer/conda-env,nicoddemus/conda-env,ESSS/conda-env,phobson/conda-env,isaac-kit/conda-env,asmeurer/conda-env,isaac-kit/conda-env | class CondaEnvException(Exception):
pass
class EnvironmentFileNotFound(CondaEnvException):
def __init__(self, filename, *args, **kwargs):
msg = '{} file not found'.format(filename)
self.filename = filename
super(EnvironmentFileNotFound, self).__init__(msg, *args, **kwargs)
Add environm... | class CondaEnvException(Exception):
pass
class EnvironmentFileNotFound(CondaEnvException):
def __init__(self, filename, *args, **kwargs):
msg = '{} file not found'.format(filename)
self.filename = filename
super(EnvironmentFileNotFound, self).__init__(msg, *args, **kwargs)
class Envi... | <commit_before>class CondaEnvException(Exception):
pass
class EnvironmentFileNotFound(CondaEnvException):
def __init__(self, filename, *args, **kwargs):
msg = '{} file not found'.format(filename)
self.filename = filename
super(EnvironmentFileNotFound, self).__init__(msg, *args, **kwarg... | class CondaEnvException(Exception):
pass
class EnvironmentFileNotFound(CondaEnvException):
def __init__(self, filename, *args, **kwargs):
msg = '{} file not found'.format(filename)
self.filename = filename
super(EnvironmentFileNotFound, self).__init__(msg, *args, **kwargs)
class Envi... | class CondaEnvException(Exception):
pass
class EnvironmentFileNotFound(CondaEnvException):
def __init__(self, filename, *args, **kwargs):
msg = '{} file not found'.format(filename)
self.filename = filename
super(EnvironmentFileNotFound, self).__init__(msg, *args, **kwargs)
Add environm... | <commit_before>class CondaEnvException(Exception):
pass
class EnvironmentFileNotFound(CondaEnvException):
def __init__(self, filename, *args, **kwargs):
msg = '{} file not found'.format(filename)
self.filename = filename
super(EnvironmentFileNotFound, self).__init__(msg, *args, **kwarg... |
484f42b6fc1a8129a53480bc6e7913c5c7d58f46 | froide/foirequest/search_indexes.py | froide/foirequest/search_indexes.py | from haystack import indexes
from celery_haystack.indexes import CelerySearchIndex
from .models import FoiRequest
class FoiRequestIndex(CelerySearchIndex, indexes.Indexable):
text = indexes.EdgeNgramField(document=True, use_template=True)
title = indexes.CharField(model_attr='title')
description = index... | from haystack import indexes
from celery_haystack.indexes import CelerySearchIndex
from .models import FoiRequest
class FoiRequestIndex(CelerySearchIndex, indexes.Indexable):
text = indexes.EdgeNgramField(document=True, use_template=True)
title = indexes.CharField(model_attr='title')
description = index... | Index only FoiRequests marked is_foi | Index only FoiRequests marked is_foi | Python | mit | fin/froide,CodeforHawaii/froide,catcosmo/froide,okfse/froide,LilithWittmann/froide,stefanw/froide,catcosmo/froide,catcosmo/froide,okfse/froide,fin/froide,ryankanno/froide,stefanw/froide,CodeforHawaii/froide,okfse/froide,LilithWittmann/froide,CodeforHawaii/froide,ryankanno/froide,ryankanno/froide,stefanw/froide,LilithWi... | from haystack import indexes
from celery_haystack.indexes import CelerySearchIndex
from .models import FoiRequest
class FoiRequestIndex(CelerySearchIndex, indexes.Indexable):
text = indexes.EdgeNgramField(document=True, use_template=True)
title = indexes.CharField(model_attr='title')
description = index... | from haystack import indexes
from celery_haystack.indexes import CelerySearchIndex
from .models import FoiRequest
class FoiRequestIndex(CelerySearchIndex, indexes.Indexable):
text = indexes.EdgeNgramField(document=True, use_template=True)
title = indexes.CharField(model_attr='title')
description = index... | <commit_before>from haystack import indexes
from celery_haystack.indexes import CelerySearchIndex
from .models import FoiRequest
class FoiRequestIndex(CelerySearchIndex, indexes.Indexable):
text = indexes.EdgeNgramField(document=True, use_template=True)
title = indexes.CharField(model_attr='title')
desc... | from haystack import indexes
from celery_haystack.indexes import CelerySearchIndex
from .models import FoiRequest
class FoiRequestIndex(CelerySearchIndex, indexes.Indexable):
text = indexes.EdgeNgramField(document=True, use_template=True)
title = indexes.CharField(model_attr='title')
description = index... | from haystack import indexes
from celery_haystack.indexes import CelerySearchIndex
from .models import FoiRequest
class FoiRequestIndex(CelerySearchIndex, indexes.Indexable):
text = indexes.EdgeNgramField(document=True, use_template=True)
title = indexes.CharField(model_attr='title')
description = index... | <commit_before>from haystack import indexes
from celery_haystack.indexes import CelerySearchIndex
from .models import FoiRequest
class FoiRequestIndex(CelerySearchIndex, indexes.Indexable):
text = indexes.EdgeNgramField(document=True, use_template=True)
title = indexes.CharField(model_attr='title')
desc... |
359595413071ff706b484a875a23a4a7d1508f50 | bindings/python/llvm/tests/base.py | bindings/python/llvm/tests/base.py | import os.path
import unittest
POSSIBLE_TEST_BINARIES = [
'libreadline.so.5',
'libreadline.so.6',
]
POSSIBLE_TEST_BINARY_PATHS = [
'/lib',
'/usr/lib',
'/usr/local/lib',
]
class TestBase(unittest.TestCase):
def get_test_binary(self):
"""Helper to obtain a test binary for object file te... | import os.path
import unittest
POSSIBLE_TEST_BINARIES = [
'libreadline.so.5',
'libreadline.so.6',
]
POSSIBLE_TEST_BINARY_PATHS = [
'/lib',
'/usr/lib',
'/usr/local/lib',
]
class TestBase(unittest.TestCase):
def get_test_binary(self):
"""Helper to obtain a test binary for object file te... | Mark get_test_binary as not being a test | [python] Mark get_test_binary as not being a test
get_test_binary is a helper method, not a test, make sure nosetests
doesn't pick it up as a test.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@153173 91177308-0d34-0410-b5e6-96231b3b80d8
| Python | apache-2.0 | llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift... | import os.path
import unittest
POSSIBLE_TEST_BINARIES = [
'libreadline.so.5',
'libreadline.so.6',
]
POSSIBLE_TEST_BINARY_PATHS = [
'/lib',
'/usr/lib',
'/usr/local/lib',
]
class TestBase(unittest.TestCase):
def get_test_binary(self):
"""Helper to obtain a test binary for object file te... | import os.path
import unittest
POSSIBLE_TEST_BINARIES = [
'libreadline.so.5',
'libreadline.so.6',
]
POSSIBLE_TEST_BINARY_PATHS = [
'/lib',
'/usr/lib',
'/usr/local/lib',
]
class TestBase(unittest.TestCase):
def get_test_binary(self):
"""Helper to obtain a test binary for object file te... | <commit_before>import os.path
import unittest
POSSIBLE_TEST_BINARIES = [
'libreadline.so.5',
'libreadline.so.6',
]
POSSIBLE_TEST_BINARY_PATHS = [
'/lib',
'/usr/lib',
'/usr/local/lib',
]
class TestBase(unittest.TestCase):
def get_test_binary(self):
"""Helper to obtain a test binary for... | import os.path
import unittest
POSSIBLE_TEST_BINARIES = [
'libreadline.so.5',
'libreadline.so.6',
]
POSSIBLE_TEST_BINARY_PATHS = [
'/lib',
'/usr/lib',
'/usr/local/lib',
]
class TestBase(unittest.TestCase):
def get_test_binary(self):
"""Helper to obtain a test binary for object file te... | import os.path
import unittest
POSSIBLE_TEST_BINARIES = [
'libreadline.so.5',
'libreadline.so.6',
]
POSSIBLE_TEST_BINARY_PATHS = [
'/lib',
'/usr/lib',
'/usr/local/lib',
]
class TestBase(unittest.TestCase):
def get_test_binary(self):
"""Helper to obtain a test binary for object file te... | <commit_before>import os.path
import unittest
POSSIBLE_TEST_BINARIES = [
'libreadline.so.5',
'libreadline.so.6',
]
POSSIBLE_TEST_BINARY_PATHS = [
'/lib',
'/usr/lib',
'/usr/local/lib',
]
class TestBase(unittest.TestCase):
def get_test_binary(self):
"""Helper to obtain a test binary for... |
50442966938b532cc759089692ffb52e94c6e89b | config_example.py | config_example.py | """Example config.py"""
webhook_urls = ["DISCORD WEBHOOK", "DISCORD WEBHOOK"] # Used to update webhooks on Discord
key_path = "/path/to/key/in/format/of/file.pem" # Private key to sign the file
file_path = "/path/to/folder" # Path to save the file to
lzss_path = "/path/to/lzss" # Path to lzss
production = None # Use p... | """Example config.py"""
webhook_urls = ["DISCORD WEBHOOK", "DISCORD WEBHOOK"] # Used to update webhooks on Discord
key_path = "/path/to/key/in/format/of/file.pem" # Private key to sign the file
file_path = "/path/to/folder" # Path to save the file to
lzss_path = "/path/to/lzss" # Path to lzss
production = None # ... | Fix PEP 8 coding violations | Fix PEP 8 coding violations
| Python | agpl-3.0 | RiiConnect24/File-Maker,RiiConnect24/File-Maker | """Example config.py"""
webhook_urls = ["DISCORD WEBHOOK", "DISCORD WEBHOOK"] # Used to update webhooks on Discord
key_path = "/path/to/key/in/format/of/file.pem" # Private key to sign the file
file_path = "/path/to/folder" # Path to save the file to
lzss_path = "/path/to/lzss" # Path to lzss
production = None # Use p... | """Example config.py"""
webhook_urls = ["DISCORD WEBHOOK", "DISCORD WEBHOOK"] # Used to update webhooks on Discord
key_path = "/path/to/key/in/format/of/file.pem" # Private key to sign the file
file_path = "/path/to/folder" # Path to save the file to
lzss_path = "/path/to/lzss" # Path to lzss
production = None # ... | <commit_before>"""Example config.py"""
webhook_urls = ["DISCORD WEBHOOK", "DISCORD WEBHOOK"] # Used to update webhooks on Discord
key_path = "/path/to/key/in/format/of/file.pem" # Private key to sign the file
file_path = "/path/to/folder" # Path to save the file to
lzss_path = "/path/to/lzss" # Path to lzss
production... | """Example config.py"""
webhook_urls = ["DISCORD WEBHOOK", "DISCORD WEBHOOK"] # Used to update webhooks on Discord
key_path = "/path/to/key/in/format/of/file.pem" # Private key to sign the file
file_path = "/path/to/folder" # Path to save the file to
lzss_path = "/path/to/lzss" # Path to lzss
production = None # ... | """Example config.py"""
webhook_urls = ["DISCORD WEBHOOK", "DISCORD WEBHOOK"] # Used to update webhooks on Discord
key_path = "/path/to/key/in/format/of/file.pem" # Private key to sign the file
file_path = "/path/to/folder" # Path to save the file to
lzss_path = "/path/to/lzss" # Path to lzss
production = None # Use p... | <commit_before>"""Example config.py"""
webhook_urls = ["DISCORD WEBHOOK", "DISCORD WEBHOOK"] # Used to update webhooks on Discord
key_path = "/path/to/key/in/format/of/file.pem" # Private key to sign the file
file_path = "/path/to/folder" # Path to save the file to
lzss_path = "/path/to/lzss" # Path to lzss
production... |
b085d519da9869be8c4bc4f56cb0e040a6b1525b | build/combine.py | build/combine.py | import os, sys, re
from simplejson import load as json
from simplejson import dumps as dump
from glob import glob
VERSION = 0.1
all = []
for p in glob("../plugins/*.json"):
fp = open(p, "r")
x = json(fp, "utf-8")
x['date'] = int(os.path.getmtime(p) * 1000)
fp.close()
all += x,
fp = open(... | import os, sys, re
try:
from simplejson import load as json
from simplejson import dumps as dump
except:
from json import load as json
from json import dumps as dump
from glob import glob
VERSION = 0.1
all = []
for p in glob("../plugins/*.json"):
fp = open(p, "r")
x = json(fp, "utf-8")
... | Use json standard module if simplejson is not present | Use json standard module if simplejson is not present | Python | mpl-2.0 | marianocarrazana/anticontainer,downthemall/anticontainer,downthemall/anticontainer,marianocarrazana/anticontainer,downthemall/anticontainer,marianocarrazana/anticontainer | import os, sys, re
from simplejson import load as json
from simplejson import dumps as dump
from glob import glob
VERSION = 0.1
all = []
for p in glob("../plugins/*.json"):
fp = open(p, "r")
x = json(fp, "utf-8")
x['date'] = int(os.path.getmtime(p) * 1000)
fp.close()
all += x,
fp = open(... | import os, sys, re
try:
from simplejson import load as json
from simplejson import dumps as dump
except:
from json import load as json
from json import dumps as dump
from glob import glob
VERSION = 0.1
all = []
for p in glob("../plugins/*.json"):
fp = open(p, "r")
x = json(fp, "utf-8")
... | <commit_before>import os, sys, re
from simplejson import load as json
from simplejson import dumps as dump
from glob import glob
VERSION = 0.1
all = []
for p in glob("../plugins/*.json"):
fp = open(p, "r")
x = json(fp, "utf-8")
x['date'] = int(os.path.getmtime(p) * 1000)
fp.close()
all += x,
... | import os, sys, re
try:
from simplejson import load as json
from simplejson import dumps as dump
except:
from json import load as json
from json import dumps as dump
from glob import glob
VERSION = 0.1
all = []
for p in glob("../plugins/*.json"):
fp = open(p, "r")
x = json(fp, "utf-8")
... | import os, sys, re
from simplejson import load as json
from simplejson import dumps as dump
from glob import glob
VERSION = 0.1
all = []
for p in glob("../plugins/*.json"):
fp = open(p, "r")
x = json(fp, "utf-8")
x['date'] = int(os.path.getmtime(p) * 1000)
fp.close()
all += x,
fp = open(... | <commit_before>import os, sys, re
from simplejson import load as json
from simplejson import dumps as dump
from glob import glob
VERSION = 0.1
all = []
for p in glob("../plugins/*.json"):
fp = open(p, "r")
x = json(fp, "utf-8")
x['date'] = int(os.path.getmtime(p) * 1000)
fp.close()
all += x,
... |
0b77033563ab85c98ca5ea9c190bcee4da5c6aef | sanic_sentry.py | sanic_sentry.py | import logging
import sanic
import raven
import raven_aiohttp
from raven.handlers.logging import SentryHandler
try:
from sanic.log import logger
except ImportError:
logger = logging.getLogger('sanic')
class SanicSentry:
def __init__(self, app=None):
self.app = None
self.handler = None
... | import logging
import sanic
import raven
import raven_aiohttp
from raven.handlers.logging import SentryHandler
try:
from sanic.log import logger
except ImportError:
logger = logging.getLogger('sanic')
class SanicSentry:
def __init__(self, app=None):
self.app = None
self.handler = None
... | Add a default value for SENTRY_PARAMS | Add a default value for SENTRY_PARAMS
| Python | mit | serathius/sanic-sentry | import logging
import sanic
import raven
import raven_aiohttp
from raven.handlers.logging import SentryHandler
try:
from sanic.log import logger
except ImportError:
logger = logging.getLogger('sanic')
class SanicSentry:
def __init__(self, app=None):
self.app = None
self.handler = None
... | import logging
import sanic
import raven
import raven_aiohttp
from raven.handlers.logging import SentryHandler
try:
from sanic.log import logger
except ImportError:
logger = logging.getLogger('sanic')
class SanicSentry:
def __init__(self, app=None):
self.app = None
self.handler = None
... | <commit_before>import logging
import sanic
import raven
import raven_aiohttp
from raven.handlers.logging import SentryHandler
try:
from sanic.log import logger
except ImportError:
logger = logging.getLogger('sanic')
class SanicSentry:
def __init__(self, app=None):
self.app = None
self.h... | import logging
import sanic
import raven
import raven_aiohttp
from raven.handlers.logging import SentryHandler
try:
from sanic.log import logger
except ImportError:
logger = logging.getLogger('sanic')
class SanicSentry:
def __init__(self, app=None):
self.app = None
self.handler = None
... | import logging
import sanic
import raven
import raven_aiohttp
from raven.handlers.logging import SentryHandler
try:
from sanic.log import logger
except ImportError:
logger = logging.getLogger('sanic')
class SanicSentry:
def __init__(self, app=None):
self.app = None
self.handler = None
... | <commit_before>import logging
import sanic
import raven
import raven_aiohttp
from raven.handlers.logging import SentryHandler
try:
from sanic.log import logger
except ImportError:
logger = logging.getLogger('sanic')
class SanicSentry:
def __init__(self, app=None):
self.app = None
self.h... |
aaa7da2b43ab08758456c972cd2bd727082c835d | build/release.py | build/release.py | #!/usr/bin/env python
import os
import sys
import shutil
import subprocess
from zipfile import ZipFile
if len(sys.argv) != 2:
print 'Usage: release.py version-number'
sys.exit(1)
version = sys.argv[1]
work_dir = 'minified'
name = 'goo-' + version
# Root directory inside zip file
zip_root = name + '/'
prin... | #!/usr/bin/env python
import os
import sys
import shutil
import subprocess
from zipfile import ZipFile
def prepend(filename, to_prepend):
"""Prepends a string to a file
"""
with open(filename, 'r') as stream:
content = stream.read()
with open(filename, 'w') as stream:
stream.write(to_prepend)
stream.write... | Add version number and copyright to goo.js | Add version number and copyright to goo.js
This is useful to keep track of which engine version the tool uses, story #294
| Python | mit | GooTechnologies/goojs,GooTechnologies/goojs,GooTechnologies/goojs | #!/usr/bin/env python
import os
import sys
import shutil
import subprocess
from zipfile import ZipFile
if len(sys.argv) != 2:
print 'Usage: release.py version-number'
sys.exit(1)
version = sys.argv[1]
work_dir = 'minified'
name = 'goo-' + version
# Root directory inside zip file
zip_root = name + '/'
prin... | #!/usr/bin/env python
import os
import sys
import shutil
import subprocess
from zipfile import ZipFile
def prepend(filename, to_prepend):
"""Prepends a string to a file
"""
with open(filename, 'r') as stream:
content = stream.read()
with open(filename, 'w') as stream:
stream.write(to_prepend)
stream.write... | <commit_before>#!/usr/bin/env python
import os
import sys
import shutil
import subprocess
from zipfile import ZipFile
if len(sys.argv) != 2:
print 'Usage: release.py version-number'
sys.exit(1)
version = sys.argv[1]
work_dir = 'minified'
name = 'goo-' + version
# Root directory inside zip file
zip_root = n... | #!/usr/bin/env python
import os
import sys
import shutil
import subprocess
from zipfile import ZipFile
def prepend(filename, to_prepend):
"""Prepends a string to a file
"""
with open(filename, 'r') as stream:
content = stream.read()
with open(filename, 'w') as stream:
stream.write(to_prepend)
stream.write... | #!/usr/bin/env python
import os
import sys
import shutil
import subprocess
from zipfile import ZipFile
if len(sys.argv) != 2:
print 'Usage: release.py version-number'
sys.exit(1)
version = sys.argv[1]
work_dir = 'minified'
name = 'goo-' + version
# Root directory inside zip file
zip_root = name + '/'
prin... | <commit_before>#!/usr/bin/env python
import os
import sys
import shutil
import subprocess
from zipfile import ZipFile
if len(sys.argv) != 2:
print 'Usage: release.py version-number'
sys.exit(1)
version = sys.argv[1]
work_dir = 'minified'
name = 'goo-' + version
# Root directory inside zip file
zip_root = n... |
1c3f89110ede8998b63831c181c44e92709481b6 | demo/widgy.py | demo/widgy.py | from __future__ import absolute_import
from widgy.site import WidgySite
class DemoWidgySite(WidgySite):
def valid_parent_of(self, parent, child_class, obj=None):
if isinstance(parent, I18NLayout):
return True
else:
return super(DemoWidgySite, self).valid_parent_of(parent, ... | from __future__ import absolute_import
from widgy.site import ReviewedWidgySite
class DemoWidgySite(ReviewedWidgySite):
def valid_parent_of(self, parent, child_class, obj=None):
if isinstance(parent, I18NLayout):
return True
else:
return super(DemoWidgySite, self).valid_pa... | Enable the review queue on the demo site | Enable the review queue on the demo site
| Python | apache-2.0 | j00bar/django-widgy,j00bar/django-widgy,j00bar/django-widgy | from __future__ import absolute_import
from widgy.site import WidgySite
class DemoWidgySite(WidgySite):
def valid_parent_of(self, parent, child_class, obj=None):
if isinstance(parent, I18NLayout):
return True
else:
return super(DemoWidgySite, self).valid_parent_of(parent, ... | from __future__ import absolute_import
from widgy.site import ReviewedWidgySite
class DemoWidgySite(ReviewedWidgySite):
def valid_parent_of(self, parent, child_class, obj=None):
if isinstance(parent, I18NLayout):
return True
else:
return super(DemoWidgySite, self).valid_pa... | <commit_before>from __future__ import absolute_import
from widgy.site import WidgySite
class DemoWidgySite(WidgySite):
def valid_parent_of(self, parent, child_class, obj=None):
if isinstance(parent, I18NLayout):
return True
else:
return super(DemoWidgySite, self).valid_par... | from __future__ import absolute_import
from widgy.site import ReviewedWidgySite
class DemoWidgySite(ReviewedWidgySite):
def valid_parent_of(self, parent, child_class, obj=None):
if isinstance(parent, I18NLayout):
return True
else:
return super(DemoWidgySite, self).valid_pa... | from __future__ import absolute_import
from widgy.site import WidgySite
class DemoWidgySite(WidgySite):
def valid_parent_of(self, parent, child_class, obj=None):
if isinstance(parent, I18NLayout):
return True
else:
return super(DemoWidgySite, self).valid_parent_of(parent, ... | <commit_before>from __future__ import absolute_import
from widgy.site import WidgySite
class DemoWidgySite(WidgySite):
def valid_parent_of(self, parent, child_class, obj=None):
if isinstance(parent, I18NLayout):
return True
else:
return super(DemoWidgySite, self).valid_par... |
ea09470ebdd69af2fa1d7d07d7b04fe3ff857987 | raffle.py | raffle.py | """
St. George Game
raffle.py
Sage Berg
Created: 9 Dec 2014
"""
from random import randint
class Raffle(object):
"""
Raffle contains a list of action objects, one of which
will be chosen and shown to the player.
"""
def __init__(self):
self.options = dict() # Maps options to weights
... | """
St. George Game
raffle.py
Sage Berg
Created: 9 Dec 2014
"""
from random import randint
class Raffle(object):
"""
Raffle contains a list of action objects, one of which
will be chosen and shown to the player.
"""
def __init__(self):
self.options = dict() # Maps options to weights
... | Add length method to Raffle | Add length method to Raffle
| Python | apache-2.0 | SageBerg/St.GeorgeGame,SageBerg/St.GeorgeGame,SageBerg/St.GeorgeGame,SageBerg/St.GeorgeGame | """
St. George Game
raffle.py
Sage Berg
Created: 9 Dec 2014
"""
from random import randint
class Raffle(object):
"""
Raffle contains a list of action objects, one of which
will be chosen and shown to the player.
"""
def __init__(self):
self.options = dict() # Maps options to weights
... | """
St. George Game
raffle.py
Sage Berg
Created: 9 Dec 2014
"""
from random import randint
class Raffle(object):
"""
Raffle contains a list of action objects, one of which
will be chosen and shown to the player.
"""
def __init__(self):
self.options = dict() # Maps options to weights
... | <commit_before>"""
St. George Game
raffle.py
Sage Berg
Created: 9 Dec 2014
"""
from random import randint
class Raffle(object):
"""
Raffle contains a list of action objects, one of which
will be chosen and shown to the player.
"""
def __init__(self):
self.options = dict() # Maps options... | """
St. George Game
raffle.py
Sage Berg
Created: 9 Dec 2014
"""
from random import randint
class Raffle(object):
"""
Raffle contains a list of action objects, one of which
will be chosen and shown to the player.
"""
def __init__(self):
self.options = dict() # Maps options to weights
... | """
St. George Game
raffle.py
Sage Berg
Created: 9 Dec 2014
"""
from random import randint
class Raffle(object):
"""
Raffle contains a list of action objects, one of which
will be chosen and shown to the player.
"""
def __init__(self):
self.options = dict() # Maps options to weights
... | <commit_before>"""
St. George Game
raffle.py
Sage Berg
Created: 9 Dec 2014
"""
from random import randint
class Raffle(object):
"""
Raffle contains a list of action objects, one of which
will be chosen and shown to the player.
"""
def __init__(self):
self.options = dict() # Maps options... |
616e9727397853e8d8f8de5b2c040c99c91e4a50 | gen_settings.py | gen_settings.py | import os
settings = os.path.join(os.path.dirname(__file__),'lib','mapnik_settings.js')
# this goes into a mapnik_settings.js file beside the C++ _mapnik.node
settings_template = """
module.exports.paths = {
'fonts': %s,
'input_plugins': %s
};
"""
def write_mapnik_settings(fonts='undefined',input_plugins='un... | import os
settings = os.path.join(os.path.dirname(__file__),'lib','mapnik_settings.js')
# this goes into a mapnik_settings.js file beside the C++ _mapnik.node
settings_template = """
module.exports.paths = {
'fonts': %s,
'input_plugins': %s
};
"""
def write_mapnik_settings(fonts='undefined',input_plugins='un... | Revert "stop reading fonts/input plugins from environ as we now have a working mapnik-config.bat on windows" | Revert "stop reading fonts/input plugins from environ as we now have a working mapnik-config.bat on windows"
This reverts commit d87c71142ba7bcc0d99d84886f3534dea7617b0c.
| Python | bsd-3-clause | mapnik/node-mapnik,langateam/node-mapnik,mojodna/node-mapnik,CartoDB/node-mapnik,CartoDB/node-mapnik,MaxSem/node-mapnik,gravitystorm/node-mapnik,tomhughes/node-mapnik,mojodna/node-mapnik,tomhughes/node-mapnik,CartoDB/node-mapnik,Uli1/node-mapnik,mojodna/node-mapnik,stefanklug/node-mapnik,CartoDB/node-mapnik,langateam/n... | import os
settings = os.path.join(os.path.dirname(__file__),'lib','mapnik_settings.js')
# this goes into a mapnik_settings.js file beside the C++ _mapnik.node
settings_template = """
module.exports.paths = {
'fonts': %s,
'input_plugins': %s
};
"""
def write_mapnik_settings(fonts='undefined',input_plugins='un... | import os
settings = os.path.join(os.path.dirname(__file__),'lib','mapnik_settings.js')
# this goes into a mapnik_settings.js file beside the C++ _mapnik.node
settings_template = """
module.exports.paths = {
'fonts': %s,
'input_plugins': %s
};
"""
def write_mapnik_settings(fonts='undefined',input_plugins='un... | <commit_before>import os
settings = os.path.join(os.path.dirname(__file__),'lib','mapnik_settings.js')
# this goes into a mapnik_settings.js file beside the C++ _mapnik.node
settings_template = """
module.exports.paths = {
'fonts': %s,
'input_plugins': %s
};
"""
def write_mapnik_settings(fonts='undefined',in... | import os
settings = os.path.join(os.path.dirname(__file__),'lib','mapnik_settings.js')
# this goes into a mapnik_settings.js file beside the C++ _mapnik.node
settings_template = """
module.exports.paths = {
'fonts': %s,
'input_plugins': %s
};
"""
def write_mapnik_settings(fonts='undefined',input_plugins='un... | import os
settings = os.path.join(os.path.dirname(__file__),'lib','mapnik_settings.js')
# this goes into a mapnik_settings.js file beside the C++ _mapnik.node
settings_template = """
module.exports.paths = {
'fonts': %s,
'input_plugins': %s
};
"""
def write_mapnik_settings(fonts='undefined',input_plugins='un... | <commit_before>import os
settings = os.path.join(os.path.dirname(__file__),'lib','mapnik_settings.js')
# this goes into a mapnik_settings.js file beside the C++ _mapnik.node
settings_template = """
module.exports.paths = {
'fonts': %s,
'input_plugins': %s
};
"""
def write_mapnik_settings(fonts='undefined',in... |
bd3473a8514e6d323dd03174ce65ecf278fa3772 | groups/admin.py | groups/admin.py | from django.contrib import admin
from .models import Discussion, Group
class GroupAdmin(admin.ModelAdmin):
filter_horizontal = ('moderators', 'watchers', 'members_if_private')
class Meta:
model = Group
class DiscussionAdmin(admin.ModelAdmin):
filter_horizontal = ('subscribers', 'ignorers')
... | from django.contrib import admin
from .models import Discussion, Group
@admin.register(Group)
class GroupAdmin(admin.ModelAdmin):
filter_horizontal = ('moderators', 'watchers', 'members_if_private')
class Meta:
model = Group
@admin.register(Discussion)
class DiscussionAdmin(admin.ModelAdmin):
... | Use a decorator for slickness. | Use a decorator for slickness.
| Python | bsd-2-clause | incuna/incuna-groups,incuna/incuna-groups | from django.contrib import admin
from .models import Discussion, Group
class GroupAdmin(admin.ModelAdmin):
filter_horizontal = ('moderators', 'watchers', 'members_if_private')
class Meta:
model = Group
class DiscussionAdmin(admin.ModelAdmin):
filter_horizontal = ('subscribers', 'ignorers')
... | from django.contrib import admin
from .models import Discussion, Group
@admin.register(Group)
class GroupAdmin(admin.ModelAdmin):
filter_horizontal = ('moderators', 'watchers', 'members_if_private')
class Meta:
model = Group
@admin.register(Discussion)
class DiscussionAdmin(admin.ModelAdmin):
... | <commit_before>from django.contrib import admin
from .models import Discussion, Group
class GroupAdmin(admin.ModelAdmin):
filter_horizontal = ('moderators', 'watchers', 'members_if_private')
class Meta:
model = Group
class DiscussionAdmin(admin.ModelAdmin):
filter_horizontal = ('subscribers', ... | from django.contrib import admin
from .models import Discussion, Group
@admin.register(Group)
class GroupAdmin(admin.ModelAdmin):
filter_horizontal = ('moderators', 'watchers', 'members_if_private')
class Meta:
model = Group
@admin.register(Discussion)
class DiscussionAdmin(admin.ModelAdmin):
... | from django.contrib import admin
from .models import Discussion, Group
class GroupAdmin(admin.ModelAdmin):
filter_horizontal = ('moderators', 'watchers', 'members_if_private')
class Meta:
model = Group
class DiscussionAdmin(admin.ModelAdmin):
filter_horizontal = ('subscribers', 'ignorers')
... | <commit_before>from django.contrib import admin
from .models import Discussion, Group
class GroupAdmin(admin.ModelAdmin):
filter_horizontal = ('moderators', 'watchers', 'members_if_private')
class Meta:
model = Group
class DiscussionAdmin(admin.ModelAdmin):
filter_horizontal = ('subscribers', ... |
b9cf2145097f8d1c702183a09bf2d54f669e2218 | skimage/filter/__init__.py | skimage/filter/__init__.py | from .lpi_filter import inverse, wiener, LPIFilter2D
from .ctmf import median_filter
from ._canny import canny
from .edges import (sobel, hsobel, vsobel, scharr, hscharr, vscharr, prewitt,
hprewitt, vprewitt, roberts , roberts_positive_diagonal,
roberts_negative_diagonal)
from ._... | from .lpi_filter import inverse, wiener, LPIFilter2D
from .ctmf import median_filter
from ._canny import canny
from .edges import (sobel, hsobel, vsobel, scharr, hscharr, vscharr, prewitt,
hprewitt, vprewitt, roberts , roberts_positive_diagonal,
roberts_negative_diagonal)
from ._... | Add filter.rank to __all__ of filter package | Add filter.rank to __all__ of filter package
| Python | bsd-3-clause | michaelpacer/scikit-image,oew1v07/scikit-image,vighneshbirodkar/scikit-image,michaelpacer/scikit-image,chriscrosscutler/scikit-image,juliusbierk/scikit-image,chintak/scikit-image,GaZ3ll3/scikit-image,warmspringwinds/scikit-image,ajaybhat/scikit-image,robintw/scikit-image,keflavich/scikit-image,chintak/scikit-image,jwig... | from .lpi_filter import inverse, wiener, LPIFilter2D
from .ctmf import median_filter
from ._canny import canny
from .edges import (sobel, hsobel, vsobel, scharr, hscharr, vscharr, prewitt,
hprewitt, vprewitt, roberts , roberts_positive_diagonal,
roberts_negative_diagonal)
from ._... | from .lpi_filter import inverse, wiener, LPIFilter2D
from .ctmf import median_filter
from ._canny import canny
from .edges import (sobel, hsobel, vsobel, scharr, hscharr, vscharr, prewitt,
hprewitt, vprewitt, roberts , roberts_positive_diagonal,
roberts_negative_diagonal)
from ._... | <commit_before>from .lpi_filter import inverse, wiener, LPIFilter2D
from .ctmf import median_filter
from ._canny import canny
from .edges import (sobel, hsobel, vsobel, scharr, hscharr, vscharr, prewitt,
hprewitt, vprewitt, roberts , roberts_positive_diagonal,
roberts_negative_di... | from .lpi_filter import inverse, wiener, LPIFilter2D
from .ctmf import median_filter
from ._canny import canny
from .edges import (sobel, hsobel, vsobel, scharr, hscharr, vscharr, prewitt,
hprewitt, vprewitt, roberts , roberts_positive_diagonal,
roberts_negative_diagonal)
from ._... | from .lpi_filter import inverse, wiener, LPIFilter2D
from .ctmf import median_filter
from ._canny import canny
from .edges import (sobel, hsobel, vsobel, scharr, hscharr, vscharr, prewitt,
hprewitt, vprewitt, roberts , roberts_positive_diagonal,
roberts_negative_diagonal)
from ._... | <commit_before>from .lpi_filter import inverse, wiener, LPIFilter2D
from .ctmf import median_filter
from ._canny import canny
from .edges import (sobel, hsobel, vsobel, scharr, hscharr, vscharr, prewitt,
hprewitt, vprewitt, roberts , roberts_positive_diagonal,
roberts_negative_di... |
98a2b7e11eb3e0d5ddc89a4d40c3d10586e400ab | website/filters/__init__.py | website/filters/__init__.py | import hashlib
import urllib
# Adapted from https://github.com/zzzsochi/Flask-Gravatar/blob/master/flaskext/gravatar.py
def gravatar(user, use_ssl=False, d=None, r=None, size=None):
if use_ssl:
base_url = 'https://secure.gravatar.com/avatar/'
else:
base_url = 'http://www.gravatar.com/avatar/'
... | import hashlib
import urllib
# Adapted from https://github.com/zzzsochi/Flask-Gravatar/blob/master/flaskext/gravatar.py
def gravatar(user, use_ssl=False, d=None, r=None, size=None):
if use_ssl:
base_url = 'https://secure.gravatar.com/avatar/'
else:
base_url = 'http://www.gravatar.com/avatar/'
... | Fix ordering of query params | Fix ordering of query params
3rd time's a charm
| Python | apache-2.0 | mluke93/osf.io,binoculars/osf.io,leb2dg/osf.io,caseyrygt/osf.io,samanehsan/osf.io,cwisecarver/osf.io,petermalcolm/osf.io,kwierman/osf.io,emetsger/osf.io,mluo613/osf.io,wearpants/osf.io,samchrisinger/osf.io,amyshi188/osf.io,jnayak1/osf.io,TomHeatwole/osf.io,petermalcolm/osf.io,TomBaxter/osf.io,amyshi188/osf.io,TomHeatwo... | import hashlib
import urllib
# Adapted from https://github.com/zzzsochi/Flask-Gravatar/blob/master/flaskext/gravatar.py
def gravatar(user, use_ssl=False, d=None, r=None, size=None):
if use_ssl:
base_url = 'https://secure.gravatar.com/avatar/'
else:
base_url = 'http://www.gravatar.com/avatar/'
... | import hashlib
import urllib
# Adapted from https://github.com/zzzsochi/Flask-Gravatar/blob/master/flaskext/gravatar.py
def gravatar(user, use_ssl=False, d=None, r=None, size=None):
if use_ssl:
base_url = 'https://secure.gravatar.com/avatar/'
else:
base_url = 'http://www.gravatar.com/avatar/'
... | <commit_before>import hashlib
import urllib
# Adapted from https://github.com/zzzsochi/Flask-Gravatar/blob/master/flaskext/gravatar.py
def gravatar(user, use_ssl=False, d=None, r=None, size=None):
if use_ssl:
base_url = 'https://secure.gravatar.com/avatar/'
else:
base_url = 'http://www.gravata... | import hashlib
import urllib
# Adapted from https://github.com/zzzsochi/Flask-Gravatar/blob/master/flaskext/gravatar.py
def gravatar(user, use_ssl=False, d=None, r=None, size=None):
if use_ssl:
base_url = 'https://secure.gravatar.com/avatar/'
else:
base_url = 'http://www.gravatar.com/avatar/'
... | import hashlib
import urllib
# Adapted from https://github.com/zzzsochi/Flask-Gravatar/blob/master/flaskext/gravatar.py
def gravatar(user, use_ssl=False, d=None, r=None, size=None):
if use_ssl:
base_url = 'https://secure.gravatar.com/avatar/'
else:
base_url = 'http://www.gravatar.com/avatar/'
... | <commit_before>import hashlib
import urllib
# Adapted from https://github.com/zzzsochi/Flask-Gravatar/blob/master/flaskext/gravatar.py
def gravatar(user, use_ssl=False, d=None, r=None, size=None):
if use_ssl:
base_url = 'https://secure.gravatar.com/avatar/'
else:
base_url = 'http://www.gravata... |
774b64779b18ff0d8fba048ab4c4cae53662628a | ummeli/vlive/auth/middleware.py | ummeli/vlive/auth/middleware.py | from django.contrib.auth.middleware import RemoteUserMiddleware
class VodafoneLiveUserMiddleware(RemoteUserMiddleware):
header = 'HTTP_X_UP_CALLING_LINE_ID'
class VodafoneLiveInfo(object):
pass
class VodafoneLiveInfoMiddleware(object):
"""
Friendlier access to device / request info that Vodafone Liv... | from django.contrib.auth.middleware import RemoteUserMiddleware
class VodafoneLiveUserMiddleware(RemoteUserMiddleware):
header = 'HTTP_X_UP_CALLING_LINE_ID'
class VodafoneLiveInfo(object):
pass
class VodafoneLiveInfoMiddleware(object):
"""
Friendlier access to device / request info that Vodafone Liv... | Revert "printing META for troubleshooting" | Revert "printing META for troubleshooting"
This reverts commit 42d15d528da14866f2f0479da6462c17a02d8c84.
| Python | bsd-3-clause | praekelt/ummeli,praekelt/ummeli,praekelt/ummeli | from django.contrib.auth.middleware import RemoteUserMiddleware
class VodafoneLiveUserMiddleware(RemoteUserMiddleware):
header = 'HTTP_X_UP_CALLING_LINE_ID'
class VodafoneLiveInfo(object):
pass
class VodafoneLiveInfoMiddleware(object):
"""
Friendlier access to device / request info that Vodafone Liv... | from django.contrib.auth.middleware import RemoteUserMiddleware
class VodafoneLiveUserMiddleware(RemoteUserMiddleware):
header = 'HTTP_X_UP_CALLING_LINE_ID'
class VodafoneLiveInfo(object):
pass
class VodafoneLiveInfoMiddleware(object):
"""
Friendlier access to device / request info that Vodafone Liv... | <commit_before>from django.contrib.auth.middleware import RemoteUserMiddleware
class VodafoneLiveUserMiddleware(RemoteUserMiddleware):
header = 'HTTP_X_UP_CALLING_LINE_ID'
class VodafoneLiveInfo(object):
pass
class VodafoneLiveInfoMiddleware(object):
"""
Friendlier access to device / request info th... | from django.contrib.auth.middleware import RemoteUserMiddleware
class VodafoneLiveUserMiddleware(RemoteUserMiddleware):
header = 'HTTP_X_UP_CALLING_LINE_ID'
class VodafoneLiveInfo(object):
pass
class VodafoneLiveInfoMiddleware(object):
"""
Friendlier access to device / request info that Vodafone Liv... | from django.contrib.auth.middleware import RemoteUserMiddleware
class VodafoneLiveUserMiddleware(RemoteUserMiddleware):
header = 'HTTP_X_UP_CALLING_LINE_ID'
class VodafoneLiveInfo(object):
pass
class VodafoneLiveInfoMiddleware(object):
"""
Friendlier access to device / request info that Vodafone Liv... | <commit_before>from django.contrib.auth.middleware import RemoteUserMiddleware
class VodafoneLiveUserMiddleware(RemoteUserMiddleware):
header = 'HTTP_X_UP_CALLING_LINE_ID'
class VodafoneLiveInfo(object):
pass
class VodafoneLiveInfoMiddleware(object):
"""
Friendlier access to device / request info th... |
de1baa49fc34f8ecf4f7df4c723456348281df69 | splunk_handler/__init__.py | splunk_handler/__init__.py | import logging
import socket
import traceback
from threading import Thread
import requests
class SplunkHandler(logging.Handler):
"""
A logging handler to send events to a Splunk Enterprise instance
"""
def __init__(self, host, port, username, password, index):
logging.Handler.__init__(self... | import logging
import socket
import traceback
from threading import Thread
import requests
class SplunkHandler(logging.Handler):
"""
A logging handler to send events to a Splunk Enterprise instance
"""
def __init__(self, host, port, username, password, index):
logging.Handler.__init__(self... | Add code to silence requests logger in the handler | Add code to silence requests logger in the handler
| Python | mit | zach-taylor/splunk_handler,sullivanmatt/splunk_handler | import logging
import socket
import traceback
from threading import Thread
import requests
class SplunkHandler(logging.Handler):
"""
A logging handler to send events to a Splunk Enterprise instance
"""
def __init__(self, host, port, username, password, index):
logging.Handler.__init__(self... | import logging
import socket
import traceback
from threading import Thread
import requests
class SplunkHandler(logging.Handler):
"""
A logging handler to send events to a Splunk Enterprise instance
"""
def __init__(self, host, port, username, password, index):
logging.Handler.__init__(self... | <commit_before>import logging
import socket
import traceback
from threading import Thread
import requests
class SplunkHandler(logging.Handler):
"""
A logging handler to send events to a Splunk Enterprise instance
"""
def __init__(self, host, port, username, password, index):
logging.Handle... | import logging
import socket
import traceback
from threading import Thread
import requests
class SplunkHandler(logging.Handler):
"""
A logging handler to send events to a Splunk Enterprise instance
"""
def __init__(self, host, port, username, password, index):
logging.Handler.__init__(self... | import logging
import socket
import traceback
from threading import Thread
import requests
class SplunkHandler(logging.Handler):
"""
A logging handler to send events to a Splunk Enterprise instance
"""
def __init__(self, host, port, username, password, index):
logging.Handler.__init__(self... | <commit_before>import logging
import socket
import traceback
from threading import Thread
import requests
class SplunkHandler(logging.Handler):
"""
A logging handler to send events to a Splunk Enterprise instance
"""
def __init__(self, host, port, username, password, index):
logging.Handle... |
d9abb2f56720480169d394a2cadd3cb9a77ac4f6 | app/main/views/frameworks.py | app/main/views/frameworks.py | from flask import jsonify
from sqlalchemy.types import String
from sqlalchemy import func
import datetime
from .. import main
from ...models import db, Framework, DraftService, Service, User, Supplier, SelectionAnswers, AuditEvent
@main.route('/frameworks', methods=['GET'])
def list_frameworks():
frameworks = Fr... | from flask import jsonify
from sqlalchemy.types import String
from sqlalchemy import func
import datetime
from .. import main
from ...models import db, Framework, DraftService, Service, User, Supplier, SelectionAnswers, AuditEvent
@main.route('/frameworks', methods=['GET'])
def list_frameworks():
frameworks = Fr... | Use one query with group_by for service status | Use one query with group_by for service status
| Python | mit | alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api | from flask import jsonify
from sqlalchemy.types import String
from sqlalchemy import func
import datetime
from .. import main
from ...models import db, Framework, DraftService, Service, User, Supplier, SelectionAnswers, AuditEvent
@main.route('/frameworks', methods=['GET'])
def list_frameworks():
frameworks = Fr... | from flask import jsonify
from sqlalchemy.types import String
from sqlalchemy import func
import datetime
from .. import main
from ...models import db, Framework, DraftService, Service, User, Supplier, SelectionAnswers, AuditEvent
@main.route('/frameworks', methods=['GET'])
def list_frameworks():
frameworks = Fr... | <commit_before>from flask import jsonify
from sqlalchemy.types import String
from sqlalchemy import func
import datetime
from .. import main
from ...models import db, Framework, DraftService, Service, User, Supplier, SelectionAnswers, AuditEvent
@main.route('/frameworks', methods=['GET'])
def list_frameworks():
... | from flask import jsonify
from sqlalchemy.types import String
from sqlalchemy import func
import datetime
from .. import main
from ...models import db, Framework, DraftService, Service, User, Supplier, SelectionAnswers, AuditEvent
@main.route('/frameworks', methods=['GET'])
def list_frameworks():
frameworks = Fr... | from flask import jsonify
from sqlalchemy.types import String
from sqlalchemy import func
import datetime
from .. import main
from ...models import db, Framework, DraftService, Service, User, Supplier, SelectionAnswers, AuditEvent
@main.route('/frameworks', methods=['GET'])
def list_frameworks():
frameworks = Fr... | <commit_before>from flask import jsonify
from sqlalchemy.types import String
from sqlalchemy import func
import datetime
from .. import main
from ...models import db, Framework, DraftService, Service, User, Supplier, SelectionAnswers, AuditEvent
@main.route('/frameworks', methods=['GET'])
def list_frameworks():
... |
a0903bb9fd988662269e9f2ef7e38acd877a63d5 | src/nodeconductor_saltstack/saltstack/handlers.py | src/nodeconductor_saltstack/saltstack/handlers.py | from __future__ import unicode_literals
import logging
from .log import event_logger
logger = logging.getLogger(__name__)
def log_saltstack_property_created(sender, instance, created=False, **kwargs):
if created:
event_logger.saltstack_property.info(
'%s {property_name} has been created.' %... | from __future__ import unicode_literals
import logging
from .log import event_logger
logger = logging.getLogger(__name__)
def log_saltstack_property_created(sender, instance, created=False, **kwargs):
if created:
event_logger.saltstack_property.info(
'%s {property_name} has been created in ... | Add more details to event logs for property CRUD | Add more details to event logs for property CRUD
| Python | mit | opennode/nodeconductor-saltstack | from __future__ import unicode_literals
import logging
from .log import event_logger
logger = logging.getLogger(__name__)
def log_saltstack_property_created(sender, instance, created=False, **kwargs):
if created:
event_logger.saltstack_property.info(
'%s {property_name} has been created.' %... | from __future__ import unicode_literals
import logging
from .log import event_logger
logger = logging.getLogger(__name__)
def log_saltstack_property_created(sender, instance, created=False, **kwargs):
if created:
event_logger.saltstack_property.info(
'%s {property_name} has been created in ... | <commit_before>from __future__ import unicode_literals
import logging
from .log import event_logger
logger = logging.getLogger(__name__)
def log_saltstack_property_created(sender, instance, created=False, **kwargs):
if created:
event_logger.saltstack_property.info(
'%s {property_name} has b... | from __future__ import unicode_literals
import logging
from .log import event_logger
logger = logging.getLogger(__name__)
def log_saltstack_property_created(sender, instance, created=False, **kwargs):
if created:
event_logger.saltstack_property.info(
'%s {property_name} has been created in ... | from __future__ import unicode_literals
import logging
from .log import event_logger
logger = logging.getLogger(__name__)
def log_saltstack_property_created(sender, instance, created=False, **kwargs):
if created:
event_logger.saltstack_property.info(
'%s {property_name} has been created.' %... | <commit_before>from __future__ import unicode_literals
import logging
from .log import event_logger
logger = logging.getLogger(__name__)
def log_saltstack_property_created(sender, instance, created=False, **kwargs):
if created:
event_logger.saltstack_property.info(
'%s {property_name} has b... |
18318b3bb431c8a5ec9261d6dd190997613cf1ed | src/pytest_django_casperjs/tests/test_fixtures.py | src/pytest_django_casperjs/tests/test_fixtures.py | from __future__ import with_statement
import django
import pytest
from django.conf import settings as real_settings
from django.utils.encoding import force_text
from django.test.client import Client, RequestFactory
from .app.models import Item
from pytest_django_casperjs.compat import urlopen
django # Avoid pyfl... | from __future__ import with_statement
import django
import pytest
from django.conf import settings as real_settings
from django.utils.encoding import force_text
from django.test.client import Client, RequestFactory
from .app.models import Item
from pytest_django_casperjs.compat import urlopen
django # Avoid pyfl... | Remove more irrelevant tests, those will be replaced with proper casperjs tests | Remove more irrelevant tests, those will be replaced with proper casperjs tests
| Python | bsd-3-clause | EnTeQuAk/pytest-django-casperjs | from __future__ import with_statement
import django
import pytest
from django.conf import settings as real_settings
from django.utils.encoding import force_text
from django.test.client import Client, RequestFactory
from .app.models import Item
from pytest_django_casperjs.compat import urlopen
django # Avoid pyfl... | from __future__ import with_statement
import django
import pytest
from django.conf import settings as real_settings
from django.utils.encoding import force_text
from django.test.client import Client, RequestFactory
from .app.models import Item
from pytest_django_casperjs.compat import urlopen
django # Avoid pyfl... | <commit_before>from __future__ import with_statement
import django
import pytest
from django.conf import settings as real_settings
from django.utils.encoding import force_text
from django.test.client import Client, RequestFactory
from .app.models import Item
from pytest_django_casperjs.compat import urlopen
djang... | from __future__ import with_statement
import django
import pytest
from django.conf import settings as real_settings
from django.utils.encoding import force_text
from django.test.client import Client, RequestFactory
from .app.models import Item
from pytest_django_casperjs.compat import urlopen
django # Avoid pyfl... | from __future__ import with_statement
import django
import pytest
from django.conf import settings as real_settings
from django.utils.encoding import force_text
from django.test.client import Client, RequestFactory
from .app.models import Item
from pytest_django_casperjs.compat import urlopen
django # Avoid pyfl... | <commit_before>from __future__ import with_statement
import django
import pytest
from django.conf import settings as real_settings
from django.utils.encoding import force_text
from django.test.client import Client, RequestFactory
from .app.models import Item
from pytest_django_casperjs.compat import urlopen
djang... |
8696885e9f1535bdfb8dbc0e285c67d1e6d41a95 | datasets/admin.py | datasets/admin.py | from django.contrib import admin
from datasets.models import Dataset, Sound, Annotation, Vote, Taxonomy, DatasetRelease, TaxonomyNode
admin.site.register(Dataset)
admin.site.register(Sound)
admin.site.register(Annotation)
admin.site.register(Vote)
admin.site.register(Taxonomy)
admin.site.register(DatasetRelease)
admin... | from django.contrib import admin
from datasets.models import Dataset, Sound, Annotation, Vote, Taxonomy, DatasetRelease, TaxonomyNode
class TaxonomyNodeAdmin(admin.ModelAdmin):
fields = ('node_id', 'name', 'description', 'citation_uri', 'faq')
admin.site.register(Dataset)
admin.site.register(Sound)
admin.site.r... | Add custom Admin model TaxonomyNode, hide freesound ex | Add custom Admin model TaxonomyNode, hide freesound ex
| Python | agpl-3.0 | MTG/freesound-datasets,MTG/freesound-datasets,MTG/freesound-datasets,MTG/freesound-datasets | from django.contrib import admin
from datasets.models import Dataset, Sound, Annotation, Vote, Taxonomy, DatasetRelease, TaxonomyNode
admin.site.register(Dataset)
admin.site.register(Sound)
admin.site.register(Annotation)
admin.site.register(Vote)
admin.site.register(Taxonomy)
admin.site.register(DatasetRelease)
admin... | from django.contrib import admin
from datasets.models import Dataset, Sound, Annotation, Vote, Taxonomy, DatasetRelease, TaxonomyNode
class TaxonomyNodeAdmin(admin.ModelAdmin):
fields = ('node_id', 'name', 'description', 'citation_uri', 'faq')
admin.site.register(Dataset)
admin.site.register(Sound)
admin.site.r... | <commit_before>from django.contrib import admin
from datasets.models import Dataset, Sound, Annotation, Vote, Taxonomy, DatasetRelease, TaxonomyNode
admin.site.register(Dataset)
admin.site.register(Sound)
admin.site.register(Annotation)
admin.site.register(Vote)
admin.site.register(Taxonomy)
admin.site.register(Datase... | from django.contrib import admin
from datasets.models import Dataset, Sound, Annotation, Vote, Taxonomy, DatasetRelease, TaxonomyNode
class TaxonomyNodeAdmin(admin.ModelAdmin):
fields = ('node_id', 'name', 'description', 'citation_uri', 'faq')
admin.site.register(Dataset)
admin.site.register(Sound)
admin.site.r... | from django.contrib import admin
from datasets.models import Dataset, Sound, Annotation, Vote, Taxonomy, DatasetRelease, TaxonomyNode
admin.site.register(Dataset)
admin.site.register(Sound)
admin.site.register(Annotation)
admin.site.register(Vote)
admin.site.register(Taxonomy)
admin.site.register(DatasetRelease)
admin... | <commit_before>from django.contrib import admin
from datasets.models import Dataset, Sound, Annotation, Vote, Taxonomy, DatasetRelease, TaxonomyNode
admin.site.register(Dataset)
admin.site.register(Sound)
admin.site.register(Annotation)
admin.site.register(Vote)
admin.site.register(Taxonomy)
admin.site.register(Datase... |
a14256e715d51728ad4c2bde7ec52f13def6b2a6 | director/views.py | director/views.py | from django.shortcuts import redirect
from django.urls import reverse
from django.views.generic import View
class HomeView(View):
def get(self, *args, **kwargs):
if self.request.user.is_authenticated:
return redirect(reverse('project_list'))
else:
return redirect(reverse('... | from django.shortcuts import redirect
from django.urls import reverse
from accounts.views import BetaTokenView
class HomeView(BetaTokenView):
"""
Home page view.
Care needs to be taken that this view returns a 200 response (not a redirect)
for unauthenticated users. This is because GCP load balancer... | Fix home view so it returns 200 for unauthenticated health check | Fix home view so it returns 200 for unauthenticated health check
| Python | apache-2.0 | stencila/hub,stencila/hub,stencila/hub,stencila/hub,stencila/hub | from django.shortcuts import redirect
from django.urls import reverse
from django.views.generic import View
class HomeView(View):
def get(self, *args, **kwargs):
if self.request.user.is_authenticated:
return redirect(reverse('project_list'))
else:
return redirect(reverse('... | from django.shortcuts import redirect
from django.urls import reverse
from accounts.views import BetaTokenView
class HomeView(BetaTokenView):
"""
Home page view.
Care needs to be taken that this view returns a 200 response (not a redirect)
for unauthenticated users. This is because GCP load balancer... | <commit_before>from django.shortcuts import redirect
from django.urls import reverse
from django.views.generic import View
class HomeView(View):
def get(self, *args, **kwargs):
if self.request.user.is_authenticated:
return redirect(reverse('project_list'))
else:
return red... | from django.shortcuts import redirect
from django.urls import reverse
from accounts.views import BetaTokenView
class HomeView(BetaTokenView):
"""
Home page view.
Care needs to be taken that this view returns a 200 response (not a redirect)
for unauthenticated users. This is because GCP load balancer... | from django.shortcuts import redirect
from django.urls import reverse
from django.views.generic import View
class HomeView(View):
def get(self, *args, **kwargs):
if self.request.user.is_authenticated:
return redirect(reverse('project_list'))
else:
return redirect(reverse('... | <commit_before>from django.shortcuts import redirect
from django.urls import reverse
from django.views.generic import View
class HomeView(View):
def get(self, *args, **kwargs):
if self.request.user.is_authenticated:
return redirect(reverse('project_list'))
else:
return red... |
95ceea4ce45d531c277c00456639a42cfd18f129 | djangae/patches/json.py | djangae/patches/json.py | from functools import wraps
def additional_type_handler(func):
@wraps(func)
def _wrapper(self, o):
if isinstance(o, set):
# Return a string representing a set
return "{" + ",".join([repr(x) for x in o]) + "}"
else:
return func(self, o)
return _wrapper
d... | from functools import wraps
def additional_type_handler(func):
@wraps(func)
def _wrapper(self, o):
if isinstance(o, set):
# Return a string representing a set
return "{" + ",".join([str(x) for x in o]) + "}"
else:
return func(self, o)
return _wrapper
de... | Use str() not repr() to avoid trailing L on longs | Use str() not repr() to avoid trailing L on longs
| Python | bsd-3-clause | grzes/djangae,leekchan/djangae,SiPiggles/djangae,potatolondon/djangae,martinogden/djangae,potatolondon/djangae,jscissr/djangae,chargrizzle/djangae,trik/djangae,leekchan/djangae,kirberich/djangae,SiPiggles/djangae,chargrizzle/djangae,wangjun/djangae,jscissr/djangae,martinogden/djangae,pablorecio/djangae,jscissr/djangae,... | from functools import wraps
def additional_type_handler(func):
@wraps(func)
def _wrapper(self, o):
if isinstance(o, set):
# Return a string representing a set
return "{" + ",".join([repr(x) for x in o]) + "}"
else:
return func(self, o)
return _wrapper
d... | from functools import wraps
def additional_type_handler(func):
@wraps(func)
def _wrapper(self, o):
if isinstance(o, set):
# Return a string representing a set
return "{" + ",".join([str(x) for x in o]) + "}"
else:
return func(self, o)
return _wrapper
de... | <commit_before>from functools import wraps
def additional_type_handler(func):
@wraps(func)
def _wrapper(self, o):
if isinstance(o, set):
# Return a string representing a set
return "{" + ",".join([repr(x) for x in o]) + "}"
else:
return func(self, o)
ret... | from functools import wraps
def additional_type_handler(func):
@wraps(func)
def _wrapper(self, o):
if isinstance(o, set):
# Return a string representing a set
return "{" + ",".join([str(x) for x in o]) + "}"
else:
return func(self, o)
return _wrapper
de... | from functools import wraps
def additional_type_handler(func):
@wraps(func)
def _wrapper(self, o):
if isinstance(o, set):
# Return a string representing a set
return "{" + ",".join([repr(x) for x in o]) + "}"
else:
return func(self, o)
return _wrapper
d... | <commit_before>from functools import wraps
def additional_type_handler(func):
@wraps(func)
def _wrapper(self, o):
if isinstance(o, set):
# Return a string representing a set
return "{" + ",".join([repr(x) for x in o]) + "}"
else:
return func(self, o)
ret... |
7bd19241e0502789bed482291554e8341034d377 | bpmodule/testing/__init__.py | bpmodule/testing/__init__.py | from .modinfo import *
# SO file
from .testing import *
# For output
from bpmodule import output
def PrintHeader(s):
output.Output(output.Line("="))
output.Output("%1%\n", s)
output.Output(output.Line("="))
def PrintResults(nfailed):
output.Output("\n\n")
if nfailed > 0:
output.Out... | from .modinfo import *
# SO file
from .testing import *
# For output
from bpmodule.output import Output, Error, Warning, Success, Debug, Line
##################
# For testing on the python side
##################
def PyTestFunc(itest, desc, expected, func, *args):
fmt = "%|1$5| : %|2$-5| %|3$-5| %|4$-9| : %... | Add testing function from python | Add testing function from python
| Python | bsd-3-clause | pulsar-chem/Pulsar-Core,pulsar-chem/Pulsar-Core,pulsar-chem/Pulsar-Core,pulsar-chem/Pulsar-Core | from .modinfo import *
# SO file
from .testing import *
# For output
from bpmodule import output
def PrintHeader(s):
output.Output(output.Line("="))
output.Output("%1%\n", s)
output.Output(output.Line("="))
def PrintResults(nfailed):
output.Output("\n\n")
if nfailed > 0:
output.Out... | from .modinfo import *
# SO file
from .testing import *
# For output
from bpmodule.output import Output, Error, Warning, Success, Debug, Line
##################
# For testing on the python side
##################
def PyTestFunc(itest, desc, expected, func, *args):
fmt = "%|1$5| : %|2$-5| %|3$-5| %|4$-9| : %... | <commit_before>from .modinfo import *
# SO file
from .testing import *
# For output
from bpmodule import output
def PrintHeader(s):
output.Output(output.Line("="))
output.Output("%1%\n", s)
output.Output(output.Line("="))
def PrintResults(nfailed):
output.Output("\n\n")
if nfailed > 0:
... | from .modinfo import *
# SO file
from .testing import *
# For output
from bpmodule.output import Output, Error, Warning, Success, Debug, Line
##################
# For testing on the python side
##################
def PyTestFunc(itest, desc, expected, func, *args):
fmt = "%|1$5| : %|2$-5| %|3$-5| %|4$-9| : %... | from .modinfo import *
# SO file
from .testing import *
# For output
from bpmodule import output
def PrintHeader(s):
output.Output(output.Line("="))
output.Output("%1%\n", s)
output.Output(output.Line("="))
def PrintResults(nfailed):
output.Output("\n\n")
if nfailed > 0:
output.Out... | <commit_before>from .modinfo import *
# SO file
from .testing import *
# For output
from bpmodule import output
def PrintHeader(s):
output.Output(output.Line("="))
output.Output("%1%\n", s)
output.Output(output.Line("="))
def PrintResults(nfailed):
output.Output("\n\n")
if nfailed > 0:
... |
a4b475120fd58f135695e071424a3fa1024ae649 | lib/__init__.py | lib/__init__.py | """Package providing an implementation of the TOPKAPI model and some utilities.
The interface isn't stable yet so be prepared to update your code
on a regular basis...
"""
__author__ = 'Theo Vischel'
__version__ = '0.1'
import model
| """Package providing an implementation of the TOPKAPI model and some utilities.
The interface isn't stable yet so be prepared to update your code
on a regular basis...
"""
__author__ = 'Theo Vischel'
__version__ = '0.2'
import model
| Update version number to 0.2. | Update version number to 0.2.
| Python | bsd-3-clause | sahg/PyTOPKAPI,scottza/PyTOPKAPI | """Package providing an implementation of the TOPKAPI model and some utilities.
The interface isn't stable yet so be prepared to update your code
on a regular basis...
"""
__author__ = 'Theo Vischel'
__version__ = '0.1'
import model
Update version number to 0.2. | """Package providing an implementation of the TOPKAPI model and some utilities.
The interface isn't stable yet so be prepared to update your code
on a regular basis...
"""
__author__ = 'Theo Vischel'
__version__ = '0.2'
import model
| <commit_before>"""Package providing an implementation of the TOPKAPI model and some utilities.
The interface isn't stable yet so be prepared to update your code
on a regular basis...
"""
__author__ = 'Theo Vischel'
__version__ = '0.1'
import model
<commit_msg>Update version number to 0.2.<commit_after> | """Package providing an implementation of the TOPKAPI model and some utilities.
The interface isn't stable yet so be prepared to update your code
on a regular basis...
"""
__author__ = 'Theo Vischel'
__version__ = '0.2'
import model
| """Package providing an implementation of the TOPKAPI model and some utilities.
The interface isn't stable yet so be prepared to update your code
on a regular basis...
"""
__author__ = 'Theo Vischel'
__version__ = '0.1'
import model
Update version number to 0.2."""Package providing an implementation of... | <commit_before>"""Package providing an implementation of the TOPKAPI model and some utilities.
The interface isn't stable yet so be prepared to update your code
on a regular basis...
"""
__author__ = 'Theo Vischel'
__version__ = '0.1'
import model
<commit_msg>Update version number to 0.2.<commit_after>... |
bb88b1d2e2c4d3eb482c3cf32d1a53c9e89f94cf | conftest.py | conftest.py | # -*- coding:utf-8 -*-
from __future__ import unicode_literals
from django.db import connection
def pytest_report_header(config):
with connection.cursor() as cursor:
cursor.execute("SELECT VERSION()")
version = cursor.fetchone()[0]
return "MySQL version: {}".format(version)
| # -*- coding:utf-8 -*-
from __future__ import unicode_literals
import django
from django.db import connection
def pytest_report_header(config):
dot_version = '.'.join(str(x) for x in django.VERSION)
header = "Django version: " + dot_version
if hasattr(connection, '_nodb_connection'):
with connec... | Fix pytest version report when database does not exist, add Django version header | Fix pytest version report when database does not exist, add Django version header
| Python | mit | nickmeharry/django-mysql,arnau126/django-mysql,arnau126/django-mysql,nickmeharry/django-mysql,adamchainz/django-mysql | # -*- coding:utf-8 -*-
from __future__ import unicode_literals
from django.db import connection
def pytest_report_header(config):
with connection.cursor() as cursor:
cursor.execute("SELECT VERSION()")
version = cursor.fetchone()[0]
return "MySQL version: {}".format(version)
Fix pytest version... | # -*- coding:utf-8 -*-
from __future__ import unicode_literals
import django
from django.db import connection
def pytest_report_header(config):
dot_version = '.'.join(str(x) for x in django.VERSION)
header = "Django version: " + dot_version
if hasattr(connection, '_nodb_connection'):
with connec... | <commit_before># -*- coding:utf-8 -*-
from __future__ import unicode_literals
from django.db import connection
def pytest_report_header(config):
with connection.cursor() as cursor:
cursor.execute("SELECT VERSION()")
version = cursor.fetchone()[0]
return "MySQL version: {}".format(version)
<co... | # -*- coding:utf-8 -*-
from __future__ import unicode_literals
import django
from django.db import connection
def pytest_report_header(config):
dot_version = '.'.join(str(x) for x in django.VERSION)
header = "Django version: " + dot_version
if hasattr(connection, '_nodb_connection'):
with connec... | # -*- coding:utf-8 -*-
from __future__ import unicode_literals
from django.db import connection
def pytest_report_header(config):
with connection.cursor() as cursor:
cursor.execute("SELECT VERSION()")
version = cursor.fetchone()[0]
return "MySQL version: {}".format(version)
Fix pytest version... | <commit_before># -*- coding:utf-8 -*-
from __future__ import unicode_literals
from django.db import connection
def pytest_report_header(config):
with connection.cursor() as cursor:
cursor.execute("SELECT VERSION()")
version = cursor.fetchone()[0]
return "MySQL version: {}".format(version)
<co... |
22a852a9ad0521496e8b0be52b37d111c3402bb4 | conftest.py | conftest.py | import pytest
from models.broadcasted_models import two_comp_model
from utilities.phoenix_utils import load_starfish_spectrum
@pytest.fixture
def host():
"""Host spectrum fixture."""
mod_spec = load_starfish_spectrum([5200, 4.50, 0.0], limits=[2110, 2170], normalize=True)
return mod_spec
@pytest.fixtur... | import pytest
from models.broadcasted_models import two_comp_model
from utilities.phoenix_utils import load_starfish_spectrum
@pytest.fixture
def host():
"""Host spectrum fixture."""
mod_spec = load_starfish_spectrum([5200, 4.50, 0.0], limits=[2110, 2165], normalize=True)
return mod_spec
@pytest.fixtur... | Revert "tweak host fixture limits" | Revert "tweak host fixture limits"
This reverts commit 06e9a964dec8392007e3af87d1a41bbe119158ca.
| Python | mit | jason-neal/companion_simulations,jason-neal/companion_simulations | import pytest
from models.broadcasted_models import two_comp_model
from utilities.phoenix_utils import load_starfish_spectrum
@pytest.fixture
def host():
"""Host spectrum fixture."""
mod_spec = load_starfish_spectrum([5200, 4.50, 0.0], limits=[2110, 2170], normalize=True)
return mod_spec
@pytest.fixtur... | import pytest
from models.broadcasted_models import two_comp_model
from utilities.phoenix_utils import load_starfish_spectrum
@pytest.fixture
def host():
"""Host spectrum fixture."""
mod_spec = load_starfish_spectrum([5200, 4.50, 0.0], limits=[2110, 2165], normalize=True)
return mod_spec
@pytest.fixtur... | <commit_before>import pytest
from models.broadcasted_models import two_comp_model
from utilities.phoenix_utils import load_starfish_spectrum
@pytest.fixture
def host():
"""Host spectrum fixture."""
mod_spec = load_starfish_spectrum([5200, 4.50, 0.0], limits=[2110, 2170], normalize=True)
return mod_spec
... | import pytest
from models.broadcasted_models import two_comp_model
from utilities.phoenix_utils import load_starfish_spectrum
@pytest.fixture
def host():
"""Host spectrum fixture."""
mod_spec = load_starfish_spectrum([5200, 4.50, 0.0], limits=[2110, 2165], normalize=True)
return mod_spec
@pytest.fixtur... | import pytest
from models.broadcasted_models import two_comp_model
from utilities.phoenix_utils import load_starfish_spectrum
@pytest.fixture
def host():
"""Host spectrum fixture."""
mod_spec = load_starfish_spectrum([5200, 4.50, 0.0], limits=[2110, 2170], normalize=True)
return mod_spec
@pytest.fixtur... | <commit_before>import pytest
from models.broadcasted_models import two_comp_model
from utilities.phoenix_utils import load_starfish_spectrum
@pytest.fixture
def host():
"""Host spectrum fixture."""
mod_spec = load_starfish_spectrum([5200, 4.50, 0.0], limits=[2110, 2170], normalize=True)
return mod_spec
... |
aaf7cb7ecc1a74fb2b222fd21aea7116dac2ca98 | contribs.py | contribs.py |
# Get Contribution Count
import urllib
import datetime
import HTMLParser
class ContribParser(HTMLParser.HTMLParser):
today = datetime.date.today().isoformat()
def handle_starttag(self, tag, attrs):
if tag == 'rect' and self.is_today(attrs):
self.count = self.get_count(attrs)
de... |
# Get Contribution Count
import urllib
import datetime
import HTMLParser
class ContribParser(HTMLParser.HTMLParser):
def __init__(self):
self.today = datetime.date.today().isoformat()
HTMLParser.HTMLParser.__init__(self)
def handle_starttag(self, tag, attrs):
if tag == 'rect' an... | Fix date issue (I think) | Fix date issue (I think)
| Python | mit | chrisfosterelli/commitwatch |
# Get Contribution Count
import urllib
import datetime
import HTMLParser
class ContribParser(HTMLParser.HTMLParser):
today = datetime.date.today().isoformat()
def handle_starttag(self, tag, attrs):
if tag == 'rect' and self.is_today(attrs):
self.count = self.get_count(attrs)
de... |
# Get Contribution Count
import urllib
import datetime
import HTMLParser
class ContribParser(HTMLParser.HTMLParser):
def __init__(self):
self.today = datetime.date.today().isoformat()
HTMLParser.HTMLParser.__init__(self)
def handle_starttag(self, tag, attrs):
if tag == 'rect' an... | <commit_before>
# Get Contribution Count
import urllib
import datetime
import HTMLParser
class ContribParser(HTMLParser.HTMLParser):
today = datetime.date.today().isoformat()
def handle_starttag(self, tag, attrs):
if tag == 'rect' and self.is_today(attrs):
self.count = self.get_count... |
# Get Contribution Count
import urllib
import datetime
import HTMLParser
class ContribParser(HTMLParser.HTMLParser):
def __init__(self):
self.today = datetime.date.today().isoformat()
HTMLParser.HTMLParser.__init__(self)
def handle_starttag(self, tag, attrs):
if tag == 'rect' an... |
# Get Contribution Count
import urllib
import datetime
import HTMLParser
class ContribParser(HTMLParser.HTMLParser):
today = datetime.date.today().isoformat()
def handle_starttag(self, tag, attrs):
if tag == 'rect' and self.is_today(attrs):
self.count = self.get_count(attrs)
de... | <commit_before>
# Get Contribution Count
import urllib
import datetime
import HTMLParser
class ContribParser(HTMLParser.HTMLParser):
today = datetime.date.today().isoformat()
def handle_starttag(self, tag, attrs):
if tag == 'rect' and self.is_today(attrs):
self.count = self.get_count... |
22be6bb3593f948893ab3f797d34e20e66fff841 | example.py | example.py | import discord
import asyncio
client = discord.Client()
@client.event
async def on_ready():
print('Logged in as')
print(client.user.name)
print(client.user.id)
print('------')
@client.event
async def on_message(message):
if message.content.startswith('!test'):
counter = 0
tmp = aw... | import discord
import asyncio
import os
#Set up Client State
CLIENT_TOKEN=os.environ['TOKEN']
client = discord.Client()
@client.event
async def on_ready():
print('Logged in as')
print(client.user.name)
print(client.user.id)
print('------')
@client.event
async def on_message(message):
if message.... | Use env value for client token | Use env value for client token
| Python | mit | gryffon/SusumuTakuan,gryffon/SusumuTakuan | import discord
import asyncio
client = discord.Client()
@client.event
async def on_ready():
print('Logged in as')
print(client.user.name)
print(client.user.id)
print('------')
@client.event
async def on_message(message):
if message.content.startswith('!test'):
counter = 0
tmp = aw... | import discord
import asyncio
import os
#Set up Client State
CLIENT_TOKEN=os.environ['TOKEN']
client = discord.Client()
@client.event
async def on_ready():
print('Logged in as')
print(client.user.name)
print(client.user.id)
print('------')
@client.event
async def on_message(message):
if message.... | <commit_before>import discord
import asyncio
client = discord.Client()
@client.event
async def on_ready():
print('Logged in as')
print(client.user.name)
print(client.user.id)
print('------')
@client.event
async def on_message(message):
if message.content.startswith('!test'):
counter = 0
... | import discord
import asyncio
import os
#Set up Client State
CLIENT_TOKEN=os.environ['TOKEN']
client = discord.Client()
@client.event
async def on_ready():
print('Logged in as')
print(client.user.name)
print(client.user.id)
print('------')
@client.event
async def on_message(message):
if message.... | import discord
import asyncio
client = discord.Client()
@client.event
async def on_ready():
print('Logged in as')
print(client.user.name)
print(client.user.id)
print('------')
@client.event
async def on_message(message):
if message.content.startswith('!test'):
counter = 0
tmp = aw... | <commit_before>import discord
import asyncio
client = discord.Client()
@client.event
async def on_ready():
print('Logged in as')
print(client.user.name)
print(client.user.id)
print('------')
@client.event
async def on_message(message):
if message.content.startswith('!test'):
counter = 0
... |
e3d8b836681a0cb4795d317c7a23defd6004c967 | pytest_run.py | pytest_run.py | # coding=utf-8
"""This is a script for running pytest from the command line.
This script exists so that the project directory gets added to sys.path, which
prevents us from accidentally testing the globally installed willie version.
pytest_run.py
Copyright 2013, Ari Koivula, <ari@koivu.la>
Licensed under the Eiffel F... | #!/usr/bin/env python
# coding=utf-8
"""This is a script for running pytest from the command line.
This script exists so that the project directory gets added to sys.path, which
prevents us from accidentally testing the globally installed willie version.
pytest_run.py
Copyright 2013, Ari Koivula, <ari@koivu.la>
Licen... | Add shebang to testing script | Add shebang to testing script
| Python | mit | Uname-a/knife_scraper,Uname-a/knife_scraper,Uname-a/knife_scraper | # coding=utf-8
"""This is a script for running pytest from the command line.
This script exists so that the project directory gets added to sys.path, which
prevents us from accidentally testing the globally installed willie version.
pytest_run.py
Copyright 2013, Ari Koivula, <ari@koivu.la>
Licensed under the Eiffel F... | #!/usr/bin/env python
# coding=utf-8
"""This is a script for running pytest from the command line.
This script exists so that the project directory gets added to sys.path, which
prevents us from accidentally testing the globally installed willie version.
pytest_run.py
Copyright 2013, Ari Koivula, <ari@koivu.la>
Licen... | <commit_before># coding=utf-8
"""This is a script for running pytest from the command line.
This script exists so that the project directory gets added to sys.path, which
prevents us from accidentally testing the globally installed willie version.
pytest_run.py
Copyright 2013, Ari Koivula, <ari@koivu.la>
Licensed und... | #!/usr/bin/env python
# coding=utf-8
"""This is a script for running pytest from the command line.
This script exists so that the project directory gets added to sys.path, which
prevents us from accidentally testing the globally installed willie version.
pytest_run.py
Copyright 2013, Ari Koivula, <ari@koivu.la>
Licen... | # coding=utf-8
"""This is a script for running pytest from the command line.
This script exists so that the project directory gets added to sys.path, which
prevents us from accidentally testing the globally installed willie version.
pytest_run.py
Copyright 2013, Ari Koivula, <ari@koivu.la>
Licensed under the Eiffel F... | <commit_before># coding=utf-8
"""This is a script for running pytest from the command line.
This script exists so that the project directory gets added to sys.path, which
prevents us from accidentally testing the globally installed willie version.
pytest_run.py
Copyright 2013, Ari Koivula, <ari@koivu.la>
Licensed und... |
d5a5e46b2fbc9284213aef3ec45f0605b002b7b1 | axes/management/commands/axes_reset.py | axes/management/commands/axes_reset.py | from django.core.management.base import BaseCommand
from axes.utils import reset
class Command(BaseCommand):
help = ("resets any lockouts or failed login records. If called with an "
"IP, resets only for that IP")
def add_arguments(self, parser):
parser.add_argument('ip', nargs='*')
... | from django.core.management.base import BaseCommand
from axes.utils import reset
class Command(BaseCommand):
help = ("resets any lockouts or failed login records. If called with an "
"IP, resets only for that IP")
def add_arguments(self, parser):
parser.add_argument('ip', nargs='*')
... | Reset all attempts when ip not specified | Reset all attempts when ip not specified
When no ip address positional arguments are specified, reset all attempts, as with reset() and per documentation. | Python | mit | svenhertle/django-axes,django-pci/django-axes,jazzband/django-axes | from django.core.management.base import BaseCommand
from axes.utils import reset
class Command(BaseCommand):
help = ("resets any lockouts or failed login records. If called with an "
"IP, resets only for that IP")
def add_arguments(self, parser):
parser.add_argument('ip', nargs='*')
... | from django.core.management.base import BaseCommand
from axes.utils import reset
class Command(BaseCommand):
help = ("resets any lockouts or failed login records. If called with an "
"IP, resets only for that IP")
def add_arguments(self, parser):
parser.add_argument('ip', nargs='*')
... | <commit_before>from django.core.management.base import BaseCommand
from axes.utils import reset
class Command(BaseCommand):
help = ("resets any lockouts or failed login records. If called with an "
"IP, resets only for that IP")
def add_arguments(self, parser):
parser.add_argument('ip', ... | from django.core.management.base import BaseCommand
from axes.utils import reset
class Command(BaseCommand):
help = ("resets any lockouts or failed login records. If called with an "
"IP, resets only for that IP")
def add_arguments(self, parser):
parser.add_argument('ip', nargs='*')
... | from django.core.management.base import BaseCommand
from axes.utils import reset
class Command(BaseCommand):
help = ("resets any lockouts or failed login records. If called with an "
"IP, resets only for that IP")
def add_arguments(self, parser):
parser.add_argument('ip', nargs='*')
... | <commit_before>from django.core.management.base import BaseCommand
from axes.utils import reset
class Command(BaseCommand):
help = ("resets any lockouts or failed login records. If called with an "
"IP, resets only for that IP")
def add_arguments(self, parser):
parser.add_argument('ip', ... |
132932747a1f7da67413b9c0cf7916707c1e3d19 | src/python/services/CVMFSAppVersions.py | src/python/services/CVMFSAppVersions.py | """CVMFS Servcice."""
import os
import re
import cherrypy
import html
from natsort import natsorted
version_re = re.compile(r"^release-(\d{1,3}\.\d{1,3}\.\d{1,3})$")
@cherrypy.popargs('appid')
class CVMFSAppVersions(object):
"""
CVMFS App Version checking service.
CVMFS Service to get the list of versio... | """CVMFS Servcice."""
import os
import re
import cherrypy
import html
from natsort import natsorted
VERSION_RE = re.compile(r"^release-(\d{1,3}\.\d{1,3}\.\d{1,3})$")
@cherrypy.popargs('appid')
class CVMFSAppVersions(object):
"""
CVMFS App Version checking service.
CVMFS Service to get the list of versio... | Change the re const name to uppercase. | Change the re const name to uppercase.
| Python | mit | alexanderrichards/LZProduction,alexanderrichards/LZProduction,alexanderrichards/LZProduction,alexanderrichards/LZProduction | """CVMFS Servcice."""
import os
import re
import cherrypy
import html
from natsort import natsorted
version_re = re.compile(r"^release-(\d{1,3}\.\d{1,3}\.\d{1,3})$")
@cherrypy.popargs('appid')
class CVMFSAppVersions(object):
"""
CVMFS App Version checking service.
CVMFS Service to get the list of versio... | """CVMFS Servcice."""
import os
import re
import cherrypy
import html
from natsort import natsorted
VERSION_RE = re.compile(r"^release-(\d{1,3}\.\d{1,3}\.\d{1,3})$")
@cherrypy.popargs('appid')
class CVMFSAppVersions(object):
"""
CVMFS App Version checking service.
CVMFS Service to get the list of versio... | <commit_before>"""CVMFS Servcice."""
import os
import re
import cherrypy
import html
from natsort import natsorted
version_re = re.compile(r"^release-(\d{1,3}\.\d{1,3}\.\d{1,3})$")
@cherrypy.popargs('appid')
class CVMFSAppVersions(object):
"""
CVMFS App Version checking service.
CVMFS Service to get the... | """CVMFS Servcice."""
import os
import re
import cherrypy
import html
from natsort import natsorted
VERSION_RE = re.compile(r"^release-(\d{1,3}\.\d{1,3}\.\d{1,3})$")
@cherrypy.popargs('appid')
class CVMFSAppVersions(object):
"""
CVMFS App Version checking service.
CVMFS Service to get the list of versio... | """CVMFS Servcice."""
import os
import re
import cherrypy
import html
from natsort import natsorted
version_re = re.compile(r"^release-(\d{1,3}\.\d{1,3}\.\d{1,3})$")
@cherrypy.popargs('appid')
class CVMFSAppVersions(object):
"""
CVMFS App Version checking service.
CVMFS Service to get the list of versio... | <commit_before>"""CVMFS Servcice."""
import os
import re
import cherrypy
import html
from natsort import natsorted
version_re = re.compile(r"^release-(\d{1,3}\.\d{1,3}\.\d{1,3})$")
@cherrypy.popargs('appid')
class CVMFSAppVersions(object):
"""
CVMFS App Version checking service.
CVMFS Service to get the... |
b26047600202a9776c99323813cf17b0aa951dcd | app/routes.py | app/routes.py | from flask import jsonify
from . import app
import mapper
import utils
from predict import predictor
@app.route("/", methods=["GET"])
def index():
firebase_dump = mapper.get_dump_firebase()
response = firebase_dump.get_all()
response = response or {}
return jsonify(response)
@app.route("/build", met... | from flask import jsonify
from . import app
import mapper
import utils
from predict import predictor
@app.route("/", methods=["GET"])
def index():
return app.send_static_file("index.html")
@app.route("/build", methods=["POST"])
def build_model():
predictor.preprocess_airports()
if not predictor.model:
... | Return index.html in root and transform /status results | Return index.html in root and transform /status results
| Python | mit | MachineLearningProject/flight-delay-prediction,MachineLearningProject/flight-delay-prediction,MachineLearningProject/flight-delay-prediction | from flask import jsonify
from . import app
import mapper
import utils
from predict import predictor
@app.route("/", methods=["GET"])
def index():
firebase_dump = mapper.get_dump_firebase()
response = firebase_dump.get_all()
response = response or {}
return jsonify(response)
@app.route("/build", met... | from flask import jsonify
from . import app
import mapper
import utils
from predict import predictor
@app.route("/", methods=["GET"])
def index():
return app.send_static_file("index.html")
@app.route("/build", methods=["POST"])
def build_model():
predictor.preprocess_airports()
if not predictor.model:
... | <commit_before>from flask import jsonify
from . import app
import mapper
import utils
from predict import predictor
@app.route("/", methods=["GET"])
def index():
firebase_dump = mapper.get_dump_firebase()
response = firebase_dump.get_all()
response = response or {}
return jsonify(response)
@app.rout... | from flask import jsonify
from . import app
import mapper
import utils
from predict import predictor
@app.route("/", methods=["GET"])
def index():
return app.send_static_file("index.html")
@app.route("/build", methods=["POST"])
def build_model():
predictor.preprocess_airports()
if not predictor.model:
... | from flask import jsonify
from . import app
import mapper
import utils
from predict import predictor
@app.route("/", methods=["GET"])
def index():
firebase_dump = mapper.get_dump_firebase()
response = firebase_dump.get_all()
response = response or {}
return jsonify(response)
@app.route("/build", met... | <commit_before>from flask import jsonify
from . import app
import mapper
import utils
from predict import predictor
@app.route("/", methods=["GET"])
def index():
firebase_dump = mapper.get_dump_firebase()
response = firebase_dump.get_all()
response = response or {}
return jsonify(response)
@app.rout... |
9bb14514a523484af6313008baef3b7cfd987951 | tests/__init__.py | tests/__init__.py | import sys
import doctest
def fix_doctests(suite):
if sys.version_info.major >= 3:
return
for case in suite._tests:
# Add some more flags.
case._dt_optionflags = (
(case._dt_optionflags or 0) |
doctest.IGNORE_EXCEPTION_DETAIL |
doctest.ELLIPSIS |
... | import sys
import doctest
def fix_doctests(suite):
if sys.version_info[0] >= 3:
return
for case in suite._tests:
# Add some more flags.
case._dt_optionflags = (
(case._dt_optionflags or 0) |
doctest.IGNORE_EXCEPTION_DETAIL |
doctest.ELLIPSIS |
... | Fix version_info check for Python2.6 | Tests: Fix version_info check for Python2.6 | Python | bsd-3-clause | mikeboers/PyTomCrypt,mikeboers/PyTomCrypt,mikeboers/PyTomCrypt | import sys
import doctest
def fix_doctests(suite):
if sys.version_info.major >= 3:
return
for case in suite._tests:
# Add some more flags.
case._dt_optionflags = (
(case._dt_optionflags or 0) |
doctest.IGNORE_EXCEPTION_DETAIL |
doctest.ELLIPSIS |
... | import sys
import doctest
def fix_doctests(suite):
if sys.version_info[0] >= 3:
return
for case in suite._tests:
# Add some more flags.
case._dt_optionflags = (
(case._dt_optionflags or 0) |
doctest.IGNORE_EXCEPTION_DETAIL |
doctest.ELLIPSIS |
... | <commit_before>import sys
import doctest
def fix_doctests(suite):
if sys.version_info.major >= 3:
return
for case in suite._tests:
# Add some more flags.
case._dt_optionflags = (
(case._dt_optionflags or 0) |
doctest.IGNORE_EXCEPTION_DETAIL |
doctest... | import sys
import doctest
def fix_doctests(suite):
if sys.version_info[0] >= 3:
return
for case in suite._tests:
# Add some more flags.
case._dt_optionflags = (
(case._dt_optionflags or 0) |
doctest.IGNORE_EXCEPTION_DETAIL |
doctest.ELLIPSIS |
... | import sys
import doctest
def fix_doctests(suite):
if sys.version_info.major >= 3:
return
for case in suite._tests:
# Add some more flags.
case._dt_optionflags = (
(case._dt_optionflags or 0) |
doctest.IGNORE_EXCEPTION_DETAIL |
doctest.ELLIPSIS |
... | <commit_before>import sys
import doctest
def fix_doctests(suite):
if sys.version_info.major >= 3:
return
for case in suite._tests:
# Add some more flags.
case._dt_optionflags = (
(case._dt_optionflags or 0) |
doctest.IGNORE_EXCEPTION_DETAIL |
doctest... |
600839e3c51d2091a6c434ac31ea11dc9ed2db85 | foialist/forms.py | foialist/forms.py | from django import forms
from foialist.models import *
class FileForm(forms.ModelForm):
class Meta:
model = File
exclude = ('entry', 'size')
class EntryForm(forms.ModelForm):
govt_entity = forms.CharField(label="Gov't. entity")
class Meta:
model = Entry
# exc... | from django import forms
from foialist.models import *
class FileForm(forms.ModelForm):
class Meta:
model = File
exclude = ('entry', 'size')
class EntryForm(forms.ModelForm):
govt_entity = forms.CharField(label="Gov't. entity")
class Meta:
model = Entry
fiel... | Correct mismatched field names in EntryForm. | Correct mismatched field names in EntryForm.
| Python | bsd-3-clause | a2civictech/a2docs-sources,a2civictech/a2docs-sources,a2civictech/a2docs-sources | from django import forms
from foialist.models import *
class FileForm(forms.ModelForm):
class Meta:
model = File
exclude = ('entry', 'size')
class EntryForm(forms.ModelForm):
govt_entity = forms.CharField(label="Gov't. entity")
class Meta:
model = Entry
# exc... | from django import forms
from foialist.models import *
class FileForm(forms.ModelForm):
class Meta:
model = File
exclude = ('entry', 'size')
class EntryForm(forms.ModelForm):
govt_entity = forms.CharField(label="Gov't. entity")
class Meta:
model = Entry
fiel... | <commit_before>from django import forms
from foialist.models import *
class FileForm(forms.ModelForm):
class Meta:
model = File
exclude = ('entry', 'size')
class EntryForm(forms.ModelForm):
govt_entity = forms.CharField(label="Gov't. entity")
class Meta:
model = Ent... | from django import forms
from foialist.models import *
class FileForm(forms.ModelForm):
class Meta:
model = File
exclude = ('entry', 'size')
class EntryForm(forms.ModelForm):
govt_entity = forms.CharField(label="Gov't. entity")
class Meta:
model = Entry
fiel... | from django import forms
from foialist.models import *
class FileForm(forms.ModelForm):
class Meta:
model = File
exclude = ('entry', 'size')
class EntryForm(forms.ModelForm):
govt_entity = forms.CharField(label="Gov't. entity")
class Meta:
model = Entry
# exc... | <commit_before>from django import forms
from foialist.models import *
class FileForm(forms.ModelForm):
class Meta:
model = File
exclude = ('entry', 'size')
class EntryForm(forms.ModelForm):
govt_entity = forms.CharField(label="Gov't. entity")
class Meta:
model = Ent... |
5d7a179e99632e2b8ca30bfa444497636492ca5a | catsnap/web/middleware/exception_logger.py | catsnap/web/middleware/exception_logger.py | import sys
import traceback
class ExceptionLogger(object):
def __init__(self, app):
self.app = app
def __call__(self, environ, start_response):
try:
return self.app(environ, start_response)
except Exception:
(exc_type, exc_value, trace) = sys.exc_info()
... | import sys
import traceback
class ExceptionLogger(object):
def __init__(self, app):
self.app = app
def __call__(self, environ, start_response):
try:
return self.app(environ, start_response)
except Exception:
(exc_type, exc_value, trace) = sys.exc_info()
... | Fix the exception logger to actually log to stdout | Fix the exception logger to actually log to stdout
| Python | mit | ErinCall/catsnap,ErinCall/catsnap,ErinCall/catsnap | import sys
import traceback
class ExceptionLogger(object):
def __init__(self, app):
self.app = app
def __call__(self, environ, start_response):
try:
return self.app(environ, start_response)
except Exception:
(exc_type, exc_value, trace) = sys.exc_info()
... | import sys
import traceback
class ExceptionLogger(object):
def __init__(self, app):
self.app = app
def __call__(self, environ, start_response):
try:
return self.app(environ, start_response)
except Exception:
(exc_type, exc_value, trace) = sys.exc_info()
... | <commit_before>import sys
import traceback
class ExceptionLogger(object):
def __init__(self, app):
self.app = app
def __call__(self, environ, start_response):
try:
return self.app(environ, start_response)
except Exception:
(exc_type, exc_value, trace) = sys.exc_... | import sys
import traceback
class ExceptionLogger(object):
def __init__(self, app):
self.app = app
def __call__(self, environ, start_response):
try:
return self.app(environ, start_response)
except Exception:
(exc_type, exc_value, trace) = sys.exc_info()
... | import sys
import traceback
class ExceptionLogger(object):
def __init__(self, app):
self.app = app
def __call__(self, environ, start_response):
try:
return self.app(environ, start_response)
except Exception:
(exc_type, exc_value, trace) = sys.exc_info()
... | <commit_before>import sys
import traceback
class ExceptionLogger(object):
def __init__(self, app):
self.app = app
def __call__(self, environ, start_response):
try:
return self.app(environ, start_response)
except Exception:
(exc_type, exc_value, trace) = sys.exc_... |
6a7302bed399aba98b01490f78728d3daa57e092 | opps/images/generate.py | opps/images/generate.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from libthumbor import CryptoURL
from django.conf import settings
crypto = CryptoURL(key=settings.THUMBOR_SECURITY_KEY)
def _remove_prefix(url, prefix):
if url.startswith(prefix):
return url[len(prefix):]
return url
def _remove_schema(url):
return ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from libthumbor import CryptoURL
from django.conf import settings
crypto = CryptoURL(key=settings.THUMBOR_SECURITY_KEY)
def _remove_prefix(url, prefix):
if url.startswith(prefix):
return url[len(prefix):]
return url
def _remove_schema(url):
return ... | Fix render git, if gif file not render via thumbor | Fix render git, if gif file not render via thumbor
| Python | mit | opps/opps,YACOWS/opps,williamroot/opps,opps/opps,williamroot/opps,jeanmask/opps,jeanmask/opps,williamroot/opps,opps/opps,YACOWS/opps,jeanmask/opps,YACOWS/opps,williamroot/opps,jeanmask/opps,opps/opps,YACOWS/opps | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from libthumbor import CryptoURL
from django.conf import settings
crypto = CryptoURL(key=settings.THUMBOR_SECURITY_KEY)
def _remove_prefix(url, prefix):
if url.startswith(prefix):
return url[len(prefix):]
return url
def _remove_schema(url):
return ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from libthumbor import CryptoURL
from django.conf import settings
crypto = CryptoURL(key=settings.THUMBOR_SECURITY_KEY)
def _remove_prefix(url, prefix):
if url.startswith(prefix):
return url[len(prefix):]
return url
def _remove_schema(url):
return ... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from libthumbor import CryptoURL
from django.conf import settings
crypto = CryptoURL(key=settings.THUMBOR_SECURITY_KEY)
def _remove_prefix(url, prefix):
if url.startswith(prefix):
return url[len(prefix):]
return url
def _remove_schema(ur... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from libthumbor import CryptoURL
from django.conf import settings
crypto = CryptoURL(key=settings.THUMBOR_SECURITY_KEY)
def _remove_prefix(url, prefix):
if url.startswith(prefix):
return url[len(prefix):]
return url
def _remove_schema(url):
return ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from libthumbor import CryptoURL
from django.conf import settings
crypto = CryptoURL(key=settings.THUMBOR_SECURITY_KEY)
def _remove_prefix(url, prefix):
if url.startswith(prefix):
return url[len(prefix):]
return url
def _remove_schema(url):
return ... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from libthumbor import CryptoURL
from django.conf import settings
crypto = CryptoURL(key=settings.THUMBOR_SECURITY_KEY)
def _remove_prefix(url, prefix):
if url.startswith(prefix):
return url[len(prefix):]
return url
def _remove_schema(ur... |
059230327fcebb35c881f8a6bc2ee12fed29d442 | mcp/config.py | mcp/config.py | #
# Copyright (c) 2005-2006 rPath, Inc.
#
# All rights reserved
#
import os
from conary import conarycfg
from conary.lib import cfgtypes
class MCPConfig(conarycfg.ConfigFile):
basePath = os.path.join(os.path.sep, 'srv', 'rbuilder', 'mcp')
logPath = os.path.join(basePath, 'logs')
queueHost = '127.0.0.1'
... | #
# Copyright (c) 2005-2006 rPath, Inc.
#
# All rights reserved
#
import os
from conary import conarycfg
from conary.lib import cfgtypes
class MCPConfig(conarycfg.ConfigFile):
basePath = os.path.join(os.path.sep, 'srv', 'rbuilder', 'mcp')
logPath = os.path.join(os.path.sep, 'var', 'log', 'rbuilder')
que... | Move default location for MCP logs into /var/log/rbuilder/ | Move default location for MCP logs into /var/log/rbuilder/
| Python | apache-2.0 | sassoftware/mcp,sassoftware/mcp | #
# Copyright (c) 2005-2006 rPath, Inc.
#
# All rights reserved
#
import os
from conary import conarycfg
from conary.lib import cfgtypes
class MCPConfig(conarycfg.ConfigFile):
basePath = os.path.join(os.path.sep, 'srv', 'rbuilder', 'mcp')
logPath = os.path.join(basePath, 'logs')
queueHost = '127.0.0.1'
... | #
# Copyright (c) 2005-2006 rPath, Inc.
#
# All rights reserved
#
import os
from conary import conarycfg
from conary.lib import cfgtypes
class MCPConfig(conarycfg.ConfigFile):
basePath = os.path.join(os.path.sep, 'srv', 'rbuilder', 'mcp')
logPath = os.path.join(os.path.sep, 'var', 'log', 'rbuilder')
que... | <commit_before>#
# Copyright (c) 2005-2006 rPath, Inc.
#
# All rights reserved
#
import os
from conary import conarycfg
from conary.lib import cfgtypes
class MCPConfig(conarycfg.ConfigFile):
basePath = os.path.join(os.path.sep, 'srv', 'rbuilder', 'mcp')
logPath = os.path.join(basePath, 'logs')
queueHost... | #
# Copyright (c) 2005-2006 rPath, Inc.
#
# All rights reserved
#
import os
from conary import conarycfg
from conary.lib import cfgtypes
class MCPConfig(conarycfg.ConfigFile):
basePath = os.path.join(os.path.sep, 'srv', 'rbuilder', 'mcp')
logPath = os.path.join(os.path.sep, 'var', 'log', 'rbuilder')
que... | #
# Copyright (c) 2005-2006 rPath, Inc.
#
# All rights reserved
#
import os
from conary import conarycfg
from conary.lib import cfgtypes
class MCPConfig(conarycfg.ConfigFile):
basePath = os.path.join(os.path.sep, 'srv', 'rbuilder', 'mcp')
logPath = os.path.join(basePath, 'logs')
queueHost = '127.0.0.1'
... | <commit_before>#
# Copyright (c) 2005-2006 rPath, Inc.
#
# All rights reserved
#
import os
from conary import conarycfg
from conary.lib import cfgtypes
class MCPConfig(conarycfg.ConfigFile):
basePath = os.path.join(os.path.sep, 'srv', 'rbuilder', 'mcp')
logPath = os.path.join(basePath, 'logs')
queueHost... |
520ad6a456cbd94e176bb54373669baf5e8cfbd9 | sprockets/mixins/correlation/__init__.py | sprockets/mixins/correlation/__init__.py | from .mixins import HandlerMixin
version_info = (1, 0, 2)
__version__ = '.'.join(str(v) for v in version_info[:3])
| try:
from .mixins import HandlerMixin
except ImportError as error:
class HandlerMixin(object):
def __init__(self, *args, **kwargs):
raise error
version_info = (1, 0, 2)
__version__ = '.'.join(str(v) for v in version_info[:3])
| Fix retrieving __version__ without Tornado installed. | Fix retrieving __version__ without Tornado installed.
| Python | bsd-3-clause | sprockets/sprockets.mixins.correlation | from .mixins import HandlerMixin
version_info = (1, 0, 2)
__version__ = '.'.join(str(v) for v in version_info[:3])
Fix retrieving __version__ without Tornado installed. | try:
from .mixins import HandlerMixin
except ImportError as error:
class HandlerMixin(object):
def __init__(self, *args, **kwargs):
raise error
version_info = (1, 0, 2)
__version__ = '.'.join(str(v) for v in version_info[:3])
| <commit_before>from .mixins import HandlerMixin
version_info = (1, 0, 2)
__version__ = '.'.join(str(v) for v in version_info[:3])
<commit_msg>Fix retrieving __version__ without Tornado installed.<commit_after> | try:
from .mixins import HandlerMixin
except ImportError as error:
class HandlerMixin(object):
def __init__(self, *args, **kwargs):
raise error
version_info = (1, 0, 2)
__version__ = '.'.join(str(v) for v in version_info[:3])
| from .mixins import HandlerMixin
version_info = (1, 0, 2)
__version__ = '.'.join(str(v) for v in version_info[:3])
Fix retrieving __version__ without Tornado installed.try:
from .mixins import HandlerMixin
except ImportError as error:
class HandlerMixin(object):
def __init__(self, *args, **kwargs):
... | <commit_before>from .mixins import HandlerMixin
version_info = (1, 0, 2)
__version__ = '.'.join(str(v) for v in version_info[:3])
<commit_msg>Fix retrieving __version__ without Tornado installed.<commit_after>try:
from .mixins import HandlerMixin
except ImportError as error:
class HandlerMixin(object):
... |
99eafe1fb8ed3edce0d8d025b74ffdffa3bf8ae6 | fabfile.py | fabfile.py | import sys
import sh
from fabric import api as fab
sed = sh.sed.bake('-i bak -e')
TRAVIS_YAML = '.travis.yml'
REPLACE_LANGUAGE = 's/language: .*/language: {}/'
def is_dirty():
return "" != sh.git.status(porcelain=True).strip()
def release(language, message):
if is_dirty():
sys.exit("Repo must be i... | import sys
import sh
from fabric import api as fab
sed = sh.sed.bake('-i bak -e')
TRAVIS_YAML = '.travis.yml'
REPLACE_LANGUAGE = 's/language: .*/language: {}/'
def is_dirty():
return "" != sh.git.status(porcelain=True).strip()
def release(language, message):
if is_dirty():
sys.exit("Repo must be i... | Print if nothing to update | Print if nothing to update
| Python | bsd-3-clause | datamicroscopes/release,jzf2101/release,jzf2101/release,datamicroscopes/release | import sys
import sh
from fabric import api as fab
sed = sh.sed.bake('-i bak -e')
TRAVIS_YAML = '.travis.yml'
REPLACE_LANGUAGE = 's/language: .*/language: {}/'
def is_dirty():
return "" != sh.git.status(porcelain=True).strip()
def release(language, message):
if is_dirty():
sys.exit("Repo must be i... | import sys
import sh
from fabric import api as fab
sed = sh.sed.bake('-i bak -e')
TRAVIS_YAML = '.travis.yml'
REPLACE_LANGUAGE = 's/language: .*/language: {}/'
def is_dirty():
return "" != sh.git.status(porcelain=True).strip()
def release(language, message):
if is_dirty():
sys.exit("Repo must be i... | <commit_before>import sys
import sh
from fabric import api as fab
sed = sh.sed.bake('-i bak -e')
TRAVIS_YAML = '.travis.yml'
REPLACE_LANGUAGE = 's/language: .*/language: {}/'
def is_dirty():
return "" != sh.git.status(porcelain=True).strip()
def release(language, message):
if is_dirty():
sys.exit(... | import sys
import sh
from fabric import api as fab
sed = sh.sed.bake('-i bak -e')
TRAVIS_YAML = '.travis.yml'
REPLACE_LANGUAGE = 's/language: .*/language: {}/'
def is_dirty():
return "" != sh.git.status(porcelain=True).strip()
def release(language, message):
if is_dirty():
sys.exit("Repo must be i... | import sys
import sh
from fabric import api as fab
sed = sh.sed.bake('-i bak -e')
TRAVIS_YAML = '.travis.yml'
REPLACE_LANGUAGE = 's/language: .*/language: {}/'
def is_dirty():
return "" != sh.git.status(porcelain=True).strip()
def release(language, message):
if is_dirty():
sys.exit("Repo must be i... | <commit_before>import sys
import sh
from fabric import api as fab
sed = sh.sed.bake('-i bak -e')
TRAVIS_YAML = '.travis.yml'
REPLACE_LANGUAGE = 's/language: .*/language: {}/'
def is_dirty():
return "" != sh.git.status(porcelain=True).strip()
def release(language, message):
if is_dirty():
sys.exit(... |
70f0be172801ee5fd205a90c78e2bf66f8e4ae07 | playserver/webserver.py | playserver/webserver.py | import flask
from . import track
app = flask.Flask(__name__)
@app.route("/")
def root():
song = track.getCurrentSong()
artist = track.getCurrentArtist()
album = track.getCurrentAlbum()
return "{} by {} - {}".format(song, artist, album)
| import flask
import json
from . import track
app = flask.Flask(__name__)
@app.route("/")
def root():
song = track.getCurrentSong()
artist = track.getCurrentArtist()
album = track.getCurrentAlbum()
return "{} by {} - {}".format(song, artist, album)
@app.route("/get_song_info")
def getSongInfo():
return json.dump... | Add basic routes for controls and song info | Add basic routes for controls and song info
| Python | mit | ollien/playserver,ollien/playserver,ollien/playserver | import flask
from . import track
app = flask.Flask(__name__)
@app.route("/")
def root():
song = track.getCurrentSong()
artist = track.getCurrentArtist()
album = track.getCurrentAlbum()
return "{} by {} - {}".format(song, artist, album)
Add basic routes for controls and song info | import flask
import json
from . import track
app = flask.Flask(__name__)
@app.route("/")
def root():
song = track.getCurrentSong()
artist = track.getCurrentArtist()
album = track.getCurrentAlbum()
return "{} by {} - {}".format(song, artist, album)
@app.route("/get_song_info")
def getSongInfo():
return json.dump... | <commit_before>import flask
from . import track
app = flask.Flask(__name__)
@app.route("/")
def root():
song = track.getCurrentSong()
artist = track.getCurrentArtist()
album = track.getCurrentAlbum()
return "{} by {} - {}".format(song, artist, album)
<commit_msg>Add basic routes for controls and song info<commit_... | import flask
import json
from . import track
app = flask.Flask(__name__)
@app.route("/")
def root():
song = track.getCurrentSong()
artist = track.getCurrentArtist()
album = track.getCurrentAlbum()
return "{} by {} - {}".format(song, artist, album)
@app.route("/get_song_info")
def getSongInfo():
return json.dump... | import flask
from . import track
app = flask.Flask(__name__)
@app.route("/")
def root():
song = track.getCurrentSong()
artist = track.getCurrentArtist()
album = track.getCurrentAlbum()
return "{} by {} - {}".format(song, artist, album)
Add basic routes for controls and song infoimport flask
import json
from . imp... | <commit_before>import flask
from . import track
app = flask.Flask(__name__)
@app.route("/")
def root():
song = track.getCurrentSong()
artist = track.getCurrentArtist()
album = track.getCurrentAlbum()
return "{} by {} - {}".format(song, artist, album)
<commit_msg>Add basic routes for controls and song info<commit_... |
76d60adabc44fd3bbd432ee2cdad011b542a2fee | nel/features/mapping.py | nel/features/mapping.py | import math
import numpy
class FeatureMapper(object):
def __init__(self, features):
self.features = features
def map(self, fv):
raise NotImplementedError
def __call__(self, doc):
for chain in doc.chains:
for c in chain.candidates:
c.fv = self.map(nu... | import math
import numpy
class FeatureMapper(object):
def __init__(self, features):
self.features = features
def map(self, fv):
raise NotImplementedError
def __call__(self, doc):
for chain in doc.chains:
for c in chain.candidates:
c.fv = self.map(nu... | Add feature vector size calculation method to mapper interface | Add feature vector size calculation method to mapper interface
| Python | mit | wikilinks/nel,wikilinks/nel | import math
import numpy
class FeatureMapper(object):
def __init__(self, features):
self.features = features
def map(self, fv):
raise NotImplementedError
def __call__(self, doc):
for chain in doc.chains:
for c in chain.candidates:
c.fv = self.map(nu... | import math
import numpy
class FeatureMapper(object):
def __init__(self, features):
self.features = features
def map(self, fv):
raise NotImplementedError
def __call__(self, doc):
for chain in doc.chains:
for c in chain.candidates:
c.fv = self.map(nu... | <commit_before>import math
import numpy
class FeatureMapper(object):
def __init__(self, features):
self.features = features
def map(self, fv):
raise NotImplementedError
def __call__(self, doc):
for chain in doc.chains:
for c in chain.candidates:
c.f... | import math
import numpy
class FeatureMapper(object):
def __init__(self, features):
self.features = features
def map(self, fv):
raise NotImplementedError
def __call__(self, doc):
for chain in doc.chains:
for c in chain.candidates:
c.fv = self.map(nu... | import math
import numpy
class FeatureMapper(object):
def __init__(self, features):
self.features = features
def map(self, fv):
raise NotImplementedError
def __call__(self, doc):
for chain in doc.chains:
for c in chain.candidates:
c.fv = self.map(nu... | <commit_before>import math
import numpy
class FeatureMapper(object):
def __init__(self, features):
self.features = features
def map(self, fv):
raise NotImplementedError
def __call__(self, doc):
for chain in doc.chains:
for c in chain.candidates:
c.f... |
141ad63b28eff5c7a034d479b98c83334ff1f0a3 | provokator/site/util.py | provokator/site/util.py | #!/usr/bin/python3 -tt
# -*- coding: utf-8 -*-
__all__ = ['internal_origin_only']
from urllib.parse import urlparse
from functools import wraps
from werkzeug.exceptions import Forbidden
import flask
import re
def internal_origin_only(fn):
@wraps(fn)
def wrapper(*args, **kwargs):
h = urlparse('http:... | #!/usr/bin/python3 -tt
# -*- coding: utf-8 -*-
__all__ = ['internal_origin_only']
from urllib.parse import urlparse
from functools import wraps
from werkzeug.exceptions import Forbidden
import flask
import re
def internal_origin_only(fn):
@wraps(fn)
def wrapper(*args, **kwargs):
host = flask.reques... | Change cross-origin check to work behind proxies | Change cross-origin check to work behind proxies
Signed-off-by: Jan Dvořák <86df5a4870880bf501c926309e3bcfbe57789f3f@anilinux.org>
| Python | mit | techlib/provokator,techlib/provokator | #!/usr/bin/python3 -tt
# -*- coding: utf-8 -*-
__all__ = ['internal_origin_only']
from urllib.parse import urlparse
from functools import wraps
from werkzeug.exceptions import Forbidden
import flask
import re
def internal_origin_only(fn):
@wraps(fn)
def wrapper(*args, **kwargs):
h = urlparse('http:... | #!/usr/bin/python3 -tt
# -*- coding: utf-8 -*-
__all__ = ['internal_origin_only']
from urllib.parse import urlparse
from functools import wraps
from werkzeug.exceptions import Forbidden
import flask
import re
def internal_origin_only(fn):
@wraps(fn)
def wrapper(*args, **kwargs):
host = flask.reques... | <commit_before>#!/usr/bin/python3 -tt
# -*- coding: utf-8 -*-
__all__ = ['internal_origin_only']
from urllib.parse import urlparse
from functools import wraps
from werkzeug.exceptions import Forbidden
import flask
import re
def internal_origin_only(fn):
@wraps(fn)
def wrapper(*args, **kwargs):
h = ... | #!/usr/bin/python3 -tt
# -*- coding: utf-8 -*-
__all__ = ['internal_origin_only']
from urllib.parse import urlparse
from functools import wraps
from werkzeug.exceptions import Forbidden
import flask
import re
def internal_origin_only(fn):
@wraps(fn)
def wrapper(*args, **kwargs):
host = flask.reques... | #!/usr/bin/python3 -tt
# -*- coding: utf-8 -*-
__all__ = ['internal_origin_only']
from urllib.parse import urlparse
from functools import wraps
from werkzeug.exceptions import Forbidden
import flask
import re
def internal_origin_only(fn):
@wraps(fn)
def wrapper(*args, **kwargs):
h = urlparse('http:... | <commit_before>#!/usr/bin/python3 -tt
# -*- coding: utf-8 -*-
__all__ = ['internal_origin_only']
from urllib.parse import urlparse
from functools import wraps
from werkzeug.exceptions import Forbidden
import flask
import re
def internal_origin_only(fn):
@wraps(fn)
def wrapper(*args, **kwargs):
h = ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.