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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
de02c92510a6117aad01be7666d737d2ad861fd7 | send_sms.py | send_sms.py | #!/usr/bin/env python
import datetime
import json
import sys
import requests
import pytz
from twilio.rest import TwilioRestClient
import conf
def send(s):
client.sms.messages.create(to=conf.TO, from_=conf.FROM, body=s)
# Use the first arg as the message to send, or use the default if not specified
default_mes... | #!/usr/bin/env python
import json
import sys
import requests
from twilio.rest import TwilioRestClient
import conf
def send(s):
client.sms.messages.create(to=conf.TO, from_=conf.FROM, body=s)
# Use the first arg as the message to send, or use the default if not specified
default_message = "You haven't committe... | Improve logic in determining latest contribution | Improve logic in determining latest contribution
Looks like the list will always contain data for the last 366 days, and
the last entry in the list will always contain data for the current day
(PST). Much simpler this way.
Added some generic error-handling just in case this isn't true.
| Python | mit | dellsystem/github-streak-saver | #!/usr/bin/env python
import datetime
import json
import sys
import requests
import pytz
from twilio.rest import TwilioRestClient
import conf
def send(s):
client.sms.messages.create(to=conf.TO, from_=conf.FROM, body=s)
# Use the first arg as the message to send, or use the default if not specified
default_mes... | #!/usr/bin/env python
import json
import sys
import requests
from twilio.rest import TwilioRestClient
import conf
def send(s):
client.sms.messages.create(to=conf.TO, from_=conf.FROM, body=s)
# Use the first arg as the message to send, or use the default if not specified
default_message = "You haven't committe... | <commit_before>#!/usr/bin/env python
import datetime
import json
import sys
import requests
import pytz
from twilio.rest import TwilioRestClient
import conf
def send(s):
client.sms.messages.create(to=conf.TO, from_=conf.FROM, body=s)
# Use the first arg as the message to send, or use the default if not specif... | #!/usr/bin/env python
import json
import sys
import requests
from twilio.rest import TwilioRestClient
import conf
def send(s):
client.sms.messages.create(to=conf.TO, from_=conf.FROM, body=s)
# Use the first arg as the message to send, or use the default if not specified
default_message = "You haven't committe... | #!/usr/bin/env python
import datetime
import json
import sys
import requests
import pytz
from twilio.rest import TwilioRestClient
import conf
def send(s):
client.sms.messages.create(to=conf.TO, from_=conf.FROM, body=s)
# Use the first arg as the message to send, or use the default if not specified
default_mes... | <commit_before>#!/usr/bin/env python
import datetime
import json
import sys
import requests
import pytz
from twilio.rest import TwilioRestClient
import conf
def send(s):
client.sms.messages.create(to=conf.TO, from_=conf.FROM, body=s)
# Use the first arg as the message to send, or use the default if not specif... |
67913476c33a4f8b3635f63c379bde0a48a5e714 | admin.py | admin.py | # -*- coding: utf-8 -*-
from django.contrib import admin
from .models import Crash
class CrashAdmin(admin.ModelAdmin):
search_fields = ('report',)
list_display = ('application', 'build',
'crdate', 'tstamp',
'is_solved', 'is_obsolete')
list_filter = ('application', 'b... | # -*- coding: utf-8 -*-
from django.contrib import admin
from .models import Crash
class CrashAdmin(admin.ModelAdmin):
search_fields = ('report',)
list_display = ('application', 'build',
'crdate', 'tstamp',
'is_solved', 'is_obsolete')
list_filter = ('application', 'b... | Disable date_hierarchy for now since it requires tzinfo in MySQL | Disable date_hierarchy for now since it requires tzinfo in MySQL
| Python | mit | mback2k/django-app-bugs | # -*- coding: utf-8 -*-
from django.contrib import admin
from .models import Crash
class CrashAdmin(admin.ModelAdmin):
search_fields = ('report',)
list_display = ('application', 'build',
'crdate', 'tstamp',
'is_solved', 'is_obsolete')
list_filter = ('application', 'b... | # -*- coding: utf-8 -*-
from django.contrib import admin
from .models import Crash
class CrashAdmin(admin.ModelAdmin):
search_fields = ('report',)
list_display = ('application', 'build',
'crdate', 'tstamp',
'is_solved', 'is_obsolete')
list_filter = ('application', 'b... | <commit_before># -*- coding: utf-8 -*-
from django.contrib import admin
from .models import Crash
class CrashAdmin(admin.ModelAdmin):
search_fields = ('report',)
list_display = ('application', 'build',
'crdate', 'tstamp',
'is_solved', 'is_obsolete')
list_filter = ('a... | # -*- coding: utf-8 -*-
from django.contrib import admin
from .models import Crash
class CrashAdmin(admin.ModelAdmin):
search_fields = ('report',)
list_display = ('application', 'build',
'crdate', 'tstamp',
'is_solved', 'is_obsolete')
list_filter = ('application', 'b... | # -*- coding: utf-8 -*-
from django.contrib import admin
from .models import Crash
class CrashAdmin(admin.ModelAdmin):
search_fields = ('report',)
list_display = ('application', 'build',
'crdate', 'tstamp',
'is_solved', 'is_obsolete')
list_filter = ('application', 'b... | <commit_before># -*- coding: utf-8 -*-
from django.contrib import admin
from .models import Crash
class CrashAdmin(admin.ModelAdmin):
search_fields = ('report',)
list_display = ('application', 'build',
'crdate', 'tstamp',
'is_solved', 'is_obsolete')
list_filter = ('a... |
5b18ec2219cbdfa479a1d32f9bf62f7460171f09 | live_studio/queue/models.py | live_studio/queue/models.py | import datetime
from django.db import models
from .managers import EntryManager
class Entry(models.Model):
config = models.ForeignKey('config.Config')
enqueued = models.DateTimeField(default=datetime.datetime.utcnow)
started = models.DateTimeField(null=True)
finished = models.DateTimeField(null=True... | import datetime
from django.db import models
from .managers import EntryManager
class Entry(models.Model):
config = models.ForeignKey('config.Config')
enqueued = models.DateTimeField(default=datetime.datetime.utcnow)
started = models.DateTimeField(null=True)
finished = models.DateTimeField(null=True... | Set verbose_name_plural properly for queue.Entry. | Set verbose_name_plural properly for queue.Entry.
Signed-off-by: Chris Lamb <[email protected]>
| Python | agpl-3.0 | debian-live/live-studio,debian-live/live-studio,lamby/live-studio,lamby/live-studio,lamby/live-studio,debian-live/live-studio | import datetime
from django.db import models
from .managers import EntryManager
class Entry(models.Model):
config = models.ForeignKey('config.Config')
enqueued = models.DateTimeField(default=datetime.datetime.utcnow)
started = models.DateTimeField(null=True)
finished = models.DateTimeField(null=True... | import datetime
from django.db import models
from .managers import EntryManager
class Entry(models.Model):
config = models.ForeignKey('config.Config')
enqueued = models.DateTimeField(default=datetime.datetime.utcnow)
started = models.DateTimeField(null=True)
finished = models.DateTimeField(null=True... | <commit_before>import datetime
from django.db import models
from .managers import EntryManager
class Entry(models.Model):
config = models.ForeignKey('config.Config')
enqueued = models.DateTimeField(default=datetime.datetime.utcnow)
started = models.DateTimeField(null=True)
finished = models.DateTime... | import datetime
from django.db import models
from .managers import EntryManager
class Entry(models.Model):
config = models.ForeignKey('config.Config')
enqueued = models.DateTimeField(default=datetime.datetime.utcnow)
started = models.DateTimeField(null=True)
finished = models.DateTimeField(null=True... | import datetime
from django.db import models
from .managers import EntryManager
class Entry(models.Model):
config = models.ForeignKey('config.Config')
enqueued = models.DateTimeField(default=datetime.datetime.utcnow)
started = models.DateTimeField(null=True)
finished = models.DateTimeField(null=True... | <commit_before>import datetime
from django.db import models
from .managers import EntryManager
class Entry(models.Model):
config = models.ForeignKey('config.Config')
enqueued = models.DateTimeField(default=datetime.datetime.utcnow)
started = models.DateTimeField(null=True)
finished = models.DateTime... |
0f183708aa8a0c9503d847a65f072de07dc800ea | tests.py | tests.py | import unittest
from gtlaunch import Launcher
class MockOptions(object):
def __init__(self):
self.verbose = False
self.config = ''
self.project = ''
class LauncherTestCase(unittest.TestCase):
def test_lazy_init(self):
options = MockOptions()
launcher = Launcher(optio... | import unittest
from gtlaunch import Launcher
class MockOptions(object):
def __init__(self):
self.verbose = False
self.config = ''
self.project = ''
class LauncherTestCase(unittest.TestCase):
def test_lazy_init(self):
options = MockOptions()
launcher = Launcher(optio... | Check for maximize in args. | Check for maximize in args.
| Python | mit | GoldenLine/gtlaunch | import unittest
from gtlaunch import Launcher
class MockOptions(object):
def __init__(self):
self.verbose = False
self.config = ''
self.project = ''
class LauncherTestCase(unittest.TestCase):
def test_lazy_init(self):
options = MockOptions()
launcher = Launcher(optio... | import unittest
from gtlaunch import Launcher
class MockOptions(object):
def __init__(self):
self.verbose = False
self.config = ''
self.project = ''
class LauncherTestCase(unittest.TestCase):
def test_lazy_init(self):
options = MockOptions()
launcher = Launcher(optio... | <commit_before>import unittest
from gtlaunch import Launcher
class MockOptions(object):
def __init__(self):
self.verbose = False
self.config = ''
self.project = ''
class LauncherTestCase(unittest.TestCase):
def test_lazy_init(self):
options = MockOptions()
launcher =... | import unittest
from gtlaunch import Launcher
class MockOptions(object):
def __init__(self):
self.verbose = False
self.config = ''
self.project = ''
class LauncherTestCase(unittest.TestCase):
def test_lazy_init(self):
options = MockOptions()
launcher = Launcher(optio... | import unittest
from gtlaunch import Launcher
class MockOptions(object):
def __init__(self):
self.verbose = False
self.config = ''
self.project = ''
class LauncherTestCase(unittest.TestCase):
def test_lazy_init(self):
options = MockOptions()
launcher = Launcher(optio... | <commit_before>import unittest
from gtlaunch import Launcher
class MockOptions(object):
def __init__(self):
self.verbose = False
self.config = ''
self.project = ''
class LauncherTestCase(unittest.TestCase):
def test_lazy_init(self):
options = MockOptions()
launcher =... |
e055874545dcc0e1205bad2b419076c204ffcf9c | duty_cycle.py | duty_cycle.py | #!/usr/bin/env python
from blinkenlights import dimmer, setup, cleanup
pin = 18
setup(pin)
up = range(10)
down = range(9)
down.reverse()
bpm = 70
period = 60.0 / bpm # seconds
time_per_level = period / len(up + down)
for i in range(10):
for j in (up + down):
brightness = (j+1) / 10.0
dimmer(... | #!/usr/bin/env python
from blinkenlights import dimmer, setup, cleanup
pin = 18
bpm = 70
setup(pin)
up = range(10)
down = range(9)
down.reverse()
spectrum = up + down + [-1]
period = 60.0 / bpm # seconds
time_per_level = period / len(spectrum)
for i in range(10):
for j in (spectrum):
brightness = (j+1... | Add a 0.0 duty cycle: brief moment of off time. | Add a 0.0 duty cycle: brief moment of off time.
| Python | mit | zimolzak/Raspberry-Pi-newbie,zimolzak/Raspberry-Pi-newbie,zimolzak/Raspberry-Pi-newbie,zimolzak/Raspberry-Pi-newbie,zimolzak/Raspberry-Pi-newbie | #!/usr/bin/env python
from blinkenlights import dimmer, setup, cleanup
pin = 18
setup(pin)
up = range(10)
down = range(9)
down.reverse()
bpm = 70
period = 60.0 / bpm # seconds
time_per_level = period / len(up + down)
for i in range(10):
for j in (up + down):
brightness = (j+1) / 10.0
dimmer(... | #!/usr/bin/env python
from blinkenlights import dimmer, setup, cleanup
pin = 18
bpm = 70
setup(pin)
up = range(10)
down = range(9)
down.reverse()
spectrum = up + down + [-1]
period = 60.0 / bpm # seconds
time_per_level = period / len(spectrum)
for i in range(10):
for j in (spectrum):
brightness = (j+1... | <commit_before>#!/usr/bin/env python
from blinkenlights import dimmer, setup, cleanup
pin = 18
setup(pin)
up = range(10)
down = range(9)
down.reverse()
bpm = 70
period = 60.0 / bpm # seconds
time_per_level = period / len(up + down)
for i in range(10):
for j in (up + down):
brightness = (j+1) / 10.0
... | #!/usr/bin/env python
from blinkenlights import dimmer, setup, cleanup
pin = 18
bpm = 70
setup(pin)
up = range(10)
down = range(9)
down.reverse()
spectrum = up + down + [-1]
period = 60.0 / bpm # seconds
time_per_level = period / len(spectrum)
for i in range(10):
for j in (spectrum):
brightness = (j+1... | #!/usr/bin/env python
from blinkenlights import dimmer, setup, cleanup
pin = 18
setup(pin)
up = range(10)
down = range(9)
down.reverse()
bpm = 70
period = 60.0 / bpm # seconds
time_per_level = period / len(up + down)
for i in range(10):
for j in (up + down):
brightness = (j+1) / 10.0
dimmer(... | <commit_before>#!/usr/bin/env python
from blinkenlights import dimmer, setup, cleanup
pin = 18
setup(pin)
up = range(10)
down = range(9)
down.reverse()
bpm = 70
period = 60.0 / bpm # seconds
time_per_level = period / len(up + down)
for i in range(10):
for j in (up + down):
brightness = (j+1) / 10.0
... |
0e740b5fd924b113173b546f2dd2b8fa1e55d074 | indra/sparser/sparser_api.py | indra/sparser/sparser_api.py | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
import logging
import xml.etree.ElementTree as ET
from indra.util import UnicodeXMLTreeBuilder as UTB
from indra.sparser.processor import SparserProcessor
logger = logging.getLogger('sparser')
def process_xml(xml_s... | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
import logging
import xml.etree.ElementTree as ET
from indra.util import UnicodeXMLTreeBuilder as UTB
from indra.sparser.processor import SparserProcessor
logger = logging.getLogger('sparser')
def process_xml(xml_s... | Print XML parse errors in Sparser API | Print XML parse errors in Sparser API
| Python | bsd-2-clause | sorgerlab/belpy,bgyori/indra,johnbachman/belpy,bgyori/indra,johnbachman/indra,johnbachman/belpy,johnbachman/belpy,pvtodorov/indra,sorgerlab/indra,bgyori/indra,sorgerlab/indra,johnbachman/indra,pvtodorov/indra,sorgerlab/belpy,pvtodorov/indra,pvtodorov/indra,sorgerlab/belpy,sorgerlab/indra,johnbachman/indra | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
import logging
import xml.etree.ElementTree as ET
from indra.util import UnicodeXMLTreeBuilder as UTB
from indra.sparser.processor import SparserProcessor
logger = logging.getLogger('sparser')
def process_xml(xml_s... | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
import logging
import xml.etree.ElementTree as ET
from indra.util import UnicodeXMLTreeBuilder as UTB
from indra.sparser.processor import SparserProcessor
logger = logging.getLogger('sparser')
def process_xml(xml_s... | <commit_before>from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
import logging
import xml.etree.ElementTree as ET
from indra.util import UnicodeXMLTreeBuilder as UTB
from indra.sparser.processor import SparserProcessor
logger = logging.getLogger('sparser')
def pr... | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
import logging
import xml.etree.ElementTree as ET
from indra.util import UnicodeXMLTreeBuilder as UTB
from indra.sparser.processor import SparserProcessor
logger = logging.getLogger('sparser')
def process_xml(xml_s... | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
import logging
import xml.etree.ElementTree as ET
from indra.util import UnicodeXMLTreeBuilder as UTB
from indra.sparser.processor import SparserProcessor
logger = logging.getLogger('sparser')
def process_xml(xml_s... | <commit_before>from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
import logging
import xml.etree.ElementTree as ET
from indra.util import UnicodeXMLTreeBuilder as UTB
from indra.sparser.processor import SparserProcessor
logger = logging.getLogger('sparser')
def pr... |
0a850f935ce6cc48a68cffbef64c127daa22a42f | write.py | write.py | import colour
import csv
import json
import os
import pprint
# write to file as json, csv, markdown, plaintext or print table
def write_data(data, user, format=None):
if format is not None:
directory = './data/'
if not os.path.exists(directory):
os.makedirs(directory)
f = ... | import csv
import json
import os
from tabulate import tabulate
def write_data(d, u, f=None):
if f is not None:
directory = './data/'
if not os.path.exists(directory):
os.makedirs(directory)
file = open(directory + u + '.' + f, 'w')
if f == 'json':
file.w... | Print table if no file format provided | Print table if no file format provided
| Python | mit | kshvmdn/github-list,kshvmdn/github-list,kshvmdn/github-list | import colour
import csv
import json
import os
import pprint
# write to file as json, csv, markdown, plaintext or print table
def write_data(data, user, format=None):
if format is not None:
directory = './data/'
if not os.path.exists(directory):
os.makedirs(directory)
f = ... | import csv
import json
import os
from tabulate import tabulate
def write_data(d, u, f=None):
if f is not None:
directory = './data/'
if not os.path.exists(directory):
os.makedirs(directory)
file = open(directory + u + '.' + f, 'w')
if f == 'json':
file.w... | <commit_before>import colour
import csv
import json
import os
import pprint
# write to file as json, csv, markdown, plaintext or print table
def write_data(data, user, format=None):
if format is not None:
directory = './data/'
if not os.path.exists(directory):
os.makedirs(directory... | import csv
import json
import os
from tabulate import tabulate
def write_data(d, u, f=None):
if f is not None:
directory = './data/'
if not os.path.exists(directory):
os.makedirs(directory)
file = open(directory + u + '.' + f, 'w')
if f == 'json':
file.w... | import colour
import csv
import json
import os
import pprint
# write to file as json, csv, markdown, plaintext or print table
def write_data(data, user, format=None):
if format is not None:
directory = './data/'
if not os.path.exists(directory):
os.makedirs(directory)
f = ... | <commit_before>import colour
import csv
import json
import os
import pprint
# write to file as json, csv, markdown, plaintext or print table
def write_data(data, user, format=None):
if format is not None:
directory = './data/'
if not os.path.exists(directory):
os.makedirs(directory... |
991889003ca31bf13b326b7c1788ecbe32801528 | profile_collection/startup/99-bluesky.py | profile_collection/startup/99-bluesky.py | from bluesky.global_state import (resume, abort, stop, panic, all_is_well,
state)
from bluesky.callbacks.olog import OlogCallback
from bluesky.global_state import gs
olog_cb = OlogCallback('Data Acquisition')
gs.RE.subscribe('start', olog_cb)
from bluesky.scientific_callbacks impor... | from bluesky.global_state import (resume, abort, stop, panic, all_is_well,
state)
from bluesky.callbacks.olog import OlogCallback
from bluesky.global_state import gs
olog_cb = OlogCallback('Data Acquisition')
gs.RE.subscribe('start', olog_cb)
gs.DETS.append(det4)
#from bluesky.sci... | Add det4 to global dets | Add det4 to global dets
| Python | bsd-2-clause | NSLS-II-IXS/ipython_ophyd,NSLS-II-IXS/ipython_ophyd | from bluesky.global_state import (resume, abort, stop, panic, all_is_well,
state)
from bluesky.callbacks.olog import OlogCallback
from bluesky.global_state import gs
olog_cb = OlogCallback('Data Acquisition')
gs.RE.subscribe('start', olog_cb)
from bluesky.scientific_callbacks impor... | from bluesky.global_state import (resume, abort, stop, panic, all_is_well,
state)
from bluesky.callbacks.olog import OlogCallback
from bluesky.global_state import gs
olog_cb = OlogCallback('Data Acquisition')
gs.RE.subscribe('start', olog_cb)
gs.DETS.append(det4)
#from bluesky.sci... | <commit_before>from bluesky.global_state import (resume, abort, stop, panic, all_is_well,
state)
from bluesky.callbacks.olog import OlogCallback
from bluesky.global_state import gs
olog_cb = OlogCallback('Data Acquisition')
gs.RE.subscribe('start', olog_cb)
from bluesky.scientific_... | from bluesky.global_state import (resume, abort, stop, panic, all_is_well,
state)
from bluesky.callbacks.olog import OlogCallback
from bluesky.global_state import gs
olog_cb = OlogCallback('Data Acquisition')
gs.RE.subscribe('start', olog_cb)
gs.DETS.append(det4)
#from bluesky.sci... | from bluesky.global_state import (resume, abort, stop, panic, all_is_well,
state)
from bluesky.callbacks.olog import OlogCallback
from bluesky.global_state import gs
olog_cb = OlogCallback('Data Acquisition')
gs.RE.subscribe('start', olog_cb)
from bluesky.scientific_callbacks impor... | <commit_before>from bluesky.global_state import (resume, abort, stop, panic, all_is_well,
state)
from bluesky.callbacks.olog import OlogCallback
from bluesky.global_state import gs
olog_cb = OlogCallback('Data Acquisition')
gs.RE.subscribe('start', olog_cb)
from bluesky.scientific_... |
b65c5157c9e4515b01558201b983727d3a3154bd | src/syntax/relative_clauses.py | src/syntax/relative_clauses.py | __author__ = 's7a'
# All imports
from nltk.tree import Tree
# The Relative clauses class
class RelativeClauses:
# Constructor for the Relative Clauses class
def __init__(self):
self.has_wh_word = False
# Break the tree
def break_tree(self, tree):
t = Tree.fromstring(str(tree))
... | __author__ = 's7a'
# All imports
from nltk.tree import Tree
# The Relative clauses class
class RelativeClauses:
# Constructor for the Relative Clauses class
def __init__(self):
self.has_wh_word = False
# Break the tree
def break_tree(self, tree):
t = Tree.fromstring(str(tree))
... | Fix detection of relative clause | Fix detection of relative clause
| Python | mit | Somsubhra/Simplify,Somsubhra/Simplify,Somsubhra/Simplify | __author__ = 's7a'
# All imports
from nltk.tree import Tree
# The Relative clauses class
class RelativeClauses:
# Constructor for the Relative Clauses class
def __init__(self):
self.has_wh_word = False
# Break the tree
def break_tree(self, tree):
t = Tree.fromstring(str(tree))
... | __author__ = 's7a'
# All imports
from nltk.tree import Tree
# The Relative clauses class
class RelativeClauses:
# Constructor for the Relative Clauses class
def __init__(self):
self.has_wh_word = False
# Break the tree
def break_tree(self, tree):
t = Tree.fromstring(str(tree))
... | <commit_before>__author__ = 's7a'
# All imports
from nltk.tree import Tree
# The Relative clauses class
class RelativeClauses:
# Constructor for the Relative Clauses class
def __init__(self):
self.has_wh_word = False
# Break the tree
def break_tree(self, tree):
t = Tree.fromstring(s... | __author__ = 's7a'
# All imports
from nltk.tree import Tree
# The Relative clauses class
class RelativeClauses:
# Constructor for the Relative Clauses class
def __init__(self):
self.has_wh_word = False
# Break the tree
def break_tree(self, tree):
t = Tree.fromstring(str(tree))
... | __author__ = 's7a'
# All imports
from nltk.tree import Tree
# The Relative clauses class
class RelativeClauses:
# Constructor for the Relative Clauses class
def __init__(self):
self.has_wh_word = False
# Break the tree
def break_tree(self, tree):
t = Tree.fromstring(str(tree))
... | <commit_before>__author__ = 's7a'
# All imports
from nltk.tree import Tree
# The Relative clauses class
class RelativeClauses:
# Constructor for the Relative Clauses class
def __init__(self):
self.has_wh_word = False
# Break the tree
def break_tree(self, tree):
t = Tree.fromstring(s... |
02e4a051e6e463d06195e9efe6a25c84cc046b55 | tests/base.py | tests/base.py | import unittest
from app import create_app, db
class Base(unittest.TestCase):
def setUp(self):
self.app = create_app("testing")
self.client = self.app.test_client()
self.user = {
"username": "brian",
"password": "password"
}
with self.app.app_contex... | import unittest
import json
from app import create_app, db
from app.models import User
class Base(unittest.TestCase):
def setUp(self):
self.app = create_app("testing")
self.client = self.app.test_client()
self.user = json.dumps({
"username": "brian",
"password": "pa... | Add authorization and content-type headers to request for tests | [CHORE] Add authorization and content-type headers to request for tests
| Python | mit | brayoh/bucket-list-api | import unittest
from app import create_app, db
class Base(unittest.TestCase):
def setUp(self):
self.app = create_app("testing")
self.client = self.app.test_client()
self.user = {
"username": "brian",
"password": "password"
}
with self.app.app_contex... | import unittest
import json
from app import create_app, db
from app.models import User
class Base(unittest.TestCase):
def setUp(self):
self.app = create_app("testing")
self.client = self.app.test_client()
self.user = json.dumps({
"username": "brian",
"password": "pa... | <commit_before>import unittest
from app import create_app, db
class Base(unittest.TestCase):
def setUp(self):
self.app = create_app("testing")
self.client = self.app.test_client()
self.user = {
"username": "brian",
"password": "password"
}
with self... | import unittest
import json
from app import create_app, db
from app.models import User
class Base(unittest.TestCase):
def setUp(self):
self.app = create_app("testing")
self.client = self.app.test_client()
self.user = json.dumps({
"username": "brian",
"password": "pa... | import unittest
from app import create_app, db
class Base(unittest.TestCase):
def setUp(self):
self.app = create_app("testing")
self.client = self.app.test_client()
self.user = {
"username": "brian",
"password": "password"
}
with self.app.app_contex... | <commit_before>import unittest
from app import create_app, db
class Base(unittest.TestCase):
def setUp(self):
self.app = create_app("testing")
self.client = self.app.test_client()
self.user = {
"username": "brian",
"password": "password"
}
with self... |
6ad77e5a9cdbe63ca706bd7c7d3aebb7a34e4cc5 | mopidy/__init__.py | mopidy/__init__.py | from __future__ import absolute_import, print_function, unicode_literals
import platform
import sys
import warnings
compatible_py2 = (2, 7) <= sys.version_info < (3,)
compatible_py3 = (3, 7) <= sys.version_info
if not (compatible_py2 or compatible_py3):
sys.exit(
'ERROR: Mopidy requires Python 2.7 or >=... | from __future__ import absolute_import, print_function, unicode_literals
import platform
import sys
import warnings
if not sys.version_info >= (3, 7):
sys.exit(
'ERROR: Mopidy requires Python >= 3.7, but found %s.' %
platform.python_version())
warnings.filterwarnings('ignore', 'could not open d... | Exit if imported on Python 2 | Exit if imported on Python 2
| Python | apache-2.0 | kingosticks/mopidy,adamcik/mopidy,jcass77/mopidy,jodal/mopidy,mopidy/mopidy,kingosticks/mopidy,mopidy/mopidy,adamcik/mopidy,jcass77/mopidy,kingosticks/mopidy,jodal/mopidy,jodal/mopidy,mopidy/mopidy,jcass77/mopidy,adamcik/mopidy | from __future__ import absolute_import, print_function, unicode_literals
import platform
import sys
import warnings
compatible_py2 = (2, 7) <= sys.version_info < (3,)
compatible_py3 = (3, 7) <= sys.version_info
if not (compatible_py2 or compatible_py3):
sys.exit(
'ERROR: Mopidy requires Python 2.7 or >=... | from __future__ import absolute_import, print_function, unicode_literals
import platform
import sys
import warnings
if not sys.version_info >= (3, 7):
sys.exit(
'ERROR: Mopidy requires Python >= 3.7, but found %s.' %
platform.python_version())
warnings.filterwarnings('ignore', 'could not open d... | <commit_before>from __future__ import absolute_import, print_function, unicode_literals
import platform
import sys
import warnings
compatible_py2 = (2, 7) <= sys.version_info < (3,)
compatible_py3 = (3, 7) <= sys.version_info
if not (compatible_py2 or compatible_py3):
sys.exit(
'ERROR: Mopidy requires P... | from __future__ import absolute_import, print_function, unicode_literals
import platform
import sys
import warnings
if not sys.version_info >= (3, 7):
sys.exit(
'ERROR: Mopidy requires Python >= 3.7, but found %s.' %
platform.python_version())
warnings.filterwarnings('ignore', 'could not open d... | from __future__ import absolute_import, print_function, unicode_literals
import platform
import sys
import warnings
compatible_py2 = (2, 7) <= sys.version_info < (3,)
compatible_py3 = (3, 7) <= sys.version_info
if not (compatible_py2 or compatible_py3):
sys.exit(
'ERROR: Mopidy requires Python 2.7 or >=... | <commit_before>from __future__ import absolute_import, print_function, unicode_literals
import platform
import sys
import warnings
compatible_py2 = (2, 7) <= sys.version_info < (3,)
compatible_py3 = (3, 7) <= sys.version_info
if not (compatible_py2 or compatible_py3):
sys.exit(
'ERROR: Mopidy requires P... |
6f0454669be842309d1c31deee9c377d9c6ffff5 | lightstep/http_connection.py | lightstep/http_connection.py | """ Connection class establishes HTTP connection with server.
Utilized to send Proto Report Requests.
"""
import threading
import requests
from lightstep.collector_pb2 import ReportResponse
class _HTTPConnection(object):
"""Instances of _Connection are used to establish a connection to the
server via HTT... | """ Connection class establishes HTTP connection with server.
Utilized to send Proto Report Requests.
"""
import threading
import requests
from lightstep.collector_pb2 import ReportResponse
class _HTTPConnection(object):
"""Instances of _Connection are used to establish a connection to the
server via HTT... | Add access token from auth not report | Add access token from auth not report
| Python | mit | lightstephq/lightstep-tracer-python | """ Connection class establishes HTTP connection with server.
Utilized to send Proto Report Requests.
"""
import threading
import requests
from lightstep.collector_pb2 import ReportResponse
class _HTTPConnection(object):
"""Instances of _Connection are used to establish a connection to the
server via HTT... | """ Connection class establishes HTTP connection with server.
Utilized to send Proto Report Requests.
"""
import threading
import requests
from lightstep.collector_pb2 import ReportResponse
class _HTTPConnection(object):
"""Instances of _Connection are used to establish a connection to the
server via HTT... | <commit_before>""" Connection class establishes HTTP connection with server.
Utilized to send Proto Report Requests.
"""
import threading
import requests
from lightstep.collector_pb2 import ReportResponse
class _HTTPConnection(object):
"""Instances of _Connection are used to establish a connection to the
... | """ Connection class establishes HTTP connection with server.
Utilized to send Proto Report Requests.
"""
import threading
import requests
from lightstep.collector_pb2 import ReportResponse
class _HTTPConnection(object):
"""Instances of _Connection are used to establish a connection to the
server via HTT... | """ Connection class establishes HTTP connection with server.
Utilized to send Proto Report Requests.
"""
import threading
import requests
from lightstep.collector_pb2 import ReportResponse
class _HTTPConnection(object):
"""Instances of _Connection are used to establish a connection to the
server via HTT... | <commit_before>""" Connection class establishes HTTP connection with server.
Utilized to send Proto Report Requests.
"""
import threading
import requests
from lightstep.collector_pb2 import ReportResponse
class _HTTPConnection(object):
"""Instances of _Connection are used to establish a connection to the
... |
ce9cbc4144c105e9cb59836274ef25a29a9b20a7 | webserver/codemanagement/tasks.py | webserver/codemanagement/tasks.py | from celery import task
from celery.result import AsyncResult
from .models import TeamSubmission
import logging
logger = logging.getLogger(__name__)
@task()
def create_shellai_tag(instance):
"""Tags the repo's HEAD as "ShellAI" to provide a default tag for
the arena to use"""
team_name = instance.team.... | from celery import task
from celery.result import AsyncResult
from .models import TeamSubmission
import logging
logger = logging.getLogger(__name__)
@task()
def create_shellai_tag(instance):
"""Tags the repo's HEAD as "ShellAI" to provide a default tag for
the arena to use"""
team_name = instance.team.... | Handle attempts to tag empty shell repos | Handle attempts to tag empty shell repos
| Python | bsd-3-clause | siggame/webserver,siggame/webserver,siggame/webserver | from celery import task
from celery.result import AsyncResult
from .models import TeamSubmission
import logging
logger = logging.getLogger(__name__)
@task()
def create_shellai_tag(instance):
"""Tags the repo's HEAD as "ShellAI" to provide a default tag for
the arena to use"""
team_name = instance.team.... | from celery import task
from celery.result import AsyncResult
from .models import TeamSubmission
import logging
logger = logging.getLogger(__name__)
@task()
def create_shellai_tag(instance):
"""Tags the repo's HEAD as "ShellAI" to provide a default tag for
the arena to use"""
team_name = instance.team.... | <commit_before>from celery import task
from celery.result import AsyncResult
from .models import TeamSubmission
import logging
logger = logging.getLogger(__name__)
@task()
def create_shellai_tag(instance):
"""Tags the repo's HEAD as "ShellAI" to provide a default tag for
the arena to use"""
team_name =... | from celery import task
from celery.result import AsyncResult
from .models import TeamSubmission
import logging
logger = logging.getLogger(__name__)
@task()
def create_shellai_tag(instance):
"""Tags the repo's HEAD as "ShellAI" to provide a default tag for
the arena to use"""
team_name = instance.team.... | from celery import task
from celery.result import AsyncResult
from .models import TeamSubmission
import logging
logger = logging.getLogger(__name__)
@task()
def create_shellai_tag(instance):
"""Tags the repo's HEAD as "ShellAI" to provide a default tag for
the arena to use"""
team_name = instance.team.... | <commit_before>from celery import task
from celery.result import AsyncResult
from .models import TeamSubmission
import logging
logger = logging.getLogger(__name__)
@task()
def create_shellai_tag(instance):
"""Tags the repo's HEAD as "ShellAI" to provide a default tag for
the arena to use"""
team_name =... |
855c7b56ff92efce90dc4953ebabc4aca07f5eb8 | domains/integrator_chains/fmrb_sci_examples/scripts/lqr.py | domains/integrator_chains/fmrb_sci_examples/scripts/lqr.py | #!/usr/bin/env python
from __future__ import print_function
import roslib; roslib.load_manifest('dynamaestro')
import rospy
from dynamaestro.msg import VectorStamped
class LQRController(rospy.Subscriber):
def __init__(self, intopic, outtopic):
rospy.Subscriber.__init__(self, outtopic, VectorStamped, self... | #!/usr/bin/env python
from __future__ import print_function
import roslib; roslib.load_manifest('dynamaestro')
import rospy
from dynamaestro.msg import VectorStamped
from control import lqr
import numpy as np
class StateFeedback(rospy.Subscriber):
def __init__(self, intopic, outtopic, K=None):
rospy.Sub... | Improve LQR example for integrator_chains domain | Improve LQR example for integrator_chains domain
| Python | bsd-3-clause | fmrchallenge/fmrbenchmark,fmrchallenge/fmrbenchmark,fmrchallenge/fmrbenchmark | #!/usr/bin/env python
from __future__ import print_function
import roslib; roslib.load_manifest('dynamaestro')
import rospy
from dynamaestro.msg import VectorStamped
class LQRController(rospy.Subscriber):
def __init__(self, intopic, outtopic):
rospy.Subscriber.__init__(self, outtopic, VectorStamped, self... | #!/usr/bin/env python
from __future__ import print_function
import roslib; roslib.load_manifest('dynamaestro')
import rospy
from dynamaestro.msg import VectorStamped
from control import lqr
import numpy as np
class StateFeedback(rospy.Subscriber):
def __init__(self, intopic, outtopic, K=None):
rospy.Sub... | <commit_before>#!/usr/bin/env python
from __future__ import print_function
import roslib; roslib.load_manifest('dynamaestro')
import rospy
from dynamaestro.msg import VectorStamped
class LQRController(rospy.Subscriber):
def __init__(self, intopic, outtopic):
rospy.Subscriber.__init__(self, outtopic, Vect... | #!/usr/bin/env python
from __future__ import print_function
import roslib; roslib.load_manifest('dynamaestro')
import rospy
from dynamaestro.msg import VectorStamped
from control import lqr
import numpy as np
class StateFeedback(rospy.Subscriber):
def __init__(self, intopic, outtopic, K=None):
rospy.Sub... | #!/usr/bin/env python
from __future__ import print_function
import roslib; roslib.load_manifest('dynamaestro')
import rospy
from dynamaestro.msg import VectorStamped
class LQRController(rospy.Subscriber):
def __init__(self, intopic, outtopic):
rospy.Subscriber.__init__(self, outtopic, VectorStamped, self... | <commit_before>#!/usr/bin/env python
from __future__ import print_function
import roslib; roslib.load_manifest('dynamaestro')
import rospy
from dynamaestro.msg import VectorStamped
class LQRController(rospy.Subscriber):
def __init__(self, intopic, outtopic):
rospy.Subscriber.__init__(self, outtopic, Vect... |
0453402da8ca1522fc08ce4d774a2664953348ee | threaded_messages/management.py | threaded_messages/management.py | from django.conf import settings
from django.utils.translation import ugettext_noop as _
from django.db.models import signals
if "notification" in settings.INSTALLED_APPS:
from notification import models as notification
def create_notice_types(app, created_models, verbosity, **kwargs):
notification.cr... | from django.conf import settings
from django.utils.translation import ugettext_noop as _
from django.db.models import signals
if "notification" in settings.INSTALLED_APPS:
from notification import models as notification
def create_notice_types(app, created_models, verbosity, **kwargs):
notification.cr... | Use post_migrate signal instead of post_syncdb | Use post_migrate signal instead of post_syncdb
| Python | mit | siovene/django-threaded-messages,siovene/django-threaded-messages,siovene/django-threaded-messages | from django.conf import settings
from django.utils.translation import ugettext_noop as _
from django.db.models import signals
if "notification" in settings.INSTALLED_APPS:
from notification import models as notification
def create_notice_types(app, created_models, verbosity, **kwargs):
notification.cr... | from django.conf import settings
from django.utils.translation import ugettext_noop as _
from django.db.models import signals
if "notification" in settings.INSTALLED_APPS:
from notification import models as notification
def create_notice_types(app, created_models, verbosity, **kwargs):
notification.cr... | <commit_before>from django.conf import settings
from django.utils.translation import ugettext_noop as _
from django.db.models import signals
if "notification" in settings.INSTALLED_APPS:
from notification import models as notification
def create_notice_types(app, created_models, verbosity, **kwargs):
... | from django.conf import settings
from django.utils.translation import ugettext_noop as _
from django.db.models import signals
if "notification" in settings.INSTALLED_APPS:
from notification import models as notification
def create_notice_types(app, created_models, verbosity, **kwargs):
notification.cr... | from django.conf import settings
from django.utils.translation import ugettext_noop as _
from django.db.models import signals
if "notification" in settings.INSTALLED_APPS:
from notification import models as notification
def create_notice_types(app, created_models, verbosity, **kwargs):
notification.cr... | <commit_before>from django.conf import settings
from django.utils.translation import ugettext_noop as _
from django.db.models import signals
if "notification" in settings.INSTALLED_APPS:
from notification import models as notification
def create_notice_types(app, created_models, verbosity, **kwargs):
... |
6a830973fa8f29278015d55819dcbd87f0472ac9 | post_office/test_urls.py | post_office/test_urls.py | from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls), name='admin'),
)
| from django.conf.urls import include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = [
url(r'^admin/', include(admin.site.urls), name='admin'),
]
| Fix Django 1.10 url patterns warning | Fix Django 1.10 url patterns warning
| Python | mit | ui/django-post_office,JostCrow/django-post_office,RafRaf/django-post_office,ui/django-post_office,yprez/django-post_office,jrief/django-post_office | from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls), name='admin'),
)
Fix Django 1.10 url patterns warning | from django.conf.urls import include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = [
url(r'^admin/', include(admin.site.urls), name='admin'),
]
| <commit_before>from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls), name='admin'),
)
<commit_msg>Fix Django 1.10 url patterns warning<commit_after> | from django.conf.urls import include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = [
url(r'^admin/', include(admin.site.urls), name='admin'),
]
| from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls), name='admin'),
)
Fix Django 1.10 url patterns warningfrom django.conf.urls import include, url
from django.contrib import admin
admin.autodi... | <commit_before>from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls), name='admin'),
)
<commit_msg>Fix Django 1.10 url patterns warning<commit_after>from django.conf.urls import include, url
from... |
480c89d81e1610d698269c41f4543c38193bef13 | test/test_orthomcl_database.py | test/test_orthomcl_database.py | import shutil
import tempfile
import unittest
import orthomcl_database
class Test(unittest.TestCase):
def setUp(self):
self.run_dir = tempfile.mkdtemp()
def tearDown(self):
shutil.rmtree(self.run_dir)
def test_get_configuration_file(self):
conffile = orthomcl_database.get_confi... | import MySQLdb
import shutil
import tempfile
import unittest
import orthomcl_database
class Test(unittest.TestCase):
def setUp(self):
self.run_dir = tempfile.mkdtemp()
self.credentials = orthomcl_database._get_root_credentials()
def tearDown(self):
shutil.rmtree(self.run_dir)
d... | Expand test to include query on the created database as restricted user | Expand test to include query on the created database as restricted user | Python | mit | ODoSE/odose.nl | import shutil
import tempfile
import unittest
import orthomcl_database
class Test(unittest.TestCase):
def setUp(self):
self.run_dir = tempfile.mkdtemp()
def tearDown(self):
shutil.rmtree(self.run_dir)
def test_get_configuration_file(self):
conffile = orthomcl_database.get_confi... | import MySQLdb
import shutil
import tempfile
import unittest
import orthomcl_database
class Test(unittest.TestCase):
def setUp(self):
self.run_dir = tempfile.mkdtemp()
self.credentials = orthomcl_database._get_root_credentials()
def tearDown(self):
shutil.rmtree(self.run_dir)
d... | <commit_before>import shutil
import tempfile
import unittest
import orthomcl_database
class Test(unittest.TestCase):
def setUp(self):
self.run_dir = tempfile.mkdtemp()
def tearDown(self):
shutil.rmtree(self.run_dir)
def test_get_configuration_file(self):
conffile = orthomcl_dat... | import MySQLdb
import shutil
import tempfile
import unittest
import orthomcl_database
class Test(unittest.TestCase):
def setUp(self):
self.run_dir = tempfile.mkdtemp()
self.credentials = orthomcl_database._get_root_credentials()
def tearDown(self):
shutil.rmtree(self.run_dir)
d... | import shutil
import tempfile
import unittest
import orthomcl_database
class Test(unittest.TestCase):
def setUp(self):
self.run_dir = tempfile.mkdtemp()
def tearDown(self):
shutil.rmtree(self.run_dir)
def test_get_configuration_file(self):
conffile = orthomcl_database.get_confi... | <commit_before>import shutil
import tempfile
import unittest
import orthomcl_database
class Test(unittest.TestCase):
def setUp(self):
self.run_dir = tempfile.mkdtemp()
def tearDown(self):
shutil.rmtree(self.run_dir)
def test_get_configuration_file(self):
conffile = orthomcl_dat... |
082ac65c32c323c36036e0ddac140a87942e9b00 | tests/window/WINDOW_CAPTION.py | tests/window/WINDOW_CAPTION.py | #!/usr/bin/env python
'''Test that the window caption can be set.
Expected behaviour:
Two windows will be opened, one with the caption "Window caption 1"
counting up every second; the other with a Unicode string including
some non-ASCII characters.
Press escape or close either window to finished the ... | #!/usr/bin/env python
'''Test that the window caption can be set.
Expected behaviour:
Two windows will be opened, one with the caption "Window caption 1"
counting up every second; the other with a Unicode string including
some non-ASCII characters.
Press escape or close either window to finished the ... | Make windows bigger in this test so the captions can be read. | Make windows bigger in this test so the captions can be read.
Index: tests/window/WINDOW_CAPTION.py
===================================================================
--- tests/window/WINDOW_CAPTION.py (revision 777)
+++ tests/window/WINDOW_CAPTION.py (working copy)
@@ -19,8 +19,8 @@
class WINDOW_CAPTION(unittest.... | Python | bsd-3-clause | infowantstobeseen/pyglet-darwincore,infowantstobeseen/pyglet-darwincore,infowantstobeseen/pyglet-darwincore,infowantstobeseen/pyglet-darwincore,infowantstobeseen/pyglet-darwincore | #!/usr/bin/env python
'''Test that the window caption can be set.
Expected behaviour:
Two windows will be opened, one with the caption "Window caption 1"
counting up every second; the other with a Unicode string including
some non-ASCII characters.
Press escape or close either window to finished the ... | #!/usr/bin/env python
'''Test that the window caption can be set.
Expected behaviour:
Two windows will be opened, one with the caption "Window caption 1"
counting up every second; the other with a Unicode string including
some non-ASCII characters.
Press escape or close either window to finished the ... | <commit_before>#!/usr/bin/env python
'''Test that the window caption can be set.
Expected behaviour:
Two windows will be opened, one with the caption "Window caption 1"
counting up every second; the other with a Unicode string including
some non-ASCII characters.
Press escape or close either window t... | #!/usr/bin/env python
'''Test that the window caption can be set.
Expected behaviour:
Two windows will be opened, one with the caption "Window caption 1"
counting up every second; the other with a Unicode string including
some non-ASCII characters.
Press escape or close either window to finished the ... | #!/usr/bin/env python
'''Test that the window caption can be set.
Expected behaviour:
Two windows will be opened, one with the caption "Window caption 1"
counting up every second; the other with a Unicode string including
some non-ASCII characters.
Press escape or close either window to finished the ... | <commit_before>#!/usr/bin/env python
'''Test that the window caption can be set.
Expected behaviour:
Two windows will be opened, one with the caption "Window caption 1"
counting up every second; the other with a Unicode string including
some non-ASCII characters.
Press escape or close either window t... |
4f4c3fabe1ccb91ca8f510a6ab81b6f2eb588c17 | openstack/tests/functional/telemetry/v2/test_statistics.py | openstack/tests/functional/telemetry/v2/test_statistics.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | Fix the telemetry statistics test | Fix the telemetry statistics test
This test worked fine on devstack, but failed on the test gate
because not all meters have statistics. Look for a meter with
statistics.
Partial-bug: #1665495
Change-Id: Ife0f1f11c70e926801b48000dd0b4e9d863a865f
| Python | apache-2.0 | briancurtin/python-openstacksdk,dtroyer/python-openstacksdk,dtroyer/python-openstacksdk,openstack/python-openstacksdk,openstack/python-openstacksdk,briancurtin/python-openstacksdk,stackforge/python-openstacksdk,stackforge/python-openstacksdk | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | <commit_before># Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# dist... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | <commit_before># Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# dist... |
0dabb6f4b18ff73f16088b207894d5e647494afb | colors.py | colors.py | from tcpgecko import TCPGecko
from textwrap import wrap
from struct import pack
from binascii import hexlify, unhexlify
import sys
def pokecolor(pos, string):
color = textwrap.wrap(string, 4)
tcp.pokemem(pos, struct.unpack(">I", color[0])[0])
tcp.pokemem(pos + 4, struct.unpack(">I", color[1])[0])
tcp... | from tcpgecko import TCPGecko
from textwrap import wrap
from struct import pack
from binascii import unhexlify
import sys
tcp = TCPGecko("192.168.0.8") #Wii U IP address
Colors = b""
for i in range(1, 4): #Ignores Alpha since it doesn't use it
Color = wrap(sys.argv[i], 2) #Split it into 2 character chunks
fo... | Update ColorHax to 2.3.0 address | Update ColorHax to 2.3.0 address
Need to make pyGecko auto-find it all
| Python | mit | wiiudev/pyGecko,wiiudev/pyGecko | from tcpgecko import TCPGecko
from textwrap import wrap
from struct import pack
from binascii import hexlify, unhexlify
import sys
def pokecolor(pos, string):
color = textwrap.wrap(string, 4)
tcp.pokemem(pos, struct.unpack(">I", color[0])[0])
tcp.pokemem(pos + 4, struct.unpack(">I", color[1])[0])
tcp... | from tcpgecko import TCPGecko
from textwrap import wrap
from struct import pack
from binascii import unhexlify
import sys
tcp = TCPGecko("192.168.0.8") #Wii U IP address
Colors = b""
for i in range(1, 4): #Ignores Alpha since it doesn't use it
Color = wrap(sys.argv[i], 2) #Split it into 2 character chunks
fo... | <commit_before>from tcpgecko import TCPGecko
from textwrap import wrap
from struct import pack
from binascii import hexlify, unhexlify
import sys
def pokecolor(pos, string):
color = textwrap.wrap(string, 4)
tcp.pokemem(pos, struct.unpack(">I", color[0])[0])
tcp.pokemem(pos + 4, struct.unpack(">I", color[... | from tcpgecko import TCPGecko
from textwrap import wrap
from struct import pack
from binascii import unhexlify
import sys
tcp = TCPGecko("192.168.0.8") #Wii U IP address
Colors = b""
for i in range(1, 4): #Ignores Alpha since it doesn't use it
Color = wrap(sys.argv[i], 2) #Split it into 2 character chunks
fo... | from tcpgecko import TCPGecko
from textwrap import wrap
from struct import pack
from binascii import hexlify, unhexlify
import sys
def pokecolor(pos, string):
color = textwrap.wrap(string, 4)
tcp.pokemem(pos, struct.unpack(">I", color[0])[0])
tcp.pokemem(pos + 4, struct.unpack(">I", color[1])[0])
tcp... | <commit_before>from tcpgecko import TCPGecko
from textwrap import wrap
from struct import pack
from binascii import hexlify, unhexlify
import sys
def pokecolor(pos, string):
color = textwrap.wrap(string, 4)
tcp.pokemem(pos, struct.unpack(">I", color[0])[0])
tcp.pokemem(pos + 4, struct.unpack(">I", color[... |
14b3ac31e7c46ce7c0482fd926a5306234a4f1e6 | taipan/_compat.py | taipan/_compat.py | """
Compatibility shims for different Python versions and platforms.
"""
try:
import json
except ImportError:
try:
import simplejson as json
except ImportError:
import django.utils.simplejson as json
import sys
IS_PY3 = sys.version_info[0] == 3
import platform
IS_PYPY = platform.python_im... | """
Compatibility shims for different Python versions and platforms.
"""
try:
import json
except ImportError:
try:
import simplejson as json
except ImportError:
import django.utils.simplejson as json
import sys
IS_PY26 = sys.version[:2] == (2, 6)
IS_PY3 = sys.version_info[0] == 3
import p... | Fix the accidental removal of IS_PY26 | Fix the accidental removal of IS_PY26
| Python | bsd-2-clause | Xion/taipan | """
Compatibility shims for different Python versions and platforms.
"""
try:
import json
except ImportError:
try:
import simplejson as json
except ImportError:
import django.utils.simplejson as json
import sys
IS_PY3 = sys.version_info[0] == 3
import platform
IS_PYPY = platform.python_im... | """
Compatibility shims for different Python versions and platforms.
"""
try:
import json
except ImportError:
try:
import simplejson as json
except ImportError:
import django.utils.simplejson as json
import sys
IS_PY26 = sys.version[:2] == (2, 6)
IS_PY3 = sys.version_info[0] == 3
import p... | <commit_before>"""
Compatibility shims for different Python versions and platforms.
"""
try:
import json
except ImportError:
try:
import simplejson as json
except ImportError:
import django.utils.simplejson as json
import sys
IS_PY3 = sys.version_info[0] == 3
import platform
IS_PYPY = pla... | """
Compatibility shims for different Python versions and platforms.
"""
try:
import json
except ImportError:
try:
import simplejson as json
except ImportError:
import django.utils.simplejson as json
import sys
IS_PY26 = sys.version[:2] == (2, 6)
IS_PY3 = sys.version_info[0] == 3
import p... | """
Compatibility shims for different Python versions and platforms.
"""
try:
import json
except ImportError:
try:
import simplejson as json
except ImportError:
import django.utils.simplejson as json
import sys
IS_PY3 = sys.version_info[0] == 3
import platform
IS_PYPY = platform.python_im... | <commit_before>"""
Compatibility shims for different Python versions and platforms.
"""
try:
import json
except ImportError:
try:
import simplejson as json
except ImportError:
import django.utils.simplejson as json
import sys
IS_PY3 = sys.version_info[0] == 3
import platform
IS_PYPY = pla... |
f52f2aafc204c3b19e04d05ac6fc1f10a4ea2463 | rcbi/rcbi/items.py | rcbi/rcbi/items.py | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class Part(scrapy.Item):
name = scrapy.Field()
site = scrapy.Field()
manufacturer = scrapy.Field()
sku = scrapy.Field()
weight = scr... | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class Part(scrapy.Item):
name = scrapy.Field()
site = scrapy.Field()
manufacturer = scrapy.Field()
sku = scrapy.Field()
weight = scr... | Update comment to be more specific about stock fields | Update comment to be more specific about stock fields
| Python | apache-2.0 | rcbuild-info/scrape,rcbuild-info/scrape | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class Part(scrapy.Item):
name = scrapy.Field()
site = scrapy.Field()
manufacturer = scrapy.Field()
sku = scrapy.Field()
weight = scr... | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class Part(scrapy.Item):
name = scrapy.Field()
site = scrapy.Field()
manufacturer = scrapy.Field()
sku = scrapy.Field()
weight = scr... | <commit_before># -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class Part(scrapy.Item):
name = scrapy.Field()
site = scrapy.Field()
manufacturer = scrapy.Field()
sku = scrapy.Field()
... | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class Part(scrapy.Item):
name = scrapy.Field()
site = scrapy.Field()
manufacturer = scrapy.Field()
sku = scrapy.Field()
weight = scr... | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class Part(scrapy.Item):
name = scrapy.Field()
site = scrapy.Field()
manufacturer = scrapy.Field()
sku = scrapy.Field()
weight = scr... | <commit_before># -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class Part(scrapy.Item):
name = scrapy.Field()
site = scrapy.Field()
manufacturer = scrapy.Field()
sku = scrapy.Field()
... |
288508e0693da5dbfc467a01ac18b31c4f8cc16c | nymms/tests/test_registry.py | nymms/tests/test_registry.py | import unittest
from nymms import registry
from nymms.resources import Command, MonitoringGroup
from weakref import WeakValueDictionary
class TestRegistry(unittest.TestCase):
def tearDown(self):
# Ensure we have a fresh registry after every test
Command.registry.clear()
def test_empty_regist... | import unittest
from nymms import registry
from nymms.resources import Command, MonitoringGroup
from weakref import WeakValueDictionary
class TestRegistry(unittest.TestCase):
def setUp(self):
# Ensure we have a fresh registry before every test
Command.registry.clear()
def test_empty_registry... | Clear command registry BEFORE each test. | Clear command registry BEFORE each test.
| Python | bsd-2-clause | cloudtools/nymms | import unittest
from nymms import registry
from nymms.resources import Command, MonitoringGroup
from weakref import WeakValueDictionary
class TestRegistry(unittest.TestCase):
def tearDown(self):
# Ensure we have a fresh registry after every test
Command.registry.clear()
def test_empty_regist... | import unittest
from nymms import registry
from nymms.resources import Command, MonitoringGroup
from weakref import WeakValueDictionary
class TestRegistry(unittest.TestCase):
def setUp(self):
# Ensure we have a fresh registry before every test
Command.registry.clear()
def test_empty_registry... | <commit_before>import unittest
from nymms import registry
from nymms.resources import Command, MonitoringGroup
from weakref import WeakValueDictionary
class TestRegistry(unittest.TestCase):
def tearDown(self):
# Ensure we have a fresh registry after every test
Command.registry.clear()
def te... | import unittest
from nymms import registry
from nymms.resources import Command, MonitoringGroup
from weakref import WeakValueDictionary
class TestRegistry(unittest.TestCase):
def setUp(self):
# Ensure we have a fresh registry before every test
Command.registry.clear()
def test_empty_registry... | import unittest
from nymms import registry
from nymms.resources import Command, MonitoringGroup
from weakref import WeakValueDictionary
class TestRegistry(unittest.TestCase):
def tearDown(self):
# Ensure we have a fresh registry after every test
Command.registry.clear()
def test_empty_regist... | <commit_before>import unittest
from nymms import registry
from nymms.resources import Command, MonitoringGroup
from weakref import WeakValueDictionary
class TestRegistry(unittest.TestCase):
def tearDown(self):
# Ensure we have a fresh registry after every test
Command.registry.clear()
def te... |
8715e112a8299bc6db831c6b2df08901107a550a | analysis/opensimulator-stats-analyzer/src/ostagraph.py | analysis/opensimulator-stats-analyzer/src/ostagraph.py | #!/usr/bin/python
import argparse
import matplotlib.pyplot as plt
from osta.osta import *
############
### MAIN ###
############
parser = argparse.ArgumentParser(formatter_class = argparse.RawTextHelpFormatter)
parser.add_argument(
'--select',
help = "Select the full name of a stat to graph (e.g. \"scene.Ke... | #!/usr/bin/python
import argparse
import matplotlib.pyplot as plt
from pylab import *
from osta.osta import *
############
### MAIN ###
############
parser = argparse.ArgumentParser(formatter_class = argparse.RawTextHelpFormatter)
parser.add_argument(
'--select',
help = "Select the full name of a stat to gr... | Add --out option to generate graph at specific location instead of interactive display | Add --out option to generate graph at specific location instead of interactive display
| Python | bsd-3-clause | justinccdev/opensimulator-tools,justinccdev/opensimulator-tools,justinccdev/opensimulator-tools,justinccdev/opensimulator-tools | #!/usr/bin/python
import argparse
import matplotlib.pyplot as plt
from osta.osta import *
############
### MAIN ###
############
parser = argparse.ArgumentParser(formatter_class = argparse.RawTextHelpFormatter)
parser.add_argument(
'--select',
help = "Select the full name of a stat to graph (e.g. \"scene.Ke... | #!/usr/bin/python
import argparse
import matplotlib.pyplot as plt
from pylab import *
from osta.osta import *
############
### MAIN ###
############
parser = argparse.ArgumentParser(formatter_class = argparse.RawTextHelpFormatter)
parser.add_argument(
'--select',
help = "Select the full name of a stat to gr... | <commit_before>#!/usr/bin/python
import argparse
import matplotlib.pyplot as plt
from osta.osta import *
############
### MAIN ###
############
parser = argparse.ArgumentParser(formatter_class = argparse.RawTextHelpFormatter)
parser.add_argument(
'--select',
help = "Select the full name of a stat to graph (... | #!/usr/bin/python
import argparse
import matplotlib.pyplot as plt
from pylab import *
from osta.osta import *
############
### MAIN ###
############
parser = argparse.ArgumentParser(formatter_class = argparse.RawTextHelpFormatter)
parser.add_argument(
'--select',
help = "Select the full name of a stat to gr... | #!/usr/bin/python
import argparse
import matplotlib.pyplot as plt
from osta.osta import *
############
### MAIN ###
############
parser = argparse.ArgumentParser(formatter_class = argparse.RawTextHelpFormatter)
parser.add_argument(
'--select',
help = "Select the full name of a stat to graph (e.g. \"scene.Ke... | <commit_before>#!/usr/bin/python
import argparse
import matplotlib.pyplot as plt
from osta.osta import *
############
### MAIN ###
############
parser = argparse.ArgumentParser(formatter_class = argparse.RawTextHelpFormatter)
parser.add_argument(
'--select',
help = "Select the full name of a stat to graph (... |
c1dc571faa9bf2ae0e0a580365943806826ced4a | src/adhocracy_spd/adhocracy_spd/workflows/digital_leben.py | src/adhocracy_spd/adhocracy_spd/workflows/digital_leben.py | """Digital leben workflow."""
from adhocracy_core.workflows import add_workflow
from adhocracy_core.workflows.standard import standard_meta
digital_leben_meta = standard_meta \
.transform(('states', 'participate', 'acm'),
{'principals': [ 'parti... | """Digital leben workflow."""
from adhocracy_core.workflows import add_workflow
from adhocracy_core.workflows.standard import standard_meta
digital_leben_meta = standard_meta \
.transform(('states', 'participate', 'acm'),
{'principals': ['participan... | Make flake8 happy for spd | Make flake8 happy for spd
| Python | agpl-3.0 | liqd/adhocracy3.mercator,xs2maverick/adhocracy3.mercator,liqd/adhocracy3.mercator,fhartwig/adhocracy3.mercator,fhartwig/adhocracy3.mercator,fhartwig/adhocracy3.mercator,xs2maverick/adhocracy3.mercator,liqd/adhocracy3.mercator,liqd/adhocracy3.mercator,fhartwig/adhocracy3.mercator,liqd/adhocracy3.mercator,xs2maverick/adh... | """Digital leben workflow."""
from adhocracy_core.workflows import add_workflow
from adhocracy_core.workflows.standard import standard_meta
digital_leben_meta = standard_meta \
.transform(('states', 'participate', 'acm'),
{'principals': [ 'parti... | """Digital leben workflow."""
from adhocracy_core.workflows import add_workflow
from adhocracy_core.workflows.standard import standard_meta
digital_leben_meta = standard_meta \
.transform(('states', 'participate', 'acm'),
{'principals': ['participan... | <commit_before>"""Digital leben workflow."""
from adhocracy_core.workflows import add_workflow
from adhocracy_core.workflows.standard import standard_meta
digital_leben_meta = standard_meta \
.transform(('states', 'participate', 'acm'),
{'principals': [ ... | """Digital leben workflow."""
from adhocracy_core.workflows import add_workflow
from adhocracy_core.workflows.standard import standard_meta
digital_leben_meta = standard_meta \
.transform(('states', 'participate', 'acm'),
{'principals': ['participan... | """Digital leben workflow."""
from adhocracy_core.workflows import add_workflow
from adhocracy_core.workflows.standard import standard_meta
digital_leben_meta = standard_meta \
.transform(('states', 'participate', 'acm'),
{'principals': [ 'parti... | <commit_before>"""Digital leben workflow."""
from adhocracy_core.workflows import add_workflow
from adhocracy_core.workflows.standard import standard_meta
digital_leben_meta = standard_meta \
.transform(('states', 'participate', 'acm'),
{'principals': [ ... |
9ad85a6986c8350cb082f23d9508301c40ca440d | resolwe_bio/api/views.py | resolwe_bio/api/views.py | from django.db.models import Q
from rest_framework.decorators import list_route
from rest_framework.response import Response
from resolwe.flow.models import Collection
from resolwe.flow.views import CollectionViewSet
class SampleViewSet(CollectionViewSet):
queryset = Collection.objects.filter(descriptor_schema_... | from django.db.models import Max, Q
from rest_framework.decorators import list_route
from rest_framework.response import Response
from resolwe.flow.models import Collection
from resolwe.flow.views import CollectionViewSet
class SampleViewSet(CollectionViewSet):
queryset = Collection.objects.filter(descriptor_sc... | Order samples by date created of the newest Data | Order samples by date created of the newest Data
| Python | apache-2.0 | genialis/resolwe-bio,genialis/resolwe-bio,genialis/resolwe-bio,genialis/resolwe-bio | from django.db.models import Q
from rest_framework.decorators import list_route
from rest_framework.response import Response
from resolwe.flow.models import Collection
from resolwe.flow.views import CollectionViewSet
class SampleViewSet(CollectionViewSet):
queryset = Collection.objects.filter(descriptor_schema_... | from django.db.models import Max, Q
from rest_framework.decorators import list_route
from rest_framework.response import Response
from resolwe.flow.models import Collection
from resolwe.flow.views import CollectionViewSet
class SampleViewSet(CollectionViewSet):
queryset = Collection.objects.filter(descriptor_sc... | <commit_before>from django.db.models import Q
from rest_framework.decorators import list_route
from rest_framework.response import Response
from resolwe.flow.models import Collection
from resolwe.flow.views import CollectionViewSet
class SampleViewSet(CollectionViewSet):
queryset = Collection.objects.filter(des... | from django.db.models import Max, Q
from rest_framework.decorators import list_route
from rest_framework.response import Response
from resolwe.flow.models import Collection
from resolwe.flow.views import CollectionViewSet
class SampleViewSet(CollectionViewSet):
queryset = Collection.objects.filter(descriptor_sc... | from django.db.models import Q
from rest_framework.decorators import list_route
from rest_framework.response import Response
from resolwe.flow.models import Collection
from resolwe.flow.views import CollectionViewSet
class SampleViewSet(CollectionViewSet):
queryset = Collection.objects.filter(descriptor_schema_... | <commit_before>from django.db.models import Q
from rest_framework.decorators import list_route
from rest_framework.response import Response
from resolwe.flow.models import Collection
from resolwe.flow.views import CollectionViewSet
class SampleViewSet(CollectionViewSet):
queryset = Collection.objects.filter(des... |
08995bcb577276af1d5b2b8ed8eb68d2678ddc4d | game/tests.py | game/tests.py | import datetime
from django.utils import timezone
from django.test import TestCase
from django.urls import reverse | import datetime
from django.utils import timezone
from django.test import TestCase
from django.urls import reverse
def create_user(question_text, days):
pass
class UserViewTests(TestCase):
def test_users_view_exists(self):
response = self.client.get(reverse('game:users'))
self.assertEqual(res... | Set up test.py file and add skeleton for UserViewTests and RegistrationTests. Also add test to make sure user view exists | Set up test.py file and add skeleton for UserViewTests and RegistrationTests. Also add test to make sure user view exists
| Python | mit | shintouki/augmented-pandemic,shintouki/augmented-pandemic,shintouki/augmented-pandemic | import datetime
from django.utils import timezone
from django.test import TestCase
from django.urls import reverseSet up test.py file and add skeleton for UserViewTests and RegistrationTests. Also add test to make sure user view exists | import datetime
from django.utils import timezone
from django.test import TestCase
from django.urls import reverse
def create_user(question_text, days):
pass
class UserViewTests(TestCase):
def test_users_view_exists(self):
response = self.client.get(reverse('game:users'))
self.assertEqual(res... | <commit_before>import datetime
from django.utils import timezone
from django.test import TestCase
from django.urls import reverse<commit_msg>Set up test.py file and add skeleton for UserViewTests and RegistrationTests. Also add test to make sure user view exists<commit_after> | import datetime
from django.utils import timezone
from django.test import TestCase
from django.urls import reverse
def create_user(question_text, days):
pass
class UserViewTests(TestCase):
def test_users_view_exists(self):
response = self.client.get(reverse('game:users'))
self.assertEqual(res... | import datetime
from django.utils import timezone
from django.test import TestCase
from django.urls import reverseSet up test.py file and add skeleton for UserViewTests and RegistrationTests. Also add test to make sure user view existsimport datetime
from django.utils import timezone
from django.test import TestCase
... | <commit_before>import datetime
from django.utils import timezone
from django.test import TestCase
from django.urls import reverse<commit_msg>Set up test.py file and add skeleton for UserViewTests and RegistrationTests. Also add test to make sure user view exists<commit_after>import datetime
from django.utils import t... |
617cda3f3d7732b28b127fc45cb7ad4344f0c77f | votes/views.py | votes/views.py | import json
from django.shortcuts import render, get_object_or_404, render_to_response
from django.http import HttpResponse
from django.views.generic import View
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from votes.models import Vote
from filters.... | import json
from django.shortcuts import render, get_object_or_404, render_to_response
from django.http import HttpResponse
from django.views.generic import View
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from votes.models import Vote
from filters.... | Add error handling to VoteView | Add error handling to VoteView
| Python | mit | OpenJUB/jay,kuboschek/jay,OpenJUB/jay,OpenJUB/jay,kuboschek/jay,kuboschek/jay | import json
from django.shortcuts import render, get_object_or_404, render_to_response
from django.http import HttpResponse
from django.views.generic import View
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from votes.models import Vote
from filters.... | import json
from django.shortcuts import render, get_object_or_404, render_to_response
from django.http import HttpResponse
from django.views.generic import View
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from votes.models import Vote
from filters.... | <commit_before>import json
from django.shortcuts import render, get_object_or_404, render_to_response
from django.http import HttpResponse
from django.views.generic import View
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from votes.models import Vot... | import json
from django.shortcuts import render, get_object_or_404, render_to_response
from django.http import HttpResponse
from django.views.generic import View
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from votes.models import Vote
from filters.... | import json
from django.shortcuts import render, get_object_or_404, render_to_response
from django.http import HttpResponse
from django.views.generic import View
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from votes.models import Vote
from filters.... | <commit_before>import json
from django.shortcuts import render, get_object_or_404, render_to_response
from django.http import HttpResponse
from django.views.generic import View
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from votes.models import Vot... |
336769417acfdc7d61394008952dc124cc889b3c | changes/api/serializer/models/jobstep.py | changes/api/serializer/models/jobstep.py | from changes.api.serializer import Serializer, register
from changes.models import JobStep
@register(JobStep)
class JobStepSerializer(Serializer):
def serialize(self, instance, attrs):
return {
'id': instance.id.hex,
'name': instance.label,
'phase': {
'i... | from changes.api.serializer import Serializer, register
from changes.models import JobStep
@register(JobStep)
class JobStepSerializer(Serializer):
def serialize(self, instance, attrs):
return {
'id': instance.id.hex,
'name': instance.label,
'phase': {
'i... | Add data to JobStep serializer | Add data to JobStep serializer
| Python | apache-2.0 | dropbox/changes,bowlofstew/changes,dropbox/changes,wfxiang08/changes,bowlofstew/changes,wfxiang08/changes,bowlofstew/changes,wfxiang08/changes,wfxiang08/changes,dropbox/changes,bowlofstew/changes,dropbox/changes | from changes.api.serializer import Serializer, register
from changes.models import JobStep
@register(JobStep)
class JobStepSerializer(Serializer):
def serialize(self, instance, attrs):
return {
'id': instance.id.hex,
'name': instance.label,
'phase': {
'i... | from changes.api.serializer import Serializer, register
from changes.models import JobStep
@register(JobStep)
class JobStepSerializer(Serializer):
def serialize(self, instance, attrs):
return {
'id': instance.id.hex,
'name': instance.label,
'phase': {
'i... | <commit_before>from changes.api.serializer import Serializer, register
from changes.models import JobStep
@register(JobStep)
class JobStepSerializer(Serializer):
def serialize(self, instance, attrs):
return {
'id': instance.id.hex,
'name': instance.label,
'phase': {
... | from changes.api.serializer import Serializer, register
from changes.models import JobStep
@register(JobStep)
class JobStepSerializer(Serializer):
def serialize(self, instance, attrs):
return {
'id': instance.id.hex,
'name': instance.label,
'phase': {
'i... | from changes.api.serializer import Serializer, register
from changes.models import JobStep
@register(JobStep)
class JobStepSerializer(Serializer):
def serialize(self, instance, attrs):
return {
'id': instance.id.hex,
'name': instance.label,
'phase': {
'i... | <commit_before>from changes.api.serializer import Serializer, register
from changes.models import JobStep
@register(JobStep)
class JobStepSerializer(Serializer):
def serialize(self, instance, attrs):
return {
'id': instance.id.hex,
'name': instance.label,
'phase': {
... |
32e70ee06be67cb9058b2da7dc1a714272c6a07a | pyQuantuccia/setup.py | pyQuantuccia/setup.py | import setuptools
qu_ext = setuptools.Extension(
'quantuccia',
include_dirs=['src/Quantuccia'],
sources=['src/pyQuantuccia.cpp']
)
setuptools.setup(
name='pyQuantuccia',
author='Jack Grahl',
author_email='[email protected]',
version='0.1.0',
packages=['pyQuantuccia'],
ext_module... | import setuptools
qu_ext = setuptools.Extension(
'quantuccia',
include_dirs=['src/Quantuccia'],
sources=['src/pyQuantuccia.cpp']
)
setuptools.setup(
name='pyQuantuccia',
author='Jack Grahl',
author_email='[email protected]',
version='0.1.0',
packages=['pyQuantuccia'],
test_suite... | Add the location of tests. | Add the location of tests.
| Python | bsd-3-clause | jwg4/pyQuantuccia,jwg4/pyQuantuccia | import setuptools
qu_ext = setuptools.Extension(
'quantuccia',
include_dirs=['src/Quantuccia'],
sources=['src/pyQuantuccia.cpp']
)
setuptools.setup(
name='pyQuantuccia',
author='Jack Grahl',
author_email='[email protected]',
version='0.1.0',
packages=['pyQuantuccia'],
ext_module... | import setuptools
qu_ext = setuptools.Extension(
'quantuccia',
include_dirs=['src/Quantuccia'],
sources=['src/pyQuantuccia.cpp']
)
setuptools.setup(
name='pyQuantuccia',
author='Jack Grahl',
author_email='[email protected]',
version='0.1.0',
packages=['pyQuantuccia'],
test_suite... | <commit_before>import setuptools
qu_ext = setuptools.Extension(
'quantuccia',
include_dirs=['src/Quantuccia'],
sources=['src/pyQuantuccia.cpp']
)
setuptools.setup(
name='pyQuantuccia',
author='Jack Grahl',
author_email='[email protected]',
version='0.1.0',
packages=['pyQuantuccia'],... | import setuptools
qu_ext = setuptools.Extension(
'quantuccia',
include_dirs=['src/Quantuccia'],
sources=['src/pyQuantuccia.cpp']
)
setuptools.setup(
name='pyQuantuccia',
author='Jack Grahl',
author_email='[email protected]',
version='0.1.0',
packages=['pyQuantuccia'],
test_suite... | import setuptools
qu_ext = setuptools.Extension(
'quantuccia',
include_dirs=['src/Quantuccia'],
sources=['src/pyQuantuccia.cpp']
)
setuptools.setup(
name='pyQuantuccia',
author='Jack Grahl',
author_email='[email protected]',
version='0.1.0',
packages=['pyQuantuccia'],
ext_module... | <commit_before>import setuptools
qu_ext = setuptools.Extension(
'quantuccia',
include_dirs=['src/Quantuccia'],
sources=['src/pyQuantuccia.cpp']
)
setuptools.setup(
name='pyQuantuccia',
author='Jack Grahl',
author_email='[email protected]',
version='0.1.0',
packages=['pyQuantuccia'],... |
6d97b723915e5de7a008e5d7bdd44e7883967fdc | retdec/tools/__init__.py | retdec/tools/__init__.py | #
# Project: retdec-python
# Copyright: (c) 2015-2016 by Petr Zemek <[email protected]> and contributors
# License: MIT, see the LICENSE file for more details
#
"""Tools that use the library to analyze and decompile files."""
from retdec import DEFAULT_API_URL
from retdec import __version__
def _add_arguments_sh... | #
# Project: retdec-python
# Copyright: (c) 2015-2016 by Petr Zemek <[email protected]> and contributors
# License: MIT, see the LICENSE file for more details
#
"""Tools that use the library to analyze and decompile files."""
from retdec import DEFAULT_API_URL
from retdec import __version__
def _add_arguments_sh... | Simplify the help message for the -k/--api-key parameter. | Simplify the help message for the -k/--api-key parameter.
We can use the '%(default)s' placeholder instead of string formatting.
| Python | mit | s3rvac/retdec-python | #
# Project: retdec-python
# Copyright: (c) 2015-2016 by Petr Zemek <[email protected]> and contributors
# License: MIT, see the LICENSE file for more details
#
"""Tools that use the library to analyze and decompile files."""
from retdec import DEFAULT_API_URL
from retdec import __version__
def _add_arguments_sh... | #
# Project: retdec-python
# Copyright: (c) 2015-2016 by Petr Zemek <[email protected]> and contributors
# License: MIT, see the LICENSE file for more details
#
"""Tools that use the library to analyze and decompile files."""
from retdec import DEFAULT_API_URL
from retdec import __version__
def _add_arguments_sh... | <commit_before>#
# Project: retdec-python
# Copyright: (c) 2015-2016 by Petr Zemek <[email protected]> and contributors
# License: MIT, see the LICENSE file for more details
#
"""Tools that use the library to analyze and decompile files."""
from retdec import DEFAULT_API_URL
from retdec import __version__
def _a... | #
# Project: retdec-python
# Copyright: (c) 2015-2016 by Petr Zemek <[email protected]> and contributors
# License: MIT, see the LICENSE file for more details
#
"""Tools that use the library to analyze and decompile files."""
from retdec import DEFAULT_API_URL
from retdec import __version__
def _add_arguments_sh... | #
# Project: retdec-python
# Copyright: (c) 2015-2016 by Petr Zemek <[email protected]> and contributors
# License: MIT, see the LICENSE file for more details
#
"""Tools that use the library to analyze and decompile files."""
from retdec import DEFAULT_API_URL
from retdec import __version__
def _add_arguments_sh... | <commit_before>#
# Project: retdec-python
# Copyright: (c) 2015-2016 by Petr Zemek <[email protected]> and contributors
# License: MIT, see the LICENSE file for more details
#
"""Tools that use the library to analyze and decompile files."""
from retdec import DEFAULT_API_URL
from retdec import __version__
def _a... |
7d9d6893a9fc01ccb74c27be4749ab512a3893a0 | tests/settings.py | tests/settings.py | import os
BASE_PATH = os.path.abspath(os.path.dirname(__file__))
MEDIA_ROOT = os.path.normpath(os.path.join(BASE_PATH, 'media'))
SECRET_KEY = 'not secret'
INSTALLED_APPS = ('simpleimages', 'tests')
TEMPLATE_DEBUG = DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'N... | import os
BASE_PATH = os.path.abspath(os.path.dirname(__file__))
MEDIA_ROOT = os.path.normpath(os.path.join(BASE_PATH, 'media'))
SECRET_KEY = 'not secret'
INSTALLED_APPS = ('simpleimages', 'tests')
TEMPLATE_DEBUG = DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
},
}
| Use in memory database for tests | Use in memory database for tests
| Python | mit | saulshanabrook/django-simpleimages | import os
BASE_PATH = os.path.abspath(os.path.dirname(__file__))
MEDIA_ROOT = os.path.normpath(os.path.join(BASE_PATH, 'media'))
SECRET_KEY = 'not secret'
INSTALLED_APPS = ('simpleimages', 'tests')
TEMPLATE_DEBUG = DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'N... | import os
BASE_PATH = os.path.abspath(os.path.dirname(__file__))
MEDIA_ROOT = os.path.normpath(os.path.join(BASE_PATH, 'media'))
SECRET_KEY = 'not secret'
INSTALLED_APPS = ('simpleimages', 'tests')
TEMPLATE_DEBUG = DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
},
}
| <commit_before>import os
BASE_PATH = os.path.abspath(os.path.dirname(__file__))
MEDIA_ROOT = os.path.normpath(os.path.join(BASE_PATH, 'media'))
SECRET_KEY = 'not secret'
INSTALLED_APPS = ('simpleimages', 'tests')
TEMPLATE_DEBUG = DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlit... | import os
BASE_PATH = os.path.abspath(os.path.dirname(__file__))
MEDIA_ROOT = os.path.normpath(os.path.join(BASE_PATH, 'media'))
SECRET_KEY = 'not secret'
INSTALLED_APPS = ('simpleimages', 'tests')
TEMPLATE_DEBUG = DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
},
}
| import os
BASE_PATH = os.path.abspath(os.path.dirname(__file__))
MEDIA_ROOT = os.path.normpath(os.path.join(BASE_PATH, 'media'))
SECRET_KEY = 'not secret'
INSTALLED_APPS = ('simpleimages', 'tests')
TEMPLATE_DEBUG = DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'N... | <commit_before>import os
BASE_PATH = os.path.abspath(os.path.dirname(__file__))
MEDIA_ROOT = os.path.normpath(os.path.join(BASE_PATH, 'media'))
SECRET_KEY = 'not secret'
INSTALLED_APPS = ('simpleimages', 'tests')
TEMPLATE_DEBUG = DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlit... |
bc8ecce3699b22ca0fd80c67172a39d6afded567 | scripts/generic-script.py | scripts/generic-script.py | #!/usr/bin/python
import os
import sys
maybeRoot = os.path.dirname(os.path.dirname(__file__))
if os.path.exists(os.path.join(maybeRoot, 'mint', 'lib')):
sys.path.insert(maybeRoot)
from mint.scripts import some_module
sys.exit(some_module.Script().run())
| #!/usr/bin/python
import os
import sys
maybeRoot = os.path.dirname(os.path.dirname(__file__))
if os.path.exists(os.path.join(maybeRoot, 'mint', 'lib')):
sys.path.insert(0, maybeRoot)
from mint.scripts import some_module
sys.exit(some_module.Script().run())
| Fix bug in generic script when running from checkout | Fix bug in generic script when running from checkout
| Python | apache-2.0 | sassoftware/mint,sassoftware/mint,sassoftware/mint,sassoftware/mint,sassoftware/mint | #!/usr/bin/python
import os
import sys
maybeRoot = os.path.dirname(os.path.dirname(__file__))
if os.path.exists(os.path.join(maybeRoot, 'mint', 'lib')):
sys.path.insert(maybeRoot)
from mint.scripts import some_module
sys.exit(some_module.Script().run())
Fix bug in generic script when running from checkout | #!/usr/bin/python
import os
import sys
maybeRoot = os.path.dirname(os.path.dirname(__file__))
if os.path.exists(os.path.join(maybeRoot, 'mint', 'lib')):
sys.path.insert(0, maybeRoot)
from mint.scripts import some_module
sys.exit(some_module.Script().run())
| <commit_before>#!/usr/bin/python
import os
import sys
maybeRoot = os.path.dirname(os.path.dirname(__file__))
if os.path.exists(os.path.join(maybeRoot, 'mint', 'lib')):
sys.path.insert(maybeRoot)
from mint.scripts import some_module
sys.exit(some_module.Script().run())
<commit_msg>Fix bug in generic script when ru... | #!/usr/bin/python
import os
import sys
maybeRoot = os.path.dirname(os.path.dirname(__file__))
if os.path.exists(os.path.join(maybeRoot, 'mint', 'lib')):
sys.path.insert(0, maybeRoot)
from mint.scripts import some_module
sys.exit(some_module.Script().run())
| #!/usr/bin/python
import os
import sys
maybeRoot = os.path.dirname(os.path.dirname(__file__))
if os.path.exists(os.path.join(maybeRoot, 'mint', 'lib')):
sys.path.insert(maybeRoot)
from mint.scripts import some_module
sys.exit(some_module.Script().run())
Fix bug in generic script when running from checkout#!/usr/b... | <commit_before>#!/usr/bin/python
import os
import sys
maybeRoot = os.path.dirname(os.path.dirname(__file__))
if os.path.exists(os.path.join(maybeRoot, 'mint', 'lib')):
sys.path.insert(maybeRoot)
from mint.scripts import some_module
sys.exit(some_module.Script().run())
<commit_msg>Fix bug in generic script when ru... |
c1893024ebd04a8eee14e2197791d6bab1985f2b | sheldon/storage.py | sheldon/storage.py | # -*- coding: utf-8 -*-
"""
Interface to Redis-storage.
@author: Seva Zhidkov
@contact: [email protected]
@license: The MIT license
Copyright (C) 2015
"""
from .utils import logger
# We will catch all import exceptions in bot.py
from redis import StrictRedis
class Storage:
def __init__(self, bot):
... | # -*- coding: utf-8 -*-
"""
Interface to Redis-storage.
@author: Seva Zhidkov
@contact: [email protected]
@license: The MIT license
Copyright (C) 2015
"""
from .utils import logger
# We will catch all import exceptions in bot.py
from redis import StrictRedis
class Storage:
def __init__(self, bot):
... | Delete 'return' to refactor code | Delete 'return' to refactor code
| Python | mit | lises/sheldon | # -*- coding: utf-8 -*-
"""
Interface to Redis-storage.
@author: Seva Zhidkov
@contact: [email protected]
@license: The MIT license
Copyright (C) 2015
"""
from .utils import logger
# We will catch all import exceptions in bot.py
from redis import StrictRedis
class Storage:
def __init__(self, bot):
... | # -*- coding: utf-8 -*-
"""
Interface to Redis-storage.
@author: Seva Zhidkov
@contact: [email protected]
@license: The MIT license
Copyright (C) 2015
"""
from .utils import logger
# We will catch all import exceptions in bot.py
from redis import StrictRedis
class Storage:
def __init__(self, bot):
... | <commit_before># -*- coding: utf-8 -*-
"""
Interface to Redis-storage.
@author: Seva Zhidkov
@contact: [email protected]
@license: The MIT license
Copyright (C) 2015
"""
from .utils import logger
# We will catch all import exceptions in bot.py
from redis import StrictRedis
class Storage:
def __init__(self... | # -*- coding: utf-8 -*-
"""
Interface to Redis-storage.
@author: Seva Zhidkov
@contact: [email protected]
@license: The MIT license
Copyright (C) 2015
"""
from .utils import logger
# We will catch all import exceptions in bot.py
from redis import StrictRedis
class Storage:
def __init__(self, bot):
... | # -*- coding: utf-8 -*-
"""
Interface to Redis-storage.
@author: Seva Zhidkov
@contact: [email protected]
@license: The MIT license
Copyright (C) 2015
"""
from .utils import logger
# We will catch all import exceptions in bot.py
from redis import StrictRedis
class Storage:
def __init__(self, bot):
... | <commit_before># -*- coding: utf-8 -*-
"""
Interface to Redis-storage.
@author: Seva Zhidkov
@contact: [email protected]
@license: The MIT license
Copyright (C) 2015
"""
from .utils import logger
# We will catch all import exceptions in bot.py
from redis import StrictRedis
class Storage:
def __init__(self... |
8b5f3576ee30c1f50b3d3c5bd477b85ba4ec760e | plinth/modules/sso/__init__.py | plinth/modules/sso/__init__.py | #
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | #
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | Make ttf-bitstream-vera a managed package | captcha: Make ttf-bitstream-vera a managed package
Signed-off-by: Joseph Nuthalpati <[email protected]>
Reviewed-by: James Valleroy <[email protected]>
| Python | agpl-3.0 | harry-7/Plinth,harry-7/Plinth,harry-7/Plinth,harry-7/Plinth,harry-7/Plinth | #
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | #
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | <commit_before>#
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This progra... | #
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | #
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | <commit_before>#
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This progra... |
3f065d3e6b54912b2d78a70b5fda98d0476c3f09 | tlsep/__main__.py | tlsep/__main__.py | # -*- test-case-name: tlsep.test.test_scripts -*-
# Copyright (c) Hynek Schlawack, Richard Wall
# See LICENSE for details.
"""
eg tlsep full.cert.getdnsapi.net 443 tcp
"""
import sys
from twisted.internet import task, threads
from tlsep import _dane
def main():
if len(sys.argv) != 4:
print "Usage: {0} ... | # -*- test-case-name: tlsep.test.test_scripts -*-
# Copyright (c) Hynek Schlawack, Richard Wall
# See LICENSE for details.
"""
eg tlsep full.cert.getdnsapi.net 443 tcp
"""
import sys
from twisted.internet import task, threads, defer
from tlsep import _dane, _tls
def printResult(res):
tlsaRecord, serverCertifi... | Check the server cert using matchesCertificate | Check the server cert using matchesCertificate
| Python | mit | hynek/tnw | # -*- test-case-name: tlsep.test.test_scripts -*-
# Copyright (c) Hynek Schlawack, Richard Wall
# See LICENSE for details.
"""
eg tlsep full.cert.getdnsapi.net 443 tcp
"""
import sys
from twisted.internet import task, threads
from tlsep import _dane
def main():
if len(sys.argv) != 4:
print "Usage: {0} ... | # -*- test-case-name: tlsep.test.test_scripts -*-
# Copyright (c) Hynek Schlawack, Richard Wall
# See LICENSE for details.
"""
eg tlsep full.cert.getdnsapi.net 443 tcp
"""
import sys
from twisted.internet import task, threads, defer
from tlsep import _dane, _tls
def printResult(res):
tlsaRecord, serverCertifi... | <commit_before># -*- test-case-name: tlsep.test.test_scripts -*-
# Copyright (c) Hynek Schlawack, Richard Wall
# See LICENSE for details.
"""
eg tlsep full.cert.getdnsapi.net 443 tcp
"""
import sys
from twisted.internet import task, threads
from tlsep import _dane
def main():
if len(sys.argv) != 4:
pri... | # -*- test-case-name: tlsep.test.test_scripts -*-
# Copyright (c) Hynek Schlawack, Richard Wall
# See LICENSE for details.
"""
eg tlsep full.cert.getdnsapi.net 443 tcp
"""
import sys
from twisted.internet import task, threads, defer
from tlsep import _dane, _tls
def printResult(res):
tlsaRecord, serverCertifi... | # -*- test-case-name: tlsep.test.test_scripts -*-
# Copyright (c) Hynek Schlawack, Richard Wall
# See LICENSE for details.
"""
eg tlsep full.cert.getdnsapi.net 443 tcp
"""
import sys
from twisted.internet import task, threads
from tlsep import _dane
def main():
if len(sys.argv) != 4:
print "Usage: {0} ... | <commit_before># -*- test-case-name: tlsep.test.test_scripts -*-
# Copyright (c) Hynek Schlawack, Richard Wall
# See LICENSE for details.
"""
eg tlsep full.cert.getdnsapi.net 443 tcp
"""
import sys
from twisted.internet import task, threads
from tlsep import _dane
def main():
if len(sys.argv) != 4:
pri... |
7ace27a6a114e381a30ac9760880b68277a868fc | python_scripts/mc_config.py | python_scripts/mc_config.py | #!/usr/bin/python
import yaml
def read_config():
yml_file = open('/home/dlarochelle/git_dev/mediacloud/mediawords.yml', 'rb')
config_file = yaml.load( yml_file )
return config_file
| #!/usr/bin/python
import yaml
import os.path
_config_file_base_name = 'mediawords.yml'
_config_file_name = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'mediawords.yml'))
def read_config():
yml_file = open(_config_file_name, 'rb')
config_file = yaml.load( yml_file )
return config_file
| Use relative path location for mediawords.yml. | Use relative path location for mediawords.yml.
| Python | agpl-3.0 | berkmancenter/mediacloud,AchyuthIIIT/mediacloud,berkmancenter/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud,AchyuthIIIT/mediacloud,berkmancenter... | #!/usr/bin/python
import yaml
def read_config():
yml_file = open('/home/dlarochelle/git_dev/mediacloud/mediawords.yml', 'rb')
config_file = yaml.load( yml_file )
return config_file
Use relative path location for mediawords.yml. | #!/usr/bin/python
import yaml
import os.path
_config_file_base_name = 'mediawords.yml'
_config_file_name = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'mediawords.yml'))
def read_config():
yml_file = open(_config_file_name, 'rb')
config_file = yaml.load( yml_file )
return config_file
| <commit_before>#!/usr/bin/python
import yaml
def read_config():
yml_file = open('/home/dlarochelle/git_dev/mediacloud/mediawords.yml', 'rb')
config_file = yaml.load( yml_file )
return config_file
<commit_msg>Use relative path location for mediawords.yml.<commit_after> | #!/usr/bin/python
import yaml
import os.path
_config_file_base_name = 'mediawords.yml'
_config_file_name = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'mediawords.yml'))
def read_config():
yml_file = open(_config_file_name, 'rb')
config_file = yaml.load( yml_file )
return config_file
| #!/usr/bin/python
import yaml
def read_config():
yml_file = open('/home/dlarochelle/git_dev/mediacloud/mediawords.yml', 'rb')
config_file = yaml.load( yml_file )
return config_file
Use relative path location for mediawords.yml.#!/usr/bin/python
import yaml
import os.path
_config_file_base_name = 'med... | <commit_before>#!/usr/bin/python
import yaml
def read_config():
yml_file = open('/home/dlarochelle/git_dev/mediacloud/mediawords.yml', 'rb')
config_file = yaml.load( yml_file )
return config_file
<commit_msg>Use relative path location for mediawords.yml.<commit_after>#!/usr/bin/python
import yaml
impo... |
0652ab317db79ad7859aafba505c016cd6d58614 | modules/combined/tests/catch_release/catch_release_test.py | modules/combined/tests/catch_release/catch_release_test.py | from options import *
test = { INPUT : 'catch_release.i',
EXODIFF : ['catch_release_out.e']}
| from options import *
test = { INPUT : 'catch_release.i',
EXODIFF : ['catch_release_out.e'],
SKIP : 'temp'
}
| Test passes on my machine, dies on others. Skipping for now. | Test passes on my machine, dies on others. Skipping for now.
r8830
| Python | lgpl-2.1 | WilkAndy/moose,jinmm1992/moose,zzyfisherman/moose,tonkmr/moose,yipenggao/moose,tonkmr/moose,raghavaggarwal/moose,lindsayad/moose,SudiptaBiswas/moose,zzyfisherman/moose,YaqiWang/moose,permcody/moose,raghavaggarwal/moose,laagesen/moose,nuclear-wizard/moose,jasondhales/moose,idaholab/moose,harterj/moose,raghavaggarwal/moo... | from options import *
test = { INPUT : 'catch_release.i',
EXODIFF : ['catch_release_out.e']}
Test passes on my machine, dies on others. Skipping for now.
r8830 | from options import *
test = { INPUT : 'catch_release.i',
EXODIFF : ['catch_release_out.e'],
SKIP : 'temp'
}
| <commit_before>from options import *
test = { INPUT : 'catch_release.i',
EXODIFF : ['catch_release_out.e']}
<commit_msg>Test passes on my machine, dies on others. Skipping for now.
r8830<commit_after> | from options import *
test = { INPUT : 'catch_release.i',
EXODIFF : ['catch_release_out.e'],
SKIP : 'temp'
}
| from options import *
test = { INPUT : 'catch_release.i',
EXODIFF : ['catch_release_out.e']}
Test passes on my machine, dies on others. Skipping for now.
r8830from options import *
test = { INPUT : 'catch_release.i',
EXODIFF : ['catch_release_out.e'],
SKIP : 'temp'
}
| <commit_before>from options import *
test = { INPUT : 'catch_release.i',
EXODIFF : ['catch_release_out.e']}
<commit_msg>Test passes on my machine, dies on others. Skipping for now.
r8830<commit_after>from options import *
test = { INPUT : 'catch_release.i',
EXODIFF : ['catch_release_out.e'],
... |
3b4d135556e2aca65050af3d6a7dc0975cd0b53b | amgut/handlers/FAQ.py | amgut/handlers/FAQ.py | from amgut.handlers.base_handlers import BaseHandler
class FAQHandler(BaseHandler):
def get(self):
self.render('FAQ.html')
| from amgut.handlers.base_handlers import BaseHandler
class FAQHandler(BaseHandler):
def get(self):
self.render('FAQ.html', loginerror='')
| Add loginerror blank to render call | Add loginerror blank to render call
| Python | bsd-3-clause | wasade/american-gut-web,mortonjt/american-gut-web,ElDeveloper/american-gut-web,josenavas/american-gut-web,PersonalGenomesOrg/american-gut-web,squirrelo/american-gut-web,squirrelo/american-gut-web,josenavas/american-gut-web,adamrp/american-gut-web,ElDeveloper/american-gut-web,biocore/american-gut-web,mortonjt/american-g... | from amgut.handlers.base_handlers import BaseHandler
class FAQHandler(BaseHandler):
def get(self):
self.render('FAQ.html')
Add loginerror blank to render call | from amgut.handlers.base_handlers import BaseHandler
class FAQHandler(BaseHandler):
def get(self):
self.render('FAQ.html', loginerror='')
| <commit_before>from amgut.handlers.base_handlers import BaseHandler
class FAQHandler(BaseHandler):
def get(self):
self.render('FAQ.html')
<commit_msg>Add loginerror blank to render call<commit_after> | from amgut.handlers.base_handlers import BaseHandler
class FAQHandler(BaseHandler):
def get(self):
self.render('FAQ.html', loginerror='')
| from amgut.handlers.base_handlers import BaseHandler
class FAQHandler(BaseHandler):
def get(self):
self.render('FAQ.html')
Add loginerror blank to render callfrom amgut.handlers.base_handlers import BaseHandler
class FAQHandler(BaseHandler):
def get(self):
self.render('FAQ.html', loginerror=... | <commit_before>from amgut.handlers.base_handlers import BaseHandler
class FAQHandler(BaseHandler):
def get(self):
self.render('FAQ.html')
<commit_msg>Add loginerror blank to render call<commit_after>from amgut.handlers.base_handlers import BaseHandler
class FAQHandler(BaseHandler):
def get(self):
... |
1113c12e71a45eb7bdac51181d62c990a0eb952e | pyOCD/target/target_k64f.py | pyOCD/target/target_k64f.py | """
mbed CMSIS-DAP debugger
Copyright (c) 2006-2013 ARM Limited
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 ... | """
mbed CMSIS-DAP debugger
Copyright (c) 2006-2013 ARM Limited
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 ... | Adjust K64F target file memory configuration to match K64F datasheet. | Adjust K64F target file memory configuration to match K64F datasheet.
| Python | apache-2.0 | geky/pyDAPLink,bridadan/pyOCD,flit/pyOCD,tgarc/pyOCD,pyocd/pyOCD,geky/pyOCD,c1728p9/pyOCD,tgarc/pyOCD,mbedmicro/pyOCD,wjzhang/pyOCD,0xc0170/pyOCD,bridadan/pyOCD,oliviermartin/pyOCD,flit/pyOCD,matthewelse/pyOCD,mesheven/pyOCD,pyocd/pyOCD,oliviermartin/pyOCD,mbedmicro/pyOCD,adamgreen/pyOCD,matthewelse/pyOCD,mesheven/pyOC... | """
mbed CMSIS-DAP debugger
Copyright (c) 2006-2013 ARM Limited
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 ... | """
mbed CMSIS-DAP debugger
Copyright (c) 2006-2013 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable ... | <commit_before>"""
mbed CMSIS-DAP debugger
Copyright (c) 2006-2013 ARM Limited
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... | """
mbed CMSIS-DAP debugger
Copyright (c) 2006-2013 ARM Limited
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 ... | """
mbed CMSIS-DAP debugger
Copyright (c) 2006-2013 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable ... | <commit_before>"""
mbed CMSIS-DAP debugger
Copyright (c) 2006-2013 ARM Limited
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... |
ba008f405a89d07e170d1b4c893246fb25ccba04 | benchmarks/benchmarks/bench_lib.py | benchmarks/benchmarks/bench_lib.py | """Benchmarks for `numpy.lib`."""
from __future__ import absolute_import, division, print_function
from .common import Benchmark
import numpy as np
class Pad(Benchmark):
"""Benchmarks for `numpy.pad`."""
param_names = ["shape", "pad_width", "mode"]
params = [
[(1000,), (10, 100), (10, 10, 10)... | """Benchmarks for `numpy.lib`."""
from __future__ import absolute_import, division, print_function
from .common import Benchmark
import numpy as np
class Pad(Benchmark):
"""Benchmarks for `numpy.pad`."""
param_names = ["shape", "pad_width", "mode"]
params = [
[(1000,),
(10, 100),
... | Make the pad benchmark pagefault in setup | BENCH: Make the pad benchmark pagefault in setup
| Python | bsd-3-clause | shoyer/numpy,grlee77/numpy,mhvk/numpy,pbrod/numpy,endolith/numpy,WarrenWeckesser/numpy,mhvk/numpy,pbrod/numpy,jakirkham/numpy,mattip/numpy,anntzer/numpy,abalkin/numpy,shoyer/numpy,WarrenWeckesser/numpy,madphysicist/numpy,MSeifert04/numpy,madphysicist/numpy,endolith/numpy,mhvk/numpy,mattip/numpy,pizzathief/numpy,seberg/... | """Benchmarks for `numpy.lib`."""
from __future__ import absolute_import, division, print_function
from .common import Benchmark
import numpy as np
class Pad(Benchmark):
"""Benchmarks for `numpy.pad`."""
param_names = ["shape", "pad_width", "mode"]
params = [
[(1000,), (10, 100), (10, 10, 10)... | """Benchmarks for `numpy.lib`."""
from __future__ import absolute_import, division, print_function
from .common import Benchmark
import numpy as np
class Pad(Benchmark):
"""Benchmarks for `numpy.pad`."""
param_names = ["shape", "pad_width", "mode"]
params = [
[(1000,),
(10, 100),
... | <commit_before>"""Benchmarks for `numpy.lib`."""
from __future__ import absolute_import, division, print_function
from .common import Benchmark
import numpy as np
class Pad(Benchmark):
"""Benchmarks for `numpy.pad`."""
param_names = ["shape", "pad_width", "mode"]
params = [
[(1000,), (10, 100... | """Benchmarks for `numpy.lib`."""
from __future__ import absolute_import, division, print_function
from .common import Benchmark
import numpy as np
class Pad(Benchmark):
"""Benchmarks for `numpy.pad`."""
param_names = ["shape", "pad_width", "mode"]
params = [
[(1000,),
(10, 100),
... | """Benchmarks for `numpy.lib`."""
from __future__ import absolute_import, division, print_function
from .common import Benchmark
import numpy as np
class Pad(Benchmark):
"""Benchmarks for `numpy.pad`."""
param_names = ["shape", "pad_width", "mode"]
params = [
[(1000,), (10, 100), (10, 10, 10)... | <commit_before>"""Benchmarks for `numpy.lib`."""
from __future__ import absolute_import, division, print_function
from .common import Benchmark
import numpy as np
class Pad(Benchmark):
"""Benchmarks for `numpy.pad`."""
param_names = ["shape", "pad_width", "mode"]
params = [
[(1000,), (10, 100... |
0701f7f4d03045a49190d8aac172daed467ebcd7 | python/xchainer/__init__.py | python/xchainer/__init__.py | from xchainer._core import * # NOQA
_global_context = Context()
set_global_default_context(_global_context)
set_default_device('native')
| from xchainer._core import * # NOQA
_global_context = Context()
set_global_default_context(_global_context)
| Remove line added by bad merge | Remove line added by bad merge
| Python | mit | niboshi/chainer,keisuke-umezawa/chainer,jnishi/chainer,wkentaro/chainer,ktnyt/chainer,chainer/chainer,jnishi/chainer,niboshi/chainer,okuta/chainer,chainer/chainer,tkerola/chainer,jnishi/chainer,chainer/chainer,wkentaro/chainer,hvy/chainer,keisuke-umezawa/chainer,pfnet/chainer,ktnyt/chainer,ktnyt/chainer,niboshi/chainer... | from xchainer._core import * # NOQA
_global_context = Context()
set_global_default_context(_global_context)
set_default_device('native')
Remove line added by bad merge | from xchainer._core import * # NOQA
_global_context = Context()
set_global_default_context(_global_context)
| <commit_before>from xchainer._core import * # NOQA
_global_context = Context()
set_global_default_context(_global_context)
set_default_device('native')
<commit_msg>Remove line added by bad merge<commit_after> | from xchainer._core import * # NOQA
_global_context = Context()
set_global_default_context(_global_context)
| from xchainer._core import * # NOQA
_global_context = Context()
set_global_default_context(_global_context)
set_default_device('native')
Remove line added by bad mergefrom xchainer._core import * # NOQA
_global_context = Context()
set_global_default_context(_global_context)
| <commit_before>from xchainer._core import * # NOQA
_global_context = Context()
set_global_default_context(_global_context)
set_default_device('native')
<commit_msg>Remove line added by bad merge<commit_after>from xchainer._core import * # NOQA
_global_context = Context()
set_global_default_context(_global_context)
|
703a423f4a0aeda7cbeaa542e2f4e0581eee3bda | slot/utils.py | slot/utils.py | import datetime
def to_ticks(dt):
"""Converts a timestamp to ticks"""
return (dt - datetime.datetime(1970, 1, 1)).total_seconds()
def ticks_to_timestamp(ticks):
"""Converts ticks to a timestamp"""
converted = datetime.datetime(1970, 1, 1) + datetime.timedelta(seconds=3700)
return converted
def... | import datetime
import pytz
this_timezone = pytz.timezone('Europe/London')
def timestamp_to_ticks(dt):
"""Converts a datetime to ticks (seconds since Epoch)"""
delta = (dt - datetime.datetime(1970, 1, 1))
ticks = int(delta.total_seconds())
return ticks
def ticks_to_timestamp(ticks):
"""Converts... | Add timezone support to timestamp helper methods | Add timezone support to timestamp helper methods
| Python | mit | nhshd-slot/SLOT,nhshd-slot/SLOT,nhshd-slot/SLOT | import datetime
def to_ticks(dt):
"""Converts a timestamp to ticks"""
return (dt - datetime.datetime(1970, 1, 1)).total_seconds()
def ticks_to_timestamp(ticks):
"""Converts ticks to a timestamp"""
converted = datetime.datetime(1970, 1, 1) + datetime.timedelta(seconds=3700)
return converted
def... | import datetime
import pytz
this_timezone = pytz.timezone('Europe/London')
def timestamp_to_ticks(dt):
"""Converts a datetime to ticks (seconds since Epoch)"""
delta = (dt - datetime.datetime(1970, 1, 1))
ticks = int(delta.total_seconds())
return ticks
def ticks_to_timestamp(ticks):
"""Converts... | <commit_before>import datetime
def to_ticks(dt):
"""Converts a timestamp to ticks"""
return (dt - datetime.datetime(1970, 1, 1)).total_seconds()
def ticks_to_timestamp(ticks):
"""Converts ticks to a timestamp"""
converted = datetime.datetime(1970, 1, 1) + datetime.timedelta(seconds=3700)
return ... | import datetime
import pytz
this_timezone = pytz.timezone('Europe/London')
def timestamp_to_ticks(dt):
"""Converts a datetime to ticks (seconds since Epoch)"""
delta = (dt - datetime.datetime(1970, 1, 1))
ticks = int(delta.total_seconds())
return ticks
def ticks_to_timestamp(ticks):
"""Converts... | import datetime
def to_ticks(dt):
"""Converts a timestamp to ticks"""
return (dt - datetime.datetime(1970, 1, 1)).total_seconds()
def ticks_to_timestamp(ticks):
"""Converts ticks to a timestamp"""
converted = datetime.datetime(1970, 1, 1) + datetime.timedelta(seconds=3700)
return converted
def... | <commit_before>import datetime
def to_ticks(dt):
"""Converts a timestamp to ticks"""
return (dt - datetime.datetime(1970, 1, 1)).total_seconds()
def ticks_to_timestamp(ticks):
"""Converts ticks to a timestamp"""
converted = datetime.datetime(1970, 1, 1) + datetime.timedelta(seconds=3700)
return ... |
430da3ea616a1118af0b043952bc9d9554086c7f | tpdatasrc/co8fixes/scr/py00248tutorial_room_7.py | tpdatasrc/co8fixes/scr/py00248tutorial_room_7.py | from toee import *
from combat_standard_routines import *
from utilities import *
def san_heartbeat( attachee, triggerer ):
for obj in game.obj_list_vicinity(attachee.location,OLC_PC):
if (critter_is_unconscious(obj) == 0):
if attachee.distance_to( obj ) < 30:
if not game.tutorial_is_active():
game.tuto... | from toee import *
from utilities import *
def correct_zombie_factions():
for obj in game.obj_list_vicinity(location_from_axis(464, 487) ,OLC_NPC):
if obj in game.party:
continue
if obj.faction_has(7) == 0:
obj.faction_add(7)
return
def san_heartbeat( attachee, triggerer ):
for obj in game.obj_list_vici... | Fix tutorial zombie faction issue (co8) | Fix tutorial zombie faction issue (co8)
| Python | mit | GrognardsFromHell/TemplePlus,GrognardsFromHell/TemplePlus,GrognardsFromHell/TemplePlus,GrognardsFromHell/TemplePlus,GrognardsFromHell/TemplePlus | from toee import *
from combat_standard_routines import *
from utilities import *
def san_heartbeat( attachee, triggerer ):
for obj in game.obj_list_vicinity(attachee.location,OLC_PC):
if (critter_is_unconscious(obj) == 0):
if attachee.distance_to( obj ) < 30:
if not game.tutorial_is_active():
game.tuto... | from toee import *
from utilities import *
def correct_zombie_factions():
for obj in game.obj_list_vicinity(location_from_axis(464, 487) ,OLC_NPC):
if obj in game.party:
continue
if obj.faction_has(7) == 0:
obj.faction_add(7)
return
def san_heartbeat( attachee, triggerer ):
for obj in game.obj_list_vici... | <commit_before>from toee import *
from combat_standard_routines import *
from utilities import *
def san_heartbeat( attachee, triggerer ):
for obj in game.obj_list_vicinity(attachee.location,OLC_PC):
if (critter_is_unconscious(obj) == 0):
if attachee.distance_to( obj ) < 30:
if not game.tutorial_is_active():... | from toee import *
from utilities import *
def correct_zombie_factions():
for obj in game.obj_list_vicinity(location_from_axis(464, 487) ,OLC_NPC):
if obj in game.party:
continue
if obj.faction_has(7) == 0:
obj.faction_add(7)
return
def san_heartbeat( attachee, triggerer ):
for obj in game.obj_list_vici... | from toee import *
from combat_standard_routines import *
from utilities import *
def san_heartbeat( attachee, triggerer ):
for obj in game.obj_list_vicinity(attachee.location,OLC_PC):
if (critter_is_unconscious(obj) == 0):
if attachee.distance_to( obj ) < 30:
if not game.tutorial_is_active():
game.tuto... | <commit_before>from toee import *
from combat_standard_routines import *
from utilities import *
def san_heartbeat( attachee, triggerer ):
for obj in game.obj_list_vicinity(attachee.location,OLC_PC):
if (critter_is_unconscious(obj) == 0):
if attachee.distance_to( obj ) < 30:
if not game.tutorial_is_active():... |
d4534c6a6088f377183995be1e098197b650a852 | faker/providers/de_DE/internet.py | faker/providers/de_DE/internet.py | # coding=utf-8
from __future__ import unicode_literals
from ..internet import Provider as InternetProvider
import re
class Provider(InternetProvider):
free_email_domains = (
'web.de', 'gmail.com', 'hotmail.de', 'yahoo.de', 'googlemail.com',
'aol.de', 'gmx.de'
)
tlds = ('com', 'com', 'com... | # coding=utf-8
from __future__ import unicode_literals
from ..internet import Provider as InternetProvider
import re
class Provider(InternetProvider):
free_email_domains = (
'web.de', 'gmail.com', 'hotmail.de', 'yahoo.de', 'googlemail.com',
'aol.de', 'gmx.de'
)
tlds = ('com', 'com', 'com... | Fix capital O missing umlaut | Fix capital O missing umlaut | Python | mit | HAYASAKA-Ryosuke/faker,jaredculp/faker,joke2k/faker,MaryanMorel/faker,johnraz/faker,venmo/faker,xfxf/faker-python,xfxf/faker-1,meganlkm/faker,yiliaofan/faker,GLMeece/faker,joke2k/faker,beetleman/faker,danhuss/faker,thedrow/faker,trtd/faker,ericchaves/faker | # coding=utf-8
from __future__ import unicode_literals
from ..internet import Provider as InternetProvider
import re
class Provider(InternetProvider):
free_email_domains = (
'web.de', 'gmail.com', 'hotmail.de', 'yahoo.de', 'googlemail.com',
'aol.de', 'gmx.de'
)
tlds = ('com', 'com', 'com... | # coding=utf-8
from __future__ import unicode_literals
from ..internet import Provider as InternetProvider
import re
class Provider(InternetProvider):
free_email_domains = (
'web.de', 'gmail.com', 'hotmail.de', 'yahoo.de', 'googlemail.com',
'aol.de', 'gmx.de'
)
tlds = ('com', 'com', 'com... | <commit_before># coding=utf-8
from __future__ import unicode_literals
from ..internet import Provider as InternetProvider
import re
class Provider(InternetProvider):
free_email_domains = (
'web.de', 'gmail.com', 'hotmail.de', 'yahoo.de', 'googlemail.com',
'aol.de', 'gmx.de'
)
tlds = ('co... | # coding=utf-8
from __future__ import unicode_literals
from ..internet import Provider as InternetProvider
import re
class Provider(InternetProvider):
free_email_domains = (
'web.de', 'gmail.com', 'hotmail.de', 'yahoo.de', 'googlemail.com',
'aol.de', 'gmx.de'
)
tlds = ('com', 'com', 'com... | # coding=utf-8
from __future__ import unicode_literals
from ..internet import Provider as InternetProvider
import re
class Provider(InternetProvider):
free_email_domains = (
'web.de', 'gmail.com', 'hotmail.de', 'yahoo.de', 'googlemail.com',
'aol.de', 'gmx.de'
)
tlds = ('com', 'com', 'com... | <commit_before># coding=utf-8
from __future__ import unicode_literals
from ..internet import Provider as InternetProvider
import re
class Provider(InternetProvider):
free_email_domains = (
'web.de', 'gmail.com', 'hotmail.de', 'yahoo.de', 'googlemail.com',
'aol.de', 'gmx.de'
)
tlds = ('co... |
b15591a8a232bdc59281aa0c7750bdc32f7e3103 | pupa/importers/jurisdiction.py | pupa/importers/jurisdiction.py | import os
import json
import datetime
from pupa.core import db
from pupa.models import Organization
from pupa.models.utils import DatetimeValidator
from pupa.models.schemas.jurisdiction import schema as jurisdiction_schema
def import_jurisdiction(org_importer, jurisdiction):
obj = jurisdiction.get_db_object()
... | import os
import json
import datetime
from pupa.core import db
from pupa.models import Organization
from pupa.models.utils import DatetimeValidator
from pupa.models.schemas.jurisdiction import schema as jurisdiction_schema
def import_jurisdiction(org_importer, jurisdiction):
obj = jurisdiction.get_db_object()
... | Throw a ValueError if we get a non-JID for the JID | Throw a ValueError if we get a non-JID for the JID
| Python | bsd-3-clause | datamade/pupa,rshorey/pupa,influence-usa/pupa,mileswwatkins/pupa,opencivicdata/pupa,rshorey/pupa,mileswwatkins/pupa,datamade/pupa,influence-usa/pupa,opencivicdata/pupa | import os
import json
import datetime
from pupa.core import db
from pupa.models import Organization
from pupa.models.utils import DatetimeValidator
from pupa.models.schemas.jurisdiction import schema as jurisdiction_schema
def import_jurisdiction(org_importer, jurisdiction):
obj = jurisdiction.get_db_object()
... | import os
import json
import datetime
from pupa.core import db
from pupa.models import Organization
from pupa.models.utils import DatetimeValidator
from pupa.models.schemas.jurisdiction import schema as jurisdiction_schema
def import_jurisdiction(org_importer, jurisdiction):
obj = jurisdiction.get_db_object()
... | <commit_before>import os
import json
import datetime
from pupa.core import db
from pupa.models import Organization
from pupa.models.utils import DatetimeValidator
from pupa.models.schemas.jurisdiction import schema as jurisdiction_schema
def import_jurisdiction(org_importer, jurisdiction):
obj = jurisdiction.get_... | import os
import json
import datetime
from pupa.core import db
from pupa.models import Organization
from pupa.models.utils import DatetimeValidator
from pupa.models.schemas.jurisdiction import schema as jurisdiction_schema
def import_jurisdiction(org_importer, jurisdiction):
obj = jurisdiction.get_db_object()
... | import os
import json
import datetime
from pupa.core import db
from pupa.models import Organization
from pupa.models.utils import DatetimeValidator
from pupa.models.schemas.jurisdiction import schema as jurisdiction_schema
def import_jurisdiction(org_importer, jurisdiction):
obj = jurisdiction.get_db_object()
... | <commit_before>import os
import json
import datetime
from pupa.core import db
from pupa.models import Organization
from pupa.models.utils import DatetimeValidator
from pupa.models.schemas.jurisdiction import schema as jurisdiction_schema
def import_jurisdiction(org_importer, jurisdiction):
obj = jurisdiction.get_... |
528c10b3988a93668c6a0d4c0b8a7de2667204b1 | frontend/ligscore/results_page.py | frontend/ligscore/results_page.py | from flask import request
import saliweb.frontend
import collections
Transform = collections.namedtuple('Transform', ['number', 'score'])
def show_results_page(job):
show_from = get_int('from', 1)
show_to = get_int('to', 20)
with open(job.get_path('input.txt')) as fh:
receptor, ligand, scoretype ... | from flask import request
import saliweb.frontend
import collections
Transform = collections.namedtuple('Transform', ['number', 'score'])
def show_results_page(job):
show_from = request.args.get('from', 1, type=int)
show_to = request.args.get('to', 20, type=int)
with open(job.get_path('input.txt')) as fh... | Drop our own get_int() function | Drop our own get_int() function
We don't need a custom function to get an int parameter;
flask/werkzeug already handles this.
| Python | lgpl-2.1 | salilab/ligscore,salilab/ligscore | from flask import request
import saliweb.frontend
import collections
Transform = collections.namedtuple('Transform', ['number', 'score'])
def show_results_page(job):
show_from = get_int('from', 1)
show_to = get_int('to', 20)
with open(job.get_path('input.txt')) as fh:
receptor, ligand, scoretype ... | from flask import request
import saliweb.frontend
import collections
Transform = collections.namedtuple('Transform', ['number', 'score'])
def show_results_page(job):
show_from = request.args.get('from', 1, type=int)
show_to = request.args.get('to', 20, type=int)
with open(job.get_path('input.txt')) as fh... | <commit_before>from flask import request
import saliweb.frontend
import collections
Transform = collections.namedtuple('Transform', ['number', 'score'])
def show_results_page(job):
show_from = get_int('from', 1)
show_to = get_int('to', 20)
with open(job.get_path('input.txt')) as fh:
receptor, lig... | from flask import request
import saliweb.frontend
import collections
Transform = collections.namedtuple('Transform', ['number', 'score'])
def show_results_page(job):
show_from = request.args.get('from', 1, type=int)
show_to = request.args.get('to', 20, type=int)
with open(job.get_path('input.txt')) as fh... | from flask import request
import saliweb.frontend
import collections
Transform = collections.namedtuple('Transform', ['number', 'score'])
def show_results_page(job):
show_from = get_int('from', 1)
show_to = get_int('to', 20)
with open(job.get_path('input.txt')) as fh:
receptor, ligand, scoretype ... | <commit_before>from flask import request
import saliweb.frontend
import collections
Transform = collections.namedtuple('Transform', ['number', 'score'])
def show_results_page(job):
show_from = get_int('from', 1)
show_to = get_int('to', 20)
with open(job.get_path('input.txt')) as fh:
receptor, lig... |
e11bc2ebc701dd947d3d5734339b4815bbd21fd1 | PythonScript/Helper/Dujing.py | PythonScript/Helper/Dujing.py | # This Python file uses the following encoding: utf-8
import sys
import getopt
import Convert
def usage():
print "Usage: to be done."
def main(argv):
try:
opts, args = getopt.getopt(argv, "hb:d", ["help", "book="])
except getopt.GetoptError:
usage()
sys.exit(2)
for opt, arg in opts:
if opt in ("-h", "-... | # This Python file uses the following encoding: utf-8
import sys
import argparse
import Convert
def main():
parser = argparse.ArgumentParser(description='Generate a classic book with the desired format.')
parser.add_argument('book', type=str, help='a book file')
args = parser.parse_args()
filePath = args.book
tr... | Use argparse (instead of getopt) to get the usage information | Use argparse (instead of getopt) to get the usage information
| Python | mit | fan-jiang/Dujing | # This Python file uses the following encoding: utf-8
import sys
import getopt
import Convert
def usage():
print "Usage: to be done."
def main(argv):
try:
opts, args = getopt.getopt(argv, "hb:d", ["help", "book="])
except getopt.GetoptError:
usage()
sys.exit(2)
for opt, arg in opts:
if opt in ("-h", "-... | # This Python file uses the following encoding: utf-8
import sys
import argparse
import Convert
def main():
parser = argparse.ArgumentParser(description='Generate a classic book with the desired format.')
parser.add_argument('book', type=str, help='a book file')
args = parser.parse_args()
filePath = args.book
tr... | <commit_before># This Python file uses the following encoding: utf-8
import sys
import getopt
import Convert
def usage():
print "Usage: to be done."
def main(argv):
try:
opts, args = getopt.getopt(argv, "hb:d", ["help", "book="])
except getopt.GetoptError:
usage()
sys.exit(2)
for opt, arg in opts:
if o... | # This Python file uses the following encoding: utf-8
import sys
import argparse
import Convert
def main():
parser = argparse.ArgumentParser(description='Generate a classic book with the desired format.')
parser.add_argument('book', type=str, help='a book file')
args = parser.parse_args()
filePath = args.book
tr... | # This Python file uses the following encoding: utf-8
import sys
import getopt
import Convert
def usage():
print "Usage: to be done."
def main(argv):
try:
opts, args = getopt.getopt(argv, "hb:d", ["help", "book="])
except getopt.GetoptError:
usage()
sys.exit(2)
for opt, arg in opts:
if opt in ("-h", "-... | <commit_before># This Python file uses the following encoding: utf-8
import sys
import getopt
import Convert
def usage():
print "Usage: to be done."
def main(argv):
try:
opts, args = getopt.getopt(argv, "hb:d", ["help", "book="])
except getopt.GetoptError:
usage()
sys.exit(2)
for opt, arg in opts:
if o... |
29e1c2e30d284e1992bae59fe522c31b4e627f0d | dataset/dataset/pipelines.py | dataset/dataset/pipelines.py | # Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
class DatasetPipeline(object):
def process_item(self, item, spider):
return item
| import re
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
class DatasetPipeline(object):
title_regex = re.compile('(((((\\(?[A-Za-z]{1}[-A-Za-z]+,?\\)?)|[-0-9]+)|-)|\\(?[A-Za-z0-9]+\\)?) *)+')
... | Convert item processing to pipeline module | Convert item processing to pipeline module
| Python | mit | MaxLikelihood/CODE | # Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
class DatasetPipeline(object):
def process_item(self, item, spider):
return item
Convert item processing to pipeline module | import re
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
class DatasetPipeline(object):
title_regex = re.compile('(((((\\(?[A-Za-z]{1}[-A-Za-z]+,?\\)?)|[-0-9]+)|-)|\\(?[A-Za-z0-9]+\\)?) *)+')
... | <commit_before># Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
class DatasetPipeline(object):
def process_item(self, item, spider):
return item
<commit_msg>Convert item processing to pipel... | import re
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
class DatasetPipeline(object):
title_regex = re.compile('(((((\\(?[A-Za-z]{1}[-A-Za-z]+,?\\)?)|[-0-9]+)|-)|\\(?[A-Za-z0-9]+\\)?) *)+')
... | # Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
class DatasetPipeline(object):
def process_item(self, item, spider):
return item
Convert item processing to pipeline moduleimport re
# Defin... | <commit_before># Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
class DatasetPipeline(object):
def process_item(self, item, spider):
return item
<commit_msg>Convert item processing to pipel... |
80162fd636cea87b9d096d6df8b93c59887d8785 | scripts/crontab/gen-cron.py | scripts/crontab/gen-cron.py | #!/usr/bin/env python
import os
from optparse import OptionParser
TEMPLATE = open(os.path.join(os.path.dirname(__file__), 'crontab.tpl')).read()
def main():
parser = OptionParser()
parser.add_option("-z", "--zamboni",
help="Location of zamboni (required)")
parser.add_option("-u", "... | #!/usr/bin/env python
import os
from optparse import OptionParser
TEMPLATE = open(os.path.join(os.path.dirname(__file__), 'crontab.tpl')).read()
def main():
parser = OptionParser()
parser.add_option("-z", "--zamboni",
help="Location of zamboni (required)")
parser.add_option("-u", "... | Add DataDog monitoring to cron job runs | Add DataDog monitoring to cron job runs
| Python | bsd-3-clause | mozilla/addons-server,diox/olympia,mozilla/addons-server,kumar303/olympia,wagnerand/addons-server,atiqueahmedziad/addons-server,eviljeff/olympia,eviljeff/olympia,wagnerand/addons-server,kumar303/addons-server,wagnerand/addons-server,bqbn/addons-server,psiinon/addons-server,bqbn/addons-server,kumar303/olympia,diox/olymp... | #!/usr/bin/env python
import os
from optparse import OptionParser
TEMPLATE = open(os.path.join(os.path.dirname(__file__), 'crontab.tpl')).read()
def main():
parser = OptionParser()
parser.add_option("-z", "--zamboni",
help="Location of zamboni (required)")
parser.add_option("-u", "... | #!/usr/bin/env python
import os
from optparse import OptionParser
TEMPLATE = open(os.path.join(os.path.dirname(__file__), 'crontab.tpl')).read()
def main():
parser = OptionParser()
parser.add_option("-z", "--zamboni",
help="Location of zamboni (required)")
parser.add_option("-u", "... | <commit_before>#!/usr/bin/env python
import os
from optparse import OptionParser
TEMPLATE = open(os.path.join(os.path.dirname(__file__), 'crontab.tpl')).read()
def main():
parser = OptionParser()
parser.add_option("-z", "--zamboni",
help="Location of zamboni (required)")
parser.add... | #!/usr/bin/env python
import os
from optparse import OptionParser
TEMPLATE = open(os.path.join(os.path.dirname(__file__), 'crontab.tpl')).read()
def main():
parser = OptionParser()
parser.add_option("-z", "--zamboni",
help="Location of zamboni (required)")
parser.add_option("-u", "... | #!/usr/bin/env python
import os
from optparse import OptionParser
TEMPLATE = open(os.path.join(os.path.dirname(__file__), 'crontab.tpl')).read()
def main():
parser = OptionParser()
parser.add_option("-z", "--zamboni",
help="Location of zamboni (required)")
parser.add_option("-u", "... | <commit_before>#!/usr/bin/env python
import os
from optparse import OptionParser
TEMPLATE = open(os.path.join(os.path.dirname(__file__), 'crontab.tpl')).read()
def main():
parser = OptionParser()
parser.add_option("-z", "--zamboni",
help="Location of zamboni (required)")
parser.add... |
9465d3985e6b6bc87b65a2f89f27871c85ca77e3 | c_major.py | c_major.py | from s4ils import *
s = Session()
with s[INIT]:
s.engine = c.Engine() | s
s.fm = s.engine.new_module(rv.m.Fm) | s
s.engine.output << s.fm | s
s.track1 = s.engine.track(0)
s.track2 = s.engine.track(1)
s.track3 = s.engine.track(2)
with s[0, 0]:
s.note1 = s.fm.note_on(n.C4) | s.track1 | s
w... | from s4ils import *
s = Session()
with s[INIT]:
s.engine = c.Engine() | s
s.fm = s.engine.new_module(rv.m.Fm) | s
s.engine.output << s.fm | s
s.track1 = s.engine.track(1)
s.track2 = s.engine.track(2)
s.track3 = s.engine.track(3)
with s[0, 0]:
s.note1 = s.fm.note_on(n.C4) | s.track1 | s
w... | Use tracks 1-3 instead of 0-2, to make room for reserved track | Use tracks 1-3 instead of 0-2, to make room for reserved track
| Python | unlicense | metrasynth/gallery,metrasynth/gallery,metrasynth/gallery | from s4ils import *
s = Session()
with s[INIT]:
s.engine = c.Engine() | s
s.fm = s.engine.new_module(rv.m.Fm) | s
s.engine.output << s.fm | s
s.track1 = s.engine.track(0)
s.track2 = s.engine.track(1)
s.track3 = s.engine.track(2)
with s[0, 0]:
s.note1 = s.fm.note_on(n.C4) | s.track1 | s
w... | from s4ils import *
s = Session()
with s[INIT]:
s.engine = c.Engine() | s
s.fm = s.engine.new_module(rv.m.Fm) | s
s.engine.output << s.fm | s
s.track1 = s.engine.track(1)
s.track2 = s.engine.track(2)
s.track3 = s.engine.track(3)
with s[0, 0]:
s.note1 = s.fm.note_on(n.C4) | s.track1 | s
w... | <commit_before>from s4ils import *
s = Session()
with s[INIT]:
s.engine = c.Engine() | s
s.fm = s.engine.new_module(rv.m.Fm) | s
s.engine.output << s.fm | s
s.track1 = s.engine.track(0)
s.track2 = s.engine.track(1)
s.track3 = s.engine.track(2)
with s[0, 0]:
s.note1 = s.fm.note_on(n.C4) | ... | from s4ils import *
s = Session()
with s[INIT]:
s.engine = c.Engine() | s
s.fm = s.engine.new_module(rv.m.Fm) | s
s.engine.output << s.fm | s
s.track1 = s.engine.track(1)
s.track2 = s.engine.track(2)
s.track3 = s.engine.track(3)
with s[0, 0]:
s.note1 = s.fm.note_on(n.C4) | s.track1 | s
w... | from s4ils import *
s = Session()
with s[INIT]:
s.engine = c.Engine() | s
s.fm = s.engine.new_module(rv.m.Fm) | s
s.engine.output << s.fm | s
s.track1 = s.engine.track(0)
s.track2 = s.engine.track(1)
s.track3 = s.engine.track(2)
with s[0, 0]:
s.note1 = s.fm.note_on(n.C4) | s.track1 | s
w... | <commit_before>from s4ils import *
s = Session()
with s[INIT]:
s.engine = c.Engine() | s
s.fm = s.engine.new_module(rv.m.Fm) | s
s.engine.output << s.fm | s
s.track1 = s.engine.track(0)
s.track2 = s.engine.track(1)
s.track3 = s.engine.track(2)
with s[0, 0]:
s.note1 = s.fm.note_on(n.C4) | ... |
ae77f5d0050167e0ce137ab876d724658c961f3d | forms.py | forms.py | """
UK-specific Form helpers
"""
from django.forms.fields import Select
class IECountySelect(Select):
"""
A Select widget that uses a list of Irish Counties as its choices.
"""
def __init__(self, attrs=None):
from ie_counties import IE_COUNTY_CHOICES
super(IECountySelect, self).__init_... | """
UK-specific Form helpers
"""
from __future__ import absolute_import
from django.contrib.localflavor.ie.ie_counties import IE_COUNTY_CHOICES
from django.forms.fields import Select
class IECountySelect(Select):
"""
A Select widget that uses a list of Irish Counties as its choices.
"""
def __init__... | Remove all relative imports. We have always been at war with relative imports. | Remove all relative imports. We have always been at war with relative imports.
git-svn-id: 4f9f921b081c523744c7bf24d959a0db39629563@17009 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| Python | bsd-3-clause | martinogden/django-localflavor-ie | """
UK-specific Form helpers
"""
from django.forms.fields import Select
class IECountySelect(Select):
"""
A Select widget that uses a list of Irish Counties as its choices.
"""
def __init__(self, attrs=None):
from ie_counties import IE_COUNTY_CHOICES
super(IECountySelect, self).__init_... | """
UK-specific Form helpers
"""
from __future__ import absolute_import
from django.contrib.localflavor.ie.ie_counties import IE_COUNTY_CHOICES
from django.forms.fields import Select
class IECountySelect(Select):
"""
A Select widget that uses a list of Irish Counties as its choices.
"""
def __init__... | <commit_before>"""
UK-specific Form helpers
"""
from django.forms.fields import Select
class IECountySelect(Select):
"""
A Select widget that uses a list of Irish Counties as its choices.
"""
def __init__(self, attrs=None):
from ie_counties import IE_COUNTY_CHOICES
super(IECountySelect... | """
UK-specific Form helpers
"""
from __future__ import absolute_import
from django.contrib.localflavor.ie.ie_counties import IE_COUNTY_CHOICES
from django.forms.fields import Select
class IECountySelect(Select):
"""
A Select widget that uses a list of Irish Counties as its choices.
"""
def __init__... | """
UK-specific Form helpers
"""
from django.forms.fields import Select
class IECountySelect(Select):
"""
A Select widget that uses a list of Irish Counties as its choices.
"""
def __init__(self, attrs=None):
from ie_counties import IE_COUNTY_CHOICES
super(IECountySelect, self).__init_... | <commit_before>"""
UK-specific Form helpers
"""
from django.forms.fields import Select
class IECountySelect(Select):
"""
A Select widget that uses a list of Irish Counties as its choices.
"""
def __init__(self, attrs=None):
from ie_counties import IE_COUNTY_CHOICES
super(IECountySelect... |
31961f9cbfd01955fe94d13cd9f6d9a9a84f3485 | server/proposal/__init__.py | server/proposal/__init__.py | from django.apps import AppConfig
class ProposalConfig(AppConfig):
name = "proposal"
def ready(self):
# Register tasks with Celery:
from . import tasks
from . import event_tasks
| from django.apps import AppConfig
class ProposalConfig(AppConfig):
name = "proposal"
def ready(self):
# Register tasks with Celery:
from . import tasks
from . import event_tasks
from . import image_tasks
| Load image processing tasks on startup | Load image processing tasks on startup
| Python | mit | cityofsomerville/citydash,codeforboston/cornerwise,cityofsomerville/cornerwise,codeforboston/cornerwise,cityofsomerville/cornerwise,cityofsomerville/citydash,codeforboston/cornerwise,codeforboston/cornerwise,cityofsomerville/citydash,cityofsomerville/cornerwise,cityofsomerville/cornerwise,cityofsomerville/citydash | from django.apps import AppConfig
class ProposalConfig(AppConfig):
name = "proposal"
def ready(self):
# Register tasks with Celery:
from . import tasks
from . import event_tasks
Load image processing tasks on startup | from django.apps import AppConfig
class ProposalConfig(AppConfig):
name = "proposal"
def ready(self):
# Register tasks with Celery:
from . import tasks
from . import event_tasks
from . import image_tasks
| <commit_before>from django.apps import AppConfig
class ProposalConfig(AppConfig):
name = "proposal"
def ready(self):
# Register tasks with Celery:
from . import tasks
from . import event_tasks
<commit_msg>Load image processing tasks on startup<commit_after> | from django.apps import AppConfig
class ProposalConfig(AppConfig):
name = "proposal"
def ready(self):
# Register tasks with Celery:
from . import tasks
from . import event_tasks
from . import image_tasks
| from django.apps import AppConfig
class ProposalConfig(AppConfig):
name = "proposal"
def ready(self):
# Register tasks with Celery:
from . import tasks
from . import event_tasks
Load image processing tasks on startupfrom django.apps import AppConfig
class ProposalConfig(AppConfig):... | <commit_before>from django.apps import AppConfig
class ProposalConfig(AppConfig):
name = "proposal"
def ready(self):
# Register tasks with Celery:
from . import tasks
from . import event_tasks
<commit_msg>Load image processing tasks on startup<commit_after>from django.apps import App... |
d409594c01e11e05a59f5614722dd3035855e399 | salt/returners/redis_return.py | salt/returners/redis_return.py | '''
Return data to a redis server
This is a VERY simple example for pushing data to a redis server and is not
nessisarily intended as a usable interface.
'''
import redis
import json
__opts__ = {
'redis.host': 'mcp',
'redis.port': 6379,
'redis.db': '0',
}
def returner(r... | '''
Return data to a redis server
This is a VERY simple example for pushing data to a redis server and is not
nessisarily intended as a usable interface.
'''
import redis
import json
__opts__ = {
'redis.host': 'mcp',
'redis.port': 6379,
'redis.db': '0',
}
def returner(r... | Change the redis returner to better use data structures | Change the redis returner to better use data structures
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | '''
Return data to a redis server
This is a VERY simple example for pushing data to a redis server and is not
nessisarily intended as a usable interface.
'''
import redis
import json
__opts__ = {
'redis.host': 'mcp',
'redis.port': 6379,
'redis.db': '0',
}
def returner(r... | '''
Return data to a redis server
This is a VERY simple example for pushing data to a redis server and is not
nessisarily intended as a usable interface.
'''
import redis
import json
__opts__ = {
'redis.host': 'mcp',
'redis.port': 6379,
'redis.db': '0',
}
def returner(r... | <commit_before>'''
Return data to a redis server
This is a VERY simple example for pushing data to a redis server and is not
nessisarily intended as a usable interface.
'''
import redis
import json
__opts__ = {
'redis.host': 'mcp',
'redis.port': 6379,
'redis.db': '0',
}
... | '''
Return data to a redis server
This is a VERY simple example for pushing data to a redis server and is not
nessisarily intended as a usable interface.
'''
import redis
import json
__opts__ = {
'redis.host': 'mcp',
'redis.port': 6379,
'redis.db': '0',
}
def returner(r... | '''
Return data to a redis server
This is a VERY simple example for pushing data to a redis server and is not
nessisarily intended as a usable interface.
'''
import redis
import json
__opts__ = {
'redis.host': 'mcp',
'redis.port': 6379,
'redis.db': '0',
}
def returner(r... | <commit_before>'''
Return data to a redis server
This is a VERY simple example for pushing data to a redis server and is not
nessisarily intended as a usable interface.
'''
import redis
import json
__opts__ = {
'redis.host': 'mcp',
'redis.port': 6379,
'redis.db': '0',
}
... |
936bdadb9e949d29a7742b088e0279680afa6c4a | copy_from_find_in_files_command.py | copy_from_find_in_files_command.py | import sublime
import sublime_plugin
import re
class CopyFromFindInFilesCommand(sublime_plugin.TextCommand):
def run(self, edit, force=False):
self.view.run_command('copy')
if not self.in_find_results_view() and not force:
return
clipboard_contents = sublime.get_clipboard()
... | import sublime
import sublime_plugin
import re
class CopyFromFindInFilesCommand(sublime_plugin.TextCommand):
def run(self, edit, force=False):
self.view.run_command('copy')
if not self.in_find_results_view() and not force:
return
clipboard_contents = sublime.get_clipboard()
... | Make the regex work on Python2.x | Make the regex work on Python2.x
| Python | mit | kema221/sublime-copy-from-find-results,NicoSantangelo/sublime-copy-from-find-results,kema221/sublime-copy-from-find-results | import sublime
import sublime_plugin
import re
class CopyFromFindInFilesCommand(sublime_plugin.TextCommand):
def run(self, edit, force=False):
self.view.run_command('copy')
if not self.in_find_results_view() and not force:
return
clipboard_contents = sublime.get_clipboard()
... | import sublime
import sublime_plugin
import re
class CopyFromFindInFilesCommand(sublime_plugin.TextCommand):
def run(self, edit, force=False):
self.view.run_command('copy')
if not self.in_find_results_view() and not force:
return
clipboard_contents = sublime.get_clipboard()
... | <commit_before>import sublime
import sublime_plugin
import re
class CopyFromFindInFilesCommand(sublime_plugin.TextCommand):
def run(self, edit, force=False):
self.view.run_command('copy')
if not self.in_find_results_view() and not force:
return
clipboard_contents = sublime.ge... | import sublime
import sublime_plugin
import re
class CopyFromFindInFilesCommand(sublime_plugin.TextCommand):
def run(self, edit, force=False):
self.view.run_command('copy')
if not self.in_find_results_view() and not force:
return
clipboard_contents = sublime.get_clipboard()
... | import sublime
import sublime_plugin
import re
class CopyFromFindInFilesCommand(sublime_plugin.TextCommand):
def run(self, edit, force=False):
self.view.run_command('copy')
if not self.in_find_results_view() and not force:
return
clipboard_contents = sublime.get_clipboard()
... | <commit_before>import sublime
import sublime_plugin
import re
class CopyFromFindInFilesCommand(sublime_plugin.TextCommand):
def run(self, edit, force=False):
self.view.run_command('copy')
if not self.in_find_results_view() and not force:
return
clipboard_contents = sublime.ge... |
2a9b8843767963fed13a9bd145aa5835a4e13dce | autocloud/__init__.py | autocloud/__init__.py | # -*- coding: utf-8 -*-
import ConfigParser
import os
PROJECT_ROOT = os.path.abspath(os.path.dirname(__name__))
name = '/etc/autocloud/autocloud.cfg'
if not os.path.exists(name):
raise Exception('Please add a proper config file under /etc/autocloud/')
config = ConfigParser.RawConfigParser()
config.read(name)
K... | # -*- coding: utf-8 -*-
import ConfigParser
import os
PROJECT_ROOT = os.path.abspath(os.path.dirname(__name__))
name = '/etc/autocloud/autocloud.cfg'
if not os.path.exists(name):
raise Exception('Please add a proper config file under /etc/autocloud/')
default = {'host': '127.0.0.1', 'port': 5000}
config = Confi... | Fix loading of default config values | config: Fix loading of default config values
If RawConfigParser is not able to find config
using get(), it doesn't return None, instead
it raises an Exception.
Signed-off-by: Vivek Anand <[email protected]>
| Python | agpl-3.0 | kushaldas/autocloud,kushaldas/autocloud,kushaldas/autocloud,kushaldas/autocloud | # -*- coding: utf-8 -*-
import ConfigParser
import os
PROJECT_ROOT = os.path.abspath(os.path.dirname(__name__))
name = '/etc/autocloud/autocloud.cfg'
if not os.path.exists(name):
raise Exception('Please add a proper config file under /etc/autocloud/')
config = ConfigParser.RawConfigParser()
config.read(name)
K... | # -*- coding: utf-8 -*-
import ConfigParser
import os
PROJECT_ROOT = os.path.abspath(os.path.dirname(__name__))
name = '/etc/autocloud/autocloud.cfg'
if not os.path.exists(name):
raise Exception('Please add a proper config file under /etc/autocloud/')
default = {'host': '127.0.0.1', 'port': 5000}
config = Confi... | <commit_before># -*- coding: utf-8 -*-
import ConfigParser
import os
PROJECT_ROOT = os.path.abspath(os.path.dirname(__name__))
name = '/etc/autocloud/autocloud.cfg'
if not os.path.exists(name):
raise Exception('Please add a proper config file under /etc/autocloud/')
config = ConfigParser.RawConfigParser()
confi... | # -*- coding: utf-8 -*-
import ConfigParser
import os
PROJECT_ROOT = os.path.abspath(os.path.dirname(__name__))
name = '/etc/autocloud/autocloud.cfg'
if not os.path.exists(name):
raise Exception('Please add a proper config file under /etc/autocloud/')
default = {'host': '127.0.0.1', 'port': 5000}
config = Confi... | # -*- coding: utf-8 -*-
import ConfigParser
import os
PROJECT_ROOT = os.path.abspath(os.path.dirname(__name__))
name = '/etc/autocloud/autocloud.cfg'
if not os.path.exists(name):
raise Exception('Please add a proper config file under /etc/autocloud/')
config = ConfigParser.RawConfigParser()
config.read(name)
K... | <commit_before># -*- coding: utf-8 -*-
import ConfigParser
import os
PROJECT_ROOT = os.path.abspath(os.path.dirname(__name__))
name = '/etc/autocloud/autocloud.cfg'
if not os.path.exists(name):
raise Exception('Please add a proper config file under /etc/autocloud/')
config = ConfigParser.RawConfigParser()
confi... |
9c68a69eb5bf6e7ffab8b7538797c74b05a7c70b | src/zeit/content/article/edit/browser/tests/test_header.py | src/zeit/content/article/edit/browser/tests/test_header.py | import zeit.content.article.edit.browser.testing
class HeaderModules(zeit.content.article.edit.browser.testing.EditorTestCase):
def test_can_create_module_by_drag_and_drop(self):
s = self.selenium
self.add_article()
# Select header that allows header module
s.click('css=#edit-form... | import zeit.content.article.edit.browser.testing
class HeaderModules(zeit.content.article.edit.browser.testing.EditorTestCase):
def test_can_create_module_by_drag_and_drop(self):
s = self.selenium
self.add_article()
# Select header that allows header module
s.click('css=#edit-form... | Test needs to wait until the header values are updated after it changed the template | FIX: Test needs to wait until the header values are updated after it changed the template
I'm not sure how this previously has ever passed, to be honest.
| Python | bsd-3-clause | ZeitOnline/zeit.content.article,ZeitOnline/zeit.content.article,ZeitOnline/zeit.content.article | import zeit.content.article.edit.browser.testing
class HeaderModules(zeit.content.article.edit.browser.testing.EditorTestCase):
def test_can_create_module_by_drag_and_drop(self):
s = self.selenium
self.add_article()
# Select header that allows header module
s.click('css=#edit-form... | import zeit.content.article.edit.browser.testing
class HeaderModules(zeit.content.article.edit.browser.testing.EditorTestCase):
def test_can_create_module_by_drag_and_drop(self):
s = self.selenium
self.add_article()
# Select header that allows header module
s.click('css=#edit-form... | <commit_before>import zeit.content.article.edit.browser.testing
class HeaderModules(zeit.content.article.edit.browser.testing.EditorTestCase):
def test_can_create_module_by_drag_and_drop(self):
s = self.selenium
self.add_article()
# Select header that allows header module
s.click(... | import zeit.content.article.edit.browser.testing
class HeaderModules(zeit.content.article.edit.browser.testing.EditorTestCase):
def test_can_create_module_by_drag_and_drop(self):
s = self.selenium
self.add_article()
# Select header that allows header module
s.click('css=#edit-form... | import zeit.content.article.edit.browser.testing
class HeaderModules(zeit.content.article.edit.browser.testing.EditorTestCase):
def test_can_create_module_by_drag_and_drop(self):
s = self.selenium
self.add_article()
# Select header that allows header module
s.click('css=#edit-form... | <commit_before>import zeit.content.article.edit.browser.testing
class HeaderModules(zeit.content.article.edit.browser.testing.EditorTestCase):
def test_can_create_module_by_drag_and_drop(self):
s = self.selenium
self.add_article()
# Select header that allows header module
s.click(... |
d6a67a94cacab93463f2a15fc5d2a2fadae2ad83 | site/tests/test_unittest.py | site/tests/test_unittest.py | import unittest
class IntegerArithmenticTestCase(unittest.TestCase):
def testAdd(self): ## test method names begin 'test*'
self.assertEqual((1 + 2), 3)
self.assertEqual(0 + 1, 1)
def testMultiply(self):
self.assertEqual((0 * 10), 0)
self.assertEqual((5 * 8), 40)
unittest.main(... | import unittest
class IntegerArithmeticTestCase(unittest.TestCase):
def testAdd(self): ## test method names begin 'test*'
self.assertEqual((1 + 2), 3)
self.assertEqual(0 + 1, 1)
def testMultiply(self):
self.assertEqual((0 * 10), 0)
self.assertEqual((5 * 8), 40)
suite = unittes... | Change unittest test in test suite : it is not run in module __main__ | Change unittest test in test suite : it is not run in module __main__
| Python | bsd-3-clause | Hasimir/brython,olemis/brython,JohnDenker/brython,firmlyjin/brython,Isendir/brython,jonathanverner/brython,Mozhuowen/brython,olemis/brython,brython-dev/brython,Lh4cKg/brython,Isendir/brython,kevinmel2000/brython,amrdraz/brython,jonathanverner/brython,molebot/brython,Mozhuowen/brython,jonathanverner/brython,JohnDenker/b... | import unittest
class IntegerArithmenticTestCase(unittest.TestCase):
def testAdd(self): ## test method names begin 'test*'
self.assertEqual((1 + 2), 3)
self.assertEqual(0 + 1, 1)
def testMultiply(self):
self.assertEqual((0 * 10), 0)
self.assertEqual((5 * 8), 40)
unittest.main(... | import unittest
class IntegerArithmeticTestCase(unittest.TestCase):
def testAdd(self): ## test method names begin 'test*'
self.assertEqual((1 + 2), 3)
self.assertEqual(0 + 1, 1)
def testMultiply(self):
self.assertEqual((0 * 10), 0)
self.assertEqual((5 * 8), 40)
suite = unittes... | <commit_before>import unittest
class IntegerArithmenticTestCase(unittest.TestCase):
def testAdd(self): ## test method names begin 'test*'
self.assertEqual((1 + 2), 3)
self.assertEqual(0 + 1, 1)
def testMultiply(self):
self.assertEqual((0 * 10), 0)
self.assertEqual((5 * 8), 40)
... | import unittest
class IntegerArithmeticTestCase(unittest.TestCase):
def testAdd(self): ## test method names begin 'test*'
self.assertEqual((1 + 2), 3)
self.assertEqual(0 + 1, 1)
def testMultiply(self):
self.assertEqual((0 * 10), 0)
self.assertEqual((5 * 8), 40)
suite = unittes... | import unittest
class IntegerArithmenticTestCase(unittest.TestCase):
def testAdd(self): ## test method names begin 'test*'
self.assertEqual((1 + 2), 3)
self.assertEqual(0 + 1, 1)
def testMultiply(self):
self.assertEqual((0 * 10), 0)
self.assertEqual((5 * 8), 40)
unittest.main(... | <commit_before>import unittest
class IntegerArithmenticTestCase(unittest.TestCase):
def testAdd(self): ## test method names begin 'test*'
self.assertEqual((1 + 2), 3)
self.assertEqual(0 + 1, 1)
def testMultiply(self):
self.assertEqual((0 * 10), 0)
self.assertEqual((5 * 8), 40)
... |
14cfc8927b36a89947c1bd4cefc5be88ebbea1b5 | cheroot/test/conftest.py | cheroot/test/conftest.py | import threading
import time
import pytest
import cheroot.server
import cheroot.wsgi
config = {
'bind_addr': ('127.0.0.1', 54583),
'wsgi_app': None,
}
def cheroot_server(server_factory):
conf = config.copy()
httpserver = server_factory(**conf) # create it
threading.Thread(target=httpserver.s... | import threading
import time
import pytest
import cheroot.server
import cheroot.wsgi
EPHEMERAL_PORT = 0
config = {
'bind_addr': ('127.0.0.1', EPHEMERAL_PORT),
'wsgi_app': None,
}
def cheroot_server(server_factory):
conf = config.copy()
httpserver = server_factory(**conf) # create it
threadin... | Make HTTP server fixture bind to an ephemeral port | Make HTTP server fixture bind to an ephemeral port
| Python | bsd-3-clause | cherrypy/cheroot | import threading
import time
import pytest
import cheroot.server
import cheroot.wsgi
config = {
'bind_addr': ('127.0.0.1', 54583),
'wsgi_app': None,
}
def cheroot_server(server_factory):
conf = config.copy()
httpserver = server_factory(**conf) # create it
threading.Thread(target=httpserver.s... | import threading
import time
import pytest
import cheroot.server
import cheroot.wsgi
EPHEMERAL_PORT = 0
config = {
'bind_addr': ('127.0.0.1', EPHEMERAL_PORT),
'wsgi_app': None,
}
def cheroot_server(server_factory):
conf = config.copy()
httpserver = server_factory(**conf) # create it
threadin... | <commit_before>import threading
import time
import pytest
import cheroot.server
import cheroot.wsgi
config = {
'bind_addr': ('127.0.0.1', 54583),
'wsgi_app': None,
}
def cheroot_server(server_factory):
conf = config.copy()
httpserver = server_factory(**conf) # create it
threading.Thread(targ... | import threading
import time
import pytest
import cheroot.server
import cheroot.wsgi
EPHEMERAL_PORT = 0
config = {
'bind_addr': ('127.0.0.1', EPHEMERAL_PORT),
'wsgi_app': None,
}
def cheroot_server(server_factory):
conf = config.copy()
httpserver = server_factory(**conf) # create it
threadin... | import threading
import time
import pytest
import cheroot.server
import cheroot.wsgi
config = {
'bind_addr': ('127.0.0.1', 54583),
'wsgi_app': None,
}
def cheroot_server(server_factory):
conf = config.copy()
httpserver = server_factory(**conf) # create it
threading.Thread(target=httpserver.s... | <commit_before>import threading
import time
import pytest
import cheroot.server
import cheroot.wsgi
config = {
'bind_addr': ('127.0.0.1', 54583),
'wsgi_app': None,
}
def cheroot_server(server_factory):
conf = config.copy()
httpserver = server_factory(**conf) # create it
threading.Thread(targ... |
bd70ef56d95958b8f105bdff31b675d66c40bca8 | serfnode/handler/supervisor.py | serfnode/handler/supervisor.py | import os
import subprocess
import docker_utils
import jinja2
env = jinja2.Environment(loader=jinja2.FileSystemLoader('/programs'))
def supervisor_install(block, **kwargs):
"""Update supervisor with `block` config.
- `block` is the name to a .conf template file (in directory
`/programs`)
- `kwargs... | import os
import subprocess
import docker_utils
import docker
import jinja2
env = jinja2.Environment(loader=jinja2.FileSystemLoader('/programs'))
def supervisor_install(block, **kwargs):
"""Update supervisor with `block` config.
- `block` is the name to a .conf template file (in directory
`/programs`)... | Add convenience function to start docker | Add convenience function to start docker
Mainly to be used from supervisor. | Python | mit | waltermoreira/serfnode,waltermoreira/serfnode,waltermoreira/serfnode | import os
import subprocess
import docker_utils
import jinja2
env = jinja2.Environment(loader=jinja2.FileSystemLoader('/programs'))
def supervisor_install(block, **kwargs):
"""Update supervisor with `block` config.
- `block` is the name to a .conf template file (in directory
`/programs`)
- `kwargs... | import os
import subprocess
import docker_utils
import docker
import jinja2
env = jinja2.Environment(loader=jinja2.FileSystemLoader('/programs'))
def supervisor_install(block, **kwargs):
"""Update supervisor with `block` config.
- `block` is the name to a .conf template file (in directory
`/programs`)... | <commit_before>import os
import subprocess
import docker_utils
import jinja2
env = jinja2.Environment(loader=jinja2.FileSystemLoader('/programs'))
def supervisor_install(block, **kwargs):
"""Update supervisor with `block` config.
- `block` is the name to a .conf template file (in directory
`/programs`... | import os
import subprocess
import docker_utils
import docker
import jinja2
env = jinja2.Environment(loader=jinja2.FileSystemLoader('/programs'))
def supervisor_install(block, **kwargs):
"""Update supervisor with `block` config.
- `block` is the name to a .conf template file (in directory
`/programs`)... | import os
import subprocess
import docker_utils
import jinja2
env = jinja2.Environment(loader=jinja2.FileSystemLoader('/programs'))
def supervisor_install(block, **kwargs):
"""Update supervisor with `block` config.
- `block` is the name to a .conf template file (in directory
`/programs`)
- `kwargs... | <commit_before>import os
import subprocess
import docker_utils
import jinja2
env = jinja2.Environment(loader=jinja2.FileSystemLoader('/programs'))
def supervisor_install(block, **kwargs):
"""Update supervisor with `block` config.
- `block` is the name to a .conf template file (in directory
`/programs`... |
8cc225db1e36785914885cdb547b8feaf1d4e8fc | brainhack/datasets.py | brainhack/datasets.py | import os
from nilearn.datasets import _get_dataset, _fetch_dataset
from sklearn.datasets.base import Bunch
def fetch_craddock_2012_test(n_subjects=None, data_dir=None, resume=True,
verbose=0):
"""Download and load example data from Craddock 2012 work.
Parameters
----------
... | Add fetching function for craddock 2012 experiment | Add fetching function for craddock 2012 experiment
| Python | bsd-3-clause | AlexandreAbraham/brainhack2013 | Add fetching function for craddock 2012 experiment | import os
from nilearn.datasets import _get_dataset, _fetch_dataset
from sklearn.datasets.base import Bunch
def fetch_craddock_2012_test(n_subjects=None, data_dir=None, resume=True,
verbose=0):
"""Download and load example data from Craddock 2012 work.
Parameters
----------
... | <commit_before><commit_msg>Add fetching function for craddock 2012 experiment<commit_after> | import os
from nilearn.datasets import _get_dataset, _fetch_dataset
from sklearn.datasets.base import Bunch
def fetch_craddock_2012_test(n_subjects=None, data_dir=None, resume=True,
verbose=0):
"""Download and load example data from Craddock 2012 work.
Parameters
----------
... | Add fetching function for craddock 2012 experimentimport os
from nilearn.datasets import _get_dataset, _fetch_dataset
from sklearn.datasets.base import Bunch
def fetch_craddock_2012_test(n_subjects=None, data_dir=None, resume=True,
verbose=0):
"""Download and load example data from Cr... | <commit_before><commit_msg>Add fetching function for craddock 2012 experiment<commit_after>import os
from nilearn.datasets import _get_dataset, _fetch_dataset
from sklearn.datasets.base import Bunch
def fetch_craddock_2012_test(n_subjects=None, data_dir=None, resume=True,
verbose=0):
... | |
973669fce5fcc2360b4c72b3d1345d708e1ca0aa | examples/bench_randomizer.py | examples/bench_randomizer.py | import random
import hurdles
class BenchRandom(hurdles.BenchCase):
def bench_this(self):
return [random.randint(1, 100000) for x in [0] * 100000]
def bench_that(self):
return [random.randint(1, 10000) for y in [0] * 10000]
if __name__ == "__main__":
B = BenchRandom()
B.run()
| import random
import hurdles
from hurdles.tools import extra_setup
class BenchRandom(hurdles.BenchCase):
@extra_setup("""import random""")
def bench_this(self, *args, **kwargs):
return [random.randint(1, 100000) for x in [0] * 100000]
def bench_that(self, *args, **kwargs):
return [rando... | Update : don't forget *args, **kwargs in bench_case methods | Update : don't forget *args, **kwargs in bench_case methods
| Python | mit | oleiade/Hurdles | import random
import hurdles
class BenchRandom(hurdles.BenchCase):
def bench_this(self):
return [random.randint(1, 100000) for x in [0] * 100000]
def bench_that(self):
return [random.randint(1, 10000) for y in [0] * 10000]
if __name__ == "__main__":
B = BenchRandom()
B.run()
Update ... | import random
import hurdles
from hurdles.tools import extra_setup
class BenchRandom(hurdles.BenchCase):
@extra_setup("""import random""")
def bench_this(self, *args, **kwargs):
return [random.randint(1, 100000) for x in [0] * 100000]
def bench_that(self, *args, **kwargs):
return [rando... | <commit_before>import random
import hurdles
class BenchRandom(hurdles.BenchCase):
def bench_this(self):
return [random.randint(1, 100000) for x in [0] * 100000]
def bench_that(self):
return [random.randint(1, 10000) for y in [0] * 10000]
if __name__ == "__main__":
B = BenchRandom()
... | import random
import hurdles
from hurdles.tools import extra_setup
class BenchRandom(hurdles.BenchCase):
@extra_setup("""import random""")
def bench_this(self, *args, **kwargs):
return [random.randint(1, 100000) for x in [0] * 100000]
def bench_that(self, *args, **kwargs):
return [rando... | import random
import hurdles
class BenchRandom(hurdles.BenchCase):
def bench_this(self):
return [random.randint(1, 100000) for x in [0] * 100000]
def bench_that(self):
return [random.randint(1, 10000) for y in [0] * 10000]
if __name__ == "__main__":
B = BenchRandom()
B.run()
Update ... | <commit_before>import random
import hurdles
class BenchRandom(hurdles.BenchCase):
def bench_this(self):
return [random.randint(1, 100000) for x in [0] * 100000]
def bench_that(self):
return [random.randint(1, 10000) for y in [0] * 10000]
if __name__ == "__main__":
B = BenchRandom()
... |
f7e01bc27d6ec8e4398b30128b986227c81cbad7 | src/foremast/pipeline/__main__.py | src/foremast/pipeline/__main__.py | """Create Spinnaker Pipeline."""
import argparse
import logging
from ..args import add_debug
from ..consts import LOGGING_FORMAT
from .create_pipeline import SpinnakerPipeline
def main():
"""Run newer stuffs."""
logging.basicConfig(format=LOGGING_FORMAT)
log = logging.getLogger(__name__)
parser = ar... | """Create Spinnaker Pipeline."""
import argparse
import logging
from ..args import add_debug
from ..consts import LOGGING_FORMAT
from .create_pipeline import SpinnakerPipeline
def main():
"""Run newer stuffs."""
logging.basicConfig(format=LOGGING_FORMAT)
log = logging.getLogger(__name__)
parser = ar... | Remove going back a directory for properties | fix: Remove going back a directory for properties
See also: PSOBAT-1197
| Python | apache-2.0 | gogoair/foremast,gogoair/foremast | """Create Spinnaker Pipeline."""
import argparse
import logging
from ..args import add_debug
from ..consts import LOGGING_FORMAT
from .create_pipeline import SpinnakerPipeline
def main():
"""Run newer stuffs."""
logging.basicConfig(format=LOGGING_FORMAT)
log = logging.getLogger(__name__)
parser = ar... | """Create Spinnaker Pipeline."""
import argparse
import logging
from ..args import add_debug
from ..consts import LOGGING_FORMAT
from .create_pipeline import SpinnakerPipeline
def main():
"""Run newer stuffs."""
logging.basicConfig(format=LOGGING_FORMAT)
log = logging.getLogger(__name__)
parser = ar... | <commit_before>"""Create Spinnaker Pipeline."""
import argparse
import logging
from ..args import add_debug
from ..consts import LOGGING_FORMAT
from .create_pipeline import SpinnakerPipeline
def main():
"""Run newer stuffs."""
logging.basicConfig(format=LOGGING_FORMAT)
log = logging.getLogger(__name__)
... | """Create Spinnaker Pipeline."""
import argparse
import logging
from ..args import add_debug
from ..consts import LOGGING_FORMAT
from .create_pipeline import SpinnakerPipeline
def main():
"""Run newer stuffs."""
logging.basicConfig(format=LOGGING_FORMAT)
log = logging.getLogger(__name__)
parser = ar... | """Create Spinnaker Pipeline."""
import argparse
import logging
from ..args import add_debug
from ..consts import LOGGING_FORMAT
from .create_pipeline import SpinnakerPipeline
def main():
"""Run newer stuffs."""
logging.basicConfig(format=LOGGING_FORMAT)
log = logging.getLogger(__name__)
parser = ar... | <commit_before>"""Create Spinnaker Pipeline."""
import argparse
import logging
from ..args import add_debug
from ..consts import LOGGING_FORMAT
from .create_pipeline import SpinnakerPipeline
def main():
"""Run newer stuffs."""
logging.basicConfig(format=LOGGING_FORMAT)
log = logging.getLogger(__name__)
... |
beb1e10582de1aa3a6d8af121053ed2bdba1b1cf | apps/accounts/myaccount_urls.py | apps/accounts/myaccount_urls.py | """
URLCONF for the user accounts app (part 2/2).
"""
from django.conf.urls import url, include
from django.contrib.auth import views as auth_views
from . import views
# User accounts URL patterns configuration
urlpatterns = (
# My account page
url(r'^$', views.my_account_show, name='index'),
# Passwo... | """
URLCONF for the user accounts app (part 2/2).
"""
from django.conf.urls import url, include
from django.contrib.auth import views as auth_views
from . import views
# User accounts URL patterns configuration
urlpatterns = (
# My account page
url(r'^$', views.my_account_show, name='index'),
# Passwo... | Add fixme for future revision | Add fixme for future revision
| Python | agpl-3.0 | TamiaLab/carnetdumaker,TamiaLab/carnetdumaker,TamiaLab/carnetdumaker,TamiaLab/carnetdumaker | """
URLCONF for the user accounts app (part 2/2).
"""
from django.conf.urls import url, include
from django.contrib.auth import views as auth_views
from . import views
# User accounts URL patterns configuration
urlpatterns = (
# My account page
url(r'^$', views.my_account_show, name='index'),
# Passwo... | """
URLCONF for the user accounts app (part 2/2).
"""
from django.conf.urls import url, include
from django.contrib.auth import views as auth_views
from . import views
# User accounts URL patterns configuration
urlpatterns = (
# My account page
url(r'^$', views.my_account_show, name='index'),
# Passwo... | <commit_before>"""
URLCONF for the user accounts app (part 2/2).
"""
from django.conf.urls import url, include
from django.contrib.auth import views as auth_views
from . import views
# User accounts URL patterns configuration
urlpatterns = (
# My account page
url(r'^$', views.my_account_show, name='index')... | """
URLCONF for the user accounts app (part 2/2).
"""
from django.conf.urls import url, include
from django.contrib.auth import views as auth_views
from . import views
# User accounts URL patterns configuration
urlpatterns = (
# My account page
url(r'^$', views.my_account_show, name='index'),
# Passwo... | """
URLCONF for the user accounts app (part 2/2).
"""
from django.conf.urls import url, include
from django.contrib.auth import views as auth_views
from . import views
# User accounts URL patterns configuration
urlpatterns = (
# My account page
url(r'^$', views.my_account_show, name='index'),
# Passwo... | <commit_before>"""
URLCONF for the user accounts app (part 2/2).
"""
from django.conf.urls import url, include
from django.contrib.auth import views as auth_views
from . import views
# User accounts URL patterns configuration
urlpatterns = (
# My account page
url(r'^$', views.my_account_show, name='index')... |
7fcaa873db11e9fd74f37251d04f246c384e3d94 | kbkdna/dna.py | kbkdna/dna.py | #!/usr/bin/env python2
def reverse(seq):
return seq[::-1]
def complement(seq):
from string import maketrans
complements = maketrans('ACTGactg', 'TGACtgac')
return seq.translate(complements)
def reverse_complement(seq):
return reverse(complement(seq))
def gc_content(seq):
# This function cont... | #!/usr/bin/env python2
from __future__ import division
def reverse(seq):
"""Return the reverse of the given sequence (i.e. 3' to
5')."""
return seq[::-1]
def complement(seq):
"""Return the complement of the given sequence (i.e. G=>C,
A=>T, etc.)"""
from string import maketrans
complemen... | Fix the gc_content bug to get a clean Travis report. | Fix the gc_content bug to get a clean Travis report.
| Python | mit | kalekundert/kbkdna | #!/usr/bin/env python2
def reverse(seq):
return seq[::-1]
def complement(seq):
from string import maketrans
complements = maketrans('ACTGactg', 'TGACtgac')
return seq.translate(complements)
def reverse_complement(seq):
return reverse(complement(seq))
def gc_content(seq):
# This function cont... | #!/usr/bin/env python2
from __future__ import division
def reverse(seq):
"""Return the reverse of the given sequence (i.e. 3' to
5')."""
return seq[::-1]
def complement(seq):
"""Return the complement of the given sequence (i.e. G=>C,
A=>T, etc.)"""
from string import maketrans
complemen... | <commit_before>#!/usr/bin/env python2
def reverse(seq):
return seq[::-1]
def complement(seq):
from string import maketrans
complements = maketrans('ACTGactg', 'TGACtgac')
return seq.translate(complements)
def reverse_complement(seq):
return reverse(complement(seq))
def gc_content(seq):
# Thi... | #!/usr/bin/env python2
from __future__ import division
def reverse(seq):
"""Return the reverse of the given sequence (i.e. 3' to
5')."""
return seq[::-1]
def complement(seq):
"""Return the complement of the given sequence (i.e. G=>C,
A=>T, etc.)"""
from string import maketrans
complemen... | #!/usr/bin/env python2
def reverse(seq):
return seq[::-1]
def complement(seq):
from string import maketrans
complements = maketrans('ACTGactg', 'TGACtgac')
return seq.translate(complements)
def reverse_complement(seq):
return reverse(complement(seq))
def gc_content(seq):
# This function cont... | <commit_before>#!/usr/bin/env python2
def reverse(seq):
return seq[::-1]
def complement(seq):
from string import maketrans
complements = maketrans('ACTGactg', 'TGACtgac')
return seq.translate(complements)
def reverse_complement(seq):
return reverse(complement(seq))
def gc_content(seq):
# Thi... |
1214870ea94d63a543593fe4f8fde2a78807d166 | django_sphinx_db/backend/models.py | django_sphinx_db/backend/models.py | from django.db import models
from django.db.models.sql import Query
from django.db.models.query import QuerySet
from django_sphinx_db.backend.sphinx.compiler import SphinxWhereNode
class SphinxQuery(Query):
compiler = 'SphinxQLCompiler'
def __init__(self, *args, **kwargs):
kwargs.setdefault('where', S... | from django.db import models
from django.db.models.sql import Query
from django.db.models.query import QuerySet
from django_sphinx_db.backend.sphinx.compiler import SphinxWhereNode
class SphinxQuery(Query):
compiler = 'SphinxQLCompiler'
def __init__(self, *args, **kwargs):
kwargs.setdefault('where', S... | Handle the situation where a SphinxModel is related to a non-sphinx model. | Handle the situation where a SphinxModel is related to a non-sphinx model.
| Python | bsd-3-clause | rutube/django-sphinx-db,jnormore/django-sphinx-db,anatoliy-larin/django-sphinx-db,smartfile/django-sphinx-db,petekalo/django-sphinx-db | from django.db import models
from django.db.models.sql import Query
from django.db.models.query import QuerySet
from django_sphinx_db.backend.sphinx.compiler import SphinxWhereNode
class SphinxQuery(Query):
compiler = 'SphinxQLCompiler'
def __init__(self, *args, **kwargs):
kwargs.setdefault('where', S... | from django.db import models
from django.db.models.sql import Query
from django.db.models.query import QuerySet
from django_sphinx_db.backend.sphinx.compiler import SphinxWhereNode
class SphinxQuery(Query):
compiler = 'SphinxQLCompiler'
def __init__(self, *args, **kwargs):
kwargs.setdefault('where', S... | <commit_before>from django.db import models
from django.db.models.sql import Query
from django.db.models.query import QuerySet
from django_sphinx_db.backend.sphinx.compiler import SphinxWhereNode
class SphinxQuery(Query):
compiler = 'SphinxQLCompiler'
def __init__(self, *args, **kwargs):
kwargs.setdef... | from django.db import models
from django.db.models.sql import Query
from django.db.models.query import QuerySet
from django_sphinx_db.backend.sphinx.compiler import SphinxWhereNode
class SphinxQuery(Query):
compiler = 'SphinxQLCompiler'
def __init__(self, *args, **kwargs):
kwargs.setdefault('where', S... | from django.db import models
from django.db.models.sql import Query
from django.db.models.query import QuerySet
from django_sphinx_db.backend.sphinx.compiler import SphinxWhereNode
class SphinxQuery(Query):
compiler = 'SphinxQLCompiler'
def __init__(self, *args, **kwargs):
kwargs.setdefault('where', S... | <commit_before>from django.db import models
from django.db.models.sql import Query
from django.db.models.query import QuerySet
from django_sphinx_db.backend.sphinx.compiler import SphinxWhereNode
class SphinxQuery(Query):
compiler = 'SphinxQLCompiler'
def __init__(self, *args, **kwargs):
kwargs.setdef... |
3844c3e77da57b001ca55a9ae8eb34a08313728a | sktracker/__init__.py | sktracker/__init__.py | """Object detection and tracking for cell biology
`scikit-learn` is bla bla bla.
Subpackages
-----------
color
Color space conversion.
"""
try:
from .version import __version__
except ImportError: # pragma: no cover
__version__ = "dev" # pragma: no cover
from . import utils
| """Object detection and tracking for cell biology
`scikit-learn` is bla bla bla.
Subpackages
-----------
utils
Utilities functions
"""
import logging
try:
from .version import __version__
except ImportError: # pragma: no cover
__version__ = "dev" # pragma: no cover
from . import utils
def setup_log()... | Add setup_logging during sktracker init | Add setup_logging during sktracker init
| Python | bsd-3-clause | bnoi/scikit-tracker,bnoi/scikit-tracker,bnoi/scikit-tracker | """Object detection and tracking for cell biology
`scikit-learn` is bla bla bla.
Subpackages
-----------
color
Color space conversion.
"""
try:
from .version import __version__
except ImportError: # pragma: no cover
__version__ = "dev" # pragma: no cover
from . import utils
Add setup_logging during skt... | """Object detection and tracking for cell biology
`scikit-learn` is bla bla bla.
Subpackages
-----------
utils
Utilities functions
"""
import logging
try:
from .version import __version__
except ImportError: # pragma: no cover
__version__ = "dev" # pragma: no cover
from . import utils
def setup_log()... | <commit_before>"""Object detection and tracking for cell biology
`scikit-learn` is bla bla bla.
Subpackages
-----------
color
Color space conversion.
"""
try:
from .version import __version__
except ImportError: # pragma: no cover
__version__ = "dev" # pragma: no cover
from . import utils
<commit_msg>A... | """Object detection and tracking for cell biology
`scikit-learn` is bla bla bla.
Subpackages
-----------
utils
Utilities functions
"""
import logging
try:
from .version import __version__
except ImportError: # pragma: no cover
__version__ = "dev" # pragma: no cover
from . import utils
def setup_log()... | """Object detection and tracking for cell biology
`scikit-learn` is bla bla bla.
Subpackages
-----------
color
Color space conversion.
"""
try:
from .version import __version__
except ImportError: # pragma: no cover
__version__ = "dev" # pragma: no cover
from . import utils
Add setup_logging during skt... | <commit_before>"""Object detection and tracking for cell biology
`scikit-learn` is bla bla bla.
Subpackages
-----------
color
Color space conversion.
"""
try:
from .version import __version__
except ImportError: # pragma: no cover
__version__ = "dev" # pragma: no cover
from . import utils
<commit_msg>A... |
c566236de3373aa73c271aaf412de60538c2abfb | common/renderers/excel_renderer.py | common/renderers/excel_renderer.py | import xlsxwriter
import os
from django.conf import settings
from rest_framework import renderers
def _write_excel_file(data):
result = data.get('results')
work_book_name = 'human.xlsx'
workbook = xlsxwriter.Workbook(work_book_name)
worksheet = workbook.add_worksheet()
row = ... | import xlsxwriter
import os
from django.conf import settings
from rest_framework import renderers
def _write_excel_file(data):
result = data.get('results')
work_book_name = 'download.xlsx'
workbook = xlsxwriter.Workbook(work_book_name)
worksheet = workbook.add_worksheet()
row... | Add support for nested lists in the excel renderer | Add support for nested lists in the excel renderer
| Python | mit | MasterFacilityList/mfl_api,urandu/mfl_api,MasterFacilityList/mfl_api,MasterFacilityList/mfl_api,MasterFacilityList/mfl_api,MasterFacilityList/mfl_api,urandu/mfl_api,urandu/mfl_api,urandu/mfl_api | import xlsxwriter
import os
from django.conf import settings
from rest_framework import renderers
def _write_excel_file(data):
result = data.get('results')
work_book_name = 'human.xlsx'
workbook = xlsxwriter.Workbook(work_book_name)
worksheet = workbook.add_worksheet()
row = ... | import xlsxwriter
import os
from django.conf import settings
from rest_framework import renderers
def _write_excel_file(data):
result = data.get('results')
work_book_name = 'download.xlsx'
workbook = xlsxwriter.Workbook(work_book_name)
worksheet = workbook.add_worksheet()
row... | <commit_before>import xlsxwriter
import os
from django.conf import settings
from rest_framework import renderers
def _write_excel_file(data):
result = data.get('results')
work_book_name = 'human.xlsx'
workbook = xlsxwriter.Workbook(work_book_name)
worksheet = workbook.add_worksheet()... | import xlsxwriter
import os
from django.conf import settings
from rest_framework import renderers
def _write_excel_file(data):
result = data.get('results')
work_book_name = 'download.xlsx'
workbook = xlsxwriter.Workbook(work_book_name)
worksheet = workbook.add_worksheet()
row... | import xlsxwriter
import os
from django.conf import settings
from rest_framework import renderers
def _write_excel_file(data):
result = data.get('results')
work_book_name = 'human.xlsx'
workbook = xlsxwriter.Workbook(work_book_name)
worksheet = workbook.add_worksheet()
row = ... | <commit_before>import xlsxwriter
import os
from django.conf import settings
from rest_framework import renderers
def _write_excel_file(data):
result = data.get('results')
work_book_name = 'human.xlsx'
workbook = xlsxwriter.Workbook(work_book_name)
worksheet = workbook.add_worksheet()... |
7e3b0ab5366756018e3bcaa50843e7d28ab7643c | codemood/common/views.py | codemood/common/views.py | from django.views.generic import TemplateView
from commits.forms import RepositoryForm
from commits.models import Repository, Commit
from social.models import Post
class Index(TemplateView):
def get_template_names(self):
if self.request.user.is_authenticated():
return 'index/authorized.html'
... | from django.views.generic import TemplateView
from commits.forms import RepositoryForm
from commits.models import Repository, Commit
from social.models import Post
class Index(TemplateView):
"""
Return different view to authenticated and not.
"""
def dispatch(self, request, *args, **kwargs):
i... | Split Index view to AuthenticatedIndex view and NotAuthenticatedIndex view. | Split Index view to AuthenticatedIndex view and NotAuthenticatedIndex view.
| Python | mit | mindinpanic/codingmood,pavlenko-volodymyr/codingmood,mindinpanic/codingmood,pavlenko-volodymyr/codingmood | from django.views.generic import TemplateView
from commits.forms import RepositoryForm
from commits.models import Repository, Commit
from social.models import Post
class Index(TemplateView):
def get_template_names(self):
if self.request.user.is_authenticated():
return 'index/authorized.html'
... | from django.views.generic import TemplateView
from commits.forms import RepositoryForm
from commits.models import Repository, Commit
from social.models import Post
class Index(TemplateView):
"""
Return different view to authenticated and not.
"""
def dispatch(self, request, *args, **kwargs):
i... | <commit_before>from django.views.generic import TemplateView
from commits.forms import RepositoryForm
from commits.models import Repository, Commit
from social.models import Post
class Index(TemplateView):
def get_template_names(self):
if self.request.user.is_authenticated():
return 'index/au... | from django.views.generic import TemplateView
from commits.forms import RepositoryForm
from commits.models import Repository, Commit
from social.models import Post
class Index(TemplateView):
"""
Return different view to authenticated and not.
"""
def dispatch(self, request, *args, **kwargs):
i... | from django.views.generic import TemplateView
from commits.forms import RepositoryForm
from commits.models import Repository, Commit
from social.models import Post
class Index(TemplateView):
def get_template_names(self):
if self.request.user.is_authenticated():
return 'index/authorized.html'
... | <commit_before>from django.views.generic import TemplateView
from commits.forms import RepositoryForm
from commits.models import Repository, Commit
from social.models import Post
class Index(TemplateView):
def get_template_names(self):
if self.request.user.is_authenticated():
return 'index/au... |
efc3aa4868eebf514b853a054cf382c6a9fb44a5 | server/middleware/AddToBU.py | server/middleware/AddToBU.py | from django.conf import settings
from django.utils.deprecation import MiddlewareMixin
from server.models import *
class AddToBU(MiddlewareMixin):
"""
This middleware will add the current user to any BU's they've not already
been explicitly added to.
"""
def process_view(self, request, view_func,... | from django.conf import settings
from django.utils.deprecation import MiddlewareMixin
from server.models import *
class AddToBU(MiddlewareMixin):
"""
This middleware will add the current user to any BU's they've not already
been explicitly added to.
"""
def process_view(self, request, view_func,... | Make `is_authenticated` a property access rather than a function call. | Make `is_authenticated` a property access rather than a function call.
This is a change in Django that was still functional for compatibility
reasons until recently, but ultimately should be an attribute.
| Python | apache-2.0 | sheagcraig/sal,sheagcraig/sal,sheagcraig/sal,salopensource/sal,salopensource/sal,salopensource/sal,sheagcraig/sal,salopensource/sal | from django.conf import settings
from django.utils.deprecation import MiddlewareMixin
from server.models import *
class AddToBU(MiddlewareMixin):
"""
This middleware will add the current user to any BU's they've not already
been explicitly added to.
"""
def process_view(self, request, view_func,... | from django.conf import settings
from django.utils.deprecation import MiddlewareMixin
from server.models import *
class AddToBU(MiddlewareMixin):
"""
This middleware will add the current user to any BU's they've not already
been explicitly added to.
"""
def process_view(self, request, view_func,... | <commit_before>from django.conf import settings
from django.utils.deprecation import MiddlewareMixin
from server.models import *
class AddToBU(MiddlewareMixin):
"""
This middleware will add the current user to any BU's they've not already
been explicitly added to.
"""
def process_view(self, requ... | from django.conf import settings
from django.utils.deprecation import MiddlewareMixin
from server.models import *
class AddToBU(MiddlewareMixin):
"""
This middleware will add the current user to any BU's they've not already
been explicitly added to.
"""
def process_view(self, request, view_func,... | from django.conf import settings
from django.utils.deprecation import MiddlewareMixin
from server.models import *
class AddToBU(MiddlewareMixin):
"""
This middleware will add the current user to any BU's they've not already
been explicitly added to.
"""
def process_view(self, request, view_func,... | <commit_before>from django.conf import settings
from django.utils.deprecation import MiddlewareMixin
from server.models import *
class AddToBU(MiddlewareMixin):
"""
This middleware will add the current user to any BU's they've not already
been explicitly added to.
"""
def process_view(self, requ... |
a260020f10b4d993635e579c8b130e754c49f7aa | dogebuild/dogefile_loader.py | dogebuild/dogefile_loader.py | from dogebuild.plugins import ContextHolder
from dogebuild.common import DOGE_FILE
def load_doge_file(filename):
with open(filename) as f:
code = compile(f.read(), DOGE_FILE, 'exec')
ContextHolder.create()
exec(code)
return ContextHolder.clear_and_get()
| import os
from pathlib import Path
from dogebuild.plugins import ContextHolder
from dogebuild.common import DOGE_FILE
def load_doge_file(filename):
dir = Path(filename).resolve().parent
with open(filename) as f:
code = compile(f.read(), DOGE_FILE, 'exec')
ContextHolder.create()
cwd =... | Add cirectoy switch on loading | Add cirectoy switch on loading
| Python | mit | dogebuild/dogebuild | from dogebuild.plugins import ContextHolder
from dogebuild.common import DOGE_FILE
def load_doge_file(filename):
with open(filename) as f:
code = compile(f.read(), DOGE_FILE, 'exec')
ContextHolder.create()
exec(code)
return ContextHolder.clear_and_get()
Add cirectoy switch on load... | import os
from pathlib import Path
from dogebuild.plugins import ContextHolder
from dogebuild.common import DOGE_FILE
def load_doge_file(filename):
dir = Path(filename).resolve().parent
with open(filename) as f:
code = compile(f.read(), DOGE_FILE, 'exec')
ContextHolder.create()
cwd =... | <commit_before>from dogebuild.plugins import ContextHolder
from dogebuild.common import DOGE_FILE
def load_doge_file(filename):
with open(filename) as f:
code = compile(f.read(), DOGE_FILE, 'exec')
ContextHolder.create()
exec(code)
return ContextHolder.clear_and_get()
<commit_msg>... | import os
from pathlib import Path
from dogebuild.plugins import ContextHolder
from dogebuild.common import DOGE_FILE
def load_doge_file(filename):
dir = Path(filename).resolve().parent
with open(filename) as f:
code = compile(f.read(), DOGE_FILE, 'exec')
ContextHolder.create()
cwd =... | from dogebuild.plugins import ContextHolder
from dogebuild.common import DOGE_FILE
def load_doge_file(filename):
with open(filename) as f:
code = compile(f.read(), DOGE_FILE, 'exec')
ContextHolder.create()
exec(code)
return ContextHolder.clear_and_get()
Add cirectoy switch on load... | <commit_before>from dogebuild.plugins import ContextHolder
from dogebuild.common import DOGE_FILE
def load_doge_file(filename):
with open(filename) as f:
code = compile(f.read(), DOGE_FILE, 'exec')
ContextHolder.create()
exec(code)
return ContextHolder.clear_and_get()
<commit_msg>... |
06d2bb81d19ba3089bddeb77e7e85482b5f0596b | cms/djangoapps/contentstore/management/commands/export_all_courses.py | cms/djangoapps/contentstore/management/commands/export_all_courses.py | """
Script for exporting all courseware from Mongo to a directory
"""
from django.core.management.base import BaseCommand, CommandError
from xmodule.modulestore.xml_exporter import export_to_xml
from xmodule.modulestore.django import modulestore
from xmodule.contentstore.django import contentstore
class Command(BaseC... | """
Script for exporting all courseware from Mongo to a directory
"""
from django.core.management.base import BaseCommand, CommandError
from xmodule.modulestore.xml_exporter import export_to_xml
from xmodule.modulestore.django import modulestore
from xmodule.contentstore.django import contentstore
class Command(BaseC... | Fix course id separator at export all courses command | Fix course id separator at export all courses command
| Python | agpl-3.0 | morenopc/edx-platform,morenopc/edx-platform,morenopc/edx-platform,morenopc/edx-platform,morenopc/edx-platform | """
Script for exporting all courseware from Mongo to a directory
"""
from django.core.management.base import BaseCommand, CommandError
from xmodule.modulestore.xml_exporter import export_to_xml
from xmodule.modulestore.django import modulestore
from xmodule.contentstore.django import contentstore
class Command(BaseC... | """
Script for exporting all courseware from Mongo to a directory
"""
from django.core.management.base import BaseCommand, CommandError
from xmodule.modulestore.xml_exporter import export_to_xml
from xmodule.modulestore.django import modulestore
from xmodule.contentstore.django import contentstore
class Command(BaseC... | <commit_before>"""
Script for exporting all courseware from Mongo to a directory
"""
from django.core.management.base import BaseCommand, CommandError
from xmodule.modulestore.xml_exporter import export_to_xml
from xmodule.modulestore.django import modulestore
from xmodule.contentstore.django import contentstore
clas... | """
Script for exporting all courseware from Mongo to a directory
"""
from django.core.management.base import BaseCommand, CommandError
from xmodule.modulestore.xml_exporter import export_to_xml
from xmodule.modulestore.django import modulestore
from xmodule.contentstore.django import contentstore
class Command(BaseC... | """
Script for exporting all courseware from Mongo to a directory
"""
from django.core.management.base import BaseCommand, CommandError
from xmodule.modulestore.xml_exporter import export_to_xml
from xmodule.modulestore.django import modulestore
from xmodule.contentstore.django import contentstore
class Command(BaseC... | <commit_before>"""
Script for exporting all courseware from Mongo to a directory
"""
from django.core.management.base import BaseCommand, CommandError
from xmodule.modulestore.xml_exporter import export_to_xml
from xmodule.modulestore.django import modulestore
from xmodule.contentstore.django import contentstore
clas... |
c4068d47da3b98f8fcc38bde6ab477174ab92a3f | djlint/analyzers/context.py | djlint/analyzers/context.py | class ContextPopException(Exception):
pass
class Context(object):
def __init__(self):
self.dicts = [{}]
def push(self):
d = {}
self.dicts.append(d)
return d
def pop(self):
if len(self.dicts) == 1:
raise ContextPopException
return self.dict... | """Inspired by django.template.Context"""
class ContextPopException(Exception):
"""pop() has been called more times than push()"""
class Context(object):
"""A stack container for imports and assignments."""
def __init__(self):
self.dicts = [{}]
def push(self):
d = {}
self.d... | Remove Context.get method and add docstrings | Remove Context.get method and add docstrings
| Python | isc | alfredhq/djlint | class ContextPopException(Exception):
pass
class Context(object):
def __init__(self):
self.dicts = [{}]
def push(self):
d = {}
self.dicts.append(d)
return d
def pop(self):
if len(self.dicts) == 1:
raise ContextPopException
return self.dict... | """Inspired by django.template.Context"""
class ContextPopException(Exception):
"""pop() has been called more times than push()"""
class Context(object):
"""A stack container for imports and assignments."""
def __init__(self):
self.dicts = [{}]
def push(self):
d = {}
self.d... | <commit_before>class ContextPopException(Exception):
pass
class Context(object):
def __init__(self):
self.dicts = [{}]
def push(self):
d = {}
self.dicts.append(d)
return d
def pop(self):
if len(self.dicts) == 1:
raise ContextPopException
r... | """Inspired by django.template.Context"""
class ContextPopException(Exception):
"""pop() has been called more times than push()"""
class Context(object):
"""A stack container for imports and assignments."""
def __init__(self):
self.dicts = [{}]
def push(self):
d = {}
self.d... | class ContextPopException(Exception):
pass
class Context(object):
def __init__(self):
self.dicts = [{}]
def push(self):
d = {}
self.dicts.append(d)
return d
def pop(self):
if len(self.dicts) == 1:
raise ContextPopException
return self.dict... | <commit_before>class ContextPopException(Exception):
pass
class Context(object):
def __init__(self):
self.dicts = [{}]
def push(self):
d = {}
self.dicts.append(d)
return d
def pop(self):
if len(self.dicts) == 1:
raise ContextPopException
r... |
73614f076e93794dde784b6fc376ca85fbb5bc21 | FileWatcher.py | FileWatcher.py | from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
import os
import time
class MyEventHandler(FileSystemEventHandler):
def __init__(self, filePath, callback):
super(MyEventHandler, self).__init__()
self.filePath = filePath
self.callback = callback
... | import sys
# FSEvents observer in watchdog cannot have multiple watchers of the same path
# use kqueue instead
if sys.platform == 'darwin':
from watchdog.observers.kqueue import KqueueObserver as Observer
else:
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
import os... | Work around for watchdog problem on OS X. | Work around for watchdog problem on OS X.
| Python | apache-2.0 | rmcgurrin/PyQLab,calebjordan/PyQLab,Plourde-Research-Lab/PyQLab,BBN-Q/PyQLab | from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
import os
import time
class MyEventHandler(FileSystemEventHandler):
def __init__(self, filePath, callback):
super(MyEventHandler, self).__init__()
self.filePath = filePath
self.callback = callback
... | import sys
# FSEvents observer in watchdog cannot have multiple watchers of the same path
# use kqueue instead
if sys.platform == 'darwin':
from watchdog.observers.kqueue import KqueueObserver as Observer
else:
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
import os... | <commit_before>from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
import os
import time
class MyEventHandler(FileSystemEventHandler):
def __init__(self, filePath, callback):
super(MyEventHandler, self).__init__()
self.filePath = filePath
self.callba... | import sys
# FSEvents observer in watchdog cannot have multiple watchers of the same path
# use kqueue instead
if sys.platform == 'darwin':
from watchdog.observers.kqueue import KqueueObserver as Observer
else:
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
import os... | from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
import os
import time
class MyEventHandler(FileSystemEventHandler):
def __init__(self, filePath, callback):
super(MyEventHandler, self).__init__()
self.filePath = filePath
self.callback = callback
... | <commit_before>from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
import os
import time
class MyEventHandler(FileSystemEventHandler):
def __init__(self, filePath, callback):
super(MyEventHandler, self).__init__()
self.filePath = filePath
self.callba... |
63fd487b8f00490c34e8dbcddcd6d7a9c070d457 | cs251tk/toolkit/process_student.py | cs251tk/toolkit/process_student.py | import os
from cs251tk.student import remove
from cs251tk.student import clone_student
from cs251tk.student import stash
from cs251tk.student import pull
from cs251tk.student import checkout_date
from cs251tk.student import record
from cs251tk.student import reset
from cs251tk.student import analyze
def process_stud... | from cs251tk.student import remove
from cs251tk.student import clone_student
from cs251tk.student import stash
from cs251tk.student import pull
from cs251tk.student import checkout_date
from cs251tk.student import record
from cs251tk.student import reset
from cs251tk.student import analyze
def process_student(
st... | Remove leftover imports from testing | Remove leftover imports from testing | Python | mit | StoDevX/cs251-toolkit,StoDevX/cs251-toolkit,StoDevX/cs251-toolkit,StoDevX/cs251-toolkit | import os
from cs251tk.student import remove
from cs251tk.student import clone_student
from cs251tk.student import stash
from cs251tk.student import pull
from cs251tk.student import checkout_date
from cs251tk.student import record
from cs251tk.student import reset
from cs251tk.student import analyze
def process_stud... | from cs251tk.student import remove
from cs251tk.student import clone_student
from cs251tk.student import stash
from cs251tk.student import pull
from cs251tk.student import checkout_date
from cs251tk.student import record
from cs251tk.student import reset
from cs251tk.student import analyze
def process_student(
st... | <commit_before>import os
from cs251tk.student import remove
from cs251tk.student import clone_student
from cs251tk.student import stash
from cs251tk.student import pull
from cs251tk.student import checkout_date
from cs251tk.student import record
from cs251tk.student import reset
from cs251tk.student import analyze
d... | from cs251tk.student import remove
from cs251tk.student import clone_student
from cs251tk.student import stash
from cs251tk.student import pull
from cs251tk.student import checkout_date
from cs251tk.student import record
from cs251tk.student import reset
from cs251tk.student import analyze
def process_student(
st... | import os
from cs251tk.student import remove
from cs251tk.student import clone_student
from cs251tk.student import stash
from cs251tk.student import pull
from cs251tk.student import checkout_date
from cs251tk.student import record
from cs251tk.student import reset
from cs251tk.student import analyze
def process_stud... | <commit_before>import os
from cs251tk.student import remove
from cs251tk.student import clone_student
from cs251tk.student import stash
from cs251tk.student import pull
from cs251tk.student import checkout_date
from cs251tk.student import record
from cs251tk.student import reset
from cs251tk.student import analyze
d... |
5fe4dab51c8b7c725b49bd6352fbf531003ead4e | openpnm/topotools/generators/__init__.py | openpnm/topotools/generators/__init__.py | from .cubic import cubic
from .delaunay import delaunay
from .gabriel import gabriel
from .voronoi import voronoi
from .voronoi_delaunay_dual import voronoi_delaunay_dual
from .template import cubic_template
from .fcc import fcc
from .bcc import bcc
| r"""
================================================
Generators (:mod:`openpnm.topotools.generators`)
================================================
This module contains a selection of functions that deal specifically with
generating sufficient information that can be turned into an openpnm network.
.. currentmodu... | Add docstrings to generators' init file | Add docstrings to generators' init file
| Python | mit | PMEAL/OpenPNM | from .cubic import cubic
from .delaunay import delaunay
from .gabriel import gabriel
from .voronoi import voronoi
from .voronoi_delaunay_dual import voronoi_delaunay_dual
from .template import cubic_template
from .fcc import fcc
from .bcc import bcc
Add docstrings to generators' init file | r"""
================================================
Generators (:mod:`openpnm.topotools.generators`)
================================================
This module contains a selection of functions that deal specifically with
generating sufficient information that can be turned into an openpnm network.
.. currentmodu... | <commit_before>from .cubic import cubic
from .delaunay import delaunay
from .gabriel import gabriel
from .voronoi import voronoi
from .voronoi_delaunay_dual import voronoi_delaunay_dual
from .template import cubic_template
from .fcc import fcc
from .bcc import bcc
<commit_msg>Add docstrings to generators' init file<com... | r"""
================================================
Generators (:mod:`openpnm.topotools.generators`)
================================================
This module contains a selection of functions that deal specifically with
generating sufficient information that can be turned into an openpnm network.
.. currentmodu... | from .cubic import cubic
from .delaunay import delaunay
from .gabriel import gabriel
from .voronoi import voronoi
from .voronoi_delaunay_dual import voronoi_delaunay_dual
from .template import cubic_template
from .fcc import fcc
from .bcc import bcc
Add docstrings to generators' init filer"""
==========================... | <commit_before>from .cubic import cubic
from .delaunay import delaunay
from .gabriel import gabriel
from .voronoi import voronoi
from .voronoi_delaunay_dual import voronoi_delaunay_dual
from .template import cubic_template
from .fcc import fcc
from .bcc import bcc
<commit_msg>Add docstrings to generators' init file<com... |
872e02dad33b42a804d0e28a500fd60947bc3ea2 | inferno/lib/notifications.py | inferno/lib/notifications.py | import smtplib
from email.mime.text import MIMEText
def send_mail(job_id=None, job_fail=None, mail_to=None, mail_from=None, mail_server=None):
mail_from = "Inferno Daemon <[email protected]>" if not mail_from else mail_from
if not job_id or not job_fail:
raise Exception("Empty job failure ... | import smtplib
from email.mime.text import MIMEText
def send_mail(job_id=None, job_fail=None, mail_to=None, mail_from=None, mail_server=None):
mail_from = "Inferno Daemon <[email protected]>" if not mail_from else mail_from
if not job_id or not job_fail:
raise Exception("Empty job failure... | Clean up email notification message | Clean up email notification message
| Python | mit | chango/inferno,pombredanne/inferno,oldmantaiter/inferno | import smtplib
from email.mime.text import MIMEText
def send_mail(job_id=None, job_fail=None, mail_to=None, mail_from=None, mail_server=None):
mail_from = "Inferno Daemon <[email protected]>" if not mail_from else mail_from
if not job_id or not job_fail:
raise Exception("Empty job failure ... | import smtplib
from email.mime.text import MIMEText
def send_mail(job_id=None, job_fail=None, mail_to=None, mail_from=None, mail_server=None):
mail_from = "Inferno Daemon <[email protected]>" if not mail_from else mail_from
if not job_id or not job_fail:
raise Exception("Empty job failure... | <commit_before>import smtplib
from email.mime.text import MIMEText
def send_mail(job_id=None, job_fail=None, mail_to=None, mail_from=None, mail_server=None):
mail_from = "Inferno Daemon <[email protected]>" if not mail_from else mail_from
if not job_id or not job_fail:
raise Exception("Emp... | import smtplib
from email.mime.text import MIMEText
def send_mail(job_id=None, job_fail=None, mail_to=None, mail_from=None, mail_server=None):
mail_from = "Inferno Daemon <[email protected]>" if not mail_from else mail_from
if not job_id or not job_fail:
raise Exception("Empty job failure... | import smtplib
from email.mime.text import MIMEText
def send_mail(job_id=None, job_fail=None, mail_to=None, mail_from=None, mail_server=None):
mail_from = "Inferno Daemon <[email protected]>" if not mail_from else mail_from
if not job_id or not job_fail:
raise Exception("Empty job failure ... | <commit_before>import smtplib
from email.mime.text import MIMEText
def send_mail(job_id=None, job_fail=None, mail_to=None, mail_from=None, mail_server=None):
mail_from = "Inferno Daemon <[email protected]>" if not mail_from else mail_from
if not job_id or not job_fail:
raise Exception("Emp... |
2ae4fb0dfa4c53e8dc80f3997cb3f9f8d9ad962a | src/ansible/models.py | src/ansible/models.py | from django.db import models
class Project(models.Model):
project_name = models.CharField(max_length=200)
playbook_path = models.CharField(max_length=200, default="~/")
ansible_config_path = models.CharField(max_length=200, default="~/")
default_inventory = models.CharField(max_length=200, default="hos... | from django.db import models
class Project(models.Model):
project_name = models.CharField(max_length=200)
playbook_path = models.CharField(max_length=200, default="~/")
ansible_config_path = models.CharField(max_length=200, default="~/")
default_inventory = models.CharField(max_length=200, default="hos... | Fix plural form of Registry | Fix plural form of Registry
TIL how to use meta class
| Python | bsd-3-clause | lozadaOmr/ansible-admin,lozadaOmr/ansible-admin,lozadaOmr/ansible-admin | from django.db import models
class Project(models.Model):
project_name = models.CharField(max_length=200)
playbook_path = models.CharField(max_length=200, default="~/")
ansible_config_path = models.CharField(max_length=200, default="~/")
default_inventory = models.CharField(max_length=200, default="hos... | from django.db import models
class Project(models.Model):
project_name = models.CharField(max_length=200)
playbook_path = models.CharField(max_length=200, default="~/")
ansible_config_path = models.CharField(max_length=200, default="~/")
default_inventory = models.CharField(max_length=200, default="hos... | <commit_before>from django.db import models
class Project(models.Model):
project_name = models.CharField(max_length=200)
playbook_path = models.CharField(max_length=200, default="~/")
ansible_config_path = models.CharField(max_length=200, default="~/")
default_inventory = models.CharField(max_length=20... | from django.db import models
class Project(models.Model):
project_name = models.CharField(max_length=200)
playbook_path = models.CharField(max_length=200, default="~/")
ansible_config_path = models.CharField(max_length=200, default="~/")
default_inventory = models.CharField(max_length=200, default="hos... | from django.db import models
class Project(models.Model):
project_name = models.CharField(max_length=200)
playbook_path = models.CharField(max_length=200, default="~/")
ansible_config_path = models.CharField(max_length=200, default="~/")
default_inventory = models.CharField(max_length=200, default="hos... | <commit_before>from django.db import models
class Project(models.Model):
project_name = models.CharField(max_length=200)
playbook_path = models.CharField(max_length=200, default="~/")
ansible_config_path = models.CharField(max_length=200, default="~/")
default_inventory = models.CharField(max_length=20... |
346d16c034450cc2cb4f26a5fcc71e721e1ac607 | api/setup.py | api/setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import humbug
import glob
from distutils.core import setup
setup(name='humbug',
version=humbug.__version__,
description='Bindings for the Humbug message API',
author='Humbug, Inc.',
author_email='[email protected]',
classifiers=[
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import humbug
import glob
import os.path
from distutils.core import setup
setup(name='humbug',
version=humbug.__version__,
description='Bindings for the Humbug message API',
author='Humbug, Inc.',
author_email='[email protected]',
classifi... | Fix need to manually update list of integrations. | api: Fix need to manually update list of integrations.
(imported from commit 6842230f939483d32acb023ad38c53cb627df149)
| Python | apache-2.0 | yuvipanda/zulip,ryanbackman/zulip,Diptanshu8/zulip,LAndreas/zulip,joyhchen/zulip,vakila/zulip,DazWorrall/zulip,avastu/zulip,rht/zulip,PhilSk/zulip,udxxabp/zulip,brainwane/zulip,isht3/zulip,thomasboyt/zulip,bluesea/zulip,kou/zulip,zorojean/zulip,wavelets/zulip,timabbott/zulip,dawran6/zulip,Frouk/zulip,zachallaun/zulip,z... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import humbug
import glob
from distutils.core import setup
setup(name='humbug',
version=humbug.__version__,
description='Bindings for the Humbug message API',
author='Humbug, Inc.',
author_email='[email protected]',
classifiers=[
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import humbug
import glob
import os.path
from distutils.core import setup
setup(name='humbug',
version=humbug.__version__,
description='Bindings for the Humbug message API',
author='Humbug, Inc.',
author_email='[email protected]',
classifi... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import humbug
import glob
from distutils.core import setup
setup(name='humbug',
version=humbug.__version__,
description='Bindings for the Humbug message API',
author='Humbug, Inc.',
author_email='[email protected]',
classifi... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import humbug
import glob
import os.path
from distutils.core import setup
setup(name='humbug',
version=humbug.__version__,
description='Bindings for the Humbug message API',
author='Humbug, Inc.',
author_email='[email protected]',
classifi... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import humbug
import glob
from distutils.core import setup
setup(name='humbug',
version=humbug.__version__,
description='Bindings for the Humbug message API',
author='Humbug, Inc.',
author_email='[email protected]',
classifiers=[
... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import humbug
import glob
from distutils.core import setup
setup(name='humbug',
version=humbug.__version__,
description='Bindings for the Humbug message API',
author='Humbug, Inc.',
author_email='[email protected]',
classifi... |
4e3351486b88a8cec60279ff3182565921caec0d | website_portal_v10/__openerp__.py | website_portal_v10/__openerp__.py | {
'name': 'Website Portal',
'category': 'Website',
'summary': 'Account Management Frontend for your Customers',
'version': '1.0',
'description': """
Allows your customers to manage their account from a beautiful web interface.
""",
'website': 'https://www.odoo.com/',
'depends': [
... | {
'name': 'Website Portal',
'category': 'Website',
'summary': 'Account Management Frontend for your Customers',
'version': '1.0',
'description': """
Allows your customers to manage their account from a beautiful web interface.
""",
'depends': [
'website',
],
'data': [
... | Remove 'author' and 'website' on odoo modules' manisfest | [IMP] Remove 'author' and 'website' on odoo modules' manisfest
And use the default values :
- author : 'Odoo S.A.'
- website: https://www.odoo.com/
| Python | agpl-3.0 | Tecnativa/website,JayVora-SerpentCS/website,RoelAdriaans-B-informed/website,JayVora-SerpentCS/website,JayVora-SerpentCS/website,nicolas-petit/website,RoelAdriaans-B-informed/website,khaeusler/website,khaeusler/website,Tecnativa/website,RoelAdriaans-B-informed/website,nicolas-petit/website,khaeusler/website,nicolas-peti... | {
'name': 'Website Portal',
'category': 'Website',
'summary': 'Account Management Frontend for your Customers',
'version': '1.0',
'description': """
Allows your customers to manage their account from a beautiful web interface.
""",
'website': 'https://www.odoo.com/',
'depends': [
... | {
'name': 'Website Portal',
'category': 'Website',
'summary': 'Account Management Frontend for your Customers',
'version': '1.0',
'description': """
Allows your customers to manage their account from a beautiful web interface.
""",
'depends': [
'website',
],
'data': [
... | <commit_before>{
'name': 'Website Portal',
'category': 'Website',
'summary': 'Account Management Frontend for your Customers',
'version': '1.0',
'description': """
Allows your customers to manage their account from a beautiful web interface.
""",
'website': 'https://www.odoo.com/',
'... | {
'name': 'Website Portal',
'category': 'Website',
'summary': 'Account Management Frontend for your Customers',
'version': '1.0',
'description': """
Allows your customers to manage their account from a beautiful web interface.
""",
'depends': [
'website',
],
'data': [
... | {
'name': 'Website Portal',
'category': 'Website',
'summary': 'Account Management Frontend for your Customers',
'version': '1.0',
'description': """
Allows your customers to manage their account from a beautiful web interface.
""",
'website': 'https://www.odoo.com/',
'depends': [
... | <commit_before>{
'name': 'Website Portal',
'category': 'Website',
'summary': 'Account Management Frontend for your Customers',
'version': '1.0',
'description': """
Allows your customers to manage their account from a beautiful web interface.
""",
'website': 'https://www.odoo.com/',
'... |
4532912e02761ef5b0209e866107987216a6e98d | compress/filters/yui/__init__.py | compress/filters/yui/__init__.py | import subprocess
from compress.conf import settings
from compress.filter_base import FilterBase, FilterError
class YUICompressorFilter(FilterBase):
def filter_common(self, content, type_, arguments):
command = '%s --type=%s %s' % (settings.COMPRESS_YUI_BINARY, type_, arguments)
if self.verbose:... | import subprocess
from compress.conf import settings
from compress.filter_base import FilterBase, FilterError
class YUICompressorFilter(FilterBase):
def filter_common(self, content, type_, arguments):
command = '%s --type=%s %s' % (settings.COMPRESS_YUI_BINARY, type_, arguments)
if self.verbose:... | Fix YUI arg passing, had CSS/JS flipped | Fix YUI arg passing, had CSS/JS flipped
| Python | mit | cyberdelia/django-pipeline,sjhewitt/django-pipeline,perdona/django-pipeline,sideffect0/django-pipeline,adamcharnock/django-pipeline,jwatson/django-pipeline,kronion/django-pipeline,lydell/django-pipeline,apendleton/django-pipeline,edx/django-pipeline,yuvadm/django-pipeline,novapost/django-pipeline,floppym/django-pipelin... | import subprocess
from compress.conf import settings
from compress.filter_base import FilterBase, FilterError
class YUICompressorFilter(FilterBase):
def filter_common(self, content, type_, arguments):
command = '%s --type=%s %s' % (settings.COMPRESS_YUI_BINARY, type_, arguments)
if self.verbose:... | import subprocess
from compress.conf import settings
from compress.filter_base import FilterBase, FilterError
class YUICompressorFilter(FilterBase):
def filter_common(self, content, type_, arguments):
command = '%s --type=%s %s' % (settings.COMPRESS_YUI_BINARY, type_, arguments)
if self.verbose:... | <commit_before>import subprocess
from compress.conf import settings
from compress.filter_base import FilterBase, FilterError
class YUICompressorFilter(FilterBase):
def filter_common(self, content, type_, arguments):
command = '%s --type=%s %s' % (settings.COMPRESS_YUI_BINARY, type_, arguments)
i... | import subprocess
from compress.conf import settings
from compress.filter_base import FilterBase, FilterError
class YUICompressorFilter(FilterBase):
def filter_common(self, content, type_, arguments):
command = '%s --type=%s %s' % (settings.COMPRESS_YUI_BINARY, type_, arguments)
if self.verbose:... | import subprocess
from compress.conf import settings
from compress.filter_base import FilterBase, FilterError
class YUICompressorFilter(FilterBase):
def filter_common(self, content, type_, arguments):
command = '%s --type=%s %s' % (settings.COMPRESS_YUI_BINARY, type_, arguments)
if self.verbose:... | <commit_before>import subprocess
from compress.conf import settings
from compress.filter_base import FilterBase, FilterError
class YUICompressorFilter(FilterBase):
def filter_common(self, content, type_, arguments):
command = '%s --type=%s %s' % (settings.COMPRESS_YUI_BINARY, type_, arguments)
i... |
b14e605c83f95e6e1a3c70f148c32bbdc0ca12b1 | zeus/api/resources/build_index.py | zeus/api/resources/build_index.py | from sqlalchemy.orm import joinedload, subqueryload_all
from zeus import auth
from zeus.models import Build
from .base import Resource
from ..schemas import BuildSchema
builds_schema = BuildSchema(many=True, strict=True)
class BuildIndexResource(Resource):
def get(self):
"""
Return a list of bu... | from sqlalchemy.orm import joinedload, subqueryload_all
from zeus import auth
from zeus.models import Build
from .base import Resource
from ..schemas import BuildSchema
builds_schema = BuildSchema(many=True, strict=True)
class BuildIndexResource(Resource):
def get(self):
"""
Return a list of bu... | Add pagination to build index | feat: Add pagination to build index
| Python | apache-2.0 | getsentry/zeus,getsentry/zeus,getsentry/zeus,getsentry/zeus | from sqlalchemy.orm import joinedload, subqueryload_all
from zeus import auth
from zeus.models import Build
from .base import Resource
from ..schemas import BuildSchema
builds_schema = BuildSchema(many=True, strict=True)
class BuildIndexResource(Resource):
def get(self):
"""
Return a list of bu... | from sqlalchemy.orm import joinedload, subqueryload_all
from zeus import auth
from zeus.models import Build
from .base import Resource
from ..schemas import BuildSchema
builds_schema = BuildSchema(many=True, strict=True)
class BuildIndexResource(Resource):
def get(self):
"""
Return a list of bu... | <commit_before>from sqlalchemy.orm import joinedload, subqueryload_all
from zeus import auth
from zeus.models import Build
from .base import Resource
from ..schemas import BuildSchema
builds_schema = BuildSchema(many=True, strict=True)
class BuildIndexResource(Resource):
def get(self):
"""
Retu... | from sqlalchemy.orm import joinedload, subqueryload_all
from zeus import auth
from zeus.models import Build
from .base import Resource
from ..schemas import BuildSchema
builds_schema = BuildSchema(many=True, strict=True)
class BuildIndexResource(Resource):
def get(self):
"""
Return a list of bu... | from sqlalchemy.orm import joinedload, subqueryload_all
from zeus import auth
from zeus.models import Build
from .base import Resource
from ..schemas import BuildSchema
builds_schema = BuildSchema(many=True, strict=True)
class BuildIndexResource(Resource):
def get(self):
"""
Return a list of bu... | <commit_before>from sqlalchemy.orm import joinedload, subqueryload_all
from zeus import auth
from zeus.models import Build
from .base import Resource
from ..schemas import BuildSchema
builds_schema = BuildSchema(many=True, strict=True)
class BuildIndexResource(Resource):
def get(self):
"""
Retu... |
04a7de877c50bc84428e7bb7d30b1c6cac00a59f | ipywidgets/widgets/tests/test_widget_selection.py | ipywidgets/widgets/tests/test_widget_selection.py | # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import warnings
from unittest import TestCase
from ipywidgets import Dropdown
class TestDropdown(TestCase):
def test_construction(self):
Dropdown()
def test_deprecation_warning_mapping_options(sel... | # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import warnings
from unittest import TestCase
from ipywidgets import Dropdown
class TestDropdown(TestCase):
def test_construction(self):
Dropdown()
def test_deprecation_warning_mapping_options(sel... | Use simplefilter('always') for testing the warning | Use simplefilter('always') for testing the warning
* Use `warnings.simplefilter('always')` for DeprecationWarning
* More specific test on warning message
| Python | bsd-3-clause | jupyter-widgets/ipywidgets,ipython/ipywidgets,SylvainCorlay/ipywidgets,jupyter-widgets/ipywidgets,ipython/ipywidgets,jupyter-widgets/ipywidgets,ipython/ipywidgets,jupyter-widgets/ipywidgets,SylvainCorlay/ipywidgets,ipython/ipywidgets,SylvainCorlay/ipywidgets,SylvainCorlay/ipywidgets,ipython/ipywidgets | # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import warnings
from unittest import TestCase
from ipywidgets import Dropdown
class TestDropdown(TestCase):
def test_construction(self):
Dropdown()
def test_deprecation_warning_mapping_options(sel... | # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import warnings
from unittest import TestCase
from ipywidgets import Dropdown
class TestDropdown(TestCase):
def test_construction(self):
Dropdown()
def test_deprecation_warning_mapping_options(sel... | <commit_before># Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import warnings
from unittest import TestCase
from ipywidgets import Dropdown
class TestDropdown(TestCase):
def test_construction(self):
Dropdown()
def test_deprecation_warning_mapp... | # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import warnings
from unittest import TestCase
from ipywidgets import Dropdown
class TestDropdown(TestCase):
def test_construction(self):
Dropdown()
def test_deprecation_warning_mapping_options(sel... | # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import warnings
from unittest import TestCase
from ipywidgets import Dropdown
class TestDropdown(TestCase):
def test_construction(self):
Dropdown()
def test_deprecation_warning_mapping_options(sel... | <commit_before># Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import warnings
from unittest import TestCase
from ipywidgets import Dropdown
class TestDropdown(TestCase):
def test_construction(self):
Dropdown()
def test_deprecation_warning_mapp... |
81978240e48dbaac2567054b33617a1acabbb695 | corehq/apps/app_manager/tasks.py | corehq/apps/app_manager/tasks.py | from celery.task import task
from corehq.apps.users.models import CommCareUser
@task
def create_user_cases(domain_name):
from corehq.apps.callcenter.utils import sync_usercase
for user in CommCareUser.by_domain(domain_name):
sync_usercase(user)
| from celery.task import task
from corehq.apps.users.models import CommCareUser
@task(queue='background_queue')
def create_user_cases(domain_name):
from corehq.apps.callcenter.utils import sync_usercase
for user in CommCareUser.by_domain(domain_name):
sync_usercase(user)
| Use background queue for creating user cases | Use background queue for creating user cases
| Python | bsd-3-clause | qedsoftware/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq | from celery.task import task
from corehq.apps.users.models import CommCareUser
@task
def create_user_cases(domain_name):
from corehq.apps.callcenter.utils import sync_usercase
for user in CommCareUser.by_domain(domain_name):
sync_usercase(user)
Use background queue for creating user cases | from celery.task import task
from corehq.apps.users.models import CommCareUser
@task(queue='background_queue')
def create_user_cases(domain_name):
from corehq.apps.callcenter.utils import sync_usercase
for user in CommCareUser.by_domain(domain_name):
sync_usercase(user)
| <commit_before>from celery.task import task
from corehq.apps.users.models import CommCareUser
@task
def create_user_cases(domain_name):
from corehq.apps.callcenter.utils import sync_usercase
for user in CommCareUser.by_domain(domain_name):
sync_usercase(user)
<commit_msg>Use background queue for creat... | from celery.task import task
from corehq.apps.users.models import CommCareUser
@task(queue='background_queue')
def create_user_cases(domain_name):
from corehq.apps.callcenter.utils import sync_usercase
for user in CommCareUser.by_domain(domain_name):
sync_usercase(user)
| from celery.task import task
from corehq.apps.users.models import CommCareUser
@task
def create_user_cases(domain_name):
from corehq.apps.callcenter.utils import sync_usercase
for user in CommCareUser.by_domain(domain_name):
sync_usercase(user)
Use background queue for creating user casesfrom celery.t... | <commit_before>from celery.task import task
from corehq.apps.users.models import CommCareUser
@task
def create_user_cases(domain_name):
from corehq.apps.callcenter.utils import sync_usercase
for user in CommCareUser.by_domain(domain_name):
sync_usercase(user)
<commit_msg>Use background queue for creat... |
c5001c6f6dab2639fdeb5735f4d4f6f7b8d35395 | pamqp/body.py | pamqp/body.py | # -*- encoding: utf-8 -*-
"""
The pamqp.body module contains the Body class which is used when
unmarshaling body frames. When dealing with content frames, the message body
will be returned from the library as an instance of the body class.
"""
class ContentBody(object):
"""ContentBody carries the value for an AM... | # -*- encoding: utf-8 -*-
"""
The pamqp.body module contains the Body class which is used when
unmarshaling body frames. When dealing with content frames, the message body
will be returned from the library as an instance of the body class.
"""
import typing
class ContentBody:
"""ContentBody carries the value for... | Update to include typing, cleanup docstrings and code | Update to include typing, cleanup docstrings and code
| Python | bsd-3-clause | gmr/pamqp | # -*- encoding: utf-8 -*-
"""
The pamqp.body module contains the Body class which is used when
unmarshaling body frames. When dealing with content frames, the message body
will be returned from the library as an instance of the body class.
"""
class ContentBody(object):
"""ContentBody carries the value for an AM... | # -*- encoding: utf-8 -*-
"""
The pamqp.body module contains the Body class which is used when
unmarshaling body frames. When dealing with content frames, the message body
will be returned from the library as an instance of the body class.
"""
import typing
class ContentBody:
"""ContentBody carries the value for... | <commit_before># -*- encoding: utf-8 -*-
"""
The pamqp.body module contains the Body class which is used when
unmarshaling body frames. When dealing with content frames, the message body
will be returned from the library as an instance of the body class.
"""
class ContentBody(object):
"""ContentBody carries the ... | # -*- encoding: utf-8 -*-
"""
The pamqp.body module contains the Body class which is used when
unmarshaling body frames. When dealing with content frames, the message body
will be returned from the library as an instance of the body class.
"""
import typing
class ContentBody:
"""ContentBody carries the value for... | # -*- encoding: utf-8 -*-
"""
The pamqp.body module contains the Body class which is used when
unmarshaling body frames. When dealing with content frames, the message body
will be returned from the library as an instance of the body class.
"""
class ContentBody(object):
"""ContentBody carries the value for an AM... | <commit_before># -*- encoding: utf-8 -*-
"""
The pamqp.body module contains the Body class which is used when
unmarshaling body frames. When dealing with content frames, the message body
will be returned from the library as an instance of the body class.
"""
class ContentBody(object):
"""ContentBody carries the ... |
f2f3ed4d735bd12956b5e4915118fc40de11d33a | src/files_create_datetree.py | src/files_create_datetree.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Parse source tree, get old files and move files info a new folder tree"""
import KmdCmd
import KmdFiles
import os
import re
import logging
class KmdFilesMove(KmdCmd.KmdCommand):
regexp = None
def extendParser(self):
super(KmdFilesMove, self).extendParse... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Parse source tree, get old files and move files info a new folder tree"""
import KmdCmd
import KmdFiles
import os
import re
import logging
class KmdFilesMove(KmdCmd.KmdCommand):
regexp = None
def extendParser(self):
super(KmdFilesMove, self).extendParse... | Clean up dir after move | Clean up dir after move
| Python | mit | pzia/keepmydatas | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Parse source tree, get old files and move files info a new folder tree"""
import KmdCmd
import KmdFiles
import os
import re
import logging
class KmdFilesMove(KmdCmd.KmdCommand):
regexp = None
def extendParser(self):
super(KmdFilesMove, self).extendParse... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Parse source tree, get old files and move files info a new folder tree"""
import KmdCmd
import KmdFiles
import os
import re
import logging
class KmdFilesMove(KmdCmd.KmdCommand):
regexp = None
def extendParser(self):
super(KmdFilesMove, self).extendParse... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Parse source tree, get old files and move files info a new folder tree"""
import KmdCmd
import KmdFiles
import os
import re
import logging
class KmdFilesMove(KmdCmd.KmdCommand):
regexp = None
def extendParser(self):
super(KmdFilesMove, se... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Parse source tree, get old files and move files info a new folder tree"""
import KmdCmd
import KmdFiles
import os
import re
import logging
class KmdFilesMove(KmdCmd.KmdCommand):
regexp = None
def extendParser(self):
super(KmdFilesMove, self).extendParse... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Parse source tree, get old files and move files info a new folder tree"""
import KmdCmd
import KmdFiles
import os
import re
import logging
class KmdFilesMove(KmdCmd.KmdCommand):
regexp = None
def extendParser(self):
super(KmdFilesMove, self).extendParse... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Parse source tree, get old files and move files info a new folder tree"""
import KmdCmd
import KmdFiles
import os
import re
import logging
class KmdFilesMove(KmdCmd.KmdCommand):
regexp = None
def extendParser(self):
super(KmdFilesMove, se... |
f9698eb96ca0c69a9d41a2d19a56af83e74da949 | examples/advanced/extend_python.py | examples/advanced/extend_python.py | """
Extend the Python Grammar
==============================
This example demonstrates how to use the `%extend` statement,
to add new syntax to the example Python grammar.
"""
from lark.lark import Lark
from python_parser import PythonIndenter
GRAMMAR = r"""
%import python (compound_stmt, single_input, file_input, ... | """
Extend the Python Grammar
==============================
This example demonstrates how to use the `%extend` statement,
to add new syntax to the example Python grammar.
"""
from lark.lark import Lark
from lark.indenter import PythonIndenter
GRAMMAR = r"""
%import python (compound_stmt, single_input, file_input, ... | Fix confusing import (no change in functionality) | Fix confusing import (no change in functionality) | Python | mit | lark-parser/lark | """
Extend the Python Grammar
==============================
This example demonstrates how to use the `%extend` statement,
to add new syntax to the example Python grammar.
"""
from lark.lark import Lark
from python_parser import PythonIndenter
GRAMMAR = r"""
%import python (compound_stmt, single_input, file_input, ... | """
Extend the Python Grammar
==============================
This example demonstrates how to use the `%extend` statement,
to add new syntax to the example Python grammar.
"""
from lark.lark import Lark
from lark.indenter import PythonIndenter
GRAMMAR = r"""
%import python (compound_stmt, single_input, file_input, ... | <commit_before>"""
Extend the Python Grammar
==============================
This example demonstrates how to use the `%extend` statement,
to add new syntax to the example Python grammar.
"""
from lark.lark import Lark
from python_parser import PythonIndenter
GRAMMAR = r"""
%import python (compound_stmt, single_inpu... | """
Extend the Python Grammar
==============================
This example demonstrates how to use the `%extend` statement,
to add new syntax to the example Python grammar.
"""
from lark.lark import Lark
from lark.indenter import PythonIndenter
GRAMMAR = r"""
%import python (compound_stmt, single_input, file_input, ... | """
Extend the Python Grammar
==============================
This example demonstrates how to use the `%extend` statement,
to add new syntax to the example Python grammar.
"""
from lark.lark import Lark
from python_parser import PythonIndenter
GRAMMAR = r"""
%import python (compound_stmt, single_input, file_input, ... | <commit_before>"""
Extend the Python Grammar
==============================
This example demonstrates how to use the `%extend` statement,
to add new syntax to the example Python grammar.
"""
from lark.lark import Lark
from python_parser import PythonIndenter
GRAMMAR = r"""
%import python (compound_stmt, single_inpu... |
f54c792b5bd79dedca275199d1e0d922f73620e9 | python/protein-translation/protein_translation.py | python/protein-translation/protein_translation.py | # Codon | Protein
# :--- | :---
# AUG | Methionine
# UUU, UUC | Phenylalanine
# UUA, UUG | Leucine
# UCU, UCC, UCC, UCC | Serine
# UAU, UAC | Tyrosine
# UGU, UGC | Cysteine
# UGG | Tryptophan
# UA... | # Codon | Protein
# :--- | :---
# AUG | Methionine
# UUU, UUC | Phenylalanine
# UUA, UUG | Leucine
# UCU, UCC, UCA, UCG | Serine
# UAU, UAC | Tyrosine
# UGU, UGC | Cysteine
# UGG | Tryptophan
# UA... | Fix mapping for codon keys for Serine | Fix mapping for codon keys for Serine
| Python | mit | rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism | # Codon | Protein
# :--- | :---
# AUG | Methionine
# UUU, UUC | Phenylalanine
# UUA, UUG | Leucine
# UCU, UCC, UCC, UCC | Serine
# UAU, UAC | Tyrosine
# UGU, UGC | Cysteine
# UGG | Tryptophan
# UA... | # Codon | Protein
# :--- | :---
# AUG | Methionine
# UUU, UUC | Phenylalanine
# UUA, UUG | Leucine
# UCU, UCC, UCA, UCG | Serine
# UAU, UAC | Tyrosine
# UGU, UGC | Cysteine
# UGG | Tryptophan
# UA... | <commit_before># Codon | Protein
# :--- | :---
# AUG | Methionine
# UUU, UUC | Phenylalanine
# UUA, UUG | Leucine
# UCU, UCC, UCC, UCC | Serine
# UAU, UAC | Tyrosine
# UGU, UGC | Cysteine
# UGG | ... | # Codon | Protein
# :--- | :---
# AUG | Methionine
# UUU, UUC | Phenylalanine
# UUA, UUG | Leucine
# UCU, UCC, UCA, UCG | Serine
# UAU, UAC | Tyrosine
# UGU, UGC | Cysteine
# UGG | Tryptophan
# UA... | # Codon | Protein
# :--- | :---
# AUG | Methionine
# UUU, UUC | Phenylalanine
# UUA, UUG | Leucine
# UCU, UCC, UCC, UCC | Serine
# UAU, UAC | Tyrosine
# UGU, UGC | Cysteine
# UGG | Tryptophan
# UA... | <commit_before># Codon | Protein
# :--- | :---
# AUG | Methionine
# UUU, UUC | Phenylalanine
# UUA, UUG | Leucine
# UCU, UCC, UCC, UCC | Serine
# UAU, UAC | Tyrosine
# UGU, UGC | Cysteine
# UGG | ... |
bed65ca5a3af883a90cdc869dbfdaf08ac4ba40e | company/configurations_api.py | company/configurations_api.py | from ..cw_controller import CWController
# Class for /company/configurations
from connectpyse.company import configuration
class ConfigurationsAPI(CWController):
def __init__(self):
self.module_url = 'company'
self.module = 'configurations'
self._class = configuration.Configuratio... | from ..cw_controller import CWController
# Class for /company/configurations
from . import configuration
class ConfigurationsAPI(CWController):
def __init__(self):
self.module_url = 'company'
self.module = 'configurations'
self._class = configuration.Configuration
super()... | Fix config api class again | Fix config api class again
| Python | mit | joshuamsmith/ConnectPyse | from ..cw_controller import CWController
# Class for /company/configurations
from connectpyse.company import configuration
class ConfigurationsAPI(CWController):
def __init__(self):
self.module_url = 'company'
self.module = 'configurations'
self._class = configuration.Configuratio... | from ..cw_controller import CWController
# Class for /company/configurations
from . import configuration
class ConfigurationsAPI(CWController):
def __init__(self):
self.module_url = 'company'
self.module = 'configurations'
self._class = configuration.Configuration
super()... | <commit_before>from ..cw_controller import CWController
# Class for /company/configurations
from connectpyse.company import configuration
class ConfigurationsAPI(CWController):
def __init__(self):
self.module_url = 'company'
self.module = 'configurations'
self._class = configurati... | from ..cw_controller import CWController
# Class for /company/configurations
from . import configuration
class ConfigurationsAPI(CWController):
def __init__(self):
self.module_url = 'company'
self.module = 'configurations'
self._class = configuration.Configuration
super()... | from ..cw_controller import CWController
# Class for /company/configurations
from connectpyse.company import configuration
class ConfigurationsAPI(CWController):
def __init__(self):
self.module_url = 'company'
self.module = 'configurations'
self._class = configuration.Configuratio... | <commit_before>from ..cw_controller import CWController
# Class for /company/configurations
from connectpyse.company import configuration
class ConfigurationsAPI(CWController):
def __init__(self):
self.module_url = 'company'
self.module = 'configurations'
self._class = configurati... |
391c1681eaeabfdbe65a64a1bb8b05beca30141e | wqflask/utility/db_tools.py | wqflask/utility/db_tools.py | from MySQLdb import escape_string as escape
def create_in_clause(items):
"""Create an in clause for mysql"""
in_clause = ', '.join("'{}'".format(x) for x in mescape(*items))
in_clause = '( {} )'.format(in_clause)
return in_clause
def mescape(*items):
"""Multiple escape"""
escaped = [escape(str... | from MySQLdb import escape_string as escape_
def create_in_clause(items):
"""Create an in clause for mysql"""
in_clause = ', '.join("'{}'".format(x) for x in mescape(*items))
in_clause = '( {} )'.format(in_clause)
return in_clause
def mescape(*items):
"""Multiple escape"""
return [escape_(st... | Add global method to convert binary string to plain string | Add global method to convert binary string to plain string
* wqflask/utility/db_tools.py: escape_string returns a binary string which
introduces a bug when composing sql query string. The escaped strings have to be
converted to plain text.
| Python | agpl-3.0 | pjotrp/genenetwork2,zsloan/genenetwork2,pjotrp/genenetwork2,genenetwork/genenetwork2,zsloan/genenetwork2,zsloan/genenetwork2,pjotrp/genenetwork2,genenetwork/genenetwork2,pjotrp/genenetwork2,genenetwork/genenetwork2,zsloan/genenetwork2,genenetwork/genenetwork2,pjotrp/genenetwork2 | from MySQLdb import escape_string as escape
def create_in_clause(items):
"""Create an in clause for mysql"""
in_clause = ', '.join("'{}'".format(x) for x in mescape(*items))
in_clause = '( {} )'.format(in_clause)
return in_clause
def mescape(*items):
"""Multiple escape"""
escaped = [escape(str... | from MySQLdb import escape_string as escape_
def create_in_clause(items):
"""Create an in clause for mysql"""
in_clause = ', '.join("'{}'".format(x) for x in mescape(*items))
in_clause = '( {} )'.format(in_clause)
return in_clause
def mescape(*items):
"""Multiple escape"""
return [escape_(st... | <commit_before>from MySQLdb import escape_string as escape
def create_in_clause(items):
"""Create an in clause for mysql"""
in_clause = ', '.join("'{}'".format(x) for x in mescape(*items))
in_clause = '( {} )'.format(in_clause)
return in_clause
def mescape(*items):
"""Multiple escape"""
escape... | from MySQLdb import escape_string as escape_
def create_in_clause(items):
"""Create an in clause for mysql"""
in_clause = ', '.join("'{}'".format(x) for x in mescape(*items))
in_clause = '( {} )'.format(in_clause)
return in_clause
def mescape(*items):
"""Multiple escape"""
return [escape_(st... | from MySQLdb import escape_string as escape
def create_in_clause(items):
"""Create an in clause for mysql"""
in_clause = ', '.join("'{}'".format(x) for x in mescape(*items))
in_clause = '( {} )'.format(in_clause)
return in_clause
def mescape(*items):
"""Multiple escape"""
escaped = [escape(str... | <commit_before>from MySQLdb import escape_string as escape
def create_in_clause(items):
"""Create an in clause for mysql"""
in_clause = ', '.join("'{}'".format(x) for x in mescape(*items))
in_clause = '( {} )'.format(in_clause)
return in_clause
def mescape(*items):
"""Multiple escape"""
escape... |
d4a7a69654e9e055c309762340e7aa4a722ca1f1 | mass_mailing_switzerland/models/crm_event_compassion.py | mass_mailing_switzerland/models/crm_event_compassion.py | ##############################################################################
#
# Copyright (C) 2018 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Nathan Fluckiger <[email protected]>
#
# The licence is in the file __manifest__.py
#
#########... | ##############################################################################
#
# Copyright (C) 2018 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Nathan Fluckiger <[email protected]>
#
# The licence is in the file __manifest__.py
#
#########... | FIX bug in event creation | FIX bug in event creation
| Python | agpl-3.0 | eicher31/compassion-switzerland,eicher31/compassion-switzerland,eicher31/compassion-switzerland,CompassionCH/compassion-switzerland,CompassionCH/compassion-switzerland,CompassionCH/compassion-switzerland | ##############################################################################
#
# Copyright (C) 2018 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Nathan Fluckiger <[email protected]>
#
# The licence is in the file __manifest__.py
#
#########... | ##############################################################################
#
# Copyright (C) 2018 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Nathan Fluckiger <[email protected]>
#
# The licence is in the file __manifest__.py
#
#########... | <commit_before>##############################################################################
#
# Copyright (C) 2018 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Nathan Fluckiger <[email protected]>
#
# The licence is in the file __manifest__... | ##############################################################################
#
# Copyright (C) 2018 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Nathan Fluckiger <[email protected]>
#
# The licence is in the file __manifest__.py
#
#########... | ##############################################################################
#
# Copyright (C) 2018 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Nathan Fluckiger <[email protected]>
#
# The licence is in the file __manifest__.py
#
#########... | <commit_before>##############################################################################
#
# Copyright (C) 2018 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Nathan Fluckiger <[email protected]>
#
# The licence is in the file __manifest__... |
00f83dad3a0cec2bccb4de878b477bbcf850e52d | core/datatypes/url.py | core/datatypes/url.py | import re
from mongoengine import *
import urlnorm
from core.datatypes import Element
from core.helpers import is_url
class Url(Element):
def clean(self):
"""Ensures that URLs are canonized before saving"""
try:
if not is_url(self.value):
raise ValidationError("Invali... | import re
from mongoengine import *
import urlnorm
from core.datatypes import Element
from core.helpers import is_url
class Url(Element):
def clean(self):
"""Ensures that URLs are canonized before saving"""
try:
if re.match("[a-zA-Z]+://", self.value) is None:
self.va... | Raise exception on invalid URL | Raise exception on invalid URL
| Python | apache-2.0 | yeti-platform/yeti,yeti-platform/yeti,yeti-platform/yeti,yeti-platform/yeti | import re
from mongoengine import *
import urlnorm
from core.datatypes import Element
from core.helpers import is_url
class Url(Element):
def clean(self):
"""Ensures that URLs are canonized before saving"""
try:
if not is_url(self.value):
raise ValidationError("Invali... | import re
from mongoengine import *
import urlnorm
from core.datatypes import Element
from core.helpers import is_url
class Url(Element):
def clean(self):
"""Ensures that URLs are canonized before saving"""
try:
if re.match("[a-zA-Z]+://", self.value) is None:
self.va... | <commit_before>import re
from mongoengine import *
import urlnorm
from core.datatypes import Element
from core.helpers import is_url
class Url(Element):
def clean(self):
"""Ensures that URLs are canonized before saving"""
try:
if not is_url(self.value):
raise Validati... | import re
from mongoengine import *
import urlnorm
from core.datatypes import Element
from core.helpers import is_url
class Url(Element):
def clean(self):
"""Ensures that URLs are canonized before saving"""
try:
if re.match("[a-zA-Z]+://", self.value) is None:
self.va... | import re
from mongoengine import *
import urlnorm
from core.datatypes import Element
from core.helpers import is_url
class Url(Element):
def clean(self):
"""Ensures that URLs are canonized before saving"""
try:
if not is_url(self.value):
raise ValidationError("Invali... | <commit_before>import re
from mongoengine import *
import urlnorm
from core.datatypes import Element
from core.helpers import is_url
class Url(Element):
def clean(self):
"""Ensures that URLs are canonized before saving"""
try:
if not is_url(self.value):
raise Validati... |
9ad5f279c33339ab00b1fcf90975c085afe0ab43 | mysite/extra_translations.py | mysite/extra_translations.py | # This module exists just to list strings for translation to be picked
# up by makemessages.
from __future__ import unicode_literals
from django.utils.translation import ugettext as _
# Labels for the extra fields which are defined in the database.
# Costa Rica:
_('Profession')
_('Important Roles')
_('Standing for r... | # -*- coding: utf-8 -*-
# This module exists just to list strings for translation to be picked
# up by makemessages.
from __future__ import unicode_literals
from django.utils.translation import ugettext as _
# Labels for the extra fields which are defined in the database.
# Costa Rica:
_('Profession')
_('Important ... | Add some more text used in migrations which need translation | Add some more text used in migrations which need translation
| Python | agpl-3.0 | mysociety/yournextrepresentative,neavouli/yournextrepresentative,DemocracyClub/yournextrepresentative,neavouli/yournextrepresentative,neavouli/yournextrepresentative,mysociety/yournextrepresentative,mysociety/yournextmp-popit,mysociety/yournextmp-popit,mysociety/yournextmp-popit,neavouli/yournextrepresentative,neavouli... | # This module exists just to list strings for translation to be picked
# up by makemessages.
from __future__ import unicode_literals
from django.utils.translation import ugettext as _
# Labels for the extra fields which are defined in the database.
# Costa Rica:
_('Profession')
_('Important Roles')
_('Standing for r... | # -*- coding: utf-8 -*-
# This module exists just to list strings for translation to be picked
# up by makemessages.
from __future__ import unicode_literals
from django.utils.translation import ugettext as _
# Labels for the extra fields which are defined in the database.
# Costa Rica:
_('Profession')
_('Important ... | <commit_before># This module exists just to list strings for translation to be picked
# up by makemessages.
from __future__ import unicode_literals
from django.utils.translation import ugettext as _
# Labels for the extra fields which are defined in the database.
# Costa Rica:
_('Profession')
_('Important Roles')
_(... | # -*- coding: utf-8 -*-
# This module exists just to list strings for translation to be picked
# up by makemessages.
from __future__ import unicode_literals
from django.utils.translation import ugettext as _
# Labels for the extra fields which are defined in the database.
# Costa Rica:
_('Profession')
_('Important ... | # This module exists just to list strings for translation to be picked
# up by makemessages.
from __future__ import unicode_literals
from django.utils.translation import ugettext as _
# Labels for the extra fields which are defined in the database.
# Costa Rica:
_('Profession')
_('Important Roles')
_('Standing for r... | <commit_before># This module exists just to list strings for translation to be picked
# up by makemessages.
from __future__ import unicode_literals
from django.utils.translation import ugettext as _
# Labels for the extra fields which are defined in the database.
# Costa Rica:
_('Profession')
_('Important Roles')
_(... |
6ce72c5b0726fc2e3ae78c6f0a22e4f03f26a2ca | erpnext/patches/v5_4/update_purchase_cost_against_project.py | erpnext/patches/v5_4/update_purchase_cost_against_project.py | # Copyright (c) 2015, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
for p in frappe.get_all("Project"):
project = frappe.get_doc("Project", p.name)
project.update_purchase_costing()
... | # Copyright (c) 2015, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
for p in frappe.get_all("Project", filters={"docstatus": 0}):
project = frappe.get_doc("Project", p.name)
project.... | Update project cost for draft project only | [fix] Update project cost for draft project only
| Python | agpl-3.0 | mbauskar/helpdesk-erpnext,hernad/erpnext,gangadharkadam/saloon_erp_install,mbauskar/omnitech-demo-erpnext,indictranstech/trufil-erpnext,mbauskar/helpdesk-erpnext,susuchina/ERPNEXT,njmube/erpnext,aruizramon/alec_erpnext,ShashaQin/erpnext,anandpdoshi/erpnext,pombredanne/erpnext,aruizramon/alec_erpnext,mahabuber/erpnext,g... | # Copyright (c) 2015, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
for p in frappe.get_all("Project"):
project = frappe.get_doc("Project", p.name)
project.update_purchase_costing()
... | # Copyright (c) 2015, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
for p in frappe.get_all("Project", filters={"docstatus": 0}):
project = frappe.get_doc("Project", p.name)
project.... | <commit_before># Copyright (c) 2015, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
for p in frappe.get_all("Project"):
project = frappe.get_doc("Project", p.name)
project.update_purc... | # Copyright (c) 2015, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
for p in frappe.get_all("Project", filters={"docstatus": 0}):
project = frappe.get_doc("Project", p.name)
project.... | # Copyright (c) 2015, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
for p in frappe.get_all("Project"):
project = frappe.get_doc("Project", p.name)
project.update_purchase_costing()
... | <commit_before># Copyright (c) 2015, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
for p in frappe.get_all("Project"):
project = frappe.get_doc("Project", p.name)
project.update_purc... |
7232f3cfe495814f5c9923cd715d4dff40458c5a | takeyourmeds/api/views.py | takeyourmeds/api/views.py | from rest_framework import serializers, viewsets
from rest_framework.response import Response
from rest_framework.decorators import api_view
from rest_framework.permissions import IsAuthenticated
from takeyourmeds.reminder.models import Reminder
class ReminderTimeField(serializers.RelatedField):
def to_representa... | from rest_framework import serializers, viewsets
from rest_framework.response import Response
from rest_framework.decorators import api_view
from rest_framework.permissions import IsAuthenticated
from takeyourmeds.reminder.models import Reminder
class ReminderTimeField(serializers.RelatedField):
def to_representa... | Use related_name to avoid "missing" security | Use related_name to avoid "missing" security
Signed-off-by: Chris Lamb <[email protected]>
| Python | mit | takeyourmeds/takeyourmeds-web,takeyourmeds/takeyourmeds-web,takeyourmeds/takeyourmeds-web,takeyourmeds/takeyourmeds-web | from rest_framework import serializers, viewsets
from rest_framework.response import Response
from rest_framework.decorators import api_view
from rest_framework.permissions import IsAuthenticated
from takeyourmeds.reminder.models import Reminder
class ReminderTimeField(serializers.RelatedField):
def to_representa... | from rest_framework import serializers, viewsets
from rest_framework.response import Response
from rest_framework.decorators import api_view
from rest_framework.permissions import IsAuthenticated
from takeyourmeds.reminder.models import Reminder
class ReminderTimeField(serializers.RelatedField):
def to_representa... | <commit_before>from rest_framework import serializers, viewsets
from rest_framework.response import Response
from rest_framework.decorators import api_view
from rest_framework.permissions import IsAuthenticated
from takeyourmeds.reminder.models import Reminder
class ReminderTimeField(serializers.RelatedField):
de... | from rest_framework import serializers, viewsets
from rest_framework.response import Response
from rest_framework.decorators import api_view
from rest_framework.permissions import IsAuthenticated
from takeyourmeds.reminder.models import Reminder
class ReminderTimeField(serializers.RelatedField):
def to_representa... | from rest_framework import serializers, viewsets
from rest_framework.response import Response
from rest_framework.decorators import api_view
from rest_framework.permissions import IsAuthenticated
from takeyourmeds.reminder.models import Reminder
class ReminderTimeField(serializers.RelatedField):
def to_representa... | <commit_before>from rest_framework import serializers, viewsets
from rest_framework.response import Response
from rest_framework.decorators import api_view
from rest_framework.permissions import IsAuthenticated
from takeyourmeds.reminder.models import Reminder
class ReminderTimeField(serializers.RelatedField):
de... |
64336620b0b2c279293e921ba0a7cdd15a573d85 | intelmq/bots/parsers/cznic/parser_proki.py | intelmq/bots/parsers/cznic/parser_proki.py | # -*- coding: utf-8 -*-
import json
from intelmq.lib import utils
from intelmq.lib.bot import ParserBot
class CZNICProkiParserBot(ParserBot):
recover_line = ParserBot.recover_line_json
def parse(self, report):
raw_report = utils.base64_decode(report.get("raw"))
report = json.loads(raw_repor... | # -*- coding: utf-8 -*-
import json
from intelmq.lib import utils
from intelmq.lib.bot import ParserBot
class CZNICProkiParserBot(ParserBot):
recover_line = ParserBot.recover_line_json
def parse(self, report):
raw_report = utils.base64_decode(report.get("raw"))
report = json.loads(raw_repor... | Allow loading events from dump | Allow loading events from dump
| Python | agpl-3.0 | aaronkaplan/intelmq,certtools/intelmq,certtools/intelmq,aaronkaplan/intelmq,certtools/intelmq,aaronkaplan/intelmq | # -*- coding: utf-8 -*-
import json
from intelmq.lib import utils
from intelmq.lib.bot import ParserBot
class CZNICProkiParserBot(ParserBot):
recover_line = ParserBot.recover_line_json
def parse(self, report):
raw_report = utils.base64_decode(report.get("raw"))
report = json.loads(raw_repor... | # -*- coding: utf-8 -*-
import json
from intelmq.lib import utils
from intelmq.lib.bot import ParserBot
class CZNICProkiParserBot(ParserBot):
recover_line = ParserBot.recover_line_json
def parse(self, report):
raw_report = utils.base64_decode(report.get("raw"))
report = json.loads(raw_repor... | <commit_before># -*- coding: utf-8 -*-
import json
from intelmq.lib import utils
from intelmq.lib.bot import ParserBot
class CZNICProkiParserBot(ParserBot):
recover_line = ParserBot.recover_line_json
def parse(self, report):
raw_report = utils.base64_decode(report.get("raw"))
report = json.... | # -*- coding: utf-8 -*-
import json
from intelmq.lib import utils
from intelmq.lib.bot import ParserBot
class CZNICProkiParserBot(ParserBot):
recover_line = ParserBot.recover_line_json
def parse(self, report):
raw_report = utils.base64_decode(report.get("raw"))
report = json.loads(raw_repor... | # -*- coding: utf-8 -*-
import json
from intelmq.lib import utils
from intelmq.lib.bot import ParserBot
class CZNICProkiParserBot(ParserBot):
recover_line = ParserBot.recover_line_json
def parse(self, report):
raw_report = utils.base64_decode(report.get("raw"))
report = json.loads(raw_repor... | <commit_before># -*- coding: utf-8 -*-
import json
from intelmq.lib import utils
from intelmq.lib.bot import ParserBot
class CZNICProkiParserBot(ParserBot):
recover_line = ParserBot.recover_line_json
def parse(self, report):
raw_report = utils.base64_decode(report.get("raw"))
report = json.... |
0d8888ef1bfa056b9fd440b227a3e3d84b10d541 | src/suit_dashboard/layout.py | src/suit_dashboard/layout.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from suit_dashboard.box import Box
class Grid(object):
def __init__(self, *rows, **kwargs):
if not all([isinstance(r, Row) for r in rows]):
raise TypeError('All elements of Grid must be Row instances')
self.type = 'grid'
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from suit_dashboard.box import Box
class Grid(object):
def __init__(self, *rows, **kwargs):
if not all([isinstance(r, Row) for r in rows]):
raise TypeError('All elements of Grid must be Row instances')
self.type = 'grid'
... | Fix type check of column elements | Fix type check of column elements
| Python | isc | Pawamoy/django-suit-dashboard,Pawamoy/django-suit-dashboard,Pawamoy/django-suit-dashboard,Pawamoy/django-suit-dashboard | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from suit_dashboard.box import Box
class Grid(object):
def __init__(self, *rows, **kwargs):
if not all([isinstance(r, Row) for r in rows]):
raise TypeError('All elements of Grid must be Row instances')
self.type = 'grid'
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from suit_dashboard.box import Box
class Grid(object):
def __init__(self, *rows, **kwargs):
if not all([isinstance(r, Row) for r in rows]):
raise TypeError('All elements of Grid must be Row instances')
self.type = 'grid'
... | <commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from suit_dashboard.box import Box
class Grid(object):
def __init__(self, *rows, **kwargs):
if not all([isinstance(r, Row) for r in rows]):
raise TypeError('All elements of Grid must be Row instances')
self... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from suit_dashboard.box import Box
class Grid(object):
def __init__(self, *rows, **kwargs):
if not all([isinstance(r, Row) for r in rows]):
raise TypeError('All elements of Grid must be Row instances')
self.type = 'grid'
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from suit_dashboard.box import Box
class Grid(object):
def __init__(self, *rows, **kwargs):
if not all([isinstance(r, Row) for r in rows]):
raise TypeError('All elements of Grid must be Row instances')
self.type = 'grid'
... | <commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from suit_dashboard.box import Box
class Grid(object):
def __init__(self, *rows, **kwargs):
if not all([isinstance(r, Row) for r in rows]):
raise TypeError('All elements of Grid must be Row instances')
self... |
c6d4a0e34a0e1ef1ea330734477aac434322ff01 | extensions/ExtGameController.py | extensions/ExtGameController.py | from python_cowbull_game.GameController import GameController
from python_cowbull_game.GameMode import GameMode
class ExtGameController(GameController):
additional_modes = [
GameMode(mode="SuperTough", priority=6, digits=10, digit_type=0),
GameMode(mode="hexTough", priority=5, digits=3, guesses_al... | from python_cowbull_game.GameController import GameController
from python_cowbull_game.GameMode import GameMode
class ExtGameController(GameController):
additional_modes = [
GameMode(mode="SuperTough", priority=6, digits=10, digit_type=0),
GameMode(mode="hexTough", priority=5, digits=3, guesses_al... | Update extensions and GameController subclass | Update extensions and GameController subclass
| Python | apache-2.0 | dsandersAzure/python_cowbull_server,dsandersAzure/python_cowbull_server | from python_cowbull_game.GameController import GameController
from python_cowbull_game.GameMode import GameMode
class ExtGameController(GameController):
additional_modes = [
GameMode(mode="SuperTough", priority=6, digits=10, digit_type=0),
GameMode(mode="hexTough", priority=5, digits=3, guesses_al... | from python_cowbull_game.GameController import GameController
from python_cowbull_game.GameMode import GameMode
class ExtGameController(GameController):
additional_modes = [
GameMode(mode="SuperTough", priority=6, digits=10, digit_type=0),
GameMode(mode="hexTough", priority=5, digits=3, guesses_al... | <commit_before>from python_cowbull_game.GameController import GameController
from python_cowbull_game.GameMode import GameMode
class ExtGameController(GameController):
additional_modes = [
GameMode(mode="SuperTough", priority=6, digits=10, digit_type=0),
GameMode(mode="hexTough", priority=5, digit... | from python_cowbull_game.GameController import GameController
from python_cowbull_game.GameMode import GameMode
class ExtGameController(GameController):
additional_modes = [
GameMode(mode="SuperTough", priority=6, digits=10, digit_type=0),
GameMode(mode="hexTough", priority=5, digits=3, guesses_al... | from python_cowbull_game.GameController import GameController
from python_cowbull_game.GameMode import GameMode
class ExtGameController(GameController):
additional_modes = [
GameMode(mode="SuperTough", priority=6, digits=10, digit_type=0),
GameMode(mode="hexTough", priority=5, digits=3, guesses_al... | <commit_before>from python_cowbull_game.GameController import GameController
from python_cowbull_game.GameMode import GameMode
class ExtGameController(GameController):
additional_modes = [
GameMode(mode="SuperTough", priority=6, digits=10, digit_type=0),
GameMode(mode="hexTough", priority=5, digit... |
087fd390c5c19d0187102cc2dbe1ac9ac8c4fb03 | perfrunner/workloads/n1ql.py | perfrunner/workloads/n1ql.py | INDEX_STATEMENTS = {
'basic': (
'CREATE INDEX by_city ON {}(city.f.f)',
'CREATE INDEX by_county ON {}(county.f.f)',
'CREATE INDEX by_realm ON {}(realm.f)',
),
'range': (
'CREATE INDEX by_coins ON {}(coins.f)',
'CREATE INDEX by_achievement ON {}(achievements)',
... | INDEX_STATEMENTS = {
'basic': (
'CREATE INDEX by_city ON `{}` (city.f.f)',
'CREATE INDEX by_county ON `{}` (county.f.f)',
'CREATE INDEX by_realm ON `{}` (`realm.f`)',
),
'range': (
'CREATE INDEX by_coins ON `{}` (coins.f)',
'CREATE INDEX by_achievement ON `{}` (achiev... | Correct syntax while creating indexes | Correct syntax while creating indexes
Change-Id: I90625647d8723531dbc7498d5d25e84ef1a3ed2b
Reviewed-on: http://review.couchbase.org/50007
Tested-by: buildbot <[email protected]>
Reviewed-by: Michael Wiederhold <[email protected]>
| Python | apache-2.0 | dkao-cb/perfrunner,couchbase/perfrunner,EricACooper/perfrunner,pavel-paulau/perfrunner,mikewied/perfrunner,couchbase/perfrunner,pavel-paulau/perfrunner,EricACooper/perfrunner,pavel-paulau/perfrunner,dkao-cb/perfrunner,vmx/perfrunner,thomas-couchbase/perfrunner,hsharsha/perfrunner,vmx/perfrunner,couchbase/perfrunner,tho... | INDEX_STATEMENTS = {
'basic': (
'CREATE INDEX by_city ON {}(city.f.f)',
'CREATE INDEX by_county ON {}(county.f.f)',
'CREATE INDEX by_realm ON {}(realm.f)',
),
'range': (
'CREATE INDEX by_coins ON {}(coins.f)',
'CREATE INDEX by_achievement ON {}(achievements)',
... | INDEX_STATEMENTS = {
'basic': (
'CREATE INDEX by_city ON `{}` (city.f.f)',
'CREATE INDEX by_county ON `{}` (county.f.f)',
'CREATE INDEX by_realm ON `{}` (`realm.f`)',
),
'range': (
'CREATE INDEX by_coins ON `{}` (coins.f)',
'CREATE INDEX by_achievement ON `{}` (achiev... | <commit_before>INDEX_STATEMENTS = {
'basic': (
'CREATE INDEX by_city ON {}(city.f.f)',
'CREATE INDEX by_county ON {}(county.f.f)',
'CREATE INDEX by_realm ON {}(realm.f)',
),
'range': (
'CREATE INDEX by_coins ON {}(coins.f)',
'CREATE INDEX by_achievement ON {}(achievem... | INDEX_STATEMENTS = {
'basic': (
'CREATE INDEX by_city ON `{}` (city.f.f)',
'CREATE INDEX by_county ON `{}` (county.f.f)',
'CREATE INDEX by_realm ON `{}` (`realm.f`)',
),
'range': (
'CREATE INDEX by_coins ON `{}` (coins.f)',
'CREATE INDEX by_achievement ON `{}` (achiev... | INDEX_STATEMENTS = {
'basic': (
'CREATE INDEX by_city ON {}(city.f.f)',
'CREATE INDEX by_county ON {}(county.f.f)',
'CREATE INDEX by_realm ON {}(realm.f)',
),
'range': (
'CREATE INDEX by_coins ON {}(coins.f)',
'CREATE INDEX by_achievement ON {}(achievements)',
... | <commit_before>INDEX_STATEMENTS = {
'basic': (
'CREATE INDEX by_city ON {}(city.f.f)',
'CREATE INDEX by_county ON {}(county.f.f)',
'CREATE INDEX by_realm ON {}(realm.f)',
),
'range': (
'CREATE INDEX by_coins ON {}(coins.f)',
'CREATE INDEX by_achievement ON {}(achievem... |
7d6c9ac443dd34784f00fd4d7bc0cbee904ed98f | src/python/cargo/temporal.py | src/python/cargo/temporal.py | """
@author: Bryan Silverthorn <[email protected]>
"""
from datetime import tzinfo
class UTC(tzinfo):
"""
The one true time zone.
"""
def utcoffset(self, dt):
"""
Return the offset to UTC.
"""
from datetime import timedelta
return timedelta(0)
def tznam... | """
@author: Bryan Silverthorn <[email protected]>
"""
from datetime import tzinfo
class UTC(tzinfo):
"""
The one true time zone.
"""
def utcoffset(self, dt):
"""
Return the offset to UTC.
"""
from datetime import timedelta
return timedelta(0)
def tznam... | Fix comment after dropping the pytz dependency. | Fix comment after dropping the pytz dependency.
| Python | mit | borg-project/cargo,borg-project/cargo | """
@author: Bryan Silverthorn <[email protected]>
"""
from datetime import tzinfo
class UTC(tzinfo):
"""
The one true time zone.
"""
def utcoffset(self, dt):
"""
Return the offset to UTC.
"""
from datetime import timedelta
return timedelta(0)
def tznam... | """
@author: Bryan Silverthorn <[email protected]>
"""
from datetime import tzinfo
class UTC(tzinfo):
"""
The one true time zone.
"""
def utcoffset(self, dt):
"""
Return the offset to UTC.
"""
from datetime import timedelta
return timedelta(0)
def tznam... | <commit_before>"""
@author: Bryan Silverthorn <[email protected]>
"""
from datetime import tzinfo
class UTC(tzinfo):
"""
The one true time zone.
"""
def utcoffset(self, dt):
"""
Return the offset to UTC.
"""
from datetime import timedelta
return timedelta(0)... | """
@author: Bryan Silverthorn <[email protected]>
"""
from datetime import tzinfo
class UTC(tzinfo):
"""
The one true time zone.
"""
def utcoffset(self, dt):
"""
Return the offset to UTC.
"""
from datetime import timedelta
return timedelta(0)
def tznam... | """
@author: Bryan Silverthorn <[email protected]>
"""
from datetime import tzinfo
class UTC(tzinfo):
"""
The one true time zone.
"""
def utcoffset(self, dt):
"""
Return the offset to UTC.
"""
from datetime import timedelta
return timedelta(0)
def tznam... | <commit_before>"""
@author: Bryan Silverthorn <[email protected]>
"""
from datetime import tzinfo
class UTC(tzinfo):
"""
The one true time zone.
"""
def utcoffset(self, dt):
"""
Return the offset to UTC.
"""
from datetime import timedelta
return timedelta(0)... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.