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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f86f684e659ab1e6c1c9d7c7f5f126e7814e7e8a | napper_kittydar.py | napper_kittydar.py | import sys, socket, time, logging
import shlex, subprocess
from hdfs import *
logging.basicConfig()
if len(sys.argv) < 4:
print "usage: napper_kittydar <job name> <worker ID> <executable>"
sys.exit(1)
job_name = sys.argv[1]
worker_id = int(sys.argv[2])
kittydar_path = " ".join(sys.argv[3:])
# fetch inputs from ... | import sys, socket, time, logging
import shlex, subprocess
from hdfs import *
logging.basicConfig()
if len(sys.argv) < 4:
print "usage: napper_kittydar <job name> <worker ID> <executable>"
sys.exit(1)
job_name = sys.argv[1]
worker_id = int(sys.argv[2])
kittydar_path = " ".join(sys.argv[3:])
# fetch inputs from ... | Use smaller data sets for Kittydar. | Use smaller data sets for Kittydar.
| Python | mit | ms705/napper | import sys, socket, time, logging
import shlex, subprocess
from hdfs import *
logging.basicConfig()
if len(sys.argv) < 4:
print "usage: napper_kittydar <job name> <worker ID> <executable>"
sys.exit(1)
job_name = sys.argv[1]
worker_id = int(sys.argv[2])
kittydar_path = " ".join(sys.argv[3:])
# fetch inputs from ... | import sys, socket, time, logging
import shlex, subprocess
from hdfs import *
logging.basicConfig()
if len(sys.argv) < 4:
print "usage: napper_kittydar <job name> <worker ID> <executable>"
sys.exit(1)
job_name = sys.argv[1]
worker_id = int(sys.argv[2])
kittydar_path = " ".join(sys.argv[3:])
# fetch inputs from ... | <commit_before>import sys, socket, time, logging
import shlex, subprocess
from hdfs import *
logging.basicConfig()
if len(sys.argv) < 4:
print "usage: napper_kittydar <job name> <worker ID> <executable>"
sys.exit(1)
job_name = sys.argv[1]
worker_id = int(sys.argv[2])
kittydar_path = " ".join(sys.argv[3:])
# fet... | import sys, socket, time, logging
import shlex, subprocess
from hdfs import *
logging.basicConfig()
if len(sys.argv) < 4:
print "usage: napper_kittydar <job name> <worker ID> <executable>"
sys.exit(1)
job_name = sys.argv[1]
worker_id = int(sys.argv[2])
kittydar_path = " ".join(sys.argv[3:])
# fetch inputs from ... | import sys, socket, time, logging
import shlex, subprocess
from hdfs import *
logging.basicConfig()
if len(sys.argv) < 4:
print "usage: napper_kittydar <job name> <worker ID> <executable>"
sys.exit(1)
job_name = sys.argv[1]
worker_id = int(sys.argv[2])
kittydar_path = " ".join(sys.argv[3:])
# fetch inputs from ... | <commit_before>import sys, socket, time, logging
import shlex, subprocess
from hdfs import *
logging.basicConfig()
if len(sys.argv) < 4:
print "usage: napper_kittydar <job name> <worker ID> <executable>"
sys.exit(1)
job_name = sys.argv[1]
worker_id = int(sys.argv[2])
kittydar_path = " ".join(sys.argv[3:])
# fet... |
6061932ef2634098f604f3a118b8ead971bd4295 | main.py | main.py | import os
import logging
import gevent
from flask import Flask, render_template, url_for, redirect
from flask_sockets import Sockets
import io
import string
import random
app = Flask(__name__)
path = os.getcwd()
app.config['DEBUG'] = True
sockets = Sockets(app)
def rand_id(size=8):
return ''.join(random.SystemRan... | import os
import logging
import gevent
from flask import Flask, render_template, url_for, redirect
from flask_sockets import Sockets
import io
import string
import random
app = Flask(__name__)
path = os.getcwd()
app.config['DEBUG'] = True
sockets = Sockets(app)
def rand_id(size=8):
return ''.join(random.SystemRan... | Delete wav files after processions | Delete wav files after processions
| Python | mit | j-salazar/mchacks15,j-salazar/mchacks15,j-salazar/mchacks15 | import os
import logging
import gevent
from flask import Flask, render_template, url_for, redirect
from flask_sockets import Sockets
import io
import string
import random
app = Flask(__name__)
path = os.getcwd()
app.config['DEBUG'] = True
sockets = Sockets(app)
def rand_id(size=8):
return ''.join(random.SystemRan... | import os
import logging
import gevent
from flask import Flask, render_template, url_for, redirect
from flask_sockets import Sockets
import io
import string
import random
app = Flask(__name__)
path = os.getcwd()
app.config['DEBUG'] = True
sockets = Sockets(app)
def rand_id(size=8):
return ''.join(random.SystemRan... | <commit_before>import os
import logging
import gevent
from flask import Flask, render_template, url_for, redirect
from flask_sockets import Sockets
import io
import string
import random
app = Flask(__name__)
path = os.getcwd()
app.config['DEBUG'] = True
sockets = Sockets(app)
def rand_id(size=8):
return ''.join(r... | import os
import logging
import gevent
from flask import Flask, render_template, url_for, redirect
from flask_sockets import Sockets
import io
import string
import random
app = Flask(__name__)
path = os.getcwd()
app.config['DEBUG'] = True
sockets = Sockets(app)
def rand_id(size=8):
return ''.join(random.SystemRan... | import os
import logging
import gevent
from flask import Flask, render_template, url_for, redirect
from flask_sockets import Sockets
import io
import string
import random
app = Flask(__name__)
path = os.getcwd()
app.config['DEBUG'] = True
sockets = Sockets(app)
def rand_id(size=8):
return ''.join(random.SystemRan... | <commit_before>import os
import logging
import gevent
from flask import Flask, render_template, url_for, redirect
from flask_sockets import Sockets
import io
import string
import random
app = Flask(__name__)
path = os.getcwd()
app.config['DEBUG'] = True
sockets = Sockets(app)
def rand_id(size=8):
return ''.join(r... |
4210d2ecb1b74c2a94c704c20eec9faaf75c5a9a | main.py | main.py | import sys,requests,configparser
github_username = ''
github_token = ''
free_user = ''
free_pass = ''
def loadConfig():
config = configparser.ConfigParser()
config.read('config.cfg')
global github_username,github_token,free_user,free_pass
try:
github_username = config['Github']['username']... | import sys,requests,configparser
github_username = ''
github_token = ''
free_user = ''
free_pass = ''
def loadConfig():
config = configparser.ConfigParser()
config.read('config.cfg')
global github_username,github_token,free_user,free_pass
try:
github_username = config['Github']['username']
... | Send SMS, only if there are notifications | Send SMS, only if there are notifications
| Python | mit | Walz/github-sms-notifications | import sys,requests,configparser
github_username = ''
github_token = ''
free_user = ''
free_pass = ''
def loadConfig():
config = configparser.ConfigParser()
config.read('config.cfg')
global github_username,github_token,free_user,free_pass
try:
github_username = config['Github']['username']... | import sys,requests,configparser
github_username = ''
github_token = ''
free_user = ''
free_pass = ''
def loadConfig():
config = configparser.ConfigParser()
config.read('config.cfg')
global github_username,github_token,free_user,free_pass
try:
github_username = config['Github']['username']
... | <commit_before>import sys,requests,configparser
github_username = ''
github_token = ''
free_user = ''
free_pass = ''
def loadConfig():
config = configparser.ConfigParser()
config.read('config.cfg')
global github_username,github_token,free_user,free_pass
try:
github_username = config['Githu... | import sys,requests,configparser
github_username = ''
github_token = ''
free_user = ''
free_pass = ''
def loadConfig():
config = configparser.ConfigParser()
config.read('config.cfg')
global github_username,github_token,free_user,free_pass
try:
github_username = config['Github']['username']
... | import sys,requests,configparser
github_username = ''
github_token = ''
free_user = ''
free_pass = ''
def loadConfig():
config = configparser.ConfigParser()
config.read('config.cfg')
global github_username,github_token,free_user,free_pass
try:
github_username = config['Github']['username']... | <commit_before>import sys,requests,configparser
github_username = ''
github_token = ''
free_user = ''
free_pass = ''
def loadConfig():
config = configparser.ConfigParser()
config.read('config.cfg')
global github_username,github_token,free_user,free_pass
try:
github_username = config['Githu... |
8423013f2864863671c8d39a5a09131e68de0002 | valohai_cli/cli.py | valohai_cli/cli.py | import logging
import click
from valohai_cli.plugin_cli import RecursiveHelpPluginCLI
from valohai_cli.table import TABLE_FORMATS, TABLE_FORMAT_META_KEY
@click.command(cls=RecursiveHelpPluginCLI, commands_module='valohai_cli.commands')
@click.option('--debug/--no-debug', default=False, envvar='VALOHAI_DEBUG')
@clic... | import logging
import platform
import sys
import click
from valohai_cli.messages import warn
from valohai_cli.plugin_cli import RecursiveHelpPluginCLI
from valohai_cli.table import TABLE_FORMATS, TABLE_FORMAT_META_KEY
@click.command(cls=RecursiveHelpPluginCLI, commands_module='valohai_cli.commands')
@click.option('... | Add a warning about future versions dropping Py2 support | Add a warning about future versions dropping Py2 support
Refs #64
| Python | mit | valohai/valohai-cli | import logging
import click
from valohai_cli.plugin_cli import RecursiveHelpPluginCLI
from valohai_cli.table import TABLE_FORMATS, TABLE_FORMAT_META_KEY
@click.command(cls=RecursiveHelpPluginCLI, commands_module='valohai_cli.commands')
@click.option('--debug/--no-debug', default=False, envvar='VALOHAI_DEBUG')
@clic... | import logging
import platform
import sys
import click
from valohai_cli.messages import warn
from valohai_cli.plugin_cli import RecursiveHelpPluginCLI
from valohai_cli.table import TABLE_FORMATS, TABLE_FORMAT_META_KEY
@click.command(cls=RecursiveHelpPluginCLI, commands_module='valohai_cli.commands')
@click.option('... | <commit_before>import logging
import click
from valohai_cli.plugin_cli import RecursiveHelpPluginCLI
from valohai_cli.table import TABLE_FORMATS, TABLE_FORMAT_META_KEY
@click.command(cls=RecursiveHelpPluginCLI, commands_module='valohai_cli.commands')
@click.option('--debug/--no-debug', default=False, envvar='VALOHA... | import logging
import platform
import sys
import click
from valohai_cli.messages import warn
from valohai_cli.plugin_cli import RecursiveHelpPluginCLI
from valohai_cli.table import TABLE_FORMATS, TABLE_FORMAT_META_KEY
@click.command(cls=RecursiveHelpPluginCLI, commands_module='valohai_cli.commands')
@click.option('... | import logging
import click
from valohai_cli.plugin_cli import RecursiveHelpPluginCLI
from valohai_cli.table import TABLE_FORMATS, TABLE_FORMAT_META_KEY
@click.command(cls=RecursiveHelpPluginCLI, commands_module='valohai_cli.commands')
@click.option('--debug/--no-debug', default=False, envvar='VALOHAI_DEBUG')
@clic... | <commit_before>import logging
import click
from valohai_cli.plugin_cli import RecursiveHelpPluginCLI
from valohai_cli.table import TABLE_FORMATS, TABLE_FORMAT_META_KEY
@click.command(cls=RecursiveHelpPluginCLI, commands_module='valohai_cli.commands')
@click.option('--debug/--no-debug', default=False, envvar='VALOHA... |
4c70c4b9558a5f18d7aa32f153db4de773d66ef2 | opps/images/tests/generate.py | opps/images/tests/generate.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from mock import patch
from unittest import TestCase
from django.template import Template, Context
class TestThumborURLTTagMock(TestCase):
url = 'oppsproject.org/path/image.jpg'
generate_url_path = 'opps.images.templatetags.images_tags.image_url'
def render(s... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from unittest import TestCase
from django.template import Template, Context
class TestImagesTags(TestCase):
url = 'oppsproject.org/path/image.jpg'
generate_url_path = 'opps.images.templatetags.images_tags.image_url'
def render(self, arguments):
source... | Add test templatetag image_url return | Add test templatetag image_url return
| Python | mit | opps/opps,opps/opps,YACOWS/opps,YACOWS/opps,opps/opps,YACOWS/opps,williamroot/opps,williamroot/opps,jeanmask/opps,williamroot/opps,opps/opps,YACOWS/opps,jeanmask/opps,williamroot/opps,jeanmask/opps,jeanmask/opps | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from mock import patch
from unittest import TestCase
from django.template import Template, Context
class TestThumborURLTTagMock(TestCase):
url = 'oppsproject.org/path/image.jpg'
generate_url_path = 'opps.images.templatetags.images_tags.image_url'
def render(s... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from unittest import TestCase
from django.template import Template, Context
class TestImagesTags(TestCase):
url = 'oppsproject.org/path/image.jpg'
generate_url_path = 'opps.images.templatetags.images_tags.image_url'
def render(self, arguments):
source... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from mock import patch
from unittest import TestCase
from django.template import Template, Context
class TestThumborURLTTagMock(TestCase):
url = 'oppsproject.org/path/image.jpg'
generate_url_path = 'opps.images.templatetags.images_tags.image_url'
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from unittest import TestCase
from django.template import Template, Context
class TestImagesTags(TestCase):
url = 'oppsproject.org/path/image.jpg'
generate_url_path = 'opps.images.templatetags.images_tags.image_url'
def render(self, arguments):
source... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from mock import patch
from unittest import TestCase
from django.template import Template, Context
class TestThumborURLTTagMock(TestCase):
url = 'oppsproject.org/path/image.jpg'
generate_url_path = 'opps.images.templatetags.images_tags.image_url'
def render(s... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from mock import patch
from unittest import TestCase
from django.template import Template, Context
class TestThumborURLTTagMock(TestCase):
url = 'oppsproject.org/path/image.jpg'
generate_url_path = 'opps.images.templatetags.images_tags.image_url'
... |
5f90db398bd67aec857900f5838fb6af8f3b8c23 | test/test_process.py | test/test_process.py | import piquant.process as ps
import os.path
import time
import utils
SCRIPT_NAME = "./script.sh"
def _write_and_run_script(dirname, command):
utils.write_executable_script(dirname, SCRIPT_NAME, command)
ps.run_in_directory(dirname, SCRIPT_NAME)
time.sleep(0.1)
def test_run_in_directory_executes_command... | import piquant.process as ps
import os.path
import time
import utils
SCRIPT_NAME = "./script.sh"
def _write_and_run_script(dirname, command):
utils.write_executable_script(dirname, SCRIPT_NAME, command)
ps.run_in_directory(dirname, SCRIPT_NAME)
time.sleep(0.1)
def test_run_in_directory_executes_command... | Fix test not working on OS X. | Fix test not working on OS X.
test_run_in_directory_executes_command_in_directory() didn't take into account
that the directory returned by tempfile.mkdtemp() might be a symlink.
| Python | mit | lweasel/piquant,lweasel/piquant | import piquant.process as ps
import os.path
import time
import utils
SCRIPT_NAME = "./script.sh"
def _write_and_run_script(dirname, command):
utils.write_executable_script(dirname, SCRIPT_NAME, command)
ps.run_in_directory(dirname, SCRIPT_NAME)
time.sleep(0.1)
def test_run_in_directory_executes_command... | import piquant.process as ps
import os.path
import time
import utils
SCRIPT_NAME = "./script.sh"
def _write_and_run_script(dirname, command):
utils.write_executable_script(dirname, SCRIPT_NAME, command)
ps.run_in_directory(dirname, SCRIPT_NAME)
time.sleep(0.1)
def test_run_in_directory_executes_command... | <commit_before>import piquant.process as ps
import os.path
import time
import utils
SCRIPT_NAME = "./script.sh"
def _write_and_run_script(dirname, command):
utils.write_executable_script(dirname, SCRIPT_NAME, command)
ps.run_in_directory(dirname, SCRIPT_NAME)
time.sleep(0.1)
def test_run_in_directory_e... | import piquant.process as ps
import os.path
import time
import utils
SCRIPT_NAME = "./script.sh"
def _write_and_run_script(dirname, command):
utils.write_executable_script(dirname, SCRIPT_NAME, command)
ps.run_in_directory(dirname, SCRIPT_NAME)
time.sleep(0.1)
def test_run_in_directory_executes_command... | import piquant.process as ps
import os.path
import time
import utils
SCRIPT_NAME = "./script.sh"
def _write_and_run_script(dirname, command):
utils.write_executable_script(dirname, SCRIPT_NAME, command)
ps.run_in_directory(dirname, SCRIPT_NAME)
time.sleep(0.1)
def test_run_in_directory_executes_command... | <commit_before>import piquant.process as ps
import os.path
import time
import utils
SCRIPT_NAME = "./script.sh"
def _write_and_run_script(dirname, command):
utils.write_executable_script(dirname, SCRIPT_NAME, command)
ps.run_in_directory(dirname, SCRIPT_NAME)
time.sleep(0.1)
def test_run_in_directory_e... |
791e254c6f1efed88bdc0714ee9bb264634e74a8 | transunit.py | transunit.py | #from lxml import etree as ET
class TransUnit(object):
"Container for XLIFF trans-unit element"
def __init__(self, argument):
self.origin_unit = argument
self.attributes = argument.attrib
self.id = ''
self.ns = ''
self.state = ''
@staticmethod
def create(xml_... | class TransUnit(object):
"Container for XLIFF trans-unit element"
def __init__(self, argument):
self.origin_unit = argument
self.attributes = argument.attrib
self.id = ''
self.ns = ''
self.state = ''
@staticmethod
def create(xml_tu):
tunit = TransUnit(... | Restructure transUnit class for better readibility | Restructure transUnit class for better readibility
| Python | mit | jakub-szczepaniak/xliff | #from lxml import etree as ET
class TransUnit(object):
"Container for XLIFF trans-unit element"
def __init__(self, argument):
self.origin_unit = argument
self.attributes = argument.attrib
self.id = ''
self.ns = ''
self.state = ''
@staticmethod
def create(xml_... | class TransUnit(object):
"Container for XLIFF trans-unit element"
def __init__(self, argument):
self.origin_unit = argument
self.attributes = argument.attrib
self.id = ''
self.ns = ''
self.state = ''
@staticmethod
def create(xml_tu):
tunit = TransUnit(... | <commit_before>#from lxml import etree as ET
class TransUnit(object):
"Container for XLIFF trans-unit element"
def __init__(self, argument):
self.origin_unit = argument
self.attributes = argument.attrib
self.id = ''
self.ns = ''
self.state = ''
@staticmethod
... | class TransUnit(object):
"Container for XLIFF trans-unit element"
def __init__(self, argument):
self.origin_unit = argument
self.attributes = argument.attrib
self.id = ''
self.ns = ''
self.state = ''
@staticmethod
def create(xml_tu):
tunit = TransUnit(... | #from lxml import etree as ET
class TransUnit(object):
"Container for XLIFF trans-unit element"
def __init__(self, argument):
self.origin_unit = argument
self.attributes = argument.attrib
self.id = ''
self.ns = ''
self.state = ''
@staticmethod
def create(xml_... | <commit_before>#from lxml import etree as ET
class TransUnit(object):
"Container for XLIFF trans-unit element"
def __init__(self, argument):
self.origin_unit = argument
self.attributes = argument.attrib
self.id = ''
self.ns = ''
self.state = ''
@staticmethod
... |
184c94252a909528fee2bc29c421c814bf7c49ee | django_fake_database_backends/backends/mysql/schema.py | django_fake_database_backends/backends/mysql/schema.py | from django.db.backends.mysql.schema import DatabaseSchemaEditor \
as BaseDatabaseSchemaEditor
import sys
class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
def execute(self, sql, params=()):
sql = str(sql)
if self.collect_sql:
ending = "" if sql.endswith(";") else ";"
... | from django.db.backends.mysql.schema import DatabaseSchemaEditor \
as BaseDatabaseSchemaEditor
import datetime
import sys
class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
def execute(self, sql, params=()):
sql = str(sql)
if self.collect_sql:
ending = "" if sql.endswith(";") el... | Add quotes around date and time for python 2 | Add quotes around date and time for python 2
| Python | mit | David-Wobrock/django-fake-database-backends | from django.db.backends.mysql.schema import DatabaseSchemaEditor \
as BaseDatabaseSchemaEditor
import sys
class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
def execute(self, sql, params=()):
sql = str(sql)
if self.collect_sql:
ending = "" if sql.endswith(";") else ";"
... | from django.db.backends.mysql.schema import DatabaseSchemaEditor \
as BaseDatabaseSchemaEditor
import datetime
import sys
class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
def execute(self, sql, params=()):
sql = str(sql)
if self.collect_sql:
ending = "" if sql.endswith(";") el... | <commit_before>from django.db.backends.mysql.schema import DatabaseSchemaEditor \
as BaseDatabaseSchemaEditor
import sys
class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
def execute(self, sql, params=()):
sql = str(sql)
if self.collect_sql:
ending = "" if sql.endswith(";") els... | from django.db.backends.mysql.schema import DatabaseSchemaEditor \
as BaseDatabaseSchemaEditor
import datetime
import sys
class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
def execute(self, sql, params=()):
sql = str(sql)
if self.collect_sql:
ending = "" if sql.endswith(";") el... | from django.db.backends.mysql.schema import DatabaseSchemaEditor \
as BaseDatabaseSchemaEditor
import sys
class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
def execute(self, sql, params=()):
sql = str(sql)
if self.collect_sql:
ending = "" if sql.endswith(";") else ";"
... | <commit_before>from django.db.backends.mysql.schema import DatabaseSchemaEditor \
as BaseDatabaseSchemaEditor
import sys
class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
def execute(self, sql, params=()):
sql = str(sql)
if self.collect_sql:
ending = "" if sql.endswith(";") els... |
23cd1ea939df8d78952f9b096207de0a3453529f | tests/test_create.py | tests/test_create.py | from matador.commands import CreateTicket, CreatePackage
from dulwich.repo import Repo
from pathlib import Path
def test_add_to_git(project_repo):
pass
def test_create_ticket(session, project_repo):
test_ticket = 'test-ticket'
CreateTicket(ticket=test_ticket)
ticket_folder = Path(project_repo, 'depl... | from matador.commands import CreateTicket, CreatePackage
from dulwich.repo import Repo
from pathlib import Path
def test_add_to_git(project_repo):
pass
def test_create_ticket(session, project_repo):
test_ticket = 'test-ticket'
CreateTicket(ticket=test_ticket)
ticket_folder = Path(project_repo, 'dep... | Add test for package commit | Add test for package commit
| Python | mit | Empiria/matador | from matador.commands import CreateTicket, CreatePackage
from dulwich.repo import Repo
from pathlib import Path
def test_add_to_git(project_repo):
pass
def test_create_ticket(session, project_repo):
test_ticket = 'test-ticket'
CreateTicket(ticket=test_ticket)
ticket_folder = Path(project_repo, 'depl... | from matador.commands import CreateTicket, CreatePackage
from dulwich.repo import Repo
from pathlib import Path
def test_add_to_git(project_repo):
pass
def test_create_ticket(session, project_repo):
test_ticket = 'test-ticket'
CreateTicket(ticket=test_ticket)
ticket_folder = Path(project_repo, 'dep... | <commit_before>from matador.commands import CreateTicket, CreatePackage
from dulwich.repo import Repo
from pathlib import Path
def test_add_to_git(project_repo):
pass
def test_create_ticket(session, project_repo):
test_ticket = 'test-ticket'
CreateTicket(ticket=test_ticket)
ticket_folder = Path(proj... | from matador.commands import CreateTicket, CreatePackage
from dulwich.repo import Repo
from pathlib import Path
def test_add_to_git(project_repo):
pass
def test_create_ticket(session, project_repo):
test_ticket = 'test-ticket'
CreateTicket(ticket=test_ticket)
ticket_folder = Path(project_repo, 'dep... | from matador.commands import CreateTicket, CreatePackage
from dulwich.repo import Repo
from pathlib import Path
def test_add_to_git(project_repo):
pass
def test_create_ticket(session, project_repo):
test_ticket = 'test-ticket'
CreateTicket(ticket=test_ticket)
ticket_folder = Path(project_repo, 'depl... | <commit_before>from matador.commands import CreateTicket, CreatePackage
from dulwich.repo import Repo
from pathlib import Path
def test_add_to_git(project_repo):
pass
def test_create_ticket(session, project_repo):
test_ticket = 'test-ticket'
CreateTicket(ticket=test_ticket)
ticket_folder = Path(proj... |
cd4fe7636d6d5254189de870f262cfa9c3c0461a | sirius/__init__.py | sirius/__init__.py | import os as _os
from . import LI_V00
from . import TB_V01
from . import BO_V901
from . import BO_V02
from . import TS_V01
from . import SI_V12
from . import coordinate_system
with open(_os.path.join(__path__[0], 'VERSION'), 'r') as _f:
__version__ = _f.read().strip()
__all__ = ['LI_V00', 'TB_V01', 'BO_V901', 'T... | import os as _os
from . import LI_V00
from . import TB_V01
from . import BO_V02
from . import TS_V01
from . import SI_V12
from . import coordinate_system
with open(_os.path.join(__path__[0], 'VERSION'), 'r') as _f:
__version__ = _f.read().strip()
__all__ = ['LI_V00', 'TB_V01', 'BO_V02', 'TS_V01', 'SI_V12']
li =... | Change booster default version (BO.V02) | Change booster default version (BO.V02)
| Python | mit | lnls-fac/sirius | import os as _os
from . import LI_V00
from . import TB_V01
from . import BO_V901
from . import BO_V02
from . import TS_V01
from . import SI_V12
from . import coordinate_system
with open(_os.path.join(__path__[0], 'VERSION'), 'r') as _f:
__version__ = _f.read().strip()
__all__ = ['LI_V00', 'TB_V01', 'BO_V901', 'T... | import os as _os
from . import LI_V00
from . import TB_V01
from . import BO_V02
from . import TS_V01
from . import SI_V12
from . import coordinate_system
with open(_os.path.join(__path__[0], 'VERSION'), 'r') as _f:
__version__ = _f.read().strip()
__all__ = ['LI_V00', 'TB_V01', 'BO_V02', 'TS_V01', 'SI_V12']
li =... | <commit_before>import os as _os
from . import LI_V00
from . import TB_V01
from . import BO_V901
from . import BO_V02
from . import TS_V01
from . import SI_V12
from . import coordinate_system
with open(_os.path.join(__path__[0], 'VERSION'), 'r') as _f:
__version__ = _f.read().strip()
__all__ = ['LI_V00', 'TB_V01'... | import os as _os
from . import LI_V00
from . import TB_V01
from . import BO_V02
from . import TS_V01
from . import SI_V12
from . import coordinate_system
with open(_os.path.join(__path__[0], 'VERSION'), 'r') as _f:
__version__ = _f.read().strip()
__all__ = ['LI_V00', 'TB_V01', 'BO_V02', 'TS_V01', 'SI_V12']
li =... | import os as _os
from . import LI_V00
from . import TB_V01
from . import BO_V901
from . import BO_V02
from . import TS_V01
from . import SI_V12
from . import coordinate_system
with open(_os.path.join(__path__[0], 'VERSION'), 'r') as _f:
__version__ = _f.read().strip()
__all__ = ['LI_V00', 'TB_V01', 'BO_V901', 'T... | <commit_before>import os as _os
from . import LI_V00
from . import TB_V01
from . import BO_V901
from . import BO_V02
from . import TS_V01
from . import SI_V12
from . import coordinate_system
with open(_os.path.join(__path__[0], 'VERSION'), 'r') as _f:
__version__ = _f.read().strip()
__all__ = ['LI_V00', 'TB_V01'... |
ea7177614dc2094e95aeea33f6249f14c792fee8 | Discord/modules/ciphers.py | Discord/modules/ciphers.py |
def encode_caesar(message, key):
encoded_message = ""
for character in message:
if not ('a' <= character <= 'z' or 'A' <= character <= 'Z'): # .isalpha() ?
encoded_message += character
continue
shifted = ord(character) + int(key)
if character.islower() and shifted > ord('z') or character.isupper() and sh... |
def encode_caesar(message, key):
encoded_message = ""
for character in message:
if not character.isalpha() or not character.isascii():
encoded_message += character
continue
shifted = ord(character) + int(key)
if character.islower() and shifted > ord('z') or character.isupper() and shifted > ord('Z'):
... | Use string methods for encode and decode caesar functions | [Discord] Use string methods for encode and decode caesar functions
To determine (in)valid characters to encode and decode
| Python | mit | Harmon758/Harmonbot,Harmon758/Harmonbot |
def encode_caesar(message, key):
encoded_message = ""
for character in message:
if not ('a' <= character <= 'z' or 'A' <= character <= 'Z'): # .isalpha() ?
encoded_message += character
continue
shifted = ord(character) + int(key)
if character.islower() and shifted > ord('z') or character.isupper() and sh... |
def encode_caesar(message, key):
encoded_message = ""
for character in message:
if not character.isalpha() or not character.isascii():
encoded_message += character
continue
shifted = ord(character) + int(key)
if character.islower() and shifted > ord('z') or character.isupper() and shifted > ord('Z'):
... | <commit_before>
def encode_caesar(message, key):
encoded_message = ""
for character in message:
if not ('a' <= character <= 'z' or 'A' <= character <= 'Z'): # .isalpha() ?
encoded_message += character
continue
shifted = ord(character) + int(key)
if character.islower() and shifted > ord('z') or character.i... |
def encode_caesar(message, key):
encoded_message = ""
for character in message:
if not character.isalpha() or not character.isascii():
encoded_message += character
continue
shifted = ord(character) + int(key)
if character.islower() and shifted > ord('z') or character.isupper() and shifted > ord('Z'):
... |
def encode_caesar(message, key):
encoded_message = ""
for character in message:
if not ('a' <= character <= 'z' or 'A' <= character <= 'Z'): # .isalpha() ?
encoded_message += character
continue
shifted = ord(character) + int(key)
if character.islower() and shifted > ord('z') or character.isupper() and sh... | <commit_before>
def encode_caesar(message, key):
encoded_message = ""
for character in message:
if not ('a' <= character <= 'z' or 'A' <= character <= 'Z'): # .isalpha() ?
encoded_message += character
continue
shifted = ord(character) + int(key)
if character.islower() and shifted > ord('z') or character.i... |
61b4aa0d99cddf88219157eb9120032c8aaf8998 | nbcollate/cli.py | nbcollate/cli.py | #!/usr/bin/env python
"""nbcollate combines a set of Jupyter notebooks into a single notebook.
Command-line interface for nbcollate.
"""
import argparse
import logging
import os
import sys
import nbformat
from . import nbcollate, nb_add_metadata
Parser = argparse.ArgumentParser(description="Create a combined notebo... | #!/usr/bin/env python
"""nbcollate combines a set of Jupyter notebooks into a single notebook.
Command-line interface for nbcollate.
"""
import argparse
import logging
import os
import sys
import nbformat
from . import nbcollate, nb_add_metadata
Parser = argparse.ArgumentParser(description="Create a combined notebo... | Add metadata to assignment notebook | Add metadata to assignment notebook
| Python | mit | olin-computing/nbcollate | #!/usr/bin/env python
"""nbcollate combines a set of Jupyter notebooks into a single notebook.
Command-line interface for nbcollate.
"""
import argparse
import logging
import os
import sys
import nbformat
from . import nbcollate, nb_add_metadata
Parser = argparse.ArgumentParser(description="Create a combined notebo... | #!/usr/bin/env python
"""nbcollate combines a set of Jupyter notebooks into a single notebook.
Command-line interface for nbcollate.
"""
import argparse
import logging
import os
import sys
import nbformat
from . import nbcollate, nb_add_metadata
Parser = argparse.ArgumentParser(description="Create a combined notebo... | <commit_before>#!/usr/bin/env python
"""nbcollate combines a set of Jupyter notebooks into a single notebook.
Command-line interface for nbcollate.
"""
import argparse
import logging
import os
import sys
import nbformat
from . import nbcollate, nb_add_metadata
Parser = argparse.ArgumentParser(description="Create a ... | #!/usr/bin/env python
"""nbcollate combines a set of Jupyter notebooks into a single notebook.
Command-line interface for nbcollate.
"""
import argparse
import logging
import os
import sys
import nbformat
from . import nbcollate, nb_add_metadata
Parser = argparse.ArgumentParser(description="Create a combined notebo... | #!/usr/bin/env python
"""nbcollate combines a set of Jupyter notebooks into a single notebook.
Command-line interface for nbcollate.
"""
import argparse
import logging
import os
import sys
import nbformat
from . import nbcollate, nb_add_metadata
Parser = argparse.ArgumentParser(description="Create a combined notebo... | <commit_before>#!/usr/bin/env python
"""nbcollate combines a set of Jupyter notebooks into a single notebook.
Command-line interface for nbcollate.
"""
import argparse
import logging
import os
import sys
import nbformat
from . import nbcollate, nb_add_metadata
Parser = argparse.ArgumentParser(description="Create a ... |
9f9d36025db87b7326b235131063ef852f43cef8 | euxfel_h5tools/h5index.py | euxfel_h5tools/h5index.py | import csv
import h5py
import sys
def hdf5_datasets(grp):
"""Print CSV data of all datasets in an HDF5 file.
path, shape, dtype
"""
writer = csv.writer(sys.stdout)
writer.writerow(['path', 'shape', 'dtype'])
def visitor(path, item):
if isinstance(item, h5py.Dataset):
write... | import csv
import h5py
import sys
def hdf5_datasets(grp):
"""Print CSV data of all datasets in an HDF5 file.
path, shape, dtype
"""
all_datasets = []
def visitor(path, item):
if isinstance(item, h5py.Dataset):
all_datasets.append([path, item.shape, item.dtype.str])
grp.vis... | Sort datasets for index of HDF5 files | Sort datasets for index of HDF5 files
| Python | bsd-3-clause | European-XFEL/h5tools-py | import csv
import h5py
import sys
def hdf5_datasets(grp):
"""Print CSV data of all datasets in an HDF5 file.
path, shape, dtype
"""
writer = csv.writer(sys.stdout)
writer.writerow(['path', 'shape', 'dtype'])
def visitor(path, item):
if isinstance(item, h5py.Dataset):
write... | import csv
import h5py
import sys
def hdf5_datasets(grp):
"""Print CSV data of all datasets in an HDF5 file.
path, shape, dtype
"""
all_datasets = []
def visitor(path, item):
if isinstance(item, h5py.Dataset):
all_datasets.append([path, item.shape, item.dtype.str])
grp.vis... | <commit_before>import csv
import h5py
import sys
def hdf5_datasets(grp):
"""Print CSV data of all datasets in an HDF5 file.
path, shape, dtype
"""
writer = csv.writer(sys.stdout)
writer.writerow(['path', 'shape', 'dtype'])
def visitor(path, item):
if isinstance(item, h5py.Dataset):
... | import csv
import h5py
import sys
def hdf5_datasets(grp):
"""Print CSV data of all datasets in an HDF5 file.
path, shape, dtype
"""
all_datasets = []
def visitor(path, item):
if isinstance(item, h5py.Dataset):
all_datasets.append([path, item.shape, item.dtype.str])
grp.vis... | import csv
import h5py
import sys
def hdf5_datasets(grp):
"""Print CSV data of all datasets in an HDF5 file.
path, shape, dtype
"""
writer = csv.writer(sys.stdout)
writer.writerow(['path', 'shape', 'dtype'])
def visitor(path, item):
if isinstance(item, h5py.Dataset):
write... | <commit_before>import csv
import h5py
import sys
def hdf5_datasets(grp):
"""Print CSV data of all datasets in an HDF5 file.
path, shape, dtype
"""
writer = csv.writer(sys.stdout)
writer.writerow(['path', 'shape', 'dtype'])
def visitor(path, item):
if isinstance(item, h5py.Dataset):
... |
24a0fcbaea3bca88278f294f41e4b6abd1e82cf3 | src/rocommand/__init__.py | src/rocommand/__init__.py | # __init__.py
#__version__ = "0.2.1" # Initial version with installation package
#__version__ = "0.2.2" # Updated README documentation for PyPI page
#__version__ = "0.2.3" # Experimenting with distribution options
#__version__ = "0.2.4" # Added MANIFEST.in so that data files are part of sdist
#_... | # __init__.py
#__version__ = "0.2.1" # Initial version with installation package
#__version__ = "0.2.2" # Updated README documentation for PyPI page
#__version__ = "0.2.3" # Experimenting with distribution options
#__version__ = "0.2.4" # Added MANIFEST.in so that data files are part of sdist
#_... | Add comments summarizing changes in this version | Add comments summarizing changes in this version
| Python | mit | wf4ever/ro-manager,wf4ever/ro-manager,wf4ever/ro-manager,wf4ever/ro-manager | # __init__.py
#__version__ = "0.2.1" # Initial version with installation package
#__version__ = "0.2.2" # Updated README documentation for PyPI page
#__version__ = "0.2.3" # Experimenting with distribution options
#__version__ = "0.2.4" # Added MANIFEST.in so that data files are part of sdist
#_... | # __init__.py
#__version__ = "0.2.1" # Initial version with installation package
#__version__ = "0.2.2" # Updated README documentation for PyPI page
#__version__ = "0.2.3" # Experimenting with distribution options
#__version__ = "0.2.4" # Added MANIFEST.in so that data files are part of sdist
#_... | <commit_before># __init__.py
#__version__ = "0.2.1" # Initial version with installation package
#__version__ = "0.2.2" # Updated README documentation for PyPI page
#__version__ = "0.2.3" # Experimenting with distribution options
#__version__ = "0.2.4" # Added MANIFEST.in so that data files are p... | # __init__.py
#__version__ = "0.2.1" # Initial version with installation package
#__version__ = "0.2.2" # Updated README documentation for PyPI page
#__version__ = "0.2.3" # Experimenting with distribution options
#__version__ = "0.2.4" # Added MANIFEST.in so that data files are part of sdist
#_... | # __init__.py
#__version__ = "0.2.1" # Initial version with installation package
#__version__ = "0.2.2" # Updated README documentation for PyPI page
#__version__ = "0.2.3" # Experimenting with distribution options
#__version__ = "0.2.4" # Added MANIFEST.in so that data files are part of sdist
#_... | <commit_before># __init__.py
#__version__ = "0.2.1" # Initial version with installation package
#__version__ = "0.2.2" # Updated README documentation for PyPI page
#__version__ = "0.2.3" # Experimenting with distribution options
#__version__ = "0.2.4" # Added MANIFEST.in so that data files are p... |
71ce7f3e745b9cee357f867f126dce65f6e210ac | main.py | main.py | import os
import sys
PROJECT_ROOT = os.path.dirname(__file__)
sys.path.insert(0, os.path.join(PROJECT_ROOT, 'vroom'))
import pygame
import math
from world import Universe
# Initialize pygame
pygame.init()
size = width, height = 800, 600
black = 0, 0, 0
screen = pygame.display.set_mode(size)
clock = pygame.time.Clo... | import os
import sys
PROJECT_ROOT = os.path.dirname(__file__)
sys.path.insert(0, os.path.join(PROJECT_ROOT, 'vroom'))
import pygame
import math
from world import Universe
# Initialize pygame
pygame.init()
size = width, height = 800, 600
black = 0, 0, 0
screen = pygame.display.set_mode(size)
clock = pygame.time.Clo... | Add more roads on map | Add more roads on map
| Python | mit | thibault/vroom | import os
import sys
PROJECT_ROOT = os.path.dirname(__file__)
sys.path.insert(0, os.path.join(PROJECT_ROOT, 'vroom'))
import pygame
import math
from world import Universe
# Initialize pygame
pygame.init()
size = width, height = 800, 600
black = 0, 0, 0
screen = pygame.display.set_mode(size)
clock = pygame.time.Clo... | import os
import sys
PROJECT_ROOT = os.path.dirname(__file__)
sys.path.insert(0, os.path.join(PROJECT_ROOT, 'vroom'))
import pygame
import math
from world import Universe
# Initialize pygame
pygame.init()
size = width, height = 800, 600
black = 0, 0, 0
screen = pygame.display.set_mode(size)
clock = pygame.time.Clo... | <commit_before>import os
import sys
PROJECT_ROOT = os.path.dirname(__file__)
sys.path.insert(0, os.path.join(PROJECT_ROOT, 'vroom'))
import pygame
import math
from world import Universe
# Initialize pygame
pygame.init()
size = width, height = 800, 600
black = 0, 0, 0
screen = pygame.display.set_mode(size)
clock = ... | import os
import sys
PROJECT_ROOT = os.path.dirname(__file__)
sys.path.insert(0, os.path.join(PROJECT_ROOT, 'vroom'))
import pygame
import math
from world import Universe
# Initialize pygame
pygame.init()
size = width, height = 800, 600
black = 0, 0, 0
screen = pygame.display.set_mode(size)
clock = pygame.time.Clo... | import os
import sys
PROJECT_ROOT = os.path.dirname(__file__)
sys.path.insert(0, os.path.join(PROJECT_ROOT, 'vroom'))
import pygame
import math
from world import Universe
# Initialize pygame
pygame.init()
size = width, height = 800, 600
black = 0, 0, 0
screen = pygame.display.set_mode(size)
clock = pygame.time.Clo... | <commit_before>import os
import sys
PROJECT_ROOT = os.path.dirname(__file__)
sys.path.insert(0, os.path.join(PROJECT_ROOT, 'vroom'))
import pygame
import math
from world import Universe
# Initialize pygame
pygame.init()
size = width, height = 800, 600
black = 0, 0, 0
screen = pygame.display.set_mode(size)
clock = ... |
d4d517611104a8b42ccc79a310c510edd5f0eae5 | numba/cuda/simulator/cudadrv/driver.py | numba/cuda/simulator/cudadrv/driver.py | '''
Most of the driver API is unsupported in the simulator, but some stubs are
provided to allow tests to import correctly.
'''
def device_memset(dst, val, size, stream=0):
dst.view('u1')[:size].fill(bytes([val])[0])
def host_to_device(dst, src, size, stream=0):
dst.view('u1')[:size] = src.view('u1')[:size]... | '''
Most of the driver API is unsupported in the simulator, but some stubs are
provided to allow tests to import correctly.
'''
def device_memset(dst, val, size, stream=0):
dst.view('u1')[:size].fill(bytes([val])[0])
def host_to_device(dst, src, size, stream=0):
dst.view('u1')[:size] = src.view('u1')[:size]... | Fix simulator by adding missing USE_NV_BINDING to simulator | CUDA: Fix simulator by adding missing USE_NV_BINDING to simulator
| Python | bsd-2-clause | cpcloud/numba,numba/numba,seibert/numba,IntelLabs/numba,cpcloud/numba,cpcloud/numba,seibert/numba,IntelLabs/numba,numba/numba,IntelLabs/numba,numba/numba,cpcloud/numba,seibert/numba,numba/numba,seibert/numba,IntelLabs/numba,numba/numba,cpcloud/numba,IntelLabs/numba,seibert/numba | '''
Most of the driver API is unsupported in the simulator, but some stubs are
provided to allow tests to import correctly.
'''
def device_memset(dst, val, size, stream=0):
dst.view('u1')[:size].fill(bytes([val])[0])
def host_to_device(dst, src, size, stream=0):
dst.view('u1')[:size] = src.view('u1')[:size]... | '''
Most of the driver API is unsupported in the simulator, but some stubs are
provided to allow tests to import correctly.
'''
def device_memset(dst, val, size, stream=0):
dst.view('u1')[:size].fill(bytes([val])[0])
def host_to_device(dst, src, size, stream=0):
dst.view('u1')[:size] = src.view('u1')[:size]... | <commit_before>'''
Most of the driver API is unsupported in the simulator, but some stubs are
provided to allow tests to import correctly.
'''
def device_memset(dst, val, size, stream=0):
dst.view('u1')[:size].fill(bytes([val])[0])
def host_to_device(dst, src, size, stream=0):
dst.view('u1')[:size] = src.vi... | '''
Most of the driver API is unsupported in the simulator, but some stubs are
provided to allow tests to import correctly.
'''
def device_memset(dst, val, size, stream=0):
dst.view('u1')[:size].fill(bytes([val])[0])
def host_to_device(dst, src, size, stream=0):
dst.view('u1')[:size] = src.view('u1')[:size]... | '''
Most of the driver API is unsupported in the simulator, but some stubs are
provided to allow tests to import correctly.
'''
def device_memset(dst, val, size, stream=0):
dst.view('u1')[:size].fill(bytes([val])[0])
def host_to_device(dst, src, size, stream=0):
dst.view('u1')[:size] = src.view('u1')[:size]... | <commit_before>'''
Most of the driver API is unsupported in the simulator, but some stubs are
provided to allow tests to import correctly.
'''
def device_memset(dst, val, size, stream=0):
dst.view('u1')[:size].fill(bytes([val])[0])
def host_to_device(dst, src, size, stream=0):
dst.view('u1')[:size] = src.vi... |
7865d7a37562be8b0af9b3668043d8c08138814b | examples/get_each_args.py | examples/get_each_args.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from clint.arguments import Args
from clint.textui import puts, colored
all_args = Args().grouped
for item in all_args:
if item is not '_':
puts(colored.red("key:%s"%item))
print(all_args[item].all)
| #! /usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
sys.path.insert(0, os.path.abspath('..'))
from clint.arguments import Args
from clint.textui import puts, colored
all_args = Args().grouped
for item in all_args:
if item is not '_':
puts(colored.red("key:%s"%item))
print(all_ar... | Add clint to import paths | Add clint to import paths
| Python | isc | kennethreitz/clint | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from clint.arguments import Args
from clint.textui import puts, colored
all_args = Args().grouped
for item in all_args:
if item is not '_':
puts(colored.red("key:%s"%item))
print(all_args[item].all)
Add clint to import paths | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
sys.path.insert(0, os.path.abspath('..'))
from clint.arguments import Args
from clint.textui import puts, colored
all_args = Args().grouped
for item in all_args:
if item is not '_':
puts(colored.red("key:%s"%item))
print(all_ar... | <commit_before>#! /usr/bin/env python
# -*- coding: utf-8 -*-
from clint.arguments import Args
from clint.textui import puts, colored
all_args = Args().grouped
for item in all_args:
if item is not '_':
puts(colored.red("key:%s"%item))
print(all_args[item].all)
<commit_msg>Add clint to import pat... | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
sys.path.insert(0, os.path.abspath('..'))
from clint.arguments import Args
from clint.textui import puts, colored
all_args = Args().grouped
for item in all_args:
if item is not '_':
puts(colored.red("key:%s"%item))
print(all_ar... | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from clint.arguments import Args
from clint.textui import puts, colored
all_args = Args().grouped
for item in all_args:
if item is not '_':
puts(colored.red("key:%s"%item))
print(all_args[item].all)
Add clint to import paths#! /usr/bin/env python
# ... | <commit_before>#! /usr/bin/env python
# -*- coding: utf-8 -*-
from clint.arguments import Args
from clint.textui import puts, colored
all_args = Args().grouped
for item in all_args:
if item is not '_':
puts(colored.red("key:%s"%item))
print(all_args[item].all)
<commit_msg>Add clint to import pat... |
19ea9c2078ffb506bcab9f175e4275577901c599 | bulbs/indexable/management/commands/synces.py | bulbs/indexable/management/commands/synces.py | from django.core.management.base import NoArgsCommand
from elasticutils import get_es
from pyelasticsearch.exceptions import IndexAlreadyExistsError, ElasticHttpError
from bulbs.indexable.conf import settings
from bulbs.indexable.models import polymorphic_indexable_registry
class Command(NoArgsCommand):
help = ... | from django.core.management.base import NoArgsCommand
from elasticutils import get_es
from pyelasticsearch.exceptions import IndexAlreadyExistsError, ElasticHttpError
from bulbs.indexable.conf import settings
from bulbs.indexable.models import polymorphic_indexable_registry
class Command(NoArgsCommand):
help = ... | Create index mappings independently of index, just update settings? | Create index mappings independently of index, just update settings?
| Python | mit | theonion/django-bulbs,theonion/django-bulbs,theonion/django-bulbs,pombredanne/django-bulbs,theonion/django-bulbs,pombredanne/django-bulbs,theonion/django-bulbs | from django.core.management.base import NoArgsCommand
from elasticutils import get_es
from pyelasticsearch.exceptions import IndexAlreadyExistsError, ElasticHttpError
from bulbs.indexable.conf import settings
from bulbs.indexable.models import polymorphic_indexable_registry
class Command(NoArgsCommand):
help = ... | from django.core.management.base import NoArgsCommand
from elasticutils import get_es
from pyelasticsearch.exceptions import IndexAlreadyExistsError, ElasticHttpError
from bulbs.indexable.conf import settings
from bulbs.indexable.models import polymorphic_indexable_registry
class Command(NoArgsCommand):
help = ... | <commit_before>from django.core.management.base import NoArgsCommand
from elasticutils import get_es
from pyelasticsearch.exceptions import IndexAlreadyExistsError, ElasticHttpError
from bulbs.indexable.conf import settings
from bulbs.indexable.models import polymorphic_indexable_registry
class Command(NoArgsComman... | from django.core.management.base import NoArgsCommand
from elasticutils import get_es
from pyelasticsearch.exceptions import IndexAlreadyExistsError, ElasticHttpError
from bulbs.indexable.conf import settings
from bulbs.indexable.models import polymorphic_indexable_registry
class Command(NoArgsCommand):
help = ... | from django.core.management.base import NoArgsCommand
from elasticutils import get_es
from pyelasticsearch.exceptions import IndexAlreadyExistsError, ElasticHttpError
from bulbs.indexable.conf import settings
from bulbs.indexable.models import polymorphic_indexable_registry
class Command(NoArgsCommand):
help = ... | <commit_before>from django.core.management.base import NoArgsCommand
from elasticutils import get_es
from pyelasticsearch.exceptions import IndexAlreadyExistsError, ElasticHttpError
from bulbs.indexable.conf import settings
from bulbs.indexable.models import polymorphic_indexable_registry
class Command(NoArgsComman... |
55290d237b851c9a245b710fb8b85c4d9a0b9388 | addons/base_action_rule/migrations/8.0.1.0/post-migration.py | addons/base_action_rule/migrations/8.0.1.0/post-migration.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 HBEE (http://www.hbee.eu)
# @author: Paulius Sladkevičius <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 HBEE (http://www.hbee.eu)
# @author: Paulius Sladkevičius <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | Set action rules kind to 'on_time' | Set action rules kind to 'on_time' | Python | agpl-3.0 | 0k/OpenUpgrade,0k/OpenUpgrade,hifly/OpenUpgrade,Endika/OpenUpgrade,0k/OpenUpgrade,pedrobaeza/OpenUpgrade,bwrsandman/OpenUpgrade,OpenUpgrade-dev/OpenUpgrade,grap/OpenUpgrade,pedrobaeza/OpenUpgrade,grap/OpenUpgrade,OpenUpgrade/OpenUpgrade,damdam-s/OpenUpgrade,mvaled/OpenUpgrade,mvaled/OpenUpgrade,Endika/OpenUpgrade,pedro... | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 HBEE (http://www.hbee.eu)
# @author: Paulius Sladkevičius <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 HBEE (http://www.hbee.eu)
# @author: Paulius Sladkevičius <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | <commit_before># -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 HBEE (http://www.hbee.eu)
# @author: Paulius Sladkevičius <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the t... | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 HBEE (http://www.hbee.eu)
# @author: Paulius Sladkevičius <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 HBEE (http://www.hbee.eu)
# @author: Paulius Sladkevičius <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | <commit_before># -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 HBEE (http://www.hbee.eu)
# @author: Paulius Sladkevičius <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the t... |
c78e1e7aff407355d26c12d06663a7dfb95314b1 | accelerator/tests/contexts/analyze_judging_context.py | accelerator/tests/contexts/analyze_judging_context.py | from accelerator.tests.factories import (
CriterionFactory,
CriterionOptionSpecFactory,
)
from accelerator.tests.contexts.judge_feedback_context import (
JudgeFeedbackContext,
)
from accelerator.models import (
JUDGING_FEEDBACK_STATUS_COMPLETE,
)
class AnalyzeJudgingContext(JudgeFeedbackContext):
... | from accelerator.tests.factories import (
CriterionFactory,
CriterionOptionSpecFactory,
)
from accelerator.tests.contexts.judge_feedback_context import (
JudgeFeedbackContext,
)
from accelerator.models import (
JUDGING_FEEDBACK_STATUS_COMPLETE,
JudgeApplicationFeedback,
)
class AnalyzeJudgingConte... | Add needed_reads method to avoid magic numbers | Add needed_reads method to avoid magic numbers
| Python | mit | masschallenge/django-accelerator,masschallenge/django-accelerator | from accelerator.tests.factories import (
CriterionFactory,
CriterionOptionSpecFactory,
)
from accelerator.tests.contexts.judge_feedback_context import (
JudgeFeedbackContext,
)
from accelerator.models import (
JUDGING_FEEDBACK_STATUS_COMPLETE,
)
class AnalyzeJudgingContext(JudgeFeedbackContext):
... | from accelerator.tests.factories import (
CriterionFactory,
CriterionOptionSpecFactory,
)
from accelerator.tests.contexts.judge_feedback_context import (
JudgeFeedbackContext,
)
from accelerator.models import (
JUDGING_FEEDBACK_STATUS_COMPLETE,
JudgeApplicationFeedback,
)
class AnalyzeJudgingConte... | <commit_before>from accelerator.tests.factories import (
CriterionFactory,
CriterionOptionSpecFactory,
)
from accelerator.tests.contexts.judge_feedback_context import (
JudgeFeedbackContext,
)
from accelerator.models import (
JUDGING_FEEDBACK_STATUS_COMPLETE,
)
class AnalyzeJudgingContext(JudgeFeedbac... | from accelerator.tests.factories import (
CriterionFactory,
CriterionOptionSpecFactory,
)
from accelerator.tests.contexts.judge_feedback_context import (
JudgeFeedbackContext,
)
from accelerator.models import (
JUDGING_FEEDBACK_STATUS_COMPLETE,
JudgeApplicationFeedback,
)
class AnalyzeJudgingConte... | from accelerator.tests.factories import (
CriterionFactory,
CriterionOptionSpecFactory,
)
from accelerator.tests.contexts.judge_feedback_context import (
JudgeFeedbackContext,
)
from accelerator.models import (
JUDGING_FEEDBACK_STATUS_COMPLETE,
)
class AnalyzeJudgingContext(JudgeFeedbackContext):
... | <commit_before>from accelerator.tests.factories import (
CriterionFactory,
CriterionOptionSpecFactory,
)
from accelerator.tests.contexts.judge_feedback_context import (
JudgeFeedbackContext,
)
from accelerator.models import (
JUDGING_FEEDBACK_STATUS_COMPLETE,
)
class AnalyzeJudgingContext(JudgeFeedbac... |
e69559b81e9b52eb0834df67b0197aa0f734db3c | wafer/talks/admin.py | wafer/talks/admin.py | from django.contrib import admin
from wafer.talks.models import Talk
class TalkAdmin(admin.ModelAdmin):
list_display = ('corresponding_author', 'title', 'status')
admin.site.register(Talk, TalkAdmin)
| from django.contrib import admin
from wafer.talks.models import Talk
class TalkAdmin(admin.ModelAdmin):
list_display = ('corresponding_author', 'title', 'status')
list_editable = ('status',)
admin.site.register(Talk, TalkAdmin)
| Make talk status editale from the talk list overview | Make talk status editale from the talk list overview
| Python | isc | CTPUG/wafer,CTPUG/wafer,CarlFK/wafer,CTPUG/wafer,CarlFK/wafer,CarlFK/wafer,CTPUG/wafer,CarlFK/wafer | from django.contrib import admin
from wafer.talks.models import Talk
class TalkAdmin(admin.ModelAdmin):
list_display = ('corresponding_author', 'title', 'status')
admin.site.register(Talk, TalkAdmin)
Make talk status editale from the talk list overview | from django.contrib import admin
from wafer.talks.models import Talk
class TalkAdmin(admin.ModelAdmin):
list_display = ('corresponding_author', 'title', 'status')
list_editable = ('status',)
admin.site.register(Talk, TalkAdmin)
| <commit_before>from django.contrib import admin
from wafer.talks.models import Talk
class TalkAdmin(admin.ModelAdmin):
list_display = ('corresponding_author', 'title', 'status')
admin.site.register(Talk, TalkAdmin)
<commit_msg>Make talk status editale from the talk list overview<commit_after> | from django.contrib import admin
from wafer.talks.models import Talk
class TalkAdmin(admin.ModelAdmin):
list_display = ('corresponding_author', 'title', 'status')
list_editable = ('status',)
admin.site.register(Talk, TalkAdmin)
| from django.contrib import admin
from wafer.talks.models import Talk
class TalkAdmin(admin.ModelAdmin):
list_display = ('corresponding_author', 'title', 'status')
admin.site.register(Talk, TalkAdmin)
Make talk status editale from the talk list overviewfrom django.contrib import admin
from wafer.talks.models i... | <commit_before>from django.contrib import admin
from wafer.talks.models import Talk
class TalkAdmin(admin.ModelAdmin):
list_display = ('corresponding_author', 'title', 'status')
admin.site.register(Talk, TalkAdmin)
<commit_msg>Make talk status editale from the talk list overview<commit_after>from django.contri... |
49bd893340f456f18101fb2fec7d66026326f401 | bot/action/extra/messages/stored_message.py | bot/action/extra/messages/stored_message.py | import json
from bot.action.core.command import UnderscoredCommandBuilder
from bot.action.extra.messages import analyzer
from bot.api.domain import ApiObject
class StoredMessage:
def __init__(self, message_id, message, *edited_messages):
self.message_id = message_id
self.message = message
... | import json
from bot.action.core.command import UnderscoredCommandBuilder
from bot.action.extra.messages import analyzer, StoredMessageMapper
from bot.api.domain import ApiObject
class StoredMessage:
def __init__(self, message_id, message, *edited_messages, incomplete=False):
self.message_id = message_id... | Add a from_message static method to StoredMessage, also an incomplete field | Add a from_message static method to StoredMessage, also an incomplete field
| Python | agpl-3.0 | alvarogzp/telegram-bot,alvarogzp/telegram-bot | import json
from bot.action.core.command import UnderscoredCommandBuilder
from bot.action.extra.messages import analyzer
from bot.api.domain import ApiObject
class StoredMessage:
def __init__(self, message_id, message, *edited_messages):
self.message_id = message_id
self.message = message
... | import json
from bot.action.core.command import UnderscoredCommandBuilder
from bot.action.extra.messages import analyzer, StoredMessageMapper
from bot.api.domain import ApiObject
class StoredMessage:
def __init__(self, message_id, message, *edited_messages, incomplete=False):
self.message_id = message_id... | <commit_before>import json
from bot.action.core.command import UnderscoredCommandBuilder
from bot.action.extra.messages import analyzer
from bot.api.domain import ApiObject
class StoredMessage:
def __init__(self, message_id, message, *edited_messages):
self.message_id = message_id
self.message = ... | import json
from bot.action.core.command import UnderscoredCommandBuilder
from bot.action.extra.messages import analyzer, StoredMessageMapper
from bot.api.domain import ApiObject
class StoredMessage:
def __init__(self, message_id, message, *edited_messages, incomplete=False):
self.message_id = message_id... | import json
from bot.action.core.command import UnderscoredCommandBuilder
from bot.action.extra.messages import analyzer
from bot.api.domain import ApiObject
class StoredMessage:
def __init__(self, message_id, message, *edited_messages):
self.message_id = message_id
self.message = message
... | <commit_before>import json
from bot.action.core.command import UnderscoredCommandBuilder
from bot.action.extra.messages import analyzer
from bot.api.domain import ApiObject
class StoredMessage:
def __init__(self, message_id, message, *edited_messages):
self.message_id = message_id
self.message = ... |
ec75d49f1b83a03b57683b622b68a6af2200a567 | onitu/api/router.py | onitu/api/router.py | from threading import Thread
import zmq
from logbook import Logger
class Router(Thread):
"""Thread waiting for a request by another Driver and responding to
it with the chunked asked.
"""
def __init__(self, name, redis, get_chunk):
super(Router, self).__init__()
self.name = name
... | from threading import Thread
import zmq
from logbook import Logger
class Router(Thread):
"""Thread waiting for a request by another Driver and responding to
it with the chunked asked.
"""
def __init__(self, name, redis, get_chunk):
super(Router, self).__init__()
self.name = name
... | Remove annoying logging in Router | Remove annoying logging in Router
| Python | mit | onitu/onitu,onitu/onitu,onitu/onitu | from threading import Thread
import zmq
from logbook import Logger
class Router(Thread):
"""Thread waiting for a request by another Driver and responding to
it with the chunked asked.
"""
def __init__(self, name, redis, get_chunk):
super(Router, self).__init__()
self.name = name
... | from threading import Thread
import zmq
from logbook import Logger
class Router(Thread):
"""Thread waiting for a request by another Driver and responding to
it with the chunked asked.
"""
def __init__(self, name, redis, get_chunk):
super(Router, self).__init__()
self.name = name
... | <commit_before>from threading import Thread
import zmq
from logbook import Logger
class Router(Thread):
"""Thread waiting for a request by another Driver and responding to
it with the chunked asked.
"""
def __init__(self, name, redis, get_chunk):
super(Router, self).__init__()
self.... | from threading import Thread
import zmq
from logbook import Logger
class Router(Thread):
"""Thread waiting for a request by another Driver and responding to
it with the chunked asked.
"""
def __init__(self, name, redis, get_chunk):
super(Router, self).__init__()
self.name = name
... | from threading import Thread
import zmq
from logbook import Logger
class Router(Thread):
"""Thread waiting for a request by another Driver and responding to
it with the chunked asked.
"""
def __init__(self, name, redis, get_chunk):
super(Router, self).__init__()
self.name = name
... | <commit_before>from threading import Thread
import zmq
from logbook import Logger
class Router(Thread):
"""Thread waiting for a request by another Driver and responding to
it with the chunked asked.
"""
def __init__(self, name, redis, get_chunk):
super(Router, self).__init__()
self.... |
d14160537292c87f870fa8c7d99c253b61420dde | blazeweb/registry.py | blazeweb/registry.py |
from paste.registry import StackedObjectProxy as PasteSOP
class StackedObjectProxy(PasteSOP):
# override b/c of
# http://trac.pythonpaste.org/pythonpaste/ticket/482
def _pop_object(self, obj=None):
"""Remove a thread-local object.
If ``obj`` is given, it is checked against the popped ob... |
from paste.registry import StackedObjectProxy as PasteSOP
class StackedObjectProxy(PasteSOP):
# override b/c of
# http://trac.pythonpaste.org/pythonpaste/ticket/482
def _pop_object(self, obj=None):
"""Remove a thread-local object.
If ``obj`` is given, it is checked against the popped ob... | Fix boolean conversion of StackedObjectProxy in Python 3 | Fix boolean conversion of StackedObjectProxy in Python 3
| Python | bsd-3-clause | level12/blazeweb,level12/blazeweb,level12/blazeweb |
from paste.registry import StackedObjectProxy as PasteSOP
class StackedObjectProxy(PasteSOP):
# override b/c of
# http://trac.pythonpaste.org/pythonpaste/ticket/482
def _pop_object(self, obj=None):
"""Remove a thread-local object.
If ``obj`` is given, it is checked against the popped ob... |
from paste.registry import StackedObjectProxy as PasteSOP
class StackedObjectProxy(PasteSOP):
# override b/c of
# http://trac.pythonpaste.org/pythonpaste/ticket/482
def _pop_object(self, obj=None):
"""Remove a thread-local object.
If ``obj`` is given, it is checked against the popped ob... | <commit_before>
from paste.registry import StackedObjectProxy as PasteSOP
class StackedObjectProxy(PasteSOP):
# override b/c of
# http://trac.pythonpaste.org/pythonpaste/ticket/482
def _pop_object(self, obj=None):
"""Remove a thread-local object.
If ``obj`` is given, it is checked agains... |
from paste.registry import StackedObjectProxy as PasteSOP
class StackedObjectProxy(PasteSOP):
# override b/c of
# http://trac.pythonpaste.org/pythonpaste/ticket/482
def _pop_object(self, obj=None):
"""Remove a thread-local object.
If ``obj`` is given, it is checked against the popped ob... |
from paste.registry import StackedObjectProxy as PasteSOP
class StackedObjectProxy(PasteSOP):
# override b/c of
# http://trac.pythonpaste.org/pythonpaste/ticket/482
def _pop_object(self, obj=None):
"""Remove a thread-local object.
If ``obj`` is given, it is checked against the popped ob... | <commit_before>
from paste.registry import StackedObjectProxy as PasteSOP
class StackedObjectProxy(PasteSOP):
# override b/c of
# http://trac.pythonpaste.org/pythonpaste/ticket/482
def _pop_object(self, obj=None):
"""Remove a thread-local object.
If ``obj`` is given, it is checked agains... |
08bffa5f6df497f28fe3481fe80b517628b0f1a3 | tmdb3/cache_engine.py | tmdb3/cache_engine.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#-----------------------
# Name: cache_engine.py
# Python Library
# Author: Raymond Wagner
# Purpose: Base cache engine class for collecting registered engines
#-----------------------
class Engines( object ):
def __init__(self):
self._engines = {}
def regi... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#-----------------------
# Name: cache_engine.py
# Python Library
# Author: Raymond Wagner
# Purpose: Base cache engine class for collecting registered engines
#-----------------------
class Engines( object ):
def __init__(self):
self._engines = {}
def regi... | Add __contains__ for proper lookup in cache Engines class. | Add __contains__ for proper lookup in cache Engines class.
| Python | bsd-3-clause | wagnerrp/pytmdb3,naveenvhegde/pytmdb3 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#-----------------------
# Name: cache_engine.py
# Python Library
# Author: Raymond Wagner
# Purpose: Base cache engine class for collecting registered engines
#-----------------------
class Engines( object ):
def __init__(self):
self._engines = {}
def regi... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#-----------------------
# Name: cache_engine.py
# Python Library
# Author: Raymond Wagner
# Purpose: Base cache engine class for collecting registered engines
#-----------------------
class Engines( object ):
def __init__(self):
self._engines = {}
def regi... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#-----------------------
# Name: cache_engine.py
# Python Library
# Author: Raymond Wagner
# Purpose: Base cache engine class for collecting registered engines
#-----------------------
class Engines( object ):
def __init__(self):
self._engines = ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#-----------------------
# Name: cache_engine.py
# Python Library
# Author: Raymond Wagner
# Purpose: Base cache engine class for collecting registered engines
#-----------------------
class Engines( object ):
def __init__(self):
self._engines = {}
def regi... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#-----------------------
# Name: cache_engine.py
# Python Library
# Author: Raymond Wagner
# Purpose: Base cache engine class for collecting registered engines
#-----------------------
class Engines( object ):
def __init__(self):
self._engines = {}
def regi... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#-----------------------
# Name: cache_engine.py
# Python Library
# Author: Raymond Wagner
# Purpose: Base cache engine class for collecting registered engines
#-----------------------
class Engines( object ):
def __init__(self):
self._engines = ... |
0c913d4bf94637da916b609b1b1d0d34b03776b7 | tests/test_logger.py | tests/test_logger.py | import pytest
from mugloar import dragon, logger
@pytest.fixture
def log_instance():
"""Returns a Logger instance"""
return logger.Logger()
@pytest.fixture
def knight():
return {'agility': 8, 'endurance': 8, 'armor': 0, 'attack': 4}
@pytest.fixture
def dragon_instance():
return dragon.Dragon()
@... | import pytest
from mugloar import dragon, logger
@pytest.fixture
def log_instance():
"""Returns a Logger instance"""
return logger.Logger()
@pytest.fixture
def knight():
return [('endurance', 8), ('attack', 8), ('armor', 0), ('agility', 4)]
@pytest.fixture
def dragon_instance():
return dragon.Drag... | Implement rudimentary unit tests for logger class | Implement rudimentary unit tests for logger class
| Python | mit | reinikai/mugloar | import pytest
from mugloar import dragon, logger
@pytest.fixture
def log_instance():
"""Returns a Logger instance"""
return logger.Logger()
@pytest.fixture
def knight():
return {'agility': 8, 'endurance': 8, 'armor': 0, 'attack': 4}
@pytest.fixture
def dragon_instance():
return dragon.Dragon()
@... | import pytest
from mugloar import dragon, logger
@pytest.fixture
def log_instance():
"""Returns a Logger instance"""
return logger.Logger()
@pytest.fixture
def knight():
return [('endurance', 8), ('attack', 8), ('armor', 0), ('agility', 4)]
@pytest.fixture
def dragon_instance():
return dragon.Drag... | <commit_before>import pytest
from mugloar import dragon, logger
@pytest.fixture
def log_instance():
"""Returns a Logger instance"""
return logger.Logger()
@pytest.fixture
def knight():
return {'agility': 8, 'endurance': 8, 'armor': 0, 'attack': 4}
@pytest.fixture
def dragon_instance():
return drag... | import pytest
from mugloar import dragon, logger
@pytest.fixture
def log_instance():
"""Returns a Logger instance"""
return logger.Logger()
@pytest.fixture
def knight():
return [('endurance', 8), ('attack', 8), ('armor', 0), ('agility', 4)]
@pytest.fixture
def dragon_instance():
return dragon.Drag... | import pytest
from mugloar import dragon, logger
@pytest.fixture
def log_instance():
"""Returns a Logger instance"""
return logger.Logger()
@pytest.fixture
def knight():
return {'agility': 8, 'endurance': 8, 'armor': 0, 'attack': 4}
@pytest.fixture
def dragon_instance():
return dragon.Dragon()
@... | <commit_before>import pytest
from mugloar import dragon, logger
@pytest.fixture
def log_instance():
"""Returns a Logger instance"""
return logger.Logger()
@pytest.fixture
def knight():
return {'agility': 8, 'endurance': 8, 'armor': 0, 'attack': 4}
@pytest.fixture
def dragon_instance():
return drag... |
3d5b893083e9d53516e1738b6fedbd890722b2e9 | src/cadorsfeed/views/about.py | src/cadorsfeed/views/about.py | from flask import Module
from cadorsfeed.views.util import render_file
about = Module(__name__)
@about.route('/')
def homepage():
return render_file('index.html')
@about.route('/disclaimer')
def disclaimer():
return render_file('disclaimer.html')
@about.route('/about')
def about_page():
return render_f... | from flask import Module
from cadorsfeed.views.util import render_file
about = Module(__name__)
@about.route('/')
@about.route('/home')
def homepage():
return render_file('index.html')
@about.route('/disclaimer')
def disclaimer():
return render_file('disclaimer.html')
@about.route('/about')
def about_page(... | Make /home point to /. | Make /home point to /.
| Python | mit | kurtraschke/cadors-parse,kurtraschke/cadors-parse | from flask import Module
from cadorsfeed.views.util import render_file
about = Module(__name__)
@about.route('/')
def homepage():
return render_file('index.html')
@about.route('/disclaimer')
def disclaimer():
return render_file('disclaimer.html')
@about.route('/about')
def about_page():
return render_f... | from flask import Module
from cadorsfeed.views.util import render_file
about = Module(__name__)
@about.route('/')
@about.route('/home')
def homepage():
return render_file('index.html')
@about.route('/disclaimer')
def disclaimer():
return render_file('disclaimer.html')
@about.route('/about')
def about_page(... | <commit_before>from flask import Module
from cadorsfeed.views.util import render_file
about = Module(__name__)
@about.route('/')
def homepage():
return render_file('index.html')
@about.route('/disclaimer')
def disclaimer():
return render_file('disclaimer.html')
@about.route('/about')
def about_page():
... | from flask import Module
from cadorsfeed.views.util import render_file
about = Module(__name__)
@about.route('/')
@about.route('/home')
def homepage():
return render_file('index.html')
@about.route('/disclaimer')
def disclaimer():
return render_file('disclaimer.html')
@about.route('/about')
def about_page(... | from flask import Module
from cadorsfeed.views.util import render_file
about = Module(__name__)
@about.route('/')
def homepage():
return render_file('index.html')
@about.route('/disclaimer')
def disclaimer():
return render_file('disclaimer.html')
@about.route('/about')
def about_page():
return render_f... | <commit_before>from flask import Module
from cadorsfeed.views.util import render_file
about = Module(__name__)
@about.route('/')
def homepage():
return render_file('index.html')
@about.route('/disclaimer')
def disclaimer():
return render_file('disclaimer.html')
@about.route('/about')
def about_page():
... |
fc41951d1e395c3cdc8994b4c025e9776d67d4e0 | http.py | http.py | from django.http import HttpResponse
class HttpResponseCreated(HttpResponse):
status_code = 201
class HttpResponseNoContent(HttpResponse):
status_code = 204
class HttpResponseNotAllowed(HttpResponse):
status_code = 405
def __init__(self, allow_headers):
"""
RFC2616: The response MUST... | from django.http import HttpResponse
class HttpResponseCreated(HttpResponse):
status_code = 201
class HttpResponseNoContent(HttpResponse):
status_code = 204
class HttpResponseNotAllowed(HttpResponse):
status_code = 405
def __init__(self, allow_headers):
"""
RFC2616: The response MUST... | Add Response class for unsupported media | Add Response class for unsupported media
| Python | mit | danrex/django-riv,danrex/django-riv | from django.http import HttpResponse
class HttpResponseCreated(HttpResponse):
status_code = 201
class HttpResponseNoContent(HttpResponse):
status_code = 204
class HttpResponseNotAllowed(HttpResponse):
status_code = 405
def __init__(self, allow_headers):
"""
RFC2616: The response MUST... | from django.http import HttpResponse
class HttpResponseCreated(HttpResponse):
status_code = 201
class HttpResponseNoContent(HttpResponse):
status_code = 204
class HttpResponseNotAllowed(HttpResponse):
status_code = 405
def __init__(self, allow_headers):
"""
RFC2616: The response MUST... | <commit_before>from django.http import HttpResponse
class HttpResponseCreated(HttpResponse):
status_code = 201
class HttpResponseNoContent(HttpResponse):
status_code = 204
class HttpResponseNotAllowed(HttpResponse):
status_code = 405
def __init__(self, allow_headers):
"""
RFC2616: Th... | from django.http import HttpResponse
class HttpResponseCreated(HttpResponse):
status_code = 201
class HttpResponseNoContent(HttpResponse):
status_code = 204
class HttpResponseNotAllowed(HttpResponse):
status_code = 405
def __init__(self, allow_headers):
"""
RFC2616: The response MUST... | from django.http import HttpResponse
class HttpResponseCreated(HttpResponse):
status_code = 201
class HttpResponseNoContent(HttpResponse):
status_code = 204
class HttpResponseNotAllowed(HttpResponse):
status_code = 405
def __init__(self, allow_headers):
"""
RFC2616: The response MUST... | <commit_before>from django.http import HttpResponse
class HttpResponseCreated(HttpResponse):
status_code = 201
class HttpResponseNoContent(HttpResponse):
status_code = 204
class HttpResponseNotAllowed(HttpResponse):
status_code = 405
def __init__(self, allow_headers):
"""
RFC2616: Th... |
6323084f97ac80a579d9c8ef7d5fec9cd9a3ec4d | src/ipf/ipfblock/connection.py | src/ipf/ipfblock/connection.py | # -*- coding: utf-8 -*-
import ioport
import weakref
class Connection(object):
""" Connection class for IPFBlock
Connection binding OPort and IPort of some IPFBlocks
"""
def __init__(self, oport, iport):
# Check port compatibility and free of input port
if ioport.is_connect... | # -*- coding: utf-8 -*-
import ioport
import weakref
class Connection(object):
""" Connection class for IPFBlock
Connection binding OPort and IPort of some IPFBlocks
"""
def __init__(self, oport, iport):
# Check port compatibility and free of input port
if ioport.is_connect... | Check weakrefs to porst before using in destructor. | Check weakrefs to porst before using in destructor.
Prevent raise of exception in case of connect deletion after block.
| Python | lgpl-2.1 | anton-golubkov/Garland,anton-golubkov/Garland | # -*- coding: utf-8 -*-
import ioport
import weakref
class Connection(object):
""" Connection class for IPFBlock
Connection binding OPort and IPort of some IPFBlocks
"""
def __init__(self, oport, iport):
# Check port compatibility and free of input port
if ioport.is_connect... | # -*- coding: utf-8 -*-
import ioport
import weakref
class Connection(object):
""" Connection class for IPFBlock
Connection binding OPort and IPort of some IPFBlocks
"""
def __init__(self, oport, iport):
# Check port compatibility and free of input port
if ioport.is_connect... | <commit_before># -*- coding: utf-8 -*-
import ioport
import weakref
class Connection(object):
""" Connection class for IPFBlock
Connection binding OPort and IPort of some IPFBlocks
"""
def __init__(self, oport, iport):
# Check port compatibility and free of input port
if io... | # -*- coding: utf-8 -*-
import ioport
import weakref
class Connection(object):
""" Connection class for IPFBlock
Connection binding OPort and IPort of some IPFBlocks
"""
def __init__(self, oport, iport):
# Check port compatibility and free of input port
if ioport.is_connect... | # -*- coding: utf-8 -*-
import ioport
import weakref
class Connection(object):
""" Connection class for IPFBlock
Connection binding OPort and IPort of some IPFBlocks
"""
def __init__(self, oport, iport):
# Check port compatibility and free of input port
if ioport.is_connect... | <commit_before># -*- coding: utf-8 -*-
import ioport
import weakref
class Connection(object):
""" Connection class for IPFBlock
Connection binding OPort and IPort of some IPFBlocks
"""
def __init__(self, oport, iport):
# Check port compatibility and free of input port
if io... |
7fe4342b2b62574230bb5196548fb1d6fb8cac69 | src/engine/request_handler.py | src/engine/request_handler.py | import Queue
import json
import EBQP
from . import world
class GameRequestHandler:
def __init__(self):
self.world = None
self.responses = {
EBQP.new: self.respond_new,
}
def process(self, request):
request_pieces = request.split(EBQP.packet_delimiter, 1)
... | import Queue
import json
import EBQP
from . import world
from . import types
from . import consts
class GameRequestHandler:
def __init__(self):
self.world = None
self.responses = {
EBQP.new: self.respond_new,
}
def process(self, request):
request_pieces = request... | Include one tank on player 1 on game creation | Include one tank on player 1 on game creation
| Python | mit | Tactique/game_engine,Tactique/game_engine | import Queue
import json
import EBQP
from . import world
class GameRequestHandler:
def __init__(self):
self.world = None
self.responses = {
EBQP.new: self.respond_new,
}
def process(self, request):
request_pieces = request.split(EBQP.packet_delimiter, 1)
... | import Queue
import json
import EBQP
from . import world
from . import types
from . import consts
class GameRequestHandler:
def __init__(self):
self.world = None
self.responses = {
EBQP.new: self.respond_new,
}
def process(self, request):
request_pieces = request... | <commit_before>import Queue
import json
import EBQP
from . import world
class GameRequestHandler:
def __init__(self):
self.world = None
self.responses = {
EBQP.new: self.respond_new,
}
def process(self, request):
request_pieces = request.split(EBQP.packet_delimit... | import Queue
import json
import EBQP
from . import world
from . import types
from . import consts
class GameRequestHandler:
def __init__(self):
self.world = None
self.responses = {
EBQP.new: self.respond_new,
}
def process(self, request):
request_pieces = request... | import Queue
import json
import EBQP
from . import world
class GameRequestHandler:
def __init__(self):
self.world = None
self.responses = {
EBQP.new: self.respond_new,
}
def process(self, request):
request_pieces = request.split(EBQP.packet_delimiter, 1)
... | <commit_before>import Queue
import json
import EBQP
from . import world
class GameRequestHandler:
def __init__(self):
self.world = None
self.responses = {
EBQP.new: self.respond_new,
}
def process(self, request):
request_pieces = request.split(EBQP.packet_delimit... |
0fbe22520657f14b1009a49c7fee0958a3704353 | turbasen/settings.py | turbasen/settings.py | class Settings:
ENDPOINT_URL = u'http://api.nasjonalturbase.no/'
LIMIT = 50
| class Settings:
ENDPOINT_URL = u'http://api.nasjonalturbase.no/'
LIMIT = 20
| Set default limit to 20 objects | Set default limit to 20 objects
| Python | mit | Turbasen/turbasen.py | class Settings:
ENDPOINT_URL = u'http://api.nasjonalturbase.no/'
LIMIT = 50
Set default limit to 20 objects | class Settings:
ENDPOINT_URL = u'http://api.nasjonalturbase.no/'
LIMIT = 20
| <commit_before>class Settings:
ENDPOINT_URL = u'http://api.nasjonalturbase.no/'
LIMIT = 50
<commit_msg>Set default limit to 20 objects<commit_after> | class Settings:
ENDPOINT_URL = u'http://api.nasjonalturbase.no/'
LIMIT = 20
| class Settings:
ENDPOINT_URL = u'http://api.nasjonalturbase.no/'
LIMIT = 50
Set default limit to 20 objectsclass Settings:
ENDPOINT_URL = u'http://api.nasjonalturbase.no/'
LIMIT = 20
| <commit_before>class Settings:
ENDPOINT_URL = u'http://api.nasjonalturbase.no/'
LIMIT = 50
<commit_msg>Set default limit to 20 objects<commit_after>class Settings:
ENDPOINT_URL = u'http://api.nasjonalturbase.no/'
LIMIT = 20
|
8ea1ee477a8f9f31e2fcb5fb92a02243723c822e | Instanssi/admin_upload/models.py | Instanssi/admin_upload/models.py | # -*- coding: utf-8 -*-
from django.db import models
from django.contrib.auth.models import User
from django.contrib import admin
from Instanssi.kompomaatti.models import Event
import os.path
class UploadedFile(models.Model):
event = models.ForeignKey(Event, verbose_name=u'Tapahtuma')
user = models.ForeignKey... | # -*- coding: utf-8 -*-
from django.db import models
from django.contrib.auth.models import User
from django.contrib import admin
from Instanssi.kompomaatti.models import Event
import os.path
class UploadedFile(models.Model):
event = models.ForeignKey(Event, verbose_name=u'Tapahtuma')
user = models.ForeignKey... | Delete old files when modified | admin_upload: Delete old files when modified
| Python | mit | Instanssi/Instanssi.org,Instanssi/Instanssi.org,Instanssi/Instanssi.org,Instanssi/Instanssi.org | # -*- coding: utf-8 -*-
from django.db import models
from django.contrib.auth.models import User
from django.contrib import admin
from Instanssi.kompomaatti.models import Event
import os.path
class UploadedFile(models.Model):
event = models.ForeignKey(Event, verbose_name=u'Tapahtuma')
user = models.ForeignKey... | # -*- coding: utf-8 -*-
from django.db import models
from django.contrib.auth.models import User
from django.contrib import admin
from Instanssi.kompomaatti.models import Event
import os.path
class UploadedFile(models.Model):
event = models.ForeignKey(Event, verbose_name=u'Tapahtuma')
user = models.ForeignKey... | <commit_before># -*- coding: utf-8 -*-
from django.db import models
from django.contrib.auth.models import User
from django.contrib import admin
from Instanssi.kompomaatti.models import Event
import os.path
class UploadedFile(models.Model):
event = models.ForeignKey(Event, verbose_name=u'Tapahtuma')
user = mo... | # -*- coding: utf-8 -*-
from django.db import models
from django.contrib.auth.models import User
from django.contrib import admin
from Instanssi.kompomaatti.models import Event
import os.path
class UploadedFile(models.Model):
event = models.ForeignKey(Event, verbose_name=u'Tapahtuma')
user = models.ForeignKey... | # -*- coding: utf-8 -*-
from django.db import models
from django.contrib.auth.models import User
from django.contrib import admin
from Instanssi.kompomaatti.models import Event
import os.path
class UploadedFile(models.Model):
event = models.ForeignKey(Event, verbose_name=u'Tapahtuma')
user = models.ForeignKey... | <commit_before># -*- coding: utf-8 -*-
from django.db import models
from django.contrib.auth.models import User
from django.contrib import admin
from Instanssi.kompomaatti.models import Event
import os.path
class UploadedFile(models.Model):
event = models.ForeignKey(Event, verbose_name=u'Tapahtuma')
user = mo... |
34c65649fc017c087aa229863bbb2c95f1be4134 | tests/test_same_origin.py | tests/test_same_origin.py | from http.cookies import SimpleCookie
from django.conf import settings
from sockjs.tornado.session import ConnectionInfo
from swampdragon.connections.sockjs_connection import SubscriberConnection
from swampdragon.testing.dragon_testcase import DragonTestCaseAsync
import uuid
class TestSession(object):
def __init_... | try:
from http.cookies import SimpleCookie
except ImportError:
from Cookie import SimpleCookie
from django.conf import settings
from sockjs.tornado.session import ConnectionInfo
from swampdragon.connections.sockjs_connection import SubscriberConnection
from swampdragon.testing.dragon_testcase import DragonTest... | Fix import error of SimpleCookie for python 2.7 | Fix import error of SimpleCookie for python 2.7
`Cookie` was renamed to `http.cookies` in Python 3 | Python | bsd-3-clause | faulkner/swampdragon,Manuel4131/swampdragon,d9pouces/swampdragon,sahlinet/swampdragon,seclinch/swampdragon,jonashagstedt/swampdragon,Manuel4131/swampdragon,Manuel4131/swampdragon,michael-k/swampdragon,boris-savic/swampdragon,bastianh/swampdragon,bastianh/swampdragon,boris-savic/swampdragon,seclinch/swampdragon,michael-... | from http.cookies import SimpleCookie
from django.conf import settings
from sockjs.tornado.session import ConnectionInfo
from swampdragon.connections.sockjs_connection import SubscriberConnection
from swampdragon.testing.dragon_testcase import DragonTestCaseAsync
import uuid
class TestSession(object):
def __init_... | try:
from http.cookies import SimpleCookie
except ImportError:
from Cookie import SimpleCookie
from django.conf import settings
from sockjs.tornado.session import ConnectionInfo
from swampdragon.connections.sockjs_connection import SubscriberConnection
from swampdragon.testing.dragon_testcase import DragonTest... | <commit_before>from http.cookies import SimpleCookie
from django.conf import settings
from sockjs.tornado.session import ConnectionInfo
from swampdragon.connections.sockjs_connection import SubscriberConnection
from swampdragon.testing.dragon_testcase import DragonTestCaseAsync
import uuid
class TestSession(object):
... | try:
from http.cookies import SimpleCookie
except ImportError:
from Cookie import SimpleCookie
from django.conf import settings
from sockjs.tornado.session import ConnectionInfo
from swampdragon.connections.sockjs_connection import SubscriberConnection
from swampdragon.testing.dragon_testcase import DragonTest... | from http.cookies import SimpleCookie
from django.conf import settings
from sockjs.tornado.session import ConnectionInfo
from swampdragon.connections.sockjs_connection import SubscriberConnection
from swampdragon.testing.dragon_testcase import DragonTestCaseAsync
import uuid
class TestSession(object):
def __init_... | <commit_before>from http.cookies import SimpleCookie
from django.conf import settings
from sockjs.tornado.session import ConnectionInfo
from swampdragon.connections.sockjs_connection import SubscriberConnection
from swampdragon.testing.dragon_testcase import DragonTestCaseAsync
import uuid
class TestSession(object):
... |
95220c99ae6062fed7d4211c67b8dffc031f4c7c | tests/versioning/tests.py | tests/versioning/tests.py | from __future__ import absolute_import
import os.path
import pytest
import subprocess
from django.conf import settings
from raven.versioning import fetch_git_sha, fetch_package_version
from raven.utils import six
def has_git_requirements():
return os.path.exists(os.path.join(settings.PROJECT_ROOT, '.git', 'ref... | from __future__ import absolute_import
import os.path
import pytest
import subprocess
from django.conf import settings
from raven.versioning import fetch_git_sha, fetch_package_version
from raven.utils import six
def has_git_requirements():
return os.path.exists(os.path.join(settings.PROJECT_ROOT, '.git', 'ref... | Remove use of check_output (not in Py2.6) | Remove use of check_output (not in Py2.6)
| Python | bsd-3-clause | johansteffner/raven-python,johansteffner/raven-python,getsentry/raven-python,akalipetis/raven-python,ewdurbin/raven-python,ewdurbin/raven-python,danriti/raven-python,getsentry/raven-python,getsentry/raven-python,johansteffner/raven-python,ewdurbin/raven-python,akalipetis/raven-python,danriti/raven-python,danriti/raven-... | from __future__ import absolute_import
import os.path
import pytest
import subprocess
from django.conf import settings
from raven.versioning import fetch_git_sha, fetch_package_version
from raven.utils import six
def has_git_requirements():
return os.path.exists(os.path.join(settings.PROJECT_ROOT, '.git', 'ref... | from __future__ import absolute_import
import os.path
import pytest
import subprocess
from django.conf import settings
from raven.versioning import fetch_git_sha, fetch_package_version
from raven.utils import six
def has_git_requirements():
return os.path.exists(os.path.join(settings.PROJECT_ROOT, '.git', 'ref... | <commit_before>from __future__ import absolute_import
import os.path
import pytest
import subprocess
from django.conf import settings
from raven.versioning import fetch_git_sha, fetch_package_version
from raven.utils import six
def has_git_requirements():
return os.path.exists(os.path.join(settings.PROJECT_ROO... | from __future__ import absolute_import
import os.path
import pytest
import subprocess
from django.conf import settings
from raven.versioning import fetch_git_sha, fetch_package_version
from raven.utils import six
def has_git_requirements():
return os.path.exists(os.path.join(settings.PROJECT_ROOT, '.git', 'ref... | from __future__ import absolute_import
import os.path
import pytest
import subprocess
from django.conf import settings
from raven.versioning import fetch_git_sha, fetch_package_version
from raven.utils import six
def has_git_requirements():
return os.path.exists(os.path.join(settings.PROJECT_ROOT, '.git', 'ref... | <commit_before>from __future__ import absolute_import
import os.path
import pytest
import subprocess
from django.conf import settings
from raven.versioning import fetch_git_sha, fetch_package_version
from raven.utils import six
def has_git_requirements():
return os.path.exists(os.path.join(settings.PROJECT_ROO... |
072526a6ec1794edc0f729f2ecb66c47ed38abb9 | harmony/extensions/rng.py | harmony/extensions/rng.py | import random
from discord.ext import commands
class RNG:
def __init__(self, bot):
self.bot = bot
@commands.command()
async def roll(self, dice: str = None):
"""Roll some dice.
Keyword arguments:
dice -- number of dice (X) and faces (Y) in the format XdY
"""
... | import random
from discord.ext import commands
class RNG:
def __init__(self, bot):
self.bot = bot
@commands.command()
async def roll(self, dice: str):
"""Roll some dice.
Keyword arguments:
dice -- number of dice (X) and faces (Y) in the format XdY
"""
try... | Make roll better and worse | Make roll better and worse
| Python | apache-2.0 | knyghty/harmony | import random
from discord.ext import commands
class RNG:
def __init__(self, bot):
self.bot = bot
@commands.command()
async def roll(self, dice: str = None):
"""Roll some dice.
Keyword arguments:
dice -- number of dice (X) and faces (Y) in the format XdY
"""
... | import random
from discord.ext import commands
class RNG:
def __init__(self, bot):
self.bot = bot
@commands.command()
async def roll(self, dice: str):
"""Roll some dice.
Keyword arguments:
dice -- number of dice (X) and faces (Y) in the format XdY
"""
try... | <commit_before>import random
from discord.ext import commands
class RNG:
def __init__(self, bot):
self.bot = bot
@commands.command()
async def roll(self, dice: str = None):
"""Roll some dice.
Keyword arguments:
dice -- number of dice (X) and faces (Y) in the format XdY
... | import random
from discord.ext import commands
class RNG:
def __init__(self, bot):
self.bot = bot
@commands.command()
async def roll(self, dice: str):
"""Roll some dice.
Keyword arguments:
dice -- number of dice (X) and faces (Y) in the format XdY
"""
try... | import random
from discord.ext import commands
class RNG:
def __init__(self, bot):
self.bot = bot
@commands.command()
async def roll(self, dice: str = None):
"""Roll some dice.
Keyword arguments:
dice -- number of dice (X) and faces (Y) in the format XdY
"""
... | <commit_before>import random
from discord.ext import commands
class RNG:
def __init__(self, bot):
self.bot = bot
@commands.command()
async def roll(self, dice: str = None):
"""Roll some dice.
Keyword arguments:
dice -- number of dice (X) and faces (Y) in the format XdY
... |
f9a22a0db46a84508cd7a6e5294612eb0484805a | watchdog/__init__.py | watchdog/__init__.py | # -*- coding: utf-8 -*-
import logging
logging.basicConfig(level=logging.DEBUG)
from events import FileSystemEventHandler
try:
import _watchdog_fsevents
logging.debug('Using FSEventsObserver.')
from fsevents_observer import FSEventsObserver as Observer
except ImportError:
try:
import win32fi... | # -*- coding: utf-8 -*-
import logging
logging.basicConfig(level=logging.DEBUG)
from events import FileSystemEventHandler
try:
import pyinotify
logging.debug('Using InotifyObserver')
from inotify_observer import InotifyObserver as Observer
except ImportError:
try:
import _watchdog_fsevents
... | Use InotifyObserver if the pyinotify dependency is satisfied. | Use InotifyObserver if the pyinotify dependency is satisfied.
Signed-off-by: Gora Khargosh <[email protected]>
| Python | apache-2.0 | glorizen/watchdog,mconstantin/watchdog,ymero/watchdog,gorakhargosh/watchdog,glorizen/watchdog,ymero/watchdog,edevil/watchdog,teleyinex/watchdog,teleyinex/watchdog,gorakhargosh/watchdog,glorizen/watchdog,teleyinex/watchdog,mconstantin/watchdog,edevil/watchdog,edevil/watchdog,mconstantin/watchdog,javrasya/watchdog,edevil... | # -*- coding: utf-8 -*-
import logging
logging.basicConfig(level=logging.DEBUG)
from events import FileSystemEventHandler
try:
import _watchdog_fsevents
logging.debug('Using FSEventsObserver.')
from fsevents_observer import FSEventsObserver as Observer
except ImportError:
try:
import win32fi... | # -*- coding: utf-8 -*-
import logging
logging.basicConfig(level=logging.DEBUG)
from events import FileSystemEventHandler
try:
import pyinotify
logging.debug('Using InotifyObserver')
from inotify_observer import InotifyObserver as Observer
except ImportError:
try:
import _watchdog_fsevents
... | <commit_before># -*- coding: utf-8 -*-
import logging
logging.basicConfig(level=logging.DEBUG)
from events import FileSystemEventHandler
try:
import _watchdog_fsevents
logging.debug('Using FSEventsObserver.')
from fsevents_observer import FSEventsObserver as Observer
except ImportError:
try:
... | # -*- coding: utf-8 -*-
import logging
logging.basicConfig(level=logging.DEBUG)
from events import FileSystemEventHandler
try:
import pyinotify
logging.debug('Using InotifyObserver')
from inotify_observer import InotifyObserver as Observer
except ImportError:
try:
import _watchdog_fsevents
... | # -*- coding: utf-8 -*-
import logging
logging.basicConfig(level=logging.DEBUG)
from events import FileSystemEventHandler
try:
import _watchdog_fsevents
logging.debug('Using FSEventsObserver.')
from fsevents_observer import FSEventsObserver as Observer
except ImportError:
try:
import win32fi... | <commit_before># -*- coding: utf-8 -*-
import logging
logging.basicConfig(level=logging.DEBUG)
from events import FileSystemEventHandler
try:
import _watchdog_fsevents
logging.debug('Using FSEventsObserver.')
from fsevents_observer import FSEventsObserver as Observer
except ImportError:
try:
... |
52f8e68835eb67e522dd8f1c7725d460eaa2cab7 | RPS/rps-1.py | RPS/rps-1.py | # A simple rock, paper, scissors script submitted as a demo of easy game-making
# In Python
# Certain parts of this program are functional—that is, written in functions that
# work together. Some parts aren't. As we improve the program, you'll find that
# This functional way of doing things has some real advantages.
i... | """
A simple rock, paper, scissors script submitted as a demo of easy game-making
In Python.
"""
import random # We need thr random module for the computer to play
# This dictionary relates a choice to what it defeats for easy comparison later.
beats = {
"rock":"scissors",
"paper":"rock",
"scissors":"paper... | Refactor out functions from rps1 | Refactor out functions from rps1
| Python | mit | mttaggart/python-cs | # A simple rock, paper, scissors script submitted as a demo of easy game-making
# In Python
# Certain parts of this program are functional—that is, written in functions that
# work together. Some parts aren't. As we improve the program, you'll find that
# This functional way of doing things has some real advantages.
i... | """
A simple rock, paper, scissors script submitted as a demo of easy game-making
In Python.
"""
import random # We need thr random module for the computer to play
# This dictionary relates a choice to what it defeats for easy comparison later.
beats = {
"rock":"scissors",
"paper":"rock",
"scissors":"paper... | <commit_before># A simple rock, paper, scissors script submitted as a demo of easy game-making
# In Python
# Certain parts of this program are functional—that is, written in functions that
# work together. Some parts aren't. As we improve the program, you'll find that
# This functional way of doing things has some real... | """
A simple rock, paper, scissors script submitted as a demo of easy game-making
In Python.
"""
import random # We need thr random module for the computer to play
# This dictionary relates a choice to what it defeats for easy comparison later.
beats = {
"rock":"scissors",
"paper":"rock",
"scissors":"paper... | # A simple rock, paper, scissors script submitted as a demo of easy game-making
# In Python
# Certain parts of this program are functional—that is, written in functions that
# work together. Some parts aren't. As we improve the program, you'll find that
# This functional way of doing things has some real advantages.
i... | <commit_before># A simple rock, paper, scissors script submitted as a demo of easy game-making
# In Python
# Certain parts of this program are functional—that is, written in functions that
# work together. Some parts aren't. As we improve the program, you'll find that
# This functional way of doing things has some real... |
e16b2de7dd7c6e0df100bba08d3a7465bbbb4424 | tests/test_service.py | tests/test_service.py | from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric import padding
from cryptography.hazmat.primitives import serialization, hashes
import requests
import base64
import unittest
import os
class TestPosieService(unittest.TestCase):
POSIE_URL = os.getenv('POSIE_... | from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
import base64
import unittest
import sys
import os
sys.path.append(os.path.abspath('../server.py'))
import server
class TestPosieService(unittest.TestCase):
def test_key_generation(self):
... | Remove requests and drop external tests (now in integration) | Remove requests and drop external tests (now in integration)
| Python | mit | ONSdigital/edcdi | from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric import padding
from cryptography.hazmat.primitives import serialization, hashes
import requests
import base64
import unittest
import os
class TestPosieService(unittest.TestCase):
POSIE_URL = os.getenv('POSIE_... | from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
import base64
import unittest
import sys
import os
sys.path.append(os.path.abspath('../server.py'))
import server
class TestPosieService(unittest.TestCase):
def test_key_generation(self):
... | <commit_before>from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric import padding
from cryptography.hazmat.primitives import serialization, hashes
import requests
import base64
import unittest
import os
class TestPosieService(unittest.TestCase):
POSIE_URL = os... | from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
import base64
import unittest
import sys
import os
sys.path.append(os.path.abspath('../server.py'))
import server
class TestPosieService(unittest.TestCase):
def test_key_generation(self):
... | from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric import padding
from cryptography.hazmat.primitives import serialization, hashes
import requests
import base64
import unittest
import os
class TestPosieService(unittest.TestCase):
POSIE_URL = os.getenv('POSIE_... | <commit_before>from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric import padding
from cryptography.hazmat.primitives import serialization, hashes
import requests
import base64
import unittest
import os
class TestPosieService(unittest.TestCase):
POSIE_URL = os... |
461019099c41ca4ef2fc7ccfec0141ed5b7e3bd6 | tests/test_unicode.py | tests/test_unicode.py | # coding: utf-8
import sys
import pytest
import jupytext
from .utils import list_all_notebooks
@pytest.mark.parametrize('nb_file', list_all_notebooks('.ipynb') +
list_all_notebooks('.Rmd'))
def test_notebook_contents_is_unicode(nb_file):
nb = jupytext.readf(nb_file)
for cell in nb.ce... | # coding: utf-8
import sys
import pytest
import jupytext
from .utils import list_all_notebooks
try:
unicode # Python 2
except NameError:
unicode = str # Python 3
@pytest.mark.parametrize('nb_file', list_all_notebooks('.ipynb') +
list_all_notebooks('.Rmd'))
def test_notebook_conte... | Define unicode in Python 3 | Define unicode in Python 3
__unicode__ was removed in Python 3 because all __str__ are Unicode.
[flake8](http://flake8.pycqa.org) testing of https://github.com/mwouts/jupytext on Python 3.7.0
$ __flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics__
```
./.jupyter/jupyter_notebook_con... | Python | mit | mwouts/jupytext,mwouts/jupytext,mwouts/jupytext,mwouts/jupytext,mwouts/jupytext,mwouts/jupytext,mwouts/jupytext,mwouts/jupytext,mwouts/jupytext,mwouts/jupytext | # coding: utf-8
import sys
import pytest
import jupytext
from .utils import list_all_notebooks
@pytest.mark.parametrize('nb_file', list_all_notebooks('.ipynb') +
list_all_notebooks('.Rmd'))
def test_notebook_contents_is_unicode(nb_file):
nb = jupytext.readf(nb_file)
for cell in nb.ce... | # coding: utf-8
import sys
import pytest
import jupytext
from .utils import list_all_notebooks
try:
unicode # Python 2
except NameError:
unicode = str # Python 3
@pytest.mark.parametrize('nb_file', list_all_notebooks('.ipynb') +
list_all_notebooks('.Rmd'))
def test_notebook_conte... | <commit_before># coding: utf-8
import sys
import pytest
import jupytext
from .utils import list_all_notebooks
@pytest.mark.parametrize('nb_file', list_all_notebooks('.ipynb') +
list_all_notebooks('.Rmd'))
def test_notebook_contents_is_unicode(nb_file):
nb = jupytext.readf(nb_file)
fo... | # coding: utf-8
import sys
import pytest
import jupytext
from .utils import list_all_notebooks
try:
unicode # Python 2
except NameError:
unicode = str # Python 3
@pytest.mark.parametrize('nb_file', list_all_notebooks('.ipynb') +
list_all_notebooks('.Rmd'))
def test_notebook_conte... | # coding: utf-8
import sys
import pytest
import jupytext
from .utils import list_all_notebooks
@pytest.mark.parametrize('nb_file', list_all_notebooks('.ipynb') +
list_all_notebooks('.Rmd'))
def test_notebook_contents_is_unicode(nb_file):
nb = jupytext.readf(nb_file)
for cell in nb.ce... | <commit_before># coding: utf-8
import sys
import pytest
import jupytext
from .utils import list_all_notebooks
@pytest.mark.parametrize('nb_file', list_all_notebooks('.ipynb') +
list_all_notebooks('.Rmd'))
def test_notebook_contents_is_unicode(nb_file):
nb = jupytext.readf(nb_file)
fo... |
eb893151d12f81f1ebe388f0b4ae650aa6f6552c | ticketing/__init__.py | ticketing/__init__.py | """
Ticketing
~~~~~~~~~
"""
try:
VERSION = __import__('pkg_resources') \
.get_distribution('django-ticketing').version
except Exception, e:
VERSION = 'unknown'
| """
Ticketing
~~~~~~~~~
"""
VERSION = (0, 6, 0, 'final', 0)
| Change the version string so it doesn't cause any errors. | Change the version string so it doesn't cause any errors.
| Python | mit | streeter/django-ticketing | """
Ticketing
~~~~~~~~~
"""
try:
VERSION = __import__('pkg_resources') \
.get_distribution('django-ticketing').version
except Exception, e:
VERSION = 'unknown'
Change the version string so it doesn't cause any errors. | """
Ticketing
~~~~~~~~~
"""
VERSION = (0, 6, 0, 'final', 0)
| <commit_before>"""
Ticketing
~~~~~~~~~
"""
try:
VERSION = __import__('pkg_resources') \
.get_distribution('django-ticketing').version
except Exception, e:
VERSION = 'unknown'
<commit_msg>Change the version string so it doesn't cause any errors.<commit_after> | """
Ticketing
~~~~~~~~~
"""
VERSION = (0, 6, 0, 'final', 0)
| """
Ticketing
~~~~~~~~~
"""
try:
VERSION = __import__('pkg_resources') \
.get_distribution('django-ticketing').version
except Exception, e:
VERSION = 'unknown'
Change the version string so it doesn't cause any errors."""
Ticketing
~~~~~~~~~
"""
VERSION = (0, 6, 0, 'final', 0)
| <commit_before>"""
Ticketing
~~~~~~~~~
"""
try:
VERSION = __import__('pkg_resources') \
.get_distribution('django-ticketing').version
except Exception, e:
VERSION = 'unknown'
<commit_msg>Change the version string so it doesn't cause any errors.<commit_after>"""
Ticketing
~~~~~~~~~
"""
VERSION = (0, 6,... |
4f98c8ff8ef724b65106a040ffaf67800dff1611 | animations.py | animations.py | """
All animators should be functions which take the input time as a number
from 0 to 1 and return a new value for the property they are animating.
For numerical properties, this should also be normalized to a [0, 1]
scale, allowing for the possibility of a [-1, 1] scale as well.
"""
def Linear(start, finish):
de... | """
All animators should be functions which take the input time as a number
from 0 to 1 and return a new value for the property they are animating.
For numerical properties, this should also be normalized to a [0, 1]
scale, allowing for the possibility of a [-1, 1] scale as well.
"""
def Linear(start, finish):
de... | Remove some debugging print statements that slipped through. | Remove some debugging print statements that slipped through.
| Python | lgpl-2.1 | platipy/spyral | """
All animators should be functions which take the input time as a number
from 0 to 1 and return a new value for the property they are animating.
For numerical properties, this should also be normalized to a [0, 1]
scale, allowing for the possibility of a [-1, 1] scale as well.
"""
def Linear(start, finish):
de... | """
All animators should be functions which take the input time as a number
from 0 to 1 and return a new value for the property they are animating.
For numerical properties, this should also be normalized to a [0, 1]
scale, allowing for the possibility of a [-1, 1] scale as well.
"""
def Linear(start, finish):
de... | <commit_before>"""
All animators should be functions which take the input time as a number
from 0 to 1 and return a new value for the property they are animating.
For numerical properties, this should also be normalized to a [0, 1]
scale, allowing for the possibility of a [-1, 1] scale as well.
"""
def Linear(start, ... | """
All animators should be functions which take the input time as a number
from 0 to 1 and return a new value for the property they are animating.
For numerical properties, this should also be normalized to a [0, 1]
scale, allowing for the possibility of a [-1, 1] scale as well.
"""
def Linear(start, finish):
de... | """
All animators should be functions which take the input time as a number
from 0 to 1 and return a new value for the property they are animating.
For numerical properties, this should also be normalized to a [0, 1]
scale, allowing for the possibility of a [-1, 1] scale as well.
"""
def Linear(start, finish):
de... | <commit_before>"""
All animators should be functions which take the input time as a number
from 0 to 1 and return a new value for the property they are animating.
For numerical properties, this should also be normalized to a [0, 1]
scale, allowing for the possibility of a [-1, 1] scale as well.
"""
def Linear(start, ... |
c370eb048aa6fe6e64f9cd738717d1deaccf8b2f | modules/pipestrconcat.py | modules/pipestrconcat.py | # pipestrconcat.py #aka stringbuilder
#
from pipe2py import util
def pipe_strconcat(context, _INPUT, conf, **kwargs):
"""This source builds a string and yields it forever.
Keyword arguments:
context -- pipeline context
_INPUT -- not used
conf:
part -- parts
Yields (_OUTPUT):... | # pipestrconcat.py #aka stringbuilder
#
from pipe2py import util
def pipe_strconcat(context, _INPUT, conf, **kwargs):
"""This source builds a string and yields it forever.
Keyword arguments:
context -- pipeline context
_INPUT -- not used
conf:
part -- parts
Yields (_OUTPUT):... | Handle subkey for submodule, in strconcat at least | Handle subkey for submodule, in strconcat at least
| Python | mit | nerevu/riko,nerevu/riko | # pipestrconcat.py #aka stringbuilder
#
from pipe2py import util
def pipe_strconcat(context, _INPUT, conf, **kwargs):
"""This source builds a string and yields it forever.
Keyword arguments:
context -- pipeline context
_INPUT -- not used
conf:
part -- parts
Yields (_OUTPUT):... | # pipestrconcat.py #aka stringbuilder
#
from pipe2py import util
def pipe_strconcat(context, _INPUT, conf, **kwargs):
"""This source builds a string and yields it forever.
Keyword arguments:
context -- pipeline context
_INPUT -- not used
conf:
part -- parts
Yields (_OUTPUT):... | <commit_before># pipestrconcat.py #aka stringbuilder
#
from pipe2py import util
def pipe_strconcat(context, _INPUT, conf, **kwargs):
"""This source builds a string and yields it forever.
Keyword arguments:
context -- pipeline context
_INPUT -- not used
conf:
part -- parts
Yi... | # pipestrconcat.py #aka stringbuilder
#
from pipe2py import util
def pipe_strconcat(context, _INPUT, conf, **kwargs):
"""This source builds a string and yields it forever.
Keyword arguments:
context -- pipeline context
_INPUT -- not used
conf:
part -- parts
Yields (_OUTPUT):... | # pipestrconcat.py #aka stringbuilder
#
from pipe2py import util
def pipe_strconcat(context, _INPUT, conf, **kwargs):
"""This source builds a string and yields it forever.
Keyword arguments:
context -- pipeline context
_INPUT -- not used
conf:
part -- parts
Yields (_OUTPUT):... | <commit_before># pipestrconcat.py #aka stringbuilder
#
from pipe2py import util
def pipe_strconcat(context, _INPUT, conf, **kwargs):
"""This source builds a string and yields it forever.
Keyword arguments:
context -- pipeline context
_INPUT -- not used
conf:
part -- parts
Yi... |
94ae82e8a2915c6c7d353d03aa363ae687805344 | testing/models/test_proposal.py | testing/models/test_proposal.py | import pytest
try:
from unittest import mock
except ImportError:
import mock
from k2catalogue import models
@pytest.fixture
def proposal():
return models.Proposal(proposal_id='abc', pi='pi', title='title',
pdf_url='pdf_url')
def test_proposal_printing(proposal):
assert re... | import pytest
try:
from unittest import mock
except ImportError:
import mock
from k2catalogue import models
@pytest.fixture
def proposal():
return models.Proposal(proposal_id='abc', pi='pi', title='title',
pdf_url='pdf_url')
def test_proposal_printing(proposal):
assert re... | Add more tests around the proposal model behaviour | Add more tests around the proposal model behaviour
| Python | mit | mindriot101/k2catalogue | import pytest
try:
from unittest import mock
except ImportError:
import mock
from k2catalogue import models
@pytest.fixture
def proposal():
return models.Proposal(proposal_id='abc', pi='pi', title='title',
pdf_url='pdf_url')
def test_proposal_printing(proposal):
assert re... | import pytest
try:
from unittest import mock
except ImportError:
import mock
from k2catalogue import models
@pytest.fixture
def proposal():
return models.Proposal(proposal_id='abc', pi='pi', title='title',
pdf_url='pdf_url')
def test_proposal_printing(proposal):
assert re... | <commit_before>import pytest
try:
from unittest import mock
except ImportError:
import mock
from k2catalogue import models
@pytest.fixture
def proposal():
return models.Proposal(proposal_id='abc', pi='pi', title='title',
pdf_url='pdf_url')
def test_proposal_printing(proposal)... | import pytest
try:
from unittest import mock
except ImportError:
import mock
from k2catalogue import models
@pytest.fixture
def proposal():
return models.Proposal(proposal_id='abc', pi='pi', title='title',
pdf_url='pdf_url')
def test_proposal_printing(proposal):
assert re... | import pytest
try:
from unittest import mock
except ImportError:
import mock
from k2catalogue import models
@pytest.fixture
def proposal():
return models.Proposal(proposal_id='abc', pi='pi', title='title',
pdf_url='pdf_url')
def test_proposal_printing(proposal):
assert re... | <commit_before>import pytest
try:
from unittest import mock
except ImportError:
import mock
from k2catalogue import models
@pytest.fixture
def proposal():
return models.Proposal(proposal_id='abc', pi='pi', title='title',
pdf_url='pdf_url')
def test_proposal_printing(proposal)... |
be871f0c6e027e2e51233600c49a502dc6b9a15b | calaccess_raw/__init__.py | calaccess_raw/__init__.py | import os
from django.conf import settings
from django.db.models.loading import get_models, get_app
default_app_config = 'calaccess_raw.apps.CalAccessRawConfig'
def get_download_directory():
"""
Returns the download directory where we will store downloaded data.
"""
if hasattr(settings, 'CALACCESS_DOW... | import os
from django.conf import settings
from django.apps import apps as django_apps
default_app_config = 'calaccess_raw.apps.CalAccessRawConfig'
def get_download_directory():
"""
Returns the download directory where we will store downloaded data.
"""
if hasattr(settings, 'CALACCESS_DOWNLOAD_DIR'):
... | Update get_model_list to use app config rather than deprecated django.db.models.loading functions | Update get_model_list to use app config rather than deprecated django.db.models.loading functions
| Python | mit | dcloud/django-calaccess-raw-data | import os
from django.conf import settings
from django.db.models.loading import get_models, get_app
default_app_config = 'calaccess_raw.apps.CalAccessRawConfig'
def get_download_directory():
"""
Returns the download directory where we will store downloaded data.
"""
if hasattr(settings, 'CALACCESS_DOW... | import os
from django.conf import settings
from django.apps import apps as django_apps
default_app_config = 'calaccess_raw.apps.CalAccessRawConfig'
def get_download_directory():
"""
Returns the download directory where we will store downloaded data.
"""
if hasattr(settings, 'CALACCESS_DOWNLOAD_DIR'):
... | <commit_before>import os
from django.conf import settings
from django.db.models.loading import get_models, get_app
default_app_config = 'calaccess_raw.apps.CalAccessRawConfig'
def get_download_directory():
"""
Returns the download directory where we will store downloaded data.
"""
if hasattr(settings,... | import os
from django.conf import settings
from django.apps import apps as django_apps
default_app_config = 'calaccess_raw.apps.CalAccessRawConfig'
def get_download_directory():
"""
Returns the download directory where we will store downloaded data.
"""
if hasattr(settings, 'CALACCESS_DOWNLOAD_DIR'):
... | import os
from django.conf import settings
from django.db.models.loading import get_models, get_app
default_app_config = 'calaccess_raw.apps.CalAccessRawConfig'
def get_download_directory():
"""
Returns the download directory where we will store downloaded data.
"""
if hasattr(settings, 'CALACCESS_DOW... | <commit_before>import os
from django.conf import settings
from django.db.models.loading import get_models, get_app
default_app_config = 'calaccess_raw.apps.CalAccessRawConfig'
def get_download_directory():
"""
Returns the download directory where we will store downloaded data.
"""
if hasattr(settings,... |
0eca195f9c29824f354cae53a4005f04c67eb86f | nodeconductor/cloud/views.py | nodeconductor/cloud/views.py | from rest_framework import permissions as rf_permissions
from rest_framework import exceptions
from nodeconductor.core import viewsets
from nodeconductor.cloud import models
from nodeconductor.cloud import serializers
from nodeconductor.structure import filters as structure_filters
from nodeconductor.structure import ... | from rest_framework import permissions as rf_permissions
from rest_framework import exceptions
from nodeconductor.core import viewsets
from nodeconductor.cloud import models
from nodeconductor.cloud import serializers
from nodeconductor.structure import filters as structure_filters
from nodeconductor.structure import ... | Optimize SQL queries used for fetching clouds | Optimize SQL queries used for fetching clouds
| Python | mit | opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor | from rest_framework import permissions as rf_permissions
from rest_framework import exceptions
from nodeconductor.core import viewsets
from nodeconductor.cloud import models
from nodeconductor.cloud import serializers
from nodeconductor.structure import filters as structure_filters
from nodeconductor.structure import ... | from rest_framework import permissions as rf_permissions
from rest_framework import exceptions
from nodeconductor.core import viewsets
from nodeconductor.cloud import models
from nodeconductor.cloud import serializers
from nodeconductor.structure import filters as structure_filters
from nodeconductor.structure import ... | <commit_before>from rest_framework import permissions as rf_permissions
from rest_framework import exceptions
from nodeconductor.core import viewsets
from nodeconductor.cloud import models
from nodeconductor.cloud import serializers
from nodeconductor.structure import filters as structure_filters
from nodeconductor.st... | from rest_framework import permissions as rf_permissions
from rest_framework import exceptions
from nodeconductor.core import viewsets
from nodeconductor.cloud import models
from nodeconductor.cloud import serializers
from nodeconductor.structure import filters as structure_filters
from nodeconductor.structure import ... | from rest_framework import permissions as rf_permissions
from rest_framework import exceptions
from nodeconductor.core import viewsets
from nodeconductor.cloud import models
from nodeconductor.cloud import serializers
from nodeconductor.structure import filters as structure_filters
from nodeconductor.structure import ... | <commit_before>from rest_framework import permissions as rf_permissions
from rest_framework import exceptions
from nodeconductor.core import viewsets
from nodeconductor.cloud import models
from nodeconductor.cloud import serializers
from nodeconductor.structure import filters as structure_filters
from nodeconductor.st... |
09a27308c97ae45992df0128ac1743147658fb98 | tests/unit/test_saysomething.py | tests/unit/test_saysomething.py | import pytest
from pmxbot import saysomething
class TestMongoDBChains:
@pytest.fixture
def mongodb_chains(self, request, mongodb_uri):
k = saysomething.MongoDBChains.from_URI(mongodb_uri)
k.db = k.db.database.connection[
k.db.database.name + '_test'
][k.db.name]
request.addfinalizer(k.db.drop)
return ... | import itertools
import functools
from more_itertools import recipes
import pytest
from pmxbot import saysomething
class TestMongoDBChains:
@pytest.fixture
def mongodb_chains(self, request, mongodb_uri):
k = saysomething.MongoDBChains.from_URI(mongodb_uri)
k.db = k.db.database.connection[
k.db.database.na... | Add test capturing expected behavior under more complex inputs. | Add test capturing expected behavior under more complex inputs.
| Python | mit | yougov/pmxbot,yougov/pmxbot,yougov/pmxbot | import pytest
from pmxbot import saysomething
class TestMongoDBChains:
@pytest.fixture
def mongodb_chains(self, request, mongodb_uri):
k = saysomething.MongoDBChains.from_URI(mongodb_uri)
k.db = k.db.database.connection[
k.db.database.name + '_test'
][k.db.name]
request.addfinalizer(k.db.drop)
return ... | import itertools
import functools
from more_itertools import recipes
import pytest
from pmxbot import saysomething
class TestMongoDBChains:
@pytest.fixture
def mongodb_chains(self, request, mongodb_uri):
k = saysomething.MongoDBChains.from_URI(mongodb_uri)
k.db = k.db.database.connection[
k.db.database.na... | <commit_before>import pytest
from pmxbot import saysomething
class TestMongoDBChains:
@pytest.fixture
def mongodb_chains(self, request, mongodb_uri):
k = saysomething.MongoDBChains.from_URI(mongodb_uri)
k.db = k.db.database.connection[
k.db.database.name + '_test'
][k.db.name]
request.addfinalizer(k.db.... | import itertools
import functools
from more_itertools import recipes
import pytest
from pmxbot import saysomething
class TestMongoDBChains:
@pytest.fixture
def mongodb_chains(self, request, mongodb_uri):
k = saysomething.MongoDBChains.from_URI(mongodb_uri)
k.db = k.db.database.connection[
k.db.database.na... | import pytest
from pmxbot import saysomething
class TestMongoDBChains:
@pytest.fixture
def mongodb_chains(self, request, mongodb_uri):
k = saysomething.MongoDBChains.from_URI(mongodb_uri)
k.db = k.db.database.connection[
k.db.database.name + '_test'
][k.db.name]
request.addfinalizer(k.db.drop)
return ... | <commit_before>import pytest
from pmxbot import saysomething
class TestMongoDBChains:
@pytest.fixture
def mongodb_chains(self, request, mongodb_uri):
k = saysomething.MongoDBChains.from_URI(mongodb_uri)
k.db = k.db.database.connection[
k.db.database.name + '_test'
][k.db.name]
request.addfinalizer(k.db.... |
3df9cdb0f96e68fb6870f3ee261cd206d38fb787 | octane/tests/test_app.py | octane/tests/test_app.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... | Refactor test to use cool py.test's fixture | Refactor test to use cool py.test's fixture
| Python | apache-2.0 | Mirantis/octane,stackforge/fuel-octane,Mirantis/octane,stackforge/fuel-octane | # 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... |
9866d25465a0c95ceeb0d5bc6502deb4bab582e0 | setuptools_scm_git_archive/__init__.py | setuptools_scm_git_archive/__init__.py | from os.path import join
import re
from setuptools_scm.utils import data_from_mime, trace
from setuptools_scm.version import meta, tags_to_versions
tag_re = re.compile(r'(?<=\btag: )([^,]+)\b')
def archival_to_version(data):
trace('data', data)
versions = tags_to_versions(tag_re.findall(data.get('ref-names... | from os.path import join
import re
from setuptools_scm.utils import data_from_mime, trace
from setuptools_scm.version import meta, tags_to_versions
tag_re = re.compile(r'(?<=\btag: )([^,]+)\b')
def archival_to_version(data):
trace('data', data)
versions = tags_to_versions(tag_re.findall(data.get('ref-names... | Update to support python 3. | Update to support python 3. | Python | mit | Changaco/setuptools_scm_git_archive | from os.path import join
import re
from setuptools_scm.utils import data_from_mime, trace
from setuptools_scm.version import meta, tags_to_versions
tag_re = re.compile(r'(?<=\btag: )([^,]+)\b')
def archival_to_version(data):
trace('data', data)
versions = tags_to_versions(tag_re.findall(data.get('ref-names... | from os.path import join
import re
from setuptools_scm.utils import data_from_mime, trace
from setuptools_scm.version import meta, tags_to_versions
tag_re = re.compile(r'(?<=\btag: )([^,]+)\b')
def archival_to_version(data):
trace('data', data)
versions = tags_to_versions(tag_re.findall(data.get('ref-names... | <commit_before>from os.path import join
import re
from setuptools_scm.utils import data_from_mime, trace
from setuptools_scm.version import meta, tags_to_versions
tag_re = re.compile(r'(?<=\btag: )([^,]+)\b')
def archival_to_version(data):
trace('data', data)
versions = tags_to_versions(tag_re.findall(data... | from os.path import join
import re
from setuptools_scm.utils import data_from_mime, trace
from setuptools_scm.version import meta, tags_to_versions
tag_re = re.compile(r'(?<=\btag: )([^,]+)\b')
def archival_to_version(data):
trace('data', data)
versions = tags_to_versions(tag_re.findall(data.get('ref-names... | from os.path import join
import re
from setuptools_scm.utils import data_from_mime, trace
from setuptools_scm.version import meta, tags_to_versions
tag_re = re.compile(r'(?<=\btag: )([^,]+)\b')
def archival_to_version(data):
trace('data', data)
versions = tags_to_versions(tag_re.findall(data.get('ref-names... | <commit_before>from os.path import join
import re
from setuptools_scm.utils import data_from_mime, trace
from setuptools_scm.version import meta, tags_to_versions
tag_re = re.compile(r'(?<=\btag: )([^,]+)\b')
def archival_to_version(data):
trace('data', data)
versions = tags_to_versions(tag_re.findall(data... |
75606e2b13a29a5d68894eda86dbede8292fb0c8 | website/project/taxonomies/__init__.py | website/project/taxonomies/__init__.py | from modularodm import fields
from framework.mongo import (
ObjectId,
StoredObject,
utils as mongo_utils
)
from website.util import api_v2_url
@mongo_utils.unique_on(['text'])
class Subject(StoredObject):
_id = fields.StringField(primary=True, default=lambda: str(ObjectId()))
text = fields.String... | import pymongo
from modularodm import fields
from framework.mongo import (
ObjectId,
StoredObject,
utils as mongo_utils
)
from website.util import api_v2_url
@mongo_utils.unique_on(['text'])
class Subject(StoredObject):
__indices__ = [
{
'unique': True,
'key_or_list':... | Add unique index on the subject model for @chrisseto | Add unique index on the subject model for @chrisseto
| Python | apache-2.0 | hmoco/osf.io,alexschiller/osf.io,CenterForOpenScience/osf.io,Johnetordoff/osf.io,HalcyonChimera/osf.io,baylee-d/osf.io,aaxelb/osf.io,samchrisinger/osf.io,HalcyonChimera/osf.io,CenterForOpenScience/osf.io,cslzchen/osf.io,cwisecarver/osf.io,Johnetordoff/osf.io,crcresearch/osf.io,chrisseto/osf.io,alexschiller/osf.io,aaxel... | from modularodm import fields
from framework.mongo import (
ObjectId,
StoredObject,
utils as mongo_utils
)
from website.util import api_v2_url
@mongo_utils.unique_on(['text'])
class Subject(StoredObject):
_id = fields.StringField(primary=True, default=lambda: str(ObjectId()))
text = fields.String... | import pymongo
from modularodm import fields
from framework.mongo import (
ObjectId,
StoredObject,
utils as mongo_utils
)
from website.util import api_v2_url
@mongo_utils.unique_on(['text'])
class Subject(StoredObject):
__indices__ = [
{
'unique': True,
'key_or_list':... | <commit_before>from modularodm import fields
from framework.mongo import (
ObjectId,
StoredObject,
utils as mongo_utils
)
from website.util import api_v2_url
@mongo_utils.unique_on(['text'])
class Subject(StoredObject):
_id = fields.StringField(primary=True, default=lambda: str(ObjectId()))
text ... | import pymongo
from modularodm import fields
from framework.mongo import (
ObjectId,
StoredObject,
utils as mongo_utils
)
from website.util import api_v2_url
@mongo_utils.unique_on(['text'])
class Subject(StoredObject):
__indices__ = [
{
'unique': True,
'key_or_list':... | from modularodm import fields
from framework.mongo import (
ObjectId,
StoredObject,
utils as mongo_utils
)
from website.util import api_v2_url
@mongo_utils.unique_on(['text'])
class Subject(StoredObject):
_id = fields.StringField(primary=True, default=lambda: str(ObjectId()))
text = fields.String... | <commit_before>from modularodm import fields
from framework.mongo import (
ObjectId,
StoredObject,
utils as mongo_utils
)
from website.util import api_v2_url
@mongo_utils.unique_on(['text'])
class Subject(StoredObject):
_id = fields.StringField(primary=True, default=lambda: str(ObjectId()))
text ... |
57f8715b8a5ec74efdf5c386226f3e416f7df9e5 | python_practice/numpy_exercise2.py | python_practice/numpy_exercise2.py | import numpy as np
Matrix_A = np.array( [[1,1],[0,1]] )
Matrix_B = np.array( [[2,0],[3,4]] )
print Matrix_A*Matrix_B
print Matrix_A.dot(Matrix_B)
print np.dot(Matrix_A, Matrix_B)
Matrix_C = np.ones((2,3), dtype=int)
Matrix_C *= 3
print Matrix_C
Matrix_D = np.ones((2,3), dtype=int)
print Matrix_C+Matrix_D
| import numpy as np
Matrix_A = np.array( [[1,1],[0,1]] )
Matrix_B = np.array( [[2,0],[3,4]] )
print Matrix_A*Matrix_B
print Matrix_A.dot(Matrix_B)
print np.dot(Matrix_A, Matrix_B)
Matrix_C = np.ones((2,3), dtype=int)
Matrix_C *= 3
print Matrix_C
Matrix_D = np.ones((2,3), dtype=int)
print Matrix_C+Matrix_D
... | Add get the element by col and row | Add get the element by col and row | Python | mit | jeremykid/FunAlgorithm,jeremykid/FunAlgorithm,jeremykid/FunAlgorithm,jeremykid/FunAlgorithm | import numpy as np
Matrix_A = np.array( [[1,1],[0,1]] )
Matrix_B = np.array( [[2,0],[3,4]] )
print Matrix_A*Matrix_B
print Matrix_A.dot(Matrix_B)
print np.dot(Matrix_A, Matrix_B)
Matrix_C = np.ones((2,3), dtype=int)
Matrix_C *= 3
print Matrix_C
Matrix_D = np.ones((2,3), dtype=int)
print Matrix_C+Matrix_D
... | import numpy as np
Matrix_A = np.array( [[1,1],[0,1]] )
Matrix_B = np.array( [[2,0],[3,4]] )
print Matrix_A*Matrix_B
print Matrix_A.dot(Matrix_B)
print np.dot(Matrix_A, Matrix_B)
Matrix_C = np.ones((2,3), dtype=int)
Matrix_C *= 3
print Matrix_C
Matrix_D = np.ones((2,3), dtype=int)
print Matrix_C+Matrix_D
... | <commit_before>import numpy as np
Matrix_A = np.array( [[1,1],[0,1]] )
Matrix_B = np.array( [[2,0],[3,4]] )
print Matrix_A*Matrix_B
print Matrix_A.dot(Matrix_B)
print np.dot(Matrix_A, Matrix_B)
Matrix_C = np.ones((2,3), dtype=int)
Matrix_C *= 3
print Matrix_C
Matrix_D = np.ones((2,3), dtype=int)
print Matr... | import numpy as np
Matrix_A = np.array( [[1,1],[0,1]] )
Matrix_B = np.array( [[2,0],[3,4]] )
print Matrix_A*Matrix_B
print Matrix_A.dot(Matrix_B)
print np.dot(Matrix_A, Matrix_B)
Matrix_C = np.ones((2,3), dtype=int)
Matrix_C *= 3
print Matrix_C
Matrix_D = np.ones((2,3), dtype=int)
print Matrix_C+Matrix_D
... | import numpy as np
Matrix_A = np.array( [[1,1],[0,1]] )
Matrix_B = np.array( [[2,0],[3,4]] )
print Matrix_A*Matrix_B
print Matrix_A.dot(Matrix_B)
print np.dot(Matrix_A, Matrix_B)
Matrix_C = np.ones((2,3), dtype=int)
Matrix_C *= 3
print Matrix_C
Matrix_D = np.ones((2,3), dtype=int)
print Matrix_C+Matrix_D
... | <commit_before>import numpy as np
Matrix_A = np.array( [[1,1],[0,1]] )
Matrix_B = np.array( [[2,0],[3,4]] )
print Matrix_A*Matrix_B
print Matrix_A.dot(Matrix_B)
print np.dot(Matrix_A, Matrix_B)
Matrix_C = np.ones((2,3), dtype=int)
Matrix_C *= 3
print Matrix_C
Matrix_D = np.ones((2,3), dtype=int)
print Matr... |
98c1875d544cd3287b1df91f6216f57d09b93bdc | waterbutler/tasks/move.py | waterbutler/tasks/move.py | import asyncio
from waterbutler.core import utils
from waterbutler.tasks import core
from waterbutler.tasks import settings
@core.celery_task
def move(src_bundle, dest_bundle):
src_args, src_provider = src_bundle.pop('args'), utils.make_provider(**src_bundle.pop('provider'))
dest_args, dest_provider = dest_bu... | import os
import time
from waterbutler.core import utils
from waterbutler.tasks import core
@core.celery_task
def move(src_bundle, dest_bundle, callback_url, auth):
src_args, src_provider = src_bundle.pop('args'), utils.make_provider(**src_bundle.pop('provider'))
dest_args, dest_provider = dest_bundle.pop('ar... | Send callback when finished moving | Send callback when finished moving
| Python | apache-2.0 | rafaeldelucena/waterbutler,icereval/waterbutler,hmoco/waterbutler,RCOSDP/waterbutler,TomBaxter/waterbutler,Ghalko/waterbutler,chrisseto/waterbutler,Johnetordoff/waterbutler,cosenal/waterbutler,felliott/waterbutler,CenterForOpenScience/waterbutler,rdhyee/waterbutler,kwierman/waterbutler | import asyncio
from waterbutler.core import utils
from waterbutler.tasks import core
from waterbutler.tasks import settings
@core.celery_task
def move(src_bundle, dest_bundle):
src_args, src_provider = src_bundle.pop('args'), utils.make_provider(**src_bundle.pop('provider'))
dest_args, dest_provider = dest_bu... | import os
import time
from waterbutler.core import utils
from waterbutler.tasks import core
@core.celery_task
def move(src_bundle, dest_bundle, callback_url, auth):
src_args, src_provider = src_bundle.pop('args'), utils.make_provider(**src_bundle.pop('provider'))
dest_args, dest_provider = dest_bundle.pop('ar... | <commit_before>import asyncio
from waterbutler.core import utils
from waterbutler.tasks import core
from waterbutler.tasks import settings
@core.celery_task
def move(src_bundle, dest_bundle):
src_args, src_provider = src_bundle.pop('args'), utils.make_provider(**src_bundle.pop('provider'))
dest_args, dest_pro... | import os
import time
from waterbutler.core import utils
from waterbutler.tasks import core
@core.celery_task
def move(src_bundle, dest_bundle, callback_url, auth):
src_args, src_provider = src_bundle.pop('args'), utils.make_provider(**src_bundle.pop('provider'))
dest_args, dest_provider = dest_bundle.pop('ar... | import asyncio
from waterbutler.core import utils
from waterbutler.tasks import core
from waterbutler.tasks import settings
@core.celery_task
def move(src_bundle, dest_bundle):
src_args, src_provider = src_bundle.pop('args'), utils.make_provider(**src_bundle.pop('provider'))
dest_args, dest_provider = dest_bu... | <commit_before>import asyncio
from waterbutler.core import utils
from waterbutler.tasks import core
from waterbutler.tasks import settings
@core.celery_task
def move(src_bundle, dest_bundle):
src_args, src_provider = src_bundle.pop('args'), utils.make_provider(**src_bundle.pop('provider'))
dest_args, dest_pro... |
2539f8adbe2b7deed2974c4245fd8087a8f05e65 | wluopensource/osl_comments/models.py | wluopensource/osl_comments/models.py | from django.contrib.comments.models import Comment
from django.db import models
class OslComment(Comment):
parent_comment = models.ForeignKey(Comment, blank=True, null=True, related_name='parent_comment')
inline_to_object = models.BooleanField()
edit_timestamp = models.DateTimeField(auto_now=True)
| from django.contrib.comments.models import Comment
from django.contrib.comments.signals import comment_was_posted
from django.db import models
class OslComment(Comment):
parent_comment = models.ForeignKey(Comment, blank=True, null=True, related_name='parent_comment')
inline_to_object = models.BooleanField()
... | Use signals to add authenticated user URL to comment when posted | Use signals to add authenticated user URL to comment when posted
| Python | bsd-3-clause | jeffcharles/Open-Source-at-Laurier-Website,jeffcharles/Open-Source-at-Laurier-Website,jeffcharles/Open-Source-at-Laurier-Website,jeffcharles/Open-Source-at-Laurier-Website | from django.contrib.comments.models import Comment
from django.db import models
class OslComment(Comment):
parent_comment = models.ForeignKey(Comment, blank=True, null=True, related_name='parent_comment')
inline_to_object = models.BooleanField()
edit_timestamp = models.DateTimeField(auto_now=True)
Use sig... | from django.contrib.comments.models import Comment
from django.contrib.comments.signals import comment_was_posted
from django.db import models
class OslComment(Comment):
parent_comment = models.ForeignKey(Comment, blank=True, null=True, related_name='parent_comment')
inline_to_object = models.BooleanField()
... | <commit_before>from django.contrib.comments.models import Comment
from django.db import models
class OslComment(Comment):
parent_comment = models.ForeignKey(Comment, blank=True, null=True, related_name='parent_comment')
inline_to_object = models.BooleanField()
edit_timestamp = models.DateTimeField(auto_now... | from django.contrib.comments.models import Comment
from django.contrib.comments.signals import comment_was_posted
from django.db import models
class OslComment(Comment):
parent_comment = models.ForeignKey(Comment, blank=True, null=True, related_name='parent_comment')
inline_to_object = models.BooleanField()
... | from django.contrib.comments.models import Comment
from django.db import models
class OslComment(Comment):
parent_comment = models.ForeignKey(Comment, blank=True, null=True, related_name='parent_comment')
inline_to_object = models.BooleanField()
edit_timestamp = models.DateTimeField(auto_now=True)
Use sig... | <commit_before>from django.contrib.comments.models import Comment
from django.db import models
class OslComment(Comment):
parent_comment = models.ForeignKey(Comment, blank=True, null=True, related_name='parent_comment')
inline_to_object = models.BooleanField()
edit_timestamp = models.DateTimeField(auto_now... |
bdb939e548afd96bfefacdecbec5e96541568053 | app/__init__.py | app/__init__.py | from flask import Flask
import base64
import json
from config import config as configs
from flask.ext.elasticsearch import FlaskElasticsearch
from dmutils import init_app, flask_featureflags
feature_flags = flask_featureflags.FeatureFlag()
elasticsearch_client = FlaskElasticsearch()
def create_app(config_name):
... | from flask import Flask
import base64
import json
from config import config as configs
from flask.ext.elasticsearch import FlaskElasticsearch
from dmutils import init_app, flask_featureflags
feature_flags = flask_featureflags.FeatureFlag()
elasticsearch_client = FlaskElasticsearch()
def create_app(config_name):
... | Use multiple ES host uris field from PaaS config | Use multiple ES host uris field from PaaS config
| Python | mit | alphagov/digitalmarketplace-search-api,alphagov/digitalmarketplace-search-api | from flask import Flask
import base64
import json
from config import config as configs
from flask.ext.elasticsearch import FlaskElasticsearch
from dmutils import init_app, flask_featureflags
feature_flags = flask_featureflags.FeatureFlag()
elasticsearch_client = FlaskElasticsearch()
def create_app(config_name):
... | from flask import Flask
import base64
import json
from config import config as configs
from flask.ext.elasticsearch import FlaskElasticsearch
from dmutils import init_app, flask_featureflags
feature_flags = flask_featureflags.FeatureFlag()
elasticsearch_client = FlaskElasticsearch()
def create_app(config_name):
... | <commit_before>from flask import Flask
import base64
import json
from config import config as configs
from flask.ext.elasticsearch import FlaskElasticsearch
from dmutils import init_app, flask_featureflags
feature_flags = flask_featureflags.FeatureFlag()
elasticsearch_client = FlaskElasticsearch()
def create_app(con... | from flask import Flask
import base64
import json
from config import config as configs
from flask.ext.elasticsearch import FlaskElasticsearch
from dmutils import init_app, flask_featureflags
feature_flags = flask_featureflags.FeatureFlag()
elasticsearch_client = FlaskElasticsearch()
def create_app(config_name):
... | from flask import Flask
import base64
import json
from config import config as configs
from flask.ext.elasticsearch import FlaskElasticsearch
from dmutils import init_app, flask_featureflags
feature_flags = flask_featureflags.FeatureFlag()
elasticsearch_client = FlaskElasticsearch()
def create_app(config_name):
... | <commit_before>from flask import Flask
import base64
import json
from config import config as configs
from flask.ext.elasticsearch import FlaskElasticsearch
from dmutils import init_app, flask_featureflags
feature_flags = flask_featureflags.FeatureFlag()
elasticsearch_client = FlaskElasticsearch()
def create_app(con... |
3ed06913ab26b44f133ef2e91ea2f626af72c996 | comics/comics/gucomics.py | comics/comics/gucomics.py | from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = 'GU Comics'
language = 'en'
url = 'http://www.gucomics.com/'
start_date = '2000-07-10'
rights = 'Woody Hearn'
class Crawler(CrawlerBase):
hi... | from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = 'GU Comics'
language = 'en'
url = 'http://www.gucomics.com/'
start_date = '2000-07-10'
rights = 'Woody Hearn'
class Crawler(CrawlerBase):
hi... | Split line to avoid flake8 warning | Split line to avoid flake8 warning
| Python | agpl-3.0 | datagutten/comics,jodal/comics,datagutten/comics,jodal/comics,jodal/comics,datagutten/comics,datagutten/comics,jodal/comics | from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = 'GU Comics'
language = 'en'
url = 'http://www.gucomics.com/'
start_date = '2000-07-10'
rights = 'Woody Hearn'
class Crawler(CrawlerBase):
hi... | from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = 'GU Comics'
language = 'en'
url = 'http://www.gucomics.com/'
start_date = '2000-07-10'
rights = 'Woody Hearn'
class Crawler(CrawlerBase):
hi... | <commit_before>from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = 'GU Comics'
language = 'en'
url = 'http://www.gucomics.com/'
start_date = '2000-07-10'
rights = 'Woody Hearn'
class Crawler(Crawl... | from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = 'GU Comics'
language = 'en'
url = 'http://www.gucomics.com/'
start_date = '2000-07-10'
rights = 'Woody Hearn'
class Crawler(CrawlerBase):
hi... | from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = 'GU Comics'
language = 'en'
url = 'http://www.gucomics.com/'
start_date = '2000-07-10'
rights = 'Woody Hearn'
class Crawler(CrawlerBase):
hi... | <commit_before>from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = 'GU Comics'
language = 'en'
url = 'http://www.gucomics.com/'
start_date = '2000-07-10'
rights = 'Woody Hearn'
class Crawler(Crawl... |
9742d86c802bc16759fdb6bc0de6c46eb316d01d | Lib/xml/__init__.py | Lib/xml/__init__.py | """Core XML support for Python.
This package contains three sub-packages:
dom -- The W3C Document Object Model. This supports DOM Level 1 +
Namespaces.
parsers -- Python wrappers for XML parsers (currently only supports Expat).
sax -- The Simple API for XML, developed by XML-Dev, led by David
Meggins... | """Core XML support for Python.
This package contains three sub-packages:
dom -- The W3C Document Object Model. This supports DOM Level 1 +
Namespaces.
parsers -- Python wrappers for XML parsers (currently only supports Expat).
sax -- The Simple API for XML, developed by XML-Dev, led by David
Meggins... | Use the string module instead of string methods; this should still work with Python 1.5.2 for now. | Use the string module instead of string methods; this should still work
with Python 1.5.2 for now.
| Python | mit | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | """Core XML support for Python.
This package contains three sub-packages:
dom -- The W3C Document Object Model. This supports DOM Level 1 +
Namespaces.
parsers -- Python wrappers for XML parsers (currently only supports Expat).
sax -- The Simple API for XML, developed by XML-Dev, led by David
Meggins... | """Core XML support for Python.
This package contains three sub-packages:
dom -- The W3C Document Object Model. This supports DOM Level 1 +
Namespaces.
parsers -- Python wrappers for XML parsers (currently only supports Expat).
sax -- The Simple API for XML, developed by XML-Dev, led by David
Meggins... | <commit_before>"""Core XML support for Python.
This package contains three sub-packages:
dom -- The W3C Document Object Model. This supports DOM Level 1 +
Namespaces.
parsers -- Python wrappers for XML parsers (currently only supports Expat).
sax -- The Simple API for XML, developed by XML-Dev, led by David... | """Core XML support for Python.
This package contains three sub-packages:
dom -- The W3C Document Object Model. This supports DOM Level 1 +
Namespaces.
parsers -- Python wrappers for XML parsers (currently only supports Expat).
sax -- The Simple API for XML, developed by XML-Dev, led by David
Meggins... | """Core XML support for Python.
This package contains three sub-packages:
dom -- The W3C Document Object Model. This supports DOM Level 1 +
Namespaces.
parsers -- Python wrappers for XML parsers (currently only supports Expat).
sax -- The Simple API for XML, developed by XML-Dev, led by David
Meggins... | <commit_before>"""Core XML support for Python.
This package contains three sub-packages:
dom -- The W3C Document Object Model. This supports DOM Level 1 +
Namespaces.
parsers -- Python wrappers for XML parsers (currently only supports Expat).
sax -- The Simple API for XML, developed by XML-Dev, led by David... |
28d4538e02d66d06fcba1d386b506502c7bad4a0 | bakery/views.py | bakery/views.py | # -*- coding: utf-8 -*-
from django.views.generic import ListView, TemplateView
from bakery.cookies.models import Cookie
class HomeView(ListView):
model = Cookie
template_name = 'home.html'
home = HomeView.as_view()
class StylesView(TemplateView):
template_name = 'styles.html'
styles = StylesView.as... | # -*- coding: utf-8 -*-
from django.db.models import Q
from django.views.generic import ListView, TemplateView
from bakery.cookies.models import Cookie
class HomeView(ListView):
model = Cookie
template_name = 'home.html'
def get_queryset(self):
queryset = super(HomeView, self).get_queryset()
... | Integrate search in home view | Integrate search in home view
| Python | bsd-3-clause | muffins-on-dope/bakery,muffins-on-dope/bakery,muffins-on-dope/bakery | # -*- coding: utf-8 -*-
from django.views.generic import ListView, TemplateView
from bakery.cookies.models import Cookie
class HomeView(ListView):
model = Cookie
template_name = 'home.html'
home = HomeView.as_view()
class StylesView(TemplateView):
template_name = 'styles.html'
styles = StylesView.as... | # -*- coding: utf-8 -*-
from django.db.models import Q
from django.views.generic import ListView, TemplateView
from bakery.cookies.models import Cookie
class HomeView(ListView):
model = Cookie
template_name = 'home.html'
def get_queryset(self):
queryset = super(HomeView, self).get_queryset()
... | <commit_before># -*- coding: utf-8 -*-
from django.views.generic import ListView, TemplateView
from bakery.cookies.models import Cookie
class HomeView(ListView):
model = Cookie
template_name = 'home.html'
home = HomeView.as_view()
class StylesView(TemplateView):
template_name = 'styles.html'
styles ... | # -*- coding: utf-8 -*-
from django.db.models import Q
from django.views.generic import ListView, TemplateView
from bakery.cookies.models import Cookie
class HomeView(ListView):
model = Cookie
template_name = 'home.html'
def get_queryset(self):
queryset = super(HomeView, self).get_queryset()
... | # -*- coding: utf-8 -*-
from django.views.generic import ListView, TemplateView
from bakery.cookies.models import Cookie
class HomeView(ListView):
model = Cookie
template_name = 'home.html'
home = HomeView.as_view()
class StylesView(TemplateView):
template_name = 'styles.html'
styles = StylesView.as... | <commit_before># -*- coding: utf-8 -*-
from django.views.generic import ListView, TemplateView
from bakery.cookies.models import Cookie
class HomeView(ListView):
model = Cookie
template_name = 'home.html'
home = HomeView.as_view()
class StylesView(TemplateView):
template_name = 'styles.html'
styles ... |
9252a0d7d86b911271bda78ecbf2c99129a1564b | blog/admin.py | blog/admin.py | from django.contrib import admin
from .models import Post
class PostAdmin(admin.ModelAdmin):
list_display = (
'title',
'slug',
'event',
'created_at',
'updated_at',
'author',
'is_sponsored',
)
search_fields = ('title', 'lead', 'body')
list_filter... | from django.contrib import admin
from .models import Post
class PostAdmin(admin.ModelAdmin):
list_display = (
'title',
'slug',
'event',
'created_at',
'updated_at',
'author',
'is_sponsored',
)
search_fields = ('title', 'lead', 'body')
list_filter... | Add event field when editing posts | Add event field when editing posts
| Python | bsd-3-clause | WebCampZg/conference-web,WebCampZg/conference-web,WebCampZg/conference-web | from django.contrib import admin
from .models import Post
class PostAdmin(admin.ModelAdmin):
list_display = (
'title',
'slug',
'event',
'created_at',
'updated_at',
'author',
'is_sponsored',
)
search_fields = ('title', 'lead', 'body')
list_filter... | from django.contrib import admin
from .models import Post
class PostAdmin(admin.ModelAdmin):
list_display = (
'title',
'slug',
'event',
'created_at',
'updated_at',
'author',
'is_sponsored',
)
search_fields = ('title', 'lead', 'body')
list_filter... | <commit_before>from django.contrib import admin
from .models import Post
class PostAdmin(admin.ModelAdmin):
list_display = (
'title',
'slug',
'event',
'created_at',
'updated_at',
'author',
'is_sponsored',
)
search_fields = ('title', 'lead', 'body')
... | from django.contrib import admin
from .models import Post
class PostAdmin(admin.ModelAdmin):
list_display = (
'title',
'slug',
'event',
'created_at',
'updated_at',
'author',
'is_sponsored',
)
search_fields = ('title', 'lead', 'body')
list_filter... | from django.contrib import admin
from .models import Post
class PostAdmin(admin.ModelAdmin):
list_display = (
'title',
'slug',
'event',
'created_at',
'updated_at',
'author',
'is_sponsored',
)
search_fields = ('title', 'lead', 'body')
list_filter... | <commit_before>from django.contrib import admin
from .models import Post
class PostAdmin(admin.ModelAdmin):
list_display = (
'title',
'slug',
'event',
'created_at',
'updated_at',
'author',
'is_sponsored',
)
search_fields = ('title', 'lead', 'body')
... |
47132cda83dcb26b7d94b5631ba145d925f05da3 | test/test_commonsdowloader.py | test/test_commonsdowloader.py | #!/usr/bin/env python
# -*- coding: latin-1 -*-
"""Unit tests."""
import unittest
import commonsdownloader
class TestCommonsDownloader(unittest.TestCase):
"""Testing methods from commonsdownloader."""
def test_clean_up_filename(self):
"""Test clean_up_filename."""
values = [('Example.jpg',... | #!/usr/bin/env python
# -*- coding: latin-1 -*-
"""Unit tests."""
import unittest
import commonsdownloader
class TestCommonsDownloader(unittest.TestCase):
"""Testing methods from commonsdownloader."""
def test_clean_up_filename(self):
"""Test clean_up_filename."""
values = [('Example.jpg',... | Add unit test for make_thumb_url() | Add unit test for make_thumb_url()
| Python | mit | Commonists/CommonsDownloader | #!/usr/bin/env python
# -*- coding: latin-1 -*-
"""Unit tests."""
import unittest
import commonsdownloader
class TestCommonsDownloader(unittest.TestCase):
"""Testing methods from commonsdownloader."""
def test_clean_up_filename(self):
"""Test clean_up_filename."""
values = [('Example.jpg',... | #!/usr/bin/env python
# -*- coding: latin-1 -*-
"""Unit tests."""
import unittest
import commonsdownloader
class TestCommonsDownloader(unittest.TestCase):
"""Testing methods from commonsdownloader."""
def test_clean_up_filename(self):
"""Test clean_up_filename."""
values = [('Example.jpg',... | <commit_before>#!/usr/bin/env python
# -*- coding: latin-1 -*-
"""Unit tests."""
import unittest
import commonsdownloader
class TestCommonsDownloader(unittest.TestCase):
"""Testing methods from commonsdownloader."""
def test_clean_up_filename(self):
"""Test clean_up_filename."""
values = [... | #!/usr/bin/env python
# -*- coding: latin-1 -*-
"""Unit tests."""
import unittest
import commonsdownloader
class TestCommonsDownloader(unittest.TestCase):
"""Testing methods from commonsdownloader."""
def test_clean_up_filename(self):
"""Test clean_up_filename."""
values = [('Example.jpg',... | #!/usr/bin/env python
# -*- coding: latin-1 -*-
"""Unit tests."""
import unittest
import commonsdownloader
class TestCommonsDownloader(unittest.TestCase):
"""Testing methods from commonsdownloader."""
def test_clean_up_filename(self):
"""Test clean_up_filename."""
values = [('Example.jpg',... | <commit_before>#!/usr/bin/env python
# -*- coding: latin-1 -*-
"""Unit tests."""
import unittest
import commonsdownloader
class TestCommonsDownloader(unittest.TestCase):
"""Testing methods from commonsdownloader."""
def test_clean_up_filename(self):
"""Test clean_up_filename."""
values = [... |
47b4779b82035d0478985c85c3e7e95581ef8efe | CodeFights/arrayPacking.py | CodeFights/arrayPacking.py | #!/usr/local/bin/python
# Code Fights Are Equally Strong Problem
def arrayPacking():
pass
def main():
tests = [
[],
[]
]
for t in tests:
res = arrayPacking(t[0])
if t[1] == res:
print("PASSED: arrayPacking({}) returned {}"
.format(t[0], ... | #!/usr/local/bin/python
# Code Fights Array Packing (Core) Problem
def arrayPacking(a):
return sum([n << 8*i for i, n in enumerate(a)])
def main():
tests = [
[[24, 85, 0], 21784],
[[23, 45, 39], 2567447]
]
for t in tests:
res = arrayPacking(t[0])
if t[1] == res:
... | Solve Code Fights array packing problem | Solve Code Fights array packing problem
| Python | mit | HKuz/Test_Code | #!/usr/local/bin/python
# Code Fights Are Equally Strong Problem
def arrayPacking():
pass
def main():
tests = [
[],
[]
]
for t in tests:
res = arrayPacking(t[0])
if t[1] == res:
print("PASSED: arrayPacking({}) returned {}"
.format(t[0], ... | #!/usr/local/bin/python
# Code Fights Array Packing (Core) Problem
def arrayPacking(a):
return sum([n << 8*i for i, n in enumerate(a)])
def main():
tests = [
[[24, 85, 0], 21784],
[[23, 45, 39], 2567447]
]
for t in tests:
res = arrayPacking(t[0])
if t[1] == res:
... | <commit_before>#!/usr/local/bin/python
# Code Fights Are Equally Strong Problem
def arrayPacking():
pass
def main():
tests = [
[],
[]
]
for t in tests:
res = arrayPacking(t[0])
if t[1] == res:
print("PASSED: arrayPacking({}) returned {}"
... | #!/usr/local/bin/python
# Code Fights Array Packing (Core) Problem
def arrayPacking(a):
return sum([n << 8*i for i, n in enumerate(a)])
def main():
tests = [
[[24, 85, 0], 21784],
[[23, 45, 39], 2567447]
]
for t in tests:
res = arrayPacking(t[0])
if t[1] == res:
... | #!/usr/local/bin/python
# Code Fights Are Equally Strong Problem
def arrayPacking():
pass
def main():
tests = [
[],
[]
]
for t in tests:
res = arrayPacking(t[0])
if t[1] == res:
print("PASSED: arrayPacking({}) returned {}"
.format(t[0], ... | <commit_before>#!/usr/local/bin/python
# Code Fights Are Equally Strong Problem
def arrayPacking():
pass
def main():
tests = [
[],
[]
]
for t in tests:
res = arrayPacking(t[0])
if t[1] == res:
print("PASSED: arrayPacking({}) returned {}"
... |
27e79e49af76a0f981f54c1ac2b88ad409bacb95 | xie/graphics/utils.py | xie/graphics/utils.py | class TextCodec:
def __init__(self):
pass
def encodeStartPoint(self, p):
return "0000{0[0]:02X}{0[1]:02X}".format(p)
def encodeEndPoint(self, p):
return "0001{0[0]:02X}{0[1]:02X}".format(p)
def encodeControlPoint(self, p):
return "0002{0[0]:02X}{0[1]:02X}".format(p)
def encodeStrokeExpression(self, poi... | class TextCodec:
def __init__(self):
pass
def encodeStartPoint(self, p):
return "0{0[0]:02X}{0[1]:02X}".format(p)
def encodeEndPoint(self, p):
return "1{0[0]:02X}{0[1]:02X}".format(p)
def encodeControlPoint(self, p):
return "2{0[0]:02X}{0[1]:02X}".format(p)
def encodeStrokeExpression(self, pointExpress... | Change the text format for drawing a stroke. To use 5 digits but not 8 digits to present a point. | Change the text format for drawing a stroke. To use 5 digits but not 8 digits to present a point.
| Python | apache-2.0 | xrloong/Xie | class TextCodec:
def __init__(self):
pass
def encodeStartPoint(self, p):
return "0000{0[0]:02X}{0[1]:02X}".format(p)
def encodeEndPoint(self, p):
return "0001{0[0]:02X}{0[1]:02X}".format(p)
def encodeControlPoint(self, p):
return "0002{0[0]:02X}{0[1]:02X}".format(p)
def encodeStrokeExpression(self, poi... | class TextCodec:
def __init__(self):
pass
def encodeStartPoint(self, p):
return "0{0[0]:02X}{0[1]:02X}".format(p)
def encodeEndPoint(self, p):
return "1{0[0]:02X}{0[1]:02X}".format(p)
def encodeControlPoint(self, p):
return "2{0[0]:02X}{0[1]:02X}".format(p)
def encodeStrokeExpression(self, pointExpress... | <commit_before>class TextCodec:
def __init__(self):
pass
def encodeStartPoint(self, p):
return "0000{0[0]:02X}{0[1]:02X}".format(p)
def encodeEndPoint(self, p):
return "0001{0[0]:02X}{0[1]:02X}".format(p)
def encodeControlPoint(self, p):
return "0002{0[0]:02X}{0[1]:02X}".format(p)
def encodeStrokeExpre... | class TextCodec:
def __init__(self):
pass
def encodeStartPoint(self, p):
return "0{0[0]:02X}{0[1]:02X}".format(p)
def encodeEndPoint(self, p):
return "1{0[0]:02X}{0[1]:02X}".format(p)
def encodeControlPoint(self, p):
return "2{0[0]:02X}{0[1]:02X}".format(p)
def encodeStrokeExpression(self, pointExpress... | class TextCodec:
def __init__(self):
pass
def encodeStartPoint(self, p):
return "0000{0[0]:02X}{0[1]:02X}".format(p)
def encodeEndPoint(self, p):
return "0001{0[0]:02X}{0[1]:02X}".format(p)
def encodeControlPoint(self, p):
return "0002{0[0]:02X}{0[1]:02X}".format(p)
def encodeStrokeExpression(self, poi... | <commit_before>class TextCodec:
def __init__(self):
pass
def encodeStartPoint(self, p):
return "0000{0[0]:02X}{0[1]:02X}".format(p)
def encodeEndPoint(self, p):
return "0001{0[0]:02X}{0[1]:02X}".format(p)
def encodeControlPoint(self, p):
return "0002{0[0]:02X}{0[1]:02X}".format(p)
def encodeStrokeExpre... |
f279d22072e853332c3fba60ad6e98fbeb4f35b8 | untappd/untappd_object.py | untappd/untappd_object.py |
class _NotSetType:
def __repr__(self):
return "NotSet" # pragma no cover
NotSet = _NotSetType()
class BasicUntappdObject(object):
def __init__(self, attributes):
self._init_attributes()
self._setup_attributes(attributes)
class UntappdObject(BasicUntappdObject):
pass | #TODO do we want to set a base object for untappd objects? do they share enough
# qualities to need a shared type?
class _NotSetType:
def __repr__(self):
return "NotSet" # pragma no cover
NotSet = _NotSetType()
class BasicUntappdObject(object):
def __init__(self, attributes):
self._init_attributes()
... | Add a few design comments. | Add a few design comments.
| Python | mit | adamomfg/pytappd |
class _NotSetType:
def __repr__(self):
return "NotSet" # pragma no cover
NotSet = _NotSetType()
class BasicUntappdObject(object):
def __init__(self, attributes):
self._init_attributes()
self._setup_attributes(attributes)
class UntappdObject(BasicUntappdObject):
passAdd a fe... | #TODO do we want to set a base object for untappd objects? do they share enough
# qualities to need a shared type?
class _NotSetType:
def __repr__(self):
return "NotSet" # pragma no cover
NotSet = _NotSetType()
class BasicUntappdObject(object):
def __init__(self, attributes):
self._init_attributes()
... | <commit_before>
class _NotSetType:
def __repr__(self):
return "NotSet" # pragma no cover
NotSet = _NotSetType()
class BasicUntappdObject(object):
def __init__(self, attributes):
self._init_attributes()
self._setup_attributes(attributes)
class UntappdObject(BasicUntappdObject):
... | #TODO do we want to set a base object for untappd objects? do they share enough
# qualities to need a shared type?
class _NotSetType:
def __repr__(self):
return "NotSet" # pragma no cover
NotSet = _NotSetType()
class BasicUntappdObject(object):
def __init__(self, attributes):
self._init_attributes()
... |
class _NotSetType:
def __repr__(self):
return "NotSet" # pragma no cover
NotSet = _NotSetType()
class BasicUntappdObject(object):
def __init__(self, attributes):
self._init_attributes()
self._setup_attributes(attributes)
class UntappdObject(BasicUntappdObject):
passAdd a fe... | <commit_before>
class _NotSetType:
def __repr__(self):
return "NotSet" # pragma no cover
NotSet = _NotSetType()
class BasicUntappdObject(object):
def __init__(self, attributes):
self._init_attributes()
self._setup_attributes(attributes)
class UntappdObject(BasicUntappdObject):
... |
7d70d97ebbf5c901b1be1071ed6a0d8d350b53c0 | appengine/swarming/swarming_bot/api/__init__.py | appengine/swarming/swarming_bot/api/__init__.py | # Copyright 2016 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
__version__ = '1.0.0'
| Add __version__ to Swarming bot 'api' package. | Add __version__ to Swarming bot 'api' package.
It will simplify making bot_config.py hooks work with different versions of
bot code (e.g. when deploying changes to bot API).
[email protected]
BUG=
Review-Url: https://codereview.chromium.org/2270113002
| Python | apache-2.0 | luci/luci-py,luci/luci-py,luci/luci-py,luci/luci-py | Add __version__ to Swarming bot 'api' package.
It will simplify making bot_config.py hooks work with different versions of
bot code (e.g. when deploying changes to bot API).
[email protected]
BUG=
Review-Url: https://codereview.chromium.org/2270113002 | # Copyright 2016 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
__version__ = '1.0.0'
| <commit_before><commit_msg>Add __version__ to Swarming bot 'api' package.
It will simplify making bot_config.py hooks work with different versions of
bot code (e.g. when deploying changes to bot API).
[email protected]
BUG=
Review-Url: https://codereview.chromium.org/2270113002<commit_after> | # Copyright 2016 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
__version__ = '1.0.0'
| Add __version__ to Swarming bot 'api' package.
It will simplify making bot_config.py hooks work with different versions of
bot code (e.g. when deploying changes to bot API).
[email protected]
BUG=
Review-Url: https://codereview.chromium.org/2270113002# Copyright 2016 The LUCI Authors. All rights reserved.
# Use ... | <commit_before><commit_msg>Add __version__ to Swarming bot 'api' package.
It will simplify making bot_config.py hooks work with different versions of
bot code (e.g. when deploying changes to bot API).
[email protected]
BUG=
Review-Url: https://codereview.chromium.org/2270113002<commit_after># Copyright 2016 The ... | |
42a459dc41cee9ea48f7e332c022643102e05355 | applications/pagefetch_project/configuration.py | applications/pagefetch_project/configuration.py | __author__ = 'leif'
import os
PROJ_PATH = os.getcwd()
print "Project Path: %s" % (PROJ_PATH)
GAME_DB = os.path.join(PROJ_PATH,'game.db')
TEMP_PATH = os.path.join(PROJ_PATH,'templates')
STATIC_PATH = os.path.join(PROJ_PATH,'static')
MEDIA_PATH = os.path.join(PROJ_PATH,'media')
MEDIA_URL = '/media/'
UPLOAD_DIR = os.pat... | __author__ = 'leif'
import os
PROJ_PATH = os.getcwd()
print "Project Path: %s" % (PROJ_PATH)
GAME_DB = os.path.join(PROJ_PATH,'game.db')
TEMP_PATH = os.path.join(PROJ_PATH,'templates')
STATIC_PATH = os.path.join(PROJ_PATH,'static')
MEDIA_PATH = os.path.join('')
MEDIA_URL = '/data/'
#UPLOAD_DIR = os.path.join(PROJ_PAT... | Change to upload paths for images. | Change to upload paths for images.
| Python | mit | leifos/ifind,leifos/ifind | __author__ = 'leif'
import os
PROJ_PATH = os.getcwd()
print "Project Path: %s" % (PROJ_PATH)
GAME_DB = os.path.join(PROJ_PATH,'game.db')
TEMP_PATH = os.path.join(PROJ_PATH,'templates')
STATIC_PATH = os.path.join(PROJ_PATH,'static')
MEDIA_PATH = os.path.join(PROJ_PATH,'media')
MEDIA_URL = '/media/'
UPLOAD_DIR = os.pat... | __author__ = 'leif'
import os
PROJ_PATH = os.getcwd()
print "Project Path: %s" % (PROJ_PATH)
GAME_DB = os.path.join(PROJ_PATH,'game.db')
TEMP_PATH = os.path.join(PROJ_PATH,'templates')
STATIC_PATH = os.path.join(PROJ_PATH,'static')
MEDIA_PATH = os.path.join('')
MEDIA_URL = '/data/'
#UPLOAD_DIR = os.path.join(PROJ_PAT... | <commit_before>__author__ = 'leif'
import os
PROJ_PATH = os.getcwd()
print "Project Path: %s" % (PROJ_PATH)
GAME_DB = os.path.join(PROJ_PATH,'game.db')
TEMP_PATH = os.path.join(PROJ_PATH,'templates')
STATIC_PATH = os.path.join(PROJ_PATH,'static')
MEDIA_PATH = os.path.join(PROJ_PATH,'media')
MEDIA_URL = '/media/'
UPLO... | __author__ = 'leif'
import os
PROJ_PATH = os.getcwd()
print "Project Path: %s" % (PROJ_PATH)
GAME_DB = os.path.join(PROJ_PATH,'game.db')
TEMP_PATH = os.path.join(PROJ_PATH,'templates')
STATIC_PATH = os.path.join(PROJ_PATH,'static')
MEDIA_PATH = os.path.join('')
MEDIA_URL = '/data/'
#UPLOAD_DIR = os.path.join(PROJ_PAT... | __author__ = 'leif'
import os
PROJ_PATH = os.getcwd()
print "Project Path: %s" % (PROJ_PATH)
GAME_DB = os.path.join(PROJ_PATH,'game.db')
TEMP_PATH = os.path.join(PROJ_PATH,'templates')
STATIC_PATH = os.path.join(PROJ_PATH,'static')
MEDIA_PATH = os.path.join(PROJ_PATH,'media')
MEDIA_URL = '/media/'
UPLOAD_DIR = os.pat... | <commit_before>__author__ = 'leif'
import os
PROJ_PATH = os.getcwd()
print "Project Path: %s" % (PROJ_PATH)
GAME_DB = os.path.join(PROJ_PATH,'game.db')
TEMP_PATH = os.path.join(PROJ_PATH,'templates')
STATIC_PATH = os.path.join(PROJ_PATH,'static')
MEDIA_PATH = os.path.join(PROJ_PATH,'media')
MEDIA_URL = '/media/'
UPLO... |
90f1cfb302c5b95243731c3c6688c5c3193b821c | mmd_tools/auto_scene_setup.py | mmd_tools/auto_scene_setup.py | # -*- coding: utf-8 -*-
import bpy
def setupFrameRanges():
s, e = 1, 1
for i in bpy.data.actions:
ts, te = i.frame_range
s = min(s, ts)
e = max(e, te)
bpy.context.scene.frame_start = s
bpy.context.scene.frame_end = e
bpy.context.scene.rigidbody_world.point_cache.frame_start... | # -*- coding: utf-8 -*-
import bpy
def setupFrameRanges():
s, e = 1, 1
for i in bpy.data.actions:
ts, te = i.frame_range
s = min(s, ts)
e = max(e, te)
bpy.context.scene.frame_start = s
bpy.context.scene.frame_end = e
if bpy.context.scene.rigidbody_world is not None:
... | Fix the bug that causes "set frame range" error on a scene that has no rigid body world. | Fix the bug that causes "set frame range" error on a scene that has no rigid body world.
| Python | mit | sugiany/blender_mmd_tools,lordscales91/blender_mmd_tools | # -*- coding: utf-8 -*-
import bpy
def setupFrameRanges():
s, e = 1, 1
for i in bpy.data.actions:
ts, te = i.frame_range
s = min(s, ts)
e = max(e, te)
bpy.context.scene.frame_start = s
bpy.context.scene.frame_end = e
bpy.context.scene.rigidbody_world.point_cache.frame_start... | # -*- coding: utf-8 -*-
import bpy
def setupFrameRanges():
s, e = 1, 1
for i in bpy.data.actions:
ts, te = i.frame_range
s = min(s, ts)
e = max(e, te)
bpy.context.scene.frame_start = s
bpy.context.scene.frame_end = e
if bpy.context.scene.rigidbody_world is not None:
... | <commit_before># -*- coding: utf-8 -*-
import bpy
def setupFrameRanges():
s, e = 1, 1
for i in bpy.data.actions:
ts, te = i.frame_range
s = min(s, ts)
e = max(e, te)
bpy.context.scene.frame_start = s
bpy.context.scene.frame_end = e
bpy.context.scene.rigidbody_world.point_ca... | # -*- coding: utf-8 -*-
import bpy
def setupFrameRanges():
s, e = 1, 1
for i in bpy.data.actions:
ts, te = i.frame_range
s = min(s, ts)
e = max(e, te)
bpy.context.scene.frame_start = s
bpy.context.scene.frame_end = e
if bpy.context.scene.rigidbody_world is not None:
... | # -*- coding: utf-8 -*-
import bpy
def setupFrameRanges():
s, e = 1, 1
for i in bpy.data.actions:
ts, te = i.frame_range
s = min(s, ts)
e = max(e, te)
bpy.context.scene.frame_start = s
bpy.context.scene.frame_end = e
bpy.context.scene.rigidbody_world.point_cache.frame_start... | <commit_before># -*- coding: utf-8 -*-
import bpy
def setupFrameRanges():
s, e = 1, 1
for i in bpy.data.actions:
ts, te = i.frame_range
s = min(s, ts)
e = max(e, te)
bpy.context.scene.frame_start = s
bpy.context.scene.frame_end = e
bpy.context.scene.rigidbody_world.point_ca... |
01ebdc54886f01a9aa58098c8987b0ce7620706a | simplestatistics/statistics/standard_deviation.py | simplestatistics/statistics/standard_deviation.py | import math
from .variance import variance
def standard_deviation(data):
"""
The `standard deviation`_ is the square root of variance_ (the sum of squared deviations
from the mean).
The standard deviation is a commonly used measure of the variation and distance of
a set of values in a sample from t... | import math
from .variance import variance
def standard_deviation(data, sample = True):
"""
The `standard deviation`_ is the square root of variance_ (the sum of squared deviations
from the mean).
The standard deviation is a commonly used measure of the variation and distance of
a set of values in ... | Add sample param to Standard Deviation function | Add sample param to Standard Deviation function
Boolean param to make possible to calculate Standard Deviation
for population (Default is sample).
| Python | unknown | sheriferson/simple-statistics-py,tmcw/simple-statistics-py,sheriferson/simplestatistics | import math
from .variance import variance
def standard_deviation(data):
"""
The `standard deviation`_ is the square root of variance_ (the sum of squared deviations
from the mean).
The standard deviation is a commonly used measure of the variation and distance of
a set of values in a sample from t... | import math
from .variance import variance
def standard_deviation(data, sample = True):
"""
The `standard deviation`_ is the square root of variance_ (the sum of squared deviations
from the mean).
The standard deviation is a commonly used measure of the variation and distance of
a set of values in ... | <commit_before>import math
from .variance import variance
def standard_deviation(data):
"""
The `standard deviation`_ is the square root of variance_ (the sum of squared deviations
from the mean).
The standard deviation is a commonly used measure of the variation and distance of
a set of values in ... | import math
from .variance import variance
def standard_deviation(data, sample = True):
"""
The `standard deviation`_ is the square root of variance_ (the sum of squared deviations
from the mean).
The standard deviation is a commonly used measure of the variation and distance of
a set of values in ... | import math
from .variance import variance
def standard_deviation(data):
"""
The `standard deviation`_ is the square root of variance_ (the sum of squared deviations
from the mean).
The standard deviation is a commonly used measure of the variation and distance of
a set of values in a sample from t... | <commit_before>import math
from .variance import variance
def standard_deviation(data):
"""
The `standard deviation`_ is the square root of variance_ (the sum of squared deviations
from the mean).
The standard deviation is a commonly used measure of the variation and distance of
a set of values in ... |
6f8ef3108e0a13fd4e2d2c9337d5809dfa12b732 | skyfield/api.py | skyfield/api.py | """Top-level objects and functions offered by the Skyfield library.
Importing this ``skyfield.api`` module causes Skyfield to load up the
default JPL planetary ephemeris ``de421`` and create planet objects like
``earth`` and ``mars`` that are ready for your use.
"""
import de421
from datetime import datetime
from .st... | """Top-level objects and functions offered by the Skyfield library.
Importing this ``skyfield.api`` module causes Skyfield to load up the
default JPL planetary ephemeris ``de421`` and create planet objects like
``earth`` and ``mars`` that are ready for your use.
"""
import de421
from datetime import datetime
from .st... | Add T0 to the symbols available through the API | Add T0 to the symbols available through the API
| Python | mit | GuidoBR/python-skyfield,GuidoBR/python-skyfield,skyfielders/python-skyfield,ozialien/python-skyfield,exoanalytic/python-skyfield,ozialien/python-skyfield,skyfielders/python-skyfield,exoanalytic/python-skyfield | """Top-level objects and functions offered by the Skyfield library.
Importing this ``skyfield.api`` module causes Skyfield to load up the
default JPL planetary ephemeris ``de421`` and create planet objects like
``earth`` and ``mars`` that are ready for your use.
"""
import de421
from datetime import datetime
from .st... | """Top-level objects and functions offered by the Skyfield library.
Importing this ``skyfield.api`` module causes Skyfield to load up the
default JPL planetary ephemeris ``de421`` and create planet objects like
``earth`` and ``mars`` that are ready for your use.
"""
import de421
from datetime import datetime
from .st... | <commit_before>"""Top-level objects and functions offered by the Skyfield library.
Importing this ``skyfield.api`` module causes Skyfield to load up the
default JPL planetary ephemeris ``de421`` and create planet objects like
``earth`` and ``mars`` that are ready for your use.
"""
import de421
from datetime import da... | """Top-level objects and functions offered by the Skyfield library.
Importing this ``skyfield.api`` module causes Skyfield to load up the
default JPL planetary ephemeris ``de421`` and create planet objects like
``earth`` and ``mars`` that are ready for your use.
"""
import de421
from datetime import datetime
from .st... | """Top-level objects and functions offered by the Skyfield library.
Importing this ``skyfield.api`` module causes Skyfield to load up the
default JPL planetary ephemeris ``de421`` and create planet objects like
``earth`` and ``mars`` that are ready for your use.
"""
import de421
from datetime import datetime
from .st... | <commit_before>"""Top-level objects and functions offered by the Skyfield library.
Importing this ``skyfield.api`` module causes Skyfield to load up the
default JPL planetary ephemeris ``de421`` and create planet objects like
``earth`` and ``mars`` that are ready for your use.
"""
import de421
from datetime import da... |
e0cd0f9a14ac354f19c4e91367ac75b34d58ae8e | pirx/checks.py | pirx/checks.py | #!/usr/bin/env python
import socket
import sys
def host(name):
return socket.gethostname() == name
def arg(name, expected_value=None):
args = [
arg.split('=') for arg in sys.argv[1:] if '=' in arg else (arg, None)
]
for arg_name, arg_value in args:
if arg_name.lstrip('--') == name:
... | #!/usr/bin/env python
import socket
import sys
def host(name):
"""Check if host name is equal to the given name"""
return socket.gethostname() == name
def arg(name, expected_value=None):
"""
Check if command-line argument with a given name was passed and if it has
the expected value.
"""
... | Set docstrings for check functions | Set docstrings for check functions
| Python | mit | piotrekw/pirx | #!/usr/bin/env python
import socket
import sys
def host(name):
return socket.gethostname() == name
def arg(name, expected_value=None):
args = [
arg.split('=') for arg in sys.argv[1:] if '=' in arg else (arg, None)
]
for arg_name, arg_value in args:
if arg_name.lstrip('--') == name:
... | #!/usr/bin/env python
import socket
import sys
def host(name):
"""Check if host name is equal to the given name"""
return socket.gethostname() == name
def arg(name, expected_value=None):
"""
Check if command-line argument with a given name was passed and if it has
the expected value.
"""
... | <commit_before>#!/usr/bin/env python
import socket
import sys
def host(name):
return socket.gethostname() == name
def arg(name, expected_value=None):
args = [
arg.split('=') for arg in sys.argv[1:] if '=' in arg else (arg, None)
]
for arg_name, arg_value in args:
if arg_name.lstrip('-... | #!/usr/bin/env python
import socket
import sys
def host(name):
"""Check if host name is equal to the given name"""
return socket.gethostname() == name
def arg(name, expected_value=None):
"""
Check if command-line argument with a given name was passed and if it has
the expected value.
"""
... | #!/usr/bin/env python
import socket
import sys
def host(name):
return socket.gethostname() == name
def arg(name, expected_value=None):
args = [
arg.split('=') for arg in sys.argv[1:] if '=' in arg else (arg, None)
]
for arg_name, arg_value in args:
if arg_name.lstrip('--') == name:
... | <commit_before>#!/usr/bin/env python
import socket
import sys
def host(name):
return socket.gethostname() == name
def arg(name, expected_value=None):
args = [
arg.split('=') for arg in sys.argv[1:] if '=' in arg else (arg, None)
]
for arg_name, arg_value in args:
if arg_name.lstrip('-... |
af1df841b3d0c013c0678fa6fb9821b61a9eb87c | policy_evaluation/deterministic.py | policy_evaluation/deterministic.py | from torch.autograd import Variable
class DeterministicPolicy(object):
def __init__(self, policy):
"""Assumes policy returns an autograd.Variable"""
self.name = "DP"
self.policy = policy
self.cuda = next(policy.parameters()).is_cuda
def get_action(self, state):
""" Ta... | from torch.autograd import Variable
class DeterministicPolicy(object):
def __init__(self, policy):
"""Assumes policy returns an autograd.Variable"""
self.name = "DP"
self.policy = policy
self.cuda = next(policy.parameters()).is_cuda
def get_action(self, state):
""" Ta... | Make DQN backward compatible with pytorch 0.1.2. | Make DQN backward compatible with pytorch 0.1.2.
| Python | mit | floringogianu/categorical-dqn | from torch.autograd import Variable
class DeterministicPolicy(object):
def __init__(self, policy):
"""Assumes policy returns an autograd.Variable"""
self.name = "DP"
self.policy = policy
self.cuda = next(policy.parameters()).is_cuda
def get_action(self, state):
""" Ta... | from torch.autograd import Variable
class DeterministicPolicy(object):
def __init__(self, policy):
"""Assumes policy returns an autograd.Variable"""
self.name = "DP"
self.policy = policy
self.cuda = next(policy.parameters()).is_cuda
def get_action(self, state):
""" Ta... | <commit_before>from torch.autograd import Variable
class DeterministicPolicy(object):
def __init__(self, policy):
"""Assumes policy returns an autograd.Variable"""
self.name = "DP"
self.policy = policy
self.cuda = next(policy.parameters()).is_cuda
def get_action(self, state):... | from torch.autograd import Variable
class DeterministicPolicy(object):
def __init__(self, policy):
"""Assumes policy returns an autograd.Variable"""
self.name = "DP"
self.policy = policy
self.cuda = next(policy.parameters()).is_cuda
def get_action(self, state):
""" Ta... | from torch.autograd import Variable
class DeterministicPolicy(object):
def __init__(self, policy):
"""Assumes policy returns an autograd.Variable"""
self.name = "DP"
self.policy = policy
self.cuda = next(policy.parameters()).is_cuda
def get_action(self, state):
""" Ta... | <commit_before>from torch.autograd import Variable
class DeterministicPolicy(object):
def __init__(self, policy):
"""Assumes policy returns an autograd.Variable"""
self.name = "DP"
self.policy = policy
self.cuda = next(policy.parameters()).is_cuda
def get_action(self, state):... |
73b380000ad1ba87169f3a9a7bd219b76109945e | selectable/tests/__init__.py | selectable/tests/__init__.py | from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from ..base import ModelLookup
from ..registry import registry
@python_2_unicode_compatible
class Thing(models.Model):
name = models.CharField(max_length=100)
description = models.CharField(max_length=100)
def __s... | from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from ..base import ModelLookup
from ..registry import registry
@python_2_unicode_compatible
class Thing(models.Model):
name = models.CharField(max_length=100)
description = models.CharField(max_length=100)
def __s... | Fix warning in test suite when running under Django 1.11 | Fix warning in test suite when running under Django 1.11
| Python | bsd-2-clause | mlavin/django-selectable,mlavin/django-selectable,mlavin/django-selectable | from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from ..base import ModelLookup
from ..registry import registry
@python_2_unicode_compatible
class Thing(models.Model):
name = models.CharField(max_length=100)
description = models.CharField(max_length=100)
def __s... | from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from ..base import ModelLookup
from ..registry import registry
@python_2_unicode_compatible
class Thing(models.Model):
name = models.CharField(max_length=100)
description = models.CharField(max_length=100)
def __s... | <commit_before>from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from ..base import ModelLookup
from ..registry import registry
@python_2_unicode_compatible
class Thing(models.Model):
name = models.CharField(max_length=100)
description = models.CharField(max_length=10... | from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from ..base import ModelLookup
from ..registry import registry
@python_2_unicode_compatible
class Thing(models.Model):
name = models.CharField(max_length=100)
description = models.CharField(max_length=100)
def __s... | from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from ..base import ModelLookup
from ..registry import registry
@python_2_unicode_compatible
class Thing(models.Model):
name = models.CharField(max_length=100)
description = models.CharField(max_length=100)
def __s... | <commit_before>from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from ..base import ModelLookup
from ..registry import registry
@python_2_unicode_compatible
class Thing(models.Model):
name = models.CharField(max_length=100)
description = models.CharField(max_length=10... |
3a2ca4573866b7b81d4b946ce87b9f36b487d272 | src/dojo.py | src/dojo.py | class Dojo(object):
def __init__(self):
self.all_rooms = []
self.all_people = []
def create_room(self, room_type, room_name):
pass
| class Dojo(object):
"""This class is responsible for managing and allocating rooms to people"""
def __init__(self):
self.all_rooms = []
self.all_people = []
def create_room(self, room_type, room_name):
pass
| Add docstring to Dojo class | Add docstring to Dojo class
| Python | mit | EdwinKato/Space-Allocator,EdwinKato/Space-Allocator | class Dojo(object):
def __init__(self):
self.all_rooms = []
self.all_people = []
def create_room(self, room_type, room_name):
pass
Add docstring to Dojo class | class Dojo(object):
"""This class is responsible for managing and allocating rooms to people"""
def __init__(self):
self.all_rooms = []
self.all_people = []
def create_room(self, room_type, room_name):
pass
| <commit_before>class Dojo(object):
def __init__(self):
self.all_rooms = []
self.all_people = []
def create_room(self, room_type, room_name):
pass
<commit_msg>Add docstring to Dojo class<commit_after> | class Dojo(object):
"""This class is responsible for managing and allocating rooms to people"""
def __init__(self):
self.all_rooms = []
self.all_people = []
def create_room(self, room_type, room_name):
pass
| class Dojo(object):
def __init__(self):
self.all_rooms = []
self.all_people = []
def create_room(self, room_type, room_name):
pass
Add docstring to Dojo classclass Dojo(object):
"""This class is responsible for managing and allocating rooms to people"""
def __init__(self):
... | <commit_before>class Dojo(object):
def __init__(self):
self.all_rooms = []
self.all_people = []
def create_room(self, room_type, room_name):
pass
<commit_msg>Add docstring to Dojo class<commit_after>class Dojo(object):
"""This class is responsible for managing and allocating room... |
d73379f6ffc82bd8f5d61a80d7f1037a69f5a3dc | yapf/yapflib/py3compat.py | yapf/yapflib/py3compat.py | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | Make the use of quotes consistent. | Make the use of quotes consistent.
| Python | apache-2.0 | abduld/yapf,jamesblunt/yapf,sbc100/yapf,wklken/yapf,google/yapf,sbc100/yapf,thurday/yapf,dmoliveira/yapf,nikolamilosevic86/yapf,bygloam/yapf,lucius-feng/yapf,elviswf/yapf,hayd/yapf,google/yapf,ambv/yapf | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | <commit_before># Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | <commit_before># Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... |
11eac909105ee944ebef38bd23e1f320a8dd1175 | shakespearelang/character.py | shakespearelang/character.py | from .errors import ShakespeareRuntimeError
class Character:
"""A character in an SPL play."""
def __init__(self, name):
self.value = 0
self.stack = []
self.on_stage = False
self.name = name
@classmethod
def from_dramatis_persona(cls, persona):
name = persona.... | from .errors import ShakespeareRuntimeError
from .utils import normalize_name
class Character:
"""A character in an SPL play."""
def __init__(self, name):
self.value = 0
self.stack = []
self.on_stage = False
self.name = name
@classmethod
def from_dramatis_persona(cls,... | Use utils to simplify code | Use utils to simplify code
| Python | mit | zmbc/shakespearelang,zmbc/shakespearelang,zmbc/shakespearelang | from .errors import ShakespeareRuntimeError
class Character:
"""A character in an SPL play."""
def __init__(self, name):
self.value = 0
self.stack = []
self.on_stage = False
self.name = name
@classmethod
def from_dramatis_persona(cls, persona):
name = persona.... | from .errors import ShakespeareRuntimeError
from .utils import normalize_name
class Character:
"""A character in an SPL play."""
def __init__(self, name):
self.value = 0
self.stack = []
self.on_stage = False
self.name = name
@classmethod
def from_dramatis_persona(cls,... | <commit_before>from .errors import ShakespeareRuntimeError
class Character:
"""A character in an SPL play."""
def __init__(self, name):
self.value = 0
self.stack = []
self.on_stage = False
self.name = name
@classmethod
def from_dramatis_persona(cls, persona):
... | from .errors import ShakespeareRuntimeError
from .utils import normalize_name
class Character:
"""A character in an SPL play."""
def __init__(self, name):
self.value = 0
self.stack = []
self.on_stage = False
self.name = name
@classmethod
def from_dramatis_persona(cls,... | from .errors import ShakespeareRuntimeError
class Character:
"""A character in an SPL play."""
def __init__(self, name):
self.value = 0
self.stack = []
self.on_stage = False
self.name = name
@classmethod
def from_dramatis_persona(cls, persona):
name = persona.... | <commit_before>from .errors import ShakespeareRuntimeError
class Character:
"""A character in an SPL play."""
def __init__(self, name):
self.value = 0
self.stack = []
self.on_stage = False
self.name = name
@classmethod
def from_dramatis_persona(cls, persona):
... |
21d5acb0ed340f15feccd5938ae51d47739f930a | falmer/commercial/queries.py | falmer/commercial/queries.py | import graphene
from .models import Offer
from . import types
class Query(graphene.ObjectType):
all_offers = graphene.List(types.Offer)
def resolve_all_offers(self, info):
return Offer.objects.all()
| import graphene
from .models import Offer
from . import types
class Query(graphene.ObjectType):
all_offers = graphene.List(types.Offer)
def resolve_all_offers(self, info):
return Offer.objects.order_by('company_name').all()
| Order offers by company name | Order offers by company name
Closes #373
| Python | mit | sussexstudent/falmer,sussexstudent/falmer,sussexstudent/falmer,sussexstudent/falmer | import graphene
from .models import Offer
from . import types
class Query(graphene.ObjectType):
all_offers = graphene.List(types.Offer)
def resolve_all_offers(self, info):
return Offer.objects.all()
Order offers by company name
Closes #373 | import graphene
from .models import Offer
from . import types
class Query(graphene.ObjectType):
all_offers = graphene.List(types.Offer)
def resolve_all_offers(self, info):
return Offer.objects.order_by('company_name').all()
| <commit_before>import graphene
from .models import Offer
from . import types
class Query(graphene.ObjectType):
all_offers = graphene.List(types.Offer)
def resolve_all_offers(self, info):
return Offer.objects.all()
<commit_msg>Order offers by company name
Closes #373<commit_after> | import graphene
from .models import Offer
from . import types
class Query(graphene.ObjectType):
all_offers = graphene.List(types.Offer)
def resolve_all_offers(self, info):
return Offer.objects.order_by('company_name').all()
| import graphene
from .models import Offer
from . import types
class Query(graphene.ObjectType):
all_offers = graphene.List(types.Offer)
def resolve_all_offers(self, info):
return Offer.objects.all()
Order offers by company name
Closes #373import graphene
from .models import Offer
from . import types... | <commit_before>import graphene
from .models import Offer
from . import types
class Query(graphene.ObjectType):
all_offers = graphene.List(types.Offer)
def resolve_all_offers(self, info):
return Offer.objects.all()
<commit_msg>Order offers by company name
Closes #373<commit_after>import graphene
from... |
d6bd21348c0758404e7cb884c639a7c618f4e281 | tx_salaries/mixins.py | tx_salaries/mixins.py | from tx_people.mixins import *
class DenormalizeOnSaveMixin(object):
def save(self, denormalize=True, *args, **kwargs):
obj = super(DenormalizeOnSaveMixin, self).save(*args, **kwargs)
# TODO: Abstract into a general library
if denormalize:
for a in self._meta.get_all_related_ob... | from tx_people.mixins import *
class DenormalizeOnSaveMixin(object):
"""
Adjusts a model's save method to denormalize data where it can
This works by going through all related objects and calling its
``denormalize`` manager method. Each of those methods should take
one argument -- the model that... | Add first pass at docs | Add first pass at docs
| Python | apache-2.0 | texastribune/tx_salaries,texastribune/tx_salaries | from tx_people.mixins import *
class DenormalizeOnSaveMixin(object):
def save(self, denormalize=True, *args, **kwargs):
obj = super(DenormalizeOnSaveMixin, self).save(*args, **kwargs)
# TODO: Abstract into a general library
if denormalize:
for a in self._meta.get_all_related_ob... | from tx_people.mixins import *
class DenormalizeOnSaveMixin(object):
"""
Adjusts a model's save method to denormalize data where it can
This works by going through all related objects and calling its
``denormalize`` manager method. Each of those methods should take
one argument -- the model that... | <commit_before>from tx_people.mixins import *
class DenormalizeOnSaveMixin(object):
def save(self, denormalize=True, *args, **kwargs):
obj = super(DenormalizeOnSaveMixin, self).save(*args, **kwargs)
# TODO: Abstract into a general library
if denormalize:
for a in self._meta.get... | from tx_people.mixins import *
class DenormalizeOnSaveMixin(object):
"""
Adjusts a model's save method to denormalize data where it can
This works by going through all related objects and calling its
``denormalize`` manager method. Each of those methods should take
one argument -- the model that... | from tx_people.mixins import *
class DenormalizeOnSaveMixin(object):
def save(self, denormalize=True, *args, **kwargs):
obj = super(DenormalizeOnSaveMixin, self).save(*args, **kwargs)
# TODO: Abstract into a general library
if denormalize:
for a in self._meta.get_all_related_ob... | <commit_before>from tx_people.mixins import *
class DenormalizeOnSaveMixin(object):
def save(self, denormalize=True, *args, **kwargs):
obj = super(DenormalizeOnSaveMixin, self).save(*args, **kwargs)
# TODO: Abstract into a general library
if denormalize:
for a in self._meta.get... |
6c34a6c3e73a41cb94bc761a7001cfa9bba24eb3 | combobox.py | combobox.py | import sys
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
class ComboBox(QWidget):
def __init__(self, parent=None, items=[]):
super(ComboBox, self).__init__(parent)
layout = QHBoxLayout()
self.cb = QComboBox()
self.items = items
self.cb.... | try:
from PyQt5.QtWidgets import QWidget, QHBoxLayout, QComboBox
except ImportError:
# needed for py3+qt4
# Ref:
# http://pyqt.sourceforge.net/Docs/PyQt4/incompatible_apis.html
# http://stackoverflow.com/questions/21217399/pyqt4-qtcore-qvariant-object-instead-of-a-string
if sys.version_info.majo... | Update imports and added PyQt4 support | Update imports and added PyQt4 support
| Python | mit | tzutalin/labelImg,tzutalin/labelImg | import sys
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
class ComboBox(QWidget):
def __init__(self, parent=None, items=[]):
super(ComboBox, self).__init__(parent)
layout = QHBoxLayout()
self.cb = QComboBox()
self.items = items
self.cb.... | try:
from PyQt5.QtWidgets import QWidget, QHBoxLayout, QComboBox
except ImportError:
# needed for py3+qt4
# Ref:
# http://pyqt.sourceforge.net/Docs/PyQt4/incompatible_apis.html
# http://stackoverflow.com/questions/21217399/pyqt4-qtcore-qvariant-object-instead-of-a-string
if sys.version_info.majo... | <commit_before>import sys
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
class ComboBox(QWidget):
def __init__(self, parent=None, items=[]):
super(ComboBox, self).__init__(parent)
layout = QHBoxLayout()
self.cb = QComboBox()
self.items = items
... | try:
from PyQt5.QtWidgets import QWidget, QHBoxLayout, QComboBox
except ImportError:
# needed for py3+qt4
# Ref:
# http://pyqt.sourceforge.net/Docs/PyQt4/incompatible_apis.html
# http://stackoverflow.com/questions/21217399/pyqt4-qtcore-qvariant-object-instead-of-a-string
if sys.version_info.majo... | import sys
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
class ComboBox(QWidget):
def __init__(self, parent=None, items=[]):
super(ComboBox, self).__init__(parent)
layout = QHBoxLayout()
self.cb = QComboBox()
self.items = items
self.cb.... | <commit_before>import sys
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
class ComboBox(QWidget):
def __init__(self, parent=None, items=[]):
super(ComboBox, self).__init__(parent)
layout = QHBoxLayout()
self.cb = QComboBox()
self.items = items
... |
400e533893e1b2e71519480504104f38c616a1a7 | ircstat/log.py | ircstat/log.py | # Copyright 2013 John Reese
# Licensed under the MIT license
import logging
logging.addLevelName(logging.DEBUG, 'DBG')
logging.addLevelName(logging.INFO, 'INF')
logging.addLevelName(logging.WARNING, 'WRN')
logging.addLevelName(logging.ERROR, 'ERR')
sh = None
def logger(name=None):
global sh
log = logging.g... | # Copyright 2013 John Reese
# Licensed under the MIT license
import logging
logging.addLevelName(logging.DEBUG, 'DBG')
logging.addLevelName(logging.INFO, 'INF')
logging.addLevelName(logging.WARNING, 'WRN')
logging.addLevelName(logging.ERROR, 'ERR')
sh = None
def logger(name=None):
global sh
log = logging.g... | Add method for debug output | Add method for debug output
| Python | mit | jreese/ircstat,jreese/ircstat | # Copyright 2013 John Reese
# Licensed under the MIT license
import logging
logging.addLevelName(logging.DEBUG, 'DBG')
logging.addLevelName(logging.INFO, 'INF')
logging.addLevelName(logging.WARNING, 'WRN')
logging.addLevelName(logging.ERROR, 'ERR')
sh = None
def logger(name=None):
global sh
log = logging.g... | # Copyright 2013 John Reese
# Licensed under the MIT license
import logging
logging.addLevelName(logging.DEBUG, 'DBG')
logging.addLevelName(logging.INFO, 'INF')
logging.addLevelName(logging.WARNING, 'WRN')
logging.addLevelName(logging.ERROR, 'ERR')
sh = None
def logger(name=None):
global sh
log = logging.g... | <commit_before># Copyright 2013 John Reese
# Licensed under the MIT license
import logging
logging.addLevelName(logging.DEBUG, 'DBG')
logging.addLevelName(logging.INFO, 'INF')
logging.addLevelName(logging.WARNING, 'WRN')
logging.addLevelName(logging.ERROR, 'ERR')
sh = None
def logger(name=None):
global sh
... | # Copyright 2013 John Reese
# Licensed under the MIT license
import logging
logging.addLevelName(logging.DEBUG, 'DBG')
logging.addLevelName(logging.INFO, 'INF')
logging.addLevelName(logging.WARNING, 'WRN')
logging.addLevelName(logging.ERROR, 'ERR')
sh = None
def logger(name=None):
global sh
log = logging.g... | # Copyright 2013 John Reese
# Licensed under the MIT license
import logging
logging.addLevelName(logging.DEBUG, 'DBG')
logging.addLevelName(logging.INFO, 'INF')
logging.addLevelName(logging.WARNING, 'WRN')
logging.addLevelName(logging.ERROR, 'ERR')
sh = None
def logger(name=None):
global sh
log = logging.g... | <commit_before># Copyright 2013 John Reese
# Licensed under the MIT license
import logging
logging.addLevelName(logging.DEBUG, 'DBG')
logging.addLevelName(logging.INFO, 'INF')
logging.addLevelName(logging.WARNING, 'WRN')
logging.addLevelName(logging.ERROR, 'ERR')
sh = None
def logger(name=None):
global sh
... |
baabc63ffad0b9641bd3d68800a9db84fe4076d3 | src/__init__.py | src/__init__.py | __version_info__ = ('1', '10', '3')
__version__ = '.'.join(__version_info__)
from .wrappers import (ObjectProxy, CallableObjectProxy, FunctionWrapper,
BoundFunctionWrapper, WeakFunctionProxy, resolve_path, apply_patch,
wrap_object, wrap_object_attribute, function_wrapper,
wrap_function_wrapper,... | __version_info__ = ('1', '10', '3')
__version__ = '.'.join(__version_info__)
from .wrappers import (ObjectProxy, CallableObjectProxy, FunctionWrapper,
BoundFunctionWrapper, WeakFunctionProxy, resolve_path, apply_patch,
wrap_object, wrap_object_attribute, function_wrapper,
wrap_function_wrapper,... | Add post import hook discovery to public API. | Add post import hook discovery to public API.
| Python | bsd-2-clause | GrahamDumpleton/wrapt,github4ry/wrapt,linglaiyao1314/wrapt,pombredanne/wrapt,wujuguang/wrapt,linglaiyao1314/wrapt,wujuguang/wrapt,akash1808/wrapt,pombredanne/wrapt,GrahamDumpleton/wrapt,github4ry/wrapt,akash1808/wrapt | __version_info__ = ('1', '10', '3')
__version__ = '.'.join(__version_info__)
from .wrappers import (ObjectProxy, CallableObjectProxy, FunctionWrapper,
BoundFunctionWrapper, WeakFunctionProxy, resolve_path, apply_patch,
wrap_object, wrap_object_attribute, function_wrapper,
wrap_function_wrapper,... | __version_info__ = ('1', '10', '3')
__version__ = '.'.join(__version_info__)
from .wrappers import (ObjectProxy, CallableObjectProxy, FunctionWrapper,
BoundFunctionWrapper, WeakFunctionProxy, resolve_path, apply_patch,
wrap_object, wrap_object_attribute, function_wrapper,
wrap_function_wrapper,... | <commit_before>__version_info__ = ('1', '10', '3')
__version__ = '.'.join(__version_info__)
from .wrappers import (ObjectProxy, CallableObjectProxy, FunctionWrapper,
BoundFunctionWrapper, WeakFunctionProxy, resolve_path, apply_patch,
wrap_object, wrap_object_attribute, function_wrapper,
wrap_fu... | __version_info__ = ('1', '10', '3')
__version__ = '.'.join(__version_info__)
from .wrappers import (ObjectProxy, CallableObjectProxy, FunctionWrapper,
BoundFunctionWrapper, WeakFunctionProxy, resolve_path, apply_patch,
wrap_object, wrap_object_attribute, function_wrapper,
wrap_function_wrapper,... | __version_info__ = ('1', '10', '3')
__version__ = '.'.join(__version_info__)
from .wrappers import (ObjectProxy, CallableObjectProxy, FunctionWrapper,
BoundFunctionWrapper, WeakFunctionProxy, resolve_path, apply_patch,
wrap_object, wrap_object_attribute, function_wrapper,
wrap_function_wrapper,... | <commit_before>__version_info__ = ('1', '10', '3')
__version__ = '.'.join(__version_info__)
from .wrappers import (ObjectProxy, CallableObjectProxy, FunctionWrapper,
BoundFunctionWrapper, WeakFunctionProxy, resolve_path, apply_patch,
wrap_object, wrap_object_attribute, function_wrapper,
wrap_fu... |
62818c327997e804090ad8fab328e05410d65d89 | resolwe/flow/tests/test_backend.py | resolwe/flow/tests/test_backend.py | # pylint: disable=missing-docstring
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import shutil
from django.conf import settings
from django.contrib.auth import get_user_model
from django.test import TestCase
from resolwe.flow.engines.local import manager
from resolwe.f... | # pylint: disable=missing-docstring
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import shutil
from django.conf import settings
from django.contrib.auth import get_user_model
from django.test import TestCase
from resolwe.flow.engines.local import manager
from resolwe.f... | Remove (potentialy dangerous) data path recreation | Remove (potentialy dangerous) data path recreation
| Python | apache-2.0 | jberci/resolwe,genialis/resolwe,jberci/resolwe,genialis/resolwe | # pylint: disable=missing-docstring
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import shutil
from django.conf import settings
from django.contrib.auth import get_user_model
from django.test import TestCase
from resolwe.flow.engines.local import manager
from resolwe.f... | # pylint: disable=missing-docstring
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import shutil
from django.conf import settings
from django.contrib.auth import get_user_model
from django.test import TestCase
from resolwe.flow.engines.local import manager
from resolwe.f... | <commit_before># pylint: disable=missing-docstring
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import shutil
from django.conf import settings
from django.contrib.auth import get_user_model
from django.test import TestCase
from resolwe.flow.engines.local import manager... | # pylint: disable=missing-docstring
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import shutil
from django.conf import settings
from django.contrib.auth import get_user_model
from django.test import TestCase
from resolwe.flow.engines.local import manager
from resolwe.f... | # pylint: disable=missing-docstring
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import shutil
from django.conf import settings
from django.contrib.auth import get_user_model
from django.test import TestCase
from resolwe.flow.engines.local import manager
from resolwe.f... | <commit_before># pylint: disable=missing-docstring
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import shutil
from django.conf import settings
from django.contrib.auth import get_user_model
from django.test import TestCase
from resolwe.flow.engines.local import manager... |
25ea87b810d717690679613251fbc262f11c021f | pajbot/modules/linefarming.py | pajbot/modules/linefarming.py | import logging
from pajbot.managers.handler import HandlerManager
from pajbot.models.user import User
from pajbot.modules import BaseModule
from pajbot.modules import ModuleSetting
log = logging.getLogger(__name__)
class LineFarmingModule(BaseModule):
ID = __name__.split(".")[-1]
NAME = "Line Farming"
... | import logging
from pajbot.managers.handler import HandlerManager
from pajbot.models.user import User
from pajbot.modules import BaseModule
from pajbot.modules import ModuleSetting
log = logging.getLogger(__name__)
class LineFarmingModule(BaseModule):
ID = __name__.split(".")[-1]
NAME = "Line Farming"
... | Revert to using += to increment user's lines Doing it the "atomic" way was causing str(user.num_lines) to become ""user".num_lines + :num_lines_1" which is not intended | Revert to using += to increment user's lines
Doing it the "atomic" way was causing str(user.num_lines) to become ""user".num_lines + :num_lines_1" which is not intended
| Python | mit | pajlada/pajbot,pajlada/pajbot,pajlada/pajbot,pajlada/tyggbot,pajlada/tyggbot,pajlada/tyggbot,pajlada/pajbot,pajlada/tyggbot | import logging
from pajbot.managers.handler import HandlerManager
from pajbot.models.user import User
from pajbot.modules import BaseModule
from pajbot.modules import ModuleSetting
log = logging.getLogger(__name__)
class LineFarmingModule(BaseModule):
ID = __name__.split(".")[-1]
NAME = "Line Farming"
... | import logging
from pajbot.managers.handler import HandlerManager
from pajbot.models.user import User
from pajbot.modules import BaseModule
from pajbot.modules import ModuleSetting
log = logging.getLogger(__name__)
class LineFarmingModule(BaseModule):
ID = __name__.split(".")[-1]
NAME = "Line Farming"
... | <commit_before>import logging
from pajbot.managers.handler import HandlerManager
from pajbot.models.user import User
from pajbot.modules import BaseModule
from pajbot.modules import ModuleSetting
log = logging.getLogger(__name__)
class LineFarmingModule(BaseModule):
ID = __name__.split(".")[-1]
NAME = "Lin... | import logging
from pajbot.managers.handler import HandlerManager
from pajbot.models.user import User
from pajbot.modules import BaseModule
from pajbot.modules import ModuleSetting
log = logging.getLogger(__name__)
class LineFarmingModule(BaseModule):
ID = __name__.split(".")[-1]
NAME = "Line Farming"
... | import logging
from pajbot.managers.handler import HandlerManager
from pajbot.models.user import User
from pajbot.modules import BaseModule
from pajbot.modules import ModuleSetting
log = logging.getLogger(__name__)
class LineFarmingModule(BaseModule):
ID = __name__.split(".")[-1]
NAME = "Line Farming"
... | <commit_before>import logging
from pajbot.managers.handler import HandlerManager
from pajbot.models.user import User
from pajbot.modules import BaseModule
from pajbot.modules import ModuleSetting
log = logging.getLogger(__name__)
class LineFarmingModule(BaseModule):
ID = __name__.split(".")[-1]
NAME = "Lin... |
2b3406a46625fd5350200dcb6d2dc32224d3c609 | warehouse/defaults.py | warehouse/defaults.py | from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
# The base domain name for this installation. Used to control linking to
# sub-domains.
SERVER_NAME = "warehouse.local"
# The URI for our PostgreSQL database.
SQLALCHEMY_DATABASE_URI = "postgres:///ware... | from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
# The base domain name for this installation. Used to control linking to
# sub-domains.
SERVER_NAME = "warehouse.local"
# The URI for our PostgreSQL database.
SQLALCHEMY_DATABASE_URI = "postgres:///ware... | Remove a no longer used setting | Remove a no longer used setting
With the removal of eventlet there is no longer a mechanism for
timing out a synchronization.
| Python | bsd-2-clause | davidfischer/warehouse | from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
# The base domain name for this installation. Used to control linking to
# sub-domains.
SERVER_NAME = "warehouse.local"
# The URI for our PostgreSQL database.
SQLALCHEMY_DATABASE_URI = "postgres:///ware... | from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
# The base domain name for this installation. Used to control linking to
# sub-domains.
SERVER_NAME = "warehouse.local"
# The URI for our PostgreSQL database.
SQLALCHEMY_DATABASE_URI = "postgres:///ware... | <commit_before>from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
# The base domain name for this installation. Used to control linking to
# sub-domains.
SERVER_NAME = "warehouse.local"
# The URI for our PostgreSQL database.
SQLALCHEMY_DATABASE_URI = "p... | from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
# The base domain name for this installation. Used to control linking to
# sub-domains.
SERVER_NAME = "warehouse.local"
# The URI for our PostgreSQL database.
SQLALCHEMY_DATABASE_URI = "postgres:///ware... | from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
# The base domain name for this installation. Used to control linking to
# sub-domains.
SERVER_NAME = "warehouse.local"
# The URI for our PostgreSQL database.
SQLALCHEMY_DATABASE_URI = "postgres:///ware... | <commit_before>from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
# The base domain name for this installation. Used to control linking to
# sub-domains.
SERVER_NAME = "warehouse.local"
# The URI for our PostgreSQL database.
SQLALCHEMY_DATABASE_URI = "p... |
9d66600518ec05dae2be62da0bbe2c15ddccce9d | spicedham/__init__.py | spicedham/__init__.py | from pkg_resources import iter_entry_points
from spicedham.config import load_config
_plugins = None
def load_plugins():
"""
If not already loaded, load plugins.
"""
global _plugins
if _plugins == None:
load_config()
_plugins = []
for plugin in iter_entry_points(group='spi... | from pkg_resources import iter_entry_points
from spicedham.config import load_config
from spicedham.backend import load_backend
_plugins = None
def load_plugins():
"""
If not already loaded, load plugins.
"""
global _plugins
if _plugins == None:
# In order to use the plugins config and ba... | Make sure to load_backend as part of load_plugins | Make sure to load_backend as part of load_plugins
| Python | mpl-2.0 | mozilla/spicedham,mozilla/spicedham | from pkg_resources import iter_entry_points
from spicedham.config import load_config
_plugins = None
def load_plugins():
"""
If not already loaded, load plugins.
"""
global _plugins
if _plugins == None:
load_config()
_plugins = []
for plugin in iter_entry_points(group='spi... | from pkg_resources import iter_entry_points
from spicedham.config import load_config
from spicedham.backend import load_backend
_plugins = None
def load_plugins():
"""
If not already loaded, load plugins.
"""
global _plugins
if _plugins == None:
# In order to use the plugins config and ba... | <commit_before>from pkg_resources import iter_entry_points
from spicedham.config import load_config
_plugins = None
def load_plugins():
"""
If not already loaded, load plugins.
"""
global _plugins
if _plugins == None:
load_config()
_plugins = []
for plugin in iter_entry_po... | from pkg_resources import iter_entry_points
from spicedham.config import load_config
from spicedham.backend import load_backend
_plugins = None
def load_plugins():
"""
If not already loaded, load plugins.
"""
global _plugins
if _plugins == None:
# In order to use the plugins config and ba... | from pkg_resources import iter_entry_points
from spicedham.config import load_config
_plugins = None
def load_plugins():
"""
If not already loaded, load plugins.
"""
global _plugins
if _plugins == None:
load_config()
_plugins = []
for plugin in iter_entry_points(group='spi... | <commit_before>from pkg_resources import iter_entry_points
from spicedham.config import load_config
_plugins = None
def load_plugins():
"""
If not already loaded, load plugins.
"""
global _plugins
if _plugins == None:
load_config()
_plugins = []
for plugin in iter_entry_po... |
d66f4a429a0e584b1ce45ca652a27ecd6c372e8c | climate_data/migrations/0024_auto_20170623_0308.py | climate_data/migrations/0024_auto_20170623_0308.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-06-23 03:08
from __future__ import unicode_literals
from django.db import migrations
# noinspection PyUnusedLocal
def add_station_sensor_link_to_reading(apps, schema_editor):
# noinspection PyPep8Naming
Reading = apps.get_model('climate_data', 'Rea... | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-06-23 03:08
from __future__ import unicode_literals
from django.db import migrations
# noinspection PyUnusedLocal
def add_station_sensor_link_to_reading(apps, schema_editor):
# noinspection PyPep8Naming
Reading = apps.get_model('climate_data', 'Rea... | Improve station-sensor link field addition to reading model migration using a paging system to prevent the migration being killed automatically. | Improve station-sensor link field addition to reading model migration using a paging system to prevent the migration being killed automatically.
| Python | apache-2.0 | qubs/data-centre,qubs/climate-data-api,qubs/climate-data-api,qubs/data-centre | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-06-23 03:08
from __future__ import unicode_literals
from django.db import migrations
# noinspection PyUnusedLocal
def add_station_sensor_link_to_reading(apps, schema_editor):
# noinspection PyPep8Naming
Reading = apps.get_model('climate_data', 'Rea... | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-06-23 03:08
from __future__ import unicode_literals
from django.db import migrations
# noinspection PyUnusedLocal
def add_station_sensor_link_to_reading(apps, schema_editor):
# noinspection PyPep8Naming
Reading = apps.get_model('climate_data', 'Rea... | <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-06-23 03:08
from __future__ import unicode_literals
from django.db import migrations
# noinspection PyUnusedLocal
def add_station_sensor_link_to_reading(apps, schema_editor):
# noinspection PyPep8Naming
Reading = apps.get_model('clim... | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-06-23 03:08
from __future__ import unicode_literals
from django.db import migrations
# noinspection PyUnusedLocal
def add_station_sensor_link_to_reading(apps, schema_editor):
# noinspection PyPep8Naming
Reading = apps.get_model('climate_data', 'Rea... | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-06-23 03:08
from __future__ import unicode_literals
from django.db import migrations
# noinspection PyUnusedLocal
def add_station_sensor_link_to_reading(apps, schema_editor):
# noinspection PyPep8Naming
Reading = apps.get_model('climate_data', 'Rea... | <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-06-23 03:08
from __future__ import unicode_literals
from django.db import migrations
# noinspection PyUnusedLocal
def add_station_sensor_link_to_reading(apps, schema_editor):
# noinspection PyPep8Naming
Reading = apps.get_model('clim... |
6fa2d67e27fcbd0cc8ff5858e4038e14a0ab8ae1 | bika/lims/skins/bika/guard_receive_transition.py | bika/lims/skins/bika/guard_receive_transition.py | ## Script (Python) "guard_receive_transition"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
from DateTime import DateTime
workflow = context.portal_workflow
# False if object is cancelled
if workflow.getInfoFor(contex... | ## Script (Python) "guard_receive_transition"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
from DateTime import DateTime
workflow = context.portal_workflow
# False if object is cancelled
if workflow.getInfoFor(contex... | Allow receive of future-dated samples | Allow receive of future-dated samples
| Python | agpl-3.0 | veroc/Bika-LIMS,DeBortoliWines/Bika-LIMS,veroc/Bika-LIMS,anneline/Bika-LIMS,labsanmartin/Bika-LIMS,veroc/Bika-LIMS,DeBortoliWines/Bika-LIMS,labsanmartin/Bika-LIMS,anneline/Bika-LIMS,DeBortoliWines/Bika-LIMS,labsanmartin/Bika-LIMS,anneline/Bika-LIMS,rockfruit/bika.lims,rockfruit/bika.lims | ## Script (Python) "guard_receive_transition"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
from DateTime import DateTime
workflow = context.portal_workflow
# False if object is cancelled
if workflow.getInfoFor(contex... | ## Script (Python) "guard_receive_transition"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
from DateTime import DateTime
workflow = context.portal_workflow
# False if object is cancelled
if workflow.getInfoFor(contex... | <commit_before>## Script (Python) "guard_receive_transition"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
from DateTime import DateTime
workflow = context.portal_workflow
# False if object is cancelled
if workflow.ge... | ## Script (Python) "guard_receive_transition"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
from DateTime import DateTime
workflow = context.portal_workflow
# False if object is cancelled
if workflow.getInfoFor(contex... | ## Script (Python) "guard_receive_transition"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
from DateTime import DateTime
workflow = context.portal_workflow
# False if object is cancelled
if workflow.getInfoFor(contex... | <commit_before>## Script (Python) "guard_receive_transition"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
from DateTime import DateTime
workflow = context.portal_workflow
# False if object is cancelled
if workflow.ge... |
b0c4a58f3002f2f0971c6b254af443773b965d4e | InvenTree/company/urls.py | InvenTree/company/urls.py | """
URL lookup for Company app
"""
from django.conf.urls import url, include
from . import views
company_detail_urls = [
url(r'^thumb-download/', views.CompanyImageDownloadFromURL.as_view(), name='company-image-download'),
# Any other URL
url(r'^.*$', views.CompanyDetail.as_view(), name='company-detai... | """
URL lookup for Company app
"""
from django.conf.urls import url, include
from . import views
company_detail_urls = [
url(r'^thumb-download/', views.CompanyImageDownloadFromURL.as_view(), name='company-image-download'),
# Any other URL
url(r'^.*$', views.CompanyDetail.as_view(), name='company-detai... | Fix URL patterns for ManufacturerPart and SupplierPart | Fix URL patterns for ManufacturerPart and SupplierPart
| Python | mit | SchrodingersGat/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree,inventree/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree | """
URL lookup for Company app
"""
from django.conf.urls import url, include
from . import views
company_detail_urls = [
url(r'^thumb-download/', views.CompanyImageDownloadFromURL.as_view(), name='company-image-download'),
# Any other URL
url(r'^.*$', views.CompanyDetail.as_view(), name='company-detai... | """
URL lookup for Company app
"""
from django.conf.urls import url, include
from . import views
company_detail_urls = [
url(r'^thumb-download/', views.CompanyImageDownloadFromURL.as_view(), name='company-image-download'),
# Any other URL
url(r'^.*$', views.CompanyDetail.as_view(), name='company-detai... | <commit_before>"""
URL lookup for Company app
"""
from django.conf.urls import url, include
from . import views
company_detail_urls = [
url(r'^thumb-download/', views.CompanyImageDownloadFromURL.as_view(), name='company-image-download'),
# Any other URL
url(r'^.*$', views.CompanyDetail.as_view(), name... | """
URL lookup for Company app
"""
from django.conf.urls import url, include
from . import views
company_detail_urls = [
url(r'^thumb-download/', views.CompanyImageDownloadFromURL.as_view(), name='company-image-download'),
# Any other URL
url(r'^.*$', views.CompanyDetail.as_view(), name='company-detai... | """
URL lookup for Company app
"""
from django.conf.urls import url, include
from . import views
company_detail_urls = [
url(r'^thumb-download/', views.CompanyImageDownloadFromURL.as_view(), name='company-image-download'),
# Any other URL
url(r'^.*$', views.CompanyDetail.as_view(), name='company-detai... | <commit_before>"""
URL lookup for Company app
"""
from django.conf.urls import url, include
from . import views
company_detail_urls = [
url(r'^thumb-download/', views.CompanyImageDownloadFromURL.as_view(), name='company-image-download'),
# Any other URL
url(r'^.*$', views.CompanyDetail.as_view(), name... |
994b5be1862a74e9773eeea806d9051a3b5dc29e | framework/auth/campaigns.py | framework/auth/campaigns.py | import httplib as http
from framework.exceptions import HTTPError
from website import mails
VALID_CAMPAIGNS = (
'prereg',
)
EMAIL_TEMPLATE_MAP = {
'prereg': mails.CONFIRM_EMAIL_PREREG
}
def email_template_for_campaign(campaign, default=None):
if campaign in VALID_CAMPAIGNS:
try:
ret... | import httplib as http
from framework.exceptions import HTTPError
from website import mails
VALID_CAMPAIGNS = (
'prereg',
)
EMAIL_TEMPLATE_MAP = {
'prereg': mails.CONFIRM_EMAIL_PREREG
}
def email_template_for_campaign(campaign, default=None):
if campaign in VALID_CAMPAIGNS:
try:
ret... | Add docstring for one-offish campaign_for_user | Add docstring for one-offish campaign_for_user
| Python | apache-2.0 | icereval/osf.io,brianjgeiger/osf.io,rdhyee/osf.io,HalcyonChimera/osf.io,crcresearch/osf.io,abought/osf.io,asanfilippo7/osf.io,brianjgeiger/osf.io,amyshi188/osf.io,alexschiller/osf.io,amyshi188/osf.io,ticklemepierce/osf.io,sloria/osf.io,mluo613/osf.io,asanfilippo7/osf.io,hmoco/osf.io,danielneis/osf.io,acshi/osf.io,danie... | import httplib as http
from framework.exceptions import HTTPError
from website import mails
VALID_CAMPAIGNS = (
'prereg',
)
EMAIL_TEMPLATE_MAP = {
'prereg': mails.CONFIRM_EMAIL_PREREG
}
def email_template_for_campaign(campaign, default=None):
if campaign in VALID_CAMPAIGNS:
try:
ret... | import httplib as http
from framework.exceptions import HTTPError
from website import mails
VALID_CAMPAIGNS = (
'prereg',
)
EMAIL_TEMPLATE_MAP = {
'prereg': mails.CONFIRM_EMAIL_PREREG
}
def email_template_for_campaign(campaign, default=None):
if campaign in VALID_CAMPAIGNS:
try:
ret... | <commit_before>import httplib as http
from framework.exceptions import HTTPError
from website import mails
VALID_CAMPAIGNS = (
'prereg',
)
EMAIL_TEMPLATE_MAP = {
'prereg': mails.CONFIRM_EMAIL_PREREG
}
def email_template_for_campaign(campaign, default=None):
if campaign in VALID_CAMPAIGNS:
try:
... | import httplib as http
from framework.exceptions import HTTPError
from website import mails
VALID_CAMPAIGNS = (
'prereg',
)
EMAIL_TEMPLATE_MAP = {
'prereg': mails.CONFIRM_EMAIL_PREREG
}
def email_template_for_campaign(campaign, default=None):
if campaign in VALID_CAMPAIGNS:
try:
ret... | import httplib as http
from framework.exceptions import HTTPError
from website import mails
VALID_CAMPAIGNS = (
'prereg',
)
EMAIL_TEMPLATE_MAP = {
'prereg': mails.CONFIRM_EMAIL_PREREG
}
def email_template_for_campaign(campaign, default=None):
if campaign in VALID_CAMPAIGNS:
try:
ret... | <commit_before>import httplib as http
from framework.exceptions import HTTPError
from website import mails
VALID_CAMPAIGNS = (
'prereg',
)
EMAIL_TEMPLATE_MAP = {
'prereg': mails.CONFIRM_EMAIL_PREREG
}
def email_template_for_campaign(campaign, default=None):
if campaign in VALID_CAMPAIGNS:
try:
... |
4e801fe6d88d35ca8b850a092acfde404bdfa287 | wsgi.py | wsgi.py | # -*- coding: utf-8 -*-
"""
wsgi
~~~~
entrypoint wsgi script
"""
from werkzeug.serving import run_simple
from werkzeug.wsgi import DispatcherMiddleware
from graphics_service import app
application = app.create_app()
if __name__ == "__main__":
run_simple('0.0.0.0', 4000, application, use_reloader=Fa... | # -*- coding: utf-8 -*-
"""
wsgi
~~~~
entrypoint wsgi script
"""
from werkzeug.serving import run_simple
from werkzeug.middleware.dispatcher import DispatcherMiddleware
from graphics_service import app
application = app.create_app()
if __name__ == "__main__":
run_simple('0.0.0.0', 4000, application... | Update importing werkzeug middleware to support python3 | Update importing werkzeug middleware to support python3
| Python | mit | adsabs/graphics_service | # -*- coding: utf-8 -*-
"""
wsgi
~~~~
entrypoint wsgi script
"""
from werkzeug.serving import run_simple
from werkzeug.wsgi import DispatcherMiddleware
from graphics_service import app
application = app.create_app()
if __name__ == "__main__":
run_simple('0.0.0.0', 4000, application, use_reloader=Fa... | # -*- coding: utf-8 -*-
"""
wsgi
~~~~
entrypoint wsgi script
"""
from werkzeug.serving import run_simple
from werkzeug.middleware.dispatcher import DispatcherMiddleware
from graphics_service import app
application = app.create_app()
if __name__ == "__main__":
run_simple('0.0.0.0', 4000, application... | <commit_before># -*- coding: utf-8 -*-
"""
wsgi
~~~~
entrypoint wsgi script
"""
from werkzeug.serving import run_simple
from werkzeug.wsgi import DispatcherMiddleware
from graphics_service import app
application = app.create_app()
if __name__ == "__main__":
run_simple('0.0.0.0', 4000, application, ... | # -*- coding: utf-8 -*-
"""
wsgi
~~~~
entrypoint wsgi script
"""
from werkzeug.serving import run_simple
from werkzeug.middleware.dispatcher import DispatcherMiddleware
from graphics_service import app
application = app.create_app()
if __name__ == "__main__":
run_simple('0.0.0.0', 4000, application... | # -*- coding: utf-8 -*-
"""
wsgi
~~~~
entrypoint wsgi script
"""
from werkzeug.serving import run_simple
from werkzeug.wsgi import DispatcherMiddleware
from graphics_service import app
application = app.create_app()
if __name__ == "__main__":
run_simple('0.0.0.0', 4000, application, use_reloader=Fa... | <commit_before># -*- coding: utf-8 -*-
"""
wsgi
~~~~
entrypoint wsgi script
"""
from werkzeug.serving import run_simple
from werkzeug.wsgi import DispatcherMiddleware
from graphics_service import app
application = app.create_app()
if __name__ == "__main__":
run_simple('0.0.0.0', 4000, application, ... |
96b3911faadc22a07176c9338420ac8cd9fb06e5 | tests/test_vector2_scale.py | tests/test_vector2_scale.py | import pytest # type: ignore
from hypothesis import assume, given
from hypothesis.strategies import floats
from math import isclose
from utils import vectors
from ppb_vector import Vector2
@given(x=vectors(max_magnitude=1e75), l=floats(min_value=-1e75, max_value=1e75))
def test_scale_to_length(x: Vector2, l: float)... | import pytest # type: ignore
from hypothesis import assume, given
from hypothesis.strategies import floats
from math import isclose
from utils import angle_isclose, vectors
from ppb_vector import Vector2
@given(x=vectors(max_magnitude=1e75), l=floats(min_value=-1e75, max_value=1e75))
def test_scale_to_length(x: Vec... | Test that scaling doesn't rotate vectors | Test that scaling doesn't rotate vectors
| Python | artistic-2.0 | ppb/ppb-vector,ppb/ppb-vector | import pytest # type: ignore
from hypothesis import assume, given
from hypothesis.strategies import floats
from math import isclose
from utils import vectors
from ppb_vector import Vector2
@given(x=vectors(max_magnitude=1e75), l=floats(min_value=-1e75, max_value=1e75))
def test_scale_to_length(x: Vector2, l: float)... | import pytest # type: ignore
from hypothesis import assume, given
from hypothesis.strategies import floats
from math import isclose
from utils import angle_isclose, vectors
from ppb_vector import Vector2
@given(x=vectors(max_magnitude=1e75), l=floats(min_value=-1e75, max_value=1e75))
def test_scale_to_length(x: Vec... | <commit_before>import pytest # type: ignore
from hypothesis import assume, given
from hypothesis.strategies import floats
from math import isclose
from utils import vectors
from ppb_vector import Vector2
@given(x=vectors(max_magnitude=1e75), l=floats(min_value=-1e75, max_value=1e75))
def test_scale_to_length(x: Vec... | import pytest # type: ignore
from hypothesis import assume, given
from hypothesis.strategies import floats
from math import isclose
from utils import angle_isclose, vectors
from ppb_vector import Vector2
@given(x=vectors(max_magnitude=1e75), l=floats(min_value=-1e75, max_value=1e75))
def test_scale_to_length(x: Vec... | import pytest # type: ignore
from hypothesis import assume, given
from hypothesis.strategies import floats
from math import isclose
from utils import vectors
from ppb_vector import Vector2
@given(x=vectors(max_magnitude=1e75), l=floats(min_value=-1e75, max_value=1e75))
def test_scale_to_length(x: Vector2, l: float)... | <commit_before>import pytest # type: ignore
from hypothesis import assume, given
from hypothesis.strategies import floats
from math import isclose
from utils import vectors
from ppb_vector import Vector2
@given(x=vectors(max_magnitude=1e75), l=floats(min_value=-1e75, max_value=1e75))
def test_scale_to_length(x: Vec... |
6ad6de83e9cb8bf71ba2b525b22fa760093ab552 | userprofile/migrations/0034_auto_20200304_2205.py | userprofile/migrations/0034_auto_20200304_2205.py | # Generated by Django 3.0.2 on 2020-03-04 22:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('userprofile', '0033_category_color_hex'),
]
operations = [
migrations.RemoveField(
model_name='category',
name='colo... | # Generated by Django 3.0.2 on 2020-03-04 22:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('userprofile', '0033_category_color_hex'),
]
operations = [
migrations.RemoveField(
model_name='category',
name='colo... | Change default in migration file to be short enough | Change default in migration file to be short enough
| Python | mit | hackerspace-ntnu/website,hackerspace-ntnu/website,hackerspace-ntnu/website | # Generated by Django 3.0.2 on 2020-03-04 22:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('userprofile', '0033_category_color_hex'),
]
operations = [
migrations.RemoveField(
model_name='category',
name='colo... | # Generated by Django 3.0.2 on 2020-03-04 22:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('userprofile', '0033_category_color_hex'),
]
operations = [
migrations.RemoveField(
model_name='category',
name='colo... | <commit_before># Generated by Django 3.0.2 on 2020-03-04 22:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('userprofile', '0033_category_color_hex'),
]
operations = [
migrations.RemoveField(
model_name='category',
... | # Generated by Django 3.0.2 on 2020-03-04 22:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('userprofile', '0033_category_color_hex'),
]
operations = [
migrations.RemoveField(
model_name='category',
name='colo... | # Generated by Django 3.0.2 on 2020-03-04 22:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('userprofile', '0033_category_color_hex'),
]
operations = [
migrations.RemoveField(
model_name='category',
name='colo... | <commit_before># Generated by Django 3.0.2 on 2020-03-04 22:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('userprofile', '0033_category_color_hex'),
]
operations = [
migrations.RemoveField(
model_name='category',
... |
c49aa5dc8ccaf821fe6c5d43ea6026e968b175e5 | makedist.py | makedist.py | # Template makedist.py file
# Set WEBSITE to the name of the web site that this package will be
# deposited in. The URL will always be:
# http://$WEBSITE/$PACKAGE/
WEBSITE = 'untroubled.org'
# If LISTSUB is set, makedist will add a note regarding mailing list
# subscription.
LISTSUB = '[email protected]'
... | # Template makedist.py file
# Set WEBSITE to the name of the web site that this package will be
# deposited in. The URL will always be:
# http://$WEBSITE/$PACKAGE/
WEBSITE = 'untroubled.org'
# If LISTSUB is set, makedist will add a note regarding mailing list
# subscription.
LISTSUB = '[email protected]'
... | Add the documentation to the web site. | Add the documentation to the web site.
| Python | lgpl-2.1 | bruceg/bglibs,bruceg/bglibs,bruceg/bglibs,bruceg/bglibs,bruceg/bglibs,bruceg/bglibs | # Template makedist.py file
# Set WEBSITE to the name of the web site that this package will be
# deposited in. The URL will always be:
# http://$WEBSITE/$PACKAGE/
WEBSITE = 'untroubled.org'
# If LISTSUB is set, makedist will add a note regarding mailing list
# subscription.
LISTSUB = '[email protected]'
... | # Template makedist.py file
# Set WEBSITE to the name of the web site that this package will be
# deposited in. The URL will always be:
# http://$WEBSITE/$PACKAGE/
WEBSITE = 'untroubled.org'
# If LISTSUB is set, makedist will add a note regarding mailing list
# subscription.
LISTSUB = '[email protected]'
... | <commit_before># Template makedist.py file
# Set WEBSITE to the name of the web site that this package will be
# deposited in. The URL will always be:
# http://$WEBSITE/$PACKAGE/
WEBSITE = 'untroubled.org'
# If LISTSUB is set, makedist will add a note regarding mailing list
# subscription.
LISTSUB = 'bgware-subscrib... | # Template makedist.py file
# Set WEBSITE to the name of the web site that this package will be
# deposited in. The URL will always be:
# http://$WEBSITE/$PACKAGE/
WEBSITE = 'untroubled.org'
# If LISTSUB is set, makedist will add a note regarding mailing list
# subscription.
LISTSUB = '[email protected]'
... | # Template makedist.py file
# Set WEBSITE to the name of the web site that this package will be
# deposited in. The URL will always be:
# http://$WEBSITE/$PACKAGE/
WEBSITE = 'untroubled.org'
# If LISTSUB is set, makedist will add a note regarding mailing list
# subscription.
LISTSUB = '[email protected]'
... | <commit_before># Template makedist.py file
# Set WEBSITE to the name of the web site that this package will be
# deposited in. The URL will always be:
# http://$WEBSITE/$PACKAGE/
WEBSITE = 'untroubled.org'
# If LISTSUB is set, makedist will add a note regarding mailing list
# subscription.
LISTSUB = 'bgware-subscrib... |
d3caf80485da78c8eb050ff4d9e33a2ee6c8feda | tests/rietveld/test_event_handler.py | tests/rietveld/test_event_handler.py | from __future__ import absolute_import, print_function
import unittest
from qtpy.QtWidgets import QApplication
from addie.rietveld import event_handler
class RietveldEventHandlerTests(unittest.TestCase):
def setUp(self):
self.main_window = QApplication([])
'''
def tearDown(self):
self.mai... | from __future__ import absolute_import, print_function
import pytest
from addie.rietveld import event_handler
@pytest.fixture
def rietveld_event_handler(qtbot):
return event_handler
def test_evt_change_gss_mode_exception(qtbot, rietveld_event_handler):
"""Test we can extract a bank id from bank workspace na... | Refactor rietveld.event_handler test to use pytest-qt | Refactor rietveld.event_handler test to use pytest-qt
| Python | mit | neutrons/FastGR,neutrons/FastGR,neutrons/FastGR | from __future__ import absolute_import, print_function
import unittest
from qtpy.QtWidgets import QApplication
from addie.rietveld import event_handler
class RietveldEventHandlerTests(unittest.TestCase):
def setUp(self):
self.main_window = QApplication([])
'''
def tearDown(self):
self.mai... | from __future__ import absolute_import, print_function
import pytest
from addie.rietveld import event_handler
@pytest.fixture
def rietveld_event_handler(qtbot):
return event_handler
def test_evt_change_gss_mode_exception(qtbot, rietveld_event_handler):
"""Test we can extract a bank id from bank workspace na... | <commit_before>from __future__ import absolute_import, print_function
import unittest
from qtpy.QtWidgets import QApplication
from addie.rietveld import event_handler
class RietveldEventHandlerTests(unittest.TestCase):
def setUp(self):
self.main_window = QApplication([])
'''
def tearDown(self):
... | from __future__ import absolute_import, print_function
import pytest
from addie.rietveld import event_handler
@pytest.fixture
def rietveld_event_handler(qtbot):
return event_handler
def test_evt_change_gss_mode_exception(qtbot, rietveld_event_handler):
"""Test we can extract a bank id from bank workspace na... | from __future__ import absolute_import, print_function
import unittest
from qtpy.QtWidgets import QApplication
from addie.rietveld import event_handler
class RietveldEventHandlerTests(unittest.TestCase):
def setUp(self):
self.main_window = QApplication([])
'''
def tearDown(self):
self.mai... | <commit_before>from __future__ import absolute_import, print_function
import unittest
from qtpy.QtWidgets import QApplication
from addie.rietveld import event_handler
class RietveldEventHandlerTests(unittest.TestCase):
def setUp(self):
self.main_window = QApplication([])
'''
def tearDown(self):
... |
4e2fd123b77572bdf74938d08f3e84ccfa15af36 | pycargr/cli.py | pycargr/cli.py | import csv
from argparse import ArgumentParser
from json import dumps
from pycargr.model import to_dict
from pycargr.parser import parse_car_page
parser = ArgumentParser()
parser.add_argument('car_ids', nargs='+')
parser.add_argument('--output', choices=['csv', 'json', 'stdout'], default='stdout')
def main():
a... | import csv
from argparse import ArgumentParser
from json import dumps
from pycargr.model import to_dict
from pycargr.parser import parse_car_page
parser = ArgumentParser()
parser.add_argument('car_ids', nargs='+')
parser.add_argument('--output', choices=['csv', 'json', 'stdout'], default='stdout')
def main():
a... | Support both json and stdout the same | Support both json and stdout the same
| Python | mit | Florents-Tselai/PyCarGr | import csv
from argparse import ArgumentParser
from json import dumps
from pycargr.model import to_dict
from pycargr.parser import parse_car_page
parser = ArgumentParser()
parser.add_argument('car_ids', nargs='+')
parser.add_argument('--output', choices=['csv', 'json', 'stdout'], default='stdout')
def main():
a... | import csv
from argparse import ArgumentParser
from json import dumps
from pycargr.model import to_dict
from pycargr.parser import parse_car_page
parser = ArgumentParser()
parser.add_argument('car_ids', nargs='+')
parser.add_argument('--output', choices=['csv', 'json', 'stdout'], default='stdout')
def main():
a... | <commit_before>import csv
from argparse import ArgumentParser
from json import dumps
from pycargr.model import to_dict
from pycargr.parser import parse_car_page
parser = ArgumentParser()
parser.add_argument('car_ids', nargs='+')
parser.add_argument('--output', choices=['csv', 'json', 'stdout'], default='stdout')
de... | import csv
from argparse import ArgumentParser
from json import dumps
from pycargr.model import to_dict
from pycargr.parser import parse_car_page
parser = ArgumentParser()
parser.add_argument('car_ids', nargs='+')
parser.add_argument('--output', choices=['csv', 'json', 'stdout'], default='stdout')
def main():
a... | import csv
from argparse import ArgumentParser
from json import dumps
from pycargr.model import to_dict
from pycargr.parser import parse_car_page
parser = ArgumentParser()
parser.add_argument('car_ids', nargs='+')
parser.add_argument('--output', choices=['csv', 'json', 'stdout'], default='stdout')
def main():
a... | <commit_before>import csv
from argparse import ArgumentParser
from json import dumps
from pycargr.model import to_dict
from pycargr.parser import parse_car_page
parser = ArgumentParser()
parser.add_argument('car_ids', nargs='+')
parser.add_argument('--output', choices=['csv', 'json', 'stdout'], default='stdout')
de... |
e9a0d9a2d64b00328f99d526db9cc67cad478760 | src/mmmblog/models.py | src/mmmblog/models.py |
from django.db import models
FORMAT_CHOICES = (
('html', 'Raw HTML'),
('markdown', 'Markdown'),
)
class Blog(models.Model):
date = models.DateTimeField(auto_now_add=True)
title = models.CharField(max_length=250)
content = models.TextField()
format = models.CharField(max_length=10, choices=FOR... |
from django.db import models
from django.db.models import signals
from staticgenerator import quick_publish, quick_delete
FORMAT_CHOICES = (
('html', 'Raw HTML'),
('markdown', 'Markdown'),
)
class Blog(models.Model):
date = models.DateTimeField(auto_now_add=True)
title = models.CharField(max_length=2... | Add signals to call staticgenerator | Add signals to call staticgenerator
| Python | mit | fajran/mmmblog |
from django.db import models
FORMAT_CHOICES = (
('html', 'Raw HTML'),
('markdown', 'Markdown'),
)
class Blog(models.Model):
date = models.DateTimeField(auto_now_add=True)
title = models.CharField(max_length=250)
content = models.TextField()
format = models.CharField(max_length=10, choices=FOR... |
from django.db import models
from django.db.models import signals
from staticgenerator import quick_publish, quick_delete
FORMAT_CHOICES = (
('html', 'Raw HTML'),
('markdown', 'Markdown'),
)
class Blog(models.Model):
date = models.DateTimeField(auto_now_add=True)
title = models.CharField(max_length=2... | <commit_before>
from django.db import models
FORMAT_CHOICES = (
('html', 'Raw HTML'),
('markdown', 'Markdown'),
)
class Blog(models.Model):
date = models.DateTimeField(auto_now_add=True)
title = models.CharField(max_length=250)
content = models.TextField()
format = models.CharField(max_length=... |
from django.db import models
from django.db.models import signals
from staticgenerator import quick_publish, quick_delete
FORMAT_CHOICES = (
('html', 'Raw HTML'),
('markdown', 'Markdown'),
)
class Blog(models.Model):
date = models.DateTimeField(auto_now_add=True)
title = models.CharField(max_length=2... |
from django.db import models
FORMAT_CHOICES = (
('html', 'Raw HTML'),
('markdown', 'Markdown'),
)
class Blog(models.Model):
date = models.DateTimeField(auto_now_add=True)
title = models.CharField(max_length=250)
content = models.TextField()
format = models.CharField(max_length=10, choices=FOR... | <commit_before>
from django.db import models
FORMAT_CHOICES = (
('html', 'Raw HTML'),
('markdown', 'Markdown'),
)
class Blog(models.Model):
date = models.DateTimeField(auto_now_add=True)
title = models.CharField(max_length=250)
content = models.TextField()
format = models.CharField(max_length=... |
2cadf26e34a5cfaa59b6ae67065dd257fd45cfe5 | students/psbriant/session010/timing_cm.py | students/psbriant/session010/timing_cm.py | #!/usr/bin/env python
"""
Timing context manager
"""
class Timer:
def __enter__(self):
pass
| #!/usr/bin/env python
"""
Timing context manager
"""
import time
class Timer:
def __enter__(self):
self.start = time.time()
def __exit__(self, exc_type, exc_val, exc_tb):
print("elapsed time:", time.time() - self.start)
| Add enter and exit methods. | Add enter and exit methods.
| Python | unlicense | UWPCE-PythonCert/IntroPython2016,weidnem/IntroPython2016,UWPCE-PythonCert/IntroPython2016,weidnem/IntroPython2016,weidnem/IntroPython2016,UWPCE-PythonCert/IntroPython2016 | #!/usr/bin/env python
"""
Timing context manager
"""
class Timer:
def __enter__(self):
pass
Add enter and exit methods. | #!/usr/bin/env python
"""
Timing context manager
"""
import time
class Timer:
def __enter__(self):
self.start = time.time()
def __exit__(self, exc_type, exc_val, exc_tb):
print("elapsed time:", time.time() - self.start)
| <commit_before>#!/usr/bin/env python
"""
Timing context manager
"""
class Timer:
def __enter__(self):
pass
<commit_msg>Add enter and exit methods.<commit_after> | #!/usr/bin/env python
"""
Timing context manager
"""
import time
class Timer:
def __enter__(self):
self.start = time.time()
def __exit__(self, exc_type, exc_val, exc_tb):
print("elapsed time:", time.time() - self.start)
| #!/usr/bin/env python
"""
Timing context manager
"""
class Timer:
def __enter__(self):
pass
Add enter and exit methods.#!/usr/bin/env python
"""
Timing context manager
"""
import time
class Timer:
def __enter__(self):
self.start = time.time()
def __exit__(self, exc_type, e... | <commit_before>#!/usr/bin/env python
"""
Timing context manager
"""
class Timer:
def __enter__(self):
pass
<commit_msg>Add enter and exit methods.<commit_after>#!/usr/bin/env python
"""
Timing context manager
"""
import time
class Timer:
def __enter__(self):
self.start = time.t... |
15621b2d1dc58998f4e9f84ec8f4ef2c50458868 | openerp/tests/addons/test_translation_import/models.py | openerp/tests/addons/test_translation_import/models.py | # -*- coding: utf-8 -*-
import openerp
from openerp.tools.translate import _
class m(openerp.osv.osv.Model):
""" A model to provide source strings.
"""
_name = 'test.translation.import'
_columns = {
'name': openerp.osv.fields.char(
'1XBUO5PUYH2RYZSA1FTLRYS8SPCNU1UYXMEYMM25ASV7JC2KT... | # -*- coding: utf-8 -*-
import openerp
from openerp.tools.translate import _
class m(openerp.osv.orm.TransientModel):
""" A model to provide source strings.
"""
_name = 'test.translation.import'
_columns = {
'name': openerp.osv.fields.char(
'1XBUO5PUYH2RYZSA1FTLRYS8SPCNU1UYXMEYMM25... | Use TransientModel for the dummy model used in translation testing | [IMP] Use TransientModel for the dummy model used in translation testing
| Python | agpl-3.0 | akretion/openerp-server,akretion/openerp-server,akretion/openerp-server | # -*- coding: utf-8 -*-
import openerp
from openerp.tools.translate import _
class m(openerp.osv.osv.Model):
""" A model to provide source strings.
"""
_name = 'test.translation.import'
_columns = {
'name': openerp.osv.fields.char(
'1XBUO5PUYH2RYZSA1FTLRYS8SPCNU1UYXMEYMM25ASV7JC2KT... | # -*- coding: utf-8 -*-
import openerp
from openerp.tools.translate import _
class m(openerp.osv.orm.TransientModel):
""" A model to provide source strings.
"""
_name = 'test.translation.import'
_columns = {
'name': openerp.osv.fields.char(
'1XBUO5PUYH2RYZSA1FTLRYS8SPCNU1UYXMEYMM25... | <commit_before># -*- coding: utf-8 -*-
import openerp
from openerp.tools.translate import _
class m(openerp.osv.osv.Model):
""" A model to provide source strings.
"""
_name = 'test.translation.import'
_columns = {
'name': openerp.osv.fields.char(
'1XBUO5PUYH2RYZSA1FTLRYS8SPCNU1UYXM... | # -*- coding: utf-8 -*-
import openerp
from openerp.tools.translate import _
class m(openerp.osv.orm.TransientModel):
""" A model to provide source strings.
"""
_name = 'test.translation.import'
_columns = {
'name': openerp.osv.fields.char(
'1XBUO5PUYH2RYZSA1FTLRYS8SPCNU1UYXMEYMM25... | # -*- coding: utf-8 -*-
import openerp
from openerp.tools.translate import _
class m(openerp.osv.osv.Model):
""" A model to provide source strings.
"""
_name = 'test.translation.import'
_columns = {
'name': openerp.osv.fields.char(
'1XBUO5PUYH2RYZSA1FTLRYS8SPCNU1UYXMEYMM25ASV7JC2KT... | <commit_before># -*- coding: utf-8 -*-
import openerp
from openerp.tools.translate import _
class m(openerp.osv.osv.Model):
""" A model to provide source strings.
"""
_name = 'test.translation.import'
_columns = {
'name': openerp.osv.fields.char(
'1XBUO5PUYH2RYZSA1FTLRYS8SPCNU1UYXM... |
daf9c8e39cd141194f8000cb3b8f4694e96401ed | pep438/core.py | pep438/core.py | """Core pep438 utility functions"""
from __future__ import unicode_literals
import requests
import xmlrpclib
import lxml.html
from requirements import parse
def valid_package(package_name):
"""Return bool if package_name is a valid package on PyPI"""
response = requests.head('https://pypi.python.org/pypi/%s'... | """Core pep438 utility functions"""
from __future__ import unicode_literals
import requests
try:
import xmlrpclib
except:
import xmlrpc.client as xmlprclib
import lxml.html
from requirements import parse
def valid_package(package_name):
"""Return bool if package_name is a valid package on PyPI"""
res... | Fix broxen import in Python 3 | Fix broxen import in Python 3
| Python | mit | treyhunner/pep438 | """Core pep438 utility functions"""
from __future__ import unicode_literals
import requests
import xmlrpclib
import lxml.html
from requirements import parse
def valid_package(package_name):
"""Return bool if package_name is a valid package on PyPI"""
response = requests.head('https://pypi.python.org/pypi/%s'... | """Core pep438 utility functions"""
from __future__ import unicode_literals
import requests
try:
import xmlrpclib
except:
import xmlrpc.client as xmlprclib
import lxml.html
from requirements import parse
def valid_package(package_name):
"""Return bool if package_name is a valid package on PyPI"""
res... | <commit_before>"""Core pep438 utility functions"""
from __future__ import unicode_literals
import requests
import xmlrpclib
import lxml.html
from requirements import parse
def valid_package(package_name):
"""Return bool if package_name is a valid package on PyPI"""
response = requests.head('https://pypi.pyth... | """Core pep438 utility functions"""
from __future__ import unicode_literals
import requests
try:
import xmlrpclib
except:
import xmlrpc.client as xmlprclib
import lxml.html
from requirements import parse
def valid_package(package_name):
"""Return bool if package_name is a valid package on PyPI"""
res... | """Core pep438 utility functions"""
from __future__ import unicode_literals
import requests
import xmlrpclib
import lxml.html
from requirements import parse
def valid_package(package_name):
"""Return bool if package_name is a valid package on PyPI"""
response = requests.head('https://pypi.python.org/pypi/%s'... | <commit_before>"""Core pep438 utility functions"""
from __future__ import unicode_literals
import requests
import xmlrpclib
import lxml.html
from requirements import parse
def valid_package(package_name):
"""Return bool if package_name is a valid package on PyPI"""
response = requests.head('https://pypi.pyth... |
b03e1b75099cb46e40f7dcf85dc61e8718aa292d | slack_log_handler/__init__.py | slack_log_handler/__init__.py | import json
import traceback
from logging import Handler
from slacker import Slacker
class SlackLogHandler(Handler):
def __init__(self, api_key, channel, stack_trace=False, username='Python logger', icon_url=None, icon_emoji=None):
Handler.__init__(self)
self.slack_chat = Slacker(api_key)
... | import json
import traceback
from logging import Handler, CRITICAL, ERROR, WARNING
from slacker import Slacker
ERROR_COLOR = 'danger' # color name is built in to Slack API
WARNING_COLOR = 'warning' # color name is built in to Slack API
INFO_COLOR = '#439FE0'
COLORS = {
CRITICAL: ERROR_COLOR,
ERROR: ERROR_C... | Set attachment color based on log level | Set attachment color based on log level
| Python | apache-2.0 | mathiasose/slacker_log_handler | import json
import traceback
from logging import Handler
from slacker import Slacker
class SlackLogHandler(Handler):
def __init__(self, api_key, channel, stack_trace=False, username='Python logger', icon_url=None, icon_emoji=None):
Handler.__init__(self)
self.slack_chat = Slacker(api_key)
... | import json
import traceback
from logging import Handler, CRITICAL, ERROR, WARNING
from slacker import Slacker
ERROR_COLOR = 'danger' # color name is built in to Slack API
WARNING_COLOR = 'warning' # color name is built in to Slack API
INFO_COLOR = '#439FE0'
COLORS = {
CRITICAL: ERROR_COLOR,
ERROR: ERROR_C... | <commit_before>import json
import traceback
from logging import Handler
from slacker import Slacker
class SlackLogHandler(Handler):
def __init__(self, api_key, channel, stack_trace=False, username='Python logger', icon_url=None, icon_emoji=None):
Handler.__init__(self)
self.slack_chat = Slacker(a... | import json
import traceback
from logging import Handler, CRITICAL, ERROR, WARNING
from slacker import Slacker
ERROR_COLOR = 'danger' # color name is built in to Slack API
WARNING_COLOR = 'warning' # color name is built in to Slack API
INFO_COLOR = '#439FE0'
COLORS = {
CRITICAL: ERROR_COLOR,
ERROR: ERROR_C... | import json
import traceback
from logging import Handler
from slacker import Slacker
class SlackLogHandler(Handler):
def __init__(self, api_key, channel, stack_trace=False, username='Python logger', icon_url=None, icon_emoji=None):
Handler.__init__(self)
self.slack_chat = Slacker(api_key)
... | <commit_before>import json
import traceback
from logging import Handler
from slacker import Slacker
class SlackLogHandler(Handler):
def __init__(self, api_key, channel, stack_trace=False, username='Python logger', icon_url=None, icon_emoji=None):
Handler.__init__(self)
self.slack_chat = Slacker(a... |
d5f650cc6932e585a848cdd9aaa257342c90a983 | publishconf.py | publishconf.py | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
# This file is only used if you use `make publish` or
# explicitly specify it as your config file.
import os
import sys
sys.path.append(os.curdir)
from pelicanconf import *
SITEURL = ''
RELATIVE_URLS = False
FEED_ALL_ATOM = 'fee... | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
# This file is only used if you use `make publish` or
# explicitly specify it as your config file.
import os
import sys
sys.path.append(os.curdir)
from pelicanconf import *
SITEURL = ''
RELATIVE_URLS = False
FEED_ALL_ATOM = 'fee... | Switch to GA universal id. | Switch to GA universal id.
| Python | mit | donnemartin/outdated-donnemartin.github.io,donnemartin/outdated-donnemartin.github.io,donnemartin/outdated-donnemartin.github.io,donnemartin/outdated-donnemartin.github.io,donnemartin/outdated-donnemartin.github.io | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
# This file is only used if you use `make publish` or
# explicitly specify it as your config file.
import os
import sys
sys.path.append(os.curdir)
from pelicanconf import *
SITEURL = ''
RELATIVE_URLS = False
FEED_ALL_ATOM = 'fee... | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
# This file is only used if you use `make publish` or
# explicitly specify it as your config file.
import os
import sys
sys.path.append(os.curdir)
from pelicanconf import *
SITEURL = ''
RELATIVE_URLS = False
FEED_ALL_ATOM = 'fee... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
# This file is only used if you use `make publish` or
# explicitly specify it as your config file.
import os
import sys
sys.path.append(os.curdir)
from pelicanconf import *
SITEURL = ''
RELATIVE_URLS = False
FEED_... | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
# This file is only used if you use `make publish` or
# explicitly specify it as your config file.
import os
import sys
sys.path.append(os.curdir)
from pelicanconf import *
SITEURL = ''
RELATIVE_URLS = False
FEED_ALL_ATOM = 'fee... | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
# This file is only used if you use `make publish` or
# explicitly specify it as your config file.
import os
import sys
sys.path.append(os.curdir)
from pelicanconf import *
SITEURL = ''
RELATIVE_URLS = False
FEED_ALL_ATOM = 'fee... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
# This file is only used if you use `make publish` or
# explicitly specify it as your config file.
import os
import sys
sys.path.append(os.curdir)
from pelicanconf import *
SITEURL = ''
RELATIVE_URLS = False
FEED_... |
20654d833deb332dbbe683e6d4e38cef1cc58dd3 | webcomix/tests/test_comic_availability.py | webcomix/tests/test_comic_availability.py | import pytest
from webcomix.comic import Comic
from webcomix.supported_comics import supported_comics
from webcomix.util import check_first_pages
@pytest.mark.slow
def test_supported_comics():
for comic_name, comic_info in supported_comics.items():
first_pages = Comic.verify_xpath(*comic_info)
ch... | import pytest
from webcomix.comic import Comic
from webcomix.supported_comics import supported_comics
from webcomix.util import check_first_pages
@pytest.mark.slow
def test_supported_comics():
for comic_name, comic_info in supported_comics.items():
comic = Comic(comic_name, *comic_info)
first_pag... | Refactor comic availability test to reflect changes to Comic class | Refactor comic availability test to reflect changes to Comic class
| Python | mit | J-CPelletier/WebComicToCBZ,J-CPelletier/webcomix,J-CPelletier/webcomix | import pytest
from webcomix.comic import Comic
from webcomix.supported_comics import supported_comics
from webcomix.util import check_first_pages
@pytest.mark.slow
def test_supported_comics():
for comic_name, comic_info in supported_comics.items():
first_pages = Comic.verify_xpath(*comic_info)
ch... | import pytest
from webcomix.comic import Comic
from webcomix.supported_comics import supported_comics
from webcomix.util import check_first_pages
@pytest.mark.slow
def test_supported_comics():
for comic_name, comic_info in supported_comics.items():
comic = Comic(comic_name, *comic_info)
first_pag... | <commit_before>import pytest
from webcomix.comic import Comic
from webcomix.supported_comics import supported_comics
from webcomix.util import check_first_pages
@pytest.mark.slow
def test_supported_comics():
for comic_name, comic_info in supported_comics.items():
first_pages = Comic.verify_xpath(*comic_i... | import pytest
from webcomix.comic import Comic
from webcomix.supported_comics import supported_comics
from webcomix.util import check_first_pages
@pytest.mark.slow
def test_supported_comics():
for comic_name, comic_info in supported_comics.items():
comic = Comic(comic_name, *comic_info)
first_pag... | import pytest
from webcomix.comic import Comic
from webcomix.supported_comics import supported_comics
from webcomix.util import check_first_pages
@pytest.mark.slow
def test_supported_comics():
for comic_name, comic_info in supported_comics.items():
first_pages = Comic.verify_xpath(*comic_info)
ch... | <commit_before>import pytest
from webcomix.comic import Comic
from webcomix.supported_comics import supported_comics
from webcomix.util import check_first_pages
@pytest.mark.slow
def test_supported_comics():
for comic_name, comic_info in supported_comics.items():
first_pages = Comic.verify_xpath(*comic_i... |
38775f06c2285f3d12b9f4a0bc70bded29dce274 | hbmqtt/utils.py | hbmqtt/utils.py | # Copyright (c) 2015 Nicolas JOUANIN
#
# See the file license.txt for copying permission.
def not_in_dict_or_none(dict, key):
"""
Check if a key exists in a map and if it's not None
:param dict: map to look for key
:param key: key to find
:return: true if key is in dict and not None
"""
if... | # Copyright (c) 2015 Nicolas JOUANIN
#
# See the file license.txt for copying permission.
def not_in_dict_or_none(dict, key):
"""
Check if a key exists in a map and if it's not None
:param dict: map to look for key
:param key: key to find
:return: true if key is in dict and not None
"""
if... | Add method for formatting client info (address, port, id) | Add method for formatting client info (address, port, id)
| Python | mit | beerfactory/hbmqtt | # Copyright (c) 2015 Nicolas JOUANIN
#
# See the file license.txt for copying permission.
def not_in_dict_or_none(dict, key):
"""
Check if a key exists in a map and if it's not None
:param dict: map to look for key
:param key: key to find
:return: true if key is in dict and not None
"""
if... | # Copyright (c) 2015 Nicolas JOUANIN
#
# See the file license.txt for copying permission.
def not_in_dict_or_none(dict, key):
"""
Check if a key exists in a map and if it's not None
:param dict: map to look for key
:param key: key to find
:return: true if key is in dict and not None
"""
if... | <commit_before># Copyright (c) 2015 Nicolas JOUANIN
#
# See the file license.txt for copying permission.
def not_in_dict_or_none(dict, key):
"""
Check if a key exists in a map and if it's not None
:param dict: map to look for key
:param key: key to find
:return: true if key is in dict and not None... | # Copyright (c) 2015 Nicolas JOUANIN
#
# See the file license.txt for copying permission.
def not_in_dict_or_none(dict, key):
"""
Check if a key exists in a map and if it's not None
:param dict: map to look for key
:param key: key to find
:return: true if key is in dict and not None
"""
if... | # Copyright (c) 2015 Nicolas JOUANIN
#
# See the file license.txt for copying permission.
def not_in_dict_or_none(dict, key):
"""
Check if a key exists in a map and if it's not None
:param dict: map to look for key
:param key: key to find
:return: true if key is in dict and not None
"""
if... | <commit_before># Copyright (c) 2015 Nicolas JOUANIN
#
# See the file license.txt for copying permission.
def not_in_dict_or_none(dict, key):
"""
Check if a key exists in a map and if it's not None
:param dict: map to look for key
:param key: key to find
:return: true if key is in dict and not None... |
1307d737a73122d948fd106ca39274b7cf505f89 | Lib/test/test_threading.py | Lib/test/test_threading.py | # Very rudimentary test of threading module
# Create a bunch of threads, let each do some work, wait until all are done
from test_support import verbose
import random
import threading
import time
numtasks = 10
# no more than 3 of the 10 can run at once
sema = threading.BoundedSemaphore(value=3)
mutex = threading.RL... | # Very rudimentary test of threading module
# Create a bunch of threads, let each do some work, wait until all are done
from test_support import verbose
import random
import threading
import time
# This takes about n/3 seconds to run (about n/3 clumps of tasks, times
# about 1 second per clump).
numtasks = 10
# no ... | Test failed because these was no expected-output file, but always printed to stdout. Repaired by not printing at all except in verbose mode. | Test failed because these was no expected-output file, but always printed
to stdout. Repaired by not printing at all except in verbose mode.
Made the test about 6x faster -- envelope analysis showed it took time
proportional to the square of the # of tasks. Now it's linear.
| Python | mit | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | # Very rudimentary test of threading module
# Create a bunch of threads, let each do some work, wait until all are done
from test_support import verbose
import random
import threading
import time
numtasks = 10
# no more than 3 of the 10 can run at once
sema = threading.BoundedSemaphore(value=3)
mutex = threading.RL... | # Very rudimentary test of threading module
# Create a bunch of threads, let each do some work, wait until all are done
from test_support import verbose
import random
import threading
import time
# This takes about n/3 seconds to run (about n/3 clumps of tasks, times
# about 1 second per clump).
numtasks = 10
# no ... | <commit_before># Very rudimentary test of threading module
# Create a bunch of threads, let each do some work, wait until all are done
from test_support import verbose
import random
import threading
import time
numtasks = 10
# no more than 3 of the 10 can run at once
sema = threading.BoundedSemaphore(value=3)
mutex... | # Very rudimentary test of threading module
# Create a bunch of threads, let each do some work, wait until all are done
from test_support import verbose
import random
import threading
import time
# This takes about n/3 seconds to run (about n/3 clumps of tasks, times
# about 1 second per clump).
numtasks = 10
# no ... | # Very rudimentary test of threading module
# Create a bunch of threads, let each do some work, wait until all are done
from test_support import verbose
import random
import threading
import time
numtasks = 10
# no more than 3 of the 10 can run at once
sema = threading.BoundedSemaphore(value=3)
mutex = threading.RL... | <commit_before># Very rudimentary test of threading module
# Create a bunch of threads, let each do some work, wait until all are done
from test_support import verbose
import random
import threading
import time
numtasks = 10
# no more than 3 of the 10 can run at once
sema = threading.BoundedSemaphore(value=3)
mutex... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.