commit stringlengths 40 40 | old_file stringlengths 5 117 | new_file stringlengths 5 117 | old_contents stringlengths 0 1.93k | new_contents stringlengths 19 3.3k | subject stringlengths 17 320 | message stringlengths 18 3.28k | lang stringclasses 1
value | license stringclasses 13
values | repos stringlengths 7 42.4k | completion stringlengths 19 3.3k | prompt stringlengths 21 3.65k |
|---|---|---|---|---|---|---|---|---|---|---|---|
7b08777d77d6cfd5a4eeeee81fb51f5fdedde987 | bumblebee/modules/caffeine.py | bumblebee/modules/caffeine.py | # pylint: disable=C0111,R0903
"""Enable/disable automatic screen locking.
Requires the following executables:
* xset
* notify-send
"""
import bumblebee.input
import bumblebee.output
import bumblebee.engine
class Module(bumblebee.engine.Module):
def __init__(self, engine, config):
super(Module, s... | # pylint: disable=C0111,R0903
"""Enable/disable automatic screen locking.
Requires the following executables:
* xset
* notify-send
"""
import bumblebee.input
import bumblebee.output
import bumblebee.engine
class Module(bumblebee.engine.Module):
def __init__(self, engine, config):
super(Module, s... | Add support for switching dpms | Add support for switching dpms
| Python | mit | tobi-wan-kenobi/bumblebee-status,tobi-wan-kenobi/bumblebee-status | # pylint: disable=C0111,R0903
"""Enable/disable automatic screen locking.
Requires the following executables:
* xset
* notify-send
"""
import bumblebee.input
import bumblebee.output
import bumblebee.engine
class Module(bumblebee.engine.Module):
def __init__(self, engine, config):
super(Module, s... | Add support for switching dpms
# pylint: disable=C0111,R0903
"""Enable/disable automatic screen locking.
Requires the following executables:
* xset
* notify-send
"""
import bumblebee.input
import bumblebee.output
import bumblebee.engine
class Module(bumblebee.engine.Module):
def __init__(self, engine, ... |
3896cd4e3ea0aee0025dafef13d2f29fe168cf10 | students/psbriant/final_project/test_clean_data.py | students/psbriant/final_project/test_clean_data.py | """
Name: Paul Briant
Date: 12/11/16
Class: Introduction to Python
Assignment: Final Project
Description:
Tests for Final Project
"""
import clean_data as cd
import pandas
def get_data():
"""
Retrieve data from csv file to test.
"""
data = pandas.read_csv("data/Residential_Water_Usage_Zip_Code_on_To... | """
Name: Paul Briant
Date: 12/11/16
Class: Introduction to Python
Assignment: Final Project
Description:
Tests for Final Project
"""
import clean_data as cd
import matplotlib.pyplot as plt
import pandas
import pytest
def get_data():
"""
Retrieve data from csv file to test.
"""
data = pandas.read_cs... | Create test for plot_zipcode to compare generated graphs. | Create test for plot_zipcode to compare generated graphs.
| Python | unlicense | UWPCE-PythonCert/IntroPython2016,weidnem/IntroPython2016,UWPCE-PythonCert/IntroPython2016,weidnem/IntroPython2016,UWPCE-PythonCert/IntroPython2016,weidnem/IntroPython2016 | """
Name: Paul Briant
Date: 12/11/16
Class: Introduction to Python
Assignment: Final Project
Description:
Tests for Final Project
"""
import clean_data as cd
import matplotlib.pyplot as plt
import pandas
import pytest
def get_data():
"""
Retrieve data from csv file to test.
"""
data = pandas.read_cs... | Create test for plot_zipcode to compare generated graphs.
"""
Name: Paul Briant
Date: 12/11/16
Class: Introduction to Python
Assignment: Final Project
Description:
Tests for Final Project
"""
import clean_data as cd
import pandas
def get_data():
"""
Retrieve data from csv file to test.
"""
data = p... |
a8db8c0448d98e2de0e662581542bd644e673c7c | geotrek/core/migrations/0018_remove_other_objects_from_factories.py | geotrek/core/migrations/0018_remove_other_objects_from_factories.py | # Generated by Django 2.0.13 on 2020-04-06 13:40
from django.conf import settings
from django.contrib.gis.geos import Point, LineString
from django.db import migrations
def remove_generated_objects_factories(apps, schema_editor):
ComfortModel = apps.get_model('core', 'Comfort')
PathSourceModel = apps.get_mod... | Add migration removing generated objects with factories | Add migration removing generated objects with factories
| Python | bsd-2-clause | makinacorpus/Geotrek,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin | # Generated by Django 2.0.13 on 2020-04-06 13:40
from django.conf import settings
from django.contrib.gis.geos import Point, LineString
from django.db import migrations
def remove_generated_objects_factories(apps, schema_editor):
ComfortModel = apps.get_model('core', 'Comfort')
PathSourceModel = apps.get_mod... | Add migration removing generated objects with factories
| |
44426207ba65ba6c56c1092b0313f508c59d6b1f | core/exceptions.py | core/exceptions.py | import sublime
from ..common import util
MYPY = False
if MYPY:
from typing import Sequence
class GitSavvyError(Exception):
def __init__(self, msg, *args, cmd=None, stdout="", stderr="", **kwargs):
# type: (str, object, Sequence[str], str, str, object) -> None
super(GitSavvyError, self).__ini... | import sublime
from ..common import util
MYPY = False
if MYPY:
from typing import Sequence
class GitSavvyError(Exception):
def __init__(self, msg, *args, cmd=None, stdout="", stderr="", **kwargs):
# type: (str, object, Sequence[str], str, str, object) -> None
super(GitSavvyError, self).__ini... | Remove unused `show_status` feature of `GitSavvyError` | Remove unused `show_status` feature of `GitSavvyError`
| Python | mit | divmain/GitSavvy,divmain/GitSavvy,divmain/GitSavvy | import sublime
from ..common import util
MYPY = False
if MYPY:
from typing import Sequence
class GitSavvyError(Exception):
def __init__(self, msg, *args, cmd=None, stdout="", stderr="", **kwargs):
# type: (str, object, Sequence[str], str, str, object) -> None
super(GitSavvyError, self).__ini... | Remove unused `show_status` feature of `GitSavvyError`
import sublime
from ..common import util
MYPY = False
if MYPY:
from typing import Sequence
class GitSavvyError(Exception):
def __init__(self, msg, *args, cmd=None, stdout="", stderr="", **kwargs):
# type: (str, object, Sequence[str], str, str, ... |
6de094b3b08751a8585c5a492bf009807ff3e1e1 | stringinfo.py | stringinfo.py | #!/usr/bin/env python3
# -*- coding: utf8 -*-
"""
Usage:
stringinfo STRING...
Options:
STRING One or more strings for which you want information
"""
from docopt import docopt
import plugins
__author__ = 'peter'
def main():
args = docopt(__doc__)
# Find plugins
ps = plugins.get_plugins()
... | #!/usr/bin/env python3
# -*- coding: utf8 -*-
"""
Usage:
stringinfo STRING...
Options:
STRING One or more strings for which you want information
"""
import colorama
from docopt import docopt
import plugins
__author__ = 'peter'
def main():
args = docopt(__doc__)
# Find plugins
ps = plugins.get... | Use colorama to print colors and print a plugin's short_description after running | Use colorama to print colors and print a plugin's short_description after running
| Python | mit | Sakartu/stringinfo | #!/usr/bin/env python3
# -*- coding: utf8 -*-
"""
Usage:
stringinfo STRING...
Options:
STRING One or more strings for which you want information
"""
import colorama
from docopt import docopt
import plugins
__author__ = 'peter'
def main():
args = docopt(__doc__)
# Find plugins
ps = plugins.get... | Use colorama to print colors and print a plugin's short_description after running
#!/usr/bin/env python3
# -*- coding: utf8 -*-
"""
Usage:
stringinfo STRING...
Options:
STRING One or more strings for which you want information
"""
from docopt import docopt
import plugins
__author__ = 'peter'
def main():
... |
30b6a5364dc22261a4d47aec2e0a77e0c5b8ccd4 | wsme/release.py | wsme/release.py | name = "WSME"
version = "0.1.0a2"
description = "Web Services Made Easy"
long_description = """
Web Service Made Easy is a pure-wsgi and modular rewrite of TGWebServices.
"""
author = "Christophe de Vienne"
email = "cdevienne@gmail.com"
url = "http://bitbucket.org/cdevienne/wsme"
license = "MIT"
| name = "WSME"
version = "0.1.0a3"
description = "Web Services Made Easy"
long_description = """
Web Service Made Easy is a pure-wsgi and modular rewrite of TGWebServices.
"""
author = "Christophe de Vienne"
email = "python-wsme@googlegroups.com"
url = "http://bitbucket.org/cdevienne/wsme"
license = "MIT"
| Update the contact mail and version | Update the contact mail and version
| Python | mit | stackforge/wsme | name = "WSME"
version = "0.1.0a3"
description = "Web Services Made Easy"
long_description = """
Web Service Made Easy is a pure-wsgi and modular rewrite of TGWebServices.
"""
author = "Christophe de Vienne"
email = "python-wsme@googlegroups.com"
url = "http://bitbucket.org/cdevienne/wsme"
license = "MIT"
| Update the contact mail and version
name = "WSME"
version = "0.1.0a2"
description = "Web Services Made Easy"
long_description = """
Web Service Made Easy is a pure-wsgi and modular rewrite of TGWebServices.
"""
author = "Christophe de Vienne"
email = "cdevienne@gmail.com"
url = "http://bitbucket.org/cdevienne/wsme"... |
82bb28f32c343e419e595aa2ca5ffb6fe6aa30ed | modules/pipeunion.py | modules/pipeunion.py | # pipeunion.py
#
from pipe2py import util
def pipe_union(context, _INPUT, **kwargs):
"""This operator merges up to 5 source together.
Keyword arguments:
context -- pipeline context
_INPUT -- source generator
kwargs -- _OTHER1 - another source generator
_OTHER2 etc.
Yields (... | # pipeunion.py
#
from pipe2py import util
def pipe_union(context, _INPUT, **kwargs):
"""This operator merges up to 5 source together.
Keyword arguments:
context -- pipeline context
_INPUT -- source generator
kwargs -- _OTHER1 - another source generator
_OTHER2 etc.
Yields (_OUT... | Fix whitespace errors and line lengths | Fix whitespace errors and line lengths
| Python | mit | nerevu/riko,nerevu/riko | # pipeunion.py
#
from pipe2py import util
def pipe_union(context, _INPUT, **kwargs):
"""This operator merges up to 5 source together.
Keyword arguments:
context -- pipeline context
_INPUT -- source generator
kwargs -- _OTHER1 - another source generator
_OTHER2 etc.
Yields (_OUT... | Fix whitespace errors and line lengths
# pipeunion.py
#
from pipe2py import util
def pipe_union(context, _INPUT, **kwargs):
"""This operator merges up to 5 source together.
Keyword arguments:
context -- pipeline context
_INPUT -- source generator
kwargs -- _OTHER1 - another source generator
... |
8f3249904ede8e6ac4fd1398f3d059335a65c8c6 | galpy/df.py | galpy/df.py | from galpy.df_src import diskdf
from galpy.df_src import surfaceSigmaProfile
from galpy.df_src import evolveddiskdf
from galpy.df_src import quasiisothermaldf
from galpy.df_src import streamdf
from galpy.df_src import streamgapdf
#
# Classes
#
shudf= diskdf.shudf
dehnendf= diskdf.dehnendf
DFcorrection= diskdf.DFcorrec... | from galpy.df_src import diskdf
from galpy.df_src import surfaceSigmaProfile
from galpy.df_src import evolveddiskdf
from galpy.df_src import quasiisothermaldf
from galpy.df_src import streamdf
from galpy.df_src import streamgapdf
#
# Functions
#
impulse_deltav_plummer= streamgapdf.impulse_deltav_plummer
impulse_deltav_... | Add impulse functions to top level | Add impulse functions to top level
| Python | bsd-3-clause | jobovy/galpy,jobovy/galpy,jobovy/galpy,jobovy/galpy | from galpy.df_src import diskdf
from galpy.df_src import surfaceSigmaProfile
from galpy.df_src import evolveddiskdf
from galpy.df_src import quasiisothermaldf
from galpy.df_src import streamdf
from galpy.df_src import streamgapdf
#
# Functions
#
impulse_deltav_plummer= streamgapdf.impulse_deltav_plummer
impulse_deltav_... | Add impulse functions to top level
from galpy.df_src import diskdf
from galpy.df_src import surfaceSigmaProfile
from galpy.df_src import evolveddiskdf
from galpy.df_src import quasiisothermaldf
from galpy.df_src import streamdf
from galpy.df_src import streamgapdf
#
# Classes
#
shudf= diskdf.shudf
dehnendf= diskdf.de... |
7bedccd6f6288c123f8dafb660417b6f7f4bde9c | tests/unit/test_vendor_tornado.py | tests/unit/test_vendor_tornado.py | # -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import, unicode_literals
import os
import re
import logging
# Import Salt Testing libs
from tests.support.unit import TestCase, skipIf
from tests.support.runtests import RUNTIME_VARS
# Import Salt libs
import salt.modules.cmdmod
import salt... | Add tests to validate vendor tornado usage | Add tests to validate vendor tornado usage
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | # -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import, unicode_literals
import os
import re
import logging
# Import Salt Testing libs
from tests.support.unit import TestCase, skipIf
from tests.support.runtests import RUNTIME_VARS
# Import Salt libs
import salt.modules.cmdmod
import salt... | Add tests to validate vendor tornado usage
| |
907169a645cd779de1a382dc09765a04c0217206 | dyngraph/exporter.py | dyngraph/exporter.py | from __future__ import print_function
class Exporter():
def __init__(self, plotinfo, viewbox):
self.plotinfo = plotinfo
self.viewbox = viewbox
def updaterange(self):
datalen = self.plotinfo.plotdata.shape[0]
vbrange = self.viewbox.viewRange()
xmin,xmax = vbrange[0]
... | from __future__ import print_function
class Exporter():
def __init__(self, plotinfo, viewbox):
self.plotinfo = plotinfo
self.viewbox = viewbox
def updaterange(self):
datalen = self.plotinfo.plotdata.shape[0]
vbrange = self.viewbox.viewRange()
xmin,xmax = vbrange[0]
... | Remove NA values from export. | Remove NA values from export.
| Python | isc | jaj42/GraPhysio,jaj42/dyngraph,jaj42/GraPhysio | from __future__ import print_function
class Exporter():
def __init__(self, plotinfo, viewbox):
self.plotinfo = plotinfo
self.viewbox = viewbox
def updaterange(self):
datalen = self.plotinfo.plotdata.shape[0]
vbrange = self.viewbox.viewRange()
xmin,xmax = vbrange[0]
... | Remove NA values from export.
from __future__ import print_function
class Exporter():
def __init__(self, plotinfo, viewbox):
self.plotinfo = plotinfo
self.viewbox = viewbox
def updaterange(self):
datalen = self.plotinfo.plotdata.shape[0]
vbrange = self.viewbox.viewRange()
... |
2291a18db52f8a6443805736a5477e2f81158ab5 | web/form/base_form.py | web/form/base_form.py | from collections import OrderedDict
from flask_wtf import Form
class BaseForm(Form):
def __iter__(self):
field_order = getattr(self, '_order', [])
if field_order:
ordered_fields = OrderedDict()
for name in field_order:
ordered_fields[name] = self._fields.... | Introduce a `BaseForm` to allow customization of field order | Introduce a `BaseForm` to allow customization of field order
| Python | apache-2.0 | lukasjuhrich/pycroft,lukasjuhrich/pycroft,agdsn/pycroft,agdsn/pycroft,lukasjuhrich/pycroft,agdsn/pycroft,lukasjuhrich/pycroft,agdsn/pycroft,agdsn/pycroft | from collections import OrderedDict
from flask_wtf import Form
class BaseForm(Form):
def __iter__(self):
field_order = getattr(self, '_order', [])
if field_order:
ordered_fields = OrderedDict()
for name in field_order:
ordered_fields[name] = self._fields.... | Introduce a `BaseForm` to allow customization of field order
| |
d9be3f189fc34117bdec6e0c7856f7a7dc5f902a | cdap-docs/tools/versionscallback-gen.py | cdap-docs/tools/versionscallback-gen.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2014 Cask Data, Inc.
#
# Used to generate JSONP from a CDAP documentation directory on a webserver.
#
# sudo echo "versionscallback({\"development\": \"2.6.0-SNAPSHOT\", \"current\": \"2.5.2\", \"versions\": [\"2.5.1\", \"2.5.0\"]});" > json-versions.js; l... | Add tool for generating the JSONP required by the documentation versions. | Add tool for generating the JSONP required by the documentation versions.
| Python | apache-2.0 | chtyim/cdap,mpouttuclarke/cdap,anthcp/cdap,chtyim/cdap,hsaputra/cdap,chtyim/cdap,hsaputra/cdap,caskdata/cdap,chtyim/cdap,caskdata/cdap,mpouttuclarke/cdap,mpouttuclarke/cdap,hsaputra/cdap,caskdata/cdap,hsaputra/cdap,mpouttuclarke/cdap,caskdata/cdap,anthcp/cdap,anthcp/cdap,chtyim/cdap,caskdata/cdap,anthcp/cdap,caskdata/c... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2014 Cask Data, Inc.
#
# Used to generate JSONP from a CDAP documentation directory on a webserver.
#
# sudo echo "versionscallback({\"development\": \"2.6.0-SNAPSHOT\", \"current\": \"2.5.2\", \"versions\": [\"2.5.1\", \"2.5.0\"]});" > json-versions.js; l... | Add tool for generating the JSONP required by the documentation versions.
| |
24df17e1c1265d81879a8f7e7a494cf4703dae69 | agent_test.py | agent_test.py | import time
import msvcrt
import zmq
from agent_pb2 import *
zctx = zmq.Context()
zsck_ctrl = zctx.socket(zmq.PUSH)
zsck_status = zctx.socket(zmq.SUB)
zsck_status.setsockopt(zmq.SUBSCRIBE, '')
zsck_ctrl.connect('tcp://127.0.0.1:17267')
zsck_status.connect('tcp://127.0.0.1:17268')
j = 0
while True:
cmd = msvcrt.... | Add simple manual test for remote control | Add simple manual test for remote control
| Python | mit | dkrikun/ffmpeg-rcd | import time
import msvcrt
import zmq
from agent_pb2 import *
zctx = zmq.Context()
zsck_ctrl = zctx.socket(zmq.PUSH)
zsck_status = zctx.socket(zmq.SUB)
zsck_status.setsockopt(zmq.SUBSCRIBE, '')
zsck_ctrl.connect('tcp://127.0.0.1:17267')
zsck_status.connect('tcp://127.0.0.1:17268')
j = 0
while True:
cmd = msvcrt.... | Add simple manual test for remote control
| |
f131cd221b2ce6fc144b2aa9882cb0ad1b116675 | tests/views/test_dashboard.py | tests/views/test_dashboard.py | #!/usr/bin/env python2.5
#
# Copyright 2011 the Melange 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 applic... | Add (failing) tests for the dashboard | Add (failing) tests for the dashboard
| Python | apache-2.0 | SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange | #!/usr/bin/env python2.5
#
# Copyright 2011 the Melange 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 applic... | Add (failing) tests for the dashboard
| |
829aa30a052b1a35d2c0d0797abe6b0c34c2f9d2 | bluechip/player/createplayers.py | bluechip/player/createplayers.py | import random
from models import Player
def create_players():
#TODO: Need to centralize this function call.
random.seed(123456789)
# TODO: Do we need to delete all?
Player.objects.all().delete()
for _ in xrange(3000):
p = Player.objects.create_player()
p.save | import random
from player.models import Player
#TODO: Need to centralize this function call.
random.seed(123456789)
# For now just create a new class each
Player.objects.all().delete()
for _ in xrange(3000):
p = Player.objects.create_player()
p.save | Add script to create the recruiting class. | Add script to create the recruiting class.
| Python | mit | isuraed/bluechip | import random
from player.models import Player
#TODO: Need to centralize this function call.
random.seed(123456789)
# For now just create a new class each
Player.objects.all().delete()
for _ in xrange(3000):
p = Player.objects.create_player()
p.save | Add script to create the recruiting class.
import random
from models import Player
def create_players():
#TODO: Need to centralize this function call.
random.seed(123456789)
# TODO: Do we need to delete all?
Player.objects.all().delete()
for _ in xrange(3000):
p = Player.objects.create_player()
p.save |
d17f14b693d770618de559bd71a277c3771ccc8e | src/events/views.py | src/events/views.py | from django.http import Http404
from django.views.generic import DetailView, ListView, RedirectView
from proposals.models import TalkProposal
from .models import SponsoredEvent
class AcceptedTalkMixin:
queryset = (
TalkProposal.objects
.filter(accepted=True)
.select_related('submitter')
... | from django.http import Http404
from django.views.generic import DetailView, ListView, RedirectView
from proposals.models import TalkProposal
from .models import SponsoredEvent
class AcceptedTalkMixin:
queryset = (
TalkProposal.objects
.filter(accepted=True)
.select_related('submitter')
... | Make sponsored event redirect permanent (HTTP 301) | Make sponsored event redirect permanent (HTTP 301)
| Python | mit | pycontw/pycontw2016,pycontw/pycontw2016,pycontw/pycontw2016,pycontw/pycontw2016 | from django.http import Http404
from django.views.generic import DetailView, ListView, RedirectView
from proposals.models import TalkProposal
from .models import SponsoredEvent
class AcceptedTalkMixin:
queryset = (
TalkProposal.objects
.filter(accepted=True)
.select_related('submitter')
... | Make sponsored event redirect permanent (HTTP 301)
from django.http import Http404
from django.views.generic import DetailView, ListView, RedirectView
from proposals.models import TalkProposal
from .models import SponsoredEvent
class AcceptedTalkMixin:
queryset = (
TalkProposal.objects
.filter(... |
e65ed7382c691d8ee19a22659ddb6deaa064e85b | kmip/__init__.py | kmip/__init__.py | # Copyright (c) 2014 The Johns Hopkins University/Applied Physics Laboratory
# 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/LICEN... | # Copyright (c) 2014 The Johns Hopkins University/Applied Physics Laboratory
# 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/LICEN... | Update the kmip package to allow importing enums globally | Update the kmip package to allow importing enums globally
This change updates the root-level kmip package, allowing users
to now import enums directly from the kmip package:
from kmip import enums
Enumerations are used throughout the codebase and user applications
and this will simplify usage and help obfuscate inte... | Python | apache-2.0 | OpenKMIP/PyKMIP,OpenKMIP/PyKMIP | # Copyright (c) 2014 The Johns Hopkins University/Applied Physics Laboratory
# 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/LICEN... | Update the kmip package to allow importing enums globally
This change updates the root-level kmip package, allowing users
to now import enums directly from the kmip package:
from kmip import enums
Enumerations are used throughout the codebase and user applications
and this will simplify usage and help obfuscate inte... |
9b8c1f35d057bbf6e336434bd028cb0b2673afb8 | installer/installer_config/admin.py | installer/installer_config/admin.py | from django.contrib import admin
from installer_config.models import Package, TerminalPrompt, EnvironmentProfile
class PackageAdmin(admin.ModelAdmin):
model = Package
list_display = ('display_name', 'version', 'website')
class TerminalPromptAdmin(admin.ModelAdmin):
model = TerminalPrompt
list_displa... | from django.contrib import admin
from installer_config.models import Package, TerminalPrompt, EnvironmentProfile
class PackageAdmin(admin.ModelAdmin):
model = Package
list_display = ('display_name', 'version', 'website')
class TerminalPromptAdmin(admin.ModelAdmin):
model = TerminalPrompt
list_displa... | Add Environment Profile to Admin view | Add Environment Profile to Admin view
| Python | mit | ezPy-co/ezpy,ezPy-co/ezpy,alibulota/Package_Installer,alibulota/Package_Installer | from django.contrib import admin
from installer_config.models import Package, TerminalPrompt, EnvironmentProfile
class PackageAdmin(admin.ModelAdmin):
model = Package
list_display = ('display_name', 'version', 'website')
class TerminalPromptAdmin(admin.ModelAdmin):
model = TerminalPrompt
list_displa... | Add Environment Profile to Admin view
from django.contrib import admin
from installer_config.models import Package, TerminalPrompt, EnvironmentProfile
class PackageAdmin(admin.ModelAdmin):
model = Package
list_display = ('display_name', 'version', 'website')
class TerminalPromptAdmin(admin.ModelAdmin):
... |
0485a265c5076402acc482db6789fb46bc313451 | proc_images.py | proc_images.py | import numpy as np
import cv
from pytesser import *
from common import *
def proc_ex (ex):
try:
text = (image_file_to_string(img_filename(ex[0])),)
except IOError:
print "Exception thrown"
text = ("",)
return text + tuple(ex)
def write_txt (fname, txt):
with open(fname, 'wb')... | Add code to lift text out of images | Add code to lift text out of images
| Python | mit | hausdorff/i-like-you,hausdorff/i-like-you | import numpy as np
import cv
from pytesser import *
from common import *
def proc_ex (ex):
try:
text = (image_file_to_string(img_filename(ex[0])),)
except IOError:
print "Exception thrown"
text = ("",)
return text + tuple(ex)
def write_txt (fname, txt):
with open(fname, 'wb')... | Add code to lift text out of images
| |
4c20c2137eb1cee69511ecd8a83a499147b42373 | tests/thread-test.py | tests/thread-test.py | #!/usr/bin/python2
import pstack
import json
threads, text = pstack.JSON(["tests/thread"])
result = json.loads(text)
# we have 10 threads + main
assert len(threads) == 11
entryThreads = 0
for thread in threads:
assert thread["ti_lid"] in result["lwps"], "LWP %d not in %s" % (thread["ti_lid"], result["lwps"])
... | #!/usr/bin/python2
import pstack
import json
pstack, text = pstack.JSON(["tests/thread"])
result = json.loads(text)
threads = result["threads"]
lwps = result["lwps"]
assert_at = result["assert_at"]
# we have 10 threads + main
assert len(threads) == 11
for thread in pstack:
# this will throw an error if the threa... | Clean up changes to thread test | Clean up changes to thread test
| Python | bsd-2-clause | peadar/pstack,peadar/pstack,peadar/pstack,peadar/pstack | #!/usr/bin/python2
import pstack
import json
pstack, text = pstack.JSON(["tests/thread"])
result = json.loads(text)
threads = result["threads"]
lwps = result["lwps"]
assert_at = result["assert_at"]
# we have 10 threads + main
assert len(threads) == 11
for thread in pstack:
# this will throw an error if the threa... | Clean up changes to thread test
#!/usr/bin/python2
import pstack
import json
threads, text = pstack.JSON(["tests/thread"])
result = json.loads(text)
# we have 10 threads + main
assert len(threads) == 11
entryThreads = 0
for thread in threads:
assert thread["ti_lid"] in result["lwps"], "LWP %d not in %s" % (threa... |
9f2c9bdb1dfcca677b7efd9f22f697c929b4c223 | readthedocs/core/migrations/0005_migrate-old-passwords.py | readthedocs/core/migrations/0005_migrate-old-passwords.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-10-11 17:28
from __future__ import unicode_literals
from django.db import migrations
def forwards_func(apps, schema_editor):
User = apps.get_model('auth', 'User')
old_password_patterns = (
'sha1$',
# RTD's production database does... | Migrate old passwords to be unusable | Migrate old passwords to be unusable
| Python | mit | rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org | # -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-10-11 17:28
from __future__ import unicode_literals
from django.db import migrations
def forwards_func(apps, schema_editor):
User = apps.get_model('auth', 'User')
old_password_patterns = (
'sha1$',
# RTD's production database does... | Migrate old passwords to be unusable
| |
e58c78fea4b604905333b490a22e640477d5e2d5 | django_pytest/test_runner.py | django_pytest/test_runner.py | def run_tests(test_labels, verbosity=1, interactive=True, extra_tests=[]):
import sys
from pkg_resources import load_entry_point
sys.argv[1:] = sys.argv[2:]
# Remove stop word (--) from argument list again. This separates Django
# command options from py.test ones.
try:
del sys.argv[sys... | class TestRunner(object):
def __init__(self, verbosity=1, interactive=True, failfast=True, **kwargs):
self.verbosity = verbosity
self.interactive = interactive
self.failfast = failfast
def run_tests(self, test_labels):
import pytest
import sys
if test_labels is ... | Add a new TestRunner class to remove Django deprecation warnings | Add a new TestRunner class to remove Django deprecation warnings
| Python | bsd-3-clause | buchuki/django-pytest,0101/django-pytest | class TestRunner(object):
def __init__(self, verbosity=1, interactive=True, failfast=True, **kwargs):
self.verbosity = verbosity
self.interactive = interactive
self.failfast = failfast
def run_tests(self, test_labels):
import pytest
import sys
if test_labels is ... | Add a new TestRunner class to remove Django deprecation warnings
def run_tests(test_labels, verbosity=1, interactive=True, extra_tests=[]):
import sys
from pkg_resources import load_entry_point
sys.argv[1:] = sys.argv[2:]
# Remove stop word (--) from argument list again. This separates Django
# co... |
a6b14d2f80355e556c466b52b518dc808c90c54a | polling_stations/settings/static_files.py | polling_stations/settings/static_files.py | from dc_theme.settings import get_pipeline_settings
from dc_theme.settings import STATICFILES_FINDERS
STATICFILES_STORAGE = 'pipeline.storage.PipelineStorage'
PIPELINE = get_pipeline_settings(
extra_css=[
'custom_css/style.scss',
'font-awesome/css/font-awesome.min.css',
],
extra_js=[],
)
PI... | from dc_theme.settings import get_pipeline_settings
from dc_theme.settings import STATICFILES_FINDERS, STATICFILES_STORAGE
PIPELINE = get_pipeline_settings(
extra_css=[
'custom_css/style.scss',
'font-awesome/css/font-awesome.min.css',
],
extra_js=[],
)
PIPELINE['STYLESHEETS']['map'] = {
... | Remove old pipeline and compressor settings | Remove old pipeline and compressor settings
libsass has a compresssion mode that's enabled by default in the 0.3
dc base theme. This removes the need for uglifyjs
| Python | bsd-3-clause | DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations | from dc_theme.settings import get_pipeline_settings
from dc_theme.settings import STATICFILES_FINDERS, STATICFILES_STORAGE
PIPELINE = get_pipeline_settings(
extra_css=[
'custom_css/style.scss',
'font-awesome/css/font-awesome.min.css',
],
extra_js=[],
)
PIPELINE['STYLESHEETS']['map'] = {
... | Remove old pipeline and compressor settings
libsass has a compresssion mode that's enabled by default in the 0.3
dc base theme. This removes the need for uglifyjs
from dc_theme.settings import get_pipeline_settings
from dc_theme.settings import STATICFILES_FINDERS
STATICFILES_STORAGE = 'pipeline.storage.PipelineStora... |
f14b1aa56b838469f63cec22c87e2e8c0c3f17c6 | csp.py | csp.py | csp = {
'default-src': '\'self\'',
'style-src': [
'\'self\'',
'\'unsafe-inline\''
],
'script-src': [
'\'self\'',
'cdn.httparchive.org',
'www.google-analytics.com',
'use.fontawesome.com',
'cdn.speedcurve.com',
'spdcrv.global.ssl.fastly.net',... | csp = {
'default-src': '\'self\'',
'style-src': [
'\'self\'',
'\'unsafe-inline\''
],
'script-src': [
'\'self\'',
'cdn.httparchive.org',
'www.google-analytics.com',
'use.fontawesome.com',
'cdn.speedcurve.com',
'spdcrv.global.ssl.fastly.net',... | Allow more discourse hostnames to fix CSP error | Allow more discourse hostnames to fix CSP error
| Python | apache-2.0 | HTTPArchive/beta.httparchive.org,HTTPArchive/beta.httparchive.org,HTTPArchive/beta.httparchive.org | csp = {
'default-src': '\'self\'',
'style-src': [
'\'self\'',
'\'unsafe-inline\''
],
'script-src': [
'\'self\'',
'cdn.httparchive.org',
'www.google-analytics.com',
'use.fontawesome.com',
'cdn.speedcurve.com',
'spdcrv.global.ssl.fastly.net',... | Allow more discourse hostnames to fix CSP error
csp = {
'default-src': '\'self\'',
'style-src': [
'\'self\'',
'\'unsafe-inline\''
],
'script-src': [
'\'self\'',
'cdn.httparchive.org',
'www.google-analytics.com',
'use.fontawesome.com',
'cdn.speedcu... |
da516d06ab294dc2dde4bb671ab16653b1421314 | tests/performance.py | tests/performance.py | """Script to run performance check."""
import time
from examples.game_of_life import GameOfLife, GOLExperiment
from xentica.utils.formatters import sizeof_fmt
MODELS = [
("Conway's Life", GameOfLife, GOLExperiment),
]
NUM_STEPS = 10000
if __name__ == "__main__":
for name, model, experiment in MODELS:
... | """Script to run performance check."""
import time
from examples.game_of_life import (
GameOfLife, GOLExperiment
)
from examples.shifting_sands import (
ShiftingSands, ShiftingSandsExperiment
)
from xentica.utils.formatters import sizeof_fmt
MODELS = [
("Conway's Life", GameOfLife, GOLExperiment),
("... | Add Shifting Sands to benchmark tests | Add Shifting Sands to benchmark tests
| Python | mit | a5kin/hecate,a5kin/hecate | """Script to run performance check."""
import time
from examples.game_of_life import (
GameOfLife, GOLExperiment
)
from examples.shifting_sands import (
ShiftingSands, ShiftingSandsExperiment
)
from xentica.utils.formatters import sizeof_fmt
MODELS = [
("Conway's Life", GameOfLife, GOLExperiment),
("... | Add Shifting Sands to benchmark tests
"""Script to run performance check."""
import time
from examples.game_of_life import GameOfLife, GOLExperiment
from xentica.utils.formatters import sizeof_fmt
MODELS = [
("Conway's Life", GameOfLife, GOLExperiment),
]
NUM_STEPS = 10000
if __name__ == "__main__":
for n... |
a5ce35c44938d37aa9727d37c0cbe0232b8e92d3 | socializr/management/commands/socializr_update.py | socializr/management/commands/socializr_update.py | '''
Main command which is meant to be run daily to get the information
from various social networks into the local db.
'''
import traceback
from django.core.management.base import BaseCommand, CommandError
from django.core.exceptions import ImproperlyConfigured
from socializr.base import get_socializr_configs
clas... | '''
Main command which is meant to be run daily to get the information
from various social networks into the local db.
'''
import traceback
from django.core.management.base import BaseCommand, CommandError
from django.core.exceptions import ImproperlyConfigured
from socializr.base import get_socializr_configs
clas... | Remove output expect when there is an error. | Remove output expect when there is an error.
| Python | mit | CIGIHub/django-socializr,albertoconnor/django-socializr | '''
Main command which is meant to be run daily to get the information
from various social networks into the local db.
'''
import traceback
from django.core.management.base import BaseCommand, CommandError
from django.core.exceptions import ImproperlyConfigured
from socializr.base import get_socializr_configs
clas... | Remove output expect when there is an error.
'''
Main command which is meant to be run daily to get the information
from various social networks into the local db.
'''
import traceback
from django.core.management.base import BaseCommand, CommandError
from django.core.exceptions import ImproperlyConfigured
from soci... |
dd58dbbbdb9b3a9479fa5db38a4e4038a6514fef | configReader.py | configReader.py | class ConfigReader():
def __init__(self):
self.keys={}
#Read Keys from file
def readKeys(self):
keysFile=open("config.txt","r")
fileLines=keysFile.readlines()
keysFile.close()
self.keys.clear()
for item in fileLines:
#If last char is \n
if (item[-1]=='\n'):
item=item[:-1]
#If a commented l... | class ConfigReader():
def __init__(self):
self.keys={}
#Read Keys from file
def readKeys(self):
keysFile=open("config.txt","r")
fileLines=keysFile.readlines()
keysFile.close()
self.keys.clear()
for item in fileLines:
#If last char is \n
if (item[-1]=='\n'):
item=item[:-1]
#If a commented l... | Change 'pass' statements to 'continue' statements. | Change 'pass' statements to 'continue' statements. | Python | mit | ollien/PyConfigReader | class ConfigReader():
def __init__(self):
self.keys={}
#Read Keys from file
def readKeys(self):
keysFile=open("config.txt","r")
fileLines=keysFile.readlines()
keysFile.close()
self.keys.clear()
for item in fileLines:
#If last char is \n
if (item[-1]=='\n'):
item=item[:-1]
#If a commented l... | Change 'pass' statements to 'continue' statements.
class ConfigReader():
def __init__(self):
self.keys={}
#Read Keys from file
def readKeys(self):
keysFile=open("config.txt","r")
fileLines=keysFile.readlines()
keysFile.close()
self.keys.clear()
for item in fileLines:
#If last char is \n
if (item[... |
c62e1b325a536294b3285f8cbcad7d66a415ee23 | heat/objects/base.py | heat/objects/base.py | # Copyright 2015 Intel Corp.
#
# 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 agr... | # Copyright 2015 Intel Corp.
#
# 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 agr... | Use a weakref for the data object context | Use a weakref for the data object context
There are no known circular reference issues caused by storing the
context in data objects, but the following changes will refer to data
objects in the context, so this change prevents any later issues.
Change-Id: I3680e5678003cf339a98fbb7a2b1b387fb2243c0
Related-Bug: #157885... | Python | apache-2.0 | noironetworks/heat,openstack/heat,openstack/heat,cwolferh/heat-scratch,noironetworks/heat,cwolferh/heat-scratch | # Copyright 2015 Intel Corp.
#
# 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 agr... | Use a weakref for the data object context
There are no known circular reference issues caused by storing the
context in data objects, but the following changes will refer to data
objects in the context, so this change prevents any later issues.
Change-Id: I3680e5678003cf339a98fbb7a2b1b387fb2243c0
Related-Bug: #157885... |
4acb0d36db6777704df7e3bff6c95f38f47ce49a | src/django_email_user_model/backends.py | src/django_email_user_model/backends.py | from django.contrib.auth import get_user_model
class EmailAuthBackend(object):
"""Docstring for EmailAuthBackend """
def authenticate(self, username=None, password=None):
"""todo: Docstring for authenticate
:param username: arg description
:type username: type description
:pa... | from django.contrib.auth import get_user_model
class EmailAuthBackend(object):
"""Docstring for EmailAuthBackend """
def authenticate(self, email=None, password=None, username=None):
"""todo: Docstring for authenticate
:param username: arg description
:type username: type description... | Update auth backend to support kwargs | Update auth backend to support kwargs
| Python | mit | jeffbuttars/django-email-user-model | from django.contrib.auth import get_user_model
class EmailAuthBackend(object):
"""Docstring for EmailAuthBackend """
def authenticate(self, email=None, password=None, username=None):
"""todo: Docstring for authenticate
:param username: arg description
:type username: type description... | Update auth backend to support kwargs
from django.contrib.auth import get_user_model
class EmailAuthBackend(object):
"""Docstring for EmailAuthBackend """
def authenticate(self, username=None, password=None):
"""todo: Docstring for authenticate
:param username: arg description
:type... |
0c6f90ded8b7d5a209f648417510aadc0a017425 | kovot/stream/mastodon.py | kovot/stream/mastodon.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import collections.abc
from mastodon import StreamListener, MastodonError, Mastodon as MastodonAPI
from queue import Queue
from kovot.response import Response
from logging import Logger
from typing import Iterator, Optional
__all__ = ['MastodonResponse', 'Mastodon']
_TOOT... | Add a kovot stream for Mastodon | Add a kovot stream for Mastodon
| Python | mit | kenkov/kovot,kenkov/kovot | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import collections.abc
from mastodon import StreamListener, MastodonError, Mastodon as MastodonAPI
from queue import Queue
from kovot.response import Response
from logging import Logger
from typing import Iterator, Optional
__all__ = ['MastodonResponse', 'Mastodon']
_TOOT... | Add a kovot stream for Mastodon
| |
cf297fc336d069b9210cfebec9f2cd724faa62fa | src/acme/demo_bundle/command.py | src/acme/demo_bundle/command.py | # -*- coding: utf-8 -*-
# This file is part of the pymfony package.
#
# (c) Alexandre Quercia <alquerci@email.com>
#
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
"""
"""
from __future__ import absolute_import;
import time
from pymfony.co... | # -*- coding: utf-8 -*-
# This file is part of the pymfony package.
#
# (c) Alexandre Quercia <alquerci@email.com>
#
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
"""
"""
from __future__ import absolute_import;
import time
from pymfony.co... | Update with last version of pymfony | Update with last version of pymfony
| Python | mit | pymfony/pymfony-standard | # -*- coding: utf-8 -*-
# This file is part of the pymfony package.
#
# (c) Alexandre Quercia <alquerci@email.com>
#
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
"""
"""
from __future__ import absolute_import;
import time
from pymfony.co... | Update with last version of pymfony
# -*- coding: utf-8 -*-
# This file is part of the pymfony package.
#
# (c) Alexandre Quercia <alquerci@email.com>
#
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
"""
"""
from __future__ import absolute_... |
d752c73ec278eb36005dfe5ca62596e111970614 | test/integration/ggrc/services/test_custom_attributes.py | test/integration/ggrc/services/test_custom_attributes.py | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Tests for PUT and POST requests for objects with custom attributes
These tests include:
- Creating an object with custom attributes (POST request).
- Editing existing custom attributes on an object.
- Ad... | Add tests for new CA post api | Add tests for new CA post api
| Python | apache-2.0 | josthkko/ggrc-core,kr41/ggrc-core,josthkko/ggrc-core,edofic/ggrc-core,AleksNeStu/ggrc-core,plamut/ggrc-core,kr41/ggrc-core,AleksNeStu/ggrc-core,selahssea/ggrc-core,josthkko/ggrc-core,kr41/ggrc-core,VinnieJohns/ggrc-core,selahssea/ggrc-core,selahssea/ggrc-core,plamut/ggrc-core,kr41/ggrc-core,plamut/ggrc-core,VinnieJohns... | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Tests for PUT and POST requests for objects with custom attributes
These tests include:
- Creating an object with custom attributes (POST request).
- Editing existing custom attributes on an object.
- Ad... | Add tests for new CA post api
| |
22ce36b227c40ace101db5d9c4e30575adca5f36 | tests/settings.py | tests/settings.py | import os
from settings import *
db = os.environ.get('DB')
SECRET_KEY = "This is a test, you don't need secrets"
if db == "sqlite":
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
},
}
elif db == "postgres":
DATABASES = {
... | from __future__ import absolute_import
import os
from settings import *
db = os.environ.get('DB')
SECRET_KEY = "This is a test, you don't need secrets"
if db == "sqlite":
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
},
}
elif d... | Use absolute imports to avoid module naming issues | Use absolute imports to avoid module naming issues
| Python | agpl-3.0 | Inboxen/Inboxen,Inboxen/Inboxen,Inboxen/infrastructure,Inboxen/Inboxen,Inboxen/Inboxen | from __future__ import absolute_import
import os
from settings import *
db = os.environ.get('DB')
SECRET_KEY = "This is a test, you don't need secrets"
if db == "sqlite":
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
},
}
elif d... | Use absolute imports to avoid module naming issues
import os
from settings import *
db = os.environ.get('DB')
SECRET_KEY = "This is a test, you don't need secrets"
if db == "sqlite":
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
},... |
29c68602396f04f57de587231b87c9e137d51412 | celery/discovery.py | celery/discovery.py | import imp
from django.conf import settings
from django.core import exceptions
__all__ = ["autodiscover", "tasks_for_app", "find_related_module"]
def autodiscover():
"""Include tasks for all applications in settings.INSTALLED_APPS."""
return filter(None, [tasks_for_app(app)
for ap... | from django.conf import settings
__all__ = ["autodiscover", "find_related_module"]
def autodiscover():
"""Include tasks for all applications in settings.INSTALLED_APPS."""
return filter(None, [find_related_module(app, "tasks")
for app in settings.INSTALLED_APPS])
def find_relate... | Make autodiscover() work with zipped eggs. | Make autodiscover() work with zipped eggs.
| Python | bsd-3-clause | ask/celery,mitsuhiko/celery,ask/celery,WoLpH/celery,frac/celery,mitsuhiko/celery,frac/celery,cbrepo/celery,cbrepo/celery,WoLpH/celery | from django.conf import settings
__all__ = ["autodiscover", "find_related_module"]
def autodiscover():
"""Include tasks for all applications in settings.INSTALLED_APPS."""
return filter(None, [find_related_module(app, "tasks")
for app in settings.INSTALLED_APPS])
def find_relate... | Make autodiscover() work with zipped eggs.
import imp
from django.conf import settings
from django.core import exceptions
__all__ = ["autodiscover", "tasks_for_app", "find_related_module"]
def autodiscover():
"""Include tasks for all applications in settings.INSTALLED_APPS."""
return filter(None, [tasks_for... |
f71a166598ab35bc15f298226bb510d43f78c810 | bids/analysis/transformations/__init__.py | bids/analysis/transformations/__init__.py | from .compute import (sum, product, scale, orthogonalize, threshold, and_, or_,
not_, demean, convolve_HRF)
from .munge import (split, rename, assign, copy, factor, filter, select,
remove, replace, to_dense)
__all__ = [
'and_',
'assign',
'convolve_HRF',
'copy',... | from .compute import (sum, product, scale, orthogonalize, threshold, and_, or_,
not_, demean, convolve)
from .munge import (split, rename, assign, copy, factor, filter, select,
delete, replace, to_dense)
__all__ = [
'and_',
'assign',
'convolve',
'copy',
'de... | Fix imports for renamed transformations | Fix imports for renamed transformations
| Python | mit | INCF/pybids | from .compute import (sum, product, scale, orthogonalize, threshold, and_, or_,
not_, demean, convolve)
from .munge import (split, rename, assign, copy, factor, filter, select,
delete, replace, to_dense)
__all__ = [
'and_',
'assign',
'convolve',
'copy',
'de... | Fix imports for renamed transformations
from .compute import (sum, product, scale, orthogonalize, threshold, and_, or_,
not_, demean, convolve_HRF)
from .munge import (split, rename, assign, copy, factor, filter, select,
remove, replace, to_dense)
__all__ = [
'and_',
... |
6fa919ae5ef0755ec3c84e11aad9aa98a016fad4 | wafw00f/plugins/ptaf.py | wafw00f/plugins/ptaf.py | #!/usr/bin/env python
'''
Copyright (C) 2020, WAFW00F Developers.
See the LICENSE file for copying permission.
'''
NAME = 'PT Application Firewall (Positive Technologies)'
def is_waf(self):
schemes = [
self.matchContent(r'<h1.{0,10}?Forbidden'),
self.matchContent(r'<pre>Request.ID:.{0,10}?\d{4}\-... | #!/usr/bin/env python
'''
Copyright (C) 2020, WAFW00F Developers.
See the LICENSE file for copying permission.
'''
NAME = 'PT Application Firewall (Positive Technologies)'
def is_waf(self):
schemes = [
self.matchContent(r'<h1.{0,10}?Forbidden'),
self.matchContent(r'<pre>Request.ID:.{0,10}?\d{4}\-... | Fix error in Request ID regex | Fix error in Request ID regex
Fix error in Request ID regex that breaks correct WAF identification.
Changed 15 to 35, because 15 symbols between date and 'pre>' is not enough for this signature.
Sample of WAF block response:
<h1>Forbidden</h1><pre>Request ID: 2017-07-31-13-59-56-72BCA33A11EC3784</pre> | Python | bsd-3-clause | EnableSecurity/wafw00f | #!/usr/bin/env python
'''
Copyright (C) 2020, WAFW00F Developers.
See the LICENSE file for copying permission.
'''
NAME = 'PT Application Firewall (Positive Technologies)'
def is_waf(self):
schemes = [
self.matchContent(r'<h1.{0,10}?Forbidden'),
self.matchContent(r'<pre>Request.ID:.{0,10}?\d{4}\-... | Fix error in Request ID regex
Fix error in Request ID regex that breaks correct WAF identification.
Changed 15 to 35, because 15 symbols between date and 'pre>' is not enough for this signature.
Sample of WAF block response:
<h1>Forbidden</h1><pre>Request ID: 2017-07-31-13-59-56-72BCA33A11EC3784</pre>
#!/usr/bin... |
7a985d102a347e252b4e6be1776c6b6609fdcdea | pupa/core/default_settings.py | pupa/core/default_settings.py | MONGO_HOST = 'localhost'
MONGO_PORT = 27017
MONGO_DATABASE = 'pupa'
SCRAPELIB_RPM = 60
SCRAPELIB_TIMEOUT = 60
SCRAPELIB_RETRY_ATTEMPTS = 3
SCRAPELIB_RETRY_WAIT_SECONDS = 20
ENABLE_ELASTICSEARCH = False
BILL_FILTERS = {}
LEGISLATOR_FILTERS = {}
EVENT_FILTERS = {}
LOGGING_CONFIG = {
'version': 1,
'disable_exi... | MONGO_HOST = 'localhost'
MONGO_PORT = 27017
MONGO_DATABASE = 'pupa'
SCRAPELIB_RPM = 60
SCRAPELIB_TIMEOUT = 60
SCRAPELIB_RETRY_ATTEMPTS = 3
SCRAPELIB_RETRY_WAIT_SECONDS = 20
ENABLE_ELASTICSEARCH = False
ELASTICSEARCH_HOST = 'localhost'
ELASTICSEARCH_TIMEOUT = 2
BILL_FILTERS = {}
LEGISLATOR_FILTERS = {}
EVENT_FILTERS ... | Add sensible defaults for ElasticSearch settings | Add sensible defaults for ElasticSearch settings
| Python | bsd-3-clause | opencivicdata/pupa,datamade/pupa,influence-usa/pupa,datamade/pupa,opencivicdata/pupa,mileswwatkins/pupa,mileswwatkins/pupa,influence-usa/pupa,rshorey/pupa,rshorey/pupa | MONGO_HOST = 'localhost'
MONGO_PORT = 27017
MONGO_DATABASE = 'pupa'
SCRAPELIB_RPM = 60
SCRAPELIB_TIMEOUT = 60
SCRAPELIB_RETRY_ATTEMPTS = 3
SCRAPELIB_RETRY_WAIT_SECONDS = 20
ENABLE_ELASTICSEARCH = False
ELASTICSEARCH_HOST = 'localhost'
ELASTICSEARCH_TIMEOUT = 2
BILL_FILTERS = {}
LEGISLATOR_FILTERS = {}
EVENT_FILTERS ... | Add sensible defaults for ElasticSearch settings
MONGO_HOST = 'localhost'
MONGO_PORT = 27017
MONGO_DATABASE = 'pupa'
SCRAPELIB_RPM = 60
SCRAPELIB_TIMEOUT = 60
SCRAPELIB_RETRY_ATTEMPTS = 3
SCRAPELIB_RETRY_WAIT_SECONDS = 20
ENABLE_ELASTICSEARCH = False
BILL_FILTERS = {}
LEGISLATOR_FILTERS = {}
EVENT_FILTERS = {}
LOG... |
bea8b07180e6e9b2c786dfe37e12e75090363a1c | run.py | run.py | import os
import json
default_conf = {
'reddit': {
'username': '',
'password': '',
},
'twitter': {
'consumer_key': '',
'consumer_secret': '',
'access_token': '',
'access_secret': '',
},
}
if __name__ == '__main__':
if not os.path.isfile('config.json... | import os
import json
import sys
default_conf = {
'reddit': {
'username': '',
'password': '',
},
'twitter': {
'consumer_key': '',
'consumer_secret': '',
'access_token': '',
'access_secret': '',
},
}
def write_conf(conf):
config = json.dumps(conf, in... | Add twitter stuff to default config and allow easier merging of configs | Add twitter stuff to default config and allow easier merging of configs
| Python | mit | r3m0t/TweetPoster,joealcorn/TweetPoster,tytek2012/TweetPoster,aperson/TweetPoster | import os
import json
import sys
default_conf = {
'reddit': {
'username': '',
'password': '',
},
'twitter': {
'consumer_key': '',
'consumer_secret': '',
'access_token': '',
'access_secret': '',
},
}
def write_conf(conf):
config = json.dumps(conf, in... | Add twitter stuff to default config and allow easier merging of configs
import os
import json
default_conf = {
'reddit': {
'username': '',
'password': '',
},
'twitter': {
'consumer_key': '',
'consumer_secret': '',
'access_token': '',
'access_secret': '',
... |
f96b4f3516905b13267d6c918f22e76556b4b56a | salt/modules/cmd.py | salt/modules/cmd.py | '''
Module for shelling out commands, inclusion of this module should be
configurable for security reasons
'''
| '''
Module for shelling out commands, inclusion of this module should be
configurable for security reasons
'''
def echo(text):
'''
Return a string - used for testing the connection
'''
return text
| Add a simple test function | Add a simple test function
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | '''
Module for shelling out commands, inclusion of this module should be
configurable for security reasons
'''
def echo(text):
'''
Return a string - used for testing the connection
'''
return text
| Add a simple test function
'''
Module for shelling out commands, inclusion of this module should be
configurable for security reasons
'''
|
6cf8bad4faa15bcbc149db678e2ec232ce82b72a | utils/efushell/SocketDriver.py | utils/efushell/SocketDriver.py | import string
import socket
import sys
import time
import threading
class SimpleSocket:
def __init__(self, hostname="localhost", port=8888, timeout=2):
self.access_semaphor = threading.Semaphore(1)
try:
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
except socket... | import string
import socket
import sys
import time
import threading
class SimpleSocket:
def __init__(self, hostname="localhost", port=8888, timeout=2):
self.access_semaphor = threading.Semaphore(1)
try:
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
except socket... | Move string formatting onto two lines for readability | Move string formatting onto two lines for readability
| Python | bsd-2-clause | ess-dmsc/event-formation-unit,ess-dmsc/event-formation-unit,ess-dmsc/event-formation-unit,ess-dmsc/event-formation-unit | import string
import socket
import sys
import time
import threading
class SimpleSocket:
def __init__(self, hostname="localhost", port=8888, timeout=2):
self.access_semaphor = threading.Semaphore(1)
try:
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
except socket... | Move string formatting onto two lines for readability
import string
import socket
import sys
import time
import threading
class SimpleSocket:
def __init__(self, hostname="localhost", port=8888, timeout=2):
self.access_semaphor = threading.Semaphore(1)
try:
self.sock = socket.socket(so... |
ae21001fea38e9b8e4af34654c48b415e419f319 | core/utils.py | core/utils.py | from django.utils.duration import _get_duration_components
from datetime import timedelta
def duration_string_from_delta(delta):
seconds = delta.total_seconds()
split = str(seconds/3600).split('.')
print split
hours = int(split[0])
minutes = int(float('.'+split[1])*60)
string = '{}:{:02d}'.... | from django.utils.duration import _get_duration_components
from datetime import timedelta
def duration_string_from_delta(delta):
seconds = delta.total_seconds()
split = str(seconds/3600).split('.')
hours = int(split[0])
minutes = int(float('.'+split[1])*60)
string = '{}:{:02d}'.format(hours, mi... | Remove debugging print statement, opps | Remove debugging print statement, opps
| Python | bsd-2-clause | muhleder/timestrap,muhleder/timestrap,overshard/timestrap,cdubz/timestrap,Leahelisabeth/timestrap,Leahelisabeth/timestrap,Leahelisabeth/timestrap,cdubz/timestrap,Leahelisabeth/timestrap,overshard/timestrap,muhleder/timestrap,cdubz/timestrap,overshard/timestrap | from django.utils.duration import _get_duration_components
from datetime import timedelta
def duration_string_from_delta(delta):
seconds = delta.total_seconds()
split = str(seconds/3600).split('.')
hours = int(split[0])
minutes = int(float('.'+split[1])*60)
string = '{}:{:02d}'.format(hours, mi... | Remove debugging print statement, opps
from django.utils.duration import _get_duration_components
from datetime import timedelta
def duration_string_from_delta(delta):
seconds = delta.total_seconds()
split = str(seconds/3600).split('.')
print split
hours = int(split[0])
minutes = int(float('.'+... |
3e617e3ade1fa55562868c2e2bf8bc07f9b09a79 | skflow/tests/test_io.py | skflow/tests/test_io.py | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | Print when pandas not installed and removed unnecessary imports | Print when pandas not installed and removed unnecessary imports
| Python | apache-2.0 | anand-c-goog/tensorflow,alheinecke/tensorflow-xsmm,sandeepdsouza93/TensorFlow-15712,alisidd/tensorflow,paolodedios/tensorflow,kevin-coder/tensorflow-fork,sjperkins/tensorflow,yanchen036/tensorflow,with-git/tensorflow,benoitsteiner/tensorflow,kobejean/tensorflow,wangyum/tensorflow,Moriadry/tensorflow,rdipietro/tensorflo... | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | Print when pandas not installed and removed unnecessary imports
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.... |
0036095ed79c3ea6b14732555dbed9a987172366 | ue-crash-dummy.py | ue-crash-dummy.py | from flask import Flask
from flask_socketio import SocketIO
## Instanciate Flask (Static files and REST API)
app = Flask(__name__)
## Instanciate SocketIO (Websockets, used for events) on top of it
socketio = SocketIO(app)
@socketio.on('testEvent')
def test_event():
print "Got test event"
@socketio.on('testEve... | from flask import Flask
from flask_socketio import SocketIO
## Instanciate Flask (Static files and REST API)
app = Flask(__name__)
## Instanciate SocketIO (Websockets, used for events) on top of it
socketio = SocketIO(app)
@socketio.on('testEvent')
def test_event(_=None):
print "Got test event"
@socketio.on('t... | Add dummy parameter for UE4. | [Bugfix] Add dummy parameter for UE4.
Signed-off-by: Juri Berlanda <5bfdca9e82c53adb0603ce7083f4ba4f2da5cacf@hotmail.com>
| Python | mit | j-be/ue4-socketio-crash | from flask import Flask
from flask_socketio import SocketIO
## Instanciate Flask (Static files and REST API)
app = Flask(__name__)
## Instanciate SocketIO (Websockets, used for events) on top of it
socketio = SocketIO(app)
@socketio.on('testEvent')
def test_event(_=None):
print "Got test event"
@socketio.on('t... | [Bugfix] Add dummy parameter for UE4.
Signed-off-by: Juri Berlanda <5bfdca9e82c53adb0603ce7083f4ba4f2da5cacf@hotmail.com>
from flask import Flask
from flask_socketio import SocketIO
## Instanciate Flask (Static files and REST API)
app = Flask(__name__)
## Instanciate SocketIO (Websockets, used for events) on top of... |
2d01301e9154045f4b15d1523089ad36fdd7f6f4 | cs251tk/toolkit/process_student.py | cs251tk/toolkit/process_student.py | import os
from cs251tk.student import remove
from cs251tk.student import clone_student
from cs251tk.student import stash
from cs251tk.student import pull
from cs251tk.student import checkout_date
from cs251tk.student import record
from cs251tk.student import reset
from cs251tk.student import analyze
from cs251tk.commo... | import os
from cs251tk.student import remove
from cs251tk.student import clone_student
from cs251tk.student import stash
from cs251tk.student import pull
from cs251tk.student import checkout_date
from cs251tk.student import record
from cs251tk.student import reset
from cs251tk.student import analyze
def process_stud... | Remove leftover imports from testing | Remove leftover imports from testing | Python | mit | StoDevX/cs251-toolkit,StoDevX/cs251-toolkit,StoDevX/cs251-toolkit,StoDevX/cs251-toolkit | import os
from cs251tk.student import remove
from cs251tk.student import clone_student
from cs251tk.student import stash
from cs251tk.student import pull
from cs251tk.student import checkout_date
from cs251tk.student import record
from cs251tk.student import reset
from cs251tk.student import analyze
def process_stud... | Remove leftover imports from testing
import os
from cs251tk.student import remove
from cs251tk.student import clone_student
from cs251tk.student import stash
from cs251tk.student import pull
from cs251tk.student import checkout_date
from cs251tk.student import record
from cs251tk.student import reset
from cs251tk.stud... |
07ea04e56589407f4f32880a0f8bc748de3b3a88 | setup.py | setup.py | import os
import sys
from distutils.core import setup
def read(filename):
return open(os.path.join(os.path.dirname(__file__), filename)).read()
if sys.version_info >= (3, 4):
install_requires = []
else:
install_requires = ['asyncio']
install_requires.append('watchdog')
exec(open('hachiko/version.py').re... | import os
import sys
from distutils.core import setup
def read(filename):
return open(os.path.join(os.path.dirname(__file__), filename)).read()
if sys.version_info >= (3, 5):
install_requires = []
else:
install_requires = ['asyncio']
install_requires.append('watchdog')
exec(open('hachiko/version.py').re... | Raise min required Python version to 3.5 Python 3.4 reached eol | Raise min required Python version to 3.5
Python 3.4 reached eol
| Python | mit | biesnecker/hachiko | import os
import sys
from distutils.core import setup
def read(filename):
return open(os.path.join(os.path.dirname(__file__), filename)).read()
if sys.version_info >= (3, 5):
install_requires = []
else:
install_requires = ['asyncio']
install_requires.append('watchdog')
exec(open('hachiko/version.py').re... | Raise min required Python version to 3.5
Python 3.4 reached eol
import os
import sys
from distutils.core import setup
def read(filename):
return open(os.path.join(os.path.dirname(__file__), filename)).read()
if sys.version_info >= (3, 4):
install_requires = []
else:
install_requires = ['asyncio']
instal... |
40149ad648fa84f4597fcb3f3182b83ee62de035 | tests/test_fuzzy_completion.py | tests/test_fuzzy_completion.py | from __future__ import unicode_literals
import pytest
from prompt_toolkit.completion import Completion
from prompt_toolkit.document import Document
@pytest.fixture
def completer():
import pgcli.pgcompleter as pgcompleter
return pgcompleter.PGCompleter()
def test_ranking_ignores_identifier_quotes(completer):... | Add tests for fuzzy ranking adjustments. | Add tests for fuzzy ranking adjustments.
| Python | bsd-3-clause | n-someya/pgcli,TamasNo1/pgcli,janusnic/pgcli,w4ngyi/pgcli,j-bennet/pgcli,n-someya/pgcli,lk1ngaa7/pgcli,darikg/pgcli,thedrow/pgcli,dbcli/pgcli,d33tah/pgcli,darikg/pgcli,bitemyapp/pgcli,koljonen/pgcli,MattOates/pgcli,d33tah/pgcli,MattOates/pgcli,zhiyuanshi/pgcli,bitmonk/pgcli,johshoff/pgcli,bitmonk/pgcli,zhiyuanshi/pgcli... | from __future__ import unicode_literals
import pytest
from prompt_toolkit.completion import Completion
from prompt_toolkit.document import Document
@pytest.fixture
def completer():
import pgcli.pgcompleter as pgcompleter
return pgcompleter.PGCompleter()
def test_ranking_ignores_identifier_quotes(completer):... | Add tests for fuzzy ranking adjustments.
| |
f7bd83ddabcad10beeeca9b1fc1e07631e68d4e0 | src/models/c2w.py | src/models/c2w.py | from keras.layers import LSTM, Input, Dense, TimeDistributed, Masking, merge
from keras.models import Model
from layers import Projection
def C2W(params, V_C):
one_hots = Input(shape=(params.maxlen, V_C.size), dtype='int8')
c_E = TimeDistributed(Projection(params.d_C))(one_hots)
# we want to preserve the... | from keras.layers import LSTM, Input, Dense, TimeDistributed, Masking, Activation, merge
from keras.models import Model
from layers import Projection
def C2W(params, V_C):
one_hots = Input(shape=(params.maxlen, V_C.size), dtype='int8')
c_E = TimeDistributed(Projection(params.d_C))(one_hots)
# we want to ... | Use tanh activation for word C2W embeddings | Use tanh activation for word C2W embeddings | Python | mit | milankinen/c2w2c,milankinen/c2w2c | from keras.layers import LSTM, Input, Dense, TimeDistributed, Masking, Activation, merge
from keras.models import Model
from layers import Projection
def C2W(params, V_C):
one_hots = Input(shape=(params.maxlen, V_C.size), dtype='int8')
c_E = TimeDistributed(Projection(params.d_C))(one_hots)
# we want to ... | Use tanh activation for word C2W embeddings
from keras.layers import LSTM, Input, Dense, TimeDistributed, Masking, merge
from keras.models import Model
from layers import Projection
def C2W(params, V_C):
one_hots = Input(shape=(params.maxlen, V_C.size), dtype='int8')
c_E = TimeDistributed(Projection(param... |
b61679efce39841120fcdb921acefbc729f4c4fd | tests/test_kmeans.py | tests/test_kmeans.py | import numpy as np
import milk.unsupervised
def test_kmeans():
features = np.r_[np.random.rand(20,3)-.5,.5+np.random.rand(20,3)]
centroids, _ = milk.unsupervised.kmeans(features,2)
positions = [0]*20 + [1]*20
correct = (centroids == positions).sum()
assert correct >= 38 or correct <= 2
| import numpy as np
import milk.unsupervised
def test_kmeans():
np.random.seed(132)
features = np.r_[np.random.rand(20,3)-.5,.5+np.random.rand(20,3)]
centroids, _ = milk.unsupervised.kmeans(features,2)
positions = [0]*20 + [1]*20
correct = (centroids == positions).sum()
assert correct >= 38 or ... | Make sure results make sense | Make sure results make sense
| Python | mit | luispedro/milk,pombredanne/milk,luispedro/milk,pombredanne/milk,luispedro/milk,pombredanne/milk | import numpy as np
import milk.unsupervised
def test_kmeans():
np.random.seed(132)
features = np.r_[np.random.rand(20,3)-.5,.5+np.random.rand(20,3)]
centroids, _ = milk.unsupervised.kmeans(features,2)
positions = [0]*20 + [1]*20
correct = (centroids == positions).sum()
assert correct >= 38 or ... | Make sure results make sense
import numpy as np
import milk.unsupervised
def test_kmeans():
features = np.r_[np.random.rand(20,3)-.5,.5+np.random.rand(20,3)]
centroids, _ = milk.unsupervised.kmeans(features,2)
positions = [0]*20 + [1]*20
correct = (centroids == positions).sum()
assert correct >= ... |
3cd07d2e1ee88d131066878bc21d8046b665b587 | indico/core/signals/category.py | indico/core/signals/category.py | # This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from blinker import Namespace
_signals = Namespace()
moved = _signals.signal('moved', """
Called when ... | # This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from blinker import Namespace
_signals = Namespace()
moved = _signals.signal('moved', """
Called when ... | Fix typo in signal name | Fix typo in signal name
| Python | mit | indico/indico,DirkHoffmann/indico,indico/indico,indico/indico,pferreir/indico,DirkHoffmann/indico,indico/indico,DirkHoffmann/indico,DirkHoffmann/indico,pferreir/indico,pferreir/indico,pferreir/indico,ThiefMaster/indico,ThiefMaster/indico,ThiefMaster/indico,ThiefMaster/indico | # This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from blinker import Namespace
_signals = Namespace()
moved = _signals.signal('moved', """
Called when ... | Fix typo in signal name
# This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from blinker import Namespace
_signals = Namespace()
moved = _signals.signal(... |
f3e6c433f1f96e3185de04d5c4b069f9f2adf311 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='scrapy-djangoitem',
version='0.0.0',
url='https://github.com/scrapy/scrapy-djangoitem',
description='Scrapy extension to write scraped items using Django models',
long_description=open('README.rst').read(),
author='Scrapy developers',
... | from setuptools import setup, find_packages
setup(
name='scrapy-djangoitem',
version='0.0.0',
url='https://github.com/scrapy/scrapy-djangoitem',
description='Scrapy extension to write scraped items using Django models',
long_description=open('README.rst').read(),
author='Scrapy developers',
... | Remove scrapy and django from install_requires. | Remove scrapy and django from install_requires.
This prevents unintended upgrades of Scrapy or Django
when user runs 'pip install -U scrapy-djangoitem'.
| Python | bsd-3-clause | scrapy-plugins/scrapy-djangoitem,scrapy/scrapy-djangoitem | from setuptools import setup, find_packages
setup(
name='scrapy-djangoitem',
version='0.0.0',
url='https://github.com/scrapy/scrapy-djangoitem',
description='Scrapy extension to write scraped items using Django models',
long_description=open('README.rst').read(),
author='Scrapy developers',
... | Remove scrapy and django from install_requires.
This prevents unintended upgrades of Scrapy or Django
when user runs 'pip install -U scrapy-djangoitem'.
from setuptools import setup, find_packages
setup(
name='scrapy-djangoitem',
version='0.0.0',
url='https://github.com/scrapy/scrapy-djangoitem',
de... |
d7697891f86603d9901f02209bb4921fc1e2d209 | smif/http_api/app.py | smif/http_api/app.py | """Provide APP constant for the purposes of manually running the flask app
For example, set up environment variables then run the app::
export FLASK_APP=smif.http_api.app
export FLASK_DEBUG=1
flask run
"""
import os
from smif.data_layer import DatafileInterface
from smif.http_api import create... | """Provide APP constant for the purposes of manually running the flask app
For example, build the front end, then run the app with environment variables::
cd smif/app/
npm run build
cd ../http_api/
FLASK_APP=smif.http_api.app FLASK_DEBUG=1 flask run
"""
import os
from smif.data_layer i... | Add front end build step to comment on running manually | Add front end build step to comment on running manually
| Python | mit | willu47/smif,nismod/smif,willu47/smif,nismod/smif,nismod/smif,nismod/smif,tomalrussell/smif,willu47/smif,tomalrussell/smif,tomalrussell/smif,tomalrussell/smif,willu47/smif | """Provide APP constant for the purposes of manually running the flask app
For example, build the front end, then run the app with environment variables::
cd smif/app/
npm run build
cd ../http_api/
FLASK_APP=smif.http_api.app FLASK_DEBUG=1 flask run
"""
import os
from smif.data_layer i... | Add front end build step to comment on running manually
"""Provide APP constant for the purposes of manually running the flask app
For example, set up environment variables then run the app::
export FLASK_APP=smif.http_api.app
export FLASK_DEBUG=1
flask run
"""
import os
from smif.data_layer ... |
c45e00924fbe90fb6ff9465202a77d390c685dc4 | tests/test_cli_update.py | tests/test_cli_update.py | # -*- coding: utf-8 -*-
import pathlib
import json
def test_store_template_data_to_json(cli_runner, tmp_rc, tmp_templates_file):
result = cli_runner([
'-c', tmp_rc, 'update'
])
assert result.exit_code == 0
templates = pathlib.Path(tmp_templates_file)
assert templates.exists()
with ... | # -*- coding: utf-8 -*-
import pathlib
import json
from configparser import RawConfigParser
import pytest
def test_store_template_data_to_json(cli_runner, tmp_rc, tmp_templates_file):
result = cli_runner([
'-c', tmp_rc, 'update'
])
assert result.exit_code == 0
templates = pathlib.Path(tmp_... | Implement a test for missing username in update cmd | Implement a test for missing username in update cmd
| Python | bsd-3-clause | hackebrot/cibopath | # -*- coding: utf-8 -*-
import pathlib
import json
from configparser import RawConfigParser
import pytest
def test_store_template_data_to_json(cli_runner, tmp_rc, tmp_templates_file):
result = cli_runner([
'-c', tmp_rc, 'update'
])
assert result.exit_code == 0
templates = pathlib.Path(tmp_... | Implement a test for missing username in update cmd
# -*- coding: utf-8 -*-
import pathlib
import json
def test_store_template_data_to_json(cli_runner, tmp_rc, tmp_templates_file):
result = cli_runner([
'-c', tmp_rc, 'update'
])
assert result.exit_code == 0
templates = pathlib.Path(tmp_tem... |
188fcafc6855da9cb7f946b3605ddca2bd20a0b8 | qiprofile_rest/routers.py | qiprofile_rest/routers.py | from rest_framework import routers
from .views import (UserViewSet, SubjectViewSet,
SubjectDetailViewSet, SessionDetailViewSet)
router = routers.SimpleRouter()
router.register(r'user', UserViewSet)
router.register(r'subjects', SubjectViewSet)
router.register(r'subject_detail', SubjectDetailViewSet)... | from rest_framework import routers
from .views import (UserViewSet, SubjectViewSet,
SubjectDetailViewSet, SessionDetailViewSet)
router = routers.SimpleRouter()
router.register(r'user', UserViewSet)
router.register(r'subjects', SubjectViewSet)
router.register(r'subject[_-]detail', SubjectDetailViewS... | Allow underscore or dash in URL. | Allow underscore or dash in URL.
| Python | bsd-2-clause | ohsu-qin/qiprofile-rest,ohsu-qin/qirest | from rest_framework import routers
from .views import (UserViewSet, SubjectViewSet,
SubjectDetailViewSet, SessionDetailViewSet)
router = routers.SimpleRouter()
router.register(r'user', UserViewSet)
router.register(r'subjects', SubjectViewSet)
router.register(r'subject[_-]detail', SubjectDetailViewS... | Allow underscore or dash in URL.
from rest_framework import routers
from .views import (UserViewSet, SubjectViewSet,
SubjectDetailViewSet, SessionDetailViewSet)
router = routers.SimpleRouter()
router.register(r'user', UserViewSet)
router.register(r'subjects', SubjectViewSet)
router.register(r'subj... |
480e51fc6b09cc47105b4615c0ff9047b39a9067 | eva_cttv_pipeline/trait_mapping/utils.py | eva_cttv_pipeline/trait_mapping/utils.py | import logging
logger = logging.getLogger(__package__)
def request_retry_helper(function, retry_count: int, url: str):
"""
Given a function make a number of attempts to call function for it to successfully return a
non-None value, subsequently returning this value. Makes the number of tries specified in
... | import logging
logger = logging.getLogger(__package__)
def request_retry_helper(function, retry_count: int, url: str):
"""
Given a function make a number of attempts to call function for it to successfully return a
non-None value, subsequently returning this value. Makes the number of tries specified in
... | Modify the URL helper to not rely on None values | Modify the URL helper to not rely on None values
| Python | apache-2.0 | EBIvariation/eva-cttv-pipeline | import logging
logger = logging.getLogger(__package__)
def request_retry_helper(function, retry_count: int, url: str):
"""
Given a function make a number of attempts to call function for it to successfully return a
non-None value, subsequently returning this value. Makes the number of tries specified in
... | Modify the URL helper to not rely on None values
import logging
logger = logging.getLogger(__package__)
def request_retry_helper(function, retry_count: int, url: str):
"""
Given a function make a number of attempts to call function for it to successfully return a
non-None value, subsequently returning th... |
ad66203ccf2a76dde790c582e8915399fd4e3148 | Code/Python/Kamaelia/Kamaelia/Visualisation/__init__.py | Code/Python/Kamaelia/Kamaelia/Visualisation/__init__.py | #!/usr/bin/env python
# Copyright (C) 2004 British Broadcasting Corporation and Kamaelia Contributors(1)
# All Rights Reserved.
#
# You may only modify and redistribute this under the terms of any of the
# following licenses(2): Mozilla Public License, V1.1, GNU General
# Public License, V2.0, GNU Lesser General P... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License,... | Change license to Apache 2 | Change license to Apache 2 | Python | apache-2.0 | sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License,... | Change license to Apache 2
#!/usr/bin/env python
# Copyright (C) 2004 British Broadcasting Corporation and Kamaelia Contributors(1)
# All Rights Reserved.
#
# You may only modify and redistribute this under the terms of any of the
# following licenses(2): Mozilla Public License, V1.1, GNU General
# Public License,... |
3d04bb1774e286df4cda3695b938251e0a6266ae | grip/patcher.py | grip/patcher.py | import re
INCOMPLETE_TASK_RE = re.compile(r'<li>\[ \] (.*?)(<ul.*?>|</li>)', re.DOTALL)
INCOMPLETE_TASK_SUB = (r'<li class="task-list-item">'
r'<input type="checkbox" '
r'class="task-list-item-checkbox" disabled=""> \1\2')
COMPLETE_TASK_RE = re.compile(r'<li>\[x\] (.*?)(<... | import re
INCOMPLETE_TASK_RE = re.compile(r'<li>\[ \] (.*?)(<ul.*?>|</li>)', re.DOTALL)
INCOMPLETE_TASK_SUB = (r'<li class="task-list-item">'
r'<input type="checkbox" '
r'class="task-list-item-checkbox" disabled=""> \1\2')
COMPLETE_TASK_RE = re.compile(r'<li>\[x\] (.*?)(<... | Patch the GitHub API response to work around the header bug | Patch the GitHub API response to work around the header bug
| Python | mit | joeyespo/grip,joeyespo/grip | import re
INCOMPLETE_TASK_RE = re.compile(r'<li>\[ \] (.*?)(<ul.*?>|</li>)', re.DOTALL)
INCOMPLETE_TASK_SUB = (r'<li class="task-list-item">'
r'<input type="checkbox" '
r'class="task-list-item-checkbox" disabled=""> \1\2')
COMPLETE_TASK_RE = re.compile(r'<li>\[x\] (.*?)(<... | Patch the GitHub API response to work around the header bug
import re
INCOMPLETE_TASK_RE = re.compile(r'<li>\[ \] (.*?)(<ul.*?>|</li>)', re.DOTALL)
INCOMPLETE_TASK_SUB = (r'<li class="task-list-item">'
r'<input type="checkbox" '
r'class="task-list-item-checkbox" disabled... |
10e37d95dde00cd02d91998662a22f555837e877 | hp3parclient/__init__.py | hp3parclient/__init__.py | # Copyright 2012-2014 Hewlett Packard Development Company, L.P.
# 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/LICE... | # Copyright 2012-2014 Hewlett Packard Development Company, L.P.
# 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/LICE... | Update the version to 3.1.1 | Update the version to 3.1.1
Change-Id: Ia24c8a9e62330243fa7413a649f885c2a40dd4fb
| Python | apache-2.0 | hp-storage/python-3parclient,hpe-storage/python-3parclient | # Copyright 2012-2014 Hewlett Packard Development Company, L.P.
# 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/LICE... | Update the version to 3.1.1
Change-Id: Ia24c8a9e62330243fa7413a649f885c2a40dd4fb
# Copyright 2012-2014 Hewlett Packard Development Company, L.P.
# 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 o... |
04a93e33afd41405fcc660e9cfd7de191def4657 | backend/breach/tests/test_error_handling.py | backend/breach/tests/test_error_handling.py | from mock import patch
from django.utils import timezone
from django.test import TestCase
from breach.strategy import Strategy
from breach.models import Target, Victim, SampleSet
class ErrorHandlingTestCase(TestCase):
def setUp(self):
self.target = Target.objects.create(
endpoint='https://di.u... | Add strategy error handling tests | Add strategy error handling tests
| Python | mit | dimriou/rupture,dimkarakostas/rupture,dimriou/rupture,dimkarakostas/rupture,dimkarakostas/rupture,dimkarakostas/rupture,dimriou/rupture,dimriou/rupture,dimkarakostas/rupture,dimriou/rupture | from mock import patch
from django.utils import timezone
from django.test import TestCase
from breach.strategy import Strategy
from breach.models import Target, Victim, SampleSet
class ErrorHandlingTestCase(TestCase):
def setUp(self):
self.target = Target.objects.create(
endpoint='https://di.u... | Add strategy error handling tests
| |
65b7d1f1eafd32d3895e3ec15a559dca608b5c23 | addons/sale_coupon/models/mail_compose_message.py | addons/sale_coupon/models/mail_compose_message.py | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class MailComposeMessage(models.TransientModel):
_inherit = 'mail.compose.message'
def send_mail(self, **kwargs):
for wizard in self:
if self._context.get('mark_coup... | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class MailComposeMessage(models.TransientModel):
_inherit = 'mail.compose.message'
def send_mail(self, **kwargs):
for wizard in self:
if self._context.get('mark_coup... | Allow helpdesk users to send coupon by email | [IMP] sale_coupon: Allow helpdesk users to send coupon by email
Purpose
=======
Helpdesk users don't have the right to write on a coupon.
When sending a coupon by email, the coupon is marked as 'sent'.
Allow users to send coupons by executing the state change in sudo.
closes odoo/odoo#45091
Taskid: 2179609
Relate... | Python | agpl-3.0 | ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class MailComposeMessage(models.TransientModel):
_inherit = 'mail.compose.message'
def send_mail(self, **kwargs):
for wizard in self:
if self._context.get('mark_coup... | [IMP] sale_coupon: Allow helpdesk users to send coupon by email
Purpose
=======
Helpdesk users don't have the right to write on a coupon.
When sending a coupon by email, the coupon is marked as 'sent'.
Allow users to send coupons by executing the state change in sudo.
closes odoo/odoo#45091
Taskid: 2179609
Relate... |
84490442de881788a7f83bc18ec4eedb7f6edb99 | tests/bugs/test-200908231005.py | tests/bugs/test-200908231005.py | import pyxb.binding.generate
import pyxb.binding.datatypes as xs
import pyxb.binding.basis
import pyxb.utils.domutils
import os.path
xsd='''<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="structure">
<xs:complexType><xs:anyAttribute processContents... | import pyxb.binding.generate
import pyxb.binding.datatypes as xs
import pyxb.binding.basis
import pyxb.utils.domutils
import os.path
xsd='''<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="structure">
<xs:complexType><xs:anyAttribute processContents... | Stop writing generated code unnecessarily | Stop writing generated code unnecessarily
| Python | apache-2.0 | jonfoster/pyxb-upstream-mirror,pabigot/pyxb,pabigot/pyxb,jonfoster/pyxb2,balanced/PyXB,jonfoster/pyxb-upstream-mirror,jonfoster/pyxb-upstream-mirror,jonfoster/pyxb1,jonfoster/pyxb2,CantemoInternal/pyxb,balanced/PyXB,balanced/PyXB,jonfoster/pyxb2,CantemoInternal/pyxb,jonfoster/pyxb1,CantemoInternal/pyxb | import pyxb.binding.generate
import pyxb.binding.datatypes as xs
import pyxb.binding.basis
import pyxb.utils.domutils
import os.path
xsd='''<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="structure">
<xs:complexType><xs:anyAttribute processContents... | Stop writing generated code unnecessarily
import pyxb.binding.generate
import pyxb.binding.datatypes as xs
import pyxb.binding.basis
import pyxb.utils.domutils
import os.path
xsd='''<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="structure">
<xs:c... |
5b88a7068a6b245d99ef5998bbf659480fb85199 | cbc/environment.py | cbc/environment.py | import os
from .exceptions import IncompleteEnv
from tempfile import TemporaryDirectory
import time
class Environment(object):
def __init__(self, *args, **kwargs):
self.environ = os.environ.copy()
self.config = {}
self.cbchome = None
if 'CBC_HOME' in kwargs:
... | import os
from .exceptions import IncompleteEnv
from tempfile import TemporaryDirectory
import time
class Environment(object):
def __init__(self, *args, **kwargs):
self.environ = os.environ.copy()
self.config = {}
self.cbchome = None
if 'CBC_HOME' in kwargs:
... | Remove temp directory creation... not worth it | Remove temp directory creation... not worth it
| Python | bsd-3-clause | jhunkeler/cbc,jhunkeler/cbc,jhunkeler/cbc | import os
from .exceptions import IncompleteEnv
from tempfile import TemporaryDirectory
import time
class Environment(object):
def __init__(self, *args, **kwargs):
self.environ = os.environ.copy()
self.config = {}
self.cbchome = None
if 'CBC_HOME' in kwargs:
... | Remove temp directory creation... not worth it
import os
from .exceptions import IncompleteEnv
from tempfile import TemporaryDirectory
import time
class Environment(object):
def __init__(self, *args, **kwargs):
self.environ = os.environ.copy()
self.config = {}
self.cbchome = Non... |
ebf3f4a73aaab3aa2ea3e760bb44cfcbd7ca8d7f | src/main.py | src/main.py | #!/usr/bin/python
#coding=utf8
from Tkinter import *
import sys
from ui import Gui
if __name__ == '__main__':
Root = Tk()
App = Gui(Root)
App.pack(expand='yes',fill='both')
Root.geometry('320x240+10+10')
Root.title('Mid!Magic')
Root.mainloop() | #!/usr/bin/python
#coding=utf8
from Tkinter import *
import sys
from ui import Gui
if __name__ == '__main__':
Root = Tk()
App = Gui(Root)
App.pack(expand='yes',fill='both')
w, h = root.winfo_screenwidth(), root.winfo_screenheight()
Root.overrideredirect(1)
Root.geometry("%dx%d+0+0" % (w, h... | Add support for full screen. | Add support for full screen. | Python | apache-2.0 | doino-gretchenliev/Mid-Magic,doino-gretchenliev/Mid-Magic | #!/usr/bin/python
#coding=utf8
from Tkinter import *
import sys
from ui import Gui
if __name__ == '__main__':
Root = Tk()
App = Gui(Root)
App.pack(expand='yes',fill='both')
w, h = root.winfo_screenwidth(), root.winfo_screenheight()
Root.overrideredirect(1)
Root.geometry("%dx%d+0+0" % (w, h... | Add support for full screen.
#!/usr/bin/python
#coding=utf8
from Tkinter import *
import sys
from ui import Gui
if __name__ == '__main__':
Root = Tk()
App = Gui(Root)
App.pack(expand='yes',fill='both')
Root.geometry('320x240+10+10')
Root.title('Mid!Magic')
Root.mainloop() |
3031bcfda01a55c70f3af860bb5620a5530e654a | Motor/src/main/python/vehicles.py | Motor/src/main/python/vehicles.py | from Adafruit_MotorHAT import Adafruit_MotorHAT
class Vehicle:
def __init__(self, motor_hat=None):
self.motor_hat = motor_hat
self.motors = []
def release(self):
self.motor_hat.getMotor(1).run(Adafruit_MotorHAT.RELEASE)
self.motor_hat.getMotor(2).run(Adafruit_MotorHAT.RELEASE)... | from Adafruit_MotorHAT import Adafruit_MotorHAT
class Vehicle:
def __init__(self, motor_hat=Adafruit_MotorHAT()):
self.motor_hat = motor_hat
self.motors = []
def release(self):
self.motor_hat.getMotor(1).run(Adafruit_MotorHAT.RELEASE)
self.motor_hat.getMotor(2).run(Adafruit_Mo... | Build vehicle with motor hat. | Build vehicle with motor hat.
| Python | mit | misalcedo/RapBot,misalcedo/RapBot,misalcedo/RapBot,misalcedo/RapBot | from Adafruit_MotorHAT import Adafruit_MotorHAT
class Vehicle:
def __init__(self, motor_hat=Adafruit_MotorHAT()):
self.motor_hat = motor_hat
self.motors = []
def release(self):
self.motor_hat.getMotor(1).run(Adafruit_MotorHAT.RELEASE)
self.motor_hat.getMotor(2).run(Adafruit_Mo... | Build vehicle with motor hat.
from Adafruit_MotorHAT import Adafruit_MotorHAT
class Vehicle:
def __init__(self, motor_hat=None):
self.motor_hat = motor_hat
self.motors = []
def release(self):
self.motor_hat.getMotor(1).run(Adafruit_MotorHAT.RELEASE)
self.motor_hat.getMotor(2)... |
53de65c29fe4bc3961258bb160210c32ddfaeae4 | django/website/contacts/tests/test_validators.py | django/website/contacts/tests/test_validators.py | from datetime import date
from django.test import TestCase
from django.core.exceptions import ValidationError
from contacts.validators import year_to_now
today = date.today()
this_year = today.year
class ValidatorTests(TestCase):
def test_year_to_now(self):
self.assertRaises(ValidationError, year_to_now... | from datetime import date
from django.test import TestCase
from django.core.exceptions import ValidationError
from contacts.validators import year_to_now
today = date.today()
this_year = today.year
class ValidatorTests(TestCase):
def test_year_to_now(self):
self.assertRaises(ValidationError, year_to_now... | Add test for year_to_now with non-integer values | Add test for year_to_now with non-integer values | Python | agpl-3.0 | aptivate/kashana,aptivate/alfie,aptivate/alfie,aptivate/kashana,daniell/kashana,daniell/kashana,daniell/kashana,aptivate/kashana,daniell/kashana,aptivate/alfie,aptivate/alfie,aptivate/kashana | from datetime import date
from django.test import TestCase
from django.core.exceptions import ValidationError
from contacts.validators import year_to_now
today = date.today()
this_year = today.year
class ValidatorTests(TestCase):
def test_year_to_now(self):
self.assertRaises(ValidationError, year_to_now... | Add test for year_to_now with non-integer values
from datetime import date
from django.test import TestCase
from django.core.exceptions import ValidationError
from contacts.validators import year_to_now
today = date.today()
this_year = today.year
class ValidatorTests(TestCase):
def test_year_to_now(self):
... |
db25f3cbab70f8367aadb8c17adf342fb687f075 | d1_common_python/src/d1_common/node.py | d1_common_python/src/d1_common/node.py | # -*- coding: utf-8 -*-
# This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2016 DataONE
#
# Licensed under the Apache License, Version 2.0 ... | Add utility module for working with the Node type | Add utility module for working with the Node type
| Python | apache-2.0 | DataONEorg/d1_python,DataONEorg/d1_python,DataONEorg/d1_python,DataONEorg/d1_python | # -*- coding: utf-8 -*-
# This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2016 DataONE
#
# Licensed under the Apache License, Version 2.0 ... | Add utility module for working with the Node type
| |
46a0caa1bc162d11b26a996379170b2fc49f2940 | mcbench/client.py | mcbench/client.py | import collections
import redis
BENCHMARK_FIELDS = [
'author', 'author_url', 'date_submitted', 'date_updated',
'name', 'summary', 'tags', 'title', 'url'
]
Benchmark = collections.namedtuple('Benchmark', ' '.join(BENCHMARK_FIELDS))
class McBenchClient(object):
def __init__(self, redis):
self.red... | import redis
class Benchmark(object):
def __init__(self, author, author_url, date_submitted, date_updated,
name, summary, tags, title, url):
self.author = author
self.author_url = author_url
self.date_submitted = date_submitted
self.date_updated = date_updated
... | Make Benchmark a class, not a namedtuple. | Make Benchmark a class, not a namedtuple.
| Python | mit | isbadawi/mcbench,isbadawi/mcbench | import redis
class Benchmark(object):
def __init__(self, author, author_url, date_submitted, date_updated,
name, summary, tags, title, url):
self.author = author
self.author_url = author_url
self.date_submitted = date_submitted
self.date_updated = date_updated
... | Make Benchmark a class, not a namedtuple.
import collections
import redis
BENCHMARK_FIELDS = [
'author', 'author_url', 'date_submitted', 'date_updated',
'name', 'summary', 'tags', 'title', 'url'
]
Benchmark = collections.namedtuple('Benchmark', ' '.join(BENCHMARK_FIELDS))
class McBenchClient(object):
... |
7e5777c7b09780d7cde1a94e58dd022f98051168 | scrapple/utils/config.py | scrapple/utils/config.py | """
scrapple.utils.config
~~~~~~~~~~~~~~~~~~~~~
Functions related to traversing the configuration file
"""
from __future__ import print_function
def traverse_next(page, next, results):
"""
Recursive generator to traverse through the next attribute and \
crawl through the links to be followed
"""
... | """
scrapple.utils.config
~~~~~~~~~~~~~~~~~~~~~
Functions related to traversing the configuration file
"""
from __future__ import print_function
from colorama import init, Fore, Back
init()
def traverse_next(page, next, results):
"""
Recursive generator to traverse through the next attribute and \
craw... | Modify stdout logging in crawler run | Modify stdout logging in crawler run
| Python | mit | AlexMathew/scrapple,AlexMathew/scrapple,scrappleapp/scrapple,scrappleapp/scrapple,AlexMathew/scrapple | """
scrapple.utils.config
~~~~~~~~~~~~~~~~~~~~~
Functions related to traversing the configuration file
"""
from __future__ import print_function
from colorama import init, Fore, Back
init()
def traverse_next(page, next, results):
"""
Recursive generator to traverse through the next attribute and \
craw... | Modify stdout logging in crawler run
"""
scrapple.utils.config
~~~~~~~~~~~~~~~~~~~~~
Functions related to traversing the configuration file
"""
from __future__ import print_function
def traverse_next(page, next, results):
"""
Recursive generator to traverse through the next attribute and \
crawl throug... |
b1906e66dc9f7ce7d164d0df2622e8c2213e1692 | tests/query_test/test_chars.py | tests/query_test/test_chars.py | #!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
#
import logging
import pytest
from copy import copy
from tests.common.test_vector import *
from tests.common.impala_test_suite import *
class TestStringQueries(ImpalaTestSuite):
@classmethod
def get_workload(cls):
return 'function... | #!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
#
import logging
import pytest
from copy import copy
from tests.common.test_vector import *
from tests.common.impala_test_suite import *
class TestStringQueries(ImpalaTestSuite):
@classmethod
def get_workload(cls):
return 'function... | Fix char test to only run on test/none. | Fix char test to only run on test/none.
Change-Id: I8f5ac5a6e7399ce2fdbe78d07ae24deaa1d7532d
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4326
Tested-by: jenkins
Reviewed-by: Alex Behm <fe1626037acfc2dc542d2aa723a6d14f2464a20c@cloudera.com>
| Python | apache-2.0 | andybab/Impala,gistic/PublicSpatialImpala,ImpalaToGo/ImpalaToGo,andybab/Impala,andybab/Impala,andybab/Impala,gistic/PublicSpatialImpala,placrosse/ImpalaToGo,andybab/Impala,gistic/PublicSpatialImpala,AtScaleInc/Impala,placrosse/ImpalaToGo,andybab/Impala,AtScaleInc/Impala,placrosse/ImpalaToGo,ImpalaToGo/ImpalaToGo,Impala... | #!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
#
import logging
import pytest
from copy import copy
from tests.common.test_vector import *
from tests.common.impala_test_suite import *
class TestStringQueries(ImpalaTestSuite):
@classmethod
def get_workload(cls):
return 'function... | Fix char test to only run on test/none.
Change-Id: I8f5ac5a6e7399ce2fdbe78d07ae24deaa1d7532d
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4326
Tested-by: jenkins
Reviewed-by: Alex Behm <fe1626037acfc2dc542d2aa723a6d14f2464a20c@cloudera.com>
#!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights rese... |
ab59466b0cce94106e7e48fd4480c33b2f17910b | pylinks/search/views.py | pylinks/search/views.py | from django.core.paginator import InvalidPage, Paginator
from django.http import Http404
from django.utils.translation import ugettext as _
from haystack.forms import FacetedSearchForm
from haystack.query import SearchQuerySet
from haystack.views import FacetedSearchView
class SearchView(FacetedSearchView):
templ... | from django.core.paginator import InvalidPage, Paginator
from django.http import Http404
from django.utils.translation import gettext as _
from haystack.forms import FacetedSearchForm
from haystack.query import SearchQuerySet
from haystack.views import FacetedSearchView
class SearchView(FacetedSearchView):
templa... | Switch import from ugettext to gettext | Switch import from ugettext to gettext
| Python | mit | michaelmior/pylinks,michaelmior/pylinks,michaelmior/pylinks | from django.core.paginator import InvalidPage, Paginator
from django.http import Http404
from django.utils.translation import gettext as _
from haystack.forms import FacetedSearchForm
from haystack.query import SearchQuerySet
from haystack.views import FacetedSearchView
class SearchView(FacetedSearchView):
templa... | Switch import from ugettext to gettext
from django.core.paginator import InvalidPage, Paginator
from django.http import Http404
from django.utils.translation import ugettext as _
from haystack.forms import FacetedSearchForm
from haystack.query import SearchQuerySet
from haystack.views import FacetedSearchView
class ... |
1b3ec35857a8eff88b8984c83564e18a25ff081e | app/routes.py | app/routes.py | from flask import request, jsonify, session, g
import numpy as np
from DatasetCreation import ConstructDataset
from . import app
from . import firebase
from sklearn.ensemble import RandomForestClassifier
from sklearn import preprocessing
from sklearn.cross_validation import cross_val_score
@app.route("/", methods=[... | from flask import jsonify
from . import app
from . import firebase
@app.route("/", methods=["GET"])
def index():
response = firebase.get("/", None)
response = response or {}
return jsonify(response)
| Remove commented code and unused imports | Remove commented code and unused imports
| Python | mit | MachineLearningProject/flight-delay-prediction,MachineLearningProject/flight-delay-prediction,MachineLearningProject/flight-delay-prediction | from flask import jsonify
from . import app
from . import firebase
@app.route("/", methods=["GET"])
def index():
response = firebase.get("/", None)
response = response or {}
return jsonify(response)
| Remove commented code and unused imports
from flask import request, jsonify, session, g
import numpy as np
from DatasetCreation import ConstructDataset
from . import app
from . import firebase
from sklearn.ensemble import RandomForestClassifier
from sklearn import preprocessing
from sklearn.cross_validation import c... |
dc10cbafe045d55906d627816a88323fb4a8c948 | exec_proc.py | exec_proc.py | #!/usr/bin/env python
# Copyright 2014 Boundary, 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 o... | #!/usr/bin/env python
# Copyright 2014 Boundary, 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 o... | Add output of command in hex | Add output of command in hex
| Python | apache-2.0 | boundary/boundary-plugin-shell,boundary/boundary-plugin-shell,jdgwartney/boundary-plugin-shell,jdgwartney/boundary-plugin-shell | #!/usr/bin/env python
# Copyright 2014 Boundary, 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 o... | Add output of command in hex
#!/usr/bin/env python
# Copyright 2014 Boundary, 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
#
# Unles... |
e8584f4193658399ea9bb2317915caff78fce88b | corehq/apps/commtrack/management/commands/update_supply_point_locations.py | corehq/apps/commtrack/management/commands/update_supply_point_locations.py | from django.core.management.base import BaseCommand
from casexml.apps.case.models import CommCareCase
from corehq.util.couch import iter_update, DocUpdate
class Command(BaseCommand):
help = ("Make sure all supply point cases have their owner_id set "
"to the location_id")
def handle(self, *args, ... | from xml.etree import ElementTree
from django.core.management.base import BaseCommand
from casexml.apps.case.mock import CaseBlock
from casexml.apps.case.models import CommCareCase
from dimagi.utils.chunked import chunked
from dimagi.utils.couch.database import iter_docs
from corehq.apps.domain.models import Domain
f... | Use CaseBlocks to update case owner_ids | Use CaseBlocks to update case owner_ids
| Python | bsd-3-clause | dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq | from xml.etree import ElementTree
from django.core.management.base import BaseCommand
from casexml.apps.case.mock import CaseBlock
from casexml.apps.case.models import CommCareCase
from dimagi.utils.chunked import chunked
from dimagi.utils.couch.database import iter_docs
from corehq.apps.domain.models import Domain
f... | Use CaseBlocks to update case owner_ids
from django.core.management.base import BaseCommand
from casexml.apps.case.models import CommCareCase
from corehq.util.couch import iter_update, DocUpdate
class Command(BaseCommand):
help = ("Make sure all supply point cases have their owner_id set "
"to the lo... |
6894bd3cfc010c371478e7ae9e5e0b3ba108e165 | plugins/configuration/configurationtype/configuration_registrar.py | plugins/configuration/configurationtype/configuration_registrar.py | #!/usr/bin/env python
#-*- coding: utf-8 -*-
#This software is distributed under the Creative Commons license (CC0) version 1.0. A copy of this license should have been distributed with this software.
#The license can also be read online: <https://creativecommons.org/publicdomain/zero/1.0/>. If this online license dif... | #!/usr/bin/env python
#-*- coding: utf-8 -*-
#This software is distributed under the Creative Commons license (CC0) version 1.0. A copy of this license should have been distributed with this software.
#The license can also be read online: <https://creativecommons.org/publicdomain/zero/1.0/>. If this online license dif... | Implement unregistration of configuration plug-ins | Implement unregistration of configuration plug-ins
Perhaps we should not give a warning, but instead an exception, when registering or unregistering fails?
| Python | cc0-1.0 | Ghostkeeper/Luna | #!/usr/bin/env python
#-*- coding: utf-8 -*-
#This software is distributed under the Creative Commons license (CC0) version 1.0. A copy of this license should have been distributed with this software.
#The license can also be read online: <https://creativecommons.org/publicdomain/zero/1.0/>. If this online license dif... | Implement unregistration of configuration plug-ins
Perhaps we should not give a warning, but instead an exception, when registering or unregistering fails?
#!/usr/bin/env python
#-*- coding: utf-8 -*-
#This software is distributed under the Creative Commons license (CC0) version 1.0. A copy of this license should ha... |
2c83148a2de978382875e6b474c0b3d899a7c5dc | swift/__init__.py | swift/__init__.py | import gettext
class Version(object):
def __init__(self, canonical_version, final):
self.canonical_version = canonical_version
self.final = final
@property
def pretty_version(self):
if self.final:
return self.canonical_version
else:
return '%s-dev' ... | import gettext
class Version(object):
def __init__(self, canonical_version, final):
self.canonical_version = canonical_version
self.final = final
@property
def pretty_version(self):
if self.final:
return self.canonical_version
else:
return '%s-dev' ... | Switch trunk to 1.4.3 development | Switch trunk to 1.4.3 development | Python | apache-2.0 | mja054/swift_plugin,clayg/swift,notmyname/swift,clayg/swift,thiagodasilva/swift,Triv90/SwiftUml,aerwin3/swift,nadeemsyed/swift,Khushbu27/Tutorial,nadeemsyed/swift,tsli/test,ceph/swift,notmyname/swift,dpgoetz/swift,revoer/keystone-8.0.0,revoer/keystone-8.0.0,eatbyte/Swift,aerwin3/swift,SUSE/swift,tsli/test,thiagodasilva... | import gettext
class Version(object):
def __init__(self, canonical_version, final):
self.canonical_version = canonical_version
self.final = final
@property
def pretty_version(self):
if self.final:
return self.canonical_version
else:
return '%s-dev' ... | Switch trunk to 1.4.3 development
import gettext
class Version(object):
def __init__(self, canonical_version, final):
self.canonical_version = canonical_version
self.final = final
@property
def pretty_version(self):
if self.final:
return self.canonical_version
... |
12b6bf33205fbf09854e4e97c12ce62da992028a | renzongxian/0001/0001.py | renzongxian/0001/0001.py | # Source:https://github.com/Show-Me-the-Code/show-me-the-code
# Author:renzongxian
# Date:2014-11-30
# Python 3.4
"""
做为 Apple Store App 独立开发者,你要搞限时促销,为你的应用生成激活码(或者优惠券),
使用 Python 如何生成 200 个激活码(或者优惠券)?
"""
import uuid
def generate_key():
key_list = []
for i in range(200):
uuid_key = uuid.uuid3(uui... | # Source:https://github.com/Show-Me-the-Code/show-me-the-code
# Author:renzongxian
# Date:2014-11-30
# Python 3.4
"""
做为 Apple Store App 独立开发者,你要搞限时促销,为你的应用生成激活码(或者优惠券),
使用 Python 如何生成 200 个激活码(或者优惠券)?
"""
import uuid
def generate_key():
key_list = []
for i in range(200):
uuid_key = uuid.uuid3(uui... | Add a blank line in the end | Add a blank line in the end
| Python | mit | agogear/python-1,Show-Me-the-Code/python,Pritesh242/python,merfii/PythonExercises,whix/python,xchaoinfo/python,tzq668766/python,Jaccorot/python,wangjun/python,zhakui/python,YGIronMan/python,luoxufeiyan/python,Friday21/python_show_me_the_code,Friday21/python_show_me_the_code,karnikamit/python,YGIronMan/python,ZuoGuocai/... | # Source:https://github.com/Show-Me-the-Code/show-me-the-code
# Author:renzongxian
# Date:2014-11-30
# Python 3.4
"""
做为 Apple Store App 独立开发者,你要搞限时促销,为你的应用生成激活码(或者优惠券),
使用 Python 如何生成 200 个激活码(或者优惠券)?
"""
import uuid
def generate_key():
key_list = []
for i in range(200):
uuid_key = uuid.uuid3(uui... | Add a blank line in the end
# Source:https://github.com/Show-Me-the-Code/show-me-the-code
# Author:renzongxian
# Date:2014-11-30
# Python 3.4
"""
做为 Apple Store App 独立开发者,你要搞限时促销,为你的应用生成激活码(或者优惠券),
使用 Python 如何生成 200 个激活码(或者优惠券)?
"""
import uuid
def generate_key():
key_list = []
for i in range(200):
... |
bdbff5ea5548067713951a85b05f3818e537c8d4 | streamparse/bootstrap/project/src/bolts/wordcount.py | streamparse/bootstrap/project/src/bolts/wordcount.py | from __future__ import absolute_import, print_function, unicode_literals
from collections import Counter
from streamparse.bolt import Bolt
class WordCounter(Bolt):
def initialize(self, conf, ctx):
self.counts = Counter()
def process(self, tup):
word = tup.values[0]
self.counts[word] ... | from __future__ import absolute_import, print_function, unicode_literals
from collections import Counter
from streamparse.bolt import Bolt
class WordCounter(Bolt):
AUTO_ACK = True # automatically acknowledge tuples after process()
AUTO_ANCHOR = True # automatically anchor tuples to current tuple
AUTO_... | Update quickstart project to use AUTO_* | Update quickstart project to use AUTO_*
| Python | apache-2.0 | crohling/streamparse,petchat/streamparse,petchat/streamparse,eric7j/streamparse,msmakhlouf/streamparse,codywilbourn/streamparse,Parsely/streamparse,codywilbourn/streamparse,msmakhlouf/streamparse,scrapinghub/streamparse,Parsely/streamparse,petchat/streamparse,phanib4u/streamparse,petchat/streamparse,scrapinghub/streamp... | from __future__ import absolute_import, print_function, unicode_literals
from collections import Counter
from streamparse.bolt import Bolt
class WordCounter(Bolt):
AUTO_ACK = True # automatically acknowledge tuples after process()
AUTO_ANCHOR = True # automatically anchor tuples to current tuple
AUTO_... | Update quickstart project to use AUTO_*
from __future__ import absolute_import, print_function, unicode_literals
from collections import Counter
from streamparse.bolt import Bolt
class WordCounter(Bolt):
def initialize(self, conf, ctx):
self.counts = Counter()
def process(self, tup):
word =... |
ea02f8e714df34da0ff55a8c9750eb0d992875c2 | feincms3/apps.py | feincms3/apps.py | # pragma: no cover
import warnings
import django
if django.VERSION < (3, 2):
from feincms3.applications import * # noqa
warnings.warn(
"Django 3.2 will start autodiscovering app configs inside '.apps' modules."
" We cannot continue using feincms3.apps because the AppsMixin inside this"
... | import warnings
import django
if django.VERSION < (3, 2):
from feincms3.applications import * # noqa
warnings.warn(
"Django 3.2 will start autodiscovering app configs inside '.apps' modules."
" We cannot continue using feincms3.apps because the AppsMixin inside this"
" module can on... | Remove a no cover pragma having no effect (since the pragma only affects the current line) | Remove a no cover pragma having no effect (since the pragma only affects the current line)
| Python | bsd-3-clause | matthiask/feincms3,matthiask/feincms3,matthiask/feincms3 | import warnings
import django
if django.VERSION < (3, 2):
from feincms3.applications import * # noqa
warnings.warn(
"Django 3.2 will start autodiscovering app configs inside '.apps' modules."
" We cannot continue using feincms3.apps because the AppsMixin inside this"
" module can on... | Remove a no cover pragma having no effect (since the pragma only affects the current line)
# pragma: no cover
import warnings
import django
if django.VERSION < (3, 2):
from feincms3.applications import * # noqa
warnings.warn(
"Django 3.2 will start autodiscovering app configs inside '.apps' modul... |
d7bf66d84aee271cbcd99cd91eaedea8942d5a93 | exponent/auth/service.py | exponent/auth/service.py | from exponent.auth import common
from twisted.cred import checkers, portal
from twisted.internet import defer
from twisted.protocols import amp
from zope import interface
def _getUserByIdentifier(rootStore, userIdentifier):
"""
Gets a user by uid.
"""
user = common.User.findUnique(rootStore, userIdent... | from twisted.cred import checkers, portal
from twisted.protocols import amp
from zope import interface
class AuthenticationLocator(amp.CommandLocator):
"""
A base class for responder locators that allow users to authenticate.
"""
credentialInterfaces = []
def __init__(self, store):
"""
... | Remove get user by id nonsense, now exponent.auth.name | Remove get user by id nonsense, now exponent.auth.name
| Python | isc | lvh/exponent | from twisted.cred import checkers, portal
from twisted.protocols import amp
from zope import interface
class AuthenticationLocator(amp.CommandLocator):
"""
A base class for responder locators that allow users to authenticate.
"""
credentialInterfaces = []
def __init__(self, store):
"""
... | Remove get user by id nonsense, now exponent.auth.name
from exponent.auth import common
from twisted.cred import checkers, portal
from twisted.internet import defer
from twisted.protocols import amp
from zope import interface
def _getUserByIdentifier(rootStore, userIdentifier):
"""
Gets a user by uid.
""... |
f07a114ed23109c9b834b2cbc37ba54c728d73cb | fmn/lib/__init__.py | fmn/lib/__init__.py | """ fedmsg-notifications internal API """
import fmn.lib.models
import logging
log = logging.getLogger(__name__)
def recipients(session, config, message):
""" The main API function.
Accepts a fedmsg message as an argument.
Returns a dict mapping context names to lists of recipients.
"""
res =... | """ fedmsg-notifications internal API """
import fmn.lib.models
import logging
log = logging.getLogger(__name__)
def recipients(session, config, message):
""" The main API function.
Accepts a fedmsg message as an argument.
Returns a dict mapping context names to lists of recipients.
"""
res =... | Restructure the valid_paths list into a dict. | Restructure the valid_paths list into a dict.
| Python | lgpl-2.1 | jeremycline/fmn,jeremycline/fmn,jeremycline/fmn | """ fedmsg-notifications internal API """
import fmn.lib.models
import logging
log = logging.getLogger(__name__)
def recipients(session, config, message):
""" The main API function.
Accepts a fedmsg message as an argument.
Returns a dict mapping context names to lists of recipients.
"""
res =... | Restructure the valid_paths list into a dict.
""" fedmsg-notifications internal API """
import fmn.lib.models
import logging
log = logging.getLogger(__name__)
def recipients(session, config, message):
""" The main API function.
Accepts a fedmsg message as an argument.
Returns a dict mapping context n... |
f09decf4d57e83c8bf13fab697bd9cfb3b983c22 | setup.py | setup.py | from setuptools import setup
with open('README.md') as file:
long_description = file.read()
setup(
name="chalupas-files",
version="0.1.0",
author="Antonin Messinger",
author_email="antonin.messinger@gmail.com",
description=" Convert any document",
long_description=long_description,
li... | from setuptools import setup
with open('README.md') as file:
long_description = file.read()
setup(
name="chalupas-files",
version="0.1.0",
author="Antonin Messinger",
author_email="antonin.messinger@gmail.com",
description=" Convert any document",
long_description=long_description,
li... | Upgrade to Flask 0.12.3 to fix CVE-2018-1000656 | Upgrade to Flask 0.12.3 to fix CVE-2018-1000656
| Python | mit | Antojitos/chalupas | from setuptools import setup
with open('README.md') as file:
long_description = file.read()
setup(
name="chalupas-files",
version="0.1.0",
author="Antonin Messinger",
author_email="antonin.messinger@gmail.com",
description=" Convert any document",
long_description=long_description,
li... | Upgrade to Flask 0.12.3 to fix CVE-2018-1000656
from setuptools import setup
with open('README.md') as file:
long_description = file.read()
setup(
name="chalupas-files",
version="0.1.0",
author="Antonin Messinger",
author_email="antonin.messinger@gmail.com",
description=" Convert any documen... |
31eae0aee3a6ae9fa7abea312ff1ea843a98e853 | graphene/contrib/django/tests/models.py | graphene/contrib/django/tests/models.py | from __future__ import absolute_import
from django.db import models
class Pet(models.Model):
name = models.CharField(max_length=30)
class Film(models.Model):
reporters = models.ManyToManyField('Reporter',
related_name='films')
class Reporter(models.Model):
first... | from __future__ import absolute_import
from django.db import models
class Pet(models.Model):
name = models.CharField(max_length=30)
class Film(models.Model):
reporters = models.ManyToManyField('Reporter',
related_name='films')
class Reporter(models.Model):
first... | Improve Django field conversion real-life tests | Improve Django field conversion real-life tests
| Python | mit | graphql-python/graphene,sjhewitt/graphene,Globegitter/graphene,sjhewitt/graphene,Globegitter/graphene,graphql-python/graphene | from __future__ import absolute_import
from django.db import models
class Pet(models.Model):
name = models.CharField(max_length=30)
class Film(models.Model):
reporters = models.ManyToManyField('Reporter',
related_name='films')
class Reporter(models.Model):
first... | Improve Django field conversion real-life tests
from __future__ import absolute_import
from django.db import models
class Pet(models.Model):
name = models.CharField(max_length=30)
class Film(models.Model):
reporters = models.ManyToManyField('Reporter',
related_name='... |
876a2934086f05514a66f97fbebed2e0bd62c7f6 | examples/gi_example.py | examples/gi_example.py | # Copyright 2012 Christoph Reiter
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
from ctypes import byref, POINTER, cast
import sys
sys.path.insert(0, '..')
from pgi.gitypes impor... | Add back the old gir example | Add back the old gir example
| Python | lgpl-2.1 | lazka/pgi,lazka/pgi | # Copyright 2012 Christoph Reiter
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
from ctypes import byref, POINTER, cast
import sys
sys.path.insert(0, '..')
from pgi.gitypes impor... | Add back the old gir example
| |
dc7e5a15eaba0a64c59afcb1d885f32347d95ebb | bluebottle/notifications/tests/test_effects.py | bluebottle/notifications/tests/test_effects.py | from django.core import mail
from bluebottle.events.messages import EventClosedOwnerMessage
from bluebottle.events.tests.factories import EventFactory
from bluebottle.notifications.effects import NotificationEffect
from bluebottle.test.factory_models.accounts import BlueBottleUserFactory
from bluebottle.test.utils imp... | Add effect test for notifications | Add effect test for notifications
| Python | bsd-3-clause | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | from django.core import mail
from bluebottle.events.messages import EventClosedOwnerMessage
from bluebottle.events.tests.factories import EventFactory
from bluebottle.notifications.effects import NotificationEffect
from bluebottle.test.factory_models.accounts import BlueBottleUserFactory
from bluebottle.test.utils imp... | Add effect test for notifications
| |
3047958a14f8e428404a4a29c43600b85fce6621 | packages/syft/src/syft/core/node/common/node_service/simple/obj_exists.py | packages/syft/src/syft/core/node/common/node_service/simple/obj_exists.py | # stdlib
from typing import Any
from typing import Optional
# third party
from nacl.signing import VerifyKey
# relative
from ... import UID
from ....abstract.node import AbstractNode
from .simple_messages import NodeRunnableMessageWithReply
class DoesObjectExistMessage(NodeRunnableMessageWithReply):
__attr_all... | Add new message which checks whether an object exists | Add new message which checks whether an object exists
| Python | apache-2.0 | OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft | # stdlib
from typing import Any
from typing import Optional
# third party
from nacl.signing import VerifyKey
# relative
from ... import UID
from ....abstract.node import AbstractNode
from .simple_messages import NodeRunnableMessageWithReply
class DoesObjectExistMessage(NodeRunnableMessageWithReply):
__attr_all... | Add new message which checks whether an object exists
| |
32912c8c5c02d1922f56bac4b8c97f4e53eccb81 | muffin_peewee/debugtoolbar.py | muffin_peewee/debugtoolbar.py | import logging
import jinja2
import datetime as dt
from muffin_debugtoolbar.panels import DebugPanel
from muffin_debugtoolbar.utils import LoggingTrackingHandler
LOGGER = logging.getLogger('peewee')
class PeeweeDebugPanel(DebugPanel):
name = 'Peewee queries'
template = jinja2.Template("""
<table c... | Add debugpanel for Muffin Debugtoolbar | Add debugpanel for Muffin Debugtoolbar
| Python | mit | klen/muffin-peewee | import logging
import jinja2
import datetime as dt
from muffin_debugtoolbar.panels import DebugPanel
from muffin_debugtoolbar.utils import LoggingTrackingHandler
LOGGER = logging.getLogger('peewee')
class PeeweeDebugPanel(DebugPanel):
name = 'Peewee queries'
template = jinja2.Template("""
<table c... | Add debugpanel for Muffin Debugtoolbar
| |
3bb0563daed1660bbede02737b1d3a38e306e9bc | build/transform-sql.py | build/transform-sql.py | #!/usr/bin/env python
#
# transform-sql.py -- create a header file with the appropriate SQL variables
# from an SQL file
#
import os
import re
import sys
def usage_and_exit(msg):
if msg:
sys.stderr.write("%s\n\n" % msg)
sys.stderr.write("usage: %s [sqlite_file]\n" % \
os.path.basename(sys.argv[0]))
sy... | Add a helper script which will transform a file full of SQL commands into a header file suitable for inclusion in a standard C file and use with the Subversion SQLite APIs. The goal here is that we can maintain our SQL schema directly as such, and let this script do the appropriate transformation as part of autogen.sh. | Add a helper script which will transform a file full of SQL commands into a
header file suitable for inclusion in a standard C file and use with the
Subversion SQLite APIs. The goal here is that we can maintain our SQL schema
directly as such, and let this script do the appropriate transformation as
part of autogen.sh... | Python | apache-2.0 | jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion | #!/usr/bin/env python
#
# transform-sql.py -- create a header file with the appropriate SQL variables
# from an SQL file
#
import os
import re
import sys
def usage_and_exit(msg):
if msg:
sys.stderr.write("%s\n\n" % msg)
sys.stderr.write("usage: %s [sqlite_file]\n" % \
os.path.basename(sys.argv[0]))
sy... | Add a helper script which will transform a file full of SQL commands into a
header file suitable for inclusion in a standard C file and use with the
Subversion SQLite APIs. The goal here is that we can maintain our SQL schema
directly as such, and let this script do the appropriate transformation as
part of autogen.sh... | |
8e124cf84b400a910e8dfc0c0b2b3fda3b846bd5 | sara_flexbe_states/src/sara_flexbe_states/Wonderland_Objects_In_A_Room.py | sara_flexbe_states/src/sara_flexbe_states/Wonderland_Objects_In_A_Room.py | #!/usr/bin/env python
# encoding=utf8
from flexbe_core import EventState, Logger
import json
class Wonderland_Objects_In_A_Room(EventState):
'''
Return all objects in a room
># json_text string json to read
#> names int[] array containing all names of objects in the room
#> ids ... | Add a state listing all entities in a room | Add a state listing all entities in a room
| Python | bsd-3-clause | WalkingMachine/sara_behaviors,WalkingMachine/sara_behaviors | #!/usr/bin/env python
# encoding=utf8
from flexbe_core import EventState, Logger
import json
class Wonderland_Objects_In_A_Room(EventState):
'''
Return all objects in a room
># json_text string json to read
#> names int[] array containing all names of objects in the room
#> ids ... | Add a state listing all entities in a room
| |
b7a9e79a80d1be827c803308c0abd651920c0b83 | setup.py | setup.py | import os.path
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
README_FILE = os.path.join(ROOT_DIR, "README.rst")
with open(README_FILE) as f:
long_description = f.read()
setup(
name="xutils",
version="1... | import os.path
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
README_FILE = os.path.join(ROOT_DIR, "README.rst")
with open(README_FILE) as f:
long_description = f.read()
setup(
name="xutils",
version="1... | Set the version to 1.2.0 | Set the version to 1.2.0
| Python | mit | xgfone/xutils,xgfone/pycom | import os.path
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
README_FILE = os.path.join(ROOT_DIR, "README.rst")
with open(README_FILE) as f:
long_description = f.read()
setup(
name="xutils",
version="1... | Set the version to 1.2.0
import os.path
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
README_FILE = os.path.join(ROOT_DIR, "README.rst")
with open(README_FILE) as f:
long_description = f.read()
setup(
nam... |
614cdfc97698204c07e172d09ad99ce45e8c3210 | genealogio/migrations/0004_auto_20150220_1242.py | genealogio/migrations/0004_auto_20150220_1242.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('genealogio', '0003_auto_20150220_0733'),
]
operations = [
migrations.AlterModelOptions(
name='family',
... | Add ordering by family name to Family model. | Add ordering by family name to Family model.
| Python | bsd-3-clause | ugoertz/django-familio,ugoertz/django-familio,ugoertz/django-familio,ugoertz/django-familio | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('genealogio', '0003_auto_20150220_0733'),
]
operations = [
migrations.AlterModelOptions(
name='family',
... | Add ordering by family name to Family model.
| |
931fca0b7cca4a631388eeb6114145c8d4ff6e18 | lims/celery.py | lims/celery.py | import os
from celery import Celery
from celery.schedules import crontab
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'lims.settings')
app = Celery('lims', broker='redis://localhost', backend='redis')
app.config_from_object('django.conf:settings', namespace='CELERY')
app.autodiscover_tasks()
app.conf.beat_schedul... | import os
from celery import Celery
from celery.schedules import crontab
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'lims.settings')
app = Celery('lims', broker=os.environ.get('REDIS_URL', 'redis://127.0.0.1:6379'), backend='redis')
app.config_from_object('django.conf:settings', namespace='CELERY')
app.autodisco... | Extend time period at which deadline processing happens | Extend time period at which deadline processing happens
| Python | mit | GETLIMS/LIMS-Backend,GETLIMS/LIMS-Backend | import os
from celery import Celery
from celery.schedules import crontab
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'lims.settings')
app = Celery('lims', broker=os.environ.get('REDIS_URL', 'redis://127.0.0.1:6379'), backend='redis')
app.config_from_object('django.conf:settings', namespace='CELERY')
app.autodisco... | Extend time period at which deadline processing happens
import os
from celery import Celery
from celery.schedules import crontab
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'lims.settings')
app = Celery('lims', broker='redis://localhost', backend='redis')
app.config_from_object('django.conf:settings', namespace=... |
c2726978a1272b13af2ffdfb10b4238985768317 | tests/test_db.py | tests/test_db.py | import pytest
from handy.db import do_sql, fetch_all, fetch_row, fetch_col, fetch_val
def pytestmark(func):
pytest.mark.django_db(func)
pytest.mark.usefixtures('test_table')(func)
@pytest.fixture(scope='module')
def test_table():
do_sql('''
begin;
create table test (
id int ... | import pytest
from handy.db import do_sql, fetch_all, fetch_row, fetch_col, fetch_val
def pytestmark(func):
pytest.mark.django_db(func)
pytest.mark.usefixtures('test_table')(func)
@pytest.fixture(scope='module')
def test_table():
# NOTE: We wrap that into transaction because in other case django will g... | Add NOTE regarding transaction to db tests setup | Add NOTE regarding transaction to db tests setup
| Python | bsd-3-clause | leliel12/handy,leliel12/handy | import pytest
from handy.db import do_sql, fetch_all, fetch_row, fetch_col, fetch_val
def pytestmark(func):
pytest.mark.django_db(func)
pytest.mark.usefixtures('test_table')(func)
@pytest.fixture(scope='module')
def test_table():
# NOTE: We wrap that into transaction because in other case django will g... | Add NOTE regarding transaction to db tests setup
import pytest
from handy.db import do_sql, fetch_all, fetch_row, fetch_col, fetch_val
def pytestmark(func):
pytest.mark.django_db(func)
pytest.mark.usefixtures('test_table')(func)
@pytest.fixture(scope='module')
def test_table():
do_sql('''
begi... |
44f232e179a2fe152ef6a7aa9e6e5cd52a4f201e | plasmapy/physics/__init__.py | plasmapy/physics/__init__.py | from .parameters import (Alfven_speed,
ion_sound_speed,
electron_thermal_speed,
ion_thermal_speed,
electron_gyrofrequency,
ion_gyrofrequency,
electron_gyroradius,
... | # 'physics' is a tentative name for this subpackage. Another
# possibility is 'plasma'. The organization is to be decided by v0.1.
from .parameters import (Alfven_speed,
ion_sound_speed,
electron_thermal_speed,
ion_thermal_speed,
... | Comment that physics is a tentative subpackage name | Comment that physics is a tentative subpackage name
| Python | bsd-3-clause | StanczakDominik/PlasmaPy | # 'physics' is a tentative name for this subpackage. Another
# possibility is 'plasma'. The organization is to be decided by v0.1.
from .parameters import (Alfven_speed,
ion_sound_speed,
electron_thermal_speed,
ion_thermal_speed,
... | Comment that physics is a tentative subpackage name
from .parameters import (Alfven_speed,
ion_sound_speed,
electron_thermal_speed,
ion_thermal_speed,
electron_gyrofrequency,
ion_gyrofrequency,
... |
dd6621267957bf621629f6ccb1930f089c7fd3eb | Lib/plat-riscos/riscosenviron.py | Lib/plat-riscos/riscosenviron.py | """A more or less complete user-defined wrapper around dictionary objects."""
import riscos
class _Environ:
def __init__(self, initial = None):
pass
def __repr__(self):
return repr(riscos.getenvdict())
def __cmp__(self, dict):
if isinstance(dict, UserDict):
return cmp(r... | """A more or less complete user-defined wrapper around dictionary objects."""
import riscos
class _Environ:
def __init__(self, initial = None):
pass
def __repr__(self):
return repr(riscos.getenvdict())
def __cmp__(self, dict):
if isinstance(dict, UserDict):
return cmp(r... | Replace setenv with putenv. Reported by Dietmar Schwertberger. | Replace setenv with putenv. Reported by Dietmar Schwertberger.
| Python | mit | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | """A more or less complete user-defined wrapper around dictionary objects."""
import riscos
class _Environ:
def __init__(self, initial = None):
pass
def __repr__(self):
return repr(riscos.getenvdict())
def __cmp__(self, dict):
if isinstance(dict, UserDict):
return cmp(r... | Replace setenv with putenv. Reported by Dietmar Schwertberger.
"""A more or less complete user-defined wrapper around dictionary objects."""
import riscos
class _Environ:
def __init__(self, initial = None):
pass
def __repr__(self):
return repr(riscos.getenvdict())
def __cmp__(self, dict):... |
abce8024f998dd62a3f0bfac57391c3aebe647fa | setup.py | setup.py | #!/usr/bin/env python3
from setuptools import setup
from ipyrmd import __version__
setup(name="ipyrmd",
version=__version__,
description="Convert between IPython/Jupyter notebooks and RMarkdown",
author="Gordon Ball",
author_email="gordon@chronitis.net",
url="https://github.com/chronitis... | #!/usr/bin/env python3
from setuptools import setup
from ipyrmd import __version__
with open("README.md") as f:
long_desc = f.read()
setup(name="ipyrmd",
version=__version__,
description="Convert between IPython/Jupyter notebooks and RMarkdown",
long_description=long_desc,
author="Gordon ... | Use contents of README as long_description | Use contents of README as long_description
| Python | mit | chronitis/ipyrmd | #!/usr/bin/env python3
from setuptools import setup
from ipyrmd import __version__
with open("README.md") as f:
long_desc = f.read()
setup(name="ipyrmd",
version=__version__,
description="Convert between IPython/Jupyter notebooks and RMarkdown",
long_description=long_desc,
author="Gordon ... | Use contents of README as long_description
#!/usr/bin/env python3
from setuptools import setup
from ipyrmd import __version__
setup(name="ipyrmd",
version=__version__,
description="Convert between IPython/Jupyter notebooks and RMarkdown",
author="Gordon Ball",
author_email="gordon@chronitis.n... |
b8666e3a2e2c4ee17bfbfa8d17e4625b84c79040 | app/PRESUBMIT.py | app/PRESUBMIT.py | #!/usr/bin/python
# Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Makes sure that the app/ code is cpplint clean."""
INCLUDE_CPP_FILES_ONLY = (
r'.*\.cc$', r'.*\.h$'
)
EXCLUDE = (
# Autogener... | #!/usr/bin/python
# Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Makes sure that the app/ code is cpplint clean."""
INCLUDE_CPP_FILES_ONLY = (
r'.*\.cc$', r'.*\.h$'
)
EXCLUDE = (
# Autogener... | Make all changes to app/ run on all trybot platforms, not just the big three. Anyone who's changing a header here may break the chromeos build. | Make all changes to app/ run on all trybot platforms, not just the big three.
Anyone who's changing a header here may break the chromeos build.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/2838027
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@51000 0039d316-1c4b-4281-b951-d872f2087c98
| Python | bsd-3-clause | gavinp/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,ropik/chromium,adobe/chromium,ropik/chromium,adobe/chromium,adobe/chromium,ropik/chromium,adobe/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,yitian134/chrom... | #!/usr/bin/python
# Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Makes sure that the app/ code is cpplint clean."""
INCLUDE_CPP_FILES_ONLY = (
r'.*\.cc$', r'.*\.h$'
)
EXCLUDE = (
# Autogener... | Make all changes to app/ run on all trybot platforms, not just the big three.
Anyone who's changing a header here may break the chromeos build.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/2838027
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@51000 0039d316-1c4b-4281-b951-d872f2087c98
#!/usr... |
e6026134e02f516cc84e499494205efa0ad7441f | tests/test_autoconfig.py | tests/test_autoconfig.py | # coding: utf-8
import os
import pytest
from mock import patch
from decouple import AutoConfig
def test_autoconfig_env():
config = AutoConfig()
path = os.path.join(os.getcwd(), 'autoconfig', 'env', 'project')
with patch.object(config, '_caller_path', return_value=path):
assert 'ENV' == config('KEY... | # coding: utf-8
import os
import pytest
from mock import patch
from decouple import AutoConfig
def test_autoconfig_env():
config = AutoConfig()
path = os.path.join(os.path.dirname(__file__), 'autoconfig', 'env', 'project')
with patch.object(config, '_caller_path', return_value=path):
assert 'ENV' ... | Replace cwd with current module's path | Replace cwd with current module's path | Python | mit | mrkschan/python-decouple,flaviohenriqu/python-decouple,henriquebastos/django-decouple,liukaijv/python-decouple,henriquebastos/python-decouple | # coding: utf-8
import os
import pytest
from mock import patch
from decouple import AutoConfig
def test_autoconfig_env():
config = AutoConfig()
path = os.path.join(os.path.dirname(__file__), 'autoconfig', 'env', 'project')
with patch.object(config, '_caller_path', return_value=path):
assert 'ENV' ... | Replace cwd with current module's path
# coding: utf-8
import os
import pytest
from mock import patch
from decouple import AutoConfig
def test_autoconfig_env():
config = AutoConfig()
path = os.path.join(os.getcwd(), 'autoconfig', 'env', 'project')
with patch.object(config, '_caller_path', return_value=pat... |
5e1c8f5bbe3cd8927b60a08b2784f7d2ea8263f2 | src/backend/live_classify_local_camera.py | src/backend/live_classify_local_camera.py | import openface
import numpy as np
import os
import cv2
import pickle
id_name = ["Alec", "Greg", "Phong", "Emil"]
def classify(aligned_face, net, clf, le):
rep = net.forward(aligned_face)
predictions = clf.predict_proba(rep.reshape((1, len(rep)))).ravel()
maxI = np.argmax(predictions)
person = le.inv... | Use the model to classify face in local camera. | Use the model to classify face in local camera.
| Python | apache-2.0 | xphongvn/smart-attendance-system-ta,xphongvn/smart-attendance-system-ta,xphongvn/smart-attendance-system-ta | import openface
import numpy as np
import os
import cv2
import pickle
id_name = ["Alec", "Greg", "Phong", "Emil"]
def classify(aligned_face, net, clf, le):
rep = net.forward(aligned_face)
predictions = clf.predict_proba(rep.reshape((1, len(rep)))).ravel()
maxI = np.argmax(predictions)
person = le.inv... | Use the model to classify face in local camera.
| |
dcc5c7be6f8463f41e1d1697bdba7fd576382259 | master/rc_force.py | master/rc_force.py | # Add a manual scheduler for building release candidates
rc_scheduler = ForceScheduler(
name="rc build",
builderNames=["package_osx10.9-x64", "package_win6.2-x64", "package_win6.2-x86", "package_tarball64", "package_tarball32", "package_tarballarm"],
reason=FixedParameter(name="reason", default=""),
bra... | # Add a manual scheduler for building release candidates
rc_scheduler = ForceScheduler(
name="rc build",
builderNames=["package_osx10.9-x64", "package_win6.2-x64", "package_win6.2-x86", "package_tarball64", "package_tarball32", "package_tarballarm", "package_tarballppc64le"],
reason=FixedParameter(name="rea... | Add ppc64le tarball rc force builder | Add ppc64le tarball rc force builder
| Python | mit | staticfloat/julia-buildbot,staticfloat/julia-buildbot | # Add a manual scheduler for building release candidates
rc_scheduler = ForceScheduler(
name="rc build",
builderNames=["package_osx10.9-x64", "package_win6.2-x64", "package_win6.2-x86", "package_tarball64", "package_tarball32", "package_tarballarm", "package_tarballppc64le"],
reason=FixedParameter(name="rea... | Add ppc64le tarball rc force builder
# Add a manual scheduler for building release candidates
rc_scheduler = ForceScheduler(
name="rc build",
builderNames=["package_osx10.9-x64", "package_win6.2-x64", "package_win6.2-x86", "package_tarball64", "package_tarball32", "package_tarballarm"],
reason=FixedParamet... |
4df17e8a4d4ce48fac9c66876dc4aeb981044655 | runtests.py | runtests.py | #!/usr/bin/env python
import sys
from os.path import dirname, abspath
from django.conf import settings
if not settings.configured:
settings.configure(
DATABASE_ENGINE='django.db.backends.postgresql_psycopg2',
DATABASE_NAME='bitfield_test',
INSTALLED_APPS=[
'django.contrib.conte... | #!/usr/bin/env python
import sys
from os.path import dirname, abspath
from django.conf import settings
if not settings.configured:
settings.configure(
DATABASE_ENGINE='django.db.backends.postgresql_psycopg2',
DATABASE_NAME='bitfield_test',
INSTALLED_APPS=[
'django.contrib.conte... | Test suite requires me to spell contenttypes correctly | Test suite requires me to spell contenttypes correctly
| Python | apache-2.0 | budlight/django-bitfield,mattcaldwell/django-bitfield,joshowen/django-bitfield,disqus/django-bitfield,moggers87/django-bitfield,Elec/django-bitfield | #!/usr/bin/env python
import sys
from os.path import dirname, abspath
from django.conf import settings
if not settings.configured:
settings.configure(
DATABASE_ENGINE='django.db.backends.postgresql_psycopg2',
DATABASE_NAME='bitfield_test',
INSTALLED_APPS=[
'django.contrib.conte... | Test suite requires me to spell contenttypes correctly
#!/usr/bin/env python
import sys
from os.path import dirname, abspath
from django.conf import settings
if not settings.configured:
settings.configure(
DATABASE_ENGINE='django.db.backends.postgresql_psycopg2',
DATABASE_NAME='bitfield_test',
... |
62545500553443863d61d9e5ecc80307c745a227 | migrate/20110917T143029-remove-value-dimensions.py | migrate/20110917T143029-remove-value-dimensions.py | import logging
from openspending.lib import cubes
from openspending import migration, model, mongo
log = logging.getLogger(__name__)
def up():
group_args = ({'dataset':1}, {}, {'num': 0},
'function (x, acc) { acc.num += 1 }')
before = mongo.db.dimension.group(*group_args)
dims = model.... | Add migration to remove non-{entity,classifier} dimensions from the database, and to recompute cubes if necessary | Add migration to remove non-{entity,classifier} dimensions from the database, and to recompute cubes if necessary
| Python | agpl-3.0 | CivicVision/datahub,openspending/spendb,johnjohndoe/spendb,USStateDept/FPA_Core,spendb/spendb,johnjohndoe/spendb,openspending/spendb,nathanhilbert/FPA_Core,pudo/spendb,openspending/spendb,nathanhilbert/FPA_Core,spendb/spendb,CivicVision/datahub,pudo/spendb,USStateDept/FPA_Core,pudo/spendb,nathanhilbert/FPA_Core,USState... | import logging
from openspending.lib import cubes
from openspending import migration, model, mongo
log = logging.getLogger(__name__)
def up():
group_args = ({'dataset':1}, {}, {'num': 0},
'function (x, acc) { acc.num += 1 }')
before = mongo.db.dimension.group(*group_args)
dims = model.... | Add migration to remove non-{entity,classifier} dimensions from the database, and to recompute cubes if necessary
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.