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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7d756efb7361c13b0db0f37ead9668351c3a6887 | unitTestUtils/parseXML.py | unitTestUtils/parseXML.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
from xml.etree.ElementTree import ParseError
import xml.etree.ElementTree as ET
import glob
import sys
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
def parse():
for infile in glob.glob('*.xml'):
tr... | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
from xml.etree.ElementTree import ParseError
import xml.etree.ElementTree as ET
import glob
import sys
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
def parse():
for infile in glob.glob('*.xml'):
tr... | Add a print with file where mistake is | Add a print with file where mistake is
| Python | apache-2.0 | wkrzemien/j-pet-framework,wkrzemien/j-pet-framework,wkrzemien/j-pet-framework,wkrzemien/j-pet-framework,wkrzemien/j-pet-framework | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
from xml.etree.ElementTree import ParseError
import xml.etree.ElementTree as ET
import glob
import sys
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
def parse():
for infile in glob.glob('*.xml'):
tr... | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
from xml.etree.ElementTree import ParseError
import xml.etree.ElementTree as ET
import glob
import sys
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
def parse():
for infile in glob.glob('*.xml'):
tr... | <commit_before>#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
from xml.etree.ElementTree import ParseError
import xml.etree.ElementTree as ET
import glob
import sys
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
def parse():
for infile in glob.glob('*.xm... | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
from xml.etree.ElementTree import ParseError
import xml.etree.ElementTree as ET
import glob
import sys
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
def parse():
for infile in glob.glob('*.xml'):
tr... | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
from xml.etree.ElementTree import ParseError
import xml.etree.ElementTree as ET
import glob
import sys
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
def parse():
for infile in glob.glob('*.xml'):
tr... | <commit_before>#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
from xml.etree.ElementTree import ParseError
import xml.etree.ElementTree as ET
import glob
import sys
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
def parse():
for infile in glob.glob('*.xm... |
817de880b1bce7b16348ae3e0b1494753e7fe6b8 | emission/net/ext_service/push/notify_queries.py | emission/net/ext_service/push/notify_queries.py | # Standard imports
import json
import logging
import uuid
# Our imports
import emission.core.get_database as edb
def get_platform_query(platform):
return {"curr_platform": platform}
def get_sync_interval_query(interval):
return {"curr_sync_interval": interval}
def get_user_query(user_id_list):
return {"... | # Standard imports
import json
import logging
import uuid
# Our imports
import emission.core.get_database as edb
def get_platform_query(platform):
return {"curr_platform": platform}
def get_sync_interval_query(interval):
return {"curr_sync_interval": interval}
def get_user_query(user_id_list):
return {"... | Add support for returning the uuids for a profile query | Add support for returning the uuids for a profile query
in addition to the tokens. This allows us to link profile query results to the
survey/push notification feature.
| Python | bsd-3-clause | e-mission/e-mission-server,e-mission/e-mission-server,shankari/e-mission-server,e-mission/e-mission-server,sunil07t/e-mission-server,shankari/e-mission-server,shankari/e-mission-server,sunil07t/e-mission-server,sunil07t/e-mission-server,shankari/e-mission-server,e-mission/e-mission-server,sunil07t/e-mission-server | # Standard imports
import json
import logging
import uuid
# Our imports
import emission.core.get_database as edb
def get_platform_query(platform):
return {"curr_platform": platform}
def get_sync_interval_query(interval):
return {"curr_sync_interval": interval}
def get_user_query(user_id_list):
return {"... | # Standard imports
import json
import logging
import uuid
# Our imports
import emission.core.get_database as edb
def get_platform_query(platform):
return {"curr_platform": platform}
def get_sync_interval_query(interval):
return {"curr_sync_interval": interval}
def get_user_query(user_id_list):
return {"... | <commit_before># Standard imports
import json
import logging
import uuid
# Our imports
import emission.core.get_database as edb
def get_platform_query(platform):
return {"curr_platform": platform}
def get_sync_interval_query(interval):
return {"curr_sync_interval": interval}
def get_user_query(user_id_list)... | # Standard imports
import json
import logging
import uuid
# Our imports
import emission.core.get_database as edb
def get_platform_query(platform):
return {"curr_platform": platform}
def get_sync_interval_query(interval):
return {"curr_sync_interval": interval}
def get_user_query(user_id_list):
return {"... | # Standard imports
import json
import logging
import uuid
# Our imports
import emission.core.get_database as edb
def get_platform_query(platform):
return {"curr_platform": platform}
def get_sync_interval_query(interval):
return {"curr_sync_interval": interval}
def get_user_query(user_id_list):
return {"... | <commit_before># Standard imports
import json
import logging
import uuid
# Our imports
import emission.core.get_database as edb
def get_platform_query(platform):
return {"curr_platform": platform}
def get_sync_interval_query(interval):
return {"curr_sync_interval": interval}
def get_user_query(user_id_list)... |
e885701a12fcb2d2557c975fadbabc7ee28ebf8b | djoauth2/helpers.py | djoauth2/helpers.py | # coding: utf-8
import random
from string import ascii_letters, digits
# From http://tools.ietf.org/html/rfc6750#section-2.1
BEARER_TOKEN_CHARSET = ascii_letters + digits + '-._~+/'
def random_hash(length):
return ''.join(random.sample(BEARER_TOKEN_CHARSET, length))
def random_hash_generator(length):
return la... | # coding: utf-8
import random
import urlparse
from string import ascii_letters, digits
from urllib2 import urlencode
# From http://tools.ietf.org/html/rfc6750#section-2.1
BEARER_TOKEN_CHARSET = ascii_letters + digits + '-._~+/'
def random_hash(length):
return ''.join(random.sample(BEARER_TOKEN_CHARSET, length))
... | Add helper for updating URL GET parameters. | Add helper for updating URL GET parameters.
| Python | mit | vden/djoauth2-ng,vden/djoauth2-ng,Locu/djoauth2,seler/djoauth2,Locu/djoauth2,seler/djoauth2 | # coding: utf-8
import random
from string import ascii_letters, digits
# From http://tools.ietf.org/html/rfc6750#section-2.1
BEARER_TOKEN_CHARSET = ascii_letters + digits + '-._~+/'
def random_hash(length):
return ''.join(random.sample(BEARER_TOKEN_CHARSET, length))
def random_hash_generator(length):
return la... | # coding: utf-8
import random
import urlparse
from string import ascii_letters, digits
from urllib2 import urlencode
# From http://tools.ietf.org/html/rfc6750#section-2.1
BEARER_TOKEN_CHARSET = ascii_letters + digits + '-._~+/'
def random_hash(length):
return ''.join(random.sample(BEARER_TOKEN_CHARSET, length))
... | <commit_before># coding: utf-8
import random
from string import ascii_letters, digits
# From http://tools.ietf.org/html/rfc6750#section-2.1
BEARER_TOKEN_CHARSET = ascii_letters + digits + '-._~+/'
def random_hash(length):
return ''.join(random.sample(BEARER_TOKEN_CHARSET, length))
def random_hash_generator(lengt... | # coding: utf-8
import random
import urlparse
from string import ascii_letters, digits
from urllib2 import urlencode
# From http://tools.ietf.org/html/rfc6750#section-2.1
BEARER_TOKEN_CHARSET = ascii_letters + digits + '-._~+/'
def random_hash(length):
return ''.join(random.sample(BEARER_TOKEN_CHARSET, length))
... | # coding: utf-8
import random
from string import ascii_letters, digits
# From http://tools.ietf.org/html/rfc6750#section-2.1
BEARER_TOKEN_CHARSET = ascii_letters + digits + '-._~+/'
def random_hash(length):
return ''.join(random.sample(BEARER_TOKEN_CHARSET, length))
def random_hash_generator(length):
return la... | <commit_before># coding: utf-8
import random
from string import ascii_letters, digits
# From http://tools.ietf.org/html/rfc6750#section-2.1
BEARER_TOKEN_CHARSET = ascii_letters + digits + '-._~+/'
def random_hash(length):
return ''.join(random.sample(BEARER_TOKEN_CHARSET, length))
def random_hash_generator(lengt... |
e2722385831a0930765d2c4bb78a582d41f4b64b | src/sentry/replays.py | src/sentry/replays.py | from __future__ import absolute_import
import socket
from httplib import HTTPConnection, HTTPSConnection
from urllib import urlencode
from urlparse import urlparse
class Replayer(object):
def __init__(self, url, method, data=None, headers=None):
self.url = url
self.method = method
self.d... | from __future__ import absolute_import
import requests
class Replayer(object):
def __init__(self, url, method, data=None, headers=None):
self.url = url
self.method = method
self.data = data
self.headers = headers
def replay(self):
try:
response = requests.r... | Use requests instead of httplib to do replay | Use requests instead of httplib to do replay
| Python | bsd-3-clause | beeftornado/sentry,nicholasserra/sentry,Kryz/sentry,JackDanger/sentry,imankulov/sentry,JamesMura/sentry,zenefits/sentry,kevinlondon/sentry,mvaled/sentry,JamesMura/sentry,ifduyue/sentry,looker/sentry,daevaorn/sentry,fotinakis/sentry,gencer/sentry,looker/sentry,JackDanger/sentry,mvaled/sentry,Natim/sentry,beeftornado/sen... | from __future__ import absolute_import
import socket
from httplib import HTTPConnection, HTTPSConnection
from urllib import urlencode
from urlparse import urlparse
class Replayer(object):
def __init__(self, url, method, data=None, headers=None):
self.url = url
self.method = method
self.d... | from __future__ import absolute_import
import requests
class Replayer(object):
def __init__(self, url, method, data=None, headers=None):
self.url = url
self.method = method
self.data = data
self.headers = headers
def replay(self):
try:
response = requests.r... | <commit_before>from __future__ import absolute_import
import socket
from httplib import HTTPConnection, HTTPSConnection
from urllib import urlencode
from urlparse import urlparse
class Replayer(object):
def __init__(self, url, method, data=None, headers=None):
self.url = url
self.method = method... | from __future__ import absolute_import
import requests
class Replayer(object):
def __init__(self, url, method, data=None, headers=None):
self.url = url
self.method = method
self.data = data
self.headers = headers
def replay(self):
try:
response = requests.r... | from __future__ import absolute_import
import socket
from httplib import HTTPConnection, HTTPSConnection
from urllib import urlencode
from urlparse import urlparse
class Replayer(object):
def __init__(self, url, method, data=None, headers=None):
self.url = url
self.method = method
self.d... | <commit_before>from __future__ import absolute_import
import socket
from httplib import HTTPConnection, HTTPSConnection
from urllib import urlencode
from urlparse import urlparse
class Replayer(object):
def __init__(self, url, method, data=None, headers=None):
self.url = url
self.method = method... |
133617660fe96a817b47d4d0fba4cfa7567dcafb | exceptional.py | exceptional.py | """A module to demonstrate exceptions."""
import sys
def convert(item):
'''
Convert to an integer.
Args:
item: some object
Returns:
an integer representation of the object
Throws:
a ValueException
'''
try:
x = int(item)
print(str.format('Conversio... | """A module to demonstrate exceptions."""
import sys
def convert(item):
"""
Convert to an integer.
Args:
item: some object
Returns:
an integer representation of the object
Throws:
a ValueException
"""
try:
return int(item)
except (ValueError, TypeErro... | Use two return statements and remove printing | Use two return statements and remove printing
| Python | mit | kentoj/python-fundamentals | """A module to demonstrate exceptions."""
import sys
def convert(item):
'''
Convert to an integer.
Args:
item: some object
Returns:
an integer representation of the object
Throws:
a ValueException
'''
try:
x = int(item)
print(str.format('Conversio... | """A module to demonstrate exceptions."""
import sys
def convert(item):
"""
Convert to an integer.
Args:
item: some object
Returns:
an integer representation of the object
Throws:
a ValueException
"""
try:
return int(item)
except (ValueError, TypeErro... | <commit_before>"""A module to demonstrate exceptions."""
import sys
def convert(item):
'''
Convert to an integer.
Args:
item: some object
Returns:
an integer representation of the object
Throws:
a ValueException
'''
try:
x = int(item)
print(str.fo... | """A module to demonstrate exceptions."""
import sys
def convert(item):
"""
Convert to an integer.
Args:
item: some object
Returns:
an integer representation of the object
Throws:
a ValueException
"""
try:
return int(item)
except (ValueError, TypeErro... | """A module to demonstrate exceptions."""
import sys
def convert(item):
'''
Convert to an integer.
Args:
item: some object
Returns:
an integer representation of the object
Throws:
a ValueException
'''
try:
x = int(item)
print(str.format('Conversio... | <commit_before>"""A module to demonstrate exceptions."""
import sys
def convert(item):
'''
Convert to an integer.
Args:
item: some object
Returns:
an integer representation of the object
Throws:
a ValueException
'''
try:
x = int(item)
print(str.fo... |
972073f7d65fe4ea2910241a7f8ba42a78ab3a86 | fore/config.py | fore/config.py | # Basic config for stuff that can be easily changed, but which is git-managed.
# See also apikeys_sample.py for the configs which are _not_ git-managed.
app_name = "fore"
server_domain = "http://www.infiniteglitch.net"
lag_limit = 88200 # samples - how much we can lag by before dropping frames.
restart_timeou... | # Basic config for stuff that can be easily changed, but which is git-managed.
# See also apikeys_sample.py for the configs which are _not_ git-managed.
app_name = "fore"
server_domain = "http://www.infiniteglitch.net"
lag_limit = 88200 # samples - how much we can lag by before dropping frames.
restart_timeou... | Decrease user and group IDs from 1000 to 0. | Decrease user and group IDs from 1000 to 0.
| Python | artistic-2.0 | Rosuav/appension,MikeiLL/appension,Rosuav/appension,MikeiLL/appension,MikeiLL/appension,MikeiLL/appension,Rosuav/appension,Rosuav/appension | # Basic config for stuff that can be easily changed, but which is git-managed.
# See also apikeys_sample.py for the configs which are _not_ git-managed.
app_name = "fore"
server_domain = "http://www.infiniteglitch.net"
lag_limit = 88200 # samples - how much we can lag by before dropping frames.
restart_timeou... | # Basic config for stuff that can be easily changed, but which is git-managed.
# See also apikeys_sample.py for the configs which are _not_ git-managed.
app_name = "fore"
server_domain = "http://www.infiniteglitch.net"
lag_limit = 88200 # samples - how much we can lag by before dropping frames.
restart_timeou... | <commit_before># Basic config for stuff that can be easily changed, but which is git-managed.
# See also apikeys_sample.py for the configs which are _not_ git-managed.
app_name = "fore"
server_domain = "http://www.infiniteglitch.net"
lag_limit = 88200 # samples - how much we can lag by before dropping frames.... | # Basic config for stuff that can be easily changed, but which is git-managed.
# See also apikeys_sample.py for the configs which are _not_ git-managed.
app_name = "fore"
server_domain = "http://www.infiniteglitch.net"
lag_limit = 88200 # samples - how much we can lag by before dropping frames.
restart_timeou... | # Basic config for stuff that can be easily changed, but which is git-managed.
# See also apikeys_sample.py for the configs which are _not_ git-managed.
app_name = "fore"
server_domain = "http://www.infiniteglitch.net"
lag_limit = 88200 # samples - how much we can lag by before dropping frames.
restart_timeou... | <commit_before># Basic config for stuff that can be easily changed, but which is git-managed.
# See also apikeys_sample.py for the configs which are _not_ git-managed.
app_name = "fore"
server_domain = "http://www.infiniteglitch.net"
lag_limit = 88200 # samples - how much we can lag by before dropping frames.... |
a0172116503f0b212a184fc4a1d2179115675e17 | fuzzyfinder/main.py | fuzzyfinder/main.py | # -*- coding: utf-8 -*-
import re
from . import export
@export
def fuzzyfinder(text, collection):
"""
Args:
text (str): A partial string which is typically entered by a user.
collection (iterable): A collection of strings which will be filtered
based on the input ... | # -*- coding: utf-8 -*-
import re
from . import export
@export
def fuzzyfinder(text, collection):
"""
Args:
text (str): A partial string which is typically entered by a user.
collection (iterable): A collection of strings which will be filtered
based on the input ... | Remove string interpolation and sorting the collection. | Remove string interpolation and sorting the collection. | Python | bsd-3-clause | adammenges/fuzzyfinder,amjith/fuzzyfinder,harrisonfeng/fuzzyfinder | # -*- coding: utf-8 -*-
import re
from . import export
@export
def fuzzyfinder(text, collection):
"""
Args:
text (str): A partial string which is typically entered by a user.
collection (iterable): A collection of strings which will be filtered
based on the input ... | # -*- coding: utf-8 -*-
import re
from . import export
@export
def fuzzyfinder(text, collection):
"""
Args:
text (str): A partial string which is typically entered by a user.
collection (iterable): A collection of strings which will be filtered
based on the input ... | <commit_before># -*- coding: utf-8 -*-
import re
from . import export
@export
def fuzzyfinder(text, collection):
"""
Args:
text (str): A partial string which is typically entered by a user.
collection (iterable): A collection of strings which will be filtered
base... | # -*- coding: utf-8 -*-
import re
from . import export
@export
def fuzzyfinder(text, collection):
"""
Args:
text (str): A partial string which is typically entered by a user.
collection (iterable): A collection of strings which will be filtered
based on the input ... | # -*- coding: utf-8 -*-
import re
from . import export
@export
def fuzzyfinder(text, collection):
"""
Args:
text (str): A partial string which is typically entered by a user.
collection (iterable): A collection of strings which will be filtered
based on the input ... | <commit_before># -*- coding: utf-8 -*-
import re
from . import export
@export
def fuzzyfinder(text, collection):
"""
Args:
text (str): A partial string which is typically entered by a user.
collection (iterable): A collection of strings which will be filtered
base... |
caf0829191e9f3276fb144486ad602dcd482b60d | ignition/dsl/sfl/proteus_coefficient_printer.py | ignition/dsl/sfl/proteus_coefficient_printer.py | """Generator for Proteus coefficient evaluator"""
from .sfl_printer import SFLPrinter
from ...code_tools import comment_code, indent_code, PythonCodePrinter
coefficient_header = """\
Proteus Coefficient file generated from Ignition
"""
class_header = """\
class %{class_name}s(TC_base):
"""
class ProteusCoefficien... | """Generator for Proteus coefficient evaluator"""
from .sfl_printer import SFLPrinter
from ...code_tools import comment_code, indent_code, PythonCodePrinter
coefficient_header = """\
Proteus Coefficient file generated from Ignition
"""
class ProteusCoefficientPrinter(SFLPrinter):
"""Generator for Proteus Coeff... | Print head, remove code for proteus python class head (use codeobj) | Print head, remove code for proteus python class head (use codeobj)
| Python | bsd-3-clause | IgnitionProject/ignition,IgnitionProject/ignition,IgnitionProject/ignition | """Generator for Proteus coefficient evaluator"""
from .sfl_printer import SFLPrinter
from ...code_tools import comment_code, indent_code, PythonCodePrinter
coefficient_header = """\
Proteus Coefficient file generated from Ignition
"""
class_header = """\
class %{class_name}s(TC_base):
"""
class ProteusCoefficien... | """Generator for Proteus coefficient evaluator"""
from .sfl_printer import SFLPrinter
from ...code_tools import comment_code, indent_code, PythonCodePrinter
coefficient_header = """\
Proteus Coefficient file generated from Ignition
"""
class ProteusCoefficientPrinter(SFLPrinter):
"""Generator for Proteus Coeff... | <commit_before>"""Generator for Proteus coefficient evaluator"""
from .sfl_printer import SFLPrinter
from ...code_tools import comment_code, indent_code, PythonCodePrinter
coefficient_header = """\
Proteus Coefficient file generated from Ignition
"""
class_header = """\
class %{class_name}s(TC_base):
"""
class Pr... | """Generator for Proteus coefficient evaluator"""
from .sfl_printer import SFLPrinter
from ...code_tools import comment_code, indent_code, PythonCodePrinter
coefficient_header = """\
Proteus Coefficient file generated from Ignition
"""
class ProteusCoefficientPrinter(SFLPrinter):
"""Generator for Proteus Coeff... | """Generator for Proteus coefficient evaluator"""
from .sfl_printer import SFLPrinter
from ...code_tools import comment_code, indent_code, PythonCodePrinter
coefficient_header = """\
Proteus Coefficient file generated from Ignition
"""
class_header = """\
class %{class_name}s(TC_base):
"""
class ProteusCoefficien... | <commit_before>"""Generator for Proteus coefficient evaluator"""
from .sfl_printer import SFLPrinter
from ...code_tools import comment_code, indent_code, PythonCodePrinter
coefficient_header = """\
Proteus Coefficient file generated from Ignition
"""
class_header = """\
class %{class_name}s(TC_base):
"""
class Pr... |
373e4e0e58cfec09b60983494f7b3bb4712e0ccd | 2/ConfNEP.py | 2/ConfNEP.py | """A custom ILAMB confrontation for net ecosystem productivity (nep)."""
import os
import numpy as np
from ILAMB.Confrontation import Confrontation
from ILAMB.Variable import Variable
import ilamblib as il
class ConfNEP(Confrontation):
"""Confront ``nep`` model outputs with ``nee`` observations.
Net ecosyste... | """A custom ILAMB confrontation for net ecosystem productivity (nep)."""
import os
import numpy as np
from ILAMB.Confrontation import Confrontation
from ILAMB.Variable import Variable
from ILAMB.ilamblib import MakeComparable
class ConfNEP(Confrontation):
"""Confront ``nep`` model outputs with ``nee`` observation... | Change import so it works | Change import so it works
| Python | mit | permamodel/ILAMB-experiments | """A custom ILAMB confrontation for net ecosystem productivity (nep)."""
import os
import numpy as np
from ILAMB.Confrontation import Confrontation
from ILAMB.Variable import Variable
import ilamblib as il
class ConfNEP(Confrontation):
"""Confront ``nep`` model outputs with ``nee`` observations.
Net ecosyste... | """A custom ILAMB confrontation for net ecosystem productivity (nep)."""
import os
import numpy as np
from ILAMB.Confrontation import Confrontation
from ILAMB.Variable import Variable
from ILAMB.ilamblib import MakeComparable
class ConfNEP(Confrontation):
"""Confront ``nep`` model outputs with ``nee`` observation... | <commit_before>"""A custom ILAMB confrontation for net ecosystem productivity (nep)."""
import os
import numpy as np
from ILAMB.Confrontation import Confrontation
from ILAMB.Variable import Variable
import ilamblib as il
class ConfNEP(Confrontation):
"""Confront ``nep`` model outputs with ``nee`` observations.
... | """A custom ILAMB confrontation for net ecosystem productivity (nep)."""
import os
import numpy as np
from ILAMB.Confrontation import Confrontation
from ILAMB.Variable import Variable
from ILAMB.ilamblib import MakeComparable
class ConfNEP(Confrontation):
"""Confront ``nep`` model outputs with ``nee`` observation... | """A custom ILAMB confrontation for net ecosystem productivity (nep)."""
import os
import numpy as np
from ILAMB.Confrontation import Confrontation
from ILAMB.Variable import Variable
import ilamblib as il
class ConfNEP(Confrontation):
"""Confront ``nep`` model outputs with ``nee`` observations.
Net ecosyste... | <commit_before>"""A custom ILAMB confrontation for net ecosystem productivity (nep)."""
import os
import numpy as np
from ILAMB.Confrontation import Confrontation
from ILAMB.Variable import Variable
import ilamblib as il
class ConfNEP(Confrontation):
"""Confront ``nep`` model outputs with ``nee`` observations.
... |
23ec0899eaf60a9dc79f6671461a33eea7e7f464 | authtools/backends.py | authtools/backends.py | from django.contrib.auth.backends import ModelBackend
class CaseInsensitiveEmailBackend(ModelBackend):
"""
This authentication backend assumes that usernames are email addresses and simply lowercases
a username before an attempt is made to authenticate said username using Django's ModelBackend.
Examp... | from django.contrib.auth.backends import ModelBackend
class CaseInsensitiveEmailBackendMixin(object):
def authenticate(self, username=None, password=None, **kwargs):
if username is not None:
username = username.lower()
return super(CaseInsensitiveEmailBackendMixin, self).authenticate(... | Add mixin to make the case-insensitive email auth backend more flexible | Add mixin to make the case-insensitive email auth backend more flexible
| Python | bsd-2-clause | fusionbox/django-authtools,vuchau/django-authtools,moreati/django-authtools,eevol/django-authtools,kivikakk/django-authtools | from django.contrib.auth.backends import ModelBackend
class CaseInsensitiveEmailBackend(ModelBackend):
"""
This authentication backend assumes that usernames are email addresses and simply lowercases
a username before an attempt is made to authenticate said username using Django's ModelBackend.
Examp... | from django.contrib.auth.backends import ModelBackend
class CaseInsensitiveEmailBackendMixin(object):
def authenticate(self, username=None, password=None, **kwargs):
if username is not None:
username = username.lower()
return super(CaseInsensitiveEmailBackendMixin, self).authenticate(... | <commit_before>from django.contrib.auth.backends import ModelBackend
class CaseInsensitiveEmailBackend(ModelBackend):
"""
This authentication backend assumes that usernames are email addresses and simply lowercases
a username before an attempt is made to authenticate said username using Django's ModelBack... | from django.contrib.auth.backends import ModelBackend
class CaseInsensitiveEmailBackendMixin(object):
def authenticate(self, username=None, password=None, **kwargs):
if username is not None:
username = username.lower()
return super(CaseInsensitiveEmailBackendMixin, self).authenticate(... | from django.contrib.auth.backends import ModelBackend
class CaseInsensitiveEmailBackend(ModelBackend):
"""
This authentication backend assumes that usernames are email addresses and simply lowercases
a username before an attempt is made to authenticate said username using Django's ModelBackend.
Examp... | <commit_before>from django.contrib.auth.backends import ModelBackend
class CaseInsensitiveEmailBackend(ModelBackend):
"""
This authentication backend assumes that usernames are email addresses and simply lowercases
a username before an attempt is made to authenticate said username using Django's ModelBack... |
e7d171b8b3721093c126560d1982e8eaebc4de6b | jay/urls.py | jay/urls.py | """jay 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-based v... | """jay 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-based v... | Add namespace to votes app URLs | Add namespace to votes app URLs
| Python | mit | kuboschek/jay,OpenJUB/jay,OpenJUB/jay,kuboschek/jay,kuboschek/jay,OpenJUB/jay | """jay 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-based v... | """jay 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-based v... | <commit_before>"""jay 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'... | """jay 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-based v... | """jay 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-based v... | <commit_before>"""jay 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'... |
4874f1b1a7a3ff465493f601f5f056bf8f3f1921 | badgekit_webhooks/urls.py | badgekit_webhooks/urls.py | from __future__ import unicode_literals
from django.conf.urls import patterns, url
from . import views
from django.contrib.admin.views.decorators import staff_member_required
urlpatterns = patterns(
"",
url(r"^hello/$", "badgekit_webhooks.views.hello", name="badgekit_webhooks_hello"),
url(r"^issued/$", "b... | from __future__ import unicode_literals
from django.conf.urls import patterns, url
from . import views
from django.contrib.admin.views.decorators import staff_member_required
urlpatterns = patterns(
"",
url(r"^hello/$", "badgekit_webhooks.views.hello", name="badgekit_webhooks_hello"),
url(r"^issued/$", "b... | Move badge instance list beneath 'badges' url | Move badge instance list beneath 'badges' url
| Python | mit | tgs/django-badgekit-webhooks | from __future__ import unicode_literals
from django.conf.urls import patterns, url
from . import views
from django.contrib.admin.views.decorators import staff_member_required
urlpatterns = patterns(
"",
url(r"^hello/$", "badgekit_webhooks.views.hello", name="badgekit_webhooks_hello"),
url(r"^issued/$", "b... | from __future__ import unicode_literals
from django.conf.urls import patterns, url
from . import views
from django.contrib.admin.views.decorators import staff_member_required
urlpatterns = patterns(
"",
url(r"^hello/$", "badgekit_webhooks.views.hello", name="badgekit_webhooks_hello"),
url(r"^issued/$", "b... | <commit_before>from __future__ import unicode_literals
from django.conf.urls import patterns, url
from . import views
from django.contrib.admin.views.decorators import staff_member_required
urlpatterns = patterns(
"",
url(r"^hello/$", "badgekit_webhooks.views.hello", name="badgekit_webhooks_hello"),
url(r... | from __future__ import unicode_literals
from django.conf.urls import patterns, url
from . import views
from django.contrib.admin.views.decorators import staff_member_required
urlpatterns = patterns(
"",
url(r"^hello/$", "badgekit_webhooks.views.hello", name="badgekit_webhooks_hello"),
url(r"^issued/$", "b... | from __future__ import unicode_literals
from django.conf.urls import patterns, url
from . import views
from django.contrib.admin.views.decorators import staff_member_required
urlpatterns = patterns(
"",
url(r"^hello/$", "badgekit_webhooks.views.hello", name="badgekit_webhooks_hello"),
url(r"^issued/$", "b... | <commit_before>from __future__ import unicode_literals
from django.conf.urls import patterns, url
from . import views
from django.contrib.admin.views.decorators import staff_member_required
urlpatterns = patterns(
"",
url(r"^hello/$", "badgekit_webhooks.views.hello", name="badgekit_webhooks_hello"),
url(r... |
11312893661ac339212fad7d81a21c9ddc2533d3 | identities/tasks.py | identities/tasks.py | import json
import requests
from celery.task import Task
from django.conf import settings
class DeliverHook(Task):
def run(self, target, payload, instance=None, hook=None, **kwargs):
"""
target: the url to receive the payload.
payload: a python primitive data structure
insta... | import json
import requests
from celery.task import Task
from django.conf import settings
class DeliverHook(Task):
def run(self, target, payload, instance_id=None, hook_id=None, **kwargs):
"""
target: the url to receive the payload.
payload: a python primitive data structure
... | Clean up params and docstrings | Clean up params and docstrings
| Python | bsd-3-clause | praekelt/seed-identity-store,praekelt/seed-identity-store | import json
import requests
from celery.task import Task
from django.conf import settings
class DeliverHook(Task):
def run(self, target, payload, instance=None, hook=None, **kwargs):
"""
target: the url to receive the payload.
payload: a python primitive data structure
insta... | import json
import requests
from celery.task import Task
from django.conf import settings
class DeliverHook(Task):
def run(self, target, payload, instance_id=None, hook_id=None, **kwargs):
"""
target: the url to receive the payload.
payload: a python primitive data structure
... | <commit_before>import json
import requests
from celery.task import Task
from django.conf import settings
class DeliverHook(Task):
def run(self, target, payload, instance=None, hook=None, **kwargs):
"""
target: the url to receive the payload.
payload: a python primitive data structur... | import json
import requests
from celery.task import Task
from django.conf import settings
class DeliverHook(Task):
def run(self, target, payload, instance_id=None, hook_id=None, **kwargs):
"""
target: the url to receive the payload.
payload: a python primitive data structure
... | import json
import requests
from celery.task import Task
from django.conf import settings
class DeliverHook(Task):
def run(self, target, payload, instance=None, hook=None, **kwargs):
"""
target: the url to receive the payload.
payload: a python primitive data structure
insta... | <commit_before>import json
import requests
from celery.task import Task
from django.conf import settings
class DeliverHook(Task):
def run(self, target, payload, instance=None, hook=None, **kwargs):
"""
target: the url to receive the payload.
payload: a python primitive data structur... |
42a0fbf29168f12a4bc3afc53bbf7148b9d008f6 | spacy/tests/pipeline/test_textcat.py | spacy/tests/pipeline/test_textcat.py | from __future__ import unicode_literals
from ...language import Language
def test_simple_train():
nlp = Language()
nlp.add_pipe(nlp.create_pipe('textcat'))
nlp.get_pipe('textcat').add_label('is_good')
nlp.begin_training()
for i in range(5):
for text, answer in [('aaaa', 1.), ('bbbb', 0),... | # coding: utf8
from __future__ import unicode_literals
from ...language import Language
def test_simple_train():
nlp = Language()
nlp.add_pipe(nlp.create_pipe('textcat'))
nlp.get_pipe('textcat').add_label('answer')
nlp.begin_training()
for i in range(5):
for text, answer in [('aaaa', 1.),... | Fix textcat simple train example | Fix textcat simple train example
| Python | mit | aikramer2/spaCy,explosion/spaCy,explosion/spaCy,recognai/spaCy,explosion/spaCy,recognai/spaCy,aikramer2/spaCy,spacy-io/spaCy,aikramer2/spaCy,honnibal/spaCy,spacy-io/spaCy,spacy-io/spaCy,spacy-io/spaCy,honnibal/spaCy,spacy-io/spaCy,explosion/spaCy,explosion/spaCy,spacy-io/spaCy,recognai/spaCy,honnibal/spaCy,aikramer2/sp... | from __future__ import unicode_literals
from ...language import Language
def test_simple_train():
nlp = Language()
nlp.add_pipe(nlp.create_pipe('textcat'))
nlp.get_pipe('textcat').add_label('is_good')
nlp.begin_training()
for i in range(5):
for text, answer in [('aaaa', 1.), ('bbbb', 0),... | # coding: utf8
from __future__ import unicode_literals
from ...language import Language
def test_simple_train():
nlp = Language()
nlp.add_pipe(nlp.create_pipe('textcat'))
nlp.get_pipe('textcat').add_label('answer')
nlp.begin_training()
for i in range(5):
for text, answer in [('aaaa', 1.),... | <commit_before>from __future__ import unicode_literals
from ...language import Language
def test_simple_train():
nlp = Language()
nlp.add_pipe(nlp.create_pipe('textcat'))
nlp.get_pipe('textcat').add_label('is_good')
nlp.begin_training()
for i in range(5):
for text, answer in [('aaaa', 1.... | # coding: utf8
from __future__ import unicode_literals
from ...language import Language
def test_simple_train():
nlp = Language()
nlp.add_pipe(nlp.create_pipe('textcat'))
nlp.get_pipe('textcat').add_label('answer')
nlp.begin_training()
for i in range(5):
for text, answer in [('aaaa', 1.),... | from __future__ import unicode_literals
from ...language import Language
def test_simple_train():
nlp = Language()
nlp.add_pipe(nlp.create_pipe('textcat'))
nlp.get_pipe('textcat').add_label('is_good')
nlp.begin_training()
for i in range(5):
for text, answer in [('aaaa', 1.), ('bbbb', 0),... | <commit_before>from __future__ import unicode_literals
from ...language import Language
def test_simple_train():
nlp = Language()
nlp.add_pipe(nlp.create_pipe('textcat'))
nlp.get_pipe('textcat').add_label('is_good')
nlp.begin_training()
for i in range(5):
for text, answer in [('aaaa', 1.... |
0b5b25b5cc3b5fe59c0a263983dae05ebfdc8de9 | plenum/common/transactions.py | plenum/common/transactions.py | from enum import Enum
class Transactions(Enum):
def __str__(self):
return self.name
class PlenumTransactions(Transactions):
# These numeric constants CANNOT be changed once they have been used,
# because that would break backwards compatibility with the ledger
# Also the numeric constants ... | from enum import Enum
class Transactions(Enum):
def __str__(self):
return self.name
class PlenumTransactions(Transactions):
# These numeric constants CANNOT be changed once they have been used,
# because that would break backwards compatibility with the ledger
# Also the numeric constants ... | Add new TAA transaction codes | INDY-2066: Add new TAA transaction codes
Signed-off-by: Sergey Khoroshavin <b770466c7a06c5fe47531d5f0e31684f1131354d@dsr-corporation.com>
| Python | apache-2.0 | evernym/zeno,evernym/plenum | from enum import Enum
class Transactions(Enum):
def __str__(self):
return self.name
class PlenumTransactions(Transactions):
# These numeric constants CANNOT be changed once they have been used,
# because that would break backwards compatibility with the ledger
# Also the numeric constants ... | from enum import Enum
class Transactions(Enum):
def __str__(self):
return self.name
class PlenumTransactions(Transactions):
# These numeric constants CANNOT be changed once they have been used,
# because that would break backwards compatibility with the ledger
# Also the numeric constants ... | <commit_before>from enum import Enum
class Transactions(Enum):
def __str__(self):
return self.name
class PlenumTransactions(Transactions):
# These numeric constants CANNOT be changed once they have been used,
# because that would break backwards compatibility with the ledger
# Also the num... | from enum import Enum
class Transactions(Enum):
def __str__(self):
return self.name
class PlenumTransactions(Transactions):
# These numeric constants CANNOT be changed once they have been used,
# because that would break backwards compatibility with the ledger
# Also the numeric constants ... | from enum import Enum
class Transactions(Enum):
def __str__(self):
return self.name
class PlenumTransactions(Transactions):
# These numeric constants CANNOT be changed once they have been used,
# because that would break backwards compatibility with the ledger
# Also the numeric constants ... | <commit_before>from enum import Enum
class Transactions(Enum):
def __str__(self):
return self.name
class PlenumTransactions(Transactions):
# These numeric constants CANNOT be changed once they have been used,
# because that would break backwards compatibility with the ledger
# Also the num... |
6ad84b8cc930922296fbe8c583c8c69f5b94d9c9 | bots/humbug_git_config.py | bots/humbug_git_config.py | # Humbug Inc's internal git plugin configuration.
# The plugin and example config are under api/integrations/
# Leaving all the instructions out of this file to avoid having to
# sync them as we update the comments.
HUMBUG_USER = "humbug+commits@humbughq.com"
HUMBUG_API_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# com... | # Humbug Inc's internal git plugin configuration.
# The plugin and example config are under api/integrations/
# Leaving all the instructions out of this file to avoid having to
# sync them as we update the comments.
HUMBUG_USER = "humbug+commits@humbughq.com"
HUMBUG_API_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# com... | Put prod back on the list of branches to send notices about. | git: Put prod back on the list of branches to send notices about.
(imported from commit e608d7050b4e68045b03341dc41e8654e45a3af3)
| Python | apache-2.0 | MariaFaBella85/zulip,SmartPeople/zulip,blaze225/zulip,calvinleenyc/zulip,natanovia/zulip,moria/zulip,dnmfarrell/zulip,samatdav/zulip,tbutter/zulip,deer-hope/zulip,guiquanz/zulip,sharmaeklavya2/zulip,zulip/zulip,guiquanz/zulip,rishig/zulip,developerfm/zulip,schatt/zulip,AZtheAsian/zulip,praveenaki/zulip,glovebx/zulip,sh... | # Humbug Inc's internal git plugin configuration.
# The plugin and example config are under api/integrations/
# Leaving all the instructions out of this file to avoid having to
# sync them as we update the comments.
HUMBUG_USER = "humbug+commits@humbughq.com"
HUMBUG_API_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# com... | # Humbug Inc's internal git plugin configuration.
# The plugin and example config are under api/integrations/
# Leaving all the instructions out of this file to avoid having to
# sync them as we update the comments.
HUMBUG_USER = "humbug+commits@humbughq.com"
HUMBUG_API_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# com... | <commit_before># Humbug Inc's internal git plugin configuration.
# The plugin and example config are under api/integrations/
# Leaving all the instructions out of this file to avoid having to
# sync them as we update the comments.
HUMBUG_USER = "humbug+commits@humbughq.com"
HUMBUG_API_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxx... | # Humbug Inc's internal git plugin configuration.
# The plugin and example config are under api/integrations/
# Leaving all the instructions out of this file to avoid having to
# sync them as we update the comments.
HUMBUG_USER = "humbug+commits@humbughq.com"
HUMBUG_API_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# com... | # Humbug Inc's internal git plugin configuration.
# The plugin and example config are under api/integrations/
# Leaving all the instructions out of this file to avoid having to
# sync them as we update the comments.
HUMBUG_USER = "humbug+commits@humbughq.com"
HUMBUG_API_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# com... | <commit_before># Humbug Inc's internal git plugin configuration.
# The plugin and example config are under api/integrations/
# Leaving all the instructions out of this file to avoid having to
# sync them as we update the comments.
HUMBUG_USER = "humbug+commits@humbughq.com"
HUMBUG_API_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxx... |
e1c58062db9c107c358e3617793aaed7cdb3a133 | jobmon/util.py | jobmon/util.py | import os
import threading
class TerminableThreadMixin:
"""
TerminableThreadMixin is useful for threads that need to be terminated
from the outside. It provides a method called 'terminate', which communicates
to the thread that it needs to die, and then waits for the death to occur.
It imposes the... | import logging
import os
import threading
def reset_loggers():
"""
Removes all handlers from the current loggers to allow for a new basicConfig.
"""
root = logging.getLogger()
for handler in root.handlers[:]:
root.removeHandler(handler)
class TerminableThreadMixin:
"""
TerminableTh... | Add way to reset loggers | Add way to reset loggers
logging.basicConfig doesn't reset the current logging infrastructure, which
was messing up some tests that expected logs to be one place even though
they ended up in another
| Python | bsd-2-clause | adamnew123456/jobmon | import os
import threading
class TerminableThreadMixin:
"""
TerminableThreadMixin is useful for threads that need to be terminated
from the outside. It provides a method called 'terminate', which communicates
to the thread that it needs to die, and then waits for the death to occur.
It imposes the... | import logging
import os
import threading
def reset_loggers():
"""
Removes all handlers from the current loggers to allow for a new basicConfig.
"""
root = logging.getLogger()
for handler in root.handlers[:]:
root.removeHandler(handler)
class TerminableThreadMixin:
"""
TerminableTh... | <commit_before>import os
import threading
class TerminableThreadMixin:
"""
TerminableThreadMixin is useful for threads that need to be terminated
from the outside. It provides a method called 'terminate', which communicates
to the thread that it needs to die, and then waits for the death to occur.
... | import logging
import os
import threading
def reset_loggers():
"""
Removes all handlers from the current loggers to allow for a new basicConfig.
"""
root = logging.getLogger()
for handler in root.handlers[:]:
root.removeHandler(handler)
class TerminableThreadMixin:
"""
TerminableTh... | import os
import threading
class TerminableThreadMixin:
"""
TerminableThreadMixin is useful for threads that need to be terminated
from the outside. It provides a method called 'terminate', which communicates
to the thread that it needs to die, and then waits for the death to occur.
It imposes the... | <commit_before>import os
import threading
class TerminableThreadMixin:
"""
TerminableThreadMixin is useful for threads that need to be terminated
from the outside. It provides a method called 'terminate', which communicates
to the thread that it needs to die, and then waits for the death to occur.
... |
232a9fd87f15a8b118c835d6f888d6bb9e236d19 | cat/search_indexes.py | cat/search_indexes.py | from haystack.indexes import SearchIndex, CharField, MultiValueField, BooleanField
from haystack import site
from .models import MuseumObject
class MuseumObjectIndex(SearchIndex):
text = CharField(document=True, use_template=True)
categories = MultiValueField(faceted=True)
item_name = CharField(model_attr... | from haystack.indexes import SearchIndex, CharField, MultiValueField, BooleanField
from haystack import site
from .models import MuseumObject
class MuseumObjectIndex(SearchIndex):
text = CharField(document=True, use_template=True)
categories = MultiValueField(faceted=True)
item_name = CharField(model_attr... | Allow indexing blank country field | Allow indexing blank country field
| Python | bsd-3-clause | uq-eresearch/uqam,uq-eresearch/uqam,uq-eresearch/uqam,uq-eresearch/uqam | from haystack.indexes import SearchIndex, CharField, MultiValueField, BooleanField
from haystack import site
from .models import MuseumObject
class MuseumObjectIndex(SearchIndex):
text = CharField(document=True, use_template=True)
categories = MultiValueField(faceted=True)
item_name = CharField(model_attr... | from haystack.indexes import SearchIndex, CharField, MultiValueField, BooleanField
from haystack import site
from .models import MuseumObject
class MuseumObjectIndex(SearchIndex):
text = CharField(document=True, use_template=True)
categories = MultiValueField(faceted=True)
item_name = CharField(model_attr... | <commit_before>from haystack.indexes import SearchIndex, CharField, MultiValueField, BooleanField
from haystack import site
from .models import MuseumObject
class MuseumObjectIndex(SearchIndex):
text = CharField(document=True, use_template=True)
categories = MultiValueField(faceted=True)
item_name = CharF... | from haystack.indexes import SearchIndex, CharField, MultiValueField, BooleanField
from haystack import site
from .models import MuseumObject
class MuseumObjectIndex(SearchIndex):
text = CharField(document=True, use_template=True)
categories = MultiValueField(faceted=True)
item_name = CharField(model_attr... | from haystack.indexes import SearchIndex, CharField, MultiValueField, BooleanField
from haystack import site
from .models import MuseumObject
class MuseumObjectIndex(SearchIndex):
text = CharField(document=True, use_template=True)
categories = MultiValueField(faceted=True)
item_name = CharField(model_attr... | <commit_before>from haystack.indexes import SearchIndex, CharField, MultiValueField, BooleanField
from haystack import site
from .models import MuseumObject
class MuseumObjectIndex(SearchIndex):
text = CharField(document=True, use_template=True)
categories = MultiValueField(faceted=True)
item_name = CharF... |
76ed5eb9d9d2f3a453de6976f52221e6970b6b71 | tests/unit/test_offline_compression.py | tests/unit/test_offline_compression.py | import os
import shutil
import tempfile
from django.test import TestCase
from django.core.management import call_command
from django.test.utils import override_settings
TMP_STATIC_DIR = tempfile.mkdtemp()
@override_settings(
COMPRESS_ENABLED=True,
COMPRESS_OFFLINE=True,
COMPRESS_ROOT=TMP_STATIC_DIR
)
c... | import os
import shutil
import tempfile
from django.test import TestCase
from django.core.management import call_command
from django.test.utils import override_settings
TMP_STATIC_DIR = tempfile.mkdtemp()
@override_settings(
COMPRESS_ENABLED=True,
COMPRESS_OFFLINE=True,
COMPRESS_ROOT=TMP_STATIC_DIR
)
c... | Add test for offline compression using django_compressor | Add test for offline compression using django_compressor
| Python | bsd-3-clause | tangentlabs/django-fancypages,socradev/django-fancypages,tangentlabs/django-fancypages,socradev/django-fancypages,socradev/django-fancypages,tangentlabs/django-fancypages | import os
import shutil
import tempfile
from django.test import TestCase
from django.core.management import call_command
from django.test.utils import override_settings
TMP_STATIC_DIR = tempfile.mkdtemp()
@override_settings(
COMPRESS_ENABLED=True,
COMPRESS_OFFLINE=True,
COMPRESS_ROOT=TMP_STATIC_DIR
)
c... | import os
import shutil
import tempfile
from django.test import TestCase
from django.core.management import call_command
from django.test.utils import override_settings
TMP_STATIC_DIR = tempfile.mkdtemp()
@override_settings(
COMPRESS_ENABLED=True,
COMPRESS_OFFLINE=True,
COMPRESS_ROOT=TMP_STATIC_DIR
)
c... | <commit_before>import os
import shutil
import tempfile
from django.test import TestCase
from django.core.management import call_command
from django.test.utils import override_settings
TMP_STATIC_DIR = tempfile.mkdtemp()
@override_settings(
COMPRESS_ENABLED=True,
COMPRESS_OFFLINE=True,
COMPRESS_ROOT=TMP... | import os
import shutil
import tempfile
from django.test import TestCase
from django.core.management import call_command
from django.test.utils import override_settings
TMP_STATIC_DIR = tempfile.mkdtemp()
@override_settings(
COMPRESS_ENABLED=True,
COMPRESS_OFFLINE=True,
COMPRESS_ROOT=TMP_STATIC_DIR
)
c... | import os
import shutil
import tempfile
from django.test import TestCase
from django.core.management import call_command
from django.test.utils import override_settings
TMP_STATIC_DIR = tempfile.mkdtemp()
@override_settings(
COMPRESS_ENABLED=True,
COMPRESS_OFFLINE=True,
COMPRESS_ROOT=TMP_STATIC_DIR
)
c... | <commit_before>import os
import shutil
import tempfile
from django.test import TestCase
from django.core.management import call_command
from django.test.utils import override_settings
TMP_STATIC_DIR = tempfile.mkdtemp()
@override_settings(
COMPRESS_ENABLED=True,
COMPRESS_OFFLINE=True,
COMPRESS_ROOT=TMP... |
d7e9eba6fb3628f0736bd468ae76e05099b9d651 | space/decorators.py | space/decorators.py | from django.http import HttpResponseBadRequest, HttpResponseForbidden
from django.views.decorators.csrf import csrf_exempt
from incubator.settings import STATUS_SECRETS
def one_or_zero(arg):
"""Typecast to 1 or 0"""
if arg == '1':
return 1
elif arg == '0':
return 0
raise ValueError("no... | from django.http import HttpResponseBadRequest, HttpResponseForbidden
from django.views.decorators.csrf import csrf_exempt
from django.conf import settings
def one_or_zero(arg):
"""Typecast to 1 or 0"""
if arg == '1':
return 1
elif arg == '0':
return 0
raise ValueError("not one or zero... | Use from django.conf import settings | Use from django.conf import settings
| Python | agpl-3.0 | UrLab/incubator,UrLab/incubator,UrLab/incubator,UrLab/incubator | from django.http import HttpResponseBadRequest, HttpResponseForbidden
from django.views.decorators.csrf import csrf_exempt
from incubator.settings import STATUS_SECRETS
def one_or_zero(arg):
"""Typecast to 1 or 0"""
if arg == '1':
return 1
elif arg == '0':
return 0
raise ValueError("no... | from django.http import HttpResponseBadRequest, HttpResponseForbidden
from django.views.decorators.csrf import csrf_exempt
from django.conf import settings
def one_or_zero(arg):
"""Typecast to 1 or 0"""
if arg == '1':
return 1
elif arg == '0':
return 0
raise ValueError("not one or zero... | <commit_before>from django.http import HttpResponseBadRequest, HttpResponseForbidden
from django.views.decorators.csrf import csrf_exempt
from incubator.settings import STATUS_SECRETS
def one_or_zero(arg):
"""Typecast to 1 or 0"""
if arg == '1':
return 1
elif arg == '0':
return 0
raise... | from django.http import HttpResponseBadRequest, HttpResponseForbidden
from django.views.decorators.csrf import csrf_exempt
from django.conf import settings
def one_or_zero(arg):
"""Typecast to 1 or 0"""
if arg == '1':
return 1
elif arg == '0':
return 0
raise ValueError("not one or zero... | from django.http import HttpResponseBadRequest, HttpResponseForbidden
from django.views.decorators.csrf import csrf_exempt
from incubator.settings import STATUS_SECRETS
def one_or_zero(arg):
"""Typecast to 1 or 0"""
if arg == '1':
return 1
elif arg == '0':
return 0
raise ValueError("no... | <commit_before>from django.http import HttpResponseBadRequest, HttpResponseForbidden
from django.views.decorators.csrf import csrf_exempt
from incubator.settings import STATUS_SECRETS
def one_or_zero(arg):
"""Typecast to 1 or 0"""
if arg == '1':
return 1
elif arg == '0':
return 0
raise... |
ce3c7daff5eaaf8eefecf3f4e5bd9fbca40a7a2a | cob/subsystems/tasks_subsystem.py | cob/subsystems/tasks_subsystem.py | import os
import logbook
from .base import SubsystemBase
_logger = logbook.Logger(__name__)
class TasksSubsystem(SubsystemBase):
NAME = 'tasks'
def activate(self, flask_app):
from ..celery.app import celery_app
self._config = self.project.config.get('celery', {})
# ensure critica... | import os
import logbook
from .base import SubsystemBase
_logger = logbook.Logger(__name__)
class TasksSubsystem(SubsystemBase):
NAME = 'tasks'
def activate(self, flask_app):
from ..celery.app import celery_app
self._config = self.project.config.get('celery', {})
# ensure critica... | Allow passing Celery configuration under the project's config | Allow passing Celery configuration under the project's config
| Python | bsd-3-clause | getweber/weber-cli | import os
import logbook
from .base import SubsystemBase
_logger = logbook.Logger(__name__)
class TasksSubsystem(SubsystemBase):
NAME = 'tasks'
def activate(self, flask_app):
from ..celery.app import celery_app
self._config = self.project.config.get('celery', {})
# ensure critica... | import os
import logbook
from .base import SubsystemBase
_logger = logbook.Logger(__name__)
class TasksSubsystem(SubsystemBase):
NAME = 'tasks'
def activate(self, flask_app):
from ..celery.app import celery_app
self._config = self.project.config.get('celery', {})
# ensure critica... | <commit_before>import os
import logbook
from .base import SubsystemBase
_logger = logbook.Logger(__name__)
class TasksSubsystem(SubsystemBase):
NAME = 'tasks'
def activate(self, flask_app):
from ..celery.app import celery_app
self._config = self.project.config.get('celery', {})
#... | import os
import logbook
from .base import SubsystemBase
_logger = logbook.Logger(__name__)
class TasksSubsystem(SubsystemBase):
NAME = 'tasks'
def activate(self, flask_app):
from ..celery.app import celery_app
self._config = self.project.config.get('celery', {})
# ensure critica... | import os
import logbook
from .base import SubsystemBase
_logger = logbook.Logger(__name__)
class TasksSubsystem(SubsystemBase):
NAME = 'tasks'
def activate(self, flask_app):
from ..celery.app import celery_app
self._config = self.project.config.get('celery', {})
# ensure critica... | <commit_before>import os
import logbook
from .base import SubsystemBase
_logger = logbook.Logger(__name__)
class TasksSubsystem(SubsystemBase):
NAME = 'tasks'
def activate(self, flask_app):
from ..celery.app import celery_app
self._config = self.project.config.get('celery', {})
#... |
68d1943b591afe55f75fa31dfb3c4c61b8f4297f | daybed/tests/support.py | daybed/tests/support.py | import os
from uuid import uuid4
from unittest import TestCase
import webtest
from daybed.db import DatabaseConnection
HERE = os.path.dirname(os.path.abspath(__file__))
class BaseWebTest(TestCase):
"""Base Web Test to test your cornice service.
It setups the database before each test and delete it after.
... | import os
from uuid import uuid4
from unittest import TestCase
import webtest
from daybed.db import DatabaseConnection
HERE = os.path.dirname(os.path.abspath(__file__))
class BaseWebTest(TestCase):
"""Base Web Test to test your cornice service.
It setups the database before each test and delete it after.
... | Fix db deletion, take 2 | Fix db deletion, take 2
| Python | bsd-3-clause | spiral-project/daybed,spiral-project/daybed | import os
from uuid import uuid4
from unittest import TestCase
import webtest
from daybed.db import DatabaseConnection
HERE = os.path.dirname(os.path.abspath(__file__))
class BaseWebTest(TestCase):
"""Base Web Test to test your cornice service.
It setups the database before each test and delete it after.
... | import os
from uuid import uuid4
from unittest import TestCase
import webtest
from daybed.db import DatabaseConnection
HERE = os.path.dirname(os.path.abspath(__file__))
class BaseWebTest(TestCase):
"""Base Web Test to test your cornice service.
It setups the database before each test and delete it after.
... | <commit_before>import os
from uuid import uuid4
from unittest import TestCase
import webtest
from daybed.db import DatabaseConnection
HERE = os.path.dirname(os.path.abspath(__file__))
class BaseWebTest(TestCase):
"""Base Web Test to test your cornice service.
It setups the database before each test and del... | import os
from uuid import uuid4
from unittest import TestCase
import webtest
from daybed.db import DatabaseConnection
HERE = os.path.dirname(os.path.abspath(__file__))
class BaseWebTest(TestCase):
"""Base Web Test to test your cornice service.
It setups the database before each test and delete it after.
... | import os
from uuid import uuid4
from unittest import TestCase
import webtest
from daybed.db import DatabaseConnection
HERE = os.path.dirname(os.path.abspath(__file__))
class BaseWebTest(TestCase):
"""Base Web Test to test your cornice service.
It setups the database before each test and delete it after.
... | <commit_before>import os
from uuid import uuid4
from unittest import TestCase
import webtest
from daybed.db import DatabaseConnection
HERE = os.path.dirname(os.path.abspath(__file__))
class BaseWebTest(TestCase):
"""Base Web Test to test your cornice service.
It setups the database before each test and del... |
455c8ed93dcac20b6393cf781e19971fa3b92cdb | tests/test_cookies.py | tests/test_cookies.py | # -*- coding: utf-8 -*-
def test_bar_fixture(testdir):
"""Make sure that pytest accepts our fixture."""
# create a temporary pytest test module
testdir.makepyfile("""
def test_sth(bar):
assert bar == "europython2015"
""")
# run pytest with the following cmd args
result = ... | # -*- coding: utf-8 -*-
def test_cookies_fixture(testdir):
"""Make sure that pytest accepts the `cookies` fixture."""
# create a temporary pytest test module
testdir.makepyfile("""
def test_valid_fixture(cookies):
assert hasattr(cookies, 'bake')
assert callable(cookies.bak... | Implement simple tests for the 'cookies' fixture | Implement simple tests for the 'cookies' fixture
| Python | mit | hackebrot/pytest-cookies | # -*- coding: utf-8 -*-
def test_bar_fixture(testdir):
"""Make sure that pytest accepts our fixture."""
# create a temporary pytest test module
testdir.makepyfile("""
def test_sth(bar):
assert bar == "europython2015"
""")
# run pytest with the following cmd args
result = ... | # -*- coding: utf-8 -*-
def test_cookies_fixture(testdir):
"""Make sure that pytest accepts the `cookies` fixture."""
# create a temporary pytest test module
testdir.makepyfile("""
def test_valid_fixture(cookies):
assert hasattr(cookies, 'bake')
assert callable(cookies.bak... | <commit_before># -*- coding: utf-8 -*-
def test_bar_fixture(testdir):
"""Make sure that pytest accepts our fixture."""
# create a temporary pytest test module
testdir.makepyfile("""
def test_sth(bar):
assert bar == "europython2015"
""")
# run pytest with the following cmd arg... | # -*- coding: utf-8 -*-
def test_cookies_fixture(testdir):
"""Make sure that pytest accepts the `cookies` fixture."""
# create a temporary pytest test module
testdir.makepyfile("""
def test_valid_fixture(cookies):
assert hasattr(cookies, 'bake')
assert callable(cookies.bak... | # -*- coding: utf-8 -*-
def test_bar_fixture(testdir):
"""Make sure that pytest accepts our fixture."""
# create a temporary pytest test module
testdir.makepyfile("""
def test_sth(bar):
assert bar == "europython2015"
""")
# run pytest with the following cmd args
result = ... | <commit_before># -*- coding: utf-8 -*-
def test_bar_fixture(testdir):
"""Make sure that pytest accepts our fixture."""
# create a temporary pytest test module
testdir.makepyfile("""
def test_sth(bar):
assert bar == "europython2015"
""")
# run pytest with the following cmd arg... |
134fcbd6e82957ac3abd2eebdc296fd4ccb457e9 | alexandria/api/books.py | alexandria/api/books.py | from . import app, mongo
from alexandria.decorators import *
from flask import request, jsonify, url_for, session
from flask.ext.classy import FlaskView, route
import json
from bson import json_util
class BooksView(FlaskView):
route_prefix = '/api/'
@authenticated
def index(self):
query = mongo.... | from . import app, mongo
from alexandria.decorators import *
from flask import request, jsonify, url_for, session
from flask.ext.classy import FlaskView, route
import json
from bson import json_util
class BooksView(FlaskView):
route_prefix = '/api/'
@authenticated
def index(self):
query = mongo.... | Set value of 'owner' to the value of the ObjectId | Set value of 'owner' to the value of the ObjectId
| Python | mit | citruspi/Alexandria,citruspi/Alexandria | from . import app, mongo
from alexandria.decorators import *
from flask import request, jsonify, url_for, session
from flask.ext.classy import FlaskView, route
import json
from bson import json_util
class BooksView(FlaskView):
route_prefix = '/api/'
@authenticated
def index(self):
query = mongo.... | from . import app, mongo
from alexandria.decorators import *
from flask import request, jsonify, url_for, session
from flask.ext.classy import FlaskView, route
import json
from bson import json_util
class BooksView(FlaskView):
route_prefix = '/api/'
@authenticated
def index(self):
query = mongo.... | <commit_before>from . import app, mongo
from alexandria.decorators import *
from flask import request, jsonify, url_for, session
from flask.ext.classy import FlaskView, route
import json
from bson import json_util
class BooksView(FlaskView):
route_prefix = '/api/'
@authenticated
def index(self):
... | from . import app, mongo
from alexandria.decorators import *
from flask import request, jsonify, url_for, session
from flask.ext.classy import FlaskView, route
import json
from bson import json_util
class BooksView(FlaskView):
route_prefix = '/api/'
@authenticated
def index(self):
query = mongo.... | from . import app, mongo
from alexandria.decorators import *
from flask import request, jsonify, url_for, session
from flask.ext.classy import FlaskView, route
import json
from bson import json_util
class BooksView(FlaskView):
route_prefix = '/api/'
@authenticated
def index(self):
query = mongo.... | <commit_before>from . import app, mongo
from alexandria.decorators import *
from flask import request, jsonify, url_for, session
from flask.ext.classy import FlaskView, route
import json
from bson import json_util
class BooksView(FlaskView):
route_prefix = '/api/'
@authenticated
def index(self):
... |
233e74abcc4a70f573e199074f5184b30bdfe1d2 | seam/__init__.py | seam/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" __init__.py
Seam
====
Seam is a simple layer between existing neuroimaging tools and your data.
While it is opinionated in how to execute tools, it makes no decisions
as to how data is organized or how the scripts are ultimately run. These
decisions are are up to yo... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" __init__.py
Seam
====
Seam is a simple layer between existing neuroimaging tools and your data.
While it is opinionated in how to execute tools, it makes no decisions
as to how data is organized or how the scripts are ultimately run. These
decisions are are up to yo... | Fix py3k relative import error | Fix py3k relative import error
| Python | mit | VUIIS/seam,VUIIS/seam | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" __init__.py
Seam
====
Seam is a simple layer between existing neuroimaging tools and your data.
While it is opinionated in how to execute tools, it makes no decisions
as to how data is organized or how the scripts are ultimately run. These
decisions are are up to yo... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" __init__.py
Seam
====
Seam is a simple layer between existing neuroimaging tools and your data.
While it is opinionated in how to execute tools, it makes no decisions
as to how data is organized or how the scripts are ultimately run. These
decisions are are up to yo... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" __init__.py
Seam
====
Seam is a simple layer between existing neuroimaging tools and your data.
While it is opinionated in how to execute tools, it makes no decisions
as to how data is organized or how the scripts are ultimately run. These
decisions a... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" __init__.py
Seam
====
Seam is a simple layer between existing neuroimaging tools and your data.
While it is opinionated in how to execute tools, it makes no decisions
as to how data is organized or how the scripts are ultimately run. These
decisions are are up to yo... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" __init__.py
Seam
====
Seam is a simple layer between existing neuroimaging tools and your data.
While it is opinionated in how to execute tools, it makes no decisions
as to how data is organized or how the scripts are ultimately run. These
decisions are are up to yo... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" __init__.py
Seam
====
Seam is a simple layer between existing neuroimaging tools and your data.
While it is opinionated in how to execute tools, it makes no decisions
as to how data is organized or how the scripts are ultimately run. These
decisions a... |
b193df5080cc8076739509523cf391f5b7132d56 | kerastuner/utils.py | kerastuner/utils.py | # Copyright 2019 The Keras Tuner Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | # Copyright 2019 The Keras Tuner Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | Fix bugs for updating from tf 2.0b0 to rc0 | Fix bugs for updating from tf 2.0b0 to rc0
Updating the dependency of tensorflow from 2.0.0b1 to 2.0.0rc0 is causing crashes in keras-tuner.
Not sure the "set" operation is really useful, but it is causing the crash because it tries to hash a tensor with equality enabled.
```
../../.virtualenvs/ak/lib/python3.6/s... | Python | apache-2.0 | keras-team/keras-tuner,keras-team/keras-tuner | # Copyright 2019 The Keras Tuner Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | # Copyright 2019 The Keras Tuner Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | <commit_before># Copyright 2019 The Keras Tuner Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | # Copyright 2019 The Keras Tuner Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | # Copyright 2019 The Keras Tuner Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | <commit_before># Copyright 2019 The Keras Tuner Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... |
3a21137a09c58612044580f5835be1bbe2765500 | markdown-pp.py | markdown-pp.py | #!/usr/bin/env python
# Copyright (C) 2010 John Reese
# Licensed under the MIT license
import sys
import MarkdownPP
if len(sys.argv) > 2:
mdpp = open(sys.argv[1], "r")
md = open(sys.argv[2], "w")
elif len(sys.argv) > 1:
mdpp = open(sys.argv[1], "r")
md = sys.stdout
else:
sys.exit(1)
MarkdownPP.MarkdownPP(in... | #!/usr/bin/env python2
# Copyright (C) 2010 John Reese
# Licensed under the MIT license
import sys
import MarkdownPP
if len(sys.argv) > 2:
mdpp = open(sys.argv[1], "r")
md = open(sys.argv[2], "w")
elif len(sys.argv) > 1:
mdpp = open(sys.argv[1], "r")
md = sys.stdout
else:
sys.exit(1)
MarkdownPP.MarkdownPP(i... | Allow specifying depth of TOC headers and rewrites | Allow specifying depth of TOC headers and rewrites
| Python | mit | triAGENS/markdown-pp,jreese/markdown-pp | #!/usr/bin/env python
# Copyright (C) 2010 John Reese
# Licensed under the MIT license
import sys
import MarkdownPP
if len(sys.argv) > 2:
mdpp = open(sys.argv[1], "r")
md = open(sys.argv[2], "w")
elif len(sys.argv) > 1:
mdpp = open(sys.argv[1], "r")
md = sys.stdout
else:
sys.exit(1)
MarkdownPP.MarkdownPP(in... | #!/usr/bin/env python2
# Copyright (C) 2010 John Reese
# Licensed under the MIT license
import sys
import MarkdownPP
if len(sys.argv) > 2:
mdpp = open(sys.argv[1], "r")
md = open(sys.argv[2], "w")
elif len(sys.argv) > 1:
mdpp = open(sys.argv[1], "r")
md = sys.stdout
else:
sys.exit(1)
MarkdownPP.MarkdownPP(i... | <commit_before>#!/usr/bin/env python
# Copyright (C) 2010 John Reese
# Licensed under the MIT license
import sys
import MarkdownPP
if len(sys.argv) > 2:
mdpp = open(sys.argv[1], "r")
md = open(sys.argv[2], "w")
elif len(sys.argv) > 1:
mdpp = open(sys.argv[1], "r")
md = sys.stdout
else:
sys.exit(1)
MarkdownP... | #!/usr/bin/env python2
# Copyright (C) 2010 John Reese
# Licensed under the MIT license
import sys
import MarkdownPP
if len(sys.argv) > 2:
mdpp = open(sys.argv[1], "r")
md = open(sys.argv[2], "w")
elif len(sys.argv) > 1:
mdpp = open(sys.argv[1], "r")
md = sys.stdout
else:
sys.exit(1)
MarkdownPP.MarkdownPP(i... | #!/usr/bin/env python
# Copyright (C) 2010 John Reese
# Licensed under the MIT license
import sys
import MarkdownPP
if len(sys.argv) > 2:
mdpp = open(sys.argv[1], "r")
md = open(sys.argv[2], "w")
elif len(sys.argv) > 1:
mdpp = open(sys.argv[1], "r")
md = sys.stdout
else:
sys.exit(1)
MarkdownPP.MarkdownPP(in... | <commit_before>#!/usr/bin/env python
# Copyright (C) 2010 John Reese
# Licensed under the MIT license
import sys
import MarkdownPP
if len(sys.argv) > 2:
mdpp = open(sys.argv[1], "r")
md = open(sys.argv[2], "w")
elif len(sys.argv) > 1:
mdpp = open(sys.argv[1], "r")
md = sys.stdout
else:
sys.exit(1)
MarkdownP... |
418e7a7d8c8261578df046d251041ab0794d1580 | decorators.py | decorators.py | #!/usr/bin/env python
class RequiresType(object):
"""
Checks that the first (or position given by the keyword argument 'position'
argument to the function is an instance of one of the types given in the
positional decorator arguments
"""
def __init__(self, *types, **kwargs):
self.type... | #!/usr/bin/env python
class RequiresType(object):
"""
Checks that the first (or position given by the keyword argument 'position'
argument to the function is an instance of one of the types given in the
positional decorator arguments
"""
def __init__(self, *types, **kwargs):
self.type... | Raise TypeError instead of returning | Raise TypeError instead of returning
| Python | bsd-3-clause | rasher/reddit-modbot | #!/usr/bin/env python
class RequiresType(object):
"""
Checks that the first (or position given by the keyword argument 'position'
argument to the function is an instance of one of the types given in the
positional decorator arguments
"""
def __init__(self, *types, **kwargs):
self.type... | #!/usr/bin/env python
class RequiresType(object):
"""
Checks that the first (or position given by the keyword argument 'position'
argument to the function is an instance of one of the types given in the
positional decorator arguments
"""
def __init__(self, *types, **kwargs):
self.type... | <commit_before>#!/usr/bin/env python
class RequiresType(object):
"""
Checks that the first (or position given by the keyword argument 'position'
argument to the function is an instance of one of the types given in the
positional decorator arguments
"""
def __init__(self, *types, **kwargs):
... | #!/usr/bin/env python
class RequiresType(object):
"""
Checks that the first (or position given by the keyword argument 'position'
argument to the function is an instance of one of the types given in the
positional decorator arguments
"""
def __init__(self, *types, **kwargs):
self.type... | #!/usr/bin/env python
class RequiresType(object):
"""
Checks that the first (or position given by the keyword argument 'position'
argument to the function is an instance of one of the types given in the
positional decorator arguments
"""
def __init__(self, *types, **kwargs):
self.type... | <commit_before>#!/usr/bin/env python
class RequiresType(object):
"""
Checks that the first (or position given by the keyword argument 'position'
argument to the function is an instance of one of the types given in the
positional decorator arguments
"""
def __init__(self, *types, **kwargs):
... |
94d54e20fe5590fad0449bef79366654b3c7f23d | swingtime/urls.py | swingtime/urls.py | from django.conf.urls import patterns, url
from swingtime import views
urlpatterns = patterns('',
url(
r'^(?:calendar/)?$',
views.CalendarView.as_view(),
name='swingtime-calendar'
),
url(
r'^calendar/json/$',
views.CalendarJSONView.as_view(),
name='swingtime... | from django.conf.urls import patterns, url
from swingtime import views
urlpatterns = patterns('',
url(
r'^(?:calendar/)?$',
views.CalendarView.as_view(),
name='swingtime-calendar'
),
url(
r'^calendar.json$',
views.CalendarJSONView.as_view(),
name='swingtime-... | Change calendar JSON view url | Change calendar JSON view url
| Python | mit | jonge-democraten/mezzanine-fullcalendar | from django.conf.urls import patterns, url
from swingtime import views
urlpatterns = patterns('',
url(
r'^(?:calendar/)?$',
views.CalendarView.as_view(),
name='swingtime-calendar'
),
url(
r'^calendar/json/$',
views.CalendarJSONView.as_view(),
name='swingtime... | from django.conf.urls import patterns, url
from swingtime import views
urlpatterns = patterns('',
url(
r'^(?:calendar/)?$',
views.CalendarView.as_view(),
name='swingtime-calendar'
),
url(
r'^calendar.json$',
views.CalendarJSONView.as_view(),
name='swingtime-... | <commit_before>from django.conf.urls import patterns, url
from swingtime import views
urlpatterns = patterns('',
url(
r'^(?:calendar/)?$',
views.CalendarView.as_view(),
name='swingtime-calendar'
),
url(
r'^calendar/json/$',
views.CalendarJSONView.as_view(),
... | from django.conf.urls import patterns, url
from swingtime import views
urlpatterns = patterns('',
url(
r'^(?:calendar/)?$',
views.CalendarView.as_view(),
name='swingtime-calendar'
),
url(
r'^calendar.json$',
views.CalendarJSONView.as_view(),
name='swingtime-... | from django.conf.urls import patterns, url
from swingtime import views
urlpatterns = patterns('',
url(
r'^(?:calendar/)?$',
views.CalendarView.as_view(),
name='swingtime-calendar'
),
url(
r'^calendar/json/$',
views.CalendarJSONView.as_view(),
name='swingtime... | <commit_before>from django.conf.urls import patterns, url
from swingtime import views
urlpatterns = patterns('',
url(
r'^(?:calendar/)?$',
views.CalendarView.as_view(),
name='swingtime-calendar'
),
url(
r'^calendar/json/$',
views.CalendarJSONView.as_view(),
... |
0d0d43f957cb79a99eaacef0623cd57351ca40f6 | test/factories.py | test/factories.py | # coding: utf-8
import factory
from django.contrib.auth.models import User
class UserFactory(factory.Factory):
FACTORY_FOR = User
first_name = "Boy"
last_name = "Factory"
email = factory.LazyAttribute(
lambda a:
"{0}_{1}@example.com".format(a.first_name, a.last_name).lower())
us... | # coding: utf-8
import factory
from django.contrib.auth.models import User
class UserFactory(factory.Factory):
FACTORY_FOR = User
first_name = "Boy"
last_name = "Factory"
email = factory.LazyAttribute(
lambda a:
"{0}_{1}@example.com".format(a.first_name, a.last_name).lower())
us... | Fix userfactory - set user flags | Fix userfactory - set user flags
| Python | mit | sarutobi/Rynda,sarutobi/ritmserdtsa,sarutobi/flowofkindness,sarutobi/Rynda,sarutobi/flowofkindness,sarutobi/ritmserdtsa,sarutobi/flowofkindness,sarutobi/ritmserdtsa,sarutobi/Rynda,sarutobi/Rynda,sarutobi/flowofkindness,sarutobi/ritmserdtsa | # coding: utf-8
import factory
from django.contrib.auth.models import User
class UserFactory(factory.Factory):
FACTORY_FOR = User
first_name = "Boy"
last_name = "Factory"
email = factory.LazyAttribute(
lambda a:
"{0}_{1}@example.com".format(a.first_name, a.last_name).lower())
us... | # coding: utf-8
import factory
from django.contrib.auth.models import User
class UserFactory(factory.Factory):
FACTORY_FOR = User
first_name = "Boy"
last_name = "Factory"
email = factory.LazyAttribute(
lambda a:
"{0}_{1}@example.com".format(a.first_name, a.last_name).lower())
us... | <commit_before># coding: utf-8
import factory
from django.contrib.auth.models import User
class UserFactory(factory.Factory):
FACTORY_FOR = User
first_name = "Boy"
last_name = "Factory"
email = factory.LazyAttribute(
lambda a:
"{0}_{1}@example.com".format(a.first_name, a.last_name).... | # coding: utf-8
import factory
from django.contrib.auth.models import User
class UserFactory(factory.Factory):
FACTORY_FOR = User
first_name = "Boy"
last_name = "Factory"
email = factory.LazyAttribute(
lambda a:
"{0}_{1}@example.com".format(a.first_name, a.last_name).lower())
us... | # coding: utf-8
import factory
from django.contrib.auth.models import User
class UserFactory(factory.Factory):
FACTORY_FOR = User
first_name = "Boy"
last_name = "Factory"
email = factory.LazyAttribute(
lambda a:
"{0}_{1}@example.com".format(a.first_name, a.last_name).lower())
us... | <commit_before># coding: utf-8
import factory
from django.contrib.auth.models import User
class UserFactory(factory.Factory):
FACTORY_FOR = User
first_name = "Boy"
last_name = "Factory"
email = factory.LazyAttribute(
lambda a:
"{0}_{1}@example.com".format(a.first_name, a.last_name).... |
f4fdba652a1822698778c65df66a2639ec0fc5ad | tests/conftest.py | tests/conftest.py | import pytest
from .app import setup, teardown
@pytest.fixture(autouse=True, scope='session')
def db_migration(request):
setup()
request.addfinalizer(teardown)
| from __future__ import absolute_import
import pytest
from .app import setup, teardown
from app import create_app
from app.models import db, Framework
@pytest.fixture(autouse=True, scope='session')
def db_migration(request):
setup()
request.addfinalizer(teardown)
@pytest.fixture(scope='session')
def app(r... | Add live and expired framework pytest fixtures | Add live and expired framework pytest fixtures
This is a tiny attempt to move away from relying on database migrations
to set up framework records for tests. Using migration framework records
means we need to use actual (sometimes expired) frameworks to write tests
ties us to existing frameworks and require manual rol... | Python | mit | alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api | import pytest
from .app import setup, teardown
@pytest.fixture(autouse=True, scope='session')
def db_migration(request):
setup()
request.addfinalizer(teardown)
Add live and expired framework pytest fixtures
This is a tiny attempt to move away from relying on database migrations
to set up framework records f... | from __future__ import absolute_import
import pytest
from .app import setup, teardown
from app import create_app
from app.models import db, Framework
@pytest.fixture(autouse=True, scope='session')
def db_migration(request):
setup()
request.addfinalizer(teardown)
@pytest.fixture(scope='session')
def app(r... | <commit_before>import pytest
from .app import setup, teardown
@pytest.fixture(autouse=True, scope='session')
def db_migration(request):
setup()
request.addfinalizer(teardown)
<commit_msg>Add live and expired framework pytest fixtures
This is a tiny attempt to move away from relying on database migrations
to... | from __future__ import absolute_import
import pytest
from .app import setup, teardown
from app import create_app
from app.models import db, Framework
@pytest.fixture(autouse=True, scope='session')
def db_migration(request):
setup()
request.addfinalizer(teardown)
@pytest.fixture(scope='session')
def app(r... | import pytest
from .app import setup, teardown
@pytest.fixture(autouse=True, scope='session')
def db_migration(request):
setup()
request.addfinalizer(teardown)
Add live and expired framework pytest fixtures
This is a tiny attempt to move away from relying on database migrations
to set up framework records f... | <commit_before>import pytest
from .app import setup, teardown
@pytest.fixture(autouse=True, scope='session')
def db_migration(request):
setup()
request.addfinalizer(teardown)
<commit_msg>Add live and expired framework pytest fixtures
This is a tiny attempt to move away from relying on database migrations
to... |
95c23b465bc0e0ce0e1ae633ddd1573cfdc997e2 | unbound_legacy_api/blueprints/stats.py | unbound_legacy_api/blueprints/stats.py | from flask import Blueprint
from unbound_legacy_api.utils.response import create_response
stats_bp = Blueprint('stats', __name__, url_prefix='/stats')
@stats_bp.route('/ping')
def ping():
"""Generic ping route to check if api is up"""
return create_response(status='success')
| from flask import Blueprint
from unbound_legacy_api.utils.response import create_response
stats_bp = Blueprint('stats', __name__, url_prefix='/v1/stats')
@stats_bp.route('/ping')
def ping():
"""Generic ping route to check if api is up"""
return create_response(status='success')
| Add versioning to api routes | fix(): Add versioning to api routes
| Python | mit | UnboundLegacy/api | from flask import Blueprint
from unbound_legacy_api.utils.response import create_response
stats_bp = Blueprint('stats', __name__, url_prefix='/stats')
@stats_bp.route('/ping')
def ping():
"""Generic ping route to check if api is up"""
return create_response(status='success')
fix(): Add versioning to api rout... | from flask import Blueprint
from unbound_legacy_api.utils.response import create_response
stats_bp = Blueprint('stats', __name__, url_prefix='/v1/stats')
@stats_bp.route('/ping')
def ping():
"""Generic ping route to check if api is up"""
return create_response(status='success')
| <commit_before>from flask import Blueprint
from unbound_legacy_api.utils.response import create_response
stats_bp = Blueprint('stats', __name__, url_prefix='/stats')
@stats_bp.route('/ping')
def ping():
"""Generic ping route to check if api is up"""
return create_response(status='success')
<commit_msg>fix():... | from flask import Blueprint
from unbound_legacy_api.utils.response import create_response
stats_bp = Blueprint('stats', __name__, url_prefix='/v1/stats')
@stats_bp.route('/ping')
def ping():
"""Generic ping route to check if api is up"""
return create_response(status='success')
| from flask import Blueprint
from unbound_legacy_api.utils.response import create_response
stats_bp = Blueprint('stats', __name__, url_prefix='/stats')
@stats_bp.route('/ping')
def ping():
"""Generic ping route to check if api is up"""
return create_response(status='success')
fix(): Add versioning to api rout... | <commit_before>from flask import Blueprint
from unbound_legacy_api.utils.response import create_response
stats_bp = Blueprint('stats', __name__, url_prefix='/stats')
@stats_bp.route('/ping')
def ping():
"""Generic ping route to check if api is up"""
return create_response(status='success')
<commit_msg>fix():... |
9145be89c1a5ba1a2c47bfeef571d40b9eb060bc | test/integration/test_user_args.py | test/integration/test_user_args.py | from . import *
class TestUserArgs(IntegrationTest):
def __init__(self, *args, **kwargs):
IntegrationTest.__init__(
self, os.path.join(examples_dir, '10_custom_args'),
configure=False, *args, **kwargs
)
def test_build_default(self):
self.configure()
sel... | from six import assertRegex
from . import *
class TestUserArgs(IntegrationTest):
def __init__(self, *args, **kwargs):
IntegrationTest.__init__(
self, os.path.join(examples_dir, '10_custom_args'),
configure=False, *args, **kwargs
)
def test_build_default(self):
... | Add integration test for user-args help | Add integration test for user-args help
| Python | bsd-3-clause | jimporter/bfg9000,jimporter/bfg9000,jimporter/bfg9000,jimporter/bfg9000 | from . import *
class TestUserArgs(IntegrationTest):
def __init__(self, *args, **kwargs):
IntegrationTest.__init__(
self, os.path.join(examples_dir, '10_custom_args'),
configure=False, *args, **kwargs
)
def test_build_default(self):
self.configure()
sel... | from six import assertRegex
from . import *
class TestUserArgs(IntegrationTest):
def __init__(self, *args, **kwargs):
IntegrationTest.__init__(
self, os.path.join(examples_dir, '10_custom_args'),
configure=False, *args, **kwargs
)
def test_build_default(self):
... | <commit_before>from . import *
class TestUserArgs(IntegrationTest):
def __init__(self, *args, **kwargs):
IntegrationTest.__init__(
self, os.path.join(examples_dir, '10_custom_args'),
configure=False, *args, **kwargs
)
def test_build_default(self):
self.configur... | from six import assertRegex
from . import *
class TestUserArgs(IntegrationTest):
def __init__(self, *args, **kwargs):
IntegrationTest.__init__(
self, os.path.join(examples_dir, '10_custom_args'),
configure=False, *args, **kwargs
)
def test_build_default(self):
... | from . import *
class TestUserArgs(IntegrationTest):
def __init__(self, *args, **kwargs):
IntegrationTest.__init__(
self, os.path.join(examples_dir, '10_custom_args'),
configure=False, *args, **kwargs
)
def test_build_default(self):
self.configure()
sel... | <commit_before>from . import *
class TestUserArgs(IntegrationTest):
def __init__(self, *args, **kwargs):
IntegrationTest.__init__(
self, os.path.join(examples_dir, '10_custom_args'),
configure=False, *args, **kwargs
)
def test_build_default(self):
self.configur... |
6a17674897bbb3a44fb2153967e3985dfdb3d5df | zounds/learn/graph.py | zounds/learn/graph.py | import featureflow as ff
from random_samples import ShuffledSamples
from random_samples import InfiniteSampler
from preprocess import PreprocessingPipeline
def learning_pipeline():
class LearningPipeline(ff.BaseModel):
samples = ff.PickleFeature(ff.IteratorNode)
shuffled = ff.PickleFeature(
... | import featureflow as ff
from random_samples import ShuffledSamples
from random_samples import InfiniteSampler
from preprocess import PreprocessingPipeline
def learning_pipeline():
class LearningPipeline(ff.BaseModel):
samples = ff.PickleFeature(ff.IteratorNode)
shuffled = ff.PickleFeature(
... | Add a new option allowing client code to turn off parallelism | Add a new option allowing client code to turn off parallelism
| Python | mit | JohnVinyard/zounds,JohnVinyard/zounds,JohnVinyard/zounds,JohnVinyard/zounds | import featureflow as ff
from random_samples import ShuffledSamples
from random_samples import InfiniteSampler
from preprocess import PreprocessingPipeline
def learning_pipeline():
class LearningPipeline(ff.BaseModel):
samples = ff.PickleFeature(ff.IteratorNode)
shuffled = ff.PickleFeature(
... | import featureflow as ff
from random_samples import ShuffledSamples
from random_samples import InfiniteSampler
from preprocess import PreprocessingPipeline
def learning_pipeline():
class LearningPipeline(ff.BaseModel):
samples = ff.PickleFeature(ff.IteratorNode)
shuffled = ff.PickleFeature(
... | <commit_before>import featureflow as ff
from random_samples import ShuffledSamples
from random_samples import InfiniteSampler
from preprocess import PreprocessingPipeline
def learning_pipeline():
class LearningPipeline(ff.BaseModel):
samples = ff.PickleFeature(ff.IteratorNode)
shuffled = ff.Pickl... | import featureflow as ff
from random_samples import ShuffledSamples
from random_samples import InfiniteSampler
from preprocess import PreprocessingPipeline
def learning_pipeline():
class LearningPipeline(ff.BaseModel):
samples = ff.PickleFeature(ff.IteratorNode)
shuffled = ff.PickleFeature(
... | import featureflow as ff
from random_samples import ShuffledSamples
from random_samples import InfiniteSampler
from preprocess import PreprocessingPipeline
def learning_pipeline():
class LearningPipeline(ff.BaseModel):
samples = ff.PickleFeature(ff.IteratorNode)
shuffled = ff.PickleFeature(
... | <commit_before>import featureflow as ff
from random_samples import ShuffledSamples
from random_samples import InfiniteSampler
from preprocess import PreprocessingPipeline
def learning_pipeline():
class LearningPipeline(ff.BaseModel):
samples = ff.PickleFeature(ff.IteratorNode)
shuffled = ff.Pickl... |
bfaf9d326fc0a2fc72a6f7b6ed92640c3fe9b87b | hirlite/__init__.py | hirlite/__init__.py | from .hirlite import Rlite, HirliteError
from .version import __version__
__all__ = ["Rlite", "HirliteError", "__version__"]
| import functools
from hirlite.hirlite import Rlite as RliteExtension, HirliteError
from hirlite.version import __version__
__all__ = ["Rlite", "HirliteError", "__version__"]
class Rlite(RliteExtension):
def __getattr__(self, command):
return functools.partial(self.command, command)
| Add support for calling commands by attr access | Add support for calling commands by attr access
| Python | bsd-2-clause | seppo0010/rlite-py,seppo0010/rlite-py,pombredanne/rlite-py,pombredanne/rlite-py | from .hirlite import Rlite, HirliteError
from .version import __version__
__all__ = ["Rlite", "HirliteError", "__version__"]
Add support for calling commands by attr access | import functools
from hirlite.hirlite import Rlite as RliteExtension, HirliteError
from hirlite.version import __version__
__all__ = ["Rlite", "HirliteError", "__version__"]
class Rlite(RliteExtension):
def __getattr__(self, command):
return functools.partial(self.command, command)
| <commit_before>from .hirlite import Rlite, HirliteError
from .version import __version__
__all__ = ["Rlite", "HirliteError", "__version__"]
<commit_msg>Add support for calling commands by attr access<commit_after> | import functools
from hirlite.hirlite import Rlite as RliteExtension, HirliteError
from hirlite.version import __version__
__all__ = ["Rlite", "HirliteError", "__version__"]
class Rlite(RliteExtension):
def __getattr__(self, command):
return functools.partial(self.command, command)
| from .hirlite import Rlite, HirliteError
from .version import __version__
__all__ = ["Rlite", "HirliteError", "__version__"]
Add support for calling commands by attr accessimport functools
from hirlite.hirlite import Rlite as RliteExtension, HirliteError
from hirlite.version import __version__
__all__ = ["Rlite", "H... | <commit_before>from .hirlite import Rlite, HirliteError
from .version import __version__
__all__ = ["Rlite", "HirliteError", "__version__"]
<commit_msg>Add support for calling commands by attr access<commit_after>import functools
from hirlite.hirlite import Rlite as RliteExtension, HirliteError
from hirlite.version i... |
9aef1f357a3319a31bd1995f462eb356011b6a93 | huxley/shortcuts.py | huxley/shortcuts.py | # Copyright (c) 2011-2013 Kunal Mehta. All rights reserved.
# Use of this source code is governed by a BSD License found in README.md.
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.utils import simplejson
from itertools impo... | # Copyright (c) 2011-2013 Kunal Mehta. All rights reserved.
# Use of this source code is governed by a BSD License found in README.md.
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.utils import simplejson
from itertools impo... | Change mimetype kwarg to content_type. | Change mimetype kwarg to content_type.
| Python | bsd-3-clause | nathanielparke/huxley,bmun/huxley,bmun/huxley,nathanielparke/huxley,ctmunwebmaster/huxley,nathanielparke/huxley,ctmunwebmaster/huxley,bmun/huxley,bmun/huxley,ctmunwebmaster/huxley,ctmunwebmaster/huxley,nathanielparke/huxley | # Copyright (c) 2011-2013 Kunal Mehta. All rights reserved.
# Use of this source code is governed by a BSD License found in README.md.
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.utils import simplejson
from itertools impo... | # Copyright (c) 2011-2013 Kunal Mehta. All rights reserved.
# Use of this source code is governed by a BSD License found in README.md.
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.utils import simplejson
from itertools impo... | <commit_before># Copyright (c) 2011-2013 Kunal Mehta. All rights reserved.
# Use of this source code is governed by a BSD License found in README.md.
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.utils import simplejson
from... | # Copyright (c) 2011-2013 Kunal Mehta. All rights reserved.
# Use of this source code is governed by a BSD License found in README.md.
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.utils import simplejson
from itertools impo... | # Copyright (c) 2011-2013 Kunal Mehta. All rights reserved.
# Use of this source code is governed by a BSD License found in README.md.
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.utils import simplejson
from itertools impo... | <commit_before># Copyright (c) 2011-2013 Kunal Mehta. All rights reserved.
# Use of this source code is governed by a BSD License found in README.md.
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.utils import simplejson
from... |
700f6e6ef40a2d33e5678e260f03cd15148e0b3a | test/test_parse_file_guess_format.py | test/test_parse_file_guess_format.py | import unittest
import logging
from pathlib import Path
from shutil import copyfile
from tempfile import TemporaryDirectory
from rdflib.exceptions import ParserError
from rdflib import Graph
class FileParserGuessFormatTest(unittest.TestCase):
def test_ttl(self):
g = Graph()
self.assertIsInstance... | import unittest
import logging
from pathlib import Path
from shutil import copyfile
from tempfile import TemporaryDirectory
from rdflib.exceptions import ParserError
from rdflib import Graph
class FileParserGuessFormatTest(unittest.TestCase):
def test_jsonld(self):
g = Graph()
self.assertIsInsta... | Add test for adding JSON-LD to guess_format() | Add test for adding JSON-LD to guess_format()
This is a follow-on patch to:
e778e9413510721c2fedaae56d4ff826df265c30
Test was confirmed to pass by running this on the current `master`
branch, and confirmed to fail with e778e941 reverted.
nosetests test/test_parse_file_guess_format.py
Signed-off-by: Alex Nelson ... | Python | bsd-3-clause | RDFLib/rdflib,RDFLib/rdflib,RDFLib/rdflib,RDFLib/rdflib | import unittest
import logging
from pathlib import Path
from shutil import copyfile
from tempfile import TemporaryDirectory
from rdflib.exceptions import ParserError
from rdflib import Graph
class FileParserGuessFormatTest(unittest.TestCase):
def test_ttl(self):
g = Graph()
self.assertIsInstance... | import unittest
import logging
from pathlib import Path
from shutil import copyfile
from tempfile import TemporaryDirectory
from rdflib.exceptions import ParserError
from rdflib import Graph
class FileParserGuessFormatTest(unittest.TestCase):
def test_jsonld(self):
g = Graph()
self.assertIsInsta... | <commit_before>import unittest
import logging
from pathlib import Path
from shutil import copyfile
from tempfile import TemporaryDirectory
from rdflib.exceptions import ParserError
from rdflib import Graph
class FileParserGuessFormatTest(unittest.TestCase):
def test_ttl(self):
g = Graph()
self.a... | import unittest
import logging
from pathlib import Path
from shutil import copyfile
from tempfile import TemporaryDirectory
from rdflib.exceptions import ParserError
from rdflib import Graph
class FileParserGuessFormatTest(unittest.TestCase):
def test_jsonld(self):
g = Graph()
self.assertIsInsta... | import unittest
import logging
from pathlib import Path
from shutil import copyfile
from tempfile import TemporaryDirectory
from rdflib.exceptions import ParserError
from rdflib import Graph
class FileParserGuessFormatTest(unittest.TestCase):
def test_ttl(self):
g = Graph()
self.assertIsInstance... | <commit_before>import unittest
import logging
from pathlib import Path
from shutil import copyfile
from tempfile import TemporaryDirectory
from rdflib.exceptions import ParserError
from rdflib import Graph
class FileParserGuessFormatTest(unittest.TestCase):
def test_ttl(self):
g = Graph()
self.a... |
24c8122db0f38a1f798461a23d08535e4e6781d5 | photo/idxitem.py | photo/idxitem.py | """Provide the class IdxItem which represents an item in the index.
"""
import hashlib
def _md5file(fname):
"""Calculate the md5 hash for a file.
"""
m = hashlib.md5()
chunksize = 8192
with open(fname, 'rb') as f:
while True:
chunk = f.read(chunksize)
if not chunk:... | """Provide the class IdxItem which represents an item in the index.
"""
import hashlib
def _md5file(fname):
"""Calculate the md5 hash for a file.
"""
m = hashlib.md5()
chunksize = 8192
with open(fname, 'rb') as f:
while True:
chunk = f.read(chunksize)
if not chunk:... | Convert tags to a set on init and back to a list on writing. | Convert tags to a set on init and back to a list on writing.
| Python | apache-2.0 | RKrahl/photo-tools | """Provide the class IdxItem which represents an item in the index.
"""
import hashlib
def _md5file(fname):
"""Calculate the md5 hash for a file.
"""
m = hashlib.md5()
chunksize = 8192
with open(fname, 'rb') as f:
while True:
chunk = f.read(chunksize)
if not chunk:... | """Provide the class IdxItem which represents an item in the index.
"""
import hashlib
def _md5file(fname):
"""Calculate the md5 hash for a file.
"""
m = hashlib.md5()
chunksize = 8192
with open(fname, 'rb') as f:
while True:
chunk = f.read(chunksize)
if not chunk:... | <commit_before>"""Provide the class IdxItem which represents an item in the index.
"""
import hashlib
def _md5file(fname):
"""Calculate the md5 hash for a file.
"""
m = hashlib.md5()
chunksize = 8192
with open(fname, 'rb') as f:
while True:
chunk = f.read(chunksize)
... | """Provide the class IdxItem which represents an item in the index.
"""
import hashlib
def _md5file(fname):
"""Calculate the md5 hash for a file.
"""
m = hashlib.md5()
chunksize = 8192
with open(fname, 'rb') as f:
while True:
chunk = f.read(chunksize)
if not chunk:... | """Provide the class IdxItem which represents an item in the index.
"""
import hashlib
def _md5file(fname):
"""Calculate the md5 hash for a file.
"""
m = hashlib.md5()
chunksize = 8192
with open(fname, 'rb') as f:
while True:
chunk = f.read(chunksize)
if not chunk:... | <commit_before>"""Provide the class IdxItem which represents an item in the index.
"""
import hashlib
def _md5file(fname):
"""Calculate the md5 hash for a file.
"""
m = hashlib.md5()
chunksize = 8192
with open(fname, 'rb') as f:
while True:
chunk = f.read(chunksize)
... |
a75dbd5aa5e9b84d08919ea14743afb75182ee8b | steel/chunks/iff.py | steel/chunks/iff.py | import collections
import io
from steel.fields.numbers import BigEndian
from steel import fields
from steel.chunks import base
__all__ = ['Chunk', 'ChunkList', 'Form']
class Chunk(base.Chunk):
id = fields.String(size=4, encoding='ascii')
size = fields.Integer(size=4, endianness=BigEndian)
p... | import collections
import io
from steel.fields.numbers import BigEndian
from steel import fields
from steel.chunks import base
__all__ = ['Chunk', 'ChunkList', 'List', 'Form', 'Prop']
class Chunk(base.Chunk):
id = fields.String(size=4, encoding='ascii')
size = fields.Integer(size=4, endianness=B... | Add a List and Prop for better IFF compliance | Add a List and Prop for better IFF compliance
| Python | bsd-3-clause | gulopine/steel | import collections
import io
from steel.fields.numbers import BigEndian
from steel import fields
from steel.chunks import base
__all__ = ['Chunk', 'ChunkList', 'Form']
class Chunk(base.Chunk):
id = fields.String(size=4, encoding='ascii')
size = fields.Integer(size=4, endianness=BigEndian)
p... | import collections
import io
from steel.fields.numbers import BigEndian
from steel import fields
from steel.chunks import base
__all__ = ['Chunk', 'ChunkList', 'List', 'Form', 'Prop']
class Chunk(base.Chunk):
id = fields.String(size=4, encoding='ascii')
size = fields.Integer(size=4, endianness=B... | <commit_before>import collections
import io
from steel.fields.numbers import BigEndian
from steel import fields
from steel.chunks import base
__all__ = ['Chunk', 'ChunkList', 'Form']
class Chunk(base.Chunk):
id = fields.String(size=4, encoding='ascii')
size = fields.Integer(size=4, endianness=Bi... | import collections
import io
from steel.fields.numbers import BigEndian
from steel import fields
from steel.chunks import base
__all__ = ['Chunk', 'ChunkList', 'List', 'Form', 'Prop']
class Chunk(base.Chunk):
id = fields.String(size=4, encoding='ascii')
size = fields.Integer(size=4, endianness=B... | import collections
import io
from steel.fields.numbers import BigEndian
from steel import fields
from steel.chunks import base
__all__ = ['Chunk', 'ChunkList', 'Form']
class Chunk(base.Chunk):
id = fields.String(size=4, encoding='ascii')
size = fields.Integer(size=4, endianness=BigEndian)
p... | <commit_before>import collections
import io
from steel.fields.numbers import BigEndian
from steel import fields
from steel.chunks import base
__all__ = ['Chunk', 'ChunkList', 'Form']
class Chunk(base.Chunk):
id = fields.String(size=4, encoding='ascii')
size = fields.Integer(size=4, endianness=Bi... |
376fa8dead817ae0b1e1e97547d7c95858b1fb0e | cairis/data/ImportDAO.py | cairis/data/ImportDAO.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | Fix problems identified by broken test | Fix problems identified by broken test
| Python | apache-2.0 | nathanbjenx/cairis,failys/CAIRIS,failys/CAIRIS,nathanbjenx/cairis,nathanbjenx/cairis,nathanbjenx/cairis,failys/CAIRIS | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | <commit_before># Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "Lic... | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | <commit_before># Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "Lic... |
15ebd5a3509b20bad4cf0123dfac9be6878fa91c | app/models/bookmarks.py | app/models/bookmarks.py | from flask import current_app
from .. import db, login_manager
class Bookmarks(db.Model):
id = db.Column(db.Integer, primary_key=True)
listing_id = db.Column(db.Integer, unique=True)
merchant_id = db.Column(db.Integer, db.ForeignKey('user.id')) #also needs to be added to Hunter's Vendors model
def __i... | from flask import current_app
from .. import db, login_manager
class Bookmarks(db.Model):
id = db.Column(db.Integer, primary_key=True)
listing_id = db.Column(db.Integer, unique=True)
merchant_id = db.Column(db.Integer, db.ForeignKey('user.id'))
merchant = db.relationship('User', backref=db.backref('boo... | Set up the relationship between bookmark and merchant | Set up the relationship between bookmark and merchant
| Python | mit | hack4impact/reading-terminal-market,hack4impact/reading-terminal-market,hack4impact/reading-terminal-market | from flask import current_app
from .. import db, login_manager
class Bookmarks(db.Model):
id = db.Column(db.Integer, primary_key=True)
listing_id = db.Column(db.Integer, unique=True)
merchant_id = db.Column(db.Integer, db.ForeignKey('user.id')) #also needs to be added to Hunter's Vendors model
def __i... | from flask import current_app
from .. import db, login_manager
class Bookmarks(db.Model):
id = db.Column(db.Integer, primary_key=True)
listing_id = db.Column(db.Integer, unique=True)
merchant_id = db.Column(db.Integer, db.ForeignKey('user.id'))
merchant = db.relationship('User', backref=db.backref('boo... | <commit_before>from flask import current_app
from .. import db, login_manager
class Bookmarks(db.Model):
id = db.Column(db.Integer, primary_key=True)
listing_id = db.Column(db.Integer, unique=True)
merchant_id = db.Column(db.Integer, db.ForeignKey('user.id')) #also needs to be added to Hunter's Vendors mod... | from flask import current_app
from .. import db, login_manager
class Bookmarks(db.Model):
id = db.Column(db.Integer, primary_key=True)
listing_id = db.Column(db.Integer, unique=True)
merchant_id = db.Column(db.Integer, db.ForeignKey('user.id'))
merchant = db.relationship('User', backref=db.backref('boo... | from flask import current_app
from .. import db, login_manager
class Bookmarks(db.Model):
id = db.Column(db.Integer, primary_key=True)
listing_id = db.Column(db.Integer, unique=True)
merchant_id = db.Column(db.Integer, db.ForeignKey('user.id')) #also needs to be added to Hunter's Vendors model
def __i... | <commit_before>from flask import current_app
from .. import db, login_manager
class Bookmarks(db.Model):
id = db.Column(db.Integer, primary_key=True)
listing_id = db.Column(db.Integer, unique=True)
merchant_id = db.Column(db.Integer, db.ForeignKey('user.id')) #also needs to be added to Hunter's Vendors mod... |
c8aca84619493cd75cb12b2fc63dc4dccb158032 | common/lib/chem/setup.py | common/lib/chem/setup.py | from setuptools import setup
setup(
name="chem",
version="0.1.1",
packages=["chem"],
install_requires=[
"pyparsing==2.0.7",
"numpy==1.6.2",
"scipy==0.14.0",
"nltk==3.2.5",
],
)
| from setuptools import setup
setup(
name="chem",
version="0.1.2",
packages=["chem"],
install_requires=[
"pyparsing==2.0.7",
"numpy==1.6.2",
"scipy==0.14.0",
"nltk==3.2.5",
],
)
| Update chem version to force new nltk requirement to be picked up | Update chem version to force new nltk requirement to be picked up
| Python | agpl-3.0 | procangroup/edx-platform,teltek/edx-platform,kmoocdev2/edx-platform,eduNEXT/edunext-platform,a-parhom/edx-platform,edx-solutions/edx-platform,a-parhom/edx-platform,gymnasium/edx-platform,Edraak/edraak-platform,appsembler/edx-platform,edx-solutions/edx-platform,ahmedaljazzar/edx-platform,kmoocdev2/edx-platform,eduNEXT/e... | from setuptools import setup
setup(
name="chem",
version="0.1.1",
packages=["chem"],
install_requires=[
"pyparsing==2.0.7",
"numpy==1.6.2",
"scipy==0.14.0",
"nltk==3.2.5",
],
)
Update chem version to force new nltk requirement to be picked up | from setuptools import setup
setup(
name="chem",
version="0.1.2",
packages=["chem"],
install_requires=[
"pyparsing==2.0.7",
"numpy==1.6.2",
"scipy==0.14.0",
"nltk==3.2.5",
],
)
| <commit_before>from setuptools import setup
setup(
name="chem",
version="0.1.1",
packages=["chem"],
install_requires=[
"pyparsing==2.0.7",
"numpy==1.6.2",
"scipy==0.14.0",
"nltk==3.2.5",
],
)
<commit_msg>Update chem version to force new nltk requirement to be picked ... | from setuptools import setup
setup(
name="chem",
version="0.1.2",
packages=["chem"],
install_requires=[
"pyparsing==2.0.7",
"numpy==1.6.2",
"scipy==0.14.0",
"nltk==3.2.5",
],
)
| from setuptools import setup
setup(
name="chem",
version="0.1.1",
packages=["chem"],
install_requires=[
"pyparsing==2.0.7",
"numpy==1.6.2",
"scipy==0.14.0",
"nltk==3.2.5",
],
)
Update chem version to force new nltk requirement to be picked upfrom setuptools import se... | <commit_before>from setuptools import setup
setup(
name="chem",
version="0.1.1",
packages=["chem"],
install_requires=[
"pyparsing==2.0.7",
"numpy==1.6.2",
"scipy==0.14.0",
"nltk==3.2.5",
],
)
<commit_msg>Update chem version to force new nltk requirement to be picked ... |
013fa911c7b882a0b362549d4d9b1f9e1e688bc8 | violations/py_unittest.py | violations/py_unittest.py | import re
from django.template.loader import render_to_string
from tasks.const import STATUS_SUCCESS, STATUS_FAILED
from .base import library
@library.register('py_unittest')
def py_unittest_violation(data):
"""Python unittest violation parser"""
lines = data['raw'].split('\n')
line = ''
while len(lin... | import re
from django.template.loader import render_to_string
from tasks.const import STATUS_SUCCESS, STATUS_FAILED
from .base import library
@library.register('py_unittest')
def py_unittest_violation(data):
"""Python unittest violation parser"""
lines = data['raw'].split('\n')
line = ''
while len(lin... | Add total tests count to py unittest graph | Add total tests count to py unittest graph
| Python | mit | nvbn/coviolations_web,nvbn/coviolations_web | import re
from django.template.loader import render_to_string
from tasks.const import STATUS_SUCCESS, STATUS_FAILED
from .base import library
@library.register('py_unittest')
def py_unittest_violation(data):
"""Python unittest violation parser"""
lines = data['raw'].split('\n')
line = ''
while len(lin... | import re
from django.template.loader import render_to_string
from tasks.const import STATUS_SUCCESS, STATUS_FAILED
from .base import library
@library.register('py_unittest')
def py_unittest_violation(data):
"""Python unittest violation parser"""
lines = data['raw'].split('\n')
line = ''
while len(lin... | <commit_before>import re
from django.template.loader import render_to_string
from tasks.const import STATUS_SUCCESS, STATUS_FAILED
from .base import library
@library.register('py_unittest')
def py_unittest_violation(data):
"""Python unittest violation parser"""
lines = data['raw'].split('\n')
line = ''
... | import re
from django.template.loader import render_to_string
from tasks.const import STATUS_SUCCESS, STATUS_FAILED
from .base import library
@library.register('py_unittest')
def py_unittest_violation(data):
"""Python unittest violation parser"""
lines = data['raw'].split('\n')
line = ''
while len(lin... | import re
from django.template.loader import render_to_string
from tasks.const import STATUS_SUCCESS, STATUS_FAILED
from .base import library
@library.register('py_unittest')
def py_unittest_violation(data):
"""Python unittest violation parser"""
lines = data['raw'].split('\n')
line = ''
while len(lin... | <commit_before>import re
from django.template.loader import render_to_string
from tasks.const import STATUS_SUCCESS, STATUS_FAILED
from .base import library
@library.register('py_unittest')
def py_unittest_violation(data):
"""Python unittest violation parser"""
lines = data['raw'].split('\n')
line = ''
... |
1c627347a55faadc28cd975d313ec45a84fcba21 | freetalks/__init__.py | freetalks/__init__.py | import webapp2
from freetalks import handler
application = webapp2.WSGIApplication([
webapp2.Route(r'/', handler.general.Home, 'home'),
webapp2.Route(r'/talk/<talk:[a-z\d-]*>', handler.talk.Display, 'talk-display'),
])
| import webapp2
from freetalks import handler
application = webapp2.WSGIApplication([
webapp2.Route(r'/', handler.general.Home, 'home'),
webapp2.Route(r'/talk/<talk:[\w]+>', handler.talk.Display, 'talk-display'),
])
| Make generic more liberal although it doesn't match all valid keys | Make generic more liberal although it doesn't match all valid keys
| Python | mit | preichenberger/freetalks,preichenberger/freetalks | import webapp2
from freetalks import handler
application = webapp2.WSGIApplication([
webapp2.Route(r'/', handler.general.Home, 'home'),
webapp2.Route(r'/talk/<talk:[a-z\d-]*>', handler.talk.Display, 'talk-display'),
])
Make generic more liberal although it doesn't match all valid keys | import webapp2
from freetalks import handler
application = webapp2.WSGIApplication([
webapp2.Route(r'/', handler.general.Home, 'home'),
webapp2.Route(r'/talk/<talk:[\w]+>', handler.talk.Display, 'talk-display'),
])
| <commit_before>import webapp2
from freetalks import handler
application = webapp2.WSGIApplication([
webapp2.Route(r'/', handler.general.Home, 'home'),
webapp2.Route(r'/talk/<talk:[a-z\d-]*>', handler.talk.Display, 'talk-display'),
])
<commit_msg>Make generic more liberal although it doesn't match all valid key... | import webapp2
from freetalks import handler
application = webapp2.WSGIApplication([
webapp2.Route(r'/', handler.general.Home, 'home'),
webapp2.Route(r'/talk/<talk:[\w]+>', handler.talk.Display, 'talk-display'),
])
| import webapp2
from freetalks import handler
application = webapp2.WSGIApplication([
webapp2.Route(r'/', handler.general.Home, 'home'),
webapp2.Route(r'/talk/<talk:[a-z\d-]*>', handler.talk.Display, 'talk-display'),
])
Make generic more liberal although it doesn't match all valid keysimport webapp2
from freeta... | <commit_before>import webapp2
from freetalks import handler
application = webapp2.WSGIApplication([
webapp2.Route(r'/', handler.general.Home, 'home'),
webapp2.Route(r'/talk/<talk:[a-z\d-]*>', handler.talk.Display, 'talk-display'),
])
<commit_msg>Make generic more liberal although it doesn't match all valid key... |
83c79251b5040e18c5c8ac65a5e140e59edc4d3f | test_readability.py | test_readability.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import readability
import unittest
good_code = """
def this_is_some_good_code(var):
for i in range(10):
print(i)
"""
bad_code = """
tisgc = lambda var: [print(i) for i in range(10)]
"""
apl_code = u"""
life←{↑1 ⍵∨.∧3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵}
"""
class TestReada... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import readability
import unittest
good_code = """
def this_is_some_good_code(var):
for i in range(10):
print(i)
"""
bad_code = """
tisgc = lambda var: [print(i) for i in range(10)]
"""
# taken from http://en.wikipedia.org/wiki/APL_%28programming_language%29#Examp... | Test APL code should give credit to Wikipedia | Test APL code should give credit to Wikipedia
| Python | mit | swenson/readability | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import readability
import unittest
good_code = """
def this_is_some_good_code(var):
for i in range(10):
print(i)
"""
bad_code = """
tisgc = lambda var: [print(i) for i in range(10)]
"""
apl_code = u"""
life←{↑1 ⍵∨.∧3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵}
"""
class TestReada... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import readability
import unittest
good_code = """
def this_is_some_good_code(var):
for i in range(10):
print(i)
"""
bad_code = """
tisgc = lambda var: [print(i) for i in range(10)]
"""
# taken from http://en.wikipedia.org/wiki/APL_%28programming_language%29#Examp... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import readability
import unittest
good_code = """
def this_is_some_good_code(var):
for i in range(10):
print(i)
"""
bad_code = """
tisgc = lambda var: [print(i) for i in range(10)]
"""
apl_code = u"""
life←{↑1 ⍵∨.∧3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵}
"""
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import readability
import unittest
good_code = """
def this_is_some_good_code(var):
for i in range(10):
print(i)
"""
bad_code = """
tisgc = lambda var: [print(i) for i in range(10)]
"""
# taken from http://en.wikipedia.org/wiki/APL_%28programming_language%29#Examp... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import readability
import unittest
good_code = """
def this_is_some_good_code(var):
for i in range(10):
print(i)
"""
bad_code = """
tisgc = lambda var: [print(i) for i in range(10)]
"""
apl_code = u"""
life←{↑1 ⍵∨.∧3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵}
"""
class TestReada... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import readability
import unittest
good_code = """
def this_is_some_good_code(var):
for i in range(10):
print(i)
"""
bad_code = """
tisgc = lambda var: [print(i) for i in range(10)]
"""
apl_code = u"""
life←{↑1 ⍵∨.∧3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵}
"""
... |
db03af21b3f46e5f5af89ccf224bc2bf4b9f6d9b | zephyr/projects/herobrine/BUILD.py | zephyr/projects/herobrine/BUILD.py | # Copyright 2021 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
def register_variant(project_name, extra_dts_overlays=(), extra_kconfig_files=()):
register_npcx_project(
project_name=project_name,
... | # Copyright 2021 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
def register_variant(project_name, extra_dts_overlays=(), extra_kconfig_files=()):
register_npcx_project(
project_name=project_name,
... | Include the missing project config | herobrine: Include the missing project config
Need to include the project config prj_herobrine_npcx9.conf to
the build. It defines CONFIG_BOARD_HEROBRINE_NPCX9=y. The board
specific alternative component code (alt_dev_replacement.c)
requires this Kconfig option.
BRANCH=None
BUG=b:216836197
TEST=Booted the herobrine_n... | Python | bsd-3-clause | coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec | # Copyright 2021 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
def register_variant(project_name, extra_dts_overlays=(), extra_kconfig_files=()):
register_npcx_project(
project_name=project_name,
... | # Copyright 2021 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
def register_variant(project_name, extra_dts_overlays=(), extra_kconfig_files=()):
register_npcx_project(
project_name=project_name,
... | <commit_before># Copyright 2021 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
def register_variant(project_name, extra_dts_overlays=(), extra_kconfig_files=()):
register_npcx_project(
project_name=project... | # Copyright 2021 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
def register_variant(project_name, extra_dts_overlays=(), extra_kconfig_files=()):
register_npcx_project(
project_name=project_name,
... | # Copyright 2021 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
def register_variant(project_name, extra_dts_overlays=(), extra_kconfig_files=()):
register_npcx_project(
project_name=project_name,
... | <commit_before># Copyright 2021 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
def register_variant(project_name, extra_dts_overlays=(), extra_kconfig_files=()):
register_npcx_project(
project_name=project... |
f2ca059d6e3e9e593b053e6483ad071d58cc99d2 | tests/core/admin.py | tests/core/admin.py | from django.contrib import admin
from import_export.admin import ImportExportMixin
from .models import Book, Category, Author
class BookAdmin(ImportExportMixin, admin.ModelAdmin):
pass
admin.site.register(Book, BookAdmin)
admin.site.register(Category)
admin.site.register(Author)
| from django.contrib import admin
from import_export.admin import ImportExportMixin
from .models import Book, Category, Author
class BookAdmin(ImportExportMixin, admin.ModelAdmin):
list_filter = ['categories', 'author']
admin.site.register(Book, BookAdmin)
admin.site.register(Category)
admin.site.register(Auth... | Add BookAdmin options in test app | Add BookAdmin options in test app
| Python | bsd-2-clause | PetrDlouhy/django-import-export,copperleaftech/django-import-export,Akoten/django-import-export,daniell/django-import-export,pajod/django-import-export,piran/django-import-export,bmihelac/django-import-export,sergei-maertens/django-import-export,bmihelac/django-import-export,PetrDlouhy/django-import-export,copperleafte... | from django.contrib import admin
from import_export.admin import ImportExportMixin
from .models import Book, Category, Author
class BookAdmin(ImportExportMixin, admin.ModelAdmin):
pass
admin.site.register(Book, BookAdmin)
admin.site.register(Category)
admin.site.register(Author)
Add BookAdmin options in test ... | from django.contrib import admin
from import_export.admin import ImportExportMixin
from .models import Book, Category, Author
class BookAdmin(ImportExportMixin, admin.ModelAdmin):
list_filter = ['categories', 'author']
admin.site.register(Book, BookAdmin)
admin.site.register(Category)
admin.site.register(Auth... | <commit_before>from django.contrib import admin
from import_export.admin import ImportExportMixin
from .models import Book, Category, Author
class BookAdmin(ImportExportMixin, admin.ModelAdmin):
pass
admin.site.register(Book, BookAdmin)
admin.site.register(Category)
admin.site.register(Author)
<commit_msg>Add... | from django.contrib import admin
from import_export.admin import ImportExportMixin
from .models import Book, Category, Author
class BookAdmin(ImportExportMixin, admin.ModelAdmin):
list_filter = ['categories', 'author']
admin.site.register(Book, BookAdmin)
admin.site.register(Category)
admin.site.register(Auth... | from django.contrib import admin
from import_export.admin import ImportExportMixin
from .models import Book, Category, Author
class BookAdmin(ImportExportMixin, admin.ModelAdmin):
pass
admin.site.register(Book, BookAdmin)
admin.site.register(Category)
admin.site.register(Author)
Add BookAdmin options in test ... | <commit_before>from django.contrib import admin
from import_export.admin import ImportExportMixin
from .models import Book, Category, Author
class BookAdmin(ImportExportMixin, admin.ModelAdmin):
pass
admin.site.register(Book, BookAdmin)
admin.site.register(Category)
admin.site.register(Author)
<commit_msg>Add... |
25c56d4c68ec484b47ef320cfb46601c4435470b | tests/test_crc32.py | tests/test_crc32.py | import hmac
import unittest
from twoping import crc32
class TestCRC32(unittest.TestCase):
def test_crc32(self):
c = crc32.new()
c.update(b"Data to hash")
self.assertEqual(c.digest(), b"\x44\x9e\x0a\x5c")
def test_hmac(self):
h = hmac.new(b"Secret key", b"Data to hash", crc32)... | import hmac
import unittest
from twoping import crc32
class TestCRC32(unittest.TestCase):
def test_crc32(self):
c = crc32.new(b"Data to hash")
self.assertEqual(c.digest(), b"\x44\x9e\x0a\x5c")
def test_hmac(self):
h = hmac.new(b"Secret key", b"Data to hash", crc32)
self.asser... | Increase test coverage on crc32 | Increase test coverage on crc32
| Python | mpl-2.0 | rfinnie/2ping,rfinnie/2ping | import hmac
import unittest
from twoping import crc32
class TestCRC32(unittest.TestCase):
def test_crc32(self):
c = crc32.new()
c.update(b"Data to hash")
self.assertEqual(c.digest(), b"\x44\x9e\x0a\x5c")
def test_hmac(self):
h = hmac.new(b"Secret key", b"Data to hash", crc32)... | import hmac
import unittest
from twoping import crc32
class TestCRC32(unittest.TestCase):
def test_crc32(self):
c = crc32.new(b"Data to hash")
self.assertEqual(c.digest(), b"\x44\x9e\x0a\x5c")
def test_hmac(self):
h = hmac.new(b"Secret key", b"Data to hash", crc32)
self.asser... | <commit_before>import hmac
import unittest
from twoping import crc32
class TestCRC32(unittest.TestCase):
def test_crc32(self):
c = crc32.new()
c.update(b"Data to hash")
self.assertEqual(c.digest(), b"\x44\x9e\x0a\x5c")
def test_hmac(self):
h = hmac.new(b"Secret key", b"Data t... | import hmac
import unittest
from twoping import crc32
class TestCRC32(unittest.TestCase):
def test_crc32(self):
c = crc32.new(b"Data to hash")
self.assertEqual(c.digest(), b"\x44\x9e\x0a\x5c")
def test_hmac(self):
h = hmac.new(b"Secret key", b"Data to hash", crc32)
self.asser... | import hmac
import unittest
from twoping import crc32
class TestCRC32(unittest.TestCase):
def test_crc32(self):
c = crc32.new()
c.update(b"Data to hash")
self.assertEqual(c.digest(), b"\x44\x9e\x0a\x5c")
def test_hmac(self):
h = hmac.new(b"Secret key", b"Data to hash", crc32)... | <commit_before>import hmac
import unittest
from twoping import crc32
class TestCRC32(unittest.TestCase):
def test_crc32(self):
c = crc32.new()
c.update(b"Data to hash")
self.assertEqual(c.digest(), b"\x44\x9e\x0a\x5c")
def test_hmac(self):
h = hmac.new(b"Secret key", b"Data t... |
096e41266ac3686c1757fc4b5087e3b786287f91 | webapp/byceps/database.py | webapp/byceps/database.py | # -*- coding: utf-8 -*-
"""
byceps.database
~~~~~~~~~~~~~~~
Database utilities.
:Copyright: 2006-2014 Jochen Kupperschmidt
"""
import uuid
from flask.ext.sqlalchemy import BaseQuery, SQLAlchemy
from sqlalchemy.dialects.postgresql import UUID
db = SQLAlchemy()
db.Uuid = UUID
def generate_uuid():
"""Genera... | # -*- coding: utf-8 -*-
"""
byceps.database
~~~~~~~~~~~~~~~
Database utilities.
:Copyright: 2006-2014 Jochen Kupperschmidt
"""
import uuid
from flask.ext.sqlalchemy import BaseQuery, SQLAlchemy
from sqlalchemy.dialects.postgresql import UUID
db = SQLAlchemy(session_options={'autoflush': False})
db.Uuid = UUID
... | Disable autoflushing as introduced with Flask-SQLAlchemy 2.0. | Disable autoflushing as introduced with Flask-SQLAlchemy 2.0.
| Python | bsd-3-clause | homeworkprod/byceps,m-ober/byceps,m-ober/byceps,m-ober/byceps,homeworkprod/byceps,homeworkprod/byceps | # -*- coding: utf-8 -*-
"""
byceps.database
~~~~~~~~~~~~~~~
Database utilities.
:Copyright: 2006-2014 Jochen Kupperschmidt
"""
import uuid
from flask.ext.sqlalchemy import BaseQuery, SQLAlchemy
from sqlalchemy.dialects.postgresql import UUID
db = SQLAlchemy()
db.Uuid = UUID
def generate_uuid():
"""Genera... | # -*- coding: utf-8 -*-
"""
byceps.database
~~~~~~~~~~~~~~~
Database utilities.
:Copyright: 2006-2014 Jochen Kupperschmidt
"""
import uuid
from flask.ext.sqlalchemy import BaseQuery, SQLAlchemy
from sqlalchemy.dialects.postgresql import UUID
db = SQLAlchemy(session_options={'autoflush': False})
db.Uuid = UUID
... | <commit_before># -*- coding: utf-8 -*-
"""
byceps.database
~~~~~~~~~~~~~~~
Database utilities.
:Copyright: 2006-2014 Jochen Kupperschmidt
"""
import uuid
from flask.ext.sqlalchemy import BaseQuery, SQLAlchemy
from sqlalchemy.dialects.postgresql import UUID
db = SQLAlchemy()
db.Uuid = UUID
def generate_uuid()... | # -*- coding: utf-8 -*-
"""
byceps.database
~~~~~~~~~~~~~~~
Database utilities.
:Copyright: 2006-2014 Jochen Kupperschmidt
"""
import uuid
from flask.ext.sqlalchemy import BaseQuery, SQLAlchemy
from sqlalchemy.dialects.postgresql import UUID
db = SQLAlchemy(session_options={'autoflush': False})
db.Uuid = UUID
... | # -*- coding: utf-8 -*-
"""
byceps.database
~~~~~~~~~~~~~~~
Database utilities.
:Copyright: 2006-2014 Jochen Kupperschmidt
"""
import uuid
from flask.ext.sqlalchemy import BaseQuery, SQLAlchemy
from sqlalchemy.dialects.postgresql import UUID
db = SQLAlchemy()
db.Uuid = UUID
def generate_uuid():
"""Genera... | <commit_before># -*- coding: utf-8 -*-
"""
byceps.database
~~~~~~~~~~~~~~~
Database utilities.
:Copyright: 2006-2014 Jochen Kupperschmidt
"""
import uuid
from flask.ext.sqlalchemy import BaseQuery, SQLAlchemy
from sqlalchemy.dialects.postgresql import UUID
db = SQLAlchemy()
db.Uuid = UUID
def generate_uuid()... |
a393881b4cf79a34101c7d4821ed0ccd78f117cb | zsh/zsh_concat.py | zsh/zsh_concat.py | #!/usr/bin/env python3
from os import scandir
from sys import argv
from platform import uname
from pathlib import Path
filename_template = """
# -------------------------------------------------------------------------------
# filename: {filename}
# -------------------------------------------------------------------... | #!/usr/bin/env python3
from os import scandir
from sys import argv
from platform import uname
from pathlib import Path
filename_template = """
# -------------------------------------------------------------------------------
# filename: {filename}
# -------------------------------------------------------------------... | Fix script to save output to script’s directory. | Fix script to save output to script’s directory.
| Python | mit | skk/dotfiles,skk/dotfiles | #!/usr/bin/env python3
from os import scandir
from sys import argv
from platform import uname
from pathlib import Path
filename_template = """
# -------------------------------------------------------------------------------
# filename: {filename}
# -------------------------------------------------------------------... | #!/usr/bin/env python3
from os import scandir
from sys import argv
from platform import uname
from pathlib import Path
filename_template = """
# -------------------------------------------------------------------------------
# filename: {filename}
# -------------------------------------------------------------------... | <commit_before>#!/usr/bin/env python3
from os import scandir
from sys import argv
from platform import uname
from pathlib import Path
filename_template = """
# -------------------------------------------------------------------------------
# filename: {filename}
# ----------------------------------------------------... | #!/usr/bin/env python3
from os import scandir
from sys import argv
from platform import uname
from pathlib import Path
filename_template = """
# -------------------------------------------------------------------------------
# filename: {filename}
# -------------------------------------------------------------------... | #!/usr/bin/env python3
from os import scandir
from sys import argv
from platform import uname
from pathlib import Path
filename_template = """
# -------------------------------------------------------------------------------
# filename: {filename}
# -------------------------------------------------------------------... | <commit_before>#!/usr/bin/env python3
from os import scandir
from sys import argv
from platform import uname
from pathlib import Path
filename_template = """
# -------------------------------------------------------------------------------
# filename: {filename}
# ----------------------------------------------------... |
ee32d3746a9fa788a06931063a8242f936b6ed18 | src/data/meta.py | src/data/meta.py | import collections
class Meta(collections.OrderedDict):
def __init__(self, *args, **kwargs):
self._smallest = float('inf')
self._largest = 0
self._ordered = True
super(Meta, self).__init__(*args, **kwargs)
def __setitem__(self, key, value, *args, **kwargs):
if key in self and self[key] == val... | import collections
import typing
class Meta(collections.OrderedDict, typing.MutableMapping[str, float]):
def __init__(self, *args, **kwargs) -> None:
self._smallest = float('inf')
self._largest = 0
self._ordered = True
super(Meta, self).__init__(*args, **kwargs)
def __setitem__(self, key: str, va... | Add typing information to Meta. | Add typing information to Meta.
| Python | mit | PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge | import collections
class Meta(collections.OrderedDict):
def __init__(self, *args, **kwargs):
self._smallest = float('inf')
self._largest = 0
self._ordered = True
super(Meta, self).__init__(*args, **kwargs)
def __setitem__(self, key, value, *args, **kwargs):
if key in self and self[key] == val... | import collections
import typing
class Meta(collections.OrderedDict, typing.MutableMapping[str, float]):
def __init__(self, *args, **kwargs) -> None:
self._smallest = float('inf')
self._largest = 0
self._ordered = True
super(Meta, self).__init__(*args, **kwargs)
def __setitem__(self, key: str, va... | <commit_before>import collections
class Meta(collections.OrderedDict):
def __init__(self, *args, **kwargs):
self._smallest = float('inf')
self._largest = 0
self._ordered = True
super(Meta, self).__init__(*args, **kwargs)
def __setitem__(self, key, value, *args, **kwargs):
if key in self and s... | import collections
import typing
class Meta(collections.OrderedDict, typing.MutableMapping[str, float]):
def __init__(self, *args, **kwargs) -> None:
self._smallest = float('inf')
self._largest = 0
self._ordered = True
super(Meta, self).__init__(*args, **kwargs)
def __setitem__(self, key: str, va... | import collections
class Meta(collections.OrderedDict):
def __init__(self, *args, **kwargs):
self._smallest = float('inf')
self._largest = 0
self._ordered = True
super(Meta, self).__init__(*args, **kwargs)
def __setitem__(self, key, value, *args, **kwargs):
if key in self and self[key] == val... | <commit_before>import collections
class Meta(collections.OrderedDict):
def __init__(self, *args, **kwargs):
self._smallest = float('inf')
self._largest = 0
self._ordered = True
super(Meta, self).__init__(*args, **kwargs)
def __setitem__(self, key, value, *args, **kwargs):
if key in self and s... |
213c25934aa15c9d607833f145f54647d17364ca | rnacentral/portal/templatetags/portal_extras.py | rnacentral/portal/templatetags/portal_extras.py | """
Copyright [2009-2014] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | """
Copyright [2009-2014] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | Update expert database list in the footer | Update expert database list in the footer
| Python | apache-2.0 | RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode | """
Copyright [2009-2014] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | """
Copyright [2009-2014] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | <commit_before>"""
Copyright [2009-2014] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by appl... | """
Copyright [2009-2014] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | """
Copyright [2009-2014] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | <commit_before>"""
Copyright [2009-2014] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by appl... |
fb27a53d0ea46e9012610eeccd90b50be07388d9 | doctr/tests/test_local.py | doctr/tests/test_local.py | from ..local import check_repo_exists
from pytest import raises
def test_bad_user():
with raises(RuntimeError):
check_repo_exists('---/invaliduser')
def test_bad_repo():
with raises(RuntimeError):
check_repo_exists('drdoctr/---')
def test_repo_exists():
assert check_repo_exists('drdoctr/... | from ..local import check_repo_exists
from pytest import raises
def test_bad_user():
with raises(RuntimeError):
check_repo_exists('---/invaliduser')
def test_bad_repo():
with raises(RuntimeError):
check_repo_exists('drdoctr/---')
def test_repo_exists():
assert not check_repo_exists('drdo... | Update expected test result for test_repo_exists now that check_repo_exists returns whether the repo is private or not | Update expected test result for test_repo_exists now that check_repo_exists returns whether the repo is private or not
| Python | mit | gforsyth/doctr_testing,drdoctr/doctr | from ..local import check_repo_exists
from pytest import raises
def test_bad_user():
with raises(RuntimeError):
check_repo_exists('---/invaliduser')
def test_bad_repo():
with raises(RuntimeError):
check_repo_exists('drdoctr/---')
def test_repo_exists():
assert check_repo_exists('drdoctr/... | from ..local import check_repo_exists
from pytest import raises
def test_bad_user():
with raises(RuntimeError):
check_repo_exists('---/invaliduser')
def test_bad_repo():
with raises(RuntimeError):
check_repo_exists('drdoctr/---')
def test_repo_exists():
assert not check_repo_exists('drdo... | <commit_before>from ..local import check_repo_exists
from pytest import raises
def test_bad_user():
with raises(RuntimeError):
check_repo_exists('---/invaliduser')
def test_bad_repo():
with raises(RuntimeError):
check_repo_exists('drdoctr/---')
def test_repo_exists():
assert check_repo_e... | from ..local import check_repo_exists
from pytest import raises
def test_bad_user():
with raises(RuntimeError):
check_repo_exists('---/invaliduser')
def test_bad_repo():
with raises(RuntimeError):
check_repo_exists('drdoctr/---')
def test_repo_exists():
assert not check_repo_exists('drdo... | from ..local import check_repo_exists
from pytest import raises
def test_bad_user():
with raises(RuntimeError):
check_repo_exists('---/invaliduser')
def test_bad_repo():
with raises(RuntimeError):
check_repo_exists('drdoctr/---')
def test_repo_exists():
assert check_repo_exists('drdoctr/... | <commit_before>from ..local import check_repo_exists
from pytest import raises
def test_bad_user():
with raises(RuntimeError):
check_repo_exists('---/invaliduser')
def test_bad_repo():
with raises(RuntimeError):
check_repo_exists('drdoctr/---')
def test_repo_exists():
assert check_repo_e... |
30230cb6fcb29cd437d3ce71c3370da6d38cb622 | python/04-2.py | python/04-2.py | #!/usr/bin/env python
import hashlib
prefix = ''
number = 1
with open('../inputs/04.txt') as f:
prefix = f.readlines()
prefix = prefix[0].rstrip()
while True:
md5 = hashlib.md5()
md5.update('{0}{1}'.format(prefix, number))
if md5.hexdigest()[:6] == '000000':
#print md5.hexdigest()
print nu... | #!/usr/bin/env python
import hashlib
prefix = ''
number = 1
with open('../inputs/04.txt') as f:
prefix = f.readlines()
prefix = prefix[0].rstrip()
md5 = hashlib.md5()
md5.update(prefix)
while True:
m = md5.copy()
m.update(str(number))
if m.hexdigest()[:6] == '000000':
print number
break
... | Use md5.copy() to be more efficient. | Use md5.copy() to be more efficient.
The hash.copy() documentation says this is more efficient given a common
initial substring.
| Python | mit | opello/adventofcode | #!/usr/bin/env python
import hashlib
prefix = ''
number = 1
with open('../inputs/04.txt') as f:
prefix = f.readlines()
prefix = prefix[0].rstrip()
while True:
md5 = hashlib.md5()
md5.update('{0}{1}'.format(prefix, number))
if md5.hexdigest()[:6] == '000000':
#print md5.hexdigest()
print nu... | #!/usr/bin/env python
import hashlib
prefix = ''
number = 1
with open('../inputs/04.txt') as f:
prefix = f.readlines()
prefix = prefix[0].rstrip()
md5 = hashlib.md5()
md5.update(prefix)
while True:
m = md5.copy()
m.update(str(number))
if m.hexdigest()[:6] == '000000':
print number
break
... | <commit_before>#!/usr/bin/env python
import hashlib
prefix = ''
number = 1
with open('../inputs/04.txt') as f:
prefix = f.readlines()
prefix = prefix[0].rstrip()
while True:
md5 = hashlib.md5()
md5.update('{0}{1}'.format(prefix, number))
if md5.hexdigest()[:6] == '000000':
#print md5.hexdigest()... | #!/usr/bin/env python
import hashlib
prefix = ''
number = 1
with open('../inputs/04.txt') as f:
prefix = f.readlines()
prefix = prefix[0].rstrip()
md5 = hashlib.md5()
md5.update(prefix)
while True:
m = md5.copy()
m.update(str(number))
if m.hexdigest()[:6] == '000000':
print number
break
... | #!/usr/bin/env python
import hashlib
prefix = ''
number = 1
with open('../inputs/04.txt') as f:
prefix = f.readlines()
prefix = prefix[0].rstrip()
while True:
md5 = hashlib.md5()
md5.update('{0}{1}'.format(prefix, number))
if md5.hexdigest()[:6] == '000000':
#print md5.hexdigest()
print nu... | <commit_before>#!/usr/bin/env python
import hashlib
prefix = ''
number = 1
with open('../inputs/04.txt') as f:
prefix = f.readlines()
prefix = prefix[0].rstrip()
while True:
md5 = hashlib.md5()
md5.update('{0}{1}'.format(prefix, number))
if md5.hexdigest()[:6] == '000000':
#print md5.hexdigest()... |
1152e7a329ee20494a4856f7a83f5ab1e6c4390e | runtests.py | runtests.py | #!/usr/bin/env python
import os, sys
from django.conf import settings
import django
DEFAULT_SETTINGS = dict(
INSTALLED_APPS=(
'django.contrib.contenttypes',
'model_utils',
'model_utils.tests',
),
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlit... | #!/usr/bin/env python
import os, sys
from django.conf import settings
import django
DEFAULT_SETTINGS = dict(
INSTALLED_APPS=(
'model_utils',
'model_utils.tests',
),
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3"
}
},
)
de... | Remove contenttypes from INSTALLED_APPS for testing; no longer needed. | Remove contenttypes from INSTALLED_APPS for testing; no longer needed.
| Python | bsd-3-clause | nemesisdesign/django-model-utils,timmygee/django-model-utils,patrys/django-model-utils,yeago/django-model-utils,nemesisdesign/django-model-utils,timmygee/django-model-utils,patrys/django-model-utils,carljm/django-model-utils,yeago/django-model-utils,carljm/django-model-utils | #!/usr/bin/env python
import os, sys
from django.conf import settings
import django
DEFAULT_SETTINGS = dict(
INSTALLED_APPS=(
'django.contrib.contenttypes',
'model_utils',
'model_utils.tests',
),
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlit... | #!/usr/bin/env python
import os, sys
from django.conf import settings
import django
DEFAULT_SETTINGS = dict(
INSTALLED_APPS=(
'model_utils',
'model_utils.tests',
),
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3"
}
},
)
de... | <commit_before>#!/usr/bin/env python
import os, sys
from django.conf import settings
import django
DEFAULT_SETTINGS = dict(
INSTALLED_APPS=(
'django.contrib.contenttypes',
'model_utils',
'model_utils.tests',
),
DATABASES={
"default": {
"ENGINE": "django.db... | #!/usr/bin/env python
import os, sys
from django.conf import settings
import django
DEFAULT_SETTINGS = dict(
INSTALLED_APPS=(
'model_utils',
'model_utils.tests',
),
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3"
}
},
)
de... | #!/usr/bin/env python
import os, sys
from django.conf import settings
import django
DEFAULT_SETTINGS = dict(
INSTALLED_APPS=(
'django.contrib.contenttypes',
'model_utils',
'model_utils.tests',
),
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlit... | <commit_before>#!/usr/bin/env python
import os, sys
from django.conf import settings
import django
DEFAULT_SETTINGS = dict(
INSTALLED_APPS=(
'django.contrib.contenttypes',
'model_utils',
'model_utils.tests',
),
DATABASES={
"default": {
"ENGINE": "django.db... |
155b1e6b8d431f1169a3e71d08d93d76a3414c59 | turbustat/statistics/vca_vcs/slice_thickness.py | turbustat/statistics/vca_vcs/slice_thickness.py | # Licensed under an MIT open source license - see LICENSE
import numpy as np
def change_slice_thickness(cube, slice_thickness=1.0):
'''
Degrades the velocity resolution of a data cube. This is to avoid
shot noise by removing velocity fluctuations at small thicknesses.
Parameters
----------
... | # Licensed under an MIT open source license - see LICENSE
import numpy as np
from astropy import units as u
from spectral_cube import SpectralCube
from astropy.convolution import Gaussian1DKernel
def spectral_regrid_cube(cube, channel_width):
fwhm_factor = np.sqrt(8 * np.log(2))
current_resolution = np.dif... | Add a corrected spectral regridding function that smooths before interpolating to a new spectral axis | Add a corrected spectral regridding function that smooths before interpolating to a new spectral axis
| Python | mit | e-koch/TurbuStat,Astroua/TurbuStat | # Licensed under an MIT open source license - see LICENSE
import numpy as np
def change_slice_thickness(cube, slice_thickness=1.0):
'''
Degrades the velocity resolution of a data cube. This is to avoid
shot noise by removing velocity fluctuations at small thicknesses.
Parameters
----------
... | # Licensed under an MIT open source license - see LICENSE
import numpy as np
from astropy import units as u
from spectral_cube import SpectralCube
from astropy.convolution import Gaussian1DKernel
def spectral_regrid_cube(cube, channel_width):
fwhm_factor = np.sqrt(8 * np.log(2))
current_resolution = np.dif... | <commit_before># Licensed under an MIT open source license - see LICENSE
import numpy as np
def change_slice_thickness(cube, slice_thickness=1.0):
'''
Degrades the velocity resolution of a data cube. This is to avoid
shot noise by removing velocity fluctuations at small thicknesses.
Parameters
... | # Licensed under an MIT open source license - see LICENSE
import numpy as np
from astropy import units as u
from spectral_cube import SpectralCube
from astropy.convolution import Gaussian1DKernel
def spectral_regrid_cube(cube, channel_width):
fwhm_factor = np.sqrt(8 * np.log(2))
current_resolution = np.dif... | # Licensed under an MIT open source license - see LICENSE
import numpy as np
def change_slice_thickness(cube, slice_thickness=1.0):
'''
Degrades the velocity resolution of a data cube. This is to avoid
shot noise by removing velocity fluctuations at small thicknesses.
Parameters
----------
... | <commit_before># Licensed under an MIT open source license - see LICENSE
import numpy as np
def change_slice_thickness(cube, slice_thickness=1.0):
'''
Degrades the velocity resolution of a data cube. This is to avoid
shot noise by removing velocity fluctuations at small thicknesses.
Parameters
... |
e39925db2834a7491f9b8b505e1e1cf181840035 | clowder_server/views.py | clowder_server/views.py | from braces.views import CsrfExemptMixin
from django.core.mail import send_mail
from django.http import HttpResponse
from django.views.generic import TemplateView, View
from clowder_server.models import Alert, Ping
class APIView(CsrfExemptMixin, View):
def post(self, request):
name = request.POST.get('n... | from braces.views import CsrfExemptMixin
from django.core.mail import send_mail
from django.http import HttpResponse
from django.views.generic import TemplateView, View
from clowder_server.models import Alert, Ping
class APIView(CsrfExemptMixin, View):
def post(self, request):
name = request.POST.get('n... | Add test response to frequency | Add test response to frequency
| Python | agpl-3.0 | framewr/clowder_server,framewr/clowder_server,keithhackbarth/clowder_server,keithhackbarth/clowder_server,framewr/clowder_server,keithhackbarth/clowder_server,keithhackbarth/clowder_server,framewr/clowder_server | from braces.views import CsrfExemptMixin
from django.core.mail import send_mail
from django.http import HttpResponse
from django.views.generic import TemplateView, View
from clowder_server.models import Alert, Ping
class APIView(CsrfExemptMixin, View):
def post(self, request):
name = request.POST.get('n... | from braces.views import CsrfExemptMixin
from django.core.mail import send_mail
from django.http import HttpResponse
from django.views.generic import TemplateView, View
from clowder_server.models import Alert, Ping
class APIView(CsrfExemptMixin, View):
def post(self, request):
name = request.POST.get('n... | <commit_before>from braces.views import CsrfExemptMixin
from django.core.mail import send_mail
from django.http import HttpResponse
from django.views.generic import TemplateView, View
from clowder_server.models import Alert, Ping
class APIView(CsrfExemptMixin, View):
def post(self, request):
name = requ... | from braces.views import CsrfExemptMixin
from django.core.mail import send_mail
from django.http import HttpResponse
from django.views.generic import TemplateView, View
from clowder_server.models import Alert, Ping
class APIView(CsrfExemptMixin, View):
def post(self, request):
name = request.POST.get('n... | from braces.views import CsrfExemptMixin
from django.core.mail import send_mail
from django.http import HttpResponse
from django.views.generic import TemplateView, View
from clowder_server.models import Alert, Ping
class APIView(CsrfExemptMixin, View):
def post(self, request):
name = request.POST.get('n... | <commit_before>from braces.views import CsrfExemptMixin
from django.core.mail import send_mail
from django.http import HttpResponse
from django.views.generic import TemplateView, View
from clowder_server.models import Alert, Ping
class APIView(CsrfExemptMixin, View):
def post(self, request):
name = requ... |
855434523df57183c31ed9b10e7458232b79046a | aclarknet/aclarknet/aclarknet/models.py | aclarknet/aclarknet/aclarknet/models.py | from django.db import models
class Client(models.Model):
client_name = models.CharField(max_length=60)
class Service(models.Model):
name = models.CharField(max_length=60)
class TeamMember(models.Model):
name = models.CharField(max_length=60)
| from django.db import models
class Client(models.Model):
client_name = models.CharField(max_length=60)
def __unicode__(self):
return self.client_name
class Service(models.Model):
name = models.CharField(max_length=60)
def __unicode__(self):
return self.name
class TeamMember(model... | Fix object name in Django Admin | Fix object name in Django Admin
http://stackoverflow.com/questions/9336463/django-xxxxxx-object-display-customization-in-admin-action-sidebar
| Python | mit | ACLARKNET/aclarknet-django,ACLARKNET/aclarknet-django | from django.db import models
class Client(models.Model):
client_name = models.CharField(max_length=60)
class Service(models.Model):
name = models.CharField(max_length=60)
class TeamMember(models.Model):
name = models.CharField(max_length=60)
Fix object name in Django Admin
http://stackoverflow.com/qu... | from django.db import models
class Client(models.Model):
client_name = models.CharField(max_length=60)
def __unicode__(self):
return self.client_name
class Service(models.Model):
name = models.CharField(max_length=60)
def __unicode__(self):
return self.name
class TeamMember(model... | <commit_before>from django.db import models
class Client(models.Model):
client_name = models.CharField(max_length=60)
class Service(models.Model):
name = models.CharField(max_length=60)
class TeamMember(models.Model):
name = models.CharField(max_length=60)
<commit_msg>Fix object name in Django Admin
... | from django.db import models
class Client(models.Model):
client_name = models.CharField(max_length=60)
def __unicode__(self):
return self.client_name
class Service(models.Model):
name = models.CharField(max_length=60)
def __unicode__(self):
return self.name
class TeamMember(model... | from django.db import models
class Client(models.Model):
client_name = models.CharField(max_length=60)
class Service(models.Model):
name = models.CharField(max_length=60)
class TeamMember(models.Model):
name = models.CharField(max_length=60)
Fix object name in Django Admin
http://stackoverflow.com/qu... | <commit_before>from django.db import models
class Client(models.Model):
client_name = models.CharField(max_length=60)
class Service(models.Model):
name = models.CharField(max_length=60)
class TeamMember(models.Model):
name = models.CharField(max_length=60)
<commit_msg>Fix object name in Django Admin
... |
6b06ff67097d0a2ef639df4a3d9baf4f6677b5fd | lmj/sim/__init__.py | lmj/sim/__init__.py | # Copyright (c) 2013 Leif Johnson <leif@leifjohnson.net>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify,... | # Copyright (c) 2013 Leif Johnson <leif@leifjohnson.net>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify,... | Update package imports for module name change. | Update package imports for module name change.
| Python | mit | EmbodiedCognition/pagoda,EmbodiedCognition/pagoda | # Copyright (c) 2013 Leif Johnson <leif@leifjohnson.net>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify,... | # Copyright (c) 2013 Leif Johnson <leif@leifjohnson.net>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify,... | <commit_before># Copyright (c) 2013 Leif Johnson <leif@leifjohnson.net>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use... | # Copyright (c) 2013 Leif Johnson <leif@leifjohnson.net>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify,... | # Copyright (c) 2013 Leif Johnson <leif@leifjohnson.net>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify,... | <commit_before># Copyright (c) 2013 Leif Johnson <leif@leifjohnson.net>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use... |
fd907ac07d5d20dcf8964dbef324bfa2da93ed44 | armstrong/core/arm_sections/managers.py | armstrong/core/arm_sections/managers.py | from django.db import models
class SectionSlugManager(models.Manager):
def __init__(self, section_field="primary_section", slug_field="slug",
*args, **kwargs):
super(SectionSlugManager, self).__init__(*args, **kwargs)
self.section_field = section_field
self.slug_field = slug_fi... | from django.db import models
class SectionSlugManager(models.Manager):
def __init__(self, section_field="primary_section", slug_field="slug",
*args, **kwargs):
super(SectionSlugManager, self).__init__(*args, **kwargs)
self.section_field = section_field
self.slug_field = slug_fi... | Handle situation where only a root full_slug is passed. | Handle situation where only a root full_slug is passed.
i.e. "section/" would break the rsplit(). If there is no slug, we can safely raise a DoesNotExist.
| Python | apache-2.0 | armstrong/armstrong.core.arm_sections,texastribune/armstrong.core.tt_sections,armstrong/armstrong.core.arm_sections,texastribune/armstrong.core.tt_sections,texastribune/armstrong.core.tt_sections | from django.db import models
class SectionSlugManager(models.Manager):
def __init__(self, section_field="primary_section", slug_field="slug",
*args, **kwargs):
super(SectionSlugManager, self).__init__(*args, **kwargs)
self.section_field = section_field
self.slug_field = slug_fi... | from django.db import models
class SectionSlugManager(models.Manager):
def __init__(self, section_field="primary_section", slug_field="slug",
*args, **kwargs):
super(SectionSlugManager, self).__init__(*args, **kwargs)
self.section_field = section_field
self.slug_field = slug_fi... | <commit_before>from django.db import models
class SectionSlugManager(models.Manager):
def __init__(self, section_field="primary_section", slug_field="slug",
*args, **kwargs):
super(SectionSlugManager, self).__init__(*args, **kwargs)
self.section_field = section_field
self.slug_... | from django.db import models
class SectionSlugManager(models.Manager):
def __init__(self, section_field="primary_section", slug_field="slug",
*args, **kwargs):
super(SectionSlugManager, self).__init__(*args, **kwargs)
self.section_field = section_field
self.slug_field = slug_fi... | from django.db import models
class SectionSlugManager(models.Manager):
def __init__(self, section_field="primary_section", slug_field="slug",
*args, **kwargs):
super(SectionSlugManager, self).__init__(*args, **kwargs)
self.section_field = section_field
self.slug_field = slug_fi... | <commit_before>from django.db import models
class SectionSlugManager(models.Manager):
def __init__(self, section_field="primary_section", slug_field="slug",
*args, **kwargs):
super(SectionSlugManager, self).__init__(*args, **kwargs)
self.section_field = section_field
self.slug_... |
03340917e96b7076ca420bea4e121f89c05935f6 | censusreporter/config/prod/settings.py | censusreporter/config/prod/settings.py | from censusreporter.config.base.settings import *
import os
DEBUG = False
ROOT_URLCONF = 'censusreporter.config.prod.urls'
WSGI_APPLICATION = "censusreporter.config.prod.wsgi.application"
ALLOWED_HOSTS = [
'censusreporter.org',
'www.censusreporter.org',
'censusreporter.dokku.censusreporter.org',
]
CACHE... | from censusreporter.config.base.settings import *
import os
DEBUG = False
ROOT_URLCONF = 'censusreporter.config.prod.urls'
WSGI_APPLICATION = "censusreporter.config.prod.wsgi.application"
ALLOWED_HOSTS = ['*']
CACHES = {
'default': {
'BACKEND': 'redis_cache.RedisCache',
'LOCATION': os.environ.ge... | Allow all hosts to support Dokku's healthcheck | Allow all hosts to support Dokku's healthcheck
| Python | mit | censusreporter/censusreporter,censusreporter/censusreporter,censusreporter/censusreporter,censusreporter/censusreporter | from censusreporter.config.base.settings import *
import os
DEBUG = False
ROOT_URLCONF = 'censusreporter.config.prod.urls'
WSGI_APPLICATION = "censusreporter.config.prod.wsgi.application"
ALLOWED_HOSTS = [
'censusreporter.org',
'www.censusreporter.org',
'censusreporter.dokku.censusreporter.org',
]
CACHE... | from censusreporter.config.base.settings import *
import os
DEBUG = False
ROOT_URLCONF = 'censusreporter.config.prod.urls'
WSGI_APPLICATION = "censusreporter.config.prod.wsgi.application"
ALLOWED_HOSTS = ['*']
CACHES = {
'default': {
'BACKEND': 'redis_cache.RedisCache',
'LOCATION': os.environ.ge... | <commit_before>from censusreporter.config.base.settings import *
import os
DEBUG = False
ROOT_URLCONF = 'censusreporter.config.prod.urls'
WSGI_APPLICATION = "censusreporter.config.prod.wsgi.application"
ALLOWED_HOSTS = [
'censusreporter.org',
'www.censusreporter.org',
'censusreporter.dokku.censusreporter... | from censusreporter.config.base.settings import *
import os
DEBUG = False
ROOT_URLCONF = 'censusreporter.config.prod.urls'
WSGI_APPLICATION = "censusreporter.config.prod.wsgi.application"
ALLOWED_HOSTS = ['*']
CACHES = {
'default': {
'BACKEND': 'redis_cache.RedisCache',
'LOCATION': os.environ.ge... | from censusreporter.config.base.settings import *
import os
DEBUG = False
ROOT_URLCONF = 'censusreporter.config.prod.urls'
WSGI_APPLICATION = "censusreporter.config.prod.wsgi.application"
ALLOWED_HOSTS = [
'censusreporter.org',
'www.censusreporter.org',
'censusreporter.dokku.censusreporter.org',
]
CACHE... | <commit_before>from censusreporter.config.base.settings import *
import os
DEBUG = False
ROOT_URLCONF = 'censusreporter.config.prod.urls'
WSGI_APPLICATION = "censusreporter.config.prod.wsgi.application"
ALLOWED_HOSTS = [
'censusreporter.org',
'www.censusreporter.org',
'censusreporter.dokku.censusreporter... |
20b4c81137d4abdd4db0dc80ae9a2e38cca4e8eb | examples/hello_twisted.py | examples/hello_twisted.py | """A simple example of Pyglet/Twisted integration. A Pyglet window
is displayed, and both Pyglet and Twisted are making scheduled calls
and regular intervals. Interacting with the window doesn't interfere
with either calls.
"""
import pyglet
import pygletreactor
pygletreactor.install() # <- this must come before...
fr... | """A simple example of Pyglet/Twisted integration. A Pyglet window
is displayed, and both Pyglet and Twisted are making scheduled calls
and regular intervals. Interacting with the window doesn't interfere
with either calls.
"""
import pyglet
import pygletreactor
pygletreactor.install() # <- this must come before...
fr... | Call to stop the reactor now uses the correct convention when closing from a thread other than the main reactor thread. | Call to stop the reactor now uses the correct convention when closing from a thread other than the main reactor thread.
Fixes Issue 5.
git-svn-id: a0251d2471cc357dbf602d275638891bc89eba80@9 4515f058-c067-11dd-9cb5-179210ed59e1
| Python | mit | padraigkitterick/pyglet-twisted | """A simple example of Pyglet/Twisted integration. A Pyglet window
is displayed, and both Pyglet and Twisted are making scheduled calls
and regular intervals. Interacting with the window doesn't interfere
with either calls.
"""
import pyglet
import pygletreactor
pygletreactor.install() # <- this must come before...
fr... | """A simple example of Pyglet/Twisted integration. A Pyglet window
is displayed, and both Pyglet and Twisted are making scheduled calls
and regular intervals. Interacting with the window doesn't interfere
with either calls.
"""
import pyglet
import pygletreactor
pygletreactor.install() # <- this must come before...
fr... | <commit_before>"""A simple example of Pyglet/Twisted integration. A Pyglet window
is displayed, and both Pyglet and Twisted are making scheduled calls
and regular intervals. Interacting with the window doesn't interfere
with either calls.
"""
import pyglet
import pygletreactor
pygletreactor.install() # <- this must co... | """A simple example of Pyglet/Twisted integration. A Pyglet window
is displayed, and both Pyglet and Twisted are making scheduled calls
and regular intervals. Interacting with the window doesn't interfere
with either calls.
"""
import pyglet
import pygletreactor
pygletreactor.install() # <- this must come before...
fr... | """A simple example of Pyglet/Twisted integration. A Pyglet window
is displayed, and both Pyglet and Twisted are making scheduled calls
and regular intervals. Interacting with the window doesn't interfere
with either calls.
"""
import pyglet
import pygletreactor
pygletreactor.install() # <- this must come before...
fr... | <commit_before>"""A simple example of Pyglet/Twisted integration. A Pyglet window
is displayed, and both Pyglet and Twisted are making scheduled calls
and regular intervals. Interacting with the window doesn't interfere
with either calls.
"""
import pyglet
import pygletreactor
pygletreactor.install() # <- this must co... |
7778b98e1a0d0ac7b9c14e4536e62de4db7debc9 | tests/integration/suite/test_global_role_bindings.py | tests/integration/suite/test_global_role_bindings.py | from .common import random_str
def test_cannot_update_global_role(admin_mc, remove_resource):
"""Asserts that globalRoleId field cannot be changed"""
admin_client = admin_mc.client
grb = admin_client.create_global_role_binding(
name="gr-" + random_str(),
userId=admin_mc.user.id,
g... | import pytest
from rancher import ApiError
from .common import random_str
def test_cannot_update_global_role(admin_mc, remove_resource):
"""Asserts that globalRoleId field cannot be changed"""
admin_client = admin_mc.client
grb = admin_client.create_global_role_binding(
name="gr-" + random_str()... | Add test for GRB validator | Add test for GRB validator
| Python | apache-2.0 | cjellick/rancher,rancherio/rancher,cjellick/rancher,rancher/rancher,cjellick/rancher,rancherio/rancher,rancher/rancher,rancher/rancher,rancher/rancher | from .common import random_str
def test_cannot_update_global_role(admin_mc, remove_resource):
"""Asserts that globalRoleId field cannot be changed"""
admin_client = admin_mc.client
grb = admin_client.create_global_role_binding(
name="gr-" + random_str(),
userId=admin_mc.user.id,
g... | import pytest
from rancher import ApiError
from .common import random_str
def test_cannot_update_global_role(admin_mc, remove_resource):
"""Asserts that globalRoleId field cannot be changed"""
admin_client = admin_mc.client
grb = admin_client.create_global_role_binding(
name="gr-" + random_str()... | <commit_before>from .common import random_str
def test_cannot_update_global_role(admin_mc, remove_resource):
"""Asserts that globalRoleId field cannot be changed"""
admin_client = admin_mc.client
grb = admin_client.create_global_role_binding(
name="gr-" + random_str(),
userId=admin_mc.use... | import pytest
from rancher import ApiError
from .common import random_str
def test_cannot_update_global_role(admin_mc, remove_resource):
"""Asserts that globalRoleId field cannot be changed"""
admin_client = admin_mc.client
grb = admin_client.create_global_role_binding(
name="gr-" + random_str()... | from .common import random_str
def test_cannot_update_global_role(admin_mc, remove_resource):
"""Asserts that globalRoleId field cannot be changed"""
admin_client = admin_mc.client
grb = admin_client.create_global_role_binding(
name="gr-" + random_str(),
userId=admin_mc.user.id,
g... | <commit_before>from .common import random_str
def test_cannot_update_global_role(admin_mc, remove_resource):
"""Asserts that globalRoleId field cannot be changed"""
admin_client = admin_mc.client
grb = admin_client.create_global_role_binding(
name="gr-" + random_str(),
userId=admin_mc.use... |
619253a51d0b79f170065e6023530937d7111102 | awscfncli/config/config.py | awscfncli/config/config.py | # -*- encoding: utf-8 -*-
import logging
import yaml
from collections import namedtuple
log = logging.getLogger(__name__)
def load(filename):
with open(filename) as fp:
config = yaml.safe_load(fp)
return CfnCliConfig.load(config)
class CfnCliConfig(namedtuple('CfnCliConfig', 'version blueprints e... | # -*- encoding: utf-8 -*-
import logging
import yaml
from collections import namedtuple
log = logging.getLogger(__name__)
def load(filename):
with open(filename) as fp:
config = yaml.safe_load(fp)
return CfnCliConfig.load(config)
class CfnCliConfig(namedtuple('CfnCliConfig', 'version blueprints e... | Use static method instead of classmethod | Use static method instead of classmethod
| Python | mit | Kotaimen/awscfncli,Kotaimen/awscfncli | # -*- encoding: utf-8 -*-
import logging
import yaml
from collections import namedtuple
log = logging.getLogger(__name__)
def load(filename):
with open(filename) as fp:
config = yaml.safe_load(fp)
return CfnCliConfig.load(config)
class CfnCliConfig(namedtuple('CfnCliConfig', 'version blueprints e... | # -*- encoding: utf-8 -*-
import logging
import yaml
from collections import namedtuple
log = logging.getLogger(__name__)
def load(filename):
with open(filename) as fp:
config = yaml.safe_load(fp)
return CfnCliConfig.load(config)
class CfnCliConfig(namedtuple('CfnCliConfig', 'version blueprints e... | <commit_before># -*- encoding: utf-8 -*-
import logging
import yaml
from collections import namedtuple
log = logging.getLogger(__name__)
def load(filename):
with open(filename) as fp:
config = yaml.safe_load(fp)
return CfnCliConfig.load(config)
class CfnCliConfig(namedtuple('CfnCliConfig', 'versi... | # -*- encoding: utf-8 -*-
import logging
import yaml
from collections import namedtuple
log = logging.getLogger(__name__)
def load(filename):
with open(filename) as fp:
config = yaml.safe_load(fp)
return CfnCliConfig.load(config)
class CfnCliConfig(namedtuple('CfnCliConfig', 'version blueprints e... | # -*- encoding: utf-8 -*-
import logging
import yaml
from collections import namedtuple
log = logging.getLogger(__name__)
def load(filename):
with open(filename) as fp:
config = yaml.safe_load(fp)
return CfnCliConfig.load(config)
class CfnCliConfig(namedtuple('CfnCliConfig', 'version blueprints e... | <commit_before># -*- encoding: utf-8 -*-
import logging
import yaml
from collections import namedtuple
log = logging.getLogger(__name__)
def load(filename):
with open(filename) as fp:
config = yaml.safe_load(fp)
return CfnCliConfig.load(config)
class CfnCliConfig(namedtuple('CfnCliConfig', 'versi... |
1285e4bcbdbcf3c28eced497c8585892f3ae1239 | django_summernote/admin.py | django_summernote/admin.py | from django.contrib import admin
from django.db import models
from django_summernote.widgets import SummernoteWidget, SummernoteInplaceWidget
from django_summernote.models import Attachment
from django_summernote.settings import summernote_config, get_attachment_model
__widget__ = SummernoteWidget if summernote_config... | from django.contrib import admin
from django.db import models
from django_summernote.widgets import SummernoteWidget, SummernoteInplaceWidget
from django_summernote.settings import summernote_config, get_attachment_model
__widget__ = SummernoteWidget if summernote_config['iframe'] \
else SummernoteInplaceWidget
... | Remove a non-used module importing | Remove a non-used module importing
| Python | mit | lqez/django-summernote,summernote/django-summernote,lqez/django-summernote,lqez/django-summernote,summernote/django-summernote,summernote/django-summernote | from django.contrib import admin
from django.db import models
from django_summernote.widgets import SummernoteWidget, SummernoteInplaceWidget
from django_summernote.models import Attachment
from django_summernote.settings import summernote_config, get_attachment_model
__widget__ = SummernoteWidget if summernote_config... | from django.contrib import admin
from django.db import models
from django_summernote.widgets import SummernoteWidget, SummernoteInplaceWidget
from django_summernote.settings import summernote_config, get_attachment_model
__widget__ = SummernoteWidget if summernote_config['iframe'] \
else SummernoteInplaceWidget
... | <commit_before>from django.contrib import admin
from django.db import models
from django_summernote.widgets import SummernoteWidget, SummernoteInplaceWidget
from django_summernote.models import Attachment
from django_summernote.settings import summernote_config, get_attachment_model
__widget__ = SummernoteWidget if su... | from django.contrib import admin
from django.db import models
from django_summernote.widgets import SummernoteWidget, SummernoteInplaceWidget
from django_summernote.settings import summernote_config, get_attachment_model
__widget__ = SummernoteWidget if summernote_config['iframe'] \
else SummernoteInplaceWidget
... | from django.contrib import admin
from django.db import models
from django_summernote.widgets import SummernoteWidget, SummernoteInplaceWidget
from django_summernote.models import Attachment
from django_summernote.settings import summernote_config, get_attachment_model
__widget__ = SummernoteWidget if summernote_config... | <commit_before>from django.contrib import admin
from django.db import models
from django_summernote.widgets import SummernoteWidget, SummernoteInplaceWidget
from django_summernote.models import Attachment
from django_summernote.settings import summernote_config, get_attachment_model
__widget__ = SummernoteWidget if su... |
7e638636606a4f7f7b5b6a09ec508746c8ca8f32 | Importacions_F1_Q1/Fact_impF1_eliminar_Ja_existeix.py | Importacions_F1_Q1/Fact_impF1_eliminar_Ja_existeix.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from ooop import OOOP
import configdb
O = OOOP(**configdb.ooop)
imp_obj = O.GiscedataFacturacioImportacioLinia
imp_del_ids = imp_obj.search([('state','=','erroni'),('info','like','Ja existeix una factura')])
imp_del_ids += imp_obj.search([('state','=','erroni')... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from ooop import OOOP
import configdb
O = OOOP(**configdb.ooop)
imp_obj = O.GiscedataFacturacioImportacioLinia
imp_del_ids = imp_obj.search([('state','=','erroni'),('info','=','Aquest fitxer XML ja s\'ha processat en els següents IDs')])
imp_del_ids = imp_obj.s... | Fix Cannot delete invoice(s) that are already opened or paid | Fix Cannot delete invoice(s) that are already opened or paid
| Python | agpl-3.0 | Som-Energia/invoice-janitor | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from ooop import OOOP
import configdb
O = OOOP(**configdb.ooop)
imp_obj = O.GiscedataFacturacioImportacioLinia
imp_del_ids = imp_obj.search([('state','=','erroni'),('info','like','Ja existeix una factura')])
imp_del_ids += imp_obj.search([('state','=','erroni')... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from ooop import OOOP
import configdb
O = OOOP(**configdb.ooop)
imp_obj = O.GiscedataFacturacioImportacioLinia
imp_del_ids = imp_obj.search([('state','=','erroni'),('info','=','Aquest fitxer XML ja s\'ha processat en els següents IDs')])
imp_del_ids = imp_obj.s... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from ooop import OOOP
import configdb
O = OOOP(**configdb.ooop)
imp_obj = O.GiscedataFacturacioImportacioLinia
imp_del_ids = imp_obj.search([('state','=','erroni'),('info','like','Ja existeix una factura')])
imp_del_ids += imp_obj.search([('state... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from ooop import OOOP
import configdb
O = OOOP(**configdb.ooop)
imp_obj = O.GiscedataFacturacioImportacioLinia
imp_del_ids = imp_obj.search([('state','=','erroni'),('info','=','Aquest fitxer XML ja s\'ha processat en els següents IDs')])
imp_del_ids = imp_obj.s... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from ooop import OOOP
import configdb
O = OOOP(**configdb.ooop)
imp_obj = O.GiscedataFacturacioImportacioLinia
imp_del_ids = imp_obj.search([('state','=','erroni'),('info','like','Ja existeix una factura')])
imp_del_ids += imp_obj.search([('state','=','erroni')... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from ooop import OOOP
import configdb
O = OOOP(**configdb.ooop)
imp_obj = O.GiscedataFacturacioImportacioLinia
imp_del_ids = imp_obj.search([('state','=','erroni'),('info','like','Ja existeix una factura')])
imp_del_ids += imp_obj.search([('state... |
8cee7d5478cde2b188da4dc93f844073be729a48 | src/gerobak/apps/profile/models.py | src/gerobak/apps/profile/models.py | from django.db import models
from django.contrib.auth.models import User
from django.conf import settings
from django.db.models.signals import post_save
from gerobak import utils
class Profile(models.Model):
pid = models.CharField(max_length=8)
user = models.ForeignKey(User)
added = models.DateTimeField(... | from django.db import models
from django.contrib.auth.models import User
from django.conf import settings
from django.db.models.signals import post_save
from gerobak import utils
class Profile(models.Model):
pid = models.CharField(max_length=8)
user = models.ForeignKey(User)
added = models.DateTimeField(... | Store task_id for update, install, and upgrade processes in the database. | Store task_id for update, install, and upgrade processes in the database.
| Python | agpl-3.0 | fajran/gerobak,fajran/gerobak | from django.db import models
from django.contrib.auth.models import User
from django.conf import settings
from django.db.models.signals import post_save
from gerobak import utils
class Profile(models.Model):
pid = models.CharField(max_length=8)
user = models.ForeignKey(User)
added = models.DateTimeField(... | from django.db import models
from django.contrib.auth.models import User
from django.conf import settings
from django.db.models.signals import post_save
from gerobak import utils
class Profile(models.Model):
pid = models.CharField(max_length=8)
user = models.ForeignKey(User)
added = models.DateTimeField(... | <commit_before>from django.db import models
from django.contrib.auth.models import User
from django.conf import settings
from django.db.models.signals import post_save
from gerobak import utils
class Profile(models.Model):
pid = models.CharField(max_length=8)
user = models.ForeignKey(User)
added = models... | from django.db import models
from django.contrib.auth.models import User
from django.conf import settings
from django.db.models.signals import post_save
from gerobak import utils
class Profile(models.Model):
pid = models.CharField(max_length=8)
user = models.ForeignKey(User)
added = models.DateTimeField(... | from django.db import models
from django.contrib.auth.models import User
from django.conf import settings
from django.db.models.signals import post_save
from gerobak import utils
class Profile(models.Model):
pid = models.CharField(max_length=8)
user = models.ForeignKey(User)
added = models.DateTimeField(... | <commit_before>from django.db import models
from django.contrib.auth.models import User
from django.conf import settings
from django.db.models.signals import post_save
from gerobak import utils
class Profile(models.Model):
pid = models.CharField(max_length=8)
user = models.ForeignKey(User)
added = models... |
6021f5af785e5234b9f83ea4ac740571b9308ae4 | Communication/mavtester.py | Communication/mavtester.py | #!/usr/bin/env python
'''
test mavlink messages
Do not forget to precise the baudrate (default 115200)
'''
import sys, struct, time, os
from curses import ascii
from pymavlink import mavutil
from argparse import ArgumentParser
parser = ArgumentParser(description=__doc__)
parser.add_argument("--baudrate", type=int,... | #!/usr/bin/env python
'''
test mavlink messages
Do not forget to precise the baudrate (default 115200)
'''
import sys, struct, time, os
from curses import ascii
from pymavlink import mavutil
from argparse import ArgumentParser
parser = ArgumentParser(description=__doc__)
parser.add_argument("--baudrate", type=int,... | Add reception of GPS_RAW_INT messages as demo | Add reception of GPS_RAW_INT messages as demo
| Python | mit | baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite | #!/usr/bin/env python
'''
test mavlink messages
Do not forget to precise the baudrate (default 115200)
'''
import sys, struct, time, os
from curses import ascii
from pymavlink import mavutil
from argparse import ArgumentParser
parser = ArgumentParser(description=__doc__)
parser.add_argument("--baudrate", type=int,... | #!/usr/bin/env python
'''
test mavlink messages
Do not forget to precise the baudrate (default 115200)
'''
import sys, struct, time, os
from curses import ascii
from pymavlink import mavutil
from argparse import ArgumentParser
parser = ArgumentParser(description=__doc__)
parser.add_argument("--baudrate", type=int,... | <commit_before>#!/usr/bin/env python
'''
test mavlink messages
Do not forget to precise the baudrate (default 115200)
'''
import sys, struct, time, os
from curses import ascii
from pymavlink import mavutil
from argparse import ArgumentParser
parser = ArgumentParser(description=__doc__)
parser.add_argument("--baudr... | #!/usr/bin/env python
'''
test mavlink messages
Do not forget to precise the baudrate (default 115200)
'''
import sys, struct, time, os
from curses import ascii
from pymavlink import mavutil
from argparse import ArgumentParser
parser = ArgumentParser(description=__doc__)
parser.add_argument("--baudrate", type=int,... | #!/usr/bin/env python
'''
test mavlink messages
Do not forget to precise the baudrate (default 115200)
'''
import sys, struct, time, os
from curses import ascii
from pymavlink import mavutil
from argparse import ArgumentParser
parser = ArgumentParser(description=__doc__)
parser.add_argument("--baudrate", type=int,... | <commit_before>#!/usr/bin/env python
'''
test mavlink messages
Do not forget to precise the baudrate (default 115200)
'''
import sys, struct, time, os
from curses import ascii
from pymavlink import mavutil
from argparse import ArgumentParser
parser = ArgumentParser(description=__doc__)
parser.add_argument("--baudr... |
3b8811af898ec8cbaa93c69c6b702b92756713dc | vumi/persist/tests/test_riak_manager.py | vumi/persist/tests/test_riak_manager.py | """Tests for vumi.persist.riak_manager."""
from twisted.trial.unittest import TestCase
from vumi.persist.riak_manager import RiakManager
class TestRiakManager(TestCase):
pass
| """Tests for vumi.persist.riak_manager."""
from itertools import count
from twisted.trial.unittest import TestCase
from twisted.internet.defer import returnValue
from vumi.persist.riak_manager import RiakManager, flatten_generator
from vumi.persist.tests.test_txriak_manager import CommonRiakManagerTests
class Test... | Add tests for (nottx)riak manager. | Add tests for (nottx)riak manager.
| Python | bsd-3-clause | vishwaprakashmishra/xmatrix,harrissoerja/vumi,TouK/vumi,vishwaprakashmishra/xmatrix,vishwaprakashmishra/xmatrix,TouK/vumi,TouK/vumi,harrissoerja/vumi,harrissoerja/vumi | """Tests for vumi.persist.riak_manager."""
from twisted.trial.unittest import TestCase
from vumi.persist.riak_manager import RiakManager
class TestRiakManager(TestCase):
pass
Add tests for (nottx)riak manager. | """Tests for vumi.persist.riak_manager."""
from itertools import count
from twisted.trial.unittest import TestCase
from twisted.internet.defer import returnValue
from vumi.persist.riak_manager import RiakManager, flatten_generator
from vumi.persist.tests.test_txriak_manager import CommonRiakManagerTests
class Test... | <commit_before>"""Tests for vumi.persist.riak_manager."""
from twisted.trial.unittest import TestCase
from vumi.persist.riak_manager import RiakManager
class TestRiakManager(TestCase):
pass
<commit_msg>Add tests for (nottx)riak manager.<commit_after> | """Tests for vumi.persist.riak_manager."""
from itertools import count
from twisted.trial.unittest import TestCase
from twisted.internet.defer import returnValue
from vumi.persist.riak_manager import RiakManager, flatten_generator
from vumi.persist.tests.test_txriak_manager import CommonRiakManagerTests
class Test... | """Tests for vumi.persist.riak_manager."""
from twisted.trial.unittest import TestCase
from vumi.persist.riak_manager import RiakManager
class TestRiakManager(TestCase):
pass
Add tests for (nottx)riak manager."""Tests for vumi.persist.riak_manager."""
from itertools import count
from twisted.trial.unittest im... | <commit_before>"""Tests for vumi.persist.riak_manager."""
from twisted.trial.unittest import TestCase
from vumi.persist.riak_manager import RiakManager
class TestRiakManager(TestCase):
pass
<commit_msg>Add tests for (nottx)riak manager.<commit_after>"""Tests for vumi.persist.riak_manager."""
from itertools imp... |
c4ea39ab8666a2872b25c9b8619f1b0feb823d9f | server.py | server.py | import os
from app import create_app, db
from flask.ext.script import Manager, Shell, Server
from flask.ext.migrate import Migrate, MigrateCommand
app = create_app(os.getenv('FLASK_CONFIG') or 'default')
manager = Manager(app)
manager.add_command("runserver", Server(host="0.0.0.0"))
migrate = Migrate(app, db)
def ma... | import os
from app import create_app, db
from flask.ext.script import Manager, Shell, Server
from flask.ext.migrate import Migrate, MigrateCommand
app = create_app(os.getenv('FLASK_CONFIG') or 'default')
manager = Manager(app)
manager.add_command("runserver", Server(host="0.0.0.0"))
migrate = Migrate(app, db)
def ma... | Change system return exit on failed tests | Change system return exit on failed tests
| Python | mit | luisfcofv/Superhero | import os
from app import create_app, db
from flask.ext.script import Manager, Shell, Server
from flask.ext.migrate import Migrate, MigrateCommand
app = create_app(os.getenv('FLASK_CONFIG') or 'default')
manager = Manager(app)
manager.add_command("runserver", Server(host="0.0.0.0"))
migrate = Migrate(app, db)
def ma... | import os
from app import create_app, db
from flask.ext.script import Manager, Shell, Server
from flask.ext.migrate import Migrate, MigrateCommand
app = create_app(os.getenv('FLASK_CONFIG') or 'default')
manager = Manager(app)
manager.add_command("runserver", Server(host="0.0.0.0"))
migrate = Migrate(app, db)
def ma... | <commit_before>import os
from app import create_app, db
from flask.ext.script import Manager, Shell, Server
from flask.ext.migrate import Migrate, MigrateCommand
app = create_app(os.getenv('FLASK_CONFIG') or 'default')
manager = Manager(app)
manager.add_command("runserver", Server(host="0.0.0.0"))
migrate = Migrate(ap... | import os
from app import create_app, db
from flask.ext.script import Manager, Shell, Server
from flask.ext.migrate import Migrate, MigrateCommand
app = create_app(os.getenv('FLASK_CONFIG') or 'default')
manager = Manager(app)
manager.add_command("runserver", Server(host="0.0.0.0"))
migrate = Migrate(app, db)
def ma... | import os
from app import create_app, db
from flask.ext.script import Manager, Shell, Server
from flask.ext.migrate import Migrate, MigrateCommand
app = create_app(os.getenv('FLASK_CONFIG') or 'default')
manager = Manager(app)
manager.add_command("runserver", Server(host="0.0.0.0"))
migrate = Migrate(app, db)
def ma... | <commit_before>import os
from app import create_app, db
from flask.ext.script import Manager, Shell, Server
from flask.ext.migrate import Migrate, MigrateCommand
app = create_app(os.getenv('FLASK_CONFIG') or 'default')
manager = Manager(app)
manager.add_command("runserver", Server(host="0.0.0.0"))
migrate = Migrate(ap... |
b80b781b8f446b8149b948a6ec4aeff63fd728ce | Orange/widgets/utils/plot/__init__.py | Orange/widgets/utils/plot/__init__.py | """
*************************
Plot classes and tools for use in Orange widgets
*************************
The main class of this module is :obj:`.OWPlot`, from which all plots
in visualization widgets should inherit.
This module also contains plot elements, which are normally used by the :obj:`.OWPlot`,
but can al... | """
*************************
Plot classes and tools for use in Orange widgets
*************************
The main class of this module is :obj:`.OWPlot`, from which all plots
in visualization widgets should inherit.
This module also contains plot elements, which are normally used by the :obj:`.OWPlot`,
but can al... | Handle PyQt 5.3 raising RuntimeError on incompatible orangeqt import | Handle PyQt 5.3 raising RuntimeError on incompatible orangeqt import
| Python | bsd-2-clause | cheral/orange3,cheral/orange3,cheral/orange3,cheral/orange3,cheral/orange3,cheral/orange3 | """
*************************
Plot classes and tools for use in Orange widgets
*************************
The main class of this module is :obj:`.OWPlot`, from which all plots
in visualization widgets should inherit.
This module also contains plot elements, which are normally used by the :obj:`.OWPlot`,
but can al... | """
*************************
Plot classes and tools for use in Orange widgets
*************************
The main class of this module is :obj:`.OWPlot`, from which all plots
in visualization widgets should inherit.
This module also contains plot elements, which are normally used by the :obj:`.OWPlot`,
but can al... | <commit_before>"""
*************************
Plot classes and tools for use in Orange widgets
*************************
The main class of this module is :obj:`.OWPlot`, from which all plots
in visualization widgets should inherit.
This module also contains plot elements, which are normally used by the :obj:`.OWPlo... | """
*************************
Plot classes and tools for use in Orange widgets
*************************
The main class of this module is :obj:`.OWPlot`, from which all plots
in visualization widgets should inherit.
This module also contains plot elements, which are normally used by the :obj:`.OWPlot`,
but can al... | """
*************************
Plot classes and tools for use in Orange widgets
*************************
The main class of this module is :obj:`.OWPlot`, from which all plots
in visualization widgets should inherit.
This module also contains plot elements, which are normally used by the :obj:`.OWPlot`,
but can al... | <commit_before>"""
*************************
Plot classes and tools for use in Orange widgets
*************************
The main class of this module is :obj:`.OWPlot`, from which all plots
in visualization widgets should inherit.
This module also contains plot elements, which are normally used by the :obj:`.OWPlo... |
59651470489a4479db6d9a79de3aacee6b9d7cd8 | travis/wait-until-cluster-initialised.py | travis/wait-until-cluster-initialised.py | #!/usr/bin/env python3
import json
import sys
import time
from urllib.request import urlopen
STATS_URL = "http://localhost:18001/stats"
MAXIMUM_TIME_SECONDS = 2 * 60
SLEEPING_INTERVAL_SECONDS = 1
STATUS_CODE_OK = 200
def is_initialised():
try:
response = urlopen(STATS_URL)
if (response.getcode()... | #!/usr/bin/env python3
import json
import sys
import time
from urllib.request import urlopen
STATS_URL = "http://localhost:18001/stats"
MAXIMUM_TIME_SECONDS = 2 * 60
SLEEPING_INTERVAL_SECONDS = 1
STATUS_CODE_OK = 200
def is_initialised():
try:
response = urlopen(STATS_URL)
if (response.getcode()... | Remove unused left over parameter | Remove unused left over parameter
| Python | apache-2.0 | codiply/barrio,codiply/barrio | #!/usr/bin/env python3
import json
import sys
import time
from urllib.request import urlopen
STATS_URL = "http://localhost:18001/stats"
MAXIMUM_TIME_SECONDS = 2 * 60
SLEEPING_INTERVAL_SECONDS = 1
STATUS_CODE_OK = 200
def is_initialised():
try:
response = urlopen(STATS_URL)
if (response.getcode()... | #!/usr/bin/env python3
import json
import sys
import time
from urllib.request import urlopen
STATS_URL = "http://localhost:18001/stats"
MAXIMUM_TIME_SECONDS = 2 * 60
SLEEPING_INTERVAL_SECONDS = 1
STATUS_CODE_OK = 200
def is_initialised():
try:
response = urlopen(STATS_URL)
if (response.getcode()... | <commit_before>#!/usr/bin/env python3
import json
import sys
import time
from urllib.request import urlopen
STATS_URL = "http://localhost:18001/stats"
MAXIMUM_TIME_SECONDS = 2 * 60
SLEEPING_INTERVAL_SECONDS = 1
STATUS_CODE_OK = 200
def is_initialised():
try:
response = urlopen(STATS_URL)
if (res... | #!/usr/bin/env python3
import json
import sys
import time
from urllib.request import urlopen
STATS_URL = "http://localhost:18001/stats"
MAXIMUM_TIME_SECONDS = 2 * 60
SLEEPING_INTERVAL_SECONDS = 1
STATUS_CODE_OK = 200
def is_initialised():
try:
response = urlopen(STATS_URL)
if (response.getcode()... | #!/usr/bin/env python3
import json
import sys
import time
from urllib.request import urlopen
STATS_URL = "http://localhost:18001/stats"
MAXIMUM_TIME_SECONDS = 2 * 60
SLEEPING_INTERVAL_SECONDS = 1
STATUS_CODE_OK = 200
def is_initialised():
try:
response = urlopen(STATS_URL)
if (response.getcode()... | <commit_before>#!/usr/bin/env python3
import json
import sys
import time
from urllib.request import urlopen
STATS_URL = "http://localhost:18001/stats"
MAXIMUM_TIME_SECONDS = 2 * 60
SLEEPING_INTERVAL_SECONDS = 1
STATUS_CODE_OK = 200
def is_initialised():
try:
response = urlopen(STATS_URL)
if (res... |
c1af56026da9669ff76908e4d89982b1c88fd30d | examples/custom_xmlrpc_client/server.py | examples/custom_xmlrpc_client/server.py | import random
import time
from SimpleXMLRPCServer import SimpleXMLRPCServer
def get_time():
time.sleep(random.random())
return time.time()
def get_random_number(low, high):
time.sleep(random.random())
return random.randint(low, high)
server = SimpleXMLRPCServer(("localhost", 8877))
print "Listening ... | import random
import time
from SimpleXMLRPCServer import SimpleXMLRPCServer
def get_time():
time.sleep(random.random())
return time.time()
def get_random_number(low, high):
time.sleep(random.random())
return random.randint(low, high)
server = SimpleXMLRPCServer(("localhost", 8877))
print("Listening ... | Use print() function in both Python 2 and Python 3 | Use print() function in both Python 2 and Python 3
Discovered via: __flake8 . --count --select=E9,F63,F72,F82 --show-source --statistics__
Legacy __print__ statements are syntax errors in Python 3 but __print()__ function works as expected in both Python 2 and Python 3. | Python | mit | locustio/locust,mbeacom/locust,mbeacom/locust,mbeacom/locust,locustio/locust,locustio/locust,heyman/locust,mbeacom/locust,locustio/locust | import random
import time
from SimpleXMLRPCServer import SimpleXMLRPCServer
def get_time():
time.sleep(random.random())
return time.time()
def get_random_number(low, high):
time.sleep(random.random())
return random.randint(low, high)
server = SimpleXMLRPCServer(("localhost", 8877))
print "Listening ... | import random
import time
from SimpleXMLRPCServer import SimpleXMLRPCServer
def get_time():
time.sleep(random.random())
return time.time()
def get_random_number(low, high):
time.sleep(random.random())
return random.randint(low, high)
server = SimpleXMLRPCServer(("localhost", 8877))
print("Listening ... | <commit_before>import random
import time
from SimpleXMLRPCServer import SimpleXMLRPCServer
def get_time():
time.sleep(random.random())
return time.time()
def get_random_number(low, high):
time.sleep(random.random())
return random.randint(low, high)
server = SimpleXMLRPCServer(("localhost", 8877))
pr... | import random
import time
from SimpleXMLRPCServer import SimpleXMLRPCServer
def get_time():
time.sleep(random.random())
return time.time()
def get_random_number(low, high):
time.sleep(random.random())
return random.randint(low, high)
server = SimpleXMLRPCServer(("localhost", 8877))
print("Listening ... | import random
import time
from SimpleXMLRPCServer import SimpleXMLRPCServer
def get_time():
time.sleep(random.random())
return time.time()
def get_random_number(low, high):
time.sleep(random.random())
return random.randint(low, high)
server = SimpleXMLRPCServer(("localhost", 8877))
print "Listening ... | <commit_before>import random
import time
from SimpleXMLRPCServer import SimpleXMLRPCServer
def get_time():
time.sleep(random.random())
return time.time()
def get_random_number(low, high):
time.sleep(random.random())
return random.randint(low, high)
server = SimpleXMLRPCServer(("localhost", 8877))
pr... |
d81dbd7b25cd44f730e979efe03eb6e5e1d87f1b | admin/commandRunner.py | admin/commandRunner.py | import configparser
import sys
import os
parser = configparser.ConfigParser()
parser.read("../halite.ini")
WORKERS = dict(parser.items("workerIPs"))
command = sys.argv[1]
print(command)
for name in WORKERS:
print("########"+name+"########")
print(WORKERS[name])
os.system("ssh root@"+WORKERS[name]+" '"+com... | import pymysql
import configparser
import sys
import os
import os.path
parser = configparser.ConfigParser()
parser.read("../halite.ini")
DB_CONFIG = parser["database"]
keyPath = os.path.join("../", parser["aws"]["keyfilepath"])
db = pymysql.connect(host=DB_CONFIG["hostname"], user=DB_CONFIG['username'], passwd=DB_CO... | Switch command runner to using db | Switch command runner to using db
| Python | mit | HaliteChallenge/Halite,HaliteChallenge/Halite,yangle/HaliteIO,HaliteChallenge/Halite,lanyudhy/Halite-II,lanyudhy/Halite-II,yangle/HaliteIO,yangle/HaliteIO,lanyudhy/Halite-II,yangle/HaliteIO,yangle/HaliteIO,HaliteChallenge/Halite,HaliteChallenge/Halite-II,lanyudhy/Halite-II,HaliteChallenge/Halite,lanyudhy/Halite-II,lany... | import configparser
import sys
import os
parser = configparser.ConfigParser()
parser.read("../halite.ini")
WORKERS = dict(parser.items("workerIPs"))
command = sys.argv[1]
print(command)
for name in WORKERS:
print("########"+name+"########")
print(WORKERS[name])
os.system("ssh root@"+WORKERS[name]+" '"+com... | import pymysql
import configparser
import sys
import os
import os.path
parser = configparser.ConfigParser()
parser.read("../halite.ini")
DB_CONFIG = parser["database"]
keyPath = os.path.join("../", parser["aws"]["keyfilepath"])
db = pymysql.connect(host=DB_CONFIG["hostname"], user=DB_CONFIG['username'], passwd=DB_CO... | <commit_before>import configparser
import sys
import os
parser = configparser.ConfigParser()
parser.read("../halite.ini")
WORKERS = dict(parser.items("workerIPs"))
command = sys.argv[1]
print(command)
for name in WORKERS:
print("########"+name+"########")
print(WORKERS[name])
os.system("ssh root@"+WORKERS... | import pymysql
import configparser
import sys
import os
import os.path
parser = configparser.ConfigParser()
parser.read("../halite.ini")
DB_CONFIG = parser["database"]
keyPath = os.path.join("../", parser["aws"]["keyfilepath"])
db = pymysql.connect(host=DB_CONFIG["hostname"], user=DB_CONFIG['username'], passwd=DB_CO... | import configparser
import sys
import os
parser = configparser.ConfigParser()
parser.read("../halite.ini")
WORKERS = dict(parser.items("workerIPs"))
command = sys.argv[1]
print(command)
for name in WORKERS:
print("########"+name+"########")
print(WORKERS[name])
os.system("ssh root@"+WORKERS[name]+" '"+com... | <commit_before>import configparser
import sys
import os
parser = configparser.ConfigParser()
parser.read("../halite.ini")
WORKERS = dict(parser.items("workerIPs"))
command = sys.argv[1]
print(command)
for name in WORKERS:
print("########"+name+"########")
print(WORKERS[name])
os.system("ssh root@"+WORKERS... |
cba8bd7d3440cc643823e93036bc3b9ac938a412 | pinboard_linkrot.py | pinboard_linkrot.py | #!/usr/bin/env python
from __future__ import division
import requests
import json
import sys
from requests.exceptions import SSLError, InvalidSchema, ConnectionError
def get_link_status_code(link):
headers = {'User-agent':'Mozilla/5.0'}
try:
r = requests.get(link, headers = headers)
return r.s... | #!/usr/bin/env python
from __future__ import division
import requests
import json
import sys
from requests.exceptions import SSLError, InvalidSchema, ConnectionError
def get_link_status_code(link):
headers = {'User-agent':'Mozilla/5.0'}
try:
r = requests.head(link, headers=headers, allow_redirects=Tru... | Switch to head requests rather than get requests. | Switch to head requests rather than get requests.
| Python | mit | edgauthier/pinboard_linkrot | #!/usr/bin/env python
from __future__ import division
import requests
import json
import sys
from requests.exceptions import SSLError, InvalidSchema, ConnectionError
def get_link_status_code(link):
headers = {'User-agent':'Mozilla/5.0'}
try:
r = requests.get(link, headers = headers)
return r.s... | #!/usr/bin/env python
from __future__ import division
import requests
import json
import sys
from requests.exceptions import SSLError, InvalidSchema, ConnectionError
def get_link_status_code(link):
headers = {'User-agent':'Mozilla/5.0'}
try:
r = requests.head(link, headers=headers, allow_redirects=Tru... | <commit_before>#!/usr/bin/env python
from __future__ import division
import requests
import json
import sys
from requests.exceptions import SSLError, InvalidSchema, ConnectionError
def get_link_status_code(link):
headers = {'User-agent':'Mozilla/5.0'}
try:
r = requests.get(link, headers = headers)
... | #!/usr/bin/env python
from __future__ import division
import requests
import json
import sys
from requests.exceptions import SSLError, InvalidSchema, ConnectionError
def get_link_status_code(link):
headers = {'User-agent':'Mozilla/5.0'}
try:
r = requests.head(link, headers=headers, allow_redirects=Tru... | #!/usr/bin/env python
from __future__ import division
import requests
import json
import sys
from requests.exceptions import SSLError, InvalidSchema, ConnectionError
def get_link_status_code(link):
headers = {'User-agent':'Mozilla/5.0'}
try:
r = requests.get(link, headers = headers)
return r.s... | <commit_before>#!/usr/bin/env python
from __future__ import division
import requests
import json
import sys
from requests.exceptions import SSLError, InvalidSchema, ConnectionError
def get_link_status_code(link):
headers = {'User-agent':'Mozilla/5.0'}
try:
r = requests.get(link, headers = headers)
... |
4efbc87a912b62db062da0c277baf2ea007e29e2 | feedthefox/users/models.py | feedthefox/users/models.py | from django.db import models
from django.contrib.auth.models import AbstractUser
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class User(AbstractUser):
"""Basic Mozillian user profile."""
ircname = models.CharField(max_length=50, default='', blank=True)
avata... | from django.db import models
from django.contrib.auth.models import AbstractUser
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class User(AbstractUser):
"""Basic Mozillian user profile."""
ircname = models.CharField(max_length=50, default='', blank=True)
avata... | Fix str method for custom User model. | Fix str method for custom User model.
| Python | mpl-2.0 | mozilla/feedthefox,akatsoulas/feedthefox,mozilla/feedthefox,akatsoulas/feedthefox,akatsoulas/feedthefox,akatsoulas/feedthefox,mozilla/feedthefox,mozilla/feedthefox | from django.db import models
from django.contrib.auth.models import AbstractUser
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class User(AbstractUser):
"""Basic Mozillian user profile."""
ircname = models.CharField(max_length=50, default='', blank=True)
avata... | from django.db import models
from django.contrib.auth.models import AbstractUser
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class User(AbstractUser):
"""Basic Mozillian user profile."""
ircname = models.CharField(max_length=50, default='', blank=True)
avata... | <commit_before>from django.db import models
from django.contrib.auth.models import AbstractUser
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class User(AbstractUser):
"""Basic Mozillian user profile."""
ircname = models.CharField(max_length=50, default='', blank=... | from django.db import models
from django.contrib.auth.models import AbstractUser
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class User(AbstractUser):
"""Basic Mozillian user profile."""
ircname = models.CharField(max_length=50, default='', blank=True)
avata... | from django.db import models
from django.contrib.auth.models import AbstractUser
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class User(AbstractUser):
"""Basic Mozillian user profile."""
ircname = models.CharField(max_length=50, default='', blank=True)
avata... | <commit_before>from django.db import models
from django.contrib.auth.models import AbstractUser
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class User(AbstractUser):
"""Basic Mozillian user profile."""
ircname = models.CharField(max_length=50, default='', blank=... |
91f107ef2ebdaf7ff210b9f36e2c810441f389e7 | services/rdio.py | services/rdio.py | from werkzeug.urls import url_decode
from oauthlib.oauth1.rfc5849 import SIGNATURE_TYPE_BODY
import foauth.providers
class Rdio(foauth.providers.OAuth1):
# General info about the provider
provider_url = 'http://www.rdio.com/'
docs_url = 'http://developer.rdio.com/docs/REST/'
category = 'Music'
#... | from werkzeug.urls import url_decode
import foauth.providers
class Rdio(foauth.providers.OAuth1):
# General info about the provider
provider_url = 'http://www.rdio.com/'
docs_url = 'http://developer.rdio.com/docs/REST/'
category = 'Music'
# URLs to interact with the API
request_token_url = '... | Allow Rdio to use default signature handling | Allow Rdio to use default signature handling
| Python | bsd-3-clause | foauth/oauth-proxy,foauth/foauth.org,foauth/foauth.org,foauth/foauth.org | from werkzeug.urls import url_decode
from oauthlib.oauth1.rfc5849 import SIGNATURE_TYPE_BODY
import foauth.providers
class Rdio(foauth.providers.OAuth1):
# General info about the provider
provider_url = 'http://www.rdio.com/'
docs_url = 'http://developer.rdio.com/docs/REST/'
category = 'Music'
#... | from werkzeug.urls import url_decode
import foauth.providers
class Rdio(foauth.providers.OAuth1):
# General info about the provider
provider_url = 'http://www.rdio.com/'
docs_url = 'http://developer.rdio.com/docs/REST/'
category = 'Music'
# URLs to interact with the API
request_token_url = '... | <commit_before>from werkzeug.urls import url_decode
from oauthlib.oauth1.rfc5849 import SIGNATURE_TYPE_BODY
import foauth.providers
class Rdio(foauth.providers.OAuth1):
# General info about the provider
provider_url = 'http://www.rdio.com/'
docs_url = 'http://developer.rdio.com/docs/REST/'
category =... | from werkzeug.urls import url_decode
import foauth.providers
class Rdio(foauth.providers.OAuth1):
# General info about the provider
provider_url = 'http://www.rdio.com/'
docs_url = 'http://developer.rdio.com/docs/REST/'
category = 'Music'
# URLs to interact with the API
request_token_url = '... | from werkzeug.urls import url_decode
from oauthlib.oauth1.rfc5849 import SIGNATURE_TYPE_BODY
import foauth.providers
class Rdio(foauth.providers.OAuth1):
# General info about the provider
provider_url = 'http://www.rdio.com/'
docs_url = 'http://developer.rdio.com/docs/REST/'
category = 'Music'
#... | <commit_before>from werkzeug.urls import url_decode
from oauthlib.oauth1.rfc5849 import SIGNATURE_TYPE_BODY
import foauth.providers
class Rdio(foauth.providers.OAuth1):
# General info about the provider
provider_url = 'http://www.rdio.com/'
docs_url = 'http://developer.rdio.com/docs/REST/'
category =... |
7dcda004fb2cc61b075e7ef67c8c33ebfd70786c | bashhub/view/status.py | bashhub/view/status.py | import dateutil.parser
import datetime
import humanize
status_view ="""\
=== Bashhub Status
http://bashhub.com/u/{0}
Total Commands: {1}
Total Sessions: {2}
Total Systems: {3}
===
Session PID {4} Started {5}
Commands In Session: {6}
Commands Today: {7}
"""
def build_status_view(model):
date = datetime.datetime.f... | import dateutil.parser
import datetime
import humanize
status_view ="""\
=== Bashhub Status
https://bashhub.com/u/{0}
Total Commands: {1}
Total Sessions: {2}
Total Systems: {3}
===
Session PID {4} Started {5}
Commands In Session: {6}
Commands Today: {7}
"""
def build_status_view(model):
date = datetime.datetime.... | Change http url to https | Change http url to https
| Python | apache-2.0 | rcaloras/bashhub-client,rcaloras/bashhub-client | import dateutil.parser
import datetime
import humanize
status_view ="""\
=== Bashhub Status
http://bashhub.com/u/{0}
Total Commands: {1}
Total Sessions: {2}
Total Systems: {3}
===
Session PID {4} Started {5}
Commands In Session: {6}
Commands Today: {7}
"""
def build_status_view(model):
date = datetime.datetime.f... | import dateutil.parser
import datetime
import humanize
status_view ="""\
=== Bashhub Status
https://bashhub.com/u/{0}
Total Commands: {1}
Total Sessions: {2}
Total Systems: {3}
===
Session PID {4} Started {5}
Commands In Session: {6}
Commands Today: {7}
"""
def build_status_view(model):
date = datetime.datetime.... | <commit_before>import dateutil.parser
import datetime
import humanize
status_view ="""\
=== Bashhub Status
http://bashhub.com/u/{0}
Total Commands: {1}
Total Sessions: {2}
Total Systems: {3}
===
Session PID {4} Started {5}
Commands In Session: {6}
Commands Today: {7}
"""
def build_status_view(model):
date = date... | import dateutil.parser
import datetime
import humanize
status_view ="""\
=== Bashhub Status
https://bashhub.com/u/{0}
Total Commands: {1}
Total Sessions: {2}
Total Systems: {3}
===
Session PID {4} Started {5}
Commands In Session: {6}
Commands Today: {7}
"""
def build_status_view(model):
date = datetime.datetime.... | import dateutil.parser
import datetime
import humanize
status_view ="""\
=== Bashhub Status
http://bashhub.com/u/{0}
Total Commands: {1}
Total Sessions: {2}
Total Systems: {3}
===
Session PID {4} Started {5}
Commands In Session: {6}
Commands Today: {7}
"""
def build_status_view(model):
date = datetime.datetime.f... | <commit_before>import dateutil.parser
import datetime
import humanize
status_view ="""\
=== Bashhub Status
http://bashhub.com/u/{0}
Total Commands: {1}
Total Sessions: {2}
Total Systems: {3}
===
Session PID {4} Started {5}
Commands In Session: {6}
Commands Today: {7}
"""
def build_status_view(model):
date = date... |
7959c38d82090db6a66c7d81a4adba089c9a884f | brains/orders/views.py | brains/orders/views.py | import math
from django.shortcuts import render
from django.template import RequestContext
from django.http import HttpResponseRedirect
from orders.models import Order
def index(request, x, y):
if request.META['HTTP_REFERER'] not in ('http://www.urbandead.com/map.cgi', 'http://urbandead.com/map.cgi'):
ret... | import math
from django.shortcuts import render
from django.template import RequestContext
from django.http import HttpResponseRedirect
from orders.models import Order
def index(request, x, y):
if request.META.get('HTTP_REFERER', None) not in ('http://www.urbandead.com/map.cgi', 'http://urbandead.com/map.cgi'):
... | Test things first you big dummy | Test things first you big dummy
| Python | bsd-3-clause | crisisking/udbraaains,crisisking/udbraaains,crisisking/udbraaains,crisisking/udbraaains | import math
from django.shortcuts import render
from django.template import RequestContext
from django.http import HttpResponseRedirect
from orders.models import Order
def index(request, x, y):
if request.META['HTTP_REFERER'] not in ('http://www.urbandead.com/map.cgi', 'http://urbandead.com/map.cgi'):
ret... | import math
from django.shortcuts import render
from django.template import RequestContext
from django.http import HttpResponseRedirect
from orders.models import Order
def index(request, x, y):
if request.META.get('HTTP_REFERER', None) not in ('http://www.urbandead.com/map.cgi', 'http://urbandead.com/map.cgi'):
... | <commit_before>import math
from django.shortcuts import render
from django.template import RequestContext
from django.http import HttpResponseRedirect
from orders.models import Order
def index(request, x, y):
if request.META['HTTP_REFERER'] not in ('http://www.urbandead.com/map.cgi', 'http://urbandead.com/map.cgi... | import math
from django.shortcuts import render
from django.template import RequestContext
from django.http import HttpResponseRedirect
from orders.models import Order
def index(request, x, y):
if request.META.get('HTTP_REFERER', None) not in ('http://www.urbandead.com/map.cgi', 'http://urbandead.com/map.cgi'):
... | import math
from django.shortcuts import render
from django.template import RequestContext
from django.http import HttpResponseRedirect
from orders.models import Order
def index(request, x, y):
if request.META['HTTP_REFERER'] not in ('http://www.urbandead.com/map.cgi', 'http://urbandead.com/map.cgi'):
ret... | <commit_before>import math
from django.shortcuts import render
from django.template import RequestContext
from django.http import HttpResponseRedirect
from orders.models import Order
def index(request, x, y):
if request.META['HTTP_REFERER'] not in ('http://www.urbandead.com/map.cgi', 'http://urbandead.com/map.cgi... |
81489c115704c5df83ef7607121c8c20ab2ab2b0 | packages/mono-llvm.py | packages/mono-llvm.py | GitHubTarballPackage ('mono', 'llvm', '3.0', '292aa8712c3120b03f9aa1d201b2e7949adf35c3',
configure = './configure --prefix="%{prefix}" --enable-optimized --enable-targets="x86 x86_64" --target=i386-apple-darwin10.8.0',
override_properties = { 'make': 'make' }
)
| GitHubTarballPackage ('mono', 'llvm', '3.0', '292aa8712c3120b03f9aa1d201b2e7949adf35c3',
configure = './configure --prefix="%{prefix}" --enable-optimized --enable-targets="x86 x86_64" --build=i386-apple-darwin10.8.0',
override_properties = { 'make': 'make' }
)
| Set --build instead of --target. | Set --build instead of --target.
| Python | mit | mono/bockbuild,BansheeMediaPlayer/bockbuild,BansheeMediaPlayer/bockbuild,mono/bockbuild,BansheeMediaPlayer/bockbuild | GitHubTarballPackage ('mono', 'llvm', '3.0', '292aa8712c3120b03f9aa1d201b2e7949adf35c3',
configure = './configure --prefix="%{prefix}" --enable-optimized --enable-targets="x86 x86_64" --target=i386-apple-darwin10.8.0',
override_properties = { 'make': 'make' }
)
Set --build instead of --target. | GitHubTarballPackage ('mono', 'llvm', '3.0', '292aa8712c3120b03f9aa1d201b2e7949adf35c3',
configure = './configure --prefix="%{prefix}" --enable-optimized --enable-targets="x86 x86_64" --build=i386-apple-darwin10.8.0',
override_properties = { 'make': 'make' }
)
| <commit_before>GitHubTarballPackage ('mono', 'llvm', '3.0', '292aa8712c3120b03f9aa1d201b2e7949adf35c3',
configure = './configure --prefix="%{prefix}" --enable-optimized --enable-targets="x86 x86_64" --target=i386-apple-darwin10.8.0',
override_properties = { 'make': 'make' }
)
<commit_msg>Set --build instead of --targ... | GitHubTarballPackage ('mono', 'llvm', '3.0', '292aa8712c3120b03f9aa1d201b2e7949adf35c3',
configure = './configure --prefix="%{prefix}" --enable-optimized --enable-targets="x86 x86_64" --build=i386-apple-darwin10.8.0',
override_properties = { 'make': 'make' }
)
| GitHubTarballPackage ('mono', 'llvm', '3.0', '292aa8712c3120b03f9aa1d201b2e7949adf35c3',
configure = './configure --prefix="%{prefix}" --enable-optimized --enable-targets="x86 x86_64" --target=i386-apple-darwin10.8.0',
override_properties = { 'make': 'make' }
)
Set --build instead of --target.GitHubTarballPackage ('m... | <commit_before>GitHubTarballPackage ('mono', 'llvm', '3.0', '292aa8712c3120b03f9aa1d201b2e7949adf35c3',
configure = './configure --prefix="%{prefix}" --enable-optimized --enable-targets="x86 x86_64" --target=i386-apple-darwin10.8.0',
override_properties = { 'make': 'make' }
)
<commit_msg>Set --build instead of --targ... |
9a7c84cab0931f2998af990200c4412f23cc2034 | scripts/run_unit_test.py | scripts/run_unit_test.py | #!/usr/bin/env python
import serial
import os
# Make and flash the unit test
FILE_LOCATION = os.path.dirname(os.path.abspath(__file__))
os.system("cd " + FILE_LOCATION + " ../")
print os.system("make flash_unit_test")
# Ask the user to reset the board
raw_input("\nPlease press the phsyical reset button on the STM32... | #!/usr/bin/env python
import serial
import os
# Make and flash the unit test
FILE_LOCATION = os.path.dirname(os.path.abspath(__file__))
os.chdir(FILE_LOCATION + "/../")
print os.system("make flash_unit_test")
# Ask the user to reset the board
raw_input("\nPlease press the phsyical reset button on the STM32F4Discove... | Add ability to run unit test script from anywhere | UNIT_TEST: Add ability to run unit test script from anywhere
| Python | mit | fnivek/Pop-a-Gator,fnivek/Pop-a-Gator,fnivek/Pop-a-Gator | #!/usr/bin/env python
import serial
import os
# Make and flash the unit test
FILE_LOCATION = os.path.dirname(os.path.abspath(__file__))
os.system("cd " + FILE_LOCATION + " ../")
print os.system("make flash_unit_test")
# Ask the user to reset the board
raw_input("\nPlease press the phsyical reset button on the STM32... | #!/usr/bin/env python
import serial
import os
# Make and flash the unit test
FILE_LOCATION = os.path.dirname(os.path.abspath(__file__))
os.chdir(FILE_LOCATION + "/../")
print os.system("make flash_unit_test")
# Ask the user to reset the board
raw_input("\nPlease press the phsyical reset button on the STM32F4Discove... | <commit_before>#!/usr/bin/env python
import serial
import os
# Make and flash the unit test
FILE_LOCATION = os.path.dirname(os.path.abspath(__file__))
os.system("cd " + FILE_LOCATION + " ../")
print os.system("make flash_unit_test")
# Ask the user to reset the board
raw_input("\nPlease press the phsyical reset butt... | #!/usr/bin/env python
import serial
import os
# Make and flash the unit test
FILE_LOCATION = os.path.dirname(os.path.abspath(__file__))
os.chdir(FILE_LOCATION + "/../")
print os.system("make flash_unit_test")
# Ask the user to reset the board
raw_input("\nPlease press the phsyical reset button on the STM32F4Discove... | #!/usr/bin/env python
import serial
import os
# Make and flash the unit test
FILE_LOCATION = os.path.dirname(os.path.abspath(__file__))
os.system("cd " + FILE_LOCATION + " ../")
print os.system("make flash_unit_test")
# Ask the user to reset the board
raw_input("\nPlease press the phsyical reset button on the STM32... | <commit_before>#!/usr/bin/env python
import serial
import os
# Make and flash the unit test
FILE_LOCATION = os.path.dirname(os.path.abspath(__file__))
os.system("cd " + FILE_LOCATION + " ../")
print os.system("make flash_unit_test")
# Ask the user to reset the board
raw_input("\nPlease press the phsyical reset butt... |
e2c3c9f50f3bdb537ef863d7cff80d4fd5e27911 | test/test_api.py | test/test_api.py | import unittest
import sys
import appdirs
if sys.version_info[0] < 3:
STRING_TYPE = basestring
else:
STRING_TYPE = str
class Test_AppDir(unittest.TestCase):
def test_metadata(self):
self.assertTrue(hasattr(appdirs, "__version__"))
self.assertTrue(hasattr(appdirs, "__version_info__"))
... | import sys
import appdirs
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
if sys.version_info[0] < 3:
STRING_TYPE = basestring
else:
STRING_TYPE = str
class Test_AppDir(unittest.TestCase):
def test_metadata(self):
self.assertTrue(hasattr(appdirs, "__versi... | Use unittest2 for Python < 2.7. | Use unittest2 for Python < 2.7.
| Python | mit | platformdirs/platformdirs | import unittest
import sys
import appdirs
if sys.version_info[0] < 3:
STRING_TYPE = basestring
else:
STRING_TYPE = str
class Test_AppDir(unittest.TestCase):
def test_metadata(self):
self.assertTrue(hasattr(appdirs, "__version__"))
self.assertTrue(hasattr(appdirs, "__version_info__"))
... | import sys
import appdirs
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
if sys.version_info[0] < 3:
STRING_TYPE = basestring
else:
STRING_TYPE = str
class Test_AppDir(unittest.TestCase):
def test_metadata(self):
self.assertTrue(hasattr(appdirs, "__versi... | <commit_before>import unittest
import sys
import appdirs
if sys.version_info[0] < 3:
STRING_TYPE = basestring
else:
STRING_TYPE = str
class Test_AppDir(unittest.TestCase):
def test_metadata(self):
self.assertTrue(hasattr(appdirs, "__version__"))
self.assertTrue(hasattr(appdirs, "__version... | import sys
import appdirs
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
if sys.version_info[0] < 3:
STRING_TYPE = basestring
else:
STRING_TYPE = str
class Test_AppDir(unittest.TestCase):
def test_metadata(self):
self.assertTrue(hasattr(appdirs, "__versi... | import unittest
import sys
import appdirs
if sys.version_info[0] < 3:
STRING_TYPE = basestring
else:
STRING_TYPE = str
class Test_AppDir(unittest.TestCase):
def test_metadata(self):
self.assertTrue(hasattr(appdirs, "__version__"))
self.assertTrue(hasattr(appdirs, "__version_info__"))
... | <commit_before>import unittest
import sys
import appdirs
if sys.version_info[0] < 3:
STRING_TYPE = basestring
else:
STRING_TYPE = str
class Test_AppDir(unittest.TestCase):
def test_metadata(self):
self.assertTrue(hasattr(appdirs, "__version__"))
self.assertTrue(hasattr(appdirs, "__version... |
53fa37b1e8a97c214a0a3c1f95be53dbe4d3d442 | comics/comics/wumovg.py | comics/comics/wumovg.py | from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = 'Wulffmorgenthaler (vg.no)'
language = 'no'
url = 'http://heltnormalt.no/wumo'
rights = 'Mikael Wulff & Anders Morgenthaler'
class Crawler(CrawlerBa... | from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = 'Wumo (vg.no)'
language = 'no'
url = 'http://heltnormalt.no/wumo'
rights = 'Mikael Wulff & Anders Morgenthaler'
class Crawler(CrawlerBase):
hist... | Update title of 'Wumo' crawlers, part two | Update title of 'Wumo' crawlers, part two
| Python | agpl-3.0 | jodal/comics,datagutten/comics,jodal/comics,jodal/comics,datagutten/comics,datagutten/comics,jodal/comics,datagutten/comics | from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = 'Wulffmorgenthaler (vg.no)'
language = 'no'
url = 'http://heltnormalt.no/wumo'
rights = 'Mikael Wulff & Anders Morgenthaler'
class Crawler(CrawlerBa... | from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = 'Wumo (vg.no)'
language = 'no'
url = 'http://heltnormalt.no/wumo'
rights = 'Mikael Wulff & Anders Morgenthaler'
class Crawler(CrawlerBase):
hist... | <commit_before>from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = 'Wulffmorgenthaler (vg.no)'
language = 'no'
url = 'http://heltnormalt.no/wumo'
rights = 'Mikael Wulff & Anders Morgenthaler'
class Cr... | from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = 'Wumo (vg.no)'
language = 'no'
url = 'http://heltnormalt.no/wumo'
rights = 'Mikael Wulff & Anders Morgenthaler'
class Crawler(CrawlerBase):
hist... | from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = 'Wulffmorgenthaler (vg.no)'
language = 'no'
url = 'http://heltnormalt.no/wumo'
rights = 'Mikael Wulff & Anders Morgenthaler'
class Crawler(CrawlerBa... | <commit_before>from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = 'Wulffmorgenthaler (vg.no)'
language = 'no'
url = 'http://heltnormalt.no/wumo'
rights = 'Mikael Wulff & Anders Morgenthaler'
class Cr... |
534066b1228bb0070c1d62445155afa696a37921 | contrail_provisioning/config/templates/contrail_plugin_ini.py | contrail_provisioning/config/templates/contrail_plugin_ini.py | import string
template = string.Template("""
[APISERVER]
api_server_ip = $__contrail_api_server_ip__
api_server_port = $__contrail_api_server_port__
multi_tenancy = $__contrail_multi_tenancy__
#use_ssl = False
#insecure = False
#certfile=$__contrail_api_server_cert_file__
#keyfile=$__contrail_api_server_key_file__
#ca... | import string
template = string.Template("""
[APISERVER]
api_server_ip = $__contrail_api_server_ip__
api_server_port = $__contrail_api_server_port__
multi_tenancy = $__contrail_multi_tenancy__
#use_ssl = False
#insecure = False
#certfile=$__contrail_api_server_cert_file__
#keyfile=$__contrail_api_server_key_file__
#ca... | Enable service-interface and vf-binding extensions by default in contrail based provisioning. | Enable service-interface and vf-binding extensions by default in
contrail based provisioning.
Change-Id: I5916f41cdf12ad54e74c0f76de244ed60f57aea5
Partial-Bug: 1556336
| Python | apache-2.0 | Juniper/contrail-provisioning,Juniper/contrail-provisioning | import string
template = string.Template("""
[APISERVER]
api_server_ip = $__contrail_api_server_ip__
api_server_port = $__contrail_api_server_port__
multi_tenancy = $__contrail_multi_tenancy__
#use_ssl = False
#insecure = False
#certfile=$__contrail_api_server_cert_file__
#keyfile=$__contrail_api_server_key_file__
#ca... | import string
template = string.Template("""
[APISERVER]
api_server_ip = $__contrail_api_server_ip__
api_server_port = $__contrail_api_server_port__
multi_tenancy = $__contrail_multi_tenancy__
#use_ssl = False
#insecure = False
#certfile=$__contrail_api_server_cert_file__
#keyfile=$__contrail_api_server_key_file__
#ca... | <commit_before>import string
template = string.Template("""
[APISERVER]
api_server_ip = $__contrail_api_server_ip__
api_server_port = $__contrail_api_server_port__
multi_tenancy = $__contrail_multi_tenancy__
#use_ssl = False
#insecure = False
#certfile=$__contrail_api_server_cert_file__
#keyfile=$__contrail_api_server... | import string
template = string.Template("""
[APISERVER]
api_server_ip = $__contrail_api_server_ip__
api_server_port = $__contrail_api_server_port__
multi_tenancy = $__contrail_multi_tenancy__
#use_ssl = False
#insecure = False
#certfile=$__contrail_api_server_cert_file__
#keyfile=$__contrail_api_server_key_file__
#ca... | import string
template = string.Template("""
[APISERVER]
api_server_ip = $__contrail_api_server_ip__
api_server_port = $__contrail_api_server_port__
multi_tenancy = $__contrail_multi_tenancy__
#use_ssl = False
#insecure = False
#certfile=$__contrail_api_server_cert_file__
#keyfile=$__contrail_api_server_key_file__
#ca... | <commit_before>import string
template = string.Template("""
[APISERVER]
api_server_ip = $__contrail_api_server_ip__
api_server_port = $__contrail_api_server_port__
multi_tenancy = $__contrail_multi_tenancy__
#use_ssl = False
#insecure = False
#certfile=$__contrail_api_server_cert_file__
#keyfile=$__contrail_api_server... |
eb987c4ca71ec53db46c0a8afa4265f70671330d | geotrek/settings/env_tests.py | geotrek/settings/env_tests.py | #
# Django Tests
# ..........................
TEST = True
CELERY_ALWAYS_EAGER = True
TEST_EXCLUDE = ('django',)
INSTALLED_APPS += (
'geotrek.diving',
'geotrek.sensitivity',
'geotrek.outdoor',
)
LOGGING['handlers']['console']['level'] = 'CRITICAL'
LANGUAGE_CODE = 'en'
MODELTRANSLATION_DEFAULT_LANGUAGE... | #
# Django Tests
# ..........................
TEST = True
CELERY_ALWAYS_EAGER = True
TEST_EXCLUDE = ('django',)
INSTALLED_APPS += (
'geotrek.diving',
'geotrek.sensitivity',
'geotrek.outdoor',
'drf_yasg',
)
LOGGING['handlers']['console']['level'] = 'CRITICAL'
LANGUAGE_CODE = 'en'
MODELTRANSLATION_... | Enable drf_yasg in test settings | Enable drf_yasg in test settings
| Python | bsd-2-clause | GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,makinacorpus/Geotrek | #
# Django Tests
# ..........................
TEST = True
CELERY_ALWAYS_EAGER = True
TEST_EXCLUDE = ('django',)
INSTALLED_APPS += (
'geotrek.diving',
'geotrek.sensitivity',
'geotrek.outdoor',
)
LOGGING['handlers']['console']['level'] = 'CRITICAL'
LANGUAGE_CODE = 'en'
MODELTRANSLATION_DEFAULT_LANGUAGE... | #
# Django Tests
# ..........................
TEST = True
CELERY_ALWAYS_EAGER = True
TEST_EXCLUDE = ('django',)
INSTALLED_APPS += (
'geotrek.diving',
'geotrek.sensitivity',
'geotrek.outdoor',
'drf_yasg',
)
LOGGING['handlers']['console']['level'] = 'CRITICAL'
LANGUAGE_CODE = 'en'
MODELTRANSLATION_... | <commit_before>#
# Django Tests
# ..........................
TEST = True
CELERY_ALWAYS_EAGER = True
TEST_EXCLUDE = ('django',)
INSTALLED_APPS += (
'geotrek.diving',
'geotrek.sensitivity',
'geotrek.outdoor',
)
LOGGING['handlers']['console']['level'] = 'CRITICAL'
LANGUAGE_CODE = 'en'
MODELTRANSLATION_D... | #
# Django Tests
# ..........................
TEST = True
CELERY_ALWAYS_EAGER = True
TEST_EXCLUDE = ('django',)
INSTALLED_APPS += (
'geotrek.diving',
'geotrek.sensitivity',
'geotrek.outdoor',
'drf_yasg',
)
LOGGING['handlers']['console']['level'] = 'CRITICAL'
LANGUAGE_CODE = 'en'
MODELTRANSLATION_... | #
# Django Tests
# ..........................
TEST = True
CELERY_ALWAYS_EAGER = True
TEST_EXCLUDE = ('django',)
INSTALLED_APPS += (
'geotrek.diving',
'geotrek.sensitivity',
'geotrek.outdoor',
)
LOGGING['handlers']['console']['level'] = 'CRITICAL'
LANGUAGE_CODE = 'en'
MODELTRANSLATION_DEFAULT_LANGUAGE... | <commit_before>#
# Django Tests
# ..........................
TEST = True
CELERY_ALWAYS_EAGER = True
TEST_EXCLUDE = ('django',)
INSTALLED_APPS += (
'geotrek.diving',
'geotrek.sensitivity',
'geotrek.outdoor',
)
LOGGING['handlers']['console']['level'] = 'CRITICAL'
LANGUAGE_CODE = 'en'
MODELTRANSLATION_D... |
456de4b1184780b9179ee9e6572a3f62cf22550a | tests/test_tools/simple_project.py | tests/test_tools/simple_project.py | project_1_yaml = {
'common': {
'sources': ['sources/main.cpp'],
'includes': ['includes/header1.h'],
'target': ['mbed-lpc1768']
}
}
projects_1_yaml = {
'projects': {
'project_1' : ['test_workspace/project_1.yaml']
},
}
| project_1_yaml = {
'common': {
'sources': ['sources/main.cpp'],
'includes': ['includes/header1.h'],
'target': ['mbed-lpc1768'],
'linker_file': ['linker_script'],
}
}
projects_1_yaml = {
'projects': {
'project_1' : ['test_workspace/project_1.yaml']
},
}
| Test - add linker script for tools project | Test - add linker script for tools project
| Python | apache-2.0 | molejar/project_generator,hwfwgrp/project_generator,0xc0170/project_generator,sarahmarshy/project_generator,ohagendorf/project_generator,project-generator/project_generator | project_1_yaml = {
'common': {
'sources': ['sources/main.cpp'],
'includes': ['includes/header1.h'],
'target': ['mbed-lpc1768']
}
}
projects_1_yaml = {
'projects': {
'project_1' : ['test_workspace/project_1.yaml']
},
}
Test - add linker script for tools project | project_1_yaml = {
'common': {
'sources': ['sources/main.cpp'],
'includes': ['includes/header1.h'],
'target': ['mbed-lpc1768'],
'linker_file': ['linker_script'],
}
}
projects_1_yaml = {
'projects': {
'project_1' : ['test_workspace/project_1.yaml']
},
}
| <commit_before>project_1_yaml = {
'common': {
'sources': ['sources/main.cpp'],
'includes': ['includes/header1.h'],
'target': ['mbed-lpc1768']
}
}
projects_1_yaml = {
'projects': {
'project_1' : ['test_workspace/project_1.yaml']
},
}
<commit_msg>Test - add linker script f... | project_1_yaml = {
'common': {
'sources': ['sources/main.cpp'],
'includes': ['includes/header1.h'],
'target': ['mbed-lpc1768'],
'linker_file': ['linker_script'],
}
}
projects_1_yaml = {
'projects': {
'project_1' : ['test_workspace/project_1.yaml']
},
}
| project_1_yaml = {
'common': {
'sources': ['sources/main.cpp'],
'includes': ['includes/header1.h'],
'target': ['mbed-lpc1768']
}
}
projects_1_yaml = {
'projects': {
'project_1' : ['test_workspace/project_1.yaml']
},
}
Test - add linker script for tools projectproject_1_y... | <commit_before>project_1_yaml = {
'common': {
'sources': ['sources/main.cpp'],
'includes': ['includes/header1.h'],
'target': ['mbed-lpc1768']
}
}
projects_1_yaml = {
'projects': {
'project_1' : ['test_workspace/project_1.yaml']
},
}
<commit_msg>Test - add linker script f... |
eca27464cc2c23a84e56e1d432a080ca663d04fb | src/dicomweb_client/__init__.py | src/dicomweb_client/__init__.py | __version__ = '0.9.1'
from dicomweb_client.api import DICOMwebClient
| __version__ = '0.9.2'
from dicomweb_client.api import DICOMwebClient
| Increase version to 0.9.2 for release | Increase version to 0.9.2 for release
| Python | mit | MGHComputationalPathology/dicomweb-client | __version__ = '0.9.1'
from dicomweb_client.api import DICOMwebClient
Increase version to 0.9.2 for release | __version__ = '0.9.2'
from dicomweb_client.api import DICOMwebClient
| <commit_before>__version__ = '0.9.1'
from dicomweb_client.api import DICOMwebClient
<commit_msg>Increase version to 0.9.2 for release<commit_after> | __version__ = '0.9.2'
from dicomweb_client.api import DICOMwebClient
| __version__ = '0.9.1'
from dicomweb_client.api import DICOMwebClient
Increase version to 0.9.2 for release__version__ = '0.9.2'
from dicomweb_client.api import DICOMwebClient
| <commit_before>__version__ = '0.9.1'
from dicomweb_client.api import DICOMwebClient
<commit_msg>Increase version to 0.9.2 for release<commit_after>__version__ = '0.9.2'
from dicomweb_client.api import DICOMwebClient
|
47aeeaad68ea0c9246ec68b7a49f385a4b7fe9cf | socketio/policyserver.py | socketio/policyserver.py | from gevent.server import StreamServer
__all__ = ['FlashPolicyServer']
class FlashPolicyServer(StreamServer):
policy = """<?xml version="1.0"?><!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy><allow-access-from domain="*" to-ports="*"/></cros... | from gevent.server import StreamServer
__all__ = ['FlashPolicyServer']
class FlashPolicyServer(StreamServer):
policy = """<?xml version="1.0"?><!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy><allow-access-from domain="*" to-ports="*"/></cros... | Fix to make sure we dont get errors in gevent socket write call when we are writing the policy file back | Fix to make sure we dont get errors in gevent socket write call when we are writing the policy file back
Conflicts:
socketio/policyserver.py
| Python | bsd-3-clause | abourget/gevent-socketio,arnuschky/gevent-socketio,bobvandevijver/gevent-socketio,Eugeny/gevent-socketio,hzruandd/gevent-socketio,gutomaia/gevent-socketio,gutomaia/gevent-socketio,yacneyac/gevent-socketio,smurfix/gevent-socketio,gutomaia/gevent-socketio,smurfix/gevent-socketio,Eugeny/gevent-socketio,kazmiruk/gevent-soc... | from gevent.server import StreamServer
__all__ = ['FlashPolicyServer']
class FlashPolicyServer(StreamServer):
policy = """<?xml version="1.0"?><!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy><allow-access-from domain="*" to-ports="*"/></cros... | from gevent.server import StreamServer
__all__ = ['FlashPolicyServer']
class FlashPolicyServer(StreamServer):
policy = """<?xml version="1.0"?><!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy><allow-access-from domain="*" to-ports="*"/></cros... | <commit_before>from gevent.server import StreamServer
__all__ = ['FlashPolicyServer']
class FlashPolicyServer(StreamServer):
policy = """<?xml version="1.0"?><!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy><allow-access-from domain="*" to-po... | from gevent.server import StreamServer
__all__ = ['FlashPolicyServer']
class FlashPolicyServer(StreamServer):
policy = """<?xml version="1.0"?><!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy><allow-access-from domain="*" to-ports="*"/></cros... | from gevent.server import StreamServer
__all__ = ['FlashPolicyServer']
class FlashPolicyServer(StreamServer):
policy = """<?xml version="1.0"?><!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy><allow-access-from domain="*" to-ports="*"/></cros... | <commit_before>from gevent.server import StreamServer
__all__ = ['FlashPolicyServer']
class FlashPolicyServer(StreamServer):
policy = """<?xml version="1.0"?><!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy><allow-access-from domain="*" to-po... |
fc04d8f2629e5fef10cf62749e7c91e6b7d2d557 | cms/djangoapps/contentstore/views/session_kv_store.py | cms/djangoapps/contentstore/views/session_kv_store.py | """
An :class:`~xblock.runtime.KeyValueStore` that stores data in the django session
"""
from __future__ import absolute_import
from xblock.runtime import KeyValueStore
class SessionKeyValueStore(KeyValueStore):
def __init__(self, request):
self._session = request.session
def get(self, key):
... | """
An :class:`~xblock.runtime.KeyValueStore` that stores data in the django session
"""
from __future__ import absolute_import
from xblock.runtime import KeyValueStore
def stringify(key):
return repr(tuple(key))
class SessionKeyValueStore(KeyValueStore):
def __init__(self, request):
self._session ... | Use strings instead of tuples as keys in SessionKeyValueStore | Use strings instead of tuples as keys in SessionKeyValueStore
Some Django packages expect only strings as keys in the user session,
and it is also a recommended practice in the Django manual.
| Python | agpl-3.0 | ESOedX/edx-platform,B-MOOC/edx-platform,jswope00/griffinx,openfun/edx-platform,MakeHer/edx-platform,benpatterson/edx-platform,stvstnfrd/edx-platform,AkA84/edx-platform,Softmotions/edx-platform,IONISx/edx-platform,kmoocdev2/edx-platform,nanolearningllc/edx-platform-cypress,unicri/edx-platform,romain-li/edx-platform,xinj... | """
An :class:`~xblock.runtime.KeyValueStore` that stores data in the django session
"""
from __future__ import absolute_import
from xblock.runtime import KeyValueStore
class SessionKeyValueStore(KeyValueStore):
def __init__(self, request):
self._session = request.session
def get(self, key):
... | """
An :class:`~xblock.runtime.KeyValueStore` that stores data in the django session
"""
from __future__ import absolute_import
from xblock.runtime import KeyValueStore
def stringify(key):
return repr(tuple(key))
class SessionKeyValueStore(KeyValueStore):
def __init__(self, request):
self._session ... | <commit_before>"""
An :class:`~xblock.runtime.KeyValueStore` that stores data in the django session
"""
from __future__ import absolute_import
from xblock.runtime import KeyValueStore
class SessionKeyValueStore(KeyValueStore):
def __init__(self, request):
self._session = request.session
def get(self,... | """
An :class:`~xblock.runtime.KeyValueStore` that stores data in the django session
"""
from __future__ import absolute_import
from xblock.runtime import KeyValueStore
def stringify(key):
return repr(tuple(key))
class SessionKeyValueStore(KeyValueStore):
def __init__(self, request):
self._session ... | """
An :class:`~xblock.runtime.KeyValueStore` that stores data in the django session
"""
from __future__ import absolute_import
from xblock.runtime import KeyValueStore
class SessionKeyValueStore(KeyValueStore):
def __init__(self, request):
self._session = request.session
def get(self, key):
... | <commit_before>"""
An :class:`~xblock.runtime.KeyValueStore` that stores data in the django session
"""
from __future__ import absolute_import
from xblock.runtime import KeyValueStore
class SessionKeyValueStore(KeyValueStore):
def __init__(self, request):
self._session = request.session
def get(self,... |
5eb3f2c61c2b61e1bad7faa006e5503bd9a20edf | uni_form/util.py | uni_form/util.py | from django import forms
from django.forms.widgets import Input
class SubmitButtonWidget(Input):
"""
A widget that handles a submit button.
"""
input_type = 'submit'
def render(self, name, value, attrs=None):
return super(SubmitButtonWidget, self).render(name,
self.attrs['value... | class BaseInput(object):
"""
An base Input class to reduce the amount of code in the Input classes.
"""
def __init__(self,name,value):
self.name = name
self.value = value
class Toggle(object):
"""
A container for holder toggled items such as fields and butt... | Revert "Made BaseInput inherit from forms.Field so inputs can be used in layouts. Added a SubmitButtonWidget." | Revert "Made BaseInput inherit from forms.Field so inputs can be used in layouts. Added a SubmitButtonWidget."
This reverts commit aa571b2e1fd177491895cc263b192467431b90c2.
| Python | mit | HungryCloud/django-crispy-forms,spectras/django-crispy-forms,iris-edu-int/django-crispy-forms,scuml/django-crispy-forms,ngenovictor/django-crispy-forms,CashStar/django-uni-form,PetrDlouhy/django-crispy-forms,RamezIssac/django-crispy-forms,jcomeauictx/django-crispy-forms,tarunlnmiit/django-crispy-forms,CashStar/django-u... | from django import forms
from django.forms.widgets import Input
class SubmitButtonWidget(Input):
"""
A widget that handles a submit button.
"""
input_type = 'submit'
def render(self, name, value, attrs=None):
return super(SubmitButtonWidget, self).render(name,
self.attrs['value... | class BaseInput(object):
"""
An base Input class to reduce the amount of code in the Input classes.
"""
def __init__(self,name,value):
self.name = name
self.value = value
class Toggle(object):
"""
A container for holder toggled items such as fields and butt... | <commit_before>from django import forms
from django.forms.widgets import Input
class SubmitButtonWidget(Input):
"""
A widget that handles a submit button.
"""
input_type = 'submit'
def render(self, name, value, attrs=None):
return super(SubmitButtonWidget, self).render(name,
se... | class BaseInput(object):
"""
An base Input class to reduce the amount of code in the Input classes.
"""
def __init__(self,name,value):
self.name = name
self.value = value
class Toggle(object):
"""
A container for holder toggled items such as fields and butt... | from django import forms
from django.forms.widgets import Input
class SubmitButtonWidget(Input):
"""
A widget that handles a submit button.
"""
input_type = 'submit'
def render(self, name, value, attrs=None):
return super(SubmitButtonWidget, self).render(name,
self.attrs['value... | <commit_before>from django import forms
from django.forms.widgets import Input
class SubmitButtonWidget(Input):
"""
A widget that handles a submit button.
"""
input_type = 'submit'
def render(self, name, value, attrs=None):
return super(SubmitButtonWidget, self).render(name,
se... |
c306f6963e53b971674421eddca7f6b5c913281e | core/data/DataWriter.py | core/data/DataWriter.py | """
DataWriter.py
"""
from DataController import DataController
from DataReader import DataReader
from vtk import vtkMetaImageWriter
from vtk import vtkXMLImageDataWriter
class DataWriter(DataController):
"""
DataWriter writes an image data object to
disk using the provided format.
"""
def __init__(self):
sup... | """
DataWriter.py
"""
from DataController import DataController
from DataReader import DataReader
from vtk import vtkMetaImageWriter
from vtk import vtkXMLImageDataWriter
class DataWriter(DataController):
"""
DataWriter writes an image data object to
disk using the provided format.
"""
def __init__(self):
sup... | Fix for comparing with the wrong data type. | Fix for comparing with the wrong data type.
| Python | mit | berendkleinhaneveld/Registrationshop,berendkleinhaneveld/Registrationshop | """
DataWriter.py
"""
from DataController import DataController
from DataReader import DataReader
from vtk import vtkMetaImageWriter
from vtk import vtkXMLImageDataWriter
class DataWriter(DataController):
"""
DataWriter writes an image data object to
disk using the provided format.
"""
def __init__(self):
sup... | """
DataWriter.py
"""
from DataController import DataController
from DataReader import DataReader
from vtk import vtkMetaImageWriter
from vtk import vtkXMLImageDataWriter
class DataWriter(DataController):
"""
DataWriter writes an image data object to
disk using the provided format.
"""
def __init__(self):
sup... | <commit_before>"""
DataWriter.py
"""
from DataController import DataController
from DataReader import DataReader
from vtk import vtkMetaImageWriter
from vtk import vtkXMLImageDataWriter
class DataWriter(DataController):
"""
DataWriter writes an image data object to
disk using the provided format.
"""
def __init... | """
DataWriter.py
"""
from DataController import DataController
from DataReader import DataReader
from vtk import vtkMetaImageWriter
from vtk import vtkXMLImageDataWriter
class DataWriter(DataController):
"""
DataWriter writes an image data object to
disk using the provided format.
"""
def __init__(self):
sup... | """
DataWriter.py
"""
from DataController import DataController
from DataReader import DataReader
from vtk import vtkMetaImageWriter
from vtk import vtkXMLImageDataWriter
class DataWriter(DataController):
"""
DataWriter writes an image data object to
disk using the provided format.
"""
def __init__(self):
sup... | <commit_before>"""
DataWriter.py
"""
from DataController import DataController
from DataReader import DataReader
from vtk import vtkMetaImageWriter
from vtk import vtkXMLImageDataWriter
class DataWriter(DataController):
"""
DataWriter writes an image data object to
disk using the provided format.
"""
def __init... |
bfe884723d06252648cb95fdfc0f9dd0f804795f | proxyswitch/driver.py | proxyswitch/driver.py | from flask import Flask
class Driver:
'''
Holds the driver state so the flasked script can change behaviour based
on what the user injects via HTTP
'''
name = 'nobody'
def start(self, name):
self.name = name
return self.name
def stop(self):
self.name = 'nob... | from flask import Flask
class Driver:
'''
Holds the driver state so the flasked script can change behaviour based
on what the user injects via HTTP
'''
name = 'nobody'
def start(self, name):
self.name = name
return self.name
def stop(self):
self.name = 'nob... | Change Flask interface to 0.0.0.0 | Change Flask interface to 0.0.0.0
| Python | mit | ustwo/mastermind,ustwo/mastermind | from flask import Flask
class Driver:
'''
Holds the driver state so the flasked script can change behaviour based
on what the user injects via HTTP
'''
name = 'nobody'
def start(self, name):
self.name = name
return self.name
def stop(self):
self.name = 'nob... | from flask import Flask
class Driver:
'''
Holds the driver state so the flasked script can change behaviour based
on what the user injects via HTTP
'''
name = 'nobody'
def start(self, name):
self.name = name
return self.name
def stop(self):
self.name = 'nob... | <commit_before>from flask import Flask
class Driver:
'''
Holds the driver state so the flasked script can change behaviour based
on what the user injects via HTTP
'''
name = 'nobody'
def start(self, name):
self.name = name
return self.name
def stop(self):
s... | from flask import Flask
class Driver:
'''
Holds the driver state so the flasked script can change behaviour based
on what the user injects via HTTP
'''
name = 'nobody'
def start(self, name):
self.name = name
return self.name
def stop(self):
self.name = 'nob... | from flask import Flask
class Driver:
'''
Holds the driver state so the flasked script can change behaviour based
on what the user injects via HTTP
'''
name = 'nobody'
def start(self, name):
self.name = name
return self.name
def stop(self):
self.name = 'nob... | <commit_before>from flask import Flask
class Driver:
'''
Holds the driver state so the flasked script can change behaviour based
on what the user injects via HTTP
'''
name = 'nobody'
def start(self, name):
self.name = name
return self.name
def stop(self):
s... |
323f897e3550f41edc139352a6ac9d95ddf7228d | seriesly/helper/context_processors.py | seriesly/helper/context_processors.py | from django.conf import settings
def site_info(request):
return {'DOMAIN_URL': settings.DOMAIN_URL,
'SECURE_DOMAIN_URL': settings.SECURE_DOMAIN_URL,
'DEBUG': settings.DEBUG} | from django.conf import settings
def site_info(request):
return {'DOMAIN_URL': settings.DOMAIN_URL,
'SECURE_DOMAIN_URL': settings.SECURE_DOMAIN_URL,
'DEFAULT_FROM_EMAIL': settings.DEFAULT_FROM_EMAIL,
'DEBUG': settings.DEBUG}
| Add DEFAULT_FROM_EMAIL to default template context | Add DEFAULT_FROM_EMAIL to default template context
| Python | agpl-3.0 | maxgraser/seriesly,maxgraser/seriesly,stefanw/seriesly,stefanw/seriesly,maxgraser/seriesly | from django.conf import settings
def site_info(request):
return {'DOMAIN_URL': settings.DOMAIN_URL,
'SECURE_DOMAIN_URL': settings.SECURE_DOMAIN_URL,
'DEBUG': settings.DEBUG}Add DEFAULT_FROM_EMAIL to default template context | from django.conf import settings
def site_info(request):
return {'DOMAIN_URL': settings.DOMAIN_URL,
'SECURE_DOMAIN_URL': settings.SECURE_DOMAIN_URL,
'DEFAULT_FROM_EMAIL': settings.DEFAULT_FROM_EMAIL,
'DEBUG': settings.DEBUG}
| <commit_before>from django.conf import settings
def site_info(request):
return {'DOMAIN_URL': settings.DOMAIN_URL,
'SECURE_DOMAIN_URL': settings.SECURE_DOMAIN_URL,
'DEBUG': settings.DEBUG}<commit_msg>Add DEFAULT_FROM_EMAIL to default template context<commit_after> | from django.conf import settings
def site_info(request):
return {'DOMAIN_URL': settings.DOMAIN_URL,
'SECURE_DOMAIN_URL': settings.SECURE_DOMAIN_URL,
'DEFAULT_FROM_EMAIL': settings.DEFAULT_FROM_EMAIL,
'DEBUG': settings.DEBUG}
| from django.conf import settings
def site_info(request):
return {'DOMAIN_URL': settings.DOMAIN_URL,
'SECURE_DOMAIN_URL': settings.SECURE_DOMAIN_URL,
'DEBUG': settings.DEBUG}Add DEFAULT_FROM_EMAIL to default template contextfrom django.conf import settings
def site_info(request):
return... | <commit_before>from django.conf import settings
def site_info(request):
return {'DOMAIN_URL': settings.DOMAIN_URL,
'SECURE_DOMAIN_URL': settings.SECURE_DOMAIN_URL,
'DEBUG': settings.DEBUG}<commit_msg>Add DEFAULT_FROM_EMAIL to default template context<commit_after>from django.conf import set... |
fd054790ce32c3918f6edbe824540c09d7efce59 | stagehand/providers/__init__.py | stagehand/providers/__init__.py | import asyncio
from ..utils import load_plugins, invoke_plugins
from .base import ProviderError
plugins, broken_plugins = load_plugins('providers', ['thetvdb', 'tvrage'])
@asyncio.coroutine
def start(manager):
"""
Called when the manager is starting.
"""
yield from invoke_plugins(plugins, 'start', ma... | import asyncio
from ..utils import load_plugins, invoke_plugins
from .base import ProviderError
plugins, broken_plugins = load_plugins('providers', ['thetvdb'])
@asyncio.coroutine
def start(manager):
"""
Called when the manager is starting.
"""
yield from invoke_plugins(plugins, 'start', manager)
... | Remove tvrage from active providers as site is shut down | Remove tvrage from active providers as site is shut down
| Python | mit | jtackaberry/stagehand,jtackaberry/stagehand | import asyncio
from ..utils import load_plugins, invoke_plugins
from .base import ProviderError
plugins, broken_plugins = load_plugins('providers', ['thetvdb', 'tvrage'])
@asyncio.coroutine
def start(manager):
"""
Called when the manager is starting.
"""
yield from invoke_plugins(plugins, 'start', ma... | import asyncio
from ..utils import load_plugins, invoke_plugins
from .base import ProviderError
plugins, broken_plugins = load_plugins('providers', ['thetvdb'])
@asyncio.coroutine
def start(manager):
"""
Called when the manager is starting.
"""
yield from invoke_plugins(plugins, 'start', manager)
... | <commit_before>import asyncio
from ..utils import load_plugins, invoke_plugins
from .base import ProviderError
plugins, broken_plugins = load_plugins('providers', ['thetvdb', 'tvrage'])
@asyncio.coroutine
def start(manager):
"""
Called when the manager is starting.
"""
yield from invoke_plugins(plugi... | import asyncio
from ..utils import load_plugins, invoke_plugins
from .base import ProviderError
plugins, broken_plugins = load_plugins('providers', ['thetvdb'])
@asyncio.coroutine
def start(manager):
"""
Called when the manager is starting.
"""
yield from invoke_plugins(plugins, 'start', manager)
... | import asyncio
from ..utils import load_plugins, invoke_plugins
from .base import ProviderError
plugins, broken_plugins = load_plugins('providers', ['thetvdb', 'tvrage'])
@asyncio.coroutine
def start(manager):
"""
Called when the manager is starting.
"""
yield from invoke_plugins(plugins, 'start', ma... | <commit_before>import asyncio
from ..utils import load_plugins, invoke_plugins
from .base import ProviderError
plugins, broken_plugins = load_plugins('providers', ['thetvdb', 'tvrage'])
@asyncio.coroutine
def start(manager):
"""
Called when the manager is starting.
"""
yield from invoke_plugins(plugi... |
22b5f7ecc6057252ec77d037522b5783c5f86c1f | mcmodfixes.py | mcmodfixes.py | #!/usr/bin/python
# Fixes and mod-specific data for various mods' mcmod.info files
DEP_BLACKLIST = set((
"mod_MinecraftForge", # we always have Forge
"Forge", # typo for mod_MinecraftForge
"Industrialcraft", # typo for IC2
"GUI_Api", # typo for GuiAPI and not needed on server
))
DEP_ADDITIONS... | #!/usr/bin/python
# Fixes and mod-specific data for various mods' mcmod.info files
DEP_BLACKLIST = set((
"mod_MinecraftForge", # we always have Forge
"Forge", # typo for mod_MinecraftForge
"Industrialcraft", # typo for IC2
"GUI_Api", # typo for GuiAPI and not needed on server
"EurysCore", # rep... | Add mcmod.info fix for SlopesAndCorners SlimevoidLib dependency | Add mcmod.info fix for SlopesAndCorners SlimevoidLib dependency
| Python | bsd-3-clause | agaricusb/ModAnalyzer,agaricusb/ModAnalyzer | #!/usr/bin/python
# Fixes and mod-specific data for various mods' mcmod.info files
DEP_BLACKLIST = set((
"mod_MinecraftForge", # we always have Forge
"Forge", # typo for mod_MinecraftForge
"Industrialcraft", # typo for IC2
"GUI_Api", # typo for GuiAPI and not needed on server
))
DEP_ADDITIONS... | #!/usr/bin/python
# Fixes and mod-specific data for various mods' mcmod.info files
DEP_BLACKLIST = set((
"mod_MinecraftForge", # we always have Forge
"Forge", # typo for mod_MinecraftForge
"Industrialcraft", # typo for IC2
"GUI_Api", # typo for GuiAPI and not needed on server
"EurysCore", # rep... | <commit_before>#!/usr/bin/python
# Fixes and mod-specific data for various mods' mcmod.info files
DEP_BLACKLIST = set((
"mod_MinecraftForge", # we always have Forge
"Forge", # typo for mod_MinecraftForge
"Industrialcraft", # typo for IC2
"GUI_Api", # typo for GuiAPI and not needed on server
))
... | #!/usr/bin/python
# Fixes and mod-specific data for various mods' mcmod.info files
DEP_BLACKLIST = set((
"mod_MinecraftForge", # we always have Forge
"Forge", # typo for mod_MinecraftForge
"Industrialcraft", # typo for IC2
"GUI_Api", # typo for GuiAPI and not needed on server
"EurysCore", # rep... | #!/usr/bin/python
# Fixes and mod-specific data for various mods' mcmod.info files
DEP_BLACKLIST = set((
"mod_MinecraftForge", # we always have Forge
"Forge", # typo for mod_MinecraftForge
"Industrialcraft", # typo for IC2
"GUI_Api", # typo for GuiAPI and not needed on server
))
DEP_ADDITIONS... | <commit_before>#!/usr/bin/python
# Fixes and mod-specific data for various mods' mcmod.info files
DEP_BLACKLIST = set((
"mod_MinecraftForge", # we always have Forge
"Forge", # typo for mod_MinecraftForge
"Industrialcraft", # typo for IC2
"GUI_Api", # typo for GuiAPI and not needed on server
))
... |
60a90722fbd5fc047fee5e9f7377f03e11f6a654 | examples/root_finding/test_funcs.py | examples/root_finding/test_funcs.py | import math
def f1(x):
"""
Test function 1
"""
return x*x*x - math.pi*x + math.e/100
| import numpy as npy
def f1(x):
"""
Test function 1
"""
return x*x*x - npy.pi*x + npy.e/100
def f2(x):
"""
Test function 2
"""
return -1.13 + npy.tanh(x-2) + 4*npy.exp(-x)*npy.sin((1/8.)*x**3) \
*x + .1*npy.exp((1/35.)*x) | Use numpy instead of math to allow vectorization | Use numpy instead of math to allow vectorization
| Python | bsd-3-clause | robclewley/fovea,akuefler/fovea | import math
def f1(x):
"""
Test function 1
"""
return x*x*x - math.pi*x + math.e/100
Use numpy instead of math to allow vectorization | import numpy as npy
def f1(x):
"""
Test function 1
"""
return x*x*x - npy.pi*x + npy.e/100
def f2(x):
"""
Test function 2
"""
return -1.13 + npy.tanh(x-2) + 4*npy.exp(-x)*npy.sin((1/8.)*x**3) \
*x + .1*npy.exp((1/35.)*x) | <commit_before>import math
def f1(x):
"""
Test function 1
"""
return x*x*x - math.pi*x + math.e/100
<commit_msg>Use numpy instead of math to allow vectorization<commit_after> | import numpy as npy
def f1(x):
"""
Test function 1
"""
return x*x*x - npy.pi*x + npy.e/100
def f2(x):
"""
Test function 2
"""
return -1.13 + npy.tanh(x-2) + 4*npy.exp(-x)*npy.sin((1/8.)*x**3) \
*x + .1*npy.exp((1/35.)*x) | import math
def f1(x):
"""
Test function 1
"""
return x*x*x - math.pi*x + math.e/100
Use numpy instead of math to allow vectorizationimport numpy as npy
def f1(x):
"""
Test function 1
"""
return x*x*x - npy.pi*x + npy.e/100
def f2(x):
"""
Test function 2
"""
return -1.... | <commit_before>import math
def f1(x):
"""
Test function 1
"""
return x*x*x - math.pi*x + math.e/100
<commit_msg>Use numpy instead of math to allow vectorization<commit_after>import numpy as npy
def f1(x):
"""
Test function 1
"""
return x*x*x - npy.pi*x + npy.e/100
def f2(x):
"""
... |
cd030a1ed2c3c7f0bf7d9a5d86f9cc81f802fcba | corehq/mobile_flags.py | corehq/mobile_flags.py | from collections import namedtuple
TAG_DIMAGI_ONLY = 'Dimagi Only'
MobileFlag = namedtuple('MobileFlag', 'slug label tags')
SUPERUSER = MobileFlag(
'superuser',
'Enable superuser-only features',
tags=(TAG_DIMAGI_ONLY,)
)
| from collections import namedtuple
MobileFlag = namedtuple('MobileFlag', 'slug label')
SUPERUSER = MobileFlag(
'superuser',
'Enable superuser-only features'
)
| Add tags for mobile flags when you need them | Add tags for mobile flags when you need them
| Python | bsd-3-clause | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq | from collections import namedtuple
TAG_DIMAGI_ONLY = 'Dimagi Only'
MobileFlag = namedtuple('MobileFlag', 'slug label tags')
SUPERUSER = MobileFlag(
'superuser',
'Enable superuser-only features',
tags=(TAG_DIMAGI_ONLY,)
)
Add tags for mobile flags when you need them | from collections import namedtuple
MobileFlag = namedtuple('MobileFlag', 'slug label')
SUPERUSER = MobileFlag(
'superuser',
'Enable superuser-only features'
)
| <commit_before>from collections import namedtuple
TAG_DIMAGI_ONLY = 'Dimagi Only'
MobileFlag = namedtuple('MobileFlag', 'slug label tags')
SUPERUSER = MobileFlag(
'superuser',
'Enable superuser-only features',
tags=(TAG_DIMAGI_ONLY,)
)
<commit_msg>Add tags for mobile flags when you need them<commit_af... | from collections import namedtuple
MobileFlag = namedtuple('MobileFlag', 'slug label')
SUPERUSER = MobileFlag(
'superuser',
'Enable superuser-only features'
)
| from collections import namedtuple
TAG_DIMAGI_ONLY = 'Dimagi Only'
MobileFlag = namedtuple('MobileFlag', 'slug label tags')
SUPERUSER = MobileFlag(
'superuser',
'Enable superuser-only features',
tags=(TAG_DIMAGI_ONLY,)
)
Add tags for mobile flags when you need themfrom collections import namedtuple
... | <commit_before>from collections import namedtuple
TAG_DIMAGI_ONLY = 'Dimagi Only'
MobileFlag = namedtuple('MobileFlag', 'slug label tags')
SUPERUSER = MobileFlag(
'superuser',
'Enable superuser-only features',
tags=(TAG_DIMAGI_ONLY,)
)
<commit_msg>Add tags for mobile flags when you need them<commit_af... |
54bb12bdeec33e98451451837dce90665413bd67 | mgsv_names.py | mgsv_names.py | from __future__ import unicode_literals, print_function
import sqlite3, os, random
_select_random = 'select {0} from {1} limit 1 offset abs(random()) % (select count({0}) from {1});'
_select_uncommon = 'select value from uncommons where key=?;'
def generate_name():
conn = sqlite3.connect(os.path.join(os.path.dirn... | from __future__ import unicode_literals, print_function
import sqlite3, os, random
_select_random = 'select {0} from {1} limit 1 offset abs(random()) % (select count({0}) from {1});'
_select_uncommon = 'select value from uncommons where key=?;'
def generate_name():
conn = sqlite3.connect(os.path.join(os.path.dirn... | Print one name at a time. | Print one name at a time.
| Python | unlicense | rotated8/mgsv_names | from __future__ import unicode_literals, print_function
import sqlite3, os, random
_select_random = 'select {0} from {1} limit 1 offset abs(random()) % (select count({0}) from {1});'
_select_uncommon = 'select value from uncommons where key=?;'
def generate_name():
conn = sqlite3.connect(os.path.join(os.path.dirn... | from __future__ import unicode_literals, print_function
import sqlite3, os, random
_select_random = 'select {0} from {1} limit 1 offset abs(random()) % (select count({0}) from {1});'
_select_uncommon = 'select value from uncommons where key=?;'
def generate_name():
conn = sqlite3.connect(os.path.join(os.path.dirn... | <commit_before>from __future__ import unicode_literals, print_function
import sqlite3, os, random
_select_random = 'select {0} from {1} limit 1 offset abs(random()) % (select count({0}) from {1});'
_select_uncommon = 'select value from uncommons where key=?;'
def generate_name():
conn = sqlite3.connect(os.path.jo... | from __future__ import unicode_literals, print_function
import sqlite3, os, random
_select_random = 'select {0} from {1} limit 1 offset abs(random()) % (select count({0}) from {1});'
_select_uncommon = 'select value from uncommons where key=?;'
def generate_name():
conn = sqlite3.connect(os.path.join(os.path.dirn... | from __future__ import unicode_literals, print_function
import sqlite3, os, random
_select_random = 'select {0} from {1} limit 1 offset abs(random()) % (select count({0}) from {1});'
_select_uncommon = 'select value from uncommons where key=?;'
def generate_name():
conn = sqlite3.connect(os.path.join(os.path.dirn... | <commit_before>from __future__ import unicode_literals, print_function
import sqlite3, os, random
_select_random = 'select {0} from {1} limit 1 offset abs(random()) % (select count({0}) from {1});'
_select_uncommon = 'select value from uncommons where key=?;'
def generate_name():
conn = sqlite3.connect(os.path.jo... |
ba16b14203af704f1fa0a6eb3111d0537e0cc399 | mail_inline_css/models/mail_template.py | mail_inline_css/models/mail_template.py | # Copyright 2017 David BEAL @ Akretion
# Copyright 2019 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models
try:
from premailer import Premailer
except (ImportError, IOError) as err: # pragma: no cover
import logging
_logger = logging.getLogger(__n... | # Copyright 2017 David BEAL @ Akretion
# Copyright 2019 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models
try:
from premailer import Premailer
except (ImportError, IOError) as err: # pragma: no cover
import logging
_logger = logging.getLogger(__n... | Fix issue on empty template with premailer | Fix issue on empty template with premailer
If premailer receives an empty value, such as an empty string,
on parsing, it returns None and fails when trying to call
'etree.fromstring()' on this None result.
We should avoid to call premailer on an empty string, as the result
will anyway not change.
We may have an empt... | Python | agpl-3.0 | OCA/social,OCA/social,OCA/social | # Copyright 2017 David BEAL @ Akretion
# Copyright 2019 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models
try:
from premailer import Premailer
except (ImportError, IOError) as err: # pragma: no cover
import logging
_logger = logging.getLogger(__n... | # Copyright 2017 David BEAL @ Akretion
# Copyright 2019 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models
try:
from premailer import Premailer
except (ImportError, IOError) as err: # pragma: no cover
import logging
_logger = logging.getLogger(__n... | <commit_before># Copyright 2017 David BEAL @ Akretion
# Copyright 2019 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models
try:
from premailer import Premailer
except (ImportError, IOError) as err: # pragma: no cover
import logging
_logger = loggin... | # Copyright 2017 David BEAL @ Akretion
# Copyright 2019 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models
try:
from premailer import Premailer
except (ImportError, IOError) as err: # pragma: no cover
import logging
_logger = logging.getLogger(__n... | # Copyright 2017 David BEAL @ Akretion
# Copyright 2019 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models
try:
from premailer import Premailer
except (ImportError, IOError) as err: # pragma: no cover
import logging
_logger = logging.getLogger(__n... | <commit_before># Copyright 2017 David BEAL @ Akretion
# Copyright 2019 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models
try:
from premailer import Premailer
except (ImportError, IOError) as err: # pragma: no cover
import logging
_logger = loggin... |
0298e8b6abcd7cea99df4cb235c73a49e340521a | tests/query_test/test_decimal_queries.py | tests/query_test/test_decimal_queries.py | #!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
# Targeted tests for decimal type.
#
import logging
import pytest
from copy import copy
from tests.common.test_vector import *
from tests.common.impala_test_suite import *
class TestDecimalQueries(ImpalaTestSuite):
BATCH_SIZES = [0, 1]
... | #!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
# Targeted tests for decimal type.
#
import logging
import pytest
from copy import copy
from tests.common.test_vector import *
from tests.common.impala_test_suite import *
class TestDecimalQueries(ImpalaTestSuite):
BATCH_SIZES = [0, 1]
... | Fix the ASAN build by xfailing test_decimal when ASAN_OPTIONS is set. | Fix the ASAN build by xfailing test_decimal when ASAN_OPTIONS is set.
Adding decimal columns crashes an ASAN built impalad. This change skips the test.
Change-Id: Ic94055a3f0d00f89354177de18bc27d2f4cecec2
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2532
Reviewed-by: Ishaan Joshi <d1d1e60202ec9f2503deb1b724986485... | Python | apache-2.0 | cloudera/Impala,michaelhkw/incubator-impala,michaelhkw/incubator-impala,michaelhkw/incubator-impala,michaelhkw/incubator-impala,michaelhkw/incubator-impala,cloudera/Impala,cloudera/Impala,cloudera/Impala,michaelhkw/incubator-impala,cloudera/Impala,cloudera/Impala,michaelhkw/incubator-impala,cloudera/Impala | #!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
# Targeted tests for decimal type.
#
import logging
import pytest
from copy import copy
from tests.common.test_vector import *
from tests.common.impala_test_suite import *
class TestDecimalQueries(ImpalaTestSuite):
BATCH_SIZES = [0, 1]
... | #!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
# Targeted tests for decimal type.
#
import logging
import pytest
from copy import copy
from tests.common.test_vector import *
from tests.common.impala_test_suite import *
class TestDecimalQueries(ImpalaTestSuite):
BATCH_SIZES = [0, 1]
... | <commit_before>#!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
# Targeted tests for decimal type.
#
import logging
import pytest
from copy import copy
from tests.common.test_vector import *
from tests.common.impala_test_suite import *
class TestDecimalQueries(ImpalaTestSuite):
BATCH_SI... | #!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
# Targeted tests for decimal type.
#
import logging
import pytest
from copy import copy
from tests.common.test_vector import *
from tests.common.impala_test_suite import *
class TestDecimalQueries(ImpalaTestSuite):
BATCH_SIZES = [0, 1]
... | #!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
# Targeted tests for decimal type.
#
import logging
import pytest
from copy import copy
from tests.common.test_vector import *
from tests.common.impala_test_suite import *
class TestDecimalQueries(ImpalaTestSuite):
BATCH_SIZES = [0, 1]
... | <commit_before>#!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
# Targeted tests for decimal type.
#
import logging
import pytest
from copy import copy
from tests.common.test_vector import *
from tests.common.impala_test_suite import *
class TestDecimalQueries(ImpalaTestSuite):
BATCH_SI... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.