commit stringlengths 40 40 | subject stringlengths 1 1.49k | old_file stringlengths 4 311 | new_file stringlengths 4 311 | new_contents stringlengths 1 29.8k | old_contents stringlengths 0 9.9k | lang stringclasses 3
values | proba float64 0 1 |
|---|---|---|---|---|---|---|---|
c4a77bf510bf23e25f259aaae8c1effa65e45a85 | fix bug when trying to get a slice (of pizza) | python/ccxtpro/base/cache.py | python/ccxtpro/base/cache.py | import collections
class Delegate:
def __init__(self, name):
self.name = name
def __get__(self, instance, owner):
return getattr(instance, self.name)
class ArrayCache(list):
# implicitly called magic methods don't invoke __getattribute__
# https://docs.python.org/3/reference/datamod... | import collections
class Delegate:
def __init__(self, name):
self.name = name
def __get__(self, instance, owner):
return getattr(instance, self.name)
class ArrayCache(list):
# implicitly called magic methods don't invoke __getattribute__
# https://docs.python.org/3/reference/datamod... | Python | 0.000002 |
49396a7964de09c60459ec1ed3e91890e212100c | fix travis | python/mxnet/lr_scheduler.py | python/mxnet/lr_scheduler.py | """
learning rate scheduler, which adaptive changes the learning rate based on the
progress
"""
import logging
class LRScheduler(object):
"""Base class of a learning rate scheduler"""
def __init__(self):
"""
base_lr : float
the initial learning rate
"""
self.base_lr ... | """
learning rate scheduler, which adaptive changes the learning rate based on the
progress
"""
import logging
class LRScheduler(object):
"""Base class of a learning rate scheduler"""
def __init__(self):
"""
base_lr : float
the initial learning rate
"""
self.base_lr ... | Python | 0.000002 |
6f42122bc4b8ae8a287f0350eba4d8cd2f5f9649 | correct the ConfigSessionError exception name. | python/vyos/configsession.py | python/vyos/configsession.py | # configsession -- the write API for the VyOS running config
# Copyright (C) 2019 VyOS maintainers and contributors
#
# This library is free software; you can redistribute it and/or modify it under the terms of
# the GNU Lesser General Public License as published by the Free Software Foundation;
# either version 2.1 of... | # configsession -- the write API for the VyOS running config
# Copyright (C) 2019 VyOS maintainers and contributors
#
# This library is free software; you can redistribute it and/or modify it under the terms of
# the GNU Lesser General Public License as published by the Free Software Foundation;
# either version 2.1 of... | Python | 0 |
07fa886690539d097b212375598d7ca3239664ba | Make option group items appear the same in the cart as text options for consistency | shop_simplevariations/cart_modifier.py | shop_simplevariations/cart_modifier.py | #-*- coding: utf-8 -*-
from shop.cart.cart_modifiers_base import BaseCartModifier
from shop_simplevariations.models import CartItemOption, CartItemTextOption
class ProductOptionsModifier(BaseCartModifier):
'''
This modifier adds an extra field to the cart to let the lineitem "know"
about product options an... | #-*- coding: utf-8 -*-
from shop.cart.cart_modifiers_base import BaseCartModifier
from shop_simplevariations.models import CartItemOption, CartItemTextOption
class ProductOptionsModifier(BaseCartModifier):
'''
This modifier adds an extra field to the cart to let the lineitem "know"
about product options an... | Python | 0.000015 |
8ebba5de25de289046bdca46f1613a337f1aacbf | Improve CommentForm tests | amy/extcomments/tests.py | amy/extcomments/tests.py | from django.test import TestCase
from django.urls import reverse
import django_comments
from workshops.models import Organization, Person
class TestEmailFieldRequiredness(TestCase):
def test_email_field_requiredness(self):
"""Regression test for #1944.
Previously a user without email address wou... | from django.test import TestCase
import django_comments
from workshops.models import Organization, Person
class TestEmailFieldRequiredness(TestCase):
def test_email_field_requiredness(self):
"""Regression test for #1944.
Previously a user without email address would not be able to add a comment.... | Python | 0 |
afbc63d29a23170d17ce18e0c39a403de974aede | Use of websockets for the episodes listing | app/handlers/__init__.py | app/handlers/__init__.py | __author__ = 'roland'
from handlers.mainhandler import MainHandler
from handlers.showhandler import ShowHandler | __author__ = 'roland'
| Python | 0 |
36f2c75f177b076ce54cb1d056b715edb15377f8 | Bump app version number. | app/handlers/__init__.py | app/handlers/__init__.py | __version__ = "2015.7.4"
__versionfull__ = __version__
| __version__ = "2015.7.3"
__versionfull__ = __version__
| Python | 0 |
dd791f210379907b909c1a52492a380d17c88058 | add arguments | compressandmove.py | compressandmove.py | #!/usr/bin/env python
# file.py Code
#
# Copyright (c) Jose M. Molero
#
# All rights reserved.
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, includin... | #!/usr/bin/env python
# file.py Code
#
# Copyright (c) Jose M. Molero
#
# All rights reserved.
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, includin... | Python | 0.000006 |
e17efc67e20e1db1f11c00853dd26da250e3655e | add access rule for event_moodle | addons/event_moodle/__openerp__.py | addons/event_moodle/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | Python | 0.000001 |
cf3e84add9cb87f0baf742e4cf1304356c57de9e | add test for RandomSlugField.db_type | randomslug/tests/__init__.py | randomslug/tests/__init__.py | """
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
from django.db import models
import re
from randomslug.models import *
from randomslug.validators impo... | """
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
from django.db import models
import re
from randomslug.models import *
from randomslug.validators impo... | Python | 0 |
c30f2ba581e0fea43124e8804f45ab8fa9dca94a | Use sfh_marginal in androcmd/phatpatchfit/majoraxplot.py | androcmd/phatpatchfit/majoraxplot.py | androcmd/phatpatchfit/majoraxplot.py | # encoding: utf-8
"""
Tools for plotting SFR along the major axis.
2015-07-01 - Created by Jonathan Sick
"""
import matplotlib as mpl
import numpy as np
from .sfrplots import scale_sfr, lin_scale_sfr
def select_patches(dataset):
"""Patch keys that lie along the major axis."""
keys = []
phi = []
for... | # encoding: utf-8
"""
Tools for plotting SFR along the major axis.
2015-07-01 - Created by Jonathan Sick
"""
import matplotlib as mpl
import numpy as np
from .analysistools import marginalize_metallicity
from .sfrplots import scale_sfr, lin_scale_sfr
def select_patches(dataset):
"""Patch keys that lie along th... | Python | 0.000001 |
ea8ea2e6203ee6cb7580444207446c0bb82f7239 | Add solution for Lesson_5_Analyzing_Data.10-Using_match_and_project. | Lesson_5_Analyzing_Data/10-Using_match_and_project/followers.py | Lesson_5_Analyzing_Data/10-Using_match_and_project/followers.py | #!/usr/bin/env python
"""
Write an aggregation query to answer this question:
Of the users in the "Brasilia" timezone who have tweeted 100 times or more,
who has the largest number of followers?
The following hints will help you solve this problem:
- Time zone is found in the "time_zone" field of the user object in e... | #!/usr/bin/env python
"""
Write an aggregation query to answer this question:
Of the users in the "Brasilia" timezone who have tweeted 100 times or more,
who has the largest number of followers?
The following hints will help you solve this problem:
- Time zone is found in the "time_zone" field of the user object in e... | Python | 0 |
93cc7c44efdd01c0e6d5a218301da7686b4f7289 | implement postmaster redirection | app/server.py | app/server.py | import requests
from salmon.routing import nolocking, route, stateless, route_like
from salmon.mail import MailResponse
from config import settings
import json
import logging
log = logging.getLogger(__name__)
log.level = logging.DEBUG
def forward_postmaster(message, domain):
log.info("===========================... | import requests
from salmon.routing import nolocking, route, stateless
from salmon.mail include MailResponse
from config import settings
import json
import logging
log = logging.getLogger(__name__)
log.level = logging.DEBUG
@route("postmaster@(domain)", inbox=".+", domain=".+")
@stateless
def forward_postmaster(mess... | Python | 0.000002 |
da51d49904ff75621ff9ebb501e4612cfa0a3d86 | Trim more | juriscraper/pacer/case_query.py | juriscraper/pacer/case_query.py | import pprint
import sys
from .docket_report import BaseDocketReport
from .reports import BaseReport
# from .utils import clean_pacer_object
from ..lib.log_tools import make_default_logger
from ..lib.string_utils import clean_string, harmonize, \
force_unicode
logger = make_default_logger()
class CaseQuery(Base... | import pprint
import re
import sys
from .docket_report import BaseDocketReport
from .reports import BaseReport
# from .utils import clean_pacer_object
from ..lib.log_tools import make_default_logger
from ..lib.string_utils import clean_string, harmonize, \
force_unicode
logger = make_default_logger()
class Case... | Python | 0 |
cc12728d7160a10f0c182c0cccfde0fd15cadb75 | Add a reset function stub | spicedham/basewrapper.py | spicedham/basewrapper.py |
class BaseWrapper(object):
"""
A base class for backend plugins.
"""
def reset(self, really):
"""
Resets the training data to a blank slate.
"""
if really:
raise NotImplementedError()
def get_key(self, tag, key, default=None):
"""
Gets ... |
class BaseWrapper(object):
"""
A base class for backend plugins.
"""
def get_key(self, tag, key, default=None):
"""
Gets the value held by the tag, key composite key. If it doesn't exist,
return default.
"""
raise NotImplementedError()
def get_key_list(sel... | Python | 0 |
f6722960a33a51d0682c4c21a6e46d03f53b80f0 | simplify max_score calc more | app/models/golf_round.py | app/models/golf_round.py | from app import db
class GolfRound(db.Model):
id = db.Column(db.Integer, primary_key=True)
user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
tee_id = db.Column(db.Integer, db.ForeignKey('tee.id'))
date = db.Column(db.DateTime)
notes = db.Column(db.String(128))
total_score = db.Column... | from app import db
class GolfRound(db.Model):
id = db.Column(db.Integer, primary_key=True)
user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
tee_id = db.Column(db.Integer, db.ForeignKey('tee.id'))
date = db.Column(db.DateTime)
notes = db.Column(db.String(128))
total_score = db.Column... | Python | 0.000018 |
425b1ac925ecc2aeae8dff358b1054c9824fa4f0 | Reorganize code in analyzer.py | analyzer.py | analyzer.py | # push-analyzer, A script for analyzing git pushes
# Copyright (c) 2014 firecoders
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the righ... | # push-analyzer, A script for analyzing git pushes
# Copyright (c) 2014 firecoders
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the righ... | Python | 0.000001 |
0205db84f05c0914abe4b6e14d824de2777f60cd | Monitor unreleased version count. | allmychanges/management/commands/send_stats.py | allmychanges/management/commands/send_stats.py | import os
import datetime
from pprint import pprint
from django.core.management.base import BaseCommand
from twiggy_goodies.django import LogMixin
from django.conf import settings
from allmychanges.utils import graphite_send
from allmychanges.models import Package, Changelog, Version, User
from django.utils import tim... | import os
import datetime
from pprint import pprint
from django.core.management.base import BaseCommand
from twiggy_goodies.django import LogMixin
from django.conf import settings
from allmychanges.utils import graphite_send
from allmychanges.models import Package, Changelog, Version, User
from django.utils import tim... | Python | 0 |
c2f2a294b3b513e83a2ea5bca09a13c255c51c88 | fix case when job has not lastBuild property | analyzer.py | analyzer.py | #!/usr/bin/python
import pprint
import re
import argparse
from datetime import datetime
from statsd import StatsClient
from utils import failureReasons, JenkinsClient
def is_build_failed(job):
if 'lastBuild' in job and job['lastBuild'] is not None and 'result' in job['lastBuild']:
if job['lastBuild']... | #!/usr/bin/python
import pprint
import re
import argparse
from datetime import datetime
from statsd import StatsClient
from utils import failureReasons, JenkinsClient
def is_build_failed(job):
if job['lastBuild']:
if job['lastBuild']['result'] == 'FAILURE':
return True
return Fals... | Python | 0.000008 |
88cc2242ccd91d7574dab0f687c3a0c755a9a4aa | convert stock prices from strings to floats before saving/returning | analyzer.py | analyzer.py | import json, urllib2
from neuralNetwork import NN
def getHistoricalData(stockSymbol):
historicalPrices = []
# login to API
urllib2.urlopen("http://api.kibot.com/?action=login&user=guest&password=guest")
# get 10 days of data from API (business days only, could be < 10)
url = "http://api.kibo... | import json, urllib2
from neuralNetwork import NN
def getHistoricalData(stockSymbol):
historicalPrices = []
# login to API
urllib2.urlopen("http://api.kibot.com/?action=login&user=guest&password=guest")
# get 10 days of data from API (business days only, could be < 10)
url = "http://api.kibo... | Python | 0.002193 |
ccdc17645440cf191f9cca27f32b2211fad4ccd0 | Load coordinates info into the main table | luigi/tasks/release/load_coordinates.py | luigi/tasks/release/load_coordinates.py | # -*- coding: utf-8 -*-
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by... | # -*- coding: utf-8 -*-
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by... | Python | 0 |
5722cac8dcacafa0a4b8d9f23f7f0a38a0632283 | Add support to specify an identity file for ssh connections | proxmoxer/backends/openssh.py | proxmoxer/backends/openssh.py | __author__ = 'Oleg Butovich'
__copyright__ = '(c) Oleg Butovich 2013-2015'
__licence__ = 'MIT'
from proxmoxer.backends.base_ssh import ProxmoxBaseSSHSession, BaseBackend
try:
import openssh_wrapper
except ImportError:
import sys
sys.stderr.write("Chosen backend requires 'openssh_wrapper' module\n")
s... | __author__ = 'Oleg Butovich'
__copyright__ = '(c) Oleg Butovich 2013-2015'
__licence__ = 'MIT'
from proxmoxer.backends.base_ssh import ProxmoxBaseSSHSession, BaseBackend
try:
import openssh_wrapper
except ImportError:
import sys
sys.stderr.write("Chosen backend requires 'openssh_wrapper' module\n")
s... | Python | 0 |
ae2f12bf1dcd7ec1b1d7b5843b56fdc8df32a50e | gunicorn debug=False | config-gunicorn.py | config-gunicorn.py | #!/usr/bin/env python
import os
def numCPUs():
if not hasattr(os, 'sysconf'):
raise RuntimeError('No sysconf detected.')
return os.sysconf('SC_NPROCESSORS_ONLN')
bind = '127.0.0.1:8000'
workers = 4
worker_class = 'gevent'
debug = False
daemon = True
pidfile = '/tmp/gunicorn.pid'
logfile = '/tmp/guni... | #!/usr/bin/env python
import os
def numCPUs():
if not hasattr(os, 'sysconf'):
raise RuntimeError('No sysconf detected.')
return os.sysconf('SC_NPROCESSORS_ONLN')
bind = '127.0.0.1:8000'
workers = 4
worker_class = 'gevent'
debug = True
daemon = True
pidfile = '/tmp/gunicorn.pid'
logfile = '/tmp/gunic... | Python | 0.999639 |
d717cc604d26f3470af3c2f686d04ce7eb1ef1f3 | Generate proper contents for displaying a user profile page. | web_apps/game_support/src/local/view.py | web_apps/game_support/src/local/view.py | #!/usr/bin/env python
# ---------------------------------------------------------------------------------------------
"""
local/view.py
Copyright (c) 2015 Kevin Cureton
"""
# ---------------------------------------------------------------------------------------------
# -----------------------------------------------... | #!/usr/bin/env python
# ---------------------------------------------------------------------------------------------
"""
local/view.py
Copyright (c) 2015 Kevin Cureton
"""
# ---------------------------------------------------------------------------------------------
# -----------------------------------------------... | Python | 0.999062 |
ff6b9eddc27ee2b897ab20198d562ef1dfe257d5 | support get docker info | app/dash.py | app/dash.py | #!/usr/bin/env python3
# coding=utf-8
"""
@version:0.1
@author: ysicing
@file: blog/dash.py
@time: 2017/9/20 22:46
"""
from flask import Blueprint, render_template,jsonify
from app.plugins.docker import DockerApi
dash = Blueprint('dash', __name__)
docker = DockerApi(host=None, timeout=None)
@dash.route('/dash/')... | #!/usr/bin/env python3
# coding=utf-8
"""
@version:0.1
@author: ysicing
@file: blog/dash.py
@time: 2017/9/20 22:46
"""
from flask import Blueprint, render_template
dash = Blueprint('dash', __name__)
@dash.route('/dash/')
def dash_index():
return render_template('dash.html') | Python | 0 |
95945f98b3c4689dc1fb5066f5102154cc4a6a28 | bump version | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='vdist',
version='0.3.5',
description='Create OS packages from Python projects using Docker containers',
long_description='Create OS packages from Python projects using Docker containers',
author='L. Brouwer',
author_email='objectified@gma... | from setuptools import setup, find_packages
setup(
name='vdist',
version='0.3.4',
description='Create OS packages from Python projects using Docker containers',
long_description='Create OS packages from Python projects using Docker containers',
author='L. Brouwer',
author_email='objectified@gma... | Python | 0 |
2b28da0ee9c3a26e5d0bd7cebe56fece3585689a | Update file_opt_args | website/addons/osfstorage/decorators.py | website/addons/osfstorage/decorators.py | import httplib
import functools
from webargs import Arg
from webargs import core
from modularodm.exceptions import NoResultsFound
from modularodm.exceptions import ValidationValueError
from modularodm.storage.base import KeyExistsException
from framework.auth.decorators import must_be_signed
from website.models impo... | import httplib
import functools
from webargs import Arg
from webargs import core
from modularodm.exceptions import NoResultsFound
from modularodm.exceptions import ValidationValueError
from modularodm.storage.base import KeyExistsException
from framework.auth.decorators import must_be_signed
from website.models impo... | Python | 0.000022 |
7dcbb064e9bd87e30d322e695452ab140c30b5ed | Support for --version | src/contexts/__main__.py | src/contexts/__main__.py | import sys
from .plugin_discovery import load_plugins
from . import run_with_plugins, main
def cmd():
if '--version' in sys.argv:
print_version()
sys.exit(0)
try:
import colorama
except ImportError:
pass
else:
colorama.init()
plugin_list = load_plugins()
... | import sys
from .plugin_discovery import load_plugins
from . import run_with_plugins, main
def cmd():
try:
import colorama
except ImportError:
pass
else:
colorama.init()
plugin_list = load_plugins()
exit_code = run_with_plugins(plugin_list)
sys.exit(exit_code)
if __n... | Python | 0 |
cdaa708e185b252ddebb542e89a9c4d5e6740f2c | Include old (>24h) messages in news feed | feedline.py | feedline.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Rapidly display fresh headlines from a TinyTinyRSS instance on the command line.
(c) 2017 Andreas Fischer <_@ndreas.de>
"""
import subprocess
import argparse
import getpass
import json
import os.path
import readchar
from ttrss import TinyTinyRSS
def get_conn():
""... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Rapidly display fresh headlines from a TinyTinyRSS instance on the command line.
(c) 2017 Andreas Fischer <_@ndreas.de>
"""
import subprocess
import argparse
import getpass
import json
import os.path
import readchar
from ttrss import TinyTinyRSS
def get_conn():
""... | Python | 0 |
72438aceb58c7fe566a9a09ffccc0f8622a8df31 | Update file list to new Hector file layout | setup.py | setup.py | """
pyhector
--------
Python wrapper for the `Hector simple climate model
<https://github.com/JGCRI/hector>`_.
**Install** using ::
pip install pyhector
Find **usage** instructions in the `repository
<https://github.com/openclimatedata/pyhector>`_.
"""
from setuptools import setup, Extension
from setuptools.co... | """
pyhector
--------
Python wrapper for the `Hector simple climate model
<https://github.com/JGCRI/hector>`_.
**Install** using ::
pip install pyhector
Find **usage** instructions in the `repository
<https://github.com/openclimatedata/pyhector>`_.
"""
from setuptools import setup, Extension
from setuptools.co... | Python | 0 |
d0b6e2b9b3a936ea16a7c48fd951bb4f297c1190 | Update setup.py to point to correct site | setup.py | setup.py | try:
from setuptools import setup, find_packages
except:
from distutils.core import setup, find_packages
install_requires = ['py3compat >= 0.2']
setup(
name='daisychain',
version='0.1',
description='Configuration-based OO-dependency resolution workflow engine',
author='Jeff Edwards',
autho... | try:
from setuptools import setup, find_packages
except:
from distutils.core import setup, find_packages
install_requires = ['py3compat >= 0.2']
setup(
name='daisychain',
version='0.1',
description='Configuration-based OO-dependency resolution workflow engine',
author='Jeff Edwards',
autho... | Python | 0 |
30bf6ddb0dde4e6bc953924fd6b22a09d97805cf | Add Test runs for Python 3.7 and remove 3.4 (#5295) | nox.py | nox.py | # Copyright 2016 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | # Copyright 2016 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | Python | 0 |
a88a9ad6ed64c3bf4b5a9e40a41a68e9581654e7 | Fix nox config. (#4599) | nox.py | nox.py | # Copyright 2017, Google LLC All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | # Copyright 2017, Google LLC All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | Python | 0 |
82cc05e882698bdf2248ae0ae1589bb6455d0ca5 | update fetch | fetch/rb.py | fetch/rb.py | import robotparser
from utils import config
from splinter import Browser
def index(session):
url = config.rb_url()
_robot_can_fetch(session, url)
def fetch():
with Browser(**config.browser_kwargs()) as browser:
browser.visit(url)
styles = []
group_names = brows... | import robotparser
from utils import config
from splinter import Browser
def index(session):
url = config.rb_url()
_robot_can_fetch(session, url)
def fetch():
with Browser(**config.browser_kwargs()) as browser:
browser.visit(url)
styles = []
group_names = brows... | Python | 0.000001 |
5839d76a0e29a3fa6b07a460ff3f0d8cf9b889b7 | Remove alpha release | setup.py | setup.py | import os
from setuptools import setup, find_packages
src_dir = os.path.dirname(__file__)
install_requires = [
"troposphere~=1.8.0",
"awacs~=0.6.0",
"stacker~=0.8.1",
]
tests_require = [
"nose~=1.0",
"mock~=2.0.0",
]
def read(filename):
full_path = os.path.join(src_dir, filename)
with o... | import os
from setuptools import setup, find_packages
src_dir = os.path.dirname(__file__)
install_requires = [
"troposphere~=1.8.0",
"awacs~=0.6.0",
"stacker~=0.8.1",
]
tests_require = [
"nose~=1.0",
"mock~=2.0.0",
]
def read(filename):
full_path = os.path.join(src_dir, filename)
with o... | Python | 0 |
38791c7bb480ea5c9efdb4bab3a9c785e5078153 | bump to version 0.1alpha9 | setup.py | setup.py | from setuptools import setup, find_packages
import os, sys
static_types = [
'*.js',
'*.html',
'*.css',
'*.ico',
'*.gif',
'*.jpg',
'*.png',
'*.txt*',
'*.py',
'*.template'
]
#if sys.platform != "win32":
# _install_requires.append("Twisted")
_install_requires = [
'cs... | from setuptools import setup, find_packages
import os, sys
static_types = [
'*.js',
'*.html',
'*.css',
'*.ico',
'*.gif',
'*.jpg',
'*.png',
'*.txt*',
'*.py',
'*.template'
]
#if sys.platform != "win32":
# _install_requires.append("Twisted")
_install_requires = [
'cs... | Python | 0 |
7156cc172b3ba87e3247367c6bf51cc24ce9a902 | Update PyPI usage | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
setup.py
Created by Stephan Hügel on 2015-06-21
"""
from __future__ import unicode_literals
import os
import re
import io
from setuptools import setup, find_packages, Distribution
def read(*names, **kwargs):
with io.open(
os.path.join(os.path.dirname(__fil... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
setup.py
Created by Stephan Hügel on 2015-06-21
"""
from __future__ import unicode_literals
import os
import re
import io
from setuptools import setup, find_packages, Distribution
def read(*names, **kwargs):
with io.open(
os.path.join(os.path.dirname(__fil... | Python | 0 |
2f766e439b9d91ab4d4682245a2360bc1e5c2bb5 | Update version | setup.py | setup.py | import matplotlib
import os
MPLBE = os.environ.get('MPLBE')
if MPLBE:
matplotlib.use(MPLBE)
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
DESCRIPTION = "General Matplotlib Exporter"
LONG_DESCRIPTION = open('README.md').read()
NAME = "mplexporter"
AUTHOR = "Jake V... | import matplotlib
import os
MPLBE = os.environ.get('MPLBE')
if MPLBE:
matplotlib.use(MPLBE)
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
DESCRIPTION = "General Matplotlib Exporter"
LONG_DESCRIPTION = open('README.md').read()
NAME = "mplexporter"
AUTHOR = "Jake V... | Python | 0 |
6797300eeeb014debc5472927c5b5711597881ea | bump to 0.2.1 | setup.py | setup.py | """
Copyright 2012 DISQUS
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distrib... | """
Copyright 2012 DISQUS
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distrib... | Python | 0.000055 |
d611830525e93e1c1a364ed88695d62003490e07 | Bump version number | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name="trajprocess",
version='2.0.5',
packages=find_packages(),
requires=['numpy', 'mdtraj', 'nose'],
zip_safe=False,
include_package_data=True,
)
| from setuptools import setup, find_packages
setup(
name="trajprocess",
version='2.0.4',
packages=find_packages(),
requires=['numpy', 'mdtraj', 'nose'],
zip_safe=False,
include_package_data=True,
)
| Python | 0.000002 |
abfdbaee5f80c7c02436268016718a5362f9083d | make setup.py pypi conform | setup.py | setup.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
version = '0.1.5'
setup(
name='SerpScrap',
version=version,
description='''A python module to scrape and extract data like links, titles, descriptions, ratings,
from search engine result pages
and listed ur... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
version = '0.1.5'
setup(
name='SerpScrap',
version=version,
description='A python module to scrape and extract data like links, titles, descriptions, ratings, from search engine result pages.',
long_description=... | Python | 0.000001 |
5d36740917dbc08aca8202d4fb5915b4f17a9552 | Add log level specification to cax | cax/main.py | cax/main.py | import argparse
import logging
import os.path
import time
from cax.config import mongo_password, set_json, get_task_list, get_config
from cax.tasks import checksum, clear, data_mover, process
from cax import __version__
def main():
parser = argparse.ArgumentParser(
description="Copying All kinds of XENON1... | import argparse
import logging
import os.path
import time
from cax.config import mongo_password, set_json, get_task_list, get_config
from cax.tasks import checksum, clear, data_mover, process
from cax import __version__
def main():
parser = argparse.ArgumentParser(
description="Copying All kinds of XENON1... | Python | 0 |
8649b296e05c432dd3841d8c5dc8d9aebd6d09db | update global test script | cea/test.py | cea/test.py | """
Test all the main scripts in one go - drink coffee while you wait :)
"""
import properties
import demand
import emissions
import embodied
import graphs
properties.test_properties()
demand.test_demand()
emissions.test_lca_operation()
embodied.test_lca_embodied()
graphs.test_graph_demand()
print 'full test complete... | """
Test all the main scripts in one go - drink coffee while you wait :)
"""
import properties
import demand
import emissions
import embodied
import graphs
properties.test_properties()
demand.test_demand()
emissions.test_lca_operation()
embodied.test_lca_embodied()
graphs.test_graph_demand()
| Python | 0 |
747ed560ac6a3854feb0a2c23885b1aa0be61b5f | fix some style issues | app/main.py | app/main.py | from google.appengine.api import urlfetch
from google.appengine.ext import ndb
import csv
import re
import os
import webapp2
import jinja2
JINJA_ENVIRONMENT = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.path.join(os.path.dirname(__file__), 'templates')),
extensions=['jinja2.ext.autoescape'],
au... | from google.appengine.api import files
from google.appengine.api import urlfetch
from google.appengine.ext import ndb
from google.appengine.ext import blobstore
import csv
import re
import sys
import os
import webapp2
import jinja2
JINJA_ENVIRONMENT = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.path.jo... | Python | 0.000018 |
90c07db3c507e1394cf0a72e73f9c7cc425b20a4 | return False | one.py | one.py | def one(iterable):
"""Return the object in the given iterable that evaluates to True.
If the given iterable has more than one object that evaluates to True,
or if there is no object that fulfills such condition, return False.
>>> one((True, False, False))
True
>>> one((True, False, True))
... | def one(iterable):
"""
Return X if X is the only one value where bool(i) is True for
each every i in the iterable. In any other case return None.
>>> one((True, False, False))
True
>>> one((True, False, True))
False
>>> one((0, 0, 'a'))
'a'
>>> one((0, False, None))
False
... | Python | 0.999999 |
6726af1a15c3b64ea9cbb68e18a7983477713842 | Update 0.91 | src/cerberus_ac/admin.py | src/cerberus_ac/admin.py | # -*- coding: utf-8 -*-
"""Admin module."""
# from cerberus_ac.views import EditUserPermissions
# from .models import *
#
#
# class SecurityAdmin(AdminSite):
# pass
#
# class DataAdmin(AdminSite):
# pass
#
# class AuditAdmin(AdminSite):
# pass
#
# security_admin_site = SecurityAdmin(name='SecurityAdmin')... | # -*- coding: utf-8 -*-
"""Admin module."""
# from django.contrib import admin
# from django.contrib.admin.sites import AdminSite
#
# from cerberus_ac.views import EditUserPermissions
# from .models import *
#
#
# class SecurityAdmin(AdminSite):
# pass
#
# class DataAdmin(AdminSite):
# pass
#
# class AuditAdm... | Python | 0 |
b16c86b418e1c706bf25347d276d25876637d89b | add failing test for customized type deep in type hierarchy | spyne/test/interface/test_interface.py | spyne/test/interface/test_interface.py | #!/usr/bin/env python
#
# spyne - Copyright (C) Spyne contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later ve... | #!/usr/bin/env python
#
# spyne - Copyright (C) Spyne contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later ve... | Python | 0 |
baab52477f637364f0a1a974b4ee13114c667bca | allow multiple encodings in headers (i.e. "From: =?iso-8859-2?Q?...?= <email@address.com>") | cia-mail.py | cia-mail.py | #!/usr/local/bin/python
#
# Copyright (C) Merlijn van Deen <valhallasw@gmail.com>, 2009
#
# Distributed under the terms of the MIT license.
#
import sys, time
from email.Parser import Parser
from email.Header import Header, decode_header
from xml.sax.saxutils import escape
from xmlrpclib import ServerProxy
e = Parser... | #!/usr/local/bin/python
#
# Copyright (C) Merlijn van Deen <valhallasw@gmail.com>, 2009
#
# Distributed under the terms of the MIT license.
#
import sys, time
from email.Parser import Parser
from email.Header import Header, decode_header
from xml.sax.saxutils import escape
from xmlrpclib import ServerProxy
e = Parser... | Python | 0.000001 |
8453607c1fb1cb1835bc1323f4c59366015e93fe | Create a command-line vulgarizer | estimate.py | estimate.py | import sys
from fractions import Fraction
from math import log10
def vulgarize(rpt):
"""Calculate a vulgar fraction for a given continued fraction"""
f = Fraction(0)
if tuple(rpt) == (0,): return f # Avoid dividing by zero
for term in reversed(rpt):
f = 1 / (term + f)
return 1/f
def magnitude(x):
"""Give an i... | import sys
from fractions import Fraction
from math import log10
digits = sys.argv[1]
print("Estimating %s as a fraction..." % digits)
def vulgarize(rpt):
"""Calculate a vulgar fraction for a given continued fraction"""
f = Fraction(0)
if tuple(rpt) == (0,): return f # Avoid dividing by zero
for term in reversed(... | Python | 0.000309 |
0e2ef0a70fa6627c0eb4a292e69d3ed1f8500f36 | Add the ability to graph the results | estimate.py | estimate.py | import sys
from fractions import Fraction
from math import log10
def vulgarize(rpt):
"""Calculate a vulgar fraction for a given continued fraction"""
f = Fraction(0)
if tuple(rpt) == (0,): return f # Avoid dividing by zero
for term in reversed(rpt):
f = 1 / (term + f)
return 1/f
def magnitude(x):
"""Give an i... | import sys
from fractions import Fraction
from math import log10
def vulgarize(rpt):
"""Calculate a vulgar fraction for a given continued fraction"""
f = Fraction(0)
if tuple(rpt) == (0,): return f # Avoid dividing by zero
for term in reversed(rpt):
f = 1 / (term + f)
return 1/f
def magnitude(x):
"""Give an i... | Python | 0.000004 |
a54cb5529e5611b2d21c837d5422e31abd8d2819 | Add :q alias for quit | placidity/commands/quit/quit.py | placidity/commands/quit/quit.py | class Quit:
aliases = ('quit', 'quit()', ':q', )
description = 'Quits the application'
def execute(self):
raise SystemExit
| class Quit:
aliases = ('quit', 'quit()', )
description = 'Quits the application'
def execute(self):
raise SystemExit
| Python | 0 |
e2d009c2e64340d101319824af1130bb92b4b021 | Add debug logger method to utils | app/util.py | app/util.py | import os
def chown(username, path, destination):
"""Set owner and group of file to that of the parent directory."""
s = os.stat(path)
os.chown(os.path.join(path, destination), s.st_uid, s.st_gid)
def construct_path(path, format, *args):
"""Constructs a path using locally available variables."""
r... | import os
def chown(username, path, destination):
"""Set owner and group of file to that of the parent directory."""
s = os.stat(path)
os.chown(os.path.join(path, destination), s.st_uid, s.st_gid)
def construct_path(path, format, *args):
"""Constructs a path using locally available variables."""
r... | Python | 0.000001 |
cf6ddfdac8a56194ad1297921a390be541d773cc | Remove last digit of version number if it's 0. | app_info.py | app_info.py | # coding=UTF8
import datetime
name = "Devo"
release_date = datetime.date(2012, 12, 13)
version = (1, 0, 0)
version_string = ".".join(str(x) for x in (version if version[2] != 0 else version[:2]))
identifier = "com.iogopro.devo"
copyright = u"Copyright © 2010-2012 Luke McCarthy"
developer = "Developer: Luke McCa... | # coding=UTF8
import datetime
name = "Devo"
release_date = datetime.date(2012, 12, 13)
version = (1, 0, 0)
version_string = ".".join(str(x) for x in version)
identifier = "com.iogopro.devo"
copyright = u"Copyright © 2010-2012 Luke McCarthy"
developer = "Developer: Luke McCarthy <luke@iogopro.co.uk>"
company_na... | Python | 0.000158 |
206715b0d205adca9598b07b9fb57063e5b4a220 | Bump VERSION_INT up | src/constants.py | src/constants.py | #
# Copyright 2013 TeamSWAP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | #
# Copyright 2013 TeamSWAP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | Python | 0.000001 |
1e7c95ee7d920a5d0f312608b323c7449ca4fe1c | Bump version. | floobits.py | floobits.py | #!/usr/bin/env python
# coding: utf-8
import os
from floo import emacs_handler
from floo.common import migrations
from floo.common import reactor
from floo.common import utils
from floo.common import shared as G
def cb(port):
print('Now listening on %s' % port)
def main():
G.__VERSION__ = '0.11'
G.__PL... | #!/usr/bin/env python
# coding: utf-8
import os
from floo import emacs_handler
from floo.common import migrations
from floo.common import reactor
from floo.common import utils
from floo.common import shared as G
def cb(port):
print('Now listening on %s' % port)
def main():
G.__VERSION__ = '0.11'
G.__PL... | Python | 0 |
5950997c8925804338f224f1278c3018479dab09 | scale pixels to 16 shades | ppp.py | ppp.py | #! /usr/bin/python
"""
ppp.py
peggy.pi.pic
Take picture with Raspberry Pi camera and then display
as 25 x 25 pixel image (16 shades) on Peggy2
"""
# http://picamera.readthedocs.org/en/release-1.9/recipes1.html#capturing-to-a-pil-image
import io
import time
import picamera
from PIL import Image
# Create the in-mem... | #! /usr/bin/python
"""
ppp.py
peggy.pi.pic
Take picture with Raspberry Pi camera and then display
as 25 x 25 pixel image (16 shades) on Peggy2
"""
# http://picamera.readthedocs.org/en/release-1.9/recipes1.html#capturing-to-a-pil-image
import io
import time
import picamera
from PIL import Image
# Create the in-mem... | Python | 0.000001 |
a9de7732dc442df94770d91f8bef9eac45aea7de | Disable bytecode writing for testing | test/test.py | test/test.py | #!/usr/bin/env python
'''CSS Property Sorter Script Unittest
Copyright (c) 2012 Yu-Jie Lin
Author: Yu-Jie Lin <livibetter@gmail.com>, http://yjl.im
License: MIT license (http://opensource.org/licenses/mit-license.php)
'''
from __future__ import print_function
import glob
import os.path
import unittest
import sys
... | #!/usr/bin/env python
'''CSS Property Sorter Script Unittest
Copyright (c) 2012 Yu-Jie Lin
Author: Yu-Jie Lin <livibetter@gmail.com>, http://yjl.im
License: MIT license (http://opensource.org/licenses/mit-license.php)
'''
from __future__ import print_function
import glob
import os.path
import unittest
import sys
... | Python | 0.000001 |
7bf84875d5999a537a5689df4c1bb9ff6ce950ae | Remove forgotten test link | src/app/sameas/plugin.py | src/app/sameas/plugin.py | '''
Created on 4 Nov 2013
@author: cmarat
'''
from flask import request, jsonify
from flask.ext.login import login_required
import requests
from app import app
SAMEAS_URL = "http://sameas.org/json"
@app.route('/sameas', methods=['POST'])
@login_required
def link_to_sameas():
# Retrieve the article from the p... | '''
Created on 4 Nov 2013
@author: cmarat
'''
from flask import request, jsonify
from flask.ext.login import login_required
import requests
from app import app
SAMEAS_URL = "http://sameas.org/json"
@app.route('/sameas', methods=['POST'])
@login_required
def link_to_sameas():
# Retrieve the article from the p... | Python | 0 |
e5e872d48db28237129fa8c4ebdb76e93dd05954 | Fix bug in casting variables when cuda is enabled | rbm.py | rbm.py | import torch
class RBM():
def __init__(self, num_visible, num_hidden, k, learning_rate=1e-3, momentum_coefficient=0.5, weight_decay=1e-4, use_cuda=True):
self.num_visible = num_visible
self.num_hidden = num_hidden
self.k = k
self.learning_rate = learning_rate
self.momentum... | import torch
class RBM():
def __init__(self, num_visible, num_hidden, k, learning_rate=1e-3, momentum_coefficient=0.5, weight_decay=1e-4, use_cuda=True):
self.num_visible = num_visible
self.num_hidden = num_hidden
self.k = k
self.learning_rate = learning_rate
self.momentum... | Python | 0 |
e8c71806e5f10c46fe4ac3e81322e9a44b42f933 | Simplify todo example | test/todo.py | test/todo.py | """Incomplete fixes."""
# E501: This should be wrapped similar to how pprint does it
{'2323k2323': 24232323, '2323323232323': 3434343434343434, '34434343434535535': 3434343434343434, '4334343434343': 3434343434}
# See below
{'2323323232323': 3434343434343434,
'2323k2323': 24232323,
'34434343434535535': 343434343434... | """Incomplete fixes."""
# E501: This should be wrapped similar to how pprint does it
{'2323k2323': 24232323, '2323323232323': 3434343434343434, '34434343434535535': 3434343434343434, '4334343434343': 3434343434}
# See below
{'2323323232323': 3434343434343434,
'2323k2323': 24232323,
'34434343434535535': 343434343434... | Python | 0.000563 |
631a231fc2a63dfc0b6d051aa6cef49bd67d80a6 | add WSGI | run.py | run.py | from app import app
import mapping
import models
wsgi = app.wsgifunc()
if __name__ == "__main__":
models.createDB()
app.run()
| from app import app
import mapping
import models
if __name__ == "__main__":
models.createDB()
app.run()
| Python | 0.001935 |
e7df2d658cdb0a3664b914d0577ea08da2845f08 | fix run.py python interpreter | run.py | run.py | #!flask/bin/python
from api import app
app.run(debug = True)
| #!env/bin/python
from api import app
app.run(debug = True)
| Python | 0.00052 |
603cf4cab90e6655a5aa26269a93376d13dd7fe1 | Fix package installing | lib/pacman/sync.py | lib/pacman/sync.py | from lib.pacman.command import execute
def refresh_force():
"""pacman -Syy"""
execute('sudo -S pacman -Syy', discard_output=True)
def system_upgrade():
"""pacman -Syu"""
execute('sudo -S pacman -Syu --noconfirm', discard_output=True)
def install(package, asdeps=False):
"""pacman -S [--asdeps] ... | from lib.pacman.command import execute
def refresh_force():
"""pacman -Syy"""
execute('sudo -S pacman -Syy', discard_output=True)
def system_upgrade():
"""pacman -Syu"""
execute('sudo -S pacman -Syu --noconfirm', discard_output=True)
def install(package, asdeps=False):
"""pacman -S [--asdeps] ... | Python | 0 |
612c809a68640fea9130952fdd626ee0118646bb | Fix code style for task group model | src/ggrc_workflows/models/task_group.py | src/ggrc_workflows/models/task_group.py | # Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: dan@reciprocitylabs.com
# Maintained By: dan@reciprocitylabs.com
from ggrc import db
from ggrc.models.mixins import (
Titled, Slugged, Describ... | # Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: dan@reciprocitylabs.com
# Maintained By: dan@reciprocitylabs.com
from ggrc import db
from ggrc.models.mixins import (
Titled, Slugged, Describ... | Python | 0.001611 |
70b00ee903fac46038bafdd69dd8e643d6cc76ad | Fix setting "auto" flag with pkgng | libpb/pkg/pkgng.py | libpb/pkg/pkgng.py | """
The next generation package management tools (i.e. pkgng)..
"""
from __future__ import absolute_import
import os
from libpb import env
__all__ = ["add", "change", "info", "query", "remove"]
suffix = ".txz"
shell_pkg_add = """
if [ ! -d %(wrkdir)s ]; then
mkdir -p %(wrkdir)s;
clean_wrkdir="YES";
fi;
tar... | """
The next generation package management tools (i.e. pkgng)..
"""
from __future__ import absolute_import
import os
from libpb import env
__all__ = ["add", "change", "info", "query", "remove"]
suffix = ".txz"
shell_pkg_add = """
if [ ! -d %(wrkdir)s ]; then
mkdir -p %(wrkdir)s;
clean_wrkdir="YES";
fi;
tar... | Python | 0 |
f01a78c6fd7bb34c2461e803e6ee1d757e17740b | Fix domain reload tests and activate them on macOS | src/domain_tests/test_domain_reload.py | src/domain_tests/test_domain_reload.py | import subprocess
import os
import platform
import pytest
from pythonnet.find_libpython import find_libpython
libpython = find_libpython()
pytestmark = pytest.mark.xfail(libpython is None, reason="Can't find suitable libpython")
def _run_test(testname):
dirname = os.path.split(__file__)[0]
exename = os.pat... | import subprocess
import os
import platform
import pytest
def _run_test(testname):
dirname = os.path.split(__file__)[0]
exename = os.path.join(dirname, 'bin', 'Python.DomainReloadTests.exe')
args = [exename, testname]
if platform.system() != 'Windows':
args = ['mono'] + args
proc = subpr... | Python | 0 |
01bff2cb28dedb98e5ac16d35178569a8ca8bbe1 | improve readability | src/graphql/pyutils/suggestion_list.py | src/graphql/pyutils/suggestion_list.py | from typing import Collection, List
__all__ = ["suggestion_list"]
def suggestion_list(input_: str, options: Collection[str]) -> List[str]:
"""Get list with suggestions for a given input.
Given an invalid input string and list of valid options, returns a filtered list
of valid options sorted based on the... | from typing import Collection, List
__all__ = ["suggestion_list"]
def suggestion_list(input_: str, options: Collection[str]) -> List[str]:
"""Get list with suggestions for a given input.
Given an invalid input string and list of valid options, returns a filtered list
of valid options sorted based on the... | Python | 0.000005 |
e37174e733b7b186a40cc82ffe95c3d10014bd2f | Check for errors | src/redis.py | src/redis.py | #!/usr/bin/env python
#
# igcollect - Redis
#
# Copyright (c) 2016 InnoGames GmbH
#
from argparse import ArgumentParser
from subprocess import check_output
from time import time
def parse_args():
parser = ArgumentParser()
parser.add_argument('--prefix', default='redis')
return parser.parse_args()
def m... | #!/usr/bin/env python
#
# igcollect - Redis
#
# Copyright (c) 2016 InnoGames GmbH
#
from argparse import ArgumentParser
from subprocess import Popen, PIPE
from time import time
def parse_args():
parser = ArgumentParser()
parser.add_argument('--prefix', default='redis')
return parser.parse_args()
def m... | Python | 0.000001 |
9d8de33a72e821bf0fb7415f73ba8cfabc3ba93b | Update version 0.7.6 -> 0.7.7 | src/setup.py | src/setup.py | #!/usr/bin/env python
#
# Copyright 2012, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | #!/usr/bin/env python
#
# Copyright 2012, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | Python | 0.000001 |
1f9947598671422d86c76c036d4037690a3e99ba | summarize short-distance rides | src/utils.py | src/utils.py | import collections
import datetime
import stravalib.client
import time
class BaseException(Exception):
pass
class ConfigError(BaseException):
pass
class MyStravaClient(stravalib.client.Client):
API_CALL_PAUSE_SECONDS = 0.5
def get_all_gears(self):
all_activities = self.get_activities()
... | import collections
import datetime
import stravalib.client
import time
class BaseException(Exception):
pass
class ConfigError(BaseException):
pass
class MyStravaClient(stravalib.client.Client):
API_CALL_PAUSE_SECONDS = 0.5
def get_all_gears(self):
all_activities = self.get_activities()
... | Python | 0.999999 |
394581407a7788b315da97f870a6dcd0bfe4bd54 | fix js MIME type | src/utils.py | src/utils.py | #!/usr/local/bin/python
# -*- coding: utf-8 -*-
import json
def is_none(target):
return target is None
def is_none_or_empty(target):
return is_none(target) or len(target) == 0
def write_json_output(response, dic):
response_text, content_type = json.dumps(dic), "application/json"
_do_write(response, ... | #!/usr/local/bin/python
# -*- coding: utf-8 -*-
import json
def is_none(target):
return target is None
def is_none_or_empty(target):
return is_none(target) or len(target) == 0
def write_json_output(response, dic):
response_text, content_type = json.dumps(dic), "application/json"
_do_write(response, ... | Python | 0.000512 |
d816e103a6092766398bc74ae2ed844ff3f9598b | Handle missing sections | pwndbg/commands/elf.py | pwndbg/commands/elf.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from elftools.elf.elffile import ELFFile
import gdb
import pwndbg.commands
@pwndbg.commands.Command
def elfheader():
"""
Prints the section mappings contained in the ELF header.
"""
local_path = pwndbg.file.get_fil... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from elftools.elf.elffile import ELFFile
import gdb
import pwndbg.commands
@pwndbg.commands.Command
def elfheader():
"""
Prints the section mappings contained in the ELF header.
"""
local_path = pwndbg.file.get_fil... | Python | 0.000753 |
6226c17ed1e9313dc202b44fc69b098a09140983 | fix translation | pycket/values_regex.py | pycket/values_regex.py | from pycket.base import W_Object
from pycket.error import SchemeException
from pycket import values, values_string
from pycket import regexp
from rpython.rlib.rsre import rsre_core
CACHE = regexp.RegexpCache()
class W_AnyRegexp(W_Object):
_immutable_fields_ = ["source"]
errorname = "regexp"
def __init_... | from pycket.base import W_Object
from pycket.error import SchemeException
from pycket import values, values_string
from pycket import regexp
from rpython.rlib.rsre import rsre_core
CACHE = regexp.RegexpCache()
class W_AnyRegexp(W_Object):
_immutable_fields_ = ["source"]
errorname = "regexp"
def __init_... | Python | 0.000028 |
1069574db36d86745fa4357ff2bc35334883ad86 | Bump app version to 2019.7.1 | app/handlers/__init__.py | app/handlers/__init__.py | __version__ = "2019.7.1"
__versionfull__ = __version__
| __version__ = "2019.7.0"
__versionfull__ = __version__
| Python | 0 |
20d5e52221713ef1ab1bc9cd74b47520bea69ac6 | Add tasks TODO | api/experiments/tasks.py | api/experiments/tasks.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import logging
from api.settings import CeleryTasks
from api.celery_api import app
from experiments.models import Experiment
from experiments.task_status import ExperimentStatus
logger = logging.getLogger('polyaxon.api.experimen... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import logging
import polyaxon as plx
from api.settings import CeleryTasks
from api.celery_api import app
from experiments.models import Experiment
from experiments.task_status import ExperimentStatus
logger = logging.getLogge... | Python | 0.001469 |
9e8b6f47f25d4445031e0c996bc8c92ba6da4cd3 | Remove unnecessary else | pygametemplate/core.py | pygametemplate/core.py | """Module containing the core functions of pygametemplate."""
import os
import sys
import traceback
from datetime import datetime
import ctypes
import pygame
from pygametemplate.exceptions import CaughtFatalException
TEST = bool(int(os.environ.get("TEST", "0")))
PATH = os.getcwd()
def path_to(*path):
"""Retu... | """Module containing the core functions of pygametemplate."""
import os
import sys
import traceback
from datetime import datetime
import ctypes
import pygame
from pygametemplate.exceptions import CaughtFatalException
TEST = bool(int(os.environ.get("TEST", "0")))
PATH = os.getcwd()
def path_to(*path):
"""Retu... | Python | 0.000006 |
c306c3b408e880edfc6d49e31575dc91a31783bd | Switch reset command to use call_command instead of subprocess. | kive/metadata/management/commands/reset.py | kive/metadata/management/commands/reset.py | from optparse import make_option
import os
import shutil
from django.core.management.base import BaseCommand
from django.core.management import call_command
import kive.settings # @UnresolvedImport
class Command(BaseCommand):
help = 'Resets the database and loads sample data.'
option_list = BaseComman... | from optparse import make_option
import os
import shutil
import subprocess
import sys
from django.core.management.base import BaseCommand
from django.core.management import call_command
import kive.settings # @UnresolvedImport
class Command(BaseCommand):
help = 'Resets the database and loads sample data.'
... | Python | 0 |
e52d0ee26ba4daf01567c460a480afb3a72667ab | Fix to pip provider | kokki/cookbooks/pip/libraries/providers.py | kokki/cookbooks/pip/libraries/providers.py |
__all__ = ["PipPackageProvider"]
import re
from subprocess import check_call, Popen, PIPE, STDOUT
from kokki import *
from kokki.providers.package import PackageProvider
version_re = re.compile(r'\S\S(.*)\/(.*)-(.*)-py(.*).egg\S')
best_match_re = re.compile(r'Best match: (.*) (.*)\n')
class PipPackageProvider(Packa... |
__all__ = ["PipPackageProvider"]
import re
from subprocess import check_call, Popen, PIPE, STDOUT
from kokki import *
from kokki.providers.package import PackageProvider
version_re = re.compile(r'\S\S(.*)\/(.*)-(.*)-py(.*).egg\S')
best_match_re = re.compile(r'Best match: (.*) (.*)\n')
class PipPackageProvider(Packa... | Python | 0.000001 |
8c26745c0608b2cc49db0e7d186eb3ad8a627bbc | Fix a copy-paste error in logging statements | examples/demo_receive.py | examples/demo_receive.py | #!/usr/bin/env python
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (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.mozilla.org/MP... | #!/usr/bin/env python
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (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.mozilla.org/MP... | Python | 0.000021 |
d77e3fbc0d59ca31ce028cc31f5d1e06f08900f4 | Fix color effect decorator in GoL example (#20) | examples/game_of_life.py | examples/game_of_life.py | from hecate import core
from hecate import seeds
from hecate.core import color_effects
class GameOfLife(core.CellularAutomaton):
""" The Idea of classic CA built with HECATE framework """
state = core.IntegerProperty(max_val=1)
class Topology:
dimensions = 2
lattice = core.OrthogonalLatti... | from hecate import core
from hecate import seeds
from hecate.core import color_effects
class GameOfLife(core.CellularAutomaton):
""" The Idea of classic CA built with HECATE framework """
state = core.IntegerProperty(max_val=1)
class Topology:
dimensions = 2
lattice = core.OrthogonalLatti... | Python | 0 |
4d79d49eb6e542f43636c6232c98953ffc1b28d3 | clean up stitcher script | app/services/stitcher.py | app/services/stitcher.py | #!/usr/bin/env python
"""
Script for streaming a camera feed
"""
import sys
import signal
import argparse
import subprocess
try:
import cv2
except:
raise Exception('OpenCV is not installed')
def parse_args():
"""
Parses command line arguments
"""
parser = argparse.ArgumentParser()
parser... | #!/usr/bin/env python
import sys
import signal, os
import argparse
import subprocess
try:
import cv2
except:
raise Exception('OpenCV is not installed')
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('-f', default='')
parser.add_argument('-i', type=int, default=0)
par... | Python | 0.000003 |
54682633b6312cb942d819be9c02beb2b5ad7bef | Add edit-entry, single-entry, new_entry. | learning_journal/learning_journal/views.py | learning_journal/learning_journal/views.py | from pyramid.response import Response
import os
HERE = os.path.dirname(__file__)
def home_page(request):
imported_text = open(os.path.join(HERE + '/static/', 'index.html')).read()
return Response(imported_text)
def view_entry(request):
imported_text = open(os.path.join(HERE + '/static/', 'single-entry... | from pyramid.response import Response
import os
HERE = os.path.dirname(__file__)
def home_page(request):
imported_text = open(os.path.join(HERE + '/static/', 'index.html')).read()
return Response(imported_text)
def includeme(config):
config.add_view(home_page, route_name='home')
| Python | 0 |
f33ce12f1f4bd53cbaa22d7942c32e82f8b718e9 | Add an export version tag and encode strings as utf-8. | king_phisher/client/export.py | king_phisher/client/export.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# king_phisher/client/export.py
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, th... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# king_phisher/client/export.py
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, th... | Python | 0 |
e3e878ddfb95141b19bdae9e3713690759149ce1 | remove unused property | pyscreenshot/loader.py | pyscreenshot/loader.py | import logging
from pyscreenshot import plugins
import traceback
log = logging.getLogger(__name__)
class FailedBackendError(Exception):
pass
class Loader(object):
def __init__(self):
self.plugins = dict()
self.all_names = [x.name for x in self.plugin_classes()]
self.changed = Tr... | import logging
from pyscreenshot import plugins
import traceback
log = logging.getLogger(__name__)
class FailedBackendError(Exception):
pass
class Loader(object):
def __init__(self):
self.plugins = dict()
self.all_names = [x.name for x in self.plugin_classes()]
self.changed = Tr... | Python | 0.000001 |
0b11bf48989673245adbc89aa6f65c85debafd9f | Make sure billing/shipping aren't populated if they aren't there | armstrong/apps/donations/backends.py | armstrong/apps/donations/backends.py | from armstrong.utils.backends import GenericBackend
from billing import get_gateway
from . import forms
class AuthorizeNetBackend(object):
def get_form_class(self):
return forms.CreditCardDonationForm
def purchase(self, donation, form):
authorize = get_gateway("authorize_net")
author... | from armstrong.utils.backends import GenericBackend
from billing import get_gateway
from . import forms
class AuthorizeNetBackend(object):
def get_form_class(self):
return forms.CreditCardDonationForm
def purchase(self, donation, form):
authorize = get_gateway("authorize_net")
author... | Python | 0 |
d167d79e5de0479bd3ddeeb0e7b03c5de6bb9ad5 | fix key error | iceprod/server/scheduled_tasks/dataset_monitor.py | iceprod/server/scheduled_tasks/dataset_monitor.py | """
Monitor the datasets.
Send monitoring data to graphite.
Initial delay: rand(1 minute)
Periodic delay: 5 minutes
"""
import logging
import random
import time
from tornado.ioloop import IOLoop
from iceprod.server import GlobalID
logger = logging.getLogger('dataset_monitor')
def dataset_monitor(module):
"""... | """
Monitor the datasets.
Send monitoring data to graphite.
Initial delay: rand(1 minute)
Periodic delay: 5 minutes
"""
import logging
import random
import time
from tornado.ioloop import IOLoop
from iceprod.server import GlobalID
logger = logging.getLogger('dataset_monitor')
def dataset_monitor(module):
"""... | Python | 0.000006 |
6ecc3fde7e0a7f767da161f627ad17f4cc249bb9 | Add AppPath class. | ievv_opensource/utils/ievvbuildstatic/filepath.py | ievv_opensource/utils/ievvbuildstatic/filepath.py | import os
from django.apps import apps
class FilePathInterface(object):
"""
Base interface for file path objects.
We provide subclasses if this interface with different use cases:
- :class:`.SourcePath`: Use this to specify a source file or folder
in the sources directory of a :class:`ievv_... | import os
from django.apps import apps
class FilePathInterface(object):
"""
Base interface for file path objects.
We provide subclasses if this interface with different use cases:
- :class:`.SourcePath`: Use this to specify a source file or folder
in the sources directory of a :class:`ievv_... | Python | 0 |
5efddf26176ac778556a3568bf97c2e70daac866 | Replace many double quotes with single quotes | anchorhub/settings/default_settings.py | anchorhub/settings/default_settings.py | """
Defaults for all settings used by AnchorHub
"""
WRAPPER = '{ }'
INPUT = '.'
OUTPUT = 'out-anchorhub'
ARGPARSER = {
'description': "anchorhub parses through Markdown files and precompiles "
"links to specially formatted anchors."
}
ARGPARSE_INPUT = {
'help': "Path of directory tree to b... | """
Defaults for all settings used by AnchorHub
"""
WRAPPER = "{ }"
INPUT = "."
OUTPUT = "out-anchorhub"
ARGPARSER = {
"description": "anchorhub parses through Markdown files and precompiles "
"links to specially formatted anchors."
}
ARGPARSE_INPUT = {
"help": "Path of directory tree to b... | Python | 0.999999 |
0ac45656e3b76564d1e1752dd16ae91cfc918134 | Set room maximum capacity | app/room.py | app/room.py | class Room(object):
"""Room class that creates rooms in amity
"""
def __init__(self, room_name, room_type, capacity, occupants):
self.room_name = room_name
self.room_type = room_type
self.capacity = capacity
self.occupants = []
class LivingSpace(Room):
"""Creates livi... | class Room(object):
"""Room class that creates rooms in amity
"""
def __init__(self, room_name, room_type, capacity, occupants):
self.room_name = room_name
self.room_type = room_type
self.capacity = capacity
self.occupants = []
class LivingSpace(Room):
"""Creates livi... | Python | 0.000001 |
89bbea9d4c61e211740ae649a0f3f15bcb89a1a5 | add device_type | lava-kernel-ci-job-creator.py | lava-kernel-ci-job-creator.py | #!/usr/bin/python
import urllib2
import urlparse
import re
import sys
import os
import shutil
base_url = None
kernel = None
dtb_list = []
dtb_map = {'exynos5250-arndale.dtb': 'arndale',
'am335x-boneblack.dtb': 'beaglebone-black',
'omap3-beagle-xm.dtb': 'beagle-xm',
'omap4-panda-es.dtb'... | #!/usr/bin/python
import urllib2
import urlparse
import re
import sys
import os
import shutil
base_url = None
kernel = None
dtb_list = []
dtb_map = {'exynos5250-arndale.dtb': 'arndale',
'am335x-boneblack.dtb': 'beaglebone-black',
'omap3-beagle-xm.dtb': 'beagle-xm',
'omap4-panda-es.dtb'... | Python | 0.000008 |
e3a84c3ccadb98ecb5dae563475de5108d46cf9d | Format external_plugin_dependencies.bzl with buildifier | external_plugin_deps.bzl | external_plugin_deps.bzl | load("//tools/bzl:maven_jar.bzl", "maven_jar")
def external_plugin_deps():
maven_jar(
name = "mockito",
artifact = "org.mockito:mockito-core:2.15.0",
sha1 = "b84bfbbc29cd22c9529409627af6ea2897f4fa85",
deps = [
"@byte_buddy//jar",
"@byte_buddy_agent//jar",
... | load("//tools/bzl:maven_jar.bzl", "maven_jar")
def external_plugin_deps():
maven_jar(
name = "mockito",
artifact = "org.mockito:mockito-core:2.15.0",
sha1 = "b84bfbbc29cd22c9529409627af6ea2897f4fa85",
deps = [
"@byte_buddy//jar",
"@byte_buddy_agent//jar",
"@objenesis//jar",
],
... | Python | 0.000001 |
0a902a5afd43fe817320bd1e400828abcd1faa83 | make su promt AIX compatible | lib/ansible/utils/su_prompts.py | lib/ansible/utils/su_prompts.py | # -*- coding: utf-8 -*-
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License,... | # -*- coding: utf-8 -*-
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License,... | Python | 0 |
b19fa5114fa3e363a634defa9d4299ec7562c607 | Make p_debug more terse: print test in same line as `DEBUG` prefix. | libexec/windows_shares_discovery_runner.py | libexec/windows_shares_discovery_runner.py | #!/usr/bin/env python
#
# Copyright (C) 2009-2012:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
# Gregory Starck, g.starck@gmail.com
#
# This file is part of Shinken.
#
# Shinken is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Gene... | #!/usr/bin/env python
# Copyright (C) 2009-2012:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
# Gregory Starck, g.starck@gmail.com
#
# This file is part of Shinken.
#
# Shinken is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Genera... | Python | 0.000013 |
f41714fb34c82d523b212f0a4301757969598373 | Simplify correct function. | agents/serf/scripts/AgentEventHandler.py | agents/serf/scripts/AgentEventHandler.py | #!/usr/bin/python
import re
import os
import SerfCID
class AgentEventHandler:
def __init__(self, payload="", CID="", envVarGetter=""):
self.payload = payload
self.CID = CID
self.TARGET_STRING = "TARGET"
self.TARGET_ALL_STRING = self.TARGET_STRING + "=ALL"
self.envVarGetter ... | #!/usr/bin/python
import re
import os
import SerfCID
class AgentEventHandler:
def __init__ (self, payload="", CID="", envVarGetter=""):
self.payload = payload
self.CID = CID
self.TARGET_STRING = "TARGET"
self.TARGET_ALL_STRING = self.TARGET_STRING + "=ALL"
self.envVarGetter = envVarGetter
def getPaylo... | Python | 0.000416 |
502ffa8fe93e0066f3553039493ef8b552069141 | Add KDumpConf shared mapper. | falafel/mappers/kdump.py | falafel/mappers/kdump.py | import re
from falafel.core import computed, MapperOutput
from falafel.core.plugins import mapper
@mapper("cmdline")
def crashkernel_enabled(context):
"""
Determine if kernel is configured to reserve memory for the crashkernel
"""
for line in context.content:
if 'crashkernel' in line:
... | import re
from falafel.core.plugins import mapper
@mapper("cmdline")
def crashkernel_enabled(context):
"""
Determine if kernel is configured to reserve memory for the crashkernel
"""
for line in context.content:
if 'crashkernel' in line:
return True
@mapper("systemctl_list-unit-... | Python | 0 |
4bce4da138c4dc8060e11451eb21fb2f7c0891f5 | Fix issue #1: Runserver failed when having callback function in root URLconf | quickadmin/register.py | quickadmin/register.py | from django.contrib import admin
from django.utils.module_loading import import_module
from django.db.models import get_models
from django.conf import settings
from django.conf.urls import include, url
from django.utils.log import getLogger
from .config import QADMIN_DEFAULT_EXCLUDES, USE_APPCONFIG
logger = getLogg... | from django.contrib import admin
from django.utils.module_loading import import_module
from django.db.models import get_models
from django.conf import settings
from django.conf.urls import include, url
from django.utils.log import getLogger
from .config import QADMIN_DEFAULT_EXCLUDES, USE_APPCONFIG
logger = getLogg... | Python | 0.000001 |
3efd6e00859afd4f8b875ab0d74e937a172f887a | Fix formatting in fedmsg-tweet log. | fedmsg/commands/tweet.py | fedmsg/commands/tweet.py | # This file is part of fedmsg.
# Copyright (C) 2012 Red Hat, Inc.
#
# fedmsg is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#... | # This file is part of fedmsg.
# Copyright (C) 2012 Red Hat, Inc.
#
# fedmsg is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#... | Python | 0.000008 |
38a8d47d3bd476f195d866e01b8a800ae86132e5 | update battery script | files/bin/bin/battery.py | files/bin/bin/battery.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
##############################################################################
#
# battery
# -------
#
# This script will output a specific icon based on the charge of a laptop
# battery. When the script is run on a system without a battery it will
# output an icon accord... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
##############################################################################
#
# battery
# -------
#
# This script will output a specific icon based on the charge of a laptop
# battery. When the script is run on a system without a battery it will
# output an icon accord... | Python | 0.000001 |
e191a1a52360f78fd65f65727e07695002d0cb77 | Convert PostArchiveAll to use paginate function. | firmant/writers/posts.py | firmant/writers/posts.py | # Copyright (c) 2010, Robert Escriva
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of condition... | # Copyright (c) 2010, Robert Escriva
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of condition... | Python | 0 |
1cc8161fbbcf6c0994af1cd4d0b4bcc6ba2fe47f | Set message | bluebottle/activities/permissions.py | bluebottle/activities/permissions.py | from rest_framework import permissions
from bluebottle.activities.models import Activity
from bluebottle.initiatives.models import InitiativePlatformSettings
from bluebottle.utils.permissions import ResourcePermission, ResourceOwnerPermission, BasePermission
class ActivityOwnerPermission(ResourceOwnerPermission):
... | from rest_framework import permissions
from bluebottle.activities.models import Activity
from bluebottle.initiatives.models import InitiativePlatformSettings
from bluebottle.utils.permissions import ResourcePermission, ResourceOwnerPermission, BasePermission
class ActivityOwnerPermission(ResourceOwnerPermission):
... | Python | 0.000002 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.