commit stringlengths 40 40 | old_file stringlengths 4 236 | new_file stringlengths 4 236 | old_contents stringlengths 1 3.26k | new_contents stringlengths 16 4.43k | subject stringlengths 16 624 | message stringlengths 17 3.29k | lang stringclasses 5
values | license stringclasses 13
values | repos stringlengths 5 91.5k |
|---|---|---|---|---|---|---|---|---|---|
73eacdde5067e60f40af000237d198748c5b3cc7 | PYNWapp/PYNWsite/models.py | PYNWapp/PYNWsite/models.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from django.utils import timezone
# Create your models here.
class Event(models.Model):
name = models.CharField(max_length=200)
location = models.CharField(max_length=300)
event_date = models.DateTimeField('event... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from django.utils import timezone
# Create your models here.
class Event(models.Model):
name = models.CharField(max_length=200)
location = models.CharField(max_length=300)
event_date = models.DateTimeField('event... | Fix plural name for Categories model. | Fix plural name for Categories model.
| Python | mit | PythonNorthwestEngland/pynw-website,PythonNorthwestEngland/pynw-website |
a31a46053df5e0b86b07b95ef5f460dcb2c12f5f | poppy/transport/app.py | poppy/transport/app.py | # Copyright (c) 2014 Rackspace, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | # Copyright (c) 2014 Rackspace, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | Add extra config file env variable option | Add extra config file env variable option
Change-Id: Ic88b442098eff0c2e3a8cc3cb527fa3d29f085ea
| Python | apache-2.0 | stackforge/poppy,stackforge/poppy,openstack/poppy,openstack/poppy,openstack/poppy,stackforge/poppy |
53a93d4d1c0029e5d616e225b1b86672b1e0f7c8 | falafel/mappers/hostname.py | falafel/mappers/hostname.py | from .. import Mapper, mapper
@mapper("facts")
@mapper("hostname")
class Hostname(Mapper):
def parse_content(self, content):
fqdn = None
if len(content) == 1:
fqdn = content[0].strip()
elif len(content) > 1:
for line in content:
if line.startswith('... | from .. import Mapper, mapper
@mapper("hostname")
class Hostname(Mapper):
"""Class for parsing ``hostname`` command output.
Attributes:
fqdn: The fully qualified domain name of the host. The same to
``hostname`` when domain part is not set.
hostname: The hostname.
domain: ... | Remove the decorate `facts` from mapper `Hostname` | Remove the decorate `facts` from mapper `Hostname`
- And update the class comment
| Python | apache-2.0 | RedHatInsights/insights-core,RedHatInsights/insights-core |
a76c7ddc80c3896dd4397b4713de267001706722 | thefederation/migrations/0020_remove_port_from_node_hostnames.py | thefederation/migrations/0020_remove_port_from_node_hostnames.py | # Generated by Django 2.0.13 on 2019-12-29 21:11
from django.db import migrations
from django.db.migrations import RunPython
def forward(apps, schema):
Node = apps.get_model("thefederation", "Node")
for node in Node.objects.filter(host__contains=":"):
node.host = node.host.split(":")[0]
if no... | # Generated by Django 2.0.13 on 2019-12-29 21:11
from django.db import migrations, IntegrityError
from django.db.migrations import RunPython
def forward(apps, schema):
Node = apps.get_model("thefederation", "Node")
for node in Node.objects.filter(host__contains=":"):
node.host = node.host.split(":")[... | Make port removing migrating a bit less flaky | Make port removing migrating a bit less flaky
| Python | agpl-3.0 | jaywink/the-federation.info,jaywink/the-federation.info,jaywink/the-federation.info |
f85a252b44a30f8b793e77c3bf7188ea8058217a | keras/mixed_precision/__init__.py | keras/mixed_precision/__init__.py | # Copyright 2020 The TensorFlow Authors. 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 applica... | # Copyright 2020 The TensorFlow Authors. 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 applica... | Make mixed precision API available in `keras.mixed_precision`. | Make mixed precision API available in `keras.mixed_precision`.
PiperOrigin-RevId: 433886558
| Python | apache-2.0 | keras-team/keras,keras-team/keras |
22465e0ae238a6584a8549796f4dfbae21db73dc | ooni/tests/test_geoip.py | ooni/tests/test_geoip.py | import os
from twisted.internet import defer
from twisted.trial import unittest
from ooni.tests import is_internet_connected
from ooni.settings import config
from ooni import geoip
class TestGeoIP(unittest.TestCase):
def test_ip_to_location(self):
location = geoip.IPToLocation('8.8.8.8')
assert ... |
from twisted.internet import defer
from twisted.trial import unittest
from ooni.tests import is_internet_connected
from ooni import geoip
class TestGeoIP(unittest.TestCase):
def test_ip_to_location(self):
location = geoip.IPToLocation('8.8.8.8')
assert 'countrycode' in location
assert 'a... | Add unittests for geoip database version | Add unittests for geoip database version
| Python | bsd-2-clause | juga0/ooni-probe,0xPoly/ooni-probe,Karthikeyan-kkk/ooni-probe,juga0/ooni-probe,0xPoly/ooni-probe,Karthikeyan-kkk/ooni-probe,juga0/ooni-probe,0xPoly/ooni-probe,lordappsec/ooni-probe,kdmurray91/ooni-probe,lordappsec/ooni-probe,kdmurray91/ooni-probe,Karthikeyan-kkk/ooni-probe,Karthikeyan-kkk/ooni-probe,lordappsec/ooni-pro... |
0413977c6f45799599fbd4f197c3c42ef0d0835f | queryexpander/expansion.py | queryexpander/expansion.py | import numpy as np
import pandas as pd
from typing import Tuple, List
from queryexpander.semantic_similarity import CppSemanticSimilarity
class QueryExpander:
def __init__(self, vocabulary_path: str, vocabulary_length: int, sums_cache_file: str, centroids_file_path: str):
self._words: List[str] = pd.read... | import numpy as np
import pandas as pd
from typing import Tuple, List
from queryexpander.semantic_similarity import CppSemanticSimilarity
class QueryExpander:
def __init__(self, vocabulary_path: str, vocabulary_length: int, sums_cache_file: str, centroids_file_path: str):
self._words: List[str] = pd.read... | Fix C++ accelerator constructor invocation | Fix C++ accelerator constructor invocation
| Python | mit | konraddysput/BioDocumentAnalysis |
047483d9897e75f8284c39e8477a285763da7b37 | heufybot/modules/util/commandhandler.py | heufybot/modules/util/commandhandler.py | from twisted.plugin import IPlugin
from heufybot.moduleinterface import BotModule, IBotModule
from zope.interface import implements
class CommandHandler(BotModule):
implements(IPlugin, IBotModule)
name = "CommandHandler"
def actions(self):
return [ ("message-channel", 1, self.handleChannelMessag... | from twisted.plugin import IPlugin
from heufybot.moduleinterface import BotModule, IBotModule
from zope.interface import implements
class CommandHandler(BotModule):
implements(IPlugin, IBotModule)
name = "CommandHandler"
def actions(self):
return [ ("message-channel", 1, self.handleChannelMessag... | Make the bot respond to its name | Make the bot respond to its name
Implements GH-7
| Python | mit | Heufneutje/PyHeufyBot,Heufneutje/PyHeufyBot |
cbbf178a59561e828214ff88e0c73ec0716fa926 | tests/test_ensure_do_cleanups.py | tests/test_ensure_do_cleanups.py | from unittesting import DeferrableTestCase
class TestDoCleanups(DeferrableTestCase):
def test_ensure_do_cleanups_works(self):
messages = []
def work(message):
messages.append(message)
self.addCleanup(work, 1)
yield from self.doCleanups()
self.assertEqual(mes... | from unittesting import DeferrableTestCase
class TestExplicitDoCleanups(DeferrableTestCase):
def test_manually_calling_do_cleanups_works(self):
messages = []
def work(message):
messages.append(message)
self.addCleanup(work, 1)
yield from self.doCleanups()
se... | Test implicit `doCleanups` on tearDown | Test implicit `doCleanups` on tearDown
| Python | mit | randy3k/UnitTesting,randy3k/UnitTesting,randy3k/UnitTesting,randy3k/UnitTesting |
27f5676656e7507883ba365d2639e5f3cb5b0b58 | snippets/keras_testing.py | snippets/keras_testing.py | from keras.models import Sequential
from keras.layers import Dense, Dropout
import sys
import numpy as np
def main():
input_filename = sys.argv[1]
training = np.loadtxt('data/%s.csv' % input_filename, delimiter=',')
test = np.loadtxt('data/%s_test.csv' % input_filename, delimiter=',')
y_train = traini... | from keras.models import Sequential
from keras.layers import Dense, Dropout
import sys
import numpy as np
def main():
input_filename = sys.argv[1]
num_networks = int(sys.argv[2])
training = np.loadtxt('data/%s.csv' % input_filename, delimiter=',')
test = np.loadtxt('data/%s_test.csv' % input_filename,... | Tweak parameters and allow runs over multiple networks | Tweak parameters and allow runs over multiple networks
| Python | mit | farthir/msc-project |
8b1516e638244824b1eafed7dc4abb2dc087ec74 | nuts/nuts.py | nuts/nuts.py | #!/usr/bin/env python2
import os
import sys
import argparse
import logging
import datetime
from src.application.Logger import Logger
from src.application.ValidationController import ValidationController
from src.application.TestController import TestController
def main(argv):
logger = Logger()
parser = argpa... | #!/usr/bin/env python2
import os
import sys
import argparse
import logging
import datetime
import colorama
from src.application.Logger import Logger
from src.application.ValidationController import ValidationController
from src.application.TestController import TestController
def main(argv):
colorama.init()
... | Add colorama for coloring on windows | Add colorama for coloring on windows
Add the module colorama that makes ANSI escape character sequences work under MS Windows. The coloring is used to give a better overview about the testresults
| Python | mit | HSRNetwork/Nuts |
37fd9a33d840d309e0b42239e86ceda08b1425c2 | scripts/list_migrations.py | scripts/list_migrations.py | #!/usr/bin/env python
# encoding: utf-8
from __future__ import print_function
import sys
from alembic.script import ScriptDirectory
def detect_heads(migrations):
heads = migrations.get_heads()
return heads
def version_history(migrations):
version_history = [
(m.revision, m.doc) for m in migra... | #!/usr/bin/env python
# encoding: utf-8
from __future__ import print_function
import sys
import warnings
from alembic.script import ScriptDirectory
warnings.simplefilter('error')
def detect_heads(migrations):
heads = migrations.get_heads()
return heads
def version_history(migrations):
version_histor... | Abort migrations check if a version is present more than once | Abort migrations check if a version is present more than once
list_migrations checks whether we have more than one branch in the
list of migration versions. Since we've switched to a new revision
naming convention, pull requests open at the same time are likely
to use the same revision number when adding new migration... | Python | mit | alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api |
12906fd952bb03a98411ccf51f1ab40e6f580e3a | surveil/tests/api/controllers/v1/test_hello.py | surveil/tests/api/controllers/v1/test_hello.py | # Copyright 2014 - Savoir-Faire Linux inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | # Copyright 2014 - Savoir-Faire Linux inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | Use self.assertEqual instead of assert | Use self.assertEqual instead of assert
Change-Id: Icae26d907eec2c4ab9f430c69491a96bd549c45a
| Python | apache-2.0 | stackforge/surveil,openstack/surveil,openstack/surveil,stackforge/surveil |
2ad6b7b57b20e75c5a98cb64d11b74e536057906 | diary/forms.py | diary/forms.py | from django import forms
import cube.diary.models
class DiaryIdeaForm(forms.ModelForm):
class Meta(object):
model = cube.diary.models.DiaryIdea
class EventForm(forms.ModelForm):
class Meta(object):
model = cube.diary.models.Event
# Ensure soft wrapping is set for textareas:
wid... | from django import forms
import cube.diary.models
class DiaryIdeaForm(forms.ModelForm):
class Meta(object):
model = cube.diary.models.DiaryIdea
class EventForm(forms.ModelForm):
class Meta(object):
model = cube.diary.models.Event
# Ensure soft wrapping is set for textareas:
wid... | Set booked_by for cloned/additional showings | Set booked_by for cloned/additional showings
| Python | agpl-3.0 | BenMotz/cubetoolkit,BenMotz/cubetoolkit,BenMotz/cubetoolkit,BenMotz/cubetoolkit |
75157b852ae174359d1665658d99852bfeca07c3 | reportlab/rl_config.py | reportlab/rl_config.py | #copyright ReportLab Inc. 2000-2001
#see license.txt for license details
#history http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/reportlab/rl_config.py?cvsroot=reportlab
#$Header: /tmp/reportlab/reportlab/rl_config.py,v 1.3 2001/04/05 09:30:11 rgbecker Exp $
import sys
from reportlab.lib import pagesizes
shapeChecking =... | #copyright ReportLab Inc. 2000-2001
#see license.txt for license details
#history http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/reportlab/rl_config.py?cvsroot=reportlab
#$Header: /tmp/reportlab/reportlab/rl_config.py,v 1.4 2001/04/17 18:28:54 rgbecker Exp $
import sys
from reportlab.lib import pagesizes
shapeChecking =... | Fix typo in T1SearchPath name | Fix typo in T1SearchPath name
| Python | bsd-3-clause | makinacorpus/reportlab-ecomobile,makinacorpus/reportlab-ecomobile,makinacorpus/reportlab-ecomobile,makinacorpus/reportlab-ecomobile,makinacorpus/reportlab-ecomobile |
f8677eff328d50e16b51c2802b3f9e168c38534b | user_test.py | user_test.py | #!/usr/bin/env python
try:
import sympy
except ImportError:
print("sympy is required")
else:
if sympy.__version__ < '0.7.5':
print("SymPy version 0.7.5 or newer is required. You have", sympy.__version__)
if sympy.__version__ != '0.7.5':
print("The stable SymPy version 0.7.5 is recomme... | #!/usr/bin/env python
try:
import sympy
except ImportError:
print("sympy is required")
else:
if sympy.__version__ < '1.0':
print("SymPy version 1.0 or newer is required. You have", sympy.__version__)
if sympy.__version__ != '1.0':
print("The stable SymPy version 1.0 is recommended. Yo... | Update SymPy/IPython version in test script | Update SymPy/IPython version in test script
| Python | bsd-3-clause | leosartaj/scipy-2016-tutorial,aktech/scipy-2016-tutorial |
df21a8558f28887b3f38a892e8c7f45c12169764 | src/ansible/urls.py | src/ansible/urls.py | from django.conf.urls import url
from ansible.forms import AnsibleForm1, AnsibleForm2
from ansible.views import (
PlaybookWizard, PlaybookListView, PlaybookDetailView,
PlaybookFileView
)
from . import views
urlpatterns = [
url(r'^create/$', PlaybookWizard.as_view([AnsibleForm1, AnsibleForm2])),
url(r'... | from django.conf.urls import url
from ansible.forms import AnsibleForm1, AnsibleForm2
from ansible.views import (
PlaybookWizard, PlaybookListView, PlaybookDetailView,
PlaybookFileEditView, PlaybookFileView
)
from . import views
urlpatterns = [
url(r'^create/$', PlaybookWizard.as_view([AnsibleForm1, Ansib... | Add PlaybookFile edit view url | Add PlaybookFile edit view url
| Python | bsd-3-clause | lozadaOmr/ansible-admin,lozadaOmr/ansible-admin,lozadaOmr/ansible-admin |
fdd6f31c582318bbbb1ca8b408a7a3194e5de85a | groundstation/gref.py | groundstation/gref.py | import os
class Gref(object):
def __init__(self, store, channel, identifier):
self.store = store
self.channel = channel.replace("/", "_")
self.identifier = identifier
def node_path(self):
node_path = os.path.join(self.store.gref_path(),
self.ch... | import os
class Gref(object):
def __init__(self, store, channel, identifier):
self.store = store
self.channel = channel.replace("/", "_")
self.identifier = identifier
def node_path(self):
node_path = os.path.join(self.store.gref_path(),
self.ch... | Fix broken attempts to open r+ non existant files | Fix broken attempts to open r+ non existant files
| Python | mit | richo/groundstation,richo/groundstation,richo/groundstation,richo/groundstation,richo/groundstation |
4304409d6f6028cb5f22edd97b8ecffa197dd9ed | server.py | server.py | import asyncio
import logging
# https://pypi.python.org/pypi/websockets
import websockets
clients = set()
logging.basicConfig(level=logging.INFO)
@asyncio.coroutine
def chat(websocket, uri):
clients.add(websocket)
while True:
msg = yield from websocket.recv()
if msg is None:
retu... | import asyncio
import logging
# https://pypi.python.org/pypi/websockets
import websockets
clients = set()
logging.basicConfig(level=logging.INFO)
@asyncio.coroutine
def chat(websocket, uri):
clients.add(websocket)
while True:
msg = yield from websocket.recv()
if msg is None:
retu... | Use Task instead of run_until_complete | Use Task instead of run_until_complete
| Python | unlicense | ajdavis/asyncio-chat-example,ajdavis/asyncio-chat-example |
301463a99dceceb21ecec933f3a83e55ca37c3b8 | wagtail/wagtailimages/api/admin/serializers.py | wagtail/wagtailimages/api/admin/serializers.py | from __future__ import absolute_import, unicode_literals
from collections import OrderedDict
from rest_framework.fields import Field
from ...models import SourceImageIOError
from ..v2.serializers import ImageSerializer
class ImageRenditionField(Field):
"""
A field that generates a rendition with the specif... | from __future__ import absolute_import, unicode_literals
from collections import OrderedDict
from rest_framework.fields import Field
from ...models import SourceImageIOError
from ..v2.serializers import ImageSerializer
class ImageRenditionField(Field):
"""
A field that generates a rendition with the specif... | Use source keyword argument (instead of overriding get_attribute) | Use source keyword argument (instead of overriding get_attribute)
This allows the ImageRenditionField to be used on models that contain an
image field.
| Python | bsd-3-clause | nealtodd/wagtail,mikedingjan/wagtail,FlipperPA/wagtail,torchbox/wagtail,iansprice/wagtail,jnns/wagtail,wagtail/wagtail,zerolab/wagtail,thenewguy/wagtail,iansprice/wagtail,zerolab/wagtail,rsalmaso/wagtail,gasman/wagtail,timorieber/wagtail,kaedroho/wagtail,mikedingjan/wagtail,torchbox/wagtail,thenewguy/wagtail,zerolab/wa... |
e21f17b7d3ee810ce587a67609a53cbe038e5458 | src/pubmed.py | src/pubmed.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import httplib
#import xml.dom.minidom as minidom
#import urllib
import time, sys
import xml.etree.ElementTree as ET
def get_pubmed_abs(pmid):
conn = httplib.HTTPConnection("eutils.ncbi.nlm.nih.gov")
conn.request("GET", '/entrez/eutils/efetch.fcgi?db=pubm... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import httplib
#import xml.dom.minidom as minidom
#import urllib
import time, sys
import xml.etree.ElementTree as ET
def get_pubmed_abs(pmid):
conn = httplib.HTTPConnection("eutils.ncbi.nlm.nih.gov")
conn.request("GET", '/entrez/eutils/efetch.fcgi?db=pubm... | Return Pubmed title and abstract | Return Pubmed title and abstract
| Python | mit | AndreLamurias/IBEnt,AndreLamurias/IBRel,AndreLamurias/IBEnt,AndreLamurias/IBRel |
969bc09c515f208738da67ebf77ef543ab358613 | leonardo_agenda/__init__.py | leonardo_agenda/__init__.py |
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
default_app_config = 'leonardo_agenda.Config'
LEONARDO_OPTGROUP = 'Events'
LEONARDO_APPS = [
'leonardo_agenda',
'elephantagenda',
'elephantagenda.backends.agenda'
]
LEONARDO_WIDGETS = [
'leonardo_agenda.models.... |
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
default_app_config = 'leonardo_agenda.Config'
LEONARDO_OPTGROUP = 'Events'
LEONARDO_APPS = [
'leonardo_agenda',
'elephantagenda',
'elephantagenda.backends.agenda'
]
LEONARDO_WIDGETS = [
'leonardo_agenda.models.... | Use leonardo helper for declare html text widget. | Use leonardo helper for declare html text widget.
| Python | bsd-3-clause | leonardo-modules/leonardo-agenda,leonardo-modules/leonardo-agenda,leonardo-modules/leonardo-agenda |
06cf113cc45e7eaa8ab63e2791c2f2a0990ac946 | EasyEuler/data.py | EasyEuler/data.py | import json
import os
from jinja2 import Environment, FileSystemLoader
BASE_PATH = os.path.abspath(os.path.dirname(__file__))
DATA_PATH = os.path.join(BASE_PATH, 'data')
TEMPLATE_PATH = os.path.join(BASE_PATH, 'templates')
CONFIG_PATH = os.path.join(BASE_PATH, 'config.json')
templates = Environment(loader=FileSystem... | import collections
import json
import os
from jinja2 import Environment, FileSystemLoader
BASE_PATH = os.path.abspath(os.path.dirname(__file__))
DATA_PATH = os.path.join(BASE_PATH, 'data')
TEMPLATE_PATH = os.path.join(BASE_PATH, 'templates')
CONFIG_PATH = os.path.join(BASE_PATH, 'config.json')
with open('%s/problems... | Add support for XDG spec configuration | Add support for XDG spec configuration
| Python | mit | Encrylize/EasyEuler |
77d491ea43fcd00dcfcee1f0b9c2fdb50dc50c8e | tests/test_models.py | tests/test_models.py | import unittest
from datetime import datetime
from twofa import create_app, db
from twofa.models import User
class UserTestCase(unittest.TestCase):
def setUp(self):
self.app = create_app('testing')
db.create_all()
def tearDown(self):
db.session.remove()
db.drop_all()
def ... | import unittest
from twofa import create_app, db
from twofa.models import User
from unittest.mock import patch
class UserTestCase(unittest.TestCase):
def setUp(self):
self.app = create_app('testing')
self.user = User(
'example@example.com',
'fakepassword',
'Ali... | Add some tests for the model | Add some tests for the model
| Python | mit | TwilioDevEd/authy2fa-flask,TwilioDevEd/authy2fa-flask,TwilioDevEd/authy2fa-flask,TwilioDevEd/authy2fa-flask |
69a763860202c42026b2c7146dcf915e30bc3f9b | misc/utils/LogTools/LogView.py | misc/utils/LogTools/LogView.py | import threading
import socket
import logging
import os
import colorama
from termcolor import colored
from collections import deque
markerStack = deque([''])
def colorMessage(message):
if 'Info' in message :
print(colored(message, 'green'))
elif 'Error' in message :
print(colored(message, 're... | """Usage: logview [options]
Options:
-h, --help show this help message
-v, --verbose print status messages
--ignore=loglevels ignore logs of the specified levels
"""
import threading
import socket
import logging
import os
import colorama
import docopt
from termcolor import colored
from collections import deque
... | Add docopt - not finished | Add docopt - not finished
| Python | mit | xfleckx/BeMoBI,xfleckx/BeMoBI |
0547675bc4530681181005d1f502a43baf7deb56 | napalm_ios/__init__.py | napalm_ios/__init__.py | # Copyright 2016 Dravetech AB. All rights reserved.
#
# The contents of this file are 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 req... | # Copyright 2016 Dravetech AB. All rights reserved.
#
# The contents of this file are 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 req... | Verify fails travis-ci due to pylama (just a test | Verify fails travis-ci due to pylama (just a test
| Python | apache-2.0 | spotify/napalm,napalm-automation/napalm-ios,napalm-automation/napalm,spotify/napalm |
8378b474fca360696adc8a7c11439ac78912fab4 | tools/test_filter.py | tools/test_filter.py | {
'bslstl_iteratorutil': [ {'OS': 'SunOS'} ],
'bslstl_unorderedmultiset': [ {'OS': 'SunOS'} ],
'bsls_atomic' : [
{'case': 7, 'HOST': 'VM', 'policy': 'skip' },
{'case': 8, 'HOST': 'VM', 'policy': 'skip' },
],
'bsls_stopwatch' : [ {'case': 6, 'HOST': 'VM', 'policy': 'skip' } ],
}
| {
'bsls_atomic' : [
{'case': 7, 'HOST': 'VM', 'policy': 'skip' },
{'case': 8, 'HOST': 'VM', 'policy': 'skip' },
],
'bsls_stopwatch' : [ {'case': 6, 'HOST': 'VM', 'policy': 'skip' } ],
}
| Remove test driver exceptions for bslstl_iteratorutil and bslstl_unorderedmultiset on Sun | Remove test driver exceptions for bslstl_iteratorutil and bslstl_unorderedmultiset on Sun
| Python | apache-2.0 | mversche/bde,gbleaney/Allocator-Benchmarks,abeels/bde,RMGiroux/bde-allocator-benchmarks,bowlofstew/bde,abeels/bde,che2/bde,saxena84/bde,minhlongdo/bde,jmptrader/bde,che2/bde,dharesign/bde,bloomberg/bde-allocator-benchmarks,bloomberg/bde-allocator-benchmarks,apaprocki/bde,jmptrader/bde,osubboo/bde,bloomberg/bde-allocato... |
826251dc100914bf644f09acafba0f01d168a797 | mysite/haystack_configuration.py | mysite/haystack_configuration.py | ################ We could, import haystack, but what's the point?
#import haystack
################# The docs suggest we do this:
#haystack.autodiscover()
################# but we will NOT because this causes explosions in the sky.
################# We should talk to the Haystack folks. It seems that they have
#######... | ### The docs suggest we do this:
import haystack
haystack.autodiscover()
| Use haystack.autodiscover() again, in the hopes it no longer breaks the world | Use haystack.autodiscover() again, in the hopes it no longer breaks the world
| Python | agpl-3.0 | SnappleCap/oh-mainline,vipul-sharma20/oh-mainline,mzdaniel/oh-mainline,nirmeshk/oh-mainline,moijes12/oh-mainline,openhatch/oh-mainline,Changaco/oh-mainline,mzdaniel/oh-mainline,mzdaniel/oh-mainline,mzdaniel/oh-mainline,sudheesh001/oh-mainline,Changaco/oh-mainline,moijes12/oh-mainline,sudheesh001/oh-mainline,nirmeshk/oh... |
3e42af8ac949032d8dc2c4bc181a64fc2fbed651 | downstream_node/models.py | downstream_node/models.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from sqlalchemy import Table | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from downstream_node.startup import db
class Files(db.Model):
__tablename__ = 'files'
id = db.Column(db.Integer(), primary_key=True, autoincrement=True)
filepath = db.Column('filepath', db.String())
class Challenges(db.Model):
__tablename__ = 'challenge... | Add model stuff into DB | Add model stuff into DB
| Python | mit | Storj/downstream-node,Storj/downstream-node |
599e2328ba0ab4f5fa467a363e35b8c99392ad3c | elvis/utils.py | elvis/utils.py | from datetime import datetime, timedelta
import pytz
DATE_PREFIX = '/Date('
DATE_SUFFIX = ')/'
ELVIS_TIMEZONE = pytz.timezone('Europe/Tallinn')
def decode_elvis_timestamp(timestamp: str):
"""Try to convert the argument to timestamp using ELVIS rules, return it unmodified if impossible"""
str_timestamp = str... | from datetime import datetime
import pytz
DATE_PREFIX = '/Date('
DATE_SUFFIX = ')/'
ELVIS_TIMEZONE = pytz.timezone('Europe/Tallinn')
UTC = pytz.timezone('UTC')
def decode_elvis_timestamp(timestamp: str):
"""Try to convert the argument to timestamp using ELVIS rules, return it unmodified if impossible"""
str... | Fix date parsing having wrong offset | Fix date parsing having wrong offset
| Python | bsd-2-clause | thorgate/python-lvis |
80326d96a8137c1d285d3c24eda15039e03dedfe | opps/contrib/logging/models.py | opps/contrib/logging/models.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.db import models
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from opps.core.models import NotUserPublishable
class Logging(NotUserPublishable):
user = models.ForeignKey(
settings.AUTH_USER_MODEL,
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.db import models
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from opps.core.models import NotUserPublishable
class Logging(NotUserPublishable):
user = models.ForeignKey(
settings.AUTH_USER_MODEL,
... | Add index in text field on Logging | Add index in text field on Logging
| Python | mit | opps/opps,williamroot/opps,opps/opps,williamroot/opps,YACOWS/opps,opps/opps,jeanmask/opps,jeanmask/opps,YACOWS/opps,jeanmask/opps,YACOWS/opps,YACOWS/opps,williamroot/opps,jeanmask/opps,williamroot/opps,opps/opps |
00c87d7b169119c8d9e5972d47ec9293870f313f | gui.py | gui.py | import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
class MainWindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="Text Playing Game")
self.set_border_width(10)
self.set_size_request(500, 400)
win = MainWindow()
win.connect("delete-event", Gtk.ma... | import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
class MainWindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="Text Playing Game")
self.set_border_width(10)
self.set_size_request(400, 350)
box = Gtk.Box(orientation=Gtk.Orientation.VERT... | Set up beginning template - definitely requires changes | Set up beginning template -
definitely requires changes
| Python | mit | Giovanni21M/Text-Playing-Game |
1079550f0742a446c1b64e6080a40e06ffa6a30d | nova/policies/instance_actions.py | nova/policies/instance_actions.py | # Copyright 2016 Cloudbase Solutions Srl
# 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 r... | # Copyright 2016 Cloudbase Solutions Srl
# 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 r... | Add policy description for instance actions | Add policy description for instance actions
This commit adds policy doc for instance actions policies.
Partial implement blueprint policy-docs
Change-Id: Id336b660fb687d096cd55bf8758dc408c45f9382
| Python | apache-2.0 | gooddata/openstack-nova,vmturbo/nova,rahulunair/nova,rajalokan/nova,klmitch/nova,openstack/nova,openstack/nova,vmturbo/nova,mikalstill/nova,mahak/nova,klmitch/nova,openstack/nova,mikalstill/nova,vmturbo/nova,mahak/nova,phenoxim/nova,mikalstill/nova,klmitch/nova,gooddata/openstack-nova,Juniper/nova,gooddata/openstack-no... |
720996b538862220a3b6c822beff52840e53aaac | seleniumbase/config/proxy_list.py | seleniumbase/config/proxy_list.py | """
Proxy Server "Phone Book".
Simplify running browser tests through a proxy server
by adding your frequently-used proxies here.
Now you can do something like this on the command line:
"pytest SOME_TEST.py --proxy=proxy1"
Format of PROXY_LIST server entries:
* "ip_address:port" OR "username:password@ip_address:po... | """
Proxy Server "Phone Book".
Simplify running browser tests through a proxy server
by adding your frequently-used proxies here.
Now you can do something like this on the command line:
"pytest SOME_TEST.py --proxy=proxy1"
Format of PROXY_LIST server entries:
* "ip_address:port" OR "username:password@ip_address:po... | Update the sample proxy list | Update the sample proxy list
| Python | mit | mdmintz/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase |
5c9100b40ce5d99368ace789f8545be10ec9db71 | providers/tasks/gog.py | providers/tasks/gog.py | """ Compare GOG games to the Lutris library """
import os
from celery import task
from celery.utils.log import get_task_logger
from django.conf import settings
from providers.gog import load_games_from_gogdb, match_from_gogdb
LOGGER = get_task_logger(__name__)
@task
def load_gog_games():
"""Task to load GOG g... | """ Compare GOG games to the Lutris library """
import os
from celery import task
from celery.utils.log import get_task_logger
from django.conf import settings
from providers.gog import load_games_from_gogdb, match_from_gogdb
from common.models import save_action_log
LOGGER = get_task_logger(__name__)
@task
def lo... | Add stats logging for GOG tasks | Add stats logging for GOG tasks
| Python | agpl-3.0 | lutris/website,lutris/website,lutris/website,lutris/website |
5ff2a8655caa66369733d7c151f36737217498f8 | scoring_engine/db.py | scoring_engine/db.py | import bcrypt
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from scoring_engine.config import config
isolation_level = "READ COMMITTED"
if 'sqlite' in config.db_uri:
# sqlite db does not support transaction based statements
# so we have to manually set it to som... | import bcrypt
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from scoring_engine.config import config
isolation_level = "READ COMMITTED"
if 'sqlite' in config.db_uri:
# sqlite db does not support transaction based statements
# so we have to manually set it to som... | Add monkeypatch for session query problems | Add monkeypatch for session query problems
| Python | mit | pwnbus/scoring_engine,pwnbus/scoring_engine,pwnbus/scoring_engine,pwnbus/scoring_engine |
6c929f04559698a5988aaa3b03d42a03c091fc57 | pyes/tests/pyestest.py | pyes/tests/pyestest.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Unit tests for pyes. These require an es server with thrift plugin running on the default port (localhost:9500).
"""
import unittest
from pyes import ES, file_to_attachment
from pyes.exceptions import NotFoundException
from pprint import pprint
import os
class ESTestCase... | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Unit tests for pyes. These require an es server with thrift plugin running on the default port (localhost:9500).
"""
import unittest
from pyes import ES, file_to_attachment
from pyes.exceptions import NotFoundException
from pprint import pprint
import os
class ESTestCase... | Add a checkRaises method to check that an exception is raised, but also return it for futher tests. | Add a checkRaises method to check that an exception is raised, but also return it for futher tests.
| Python | bsd-3-clause | mouadino/pyes,Fiedzia/pyes,haiwen/pyes,HackLinux/pyes,haiwen/pyes,Fiedzia/pyes,Fiedzia/pyes,aparo/pyes,aparo/pyes,haiwen/pyes,rookdev/pyes,HackLinux/pyes,jayzeng/pyes,HackLinux/pyes,mavarick/pyes,mavarick/pyes,rookdev/pyes,mavarick/pyes,jayzeng/pyes,mouadino/pyes,aparo/pyes,jayzeng/pyes |
95f89ab590555bd4cc6c92b6b24883a27b323d2a | tests/test_methods.py | tests/test_methods.py | from apiritif import http
from unittest import TestCase
class TestRequests(TestCase):
def test_get(self):
http.get('http://blazedemo.com/?tag=get')
def test_post(self):
http.post('http://blazedemo.com/?tag=post')
def test_put(self):
http.put('http://blazedemo.com/?tag=put')
... | from apiritif import http
from unittest import TestCase
class TestHTTPMethods(TestCase):
def test_get(self):
http.get('http://blazedemo.com/?tag=get')
def test_post(self):
http.post('http://blazedemo.com/?tag=post')
def test_put(self):
http.put('http://blazedemo.com/?tag=put')
... | Add a lot more tests | Add a lot more tests
| Python | apache-2.0 | Blazemeter/apiritif,Blazemeter/apiritif |
5c8741b8c4fe7ce447fadeeb1707144903728836 | tests/builtins/test_sum.py | tests/builtins/test_sum.py | from .. utils import TranspileTestCase, BuiltinFunctionTestCase
class SumTests(TranspileTestCase):
pass
class BuiltinSumFunctionTests(BuiltinFunctionTestCase, TranspileTestCase):
functions = ["sum"]
not_implemented = [
'test_bytearray',
'test_bytes',
'test_class',
'test_... | from unittest import expectedFailure
from .. utils import TranspileTestCase, BuiltinFunctionTestCase
class SumTests(TranspileTestCase):
pass
class BuiltinSumFunctionTests(BuiltinFunctionTestCase, TranspileTestCase):
functions = ["sum"]
not_implemented = [
'test_bytearray',
'test_bytes'... | Add extra testcases for `sum`. | Add extra testcases for `sum`.
| Python | bsd-3-clause | ASP1234/voc,Felix5721/voc,cflee/voc,cflee/voc,freakboy3742/voc,pombredanne/voc,gEt-rIgHt-jR/voc,pombredanne/voc,gEt-rIgHt-jR/voc,ASP1234/voc,Felix5721/voc,freakboy3742/voc |
0d5e5bb3eec9a4603b7e0899c296042e09c80911 | gatekeeper/app.py | gatekeeper/app.py | #!/usr/bin/env python3
import bot as chat_bot
from intercom import Intercom
import logging
from facerecognition import FaceRecognition
import nodered
import subprocess
from sys import platform
icom = Intercom()
facerec = FaceRecognition()
doorBellServer = nodered.NodeRedDoorbellServerThread(icom)
doorBellServer.star... | #!/usr/bin/env python3
import bot as chat_bot
from intercom import Intercom
import logging
from facerecognition import FaceRecognition
import nodered
import subprocess
from sys import platform
icom = Intercom()
facerec = FaceRecognition()
doorBellServer = nodered.NodeRedDoorbellServerThread(icom)
doorBellServer.star... | Add a print when running pulseaudio | Add a print when running pulseaudio
| Python | mit | git-commit/iot-gatekeeper,git-commit/iot-gatekeeper |
758227a735c914ace87e6648e95cecc445fe4e68 | lab/provider/files.py | lab/provider/files.py | import os
import io
import errno
from xdg import BaseDirectory
from .common import ProviderError
class Record(object):
def __init__(self, *path):
data_dir = BaseDirectory.save_data_path('lab', 'v1', *path[:-1])
self.path = os.path.join(data_dir, path[-1])
try:
with io.open(sel... | import os
import io
import errno
from xdg import BaseDirectory
from .common import ProviderError
class Record(object):
def __init__(self, *path):
data_dir = BaseDirectory.save_data_path('lab', 'v1', *path[:-1])
self.path = os.path.join(data_dir, path[-1])
try:
with io.open(sel... | Add comment on FileProvider init | Add comment on FileProvider init
I swear I added this prior to merging, somehow slipped through. Sorry
| Python | mpl-2.0 | sangoma/pytestlab |
806fcd76941efe6971709509623876d5181c1f8d | mopidy_subsonic/__init__.py | mopidy_subsonic/__init__.py | from __future__ import unicode_literals
import os
from mopidy import ext, config
__version__ = '0.2'
class SubsonicExtension(ext.Extension):
dist_name = 'Mopidy-Subsonic'
ext_name = 'subsonic'
version = __version__
def get_default_config(self):
conf_file = os.path.join(os.path.dirname(__f... | from __future__ import unicode_literals
import os
from mopidy import ext, config
__version__ = '0.2'
class SubsonicExtension(ext.Extension):
dist_name = 'Mopidy-Subsonic'
ext_name = 'subsonic'
version = __version__
def get_default_config(self):
conf_file = os.path.join(os.path.dirname(__f... | Use new extension setup() API | Use new extension setup() API
| Python | mit | rattboi/mopidy-subsonic |
08e4669d7ac743c152c552edf0617caa1d4934ad | tests/settings-djcelery.py | tests/settings-djcelery.py | __doc__ = """Minimal django settings to run manage.py test command"""
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': __name__,
'ATOMIC': True
}
}
BROKER_BACKEND = 'memory'
ROOT_URLCONF = 'tests.urls'
INSTALLED_APPS = ('djcelery_transactions',
... | __doc__ = """Minimal django settings to run manage.py test command"""
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': __name__
}
}
BROKER_BACKEND = 'memory'
ROOT_URLCONF = 'tests.urls'
INSTALLED_APPS = ('djcelery_transactions',
'test'
... | Make both test settings more similar | Make both test settings more similar
| Python | bsd-2-clause | roverdotcom/django-celery-transactions,stored/django-celery-transactions,fellowshipofone/django-celery-transactions |
86036942f32b629e7d3ccc5307be6b3e03ae4053 | tests/test_content_type.py | tests/test_content_type.py | import pytest
from rest_framework.request import Request
from rest_framework.test import APIRequestFactory
from rest_framework.parsers import JSONParser, FormParser, MultiPartParser
factory = APIRequestFactory()
def test_content_type_override_query():
from rest_url_override_content_negotiation import \
... | import pytest
from rest_framework.request import Request
from rest_framework.test import APIRequestFactory
from rest_framework.parsers import JSONParser, FormParser, MultiPartParser
factory = APIRequestFactory()
def test_content_type_override_query():
from rest_url_override_content_negotiation import \
... | Test that not all content types are overridden | Test that not all content types are overridden
| Python | mit | hzdg/drf-url-content-type-override |
dd35907f9164cd8f75babb1b5b9b6ff9711628fb | djangopeople/djangopeople/management/commands/fix_counts.py | djangopeople/djangopeople/management/commands/fix_counts.py | from django.core.management.base import NoArgsCommand
from ...models import Country, Region
class Command(NoArgsCommand):
"""
Countries and regions keep a denormalized count of people that gets out of
sync during migrate. This updates it.
"""
def handle_noargs(self, **options):
for qs in... | from django.core.management.base import BaseCommand
from ...models import Country, Region
class Command(BaseCommand):
"""
Countries and regions keep a denormalized count of people that gets out of
sync during migrate. This updates it.
"""
def handle(self, **options):
for qs in (Country.o... | Remove usage of deprecated NoArgsCommand | Remove usage of deprecated NoArgsCommand
| Python | mit | brutasse/djangopeople,django/djangopeople,django/djangopeople,django/djangopeople,brutasse/djangopeople,brutasse/djangopeople,brutasse/djangopeople |
5aa55190bae3657e09f6c2fbdedb9ab71210fad5 | cocktails/drinks/models.py | cocktails/drinks/models.py | from django.db import models
# Create your models here.
class Ingredient(models.Model):
name = models.CharField(max_length=100)
abv = models.FloatField()
type = models.CharField(max_length=25)
def __str__(self):
return self.name
class Admin:
list_display = ('name')
class Meta... | from django.db import models
# Create your models here.
class Ingredient(models.Model):
name = models.CharField(max_length=100)
abv = models.FloatField()
type = models.CharField(max_length=25)
def __str__(self):
return self.name
class Admin:
list_display = ('name')
class Meta... | Remove 0.0 from ings line | Remove 0.0 from ings line
| Python | mit | jake-jake-jake/cocktails,jake-jake-jake/cocktails,jake-jake-jake/cocktails,jake-jake-jake/cocktails |
bcd5ea69815405508d7f862754f910fe381172b9 | responsive/context_processors.py | responsive/context_processors.py | from django.core.exceptions import ImproperlyConfigured
from .conf import settings
from .utils import Device
def device(request):
responsive_middleware = 'responsive.middleware.ResponsiveMiddleware'
if responsive_middleware not in settings.MIDDLEWARE_CLASSES:
raise ImproperlyConfigured(
"... | from django.core.exceptions import ImproperlyConfigured
from .conf import settings
from .utils import Device
def device(request):
responsive_middleware = 'responsive.middleware.ResponsiveMiddleware'
if responsive_middleware not in settings.MIDDLEWARE_CLASSES:
raise ImproperlyConfigured(
"... | Update message for missing ResponsiveMiddleware | Update message for missing ResponsiveMiddleware
| Python | bsd-3-clause | mishbahr/django-responsive2,mishbahr/django-responsive2 |
77e78827237b1d3dfcb173075970377d17db4627 | formly/utils/views.py | formly/utils/views.py | from django.contrib.auth.decorators import login_required
from django.core.exceptions import PermissionDenied
from django.urls import reverse
from django.utils.decorators import method_decorator
from django.views.generic import DeleteView
def cbv_decorator(decorator):
def _decorator(cls):
cls.dispatch = m... | from django.contrib.auth.mixins import LoginRequiredMixin
from django.core.exceptions import PermissionDenied
from django.urls import reverse
from django.views.generic import DeleteView
class BaseDeleteView(LoginRequiredMixin, DeleteView):
success_url_name = ""
pk_obj_name = ""
def get_object(self, query... | Use modern login required mixin | Use modern login required mixin
| Python | bsd-3-clause | eldarion/formly,eldarion/formly |
9294f54822d9c73b27cd225fa318c3119a999e4a | pylearn2/training_algorithms/training_algorithm.py | pylearn2/training_algorithms/training_algorithm.py | class TrainingAlgorithm(object):
"""
An abstract superclass that defines the interface of training
algorithms.
"""
def setup(self, model):
"""
Initialize the given training algorithm.
Parameters
----------
model : object
Object that implements the... | class TrainingAlgorithm(object):
"""
An abstract superclass that defines the interface of training
algorithms.
"""
def setup(self, model, dataset):
"""
Initialize the given training algorithm.
Parameters
----------
model : object
Object that imple... | Make TrainingAlgorithm interface to respect reality. | Make TrainingAlgorithm interface to respect reality.
| Python | bsd-3-clause | TNick/pylearn2,caidongyun/pylearn2,alexjc/pylearn2,cosmoharrigan/pylearn2,mclaughlin6464/pylearn2,alexjc/pylearn2,abergeron/pylearn2,kastnerkyle/pylearn2,chrish42/pylearn,pombredanne/pylearn2,JesseLivezey/pylearn2,lamblin/pylearn2,kose-y/pylearn2,msingh172/pylearn2,se4u/pylearn2,lancezlin/pylearn2,w1kke/pylearn2,fulmic... |
98ed31aa995bfdf08b2b069c00ecc0d0b0b29b90 | twitter/endpoints_v1_1.py | twitter/endpoints_v1_1.py | """
API Mapping for Twitter API 1.1
"""
mapping_table = {
'content_type': 'application/json',
'path_prefix': '/1.1',
'search_tweets' : {
'path': '/search/tweets.json',
'valid_params': ['q']
},
}
| """
API Mapping for Twitter API 1.1
"""
mapping_table = {
'content_type': 'application/json',
'path_prefix': '/1.1',
'search_tweets' : {
'path': '/search/tweets.json',
'valid_params': ['q'],
},
'show_status' : {
'path': '/statuses/show.json',
'valid_params': ['id'... | Add method to show a status by id. | Add method to show a status by id.
| Python | mit | alexcchan/twitter |
5383db76e043057217dfbebd2dd484f5b6418260 | app/models.py | app/models.py | from app import db
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(64), index=True, unique=True)
email = db.Column(db.String(120), index=True, unique=True)
posts = db.relationship('Post', backref='author', lazy='dynamic')
def __repr__(self):
re... | from app import db
# Define char limits allowed in names and passwords
user_limits = {'name': 16,
'email': 50}
# Define char limits allowed in titles and bodies of posts
post_limits = {'title': 1000,
'body': 30000}
# of pages
page_limits = {'title': 1000,
'body': 75000}
... | Add Page class and restructure hard-coded character limits | Add Page class and restructure hard-coded character limits
| Python | agpl-3.0 | lasa/website,lasa/website,lasa/website |
2d1290b7a4ba750611a23fe38b7d028f2f0db030 | txircd/modules/cmd_user.py | txircd/modules/cmd_user.py | from twisted.words.protocols import irc
from txircd.modbase import Command
import string
class UserCommand(Command):
def onUse(self, user, data):
if not user.username:
user.registered -= 1
user.username = data["ident"]
user.realname = data["gecos"]
if user.registered == 0:
user.register()
def process... | from twisted.words.protocols import irc
from txircd.modbase import Command
import string
class UserCommand(Command):
def onUse(self, user, data):
if not user.username:
user.registered -= 1
user.username = data["ident"]
user.realname = data["gecos"]
if user.registered == 0:
user.register()
def process... | Fix message with 462 numeric | Fix message with 462 numeric
| Python | bsd-3-clause | ElementalAlchemist/txircd,DesertBus/txircd,Heufneutje/txircd |
201d8d532b907d97823c2dbf61fdd6e75b8eb615 | form_designer/contrib/cms_plugins/form_designer_form/cms_plugins.py | form_designer/contrib/cms_plugins/form_designer_form/cms_plugins.py | from form_designer.contrib.cms_plugins.form_designer_form.models import CMSFormDefinition
from form_designer.views import process_form
from form_designer import settings
from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from django.utils.translation import ugettext as _
class FormDes... | from form_designer.contrib.cms_plugins.form_designer_form.models import CMSFormDefinition
from form_designer.views import process_form
from form_designer import settings
from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from django.utils.translation import ugettext as _
class FormDes... | Disable caching for CMS plugin. | Disable caching for CMS plugin.
CSRF tokens may get cached otherwise.
This is for compatibility with Django CMS 3.0+.
| Python | bsd-3-clause | andersinno/django-form-designer-ai,andersinno/django-form-designer,kcsry/django-form-designer,andersinno/django-form-designer,kcsry/django-form-designer,andersinno/django-form-designer-ai |
d030e9bfaf8cd4f83d0db7728f4f546c48bd8934 | harness/ext/SciKit.py | harness/ext/SciKit.py |
# coding: utf-8
# A jinja extension for the harness
# In[9]:
try:
from .base import HarnessExtension
except:
from base import HarnessExtension
import pandas, sklearn.model_selection as model_selection
from toolz.curried import first
# In[11]:
get_ipython().magic('pinfo2 model_selection.ShuffleSplit')
... |
# coding: utf-8
# A jinja extension for the harness
# In[9]:
try:
from .base import HarnessExtension
except:
from base import HarnessExtension
import pandas, sklearn.model_selection as model_selection
from toolz.curried import first
# In[10]:
class SciKitExtension(HarnessExtension):
alias = 'sklearn... | Fix error message in the scikitlearn extension. | Fix error message in the scikitlearn extension.
| Python | bsd-3-clause | tonyfast/tidy-harness,tonyfast/tidy-harness |
44e21fa7504a4650eb2db0036a66ecf7b0ab5e5d | d_parser/helpers/re_set.py | d_parser/helpers/re_set.py | # re_set.py
# Module for generating regex rules
# r1
import re
class Ree:
float = None
number = None
page_number = None
extract_int = None
@staticmethod
def init():
Ree._is_float()
Ree._is_number()
Ree._is_page_number('')
Ree._extract_int_compile()
@stat... | # re_set.py
# Module for generating regex rules
# r1
import re
class Ree:
float = None
number = None
page_number = None
extract_int = None
extract_float = None
@staticmethod
def init():
Ree._is_float()
Ree._is_number()
Ree._is_page_number('')
Ree._extract... | Add float extractor, fix extractors rules | Add float extractor, fix extractors rules
| Python | mit | Holovin/D_GrabDemo |
18e056339492c8dde9ae53aafa9d53d16d3bb455 | src/mcedit2/editortools/select_block.py | src/mcedit2/editortools/select_block.py | """
select block
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
from PySide import QtGui
from mcedit2.editortools import EditorTool
from mcedit2.util.load_ui import load_ui
log = logging.getLogger(__name__)
class SelectBlockCommand(QtGui.QUndoCommand):
... | """
select block
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
from PySide import QtGui
from mcedit2.editortools import EditorTool
from mcedit2.util.load_ui import load_ui
log = logging.getLogger(__name__)
class SelectBlockTool(EditorTool):
name = "Se... | Select Block is no longer undoable | Select Block is no longer undoable
| Python | bsd-3-clause | vorburger/mcedit2,vorburger/mcedit2,Rubisk/mcedit2,Rubisk/mcedit2 |
75922744effcd1748a9d16887c771149a2026e20 | mfr/ext/pdf/render.py | mfr/ext/pdf/render.py | """PDF renderer module."""
from mfr.core import RenderResult
import PyPDF2
import urllib
def is_valid(fp):
"""Tests file pointer for validity
:return: True if fp is a valid pdf, False if not
"""
try:
PyPDF2.PdfFileReader(fp)
return True
except PyPDF2.utils.PdfReadError:
re... | """PDF renderer module."""
from mfr.core import RenderResult
import PyPDF2
import urllib
import mfr
def is_valid(fp):
"""Tests file pointer for validity
:return: True if fp is a valid pdf, False if not
"""
try:
PyPDF2.PdfFileReader(fp)
return True
except PyPDF2.utils.PdfReadError:... | Change path to mfr directory | Change path to mfr directory
| Python | apache-2.0 | AddisonSchiller/modular-file-renderer,Johnetordoff/modular-file-renderer,rdhyee/modular-file-renderer,mfraezz/modular-file-renderer,TomBaxter/modular-file-renderer,icereval/modular-file-renderer,CenterForOpenScience/modular-file-renderer,mfraezz/modular-file-renderer,mfraezz/modular-file-renderer,Johnetordoff/modular-f... |
e5f22a2e59a44535cde1a3a41ccae4eee440bbf2 | mica/report/tests/test_write_report.py | mica/report/tests/test_write_report.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import tempfile
import os
import shutil
import pytest
from .. import report
try:
import Ska.DBI
with Ska.DBI.DBI(server='sqlsao', dbi='sybase', user='aca_ops', database='axafocat') as db:
assert db.conn._is_connected == 1
HAS_SYBA... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import tempfile
import os
import shutil
import pytest
from .. import report
try:
import Ska.DBI
with Ska.DBI.DBI(server='sqlsao', dbi='sybase', user='aca_ops', database='axafocat') as db:
assert db.conn._is_connected == 1
HAS_SYBA... | Add one more test skip on mica.report | Add one more test skip on mica.report
| Python | bsd-3-clause | sot/mica,sot/mica |
638dda46a63f1c98f674febe170df55fe36cea5e | tests/test_timestepping.py | tests/test_timestepping.py | import numpy as np
from sympy import Eq
import pytest
from devito.interfaces import TimeData
from devito.stencilkernel import StencilKernel
@pytest.fixture
def a(shape=(11, 11)):
"""Forward time data object, unrolled (save=True)"""
return TimeData(name='a', shape=shape, time_order=1,
tim... | import numpy as np
from sympy import Eq
import pytest
from devito.interfaces import Backward, Forward, TimeData
from devito.stencilkernel import StencilKernel
@pytest.fixture
def a(shape=(11, 11)):
"""Forward time data object, unrolled (save=True)"""
return TimeData(name='a', shape=shape, time_order=1,
... | Add explicit test for reverse timestepping | TimeData: Add explicit test for reverse timestepping
| Python | mit | opesci/devito,opesci/devito |
1eea70f8f378477b216b608aaa93e524a900cdf8 | tests/unit/test_stencil.py | tests/unit/test_stencil.py | # -*- coding: utf-8 -*-
import unittest
import stencil
from stencil import Token
class ModuleTestCase(unittest.TestCase):
"""Test cases for the stencil module."""
@staticmethod
def test_tokenise():
"""Test stencil.tokenise() function."""
it_token = stencil.tokenise('abc {{ x }} xyz')
... | # -*- coding: utf-8 -*-
import unittest
import stencil
from stencil import Token
class ModuleTestCase(unittest.TestCase):
"""Test cases for the stencil module."""
@staticmethod
def test_tokenise():
"""Test stencil.tokenise() function."""
it_token = stencil.tokenise('abc {{ x }} xyz')
... | Add simple context push test | Add simple context push test
| Python | mit | funkybob/stencil,funkybob/stencil |
f5c2f39892d3ec10bf00a5df661b3d6bb3a30399 | web_paullaroid/__init__.py | web_paullaroid/__init__.py | from pyramid.config import Configurator
def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
config = Configurator(settings=settings)
config.include('pyramid_chameleon')
config.add_static_view('static', 'static', cache_max_age=3600)
config.add_route('h... | from pyramid.config import Configurator
def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
config = Configurator(settings=settings)
config.include('pyramid_chameleon')
config.add_static_view('static', 'static', cache_max_age=3600)
config.add_route('h... | Add event and image route | Add event and image route
| Python | mit | mips-lab/web_paullaroid,mips-lab/web_paullaroid,mips-lab/web_paullaroid |
4b1ab446ffb396b6ddec8fa593c4225d5878363a | deflect/management/commands/checkurls.py | deflect/management/commands/checkurls.py | from django.core.management.base import NoArgsCommand
from django.core.urlresolvers import reverse
import requests
from deflect.models import ShortURL
class Command(NoArgsCommand):
help = "Validate short URL redirect targets"
def handle_noargs(self, *args, **options):
for url in ShortURL.objects.al... | from django.core.management.base import NoArgsCommand
from django.core.urlresolvers import reverse
import requests
from deflect.models import ShortURL
class Command(NoArgsCommand):
help = "Validate short URL redirect targets"
def handle_noargs(self, *args, **options):
for url in ShortURL.objects.al... | Modify text for management command message | Modify text for management command message
| Python | bsd-3-clause | jbittel/django-deflect |
31d0278bb7eb40e108af1ad455275c86aa462390 | src/helpers/utils.py | src/helpers/utils.py | from __future__ import unicode_literals
from config import settings
import os
import re
import string
import pytz
def clear_screen():
# Clear screen
os.system(['clear', 'cls'][os.name == 'nt'])
def print_obj(obj):
for attr, val in obj.__dict__.iteritems():
print "{0}: {1}".format(attr, val)
d... | from __future__ import unicode_literals
from config import settings
import os
import re
import string
import pytz
def clear_screen():
# Clear screen
os.system(['clear', 'cls'][os.name == 'nt'])
def print_obj(obj):
for attr, val in obj.__dict__.iteritems():
print "{0}: {1}".format(attr, val)
d... | Add data change to updates string only if new value is not None in order to preserve scraped data, that user decided to hide. | Add data change to updates string only if new value is not None in order to preserve scraped data, that user decided to hide.
| Python | mit | lesh1k/VKStalk |
8e6532b9e3d47948f6d1a37b74e54c91a8cdc0b4 | examples/translations/japanese_test_1.py | examples/translations/japanese_test_1.py | # Japanese Language Test
from seleniumbase.translate.japanese import セレニウムテストケース # noqa
class 私のテストクラス(セレニウムテストケース):
def test_例1(self):
self.を開く("https://ja.wikipedia.org/wiki/")
self.テキストを確認する("ウィキペディア")
self.要素を確認する('[title*="メインページに移動する"]')
self.JS入力('input[name="search"]', "アニ... | # Japanese Language Test
from seleniumbase.translate.japanese import セレニウムテストケース # noqa
class 私のテストクラス(セレニウムテストケース):
def test_例1(self):
self.を開く("https://ja.wikipedia.org/wiki/")
self.テキストを確認する("ウィキペディア")
self.要素を確認する('[title*="ウィキペディアへようこそ"]')
self.JS入力('input[name="search"]', "ア... | Update the Japanese example test | Update the Japanese example test
| Python | mit | seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase |
a6935b78a8411fafe05543d928449a98ba89c4be | Orange/tests/test_sparse_table.py | Orange/tests/test_sparse_table.py | import unittest
import numpy as np
from scipy.sparse import csr_matrix, lil_matrix
from Orange import data
from Orange.tests import test_table as tabletests
class InterfaceTest(tabletests.InterfaceTest):
def setUp(self):
super().setUp()
self.table = data.Table.from_numpy(
self.domain... | import unittest
import numpy as np
from scipy.sparse import csr_matrix, lil_matrix
from Orange import data
from Orange.tests import test_table as tabletests
class InterfaceTest(tabletests.InterfaceTest):
def setUp(self):
super().setUp()
self.table = data.Table.from_numpy(
self.domain... | Call same methods on parent class. | Call same methods on parent class.
| Python | bsd-2-clause | marinkaz/orange3,kwikadi/orange3,kwikadi/orange3,qPCR4vir/orange3,qPCR4vir/orange3,marinkaz/orange3,qusp/orange3,marinkaz/orange3,qusp/orange3,cheral/orange3,qPCR4vir/orange3,marinkaz/orange3,cheral/orange3,cheral/orange3,cheral/orange3,qPCR4vir/orange3,kwikadi/orange3,cheral/orange3,qusp/orange3,marinkaz/orange3,marin... |
d2e9289167b538fe5ef83edcbfce3d5f023de088 | lib/core/countpage.py | lib/core/countpage.py | #!/usr/bin/env python
'''
Copyright (c) 2016 anti-XSS developers
'''
class CountPage(object):
__number = 0
def __init__(self, number=0):
self.__number = number
def setNumber(self, number):
self.__number = number
def getNumber(self):
return self.__number
def incNumber(s... | #!/usr/bin/env python
'''
Copyright (c) 2016 anti-XSS developers
'''
class CountPage(object):
number = 0
def __init__(self, number=0):
self.number = number
def setNumber(self, number):
self.number = number
def getNumber(self):
return self.number
def incNumber(self):
... | Modify CountPage to a public class | Modify CountPage to a public class
| Python | mit | lewangbtcc/anti-XSS,lewangbtcc/anti-XSS |
27e7a2a429367b52ae7eff6b1b4aaf9adc212813 | JasmineCoffeeScriptDetectFileType.py | JasmineCoffeeScriptDetectFileType.py | import sublime, sublime_plugin
import os
class JasmineCoffeeScriptDetectFileTypeCommand(sublime_plugin.EventListener):
""" Detects current file type if the file's extension isn't conclusive """
""" Modified for Ruby on Rails and Sublime Text 2 """
""" Original pastie here: http://pastie.org/private/kz8gtts0cjcvk... | import sublime, sublime_plugin
import os
class JasmineCoffeeScriptDetectFileTypeCommand(sublime_plugin.EventListener):
""" Detects current file type if the file's extension isn't conclusive """
def on_load(self, view):
filename = view.file_name()
if not filename: # buffer has never been saved
return... | Remove copied comment from Rspec Syntax detector | Remove copied comment from Rspec Syntax detector
| Python | mit | integrum/sublime-text-jasmine-coffeescript |
a35a25732159e4c8b5655755ce31ec4c3e6e7975 | dummy_robot/dummy_robot_bringup/launch/dummy_robot_bringup.launch.py | dummy_robot/dummy_robot_bringup/launch/dummy_robot_bringup.launch.py | # Copyright 2018 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | # Copyright 2018 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | Switch dummy_robot_bringup to use parameter for rsp. | Switch dummy_robot_bringup to use parameter for rsp.
Signed-off-by: Chris Lalancette <281cd07d7578d97c83271fbbf2faddb83ab3791c@openrobotics.org>
| Python | apache-2.0 | ros2/demos,ros2/demos,ros2/demos,ros2/demos |
123ffcabb6fa783b1524a55dd3dce52ad33a13db | nitrogen/local.py | nitrogen/local.py |
import collections
from werkzeug.local import release_local, Local, LocalManager, LocalStack, allocate_lock
from .proxy import Proxy
class Local(Local):
# Just adding a __dict__ property to the object.
def __init__(self):
super(Local, self).__init__()
object.__setattr__(self, '__storage_... |
import collections
from werkzeug.local import release_local, Local, LocalManager, LocalStack, allocate_lock, get_ident
from .proxy import Proxy
class Local(Local):
# We are extending this class for the only purpose of adding a __dict__
# attribute, so that this will work nearly identically to the builtin... | Fix Local class to work with older werkzeug. | Fix Local class to work with older werkzeug. | Python | bsd-3-clause | mikeboers/Nitrogen,mikeboers/Nitrogen,mikeboers/Nitrogen,mikeboers/Nitrogen,mikeboers/Nitrogen,mikeboers/Nitrogen |
4adb686fc15dc3dfdb872157df27b534f1ca7f98 | tests/QtUiTools/bug_392.py | tests/QtUiTools/bug_392.py | import unittest
import os
from helper import UsesQApplication
from PySide import QtCore, QtGui
from PySide.QtUiTools import QUiLoader
class BugTest(UsesQApplication):
def testCase(self):
w = QtGui.QWidget()
loader = QUiLoader()
filePath = os.path.join(os.path.dirname(__file__), 'action.ui... | import unittest
import os
from helper import UsesQApplication
from PySide import QtCore, QtGui, QtDeclarative
from PySide.QtUiTools import QUiLoader
class BugTest(UsesQApplication):
def testCase(self):
w = QtGui.QWidget()
loader = QUiLoader()
filePath = os.path.join(os.path.dirname(__file... | Extend QUiLoader test to test ui files with custom widgets. | Extend QUiLoader test to test ui files with custom widgets.
| Python | lgpl-2.1 | PySide/PySide,RobinD42/pyside,M4rtinK/pyside-android,IronManMark20/pyside2,PySide/PySide,RobinD42/pyside,PySide/PySide,RobinD42/pyside,RobinD42/pyside,PySide/PySide,M4rtinK/pyside-android,BadSingleton/pyside2,BadSingleton/pyside2,RobinD42/pyside,enthought/pyside,pankajp/pyside,gbaty/pyside2,M4rtinK/pyside-android,IronM... |
fd8c82855f233d2bc7fba482191de46ab5afef5a | wagtailimportexport/tests/test_views.py | wagtailimportexport/tests/test_views.py | import json
import os
import tempfile
import zipfile
from django.core.serializers.json import DjangoJSONEncoder
from django.contrib.auth.models import User
from django.test import TestCase
from wagtailimportexport.compat import Page
from wagtailimportexport import views # read this aloud
class TestViews(TestCase):
... | import json
import os
import tempfile
import zipfile
from django.core.serializers.json import DjangoJSONEncoder
from django.contrib.auth.models import User
from django.test import TestCase, Client
from wagtailimportexport.compat import Page
from django.urls import reverse
from wagtailimportexport import views # read ... | Add tests for wagtailimportexport forms. | Add tests for wagtailimportexport forms.
| Python | agpl-3.0 | openstax/openstax-cms,openstax/openstax-cms,openstax/openstax-cms,openstax/openstax-cms,Connexions/openstax-cms,Connexions/openstax-cms |
3fa49eda98233f4cd76cf4f3b9b1fc02006fb2de | website/search/mutation_result.py | website/search/mutation_result.py | from models import Protein, Mutation
class SearchResult:
def __init__(self, protein, mutation, is_mutation_novel, type, **kwargs):
self.protein = protein
self.mutation = mutation
self.is_mutation_novel = is_mutation_novel
self.type = type
self.meta_user = None
self... | from models import Protein, Mutation
from database import get_or_create
class SearchResult:
def __init__(self, protein, mutation, is_mutation_novel, type, **kwargs):
self.protein = protein
self.mutation = mutation
self.is_mutation_novel = is_mutation_novel
self.type = type
... | Fix result loading for novel mutations | Fix result loading for novel mutations
| Python | lgpl-2.1 | reimandlab/ActiveDriverDB,reimandlab/Visualistion-Framework-for-Genome-Mutations,reimandlab/Visualisation-Framework-for-Genome-Mutations,reimandlab/ActiveDriverDB,reimandlab/ActiveDriverDB,reimandlab/Visualistion-Framework-for-Genome-Mutations,reimandlab/Visualistion-Framework-for-Genome-Mutations,reimandlab/Visualisat... |
bbf3d68b9566a826f404aa1ab3da198d765dca58 | contacts/rules.py | contacts/rules.py | """
contacts.rules
~~~~~~~~~~~~
This module sets rules for Contacts 📕.
:copyright: (c) 2017 by David Heimann.
:license: MIT, see LICENSE for more details.
"""
ALLOWED_FIELDS = [
'name',
'first_name',
'last_name',
'phone_number',
'photo',
'email',
'twitter'
] | """
contacts.rules
~~~~~~~~~~~~
This module sets rules for Contacts 📕.
:copyright: (c) 2017 by David Heimann.
:license: MIT, see LICENSE for more details.
"""
ALLOWED_FIELDS = [
'name',
'phone_number',
'first_name',
'last_name',
'phone_number',
'photo',
'email',
'twitter'
] | Add 'phone_number' field to ALLOWED_FIELDS. | Add 'phone_number' field to ALLOWED_FIELDS.
| Python | mit | heimann/contacts |
12555db92719be1aa96111ac788bc2fba784b5de | mapclientplugins/plainmodelviewerstep/view/plainmodelviewerwidget.py | mapclientplugins/plainmodelviewerstep/view/plainmodelviewerwidget.py | __author__ = 'hsor001'
from PySide import QtGui
from opencmiss.zinc.context import Context
from mapclientplugins.plainmodelviewerstep.view.ui_plainmodelviewerwidget import Ui_PlainModelViewerWidget
class PlainModelViewerWidget(QtGui.QWidget):
def __init__(self, parent=None):
super(PlainModelViewerWidge... | __author__ = 'hsor001'
from PySide import QtGui
from opencmiss.zinc.context import Context
from mapclientplugins.plainmodelviewerstep.view.ui_plainmodelviewerwidget import Ui_PlainModelViewerWidget
class PlainModelViewerWidget(QtGui.QWidget):
def __init__(self, parent=None):
super(PlainModelViewerWidge... | Add functions defineStandardMaterials and defineStandardGlyphs. | Add functions defineStandardMaterials and defineStandardGlyphs.
| Python | apache-2.0 | mapclient-plugins/plainmodelviewer |
ba3282d4df890daa054be808dfbf503404b77c3c | src/dirtyfields/dirtyfields.py | src/dirtyfields/dirtyfields.py | # Adapted from http://stackoverflow.com/questions/110803/dirty-fields-in-django
from django.db.models.signals import post_save
class DirtyFieldsMixin(object):
def __init__(self, *args, **kwargs):
super(DirtyFieldsMixin, self).__init__(*args, **kwargs)
post_save.connect(reset_state, sender=self.__cl... | # Adapted from http://stackoverflow.com/questions/110803/dirty-fields-in-django
from django.db.models.signals import post_save
class DirtyFieldsMixin(object):
def __init__(self, *args, **kwargs):
super(DirtyFieldsMixin, self).__init__(*args, **kwargs)
post_save.connect(reset_state, sender=self.__cl... | Use field.to_python to do django type conversions on the field before checking if dirty. | Use field.to_python to do django type conversions on the field before checking if dirty.
This solves issues where you might have a decimal field that you write a string to, eg:
>>> m = MyModel.objects.get(id=1)
>>> m.my_decimal_field
Decimal('1.00')
>>> m.my_decimal_field = u'1.00' # from a form or something
>>... | Python | bsd-3-clause | romgar/django-dirtyfields,smn/django-dirtyfields,jdotjdot/django-dirtyfields |
ccc667bb7c4fc014bf1d9c8f8bb90d419b979dcf | medlem.py | medlem.py | #! /usr/bin/env python2.7
import cherrypy
import controller.authentication
import controller.user
class Medlem(object):
def __init__(self):
self.authentication = controller.authentication.Authentication()
self.user = controller.user.User()
| #! /usr/bin/env python2.7
import cherrypy
import controller.authentication
import controller.user
class Medlem(object):
def __init__(self):
cherrypy.tools.content_type_json = cherrypy.Tool("before_finalize", self.content_type_json)
cherrypy.config.update({"tools.content_type_json.on": True})
cherrypy.config.u... | Set content-type to json on everything | Set content-type to json on everything
| Python | bsd-3-clause | UngaForskareStockholm/medlem2 |
d6912d7453bd128aafb9ee8634782b26427a42a4 | src/dashboard/src/main/templatetags/active.py | src/dashboard/src/main/templatetags/active.py | from django.template import Library
import math
register = Library()
@register.simple_tag
def active(request, pattern):
if request.path.startswith(pattern) and pattern != '/':
return 'active'
elif request.path == pattern == '/':
return 'active'
| from django.template import Library
import math
register = Library()
@register.simple_tag
def active(request, pattern):
if request.path.startswith(pattern) and pattern != '/':
return 'active'
elif request.path == pattern == '/':
return 'active'
else:
return ''
| Return sth in every case | Return sth in every case
Autoconverted from SVN (revision:1844)
| Python | agpl-3.0 | artefactual/archivematica-history,artefactual/archivematica-history,artefactual/archivematica-history,artefactual/archivematica-history |
8d5b0682c3262fa210c3ed5e50c91259f1f2550c | myhome/blog/models.py | myhome/blog/models.py | from django.db import models
class BlogPostTag(models.Model):
name = models.CharField(max_length=255)
def __str__(self):
return self.name
class BlogPost(models.Model):
datetime = models.DateTimeField()
title = models.CharField(max_length=255)
content = models.TextField()
live = model... | from django.db import models
class BlogPostTag(models.Model):
name = models.CharField(max_length=255)
class Meta:
ordering = ['name']
def __str__(self):
return self.name
class BlogPost(models.Model):
datetime = models.DateTimeField()
title = models.CharField(max_length=255)
... | Set default ordering for blog post tags | Set default ordering for blog post tags
| Python | mit | plumdog/myhome,plumdog/myhome,plumdog/myhome,plumdog/myhome |
2459239188b4a6f9e46363ef84fc9dc252793774 | trie_search/record_trie.py | trie_search/record_trie.py | from marisa_trie import RecordTrie
from .trie import TrieSearch
class RecordTrieSearch(RecordTrie, TrieSearch):
def __init__(self, record_format, records=None, filepath=None):
super(RecordTrieSearch, self).__init__(record_format, records)
if filepath:
self.load(filepath)
def searc... | from marisa_trie import RecordTrie
from .trie import TrieSearch
class RecordTrieSearch(RecordTrie, TrieSearch):
def __init__(self, record_format, records=None, filepath=None):
super(RecordTrieSearch, self).__init__(record_format, records)
if filepath:
self.load(filepath)
def searc... | Modify the condition for selection of longest patterns | Modify the condition for selection of longest patterns
| Python | mit | nkmrtty/trie-search |
caf1cce23853955bf0a04fc4e255f23b730dca97 | tests/test__utils.py | tests/test__utils.py | # -*- coding: utf-8 -*-
import pytest
import numpy as np
import dask.array as da
import dask.array.utils as dau
import dask_ndfourier._utils
@pytest.mark.parametrize(
"a, s, n, axis", [
(da.ones((3, 4), chunks=(3, 4)), da.ones((2,), chunks=(2,)), -1, -1),
]
)
def test_norm_args(a, s, n, axis):
... | # -*- coding: utf-8 -*-
import pytest
import numpy as np
import dask.array as da
import dask.array.utils as dau
import dask_ndfourier._utils
@pytest.mark.parametrize(
"a, s, n, axis", [
(da.ones((3, 4), chunks=(3, 4)), da.ones((2,), chunks=(2,)), -1, -1),
]
)
def test_norm_args(a, s, n, axis):
... | Update the argument normalization test | Update the argument normalization test
Needs to make sure it unpacks the right number of return values. Also
since we are changing the input array, it is good to add a check to make
sure it is still of the expected type.
| Python | bsd-3-clause | dask-image/dask-ndfourier |
23fbdabb97689a355abaac7310d3b1e887f921b8 | tests/test_logger.py | tests/test_logger.py | """This module is about testing the logger."""
import sys
from unittest import TestCase
LOGGER = sys.modules["Rainmeter.logger"]
class TestFunctions(TestCase):
"""Test class wrapper using unittest."""
# pylint: disable=W0703; This is acceptable since we are testing it not failing
def test_info(self):... | """This module is about testing the logger."""
import sys
from unittest import TestCase
LOGGER = sys.modules["Rainmeter.logger"]
class TestFunctions(TestCase):
"""Test class wrapper using unittest."""
# pylint: disable=W0703; This is acceptable since we are testing it not failing
def test_info(self):... | Convert exceptions in a type-safe manner to string before string cats | Convert exceptions in a type-safe manner to string before string cats
| Python | mit | thatsIch/sublime-rainmeter |
6446af2cd11bdc5069fdc8ab47a0881089e7cbab | tests/test_normal.py | tests/test_normal.py | """
Just to make sure the plugin doesn't choke on doctests::
>>> print('Yay, doctests!')
Yay, doctests!
"""
import time
from functools import partial
import pytest
def test_fast(benchmark):
@benchmark
def result():
return time.sleep(0.000001)
assert result is None
def test_slow(benchm... | """
Just to make sure the plugin doesn't choke on doctests::
>>> print('Yay, doctests!')
Yay, doctests!
"""
import time
from functools import partial
import pytest
def test_fast(benchmark):
@benchmark
def result():
return time.sleep(0.000001)
assert result is None
def test_slow(benchm... | Add a parametrized sample test. Make xfast faster. | Add a parametrized sample test. Make xfast faster.
| Python | bsd-2-clause | SectorLabs/pytest-benchmark,thedrow/pytest-benchmark,aldanor/pytest-benchmark,ionelmc/pytest-benchmark |
512ca99144da537da61e7437d17782e5a95addb9 | S3utility/s3_sqs_message.py | S3utility/s3_sqs_message.py | from boto.sqs.message import Message
import json
from s3_notification_info import S3NotificationInfo
class S3SQSMessage(Message):
def __init__(self, queue=None, body='', xml_attrs=None):
Message.__init__(self, queue, body)
self.payload = None
self.notification_type = 'S3Info'
def even... | from boto.sqs.message import Message
import json
from s3_notification_info import S3NotificationInfo
class S3SQSMessage(Message):
def __init__(self, queue=None, body='', xml_attrs=None):
Message.__init__(self, queue, body)
self.payload = None
self.notification_type = 'S3Info'
def even... | Tweak for when SQS message is missing the eTag from a bucket notification. | Tweak for when SQS message is missing the eTag from a bucket notification.
| Python | mit | gnott/elife-bot,gnott/elife-bot,jhroot/elife-bot,jhroot/elife-bot,gnott/elife-bot,jhroot/elife-bot |
566ae40b7f546e3773933217506f917845c8b468 | virtool/subtractions/db.py | virtool/subtractions/db.py | import virtool.utils
PROJECTION = [
"_id",
"file",
"ready",
"job"
]
async def get_linked_samples(db, subtraction_id):
cursor = db.samples.find({"subtraction.id": subtraction_id}, ["name"])
return [virtool.utils.base_processor(d) async for d in cursor]
| import virtool.utils
PROJECTION = [
"_id",
"count",
"file",
"ready",
"job",
"nickname",
"user"
]
async def get_linked_samples(db, subtraction_id):
cursor = db.samples.find({"subtraction.id": subtraction_id}, ["name"])
return [virtool.utils.base_processor(d) async for d in cursor]
| Return more fields in subtraction find API response | Return more fields in subtraction find API response
| Python | mit | igboyes/virtool,virtool/virtool,igboyes/virtool,virtool/virtool |
d918c5e28bc2505407cc3245ecae378bdb97ba19 | registration/admin.py | registration/admin.py | from django.contrib import admin
from registration.models import RegistrationProfile
class RegistrationAdmin(admin.ModelAdmin):
list_display = ('__unicode__', 'activation_key_expired')
search_fields = ('user__username', 'user__first_name')
admin.site.register(RegistrationProfile, RegistrationAdmin)
| from django.contrib import admin
from registration.models import RegistrationProfile
class RegistrationAdmin(admin.ModelAdmin):
list_display = ('__unicode__', 'activation_key_expired')
raw_id_fields = ['user']
search_fields = ('user__username', 'user__first_name')
admin.site.register(RegistrationProfil... | Use raw_id_fields for the relation from RegistrationProfile to User, for sites which have huge numbers of users. | Use raw_id_fields for the relation from RegistrationProfile to User, for sites which have huge numbers of users.
| Python | bsd-3-clause | sandipagr/django-registration,myimages/django-registration,euanlau/django-registration,Troyhy/django-registration,kennydude/djregs,spurfly/django-registration,futurecolors/django-registration,hacklabr/django-registration,futurecolors/django-registration,awakeup/django-registration,sandipagr/django-registration,akvo/dja... |
0d58d7c7a3eee8748efbf7405aba7a5f3e0f7eb3 | bluebottle/funding_telesom/admin.py | bluebottle/funding_telesom/admin.py | from django.contrib import admin
from bluebottle.funding.admin import PaymentChildAdmin, PaymentProviderChildAdmin, BankAccountChildAdmin
from bluebottle.funding.models import PaymentProvider, Payment
from bluebottle.funding_telesom.models import TelesomPayment, TelesomPaymentProvider, TelesomBankAccount
@admin.regi... | from django.contrib import admin
from bluebottle.funding.admin import PaymentChildAdmin, PaymentProviderChildAdmin, BankAccountChildAdmin
from bluebottle.funding.models import PaymentProvider, Payment
from bluebottle.funding_telesom.models import TelesomPayment, TelesomPaymentProvider, TelesomBankAccount
@admin.regi... | Add some search fields to Zaad | Add some search fields to Zaad
| Python | bsd-3-clause | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle |
cda1d6b1cdb0a36a3e9d9e5a65eabfb22a29e94e | src/ocspdash/web/blueprints/ui.py | src/ocspdash/web/blueprints/ui.py | import base64
from collections import namedtuple, OrderedDict
from itertools import groupby
import json
from operator import itemgetter
from typing import List
from flask import Blueprint, render_template, request, current_app
import nacl.signing
import nacl.encoding
import nacl.exceptions
from ...models import Locat... | import base64
from collections import namedtuple, OrderedDict
from itertools import groupby
import json
from operator import itemgetter
from typing import List
from flask import Blueprint, render_template, request, current_app
import nacl.signing
import nacl.encoding
import nacl.exceptions
from ...models import Locat... | Handle bad signature with flask abort | Handle bad signature with flask abort
| Python | mit | scolby33/OCSPdash,scolby33/OCSPdash,scolby33/OCSPdash |
234df393c438fdf729dc050d20084e1fe1a4c2ee | backend/mcapi/mcdir.py | backend/mcapi/mcdir.py | import utils
from os import environ
import os.path
MCDIR = environ.get("MCDIR") or '/mcfs/data'
def for_uid(uidstr):
pieces = uidstr.split('-')
path = os.path.join(MCDIR, pieces[1][0:2], pieces[1][2:4])
utils.mkdirp(path)
return path
| import utils
from os import environ
import os.path
MCDIR = environ.get("MCDIR") or '/mcfs/data/materialscommons'
def for_uid(uidstr):
pieces = uidstr.split('-')
path = os.path.join(MCDIR, pieces[1][0:2], pieces[1][2:4])
utils.mkdirp(path)
return path
| Change directory where data is written to. | Change directory where data is written to.
| Python | mit | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org |
72f84b49ea9781f3252c49a1805c0ce19af5c635 | corehq/apps/case_search/dsl_utils.py | corehq/apps/case_search/dsl_utils.py | from django.utils.translation import gettext as _
from eulxml.xpath.ast import FunctionCall, UnaryExpression, serialize
from corehq.apps.case_search.exceptions import (
CaseFilterError,
XPathFunctionException,
)
from corehq.apps.case_search.xpath_functions import XPATH_VALUE_FUNCTIONS
def unwrap_value(value... | from django.utils.translation import gettext as _
from eulxml.xpath.ast import FunctionCall, UnaryExpression, serialize
from corehq.apps.case_search.exceptions import (
CaseFilterError,
XPathFunctionException,
)
from corehq.apps.case_search.xpath_functions import XPATH_VALUE_FUNCTIONS
def unwrap_value(value... | Revert "support unwrapping of basic types" | Revert "support unwrapping of basic types"
This reverts commit 86a5a1c8
| Python | bsd-3-clause | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq |
f6a974a1dc5337e482fe6fcac402597735892567 | saleor/delivery/__init__.py | saleor/delivery/__init__.py | from __future__ import unicode_literals
from django.conf import settings
from prices import Price
from satchless.item import Item
class BaseDelivery(Item):
def __init__(self, delivery_group):
self.group = delivery_group
def get_price_per_item(self, **kwargs):
return Price(0, currency=settin... | from __future__ import unicode_literals
from re import sub
from django.conf import settings
from prices import Price
from satchless.item import ItemSet
from ..cart import ShippedGroup
class BaseDelivery(ItemSet):
group = None
def __init__(self, delivery_group):
self.group = delivery_group
def... | Use the delivery classes as proxy for items groups | Use the delivery classes as proxy for items groups
| Python | bsd-3-clause | Drekscott/Motlaesaleor,taedori81/saleor,rchav/vinerack,maferelo/saleor,rodrigozn/CW-Shop,dashmug/saleor,taedori81/saleor,laosunhust/saleor,laosunhust/saleor,car3oon/saleor,mociepka/saleor,hongquan/saleor,arth-co/saleor,taedori81/saleor,car3oon/saleor,spartonia/saleor,dashmug/saleor,hongquan/saleor,hongquan/saleor,car3o... |
510edc5b7d5320deb568b2fab1d654ee4d7a5c83 | autogenerate_config_docs/hooks.py | autogenerate_config_docs/hooks.py | #
# A collection of shared functions for managing help flag mapping files.
#
# 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 requi... | #
# A collection of shared functions for managing help flag mapping files.
#
# 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 requi... | Add a hook to load glance_store options | Add a hook to load glance_store options
The backends configuration options are now in the glance_store package
and are loaded at runtime. This patch adds a hook that calls a
glance_store function to load the options.
Change-Id: Iefd49afd578f2b5fa9318d8ed8fb9f7a76d8ba34
| Python | apache-2.0 | openstack/openstack-doc-tools,savinash47/openstack-doc-tools,savinash47/openstack-doc-tools,openstack/openstack-doc-tools,savinash47/openstack-doc-tools |
dcf2dcb41e66ce01e386d526370ce23064e6e2a3 | schemer/exceptions.py | schemer/exceptions.py |
class SchemaFormatException(Exception):
"""Exception which encapsulates a problem found during the verification of a
a schema."""
def __init__(self, message, path):
self._message = message.format(path)
self._path = path
@property
def path(self):
"""The field path at which... |
class SchemaFormatException(Exception):
"""Exception which encapsulates a problem found during the verification of a
a schema."""
def __init__(self, message, path):
self._message = message.format('\"{}\"'.format(path))
self._path = path
@property
def path(self):
"""The fi... | Improve formatting of schema format exception messages | Improve formatting of schema format exception messages
| Python | mit | gamechanger/schemer |
2823b35d3bf3d521ae3c9769e2696455bbed8318 | scriptorium/config.py | scriptorium/config.py | #!/usr/bin/env python
"""Configuration related functionality for scriptorium."""
import os
import yaml
import scriptorium
_DEFAULT_DIR = os.path.join(os.path.expanduser("~"), '.scriptorium')
_CFG_FILE = os.path.join(_DEFAULT_DIR, 'config')
_DEFAULT_CFG = {
'TEMPLATE_DIR': os.path.join(_DEFAULT_DIR, 'templates')... | #!/usr/bin/env python
"""Configuration related functionality for scriptorium."""
import os
import yaml
import scriptorium
_DEFAULT_DIR = os.path.join(os.path.expanduser("~"), '.scriptorium')
_CFG_FILE = os.path.join(_DEFAULT_DIR, 'config')
_DEFAULT_CFG = {
'TEMPLATE_DIR': os.path.join(_DEFAULT_DIR, 'templates')... | Expand home directory wildcards to ensure path is valid | Expand home directory wildcards to ensure path is valid
| Python | mit | jasedit/scriptorium,jasedit/papers_base |
2d57d87b15c73fe1f9b884dc57ecf2c25a5e7454 | tensorflow_probability/python/internal/backend/numpy/tensor_spec.py | tensorflow_probability/python/internal/backend/numpy/tensor_spec.py | # Copyright 2021 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | # Copyright 2021 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | Add `from_tensor` classmethod to `TensorSpec` in the Numpy backend. | Add `from_tensor` classmethod to `TensorSpec` in the Numpy backend.
PiperOrigin-RevId: 466171774
| Python | apache-2.0 | tensorflow/probability,tensorflow/probability |
ba5bfeb652804e57203b1794c6293b8227590ac1 | pyinstalive/logger.py | pyinstalive/logger.py | def colors(state):
color = ''
if (state == 'BLUE'):
color = '\033[94m'
if (state == 'GREEN'):
color = '\033[92m'
if (state == 'YELLOW'):
color = '\033[93m'
if (state == 'RED'):
color = '\033[91m'
if (state == 'ENDC'):
color = '\033[0m'
if (state == 'WHITE'):
color = '\033[0m'
return color
de... | import sys
import os
def colors(state):
color = ''
if (state == 'BLUE'):
color = '\033[94m'
if (state == 'GREEN'):
color = '\033[92m'
if (state == 'YELLOW'):
color = '\033[93m'
if (state == 'RED'):
color = '\033[91m'
if (state == 'ENDC'):
color = '\033[0m'
if (state == 'WHITE'):
color = '\033[... | Add proper logging support for consoles that don't accept ANSI | Add proper logging support for consoles that don't accept ANSI
| Python | mit | notcammy/PyInstaLive |
37b16cea115419d1353cf1213698fc4a0d229fa7 | warehouse/helpers.py | warehouse/helpers.py | # Copyright 2013 Donald Stufft
#
# 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, so... | # Copyright 2013 Donald Stufft
#
# 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, so... | Make it possible to force an external url with the url_for helper | Make it possible to force an external url with the url_for helper
| Python | apache-2.0 | robhudson/warehouse,mattrobenolt/warehouse,techtonik/warehouse,mattrobenolt/warehouse,robhudson/warehouse,techtonik/warehouse,mattrobenolt/warehouse |
27e2cc73f43c5ca8eedee52009652b6195e76198 | tests/py/test_notifications.py | tests/py/test_notifications.py | from gratipay.testing import Harness
class TestNotifications(Harness):
def test_add_single_notification(self):
alice = self.make_participant('alice')
alice.add_notification('abcd')
assert alice.notifications == ["abcd"]
def test_add_multiple_notifications(self):
alice = self.ma... | from gratipay.testing import Harness
class TestNotifications(Harness):
def test_add_single_notification(self):
alice = self.make_participant('alice')
alice.add_notification('abcd')
assert alice.notifications == ["abcd"]
def test_add_multiple_notifications(self):
alice = self.ma... | Add a test for the blog announcement | Add a test for the blog announcement
| Python | mit | gratipay/gratipay.com,gratipay/gratipay.com,gratipay/gratipay.com,gratipay/gratipay.com |
b72bea3f6970a095864ec564008f5542dc88eeca | tests/test_vector2_equality.py | tests/test_vector2_equality.py | from hypothesis import assume, given
from ppb_vector import Vector2
from utils import vectors
@given(x=vectors())
def test_equal_self(x: Vector2):
assert x == x
@given(x=vectors())
def test_non_zero_equal(x: Vector2):
assume(x != (0, 0))
assert x != 1.1 * x
assert x != -x
@given(x=vectors(), y=vectors())
de... | from hypothesis import assume, given
from ppb_vector import Vector2
from utils import vectors, vector_likes
@given(x=vectors())
def test_equal_self(x: Vector2):
assert x == x
@given(x=vectors(), y=vectors())
def test_equal_symmetric(x: Vector2, y):
assert (x == y) == (y == x)
for y_like in vector_likes(y):
... | Test symmetry of equality, even with vector-likes | tests/equality: Test symmetry of equality, even with vector-likes
| Python | artistic-2.0 | ppb/ppb-vector,ppb/ppb-vector |
b5fe71191bc7c39996d526132720a22c3967b1cf | canopus/schema/core.py | canopus/schema/core.py | from marshmallow import Schema, fields
from ..models.core import Post
class PostSchema(Schema):
id = fields.Integer()
title = fields.String()
body = fields.String()
is_published = fields.Boolean()
def make_object(self, data):
return Post(**data)
| from marshmallow import Schema, fields, post_load
from ..models import Post
class PostSchema(Schema):
__model__ = Post
id = fields.Integer()
title = fields.String()
body = fields.String()
is_published = fields.Boolean()
class Meta:
ordered = True
@post_load
def make_object(... | Fix post schema for latest marshmallow release | Fix post schema for latest marshmallow release
| Python | mit | josuemontano/pyramid-angularjs-starter,josuemontano/pyramid-angularjs-starter,josuemontano/pyramid-angularjs-starter,josuemontano/API-platform,josuemontano/api-starter,josuemontano/API-platform,josuemontano/api-starter,josuemontano/api-starter,josuemontano/API-platform,josuemontano/API-platform |
b3028843fc9f799d3fe1f52fbd64bb843dcd6f75 | picaxe/urls.py | picaxe/urls.py | from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.contrib.sites.models import Site
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'picaxe.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
... | from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.contrib.sites.models import Site
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'picaxe.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
... | Use photologue as default url | Use photologue as default url
| Python | mit | TuinfeesT/PicAxe |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.