commit stringlengths 40 40 | subject stringlengths 4 1.73k | repos stringlengths 5 127k | old_file stringlengths 2 751 | new_file stringlengths 2 751 | new_contents stringlengths 1 8.98k | old_contents stringlengths 0 6.59k | license stringclasses 13
values | lang stringclasses 23
values |
|---|---|---|---|---|---|---|---|---|
35d6d780bddf72ab5ff216a7603bd89f980c8deb | Bump version | bright-sparks/grab-site,UncleStranger/grab-site,bright-sparks/grab-site,UncleStranger/grab-site | libgrabsite/__init__.py | libgrabsite/__init__.py | __version__ = '0.4.1'
| __version__ = '0.4.0'
| mit | Python |
e511da2cb7b73891f26b93e684d9fba80042f3cd | fix syntax | madcore-ai/core,madcore-ai/core | bin/redis_app_update.py | bin/redis_app_update.py | import json
import sys
import redis
r_server = redis.StrictRedis('127.0.0.1', db=2)
app_key = "apps"
app_info = json.loads(r_server.get(app_key))
app_name = sys.argv[1]
app_port = sys.argv[2]
app_namespace = sys.argv[3]
app_service_name = sys.argv[4]
check = False
for app in app_info:
if app["name"] == app_name:... | import json
import sys
import redis
r_server = redis.StrictRedis('127.0.0.1', db=2)
app_key = "apps"
app_info = json.loads(r_server.get(app_key))
app_name = sys.argv[1]
app_port = sys.argv[2]
app_namespace = sys.argv[3]
app_service_name = sys.argv[4]
check = False
for app in app_info:
if app["name"] == app_name:... | mit | Python |
0d68fbaef300c53db407f6296c00e493e4b040bf | use xdg-email by default, fallback to xdg-open + mailto uri | cleett/plyer,kivy/plyer,kostyll/plyer,KeyWeeUsr/plyer,KeyWeeUsr/plyer,kivy/plyer,kivy/plyer,johnbolia/plyer,kived/plyer,kived/plyer,johnbolia/plyer,KeyWeeUsr/plyer,kostyll/plyer,cleett/plyer | plyer/platforms/linux/email.py | plyer/platforms/linux/email.py | import subprocess
from urllib import quote
from plyer.facades import Email
class LinuxEmail(Email):
def _send(self, **kwargs):
recipient = kwargs.get('recipient')
subject = kwargs.get('subject')
text = kwargs.get('text')
create_chooser = kwargs.get('create_chooser')
uri = "... | import subprocess
from urllib import quote
from plyer.facades import Email
class LinuxEmail(Email):
def _send(self, **kwargs):
recipient = kwargs.get('recipient')
subject = kwargs.get('subject')
text = kwargs.get('text')
create_chooser = kwargs.get('create_chooser')
uri = "... | mit | Python |
8fb201b866c0eabc99c370cf3ccc993d2de06264 | Update version 0.10.1 | MSeifert04/iteration_utilities,MSeifert04/iteration_utilities,MSeifert04/iteration_utilities,MSeifert04/iteration_utilities | src/iteration_utilities/__init__.py | src/iteration_utilities/__init__.py | # Licensed under Apache License Version 2.0 - see LICENSE
"""Utilities based on Pythons iterators and generators."""
from ._iteration_utilities import *
from ._convenience import *
from ._recipes import *
from ._additional_recipes import *
from ._classes import *
__version__ = '0.10.1'
| # Licensed under Apache License Version 2.0 - see LICENSE
"""Utilities based on Pythons iterators and generators."""
from ._iteration_utilities import *
from ._convenience import *
from ._recipes import *
from ._additional_recipes import *
from ._classes import *
__version__ = '0.10.0'
| apache-2.0 | Python |
ffa551d8e4519005791f42bb2862f0411c54ced3 | Update projectfiles_unchanged script | kullo/smartsqlite,kullo/smartsqlite,kullo/smartsqlite | projectfiles_unchanged.py | projectfiles_unchanged.py | #!/usr/bin/env python3
#
# This script is used on Linux, OS X and Windows.
# Python 3 required.
# Returns 0 if project files are unchanged and 1 else.
#
# Script version: 3
import os
import glob
import hashlib
import sys
matches = []
tmp_file = "projectfiles.md5.tmp"
exlude_dirs = set(['.git', 'docs'])
def get_subdi... | # version: 2
import os
import glob
import hashlib
import sys
matches = []
exlude_dirs = set(['.git', 'docs'])
def get_subdirs(path):
return set([name for name in os.listdir(path)
if os.path.isdir(os.path.join(path, name))])
def find_in(path):
# print(path)
out = []
out += glob.glob(path + "/... | bsd-3-clause | Python |
4e62d7d9514449be5afc5a27b15726a254077e89 | Remove dangling argument | fieldOfView/Cura,ynotstartups/Wanhao,totalretribution/Cura,hmflash/Cura,totalretribution/Cura,ynotstartups/Wanhao,fieldOfView/Cura,hmflash/Cura,Curahelper/Cura,senttech/Cura,senttech/Cura,Curahelper/Cura | MachineSettingsAction.py | MachineSettingsAction.py | from cura.MachineAction import MachineAction
import cura.Settings.CuraContainerRegistry
from UM.i18n import i18nCatalog
from UM.Settings.DefinitionContainer import DefinitionContainer
from UM.Application import Application
from PyQt5.QtCore import pyqtSlot, QObject
catalog = i18nCatalog("cura")
class MachineSetti... | from cura.MachineAction import MachineAction
import cura.Settings.CuraContainerRegistry
from UM.i18n import i18nCatalog
from UM.Settings.DefinitionContainer import DefinitionContainer
from UM.Application import Application
from PyQt5.QtCore import pyqtSlot, QObject
catalog = i18nCatalog("cura")
class MachineSetti... | agpl-3.0 | Python |
2e071c0e37fac657955de70fb7193b3e46ba2aef | Update subscribe_speakers_to_talks.py | pythonitalia/pycon_site,pythonitalia/pycon_site,leriomaggio/pycon_site,pythonitalia/pycon_site,pythonitalia/pycon_site,leriomaggio/pycon_site,leriomaggio/pycon_site,pythonitalia/pycon_site,leriomaggio/pycon_site,leriomaggio/pycon_site | p3/management/commands/subscribe_speakers_to_talks.py | p3/management/commands/subscribe_speakers_to_talks.py | # -*- coding: UTF-8 -*-
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth import get_user_model
from conference import models as cmodels
from hcomments import models as hmodels
info = get_user_model().objects.get(email='info@pycon.it')
class Command(BaseCommand):
def handl... | # -*- coding: UTF-8 -*-
from django.core.management.base import BaseCommand, CommandError
from conference import models as cmodels
from hcomments import models as hmodels
class Command(BaseCommand):
def handle(self, *args, **options):
try:
conf = args[0]
except IndexError:
r... | bsd-2-clause | Python |
78dd9bb220a8e1a03b51b801e023e4401a351892 | Support animated pngs | stevearc/gif-split,stevearc/gif-split | gif_split/views.py | gif_split/views.py | import os
import posixpath
from cStringIO import StringIO
import logging
import requests
from PIL import Image, ImageSequence
from paste.httpheaders import CONTENT_DISPOSITION
from pyramid.response import FileIter, FileResponse
from pyramid.view import view_config
from pyramid_duh import argify
LOG = logging.getLogg... | import os
import posixpath
from cStringIO import StringIO
import logging
import requests
from PIL import Image, ImageSequence
from paste.httpheaders import CONTENT_DISPOSITION
from pyramid.response import FileIter, FileResponse
from pyramid.view import view_config
from pyramid_duh import argify
LOG = logging.getLogg... | mit | Python |
d00d809735210f53c3da71195107f1991814eb52 | fix minor bug most likely due to merge error | StartupsPoleEmploi/labonneboite,StartupsPoleEmploi/labonneboite,StartupsPoleEmploi/labonneboite,StartupsPoleEmploi/labonneboite | labonneboite/common/models/user_favorite_offices.py | labonneboite/common/models/user_favorite_offices.py | # coding: utf8
import datetime
from sqlalchemy import Column, ForeignKey, UniqueConstraint
from sqlalchemy import desc
from sqlalchemy import Integer, String, DateTime
from sqlalchemy.orm import relationship
from labonneboite.common.database import Base
from labonneboite.common.database import db_session
from labonn... | # coding: utf8
import datetime
from sqlalchemy import Column, ForeignKey, UniqueConstraint
from sqlalchemy import desc
from sqlalchemy import Integer, String, DateTime
from sqlalchemy.orm import relationship
from labonneboite.common.database import Base
from labonneboite.common.database import db_session
from labonn... | agpl-3.0 | Python |
02d6e904fe02a4c53b1878a3f6c44c074de47d79 | Add __str__ to Decorator | schwa-lab/libschwa,schwa-lab/libschwa,schwa-lab/libschwa,schwa-lab/libschwa | api/python/schwa/dr/decoration.py | api/python/schwa/dr/decoration.py | """
Utilities for managing document decoration by marking the document with the set of decorations that have been applied to it.
"""
from functools import wraps, partial
def decorator(key=None):
"""
Wraps a docrep decorator, ensuring it is only executed once per document.
Duplication is checked using the given... | """
Utilities for managing document decoration by marking the document with the set of decorations that have been applied to it.
"""
from functools import wraps, partial
def decorator(key=None):
"""
Wraps a docrep decorator, ensuring it is only executed once per document.
Duplication is checked using the given... | mit | Python |
d7e6db61a0100e69b9a18c17a906e094e91ce7b3 | fix wrong keyword param (passws) to MySQLdb.connect | kavinyao/SKBPR,kavinyao/SKBPR | database.py | database.py | """
Database Manager.
"""
import MySQLdb
import MySQLdb.cursors
class DatabaseManager(object):
def __init__(self, host, user, passwd, database, charset='utf8', large_scale=False):
"""Be careful using large_scale=True, SSDictCursor seems not reliable."""
self.conn = MySQLdb.connect(host=host, user=... | """
Database Manager.
"""
import MySQLdb
import MySQLdb.cursors
class DatabaseManager(object):
def __init__(self, host, user, passwd, database, charset='utf8', large_scale=False):
"""Be careful using large_scale=True, SSDictCursor seems not reliable."""
self.conn = MySQLdb.connect(host=host, user=... | mit | Python |
2e164c5fe2e3a208dbdcbc51f287a9e5b7cc34a8 | Add package_data entry in setup.py | pmorissette/klink,pmorissette/klink,dfroger/klink,dfroger/klink | setup.py | setup.py | from setuptools import setup
from klink import __version__
setup(
name='klink',
version=__version__,
url='https://github.com/pmorissette/klink',
description='Klink is a simple and clean theme for creating Sphinx docs, inspired by jrnl',
license='MIT',
author='Philippe Morissette',
author_em... | from setuptools import setup
from klink import __version__
setup(
name='klink',
version=__version__,
url='https://github.com/pmorissette/klink',
description='Klink is a simple and clean theme for creating Sphinx docs, inspired by jrnl',
license='MIT',
author='Philippe Morissette',
author_em... | mit | Python |
64c50a273c3e113affdb700f137bda78fd1a684d | update examples/progressbar.by | TaiSakuma/AlphaTwirl,alphatwirl/alphatwirl,TaiSakuma/AlphaTwirl,alphatwirl/alphatwirl,alphatwirl/alphatwirl,alphatwirl/alphatwirl | examples/progressbar.py | examples/progressbar.py | #!/usr/bin/env python
# Tai Sakuma <sakuma@fnal.gov>
from AlphaTwirl.ProgressBar import ProgressBar, ProgressBar2, MPProgressMonitor, ProgressReport
from AlphaTwirl.EventReader import MPEventLoopRunner
import time, random
##____________________________________________________________________________||
class EventLoop(... | #!/usr/bin/env python
# Tai Sakuma <sakuma@fnal.gov>
from AlphaTwirl.ProgressBar import ProgressBar, MPProgressMonitor, ProgressReport
from AlphaTwirl.EventReader import MPEventLoopRunner
import time, random
##____________________________________________________________________________||
class EventLoop(object):
d... | bsd-3-clause | Python |
f8bd4073beb50f9fb750170e79804d13ea50db0b | update example | ericdill/bluesky,ericdill/bluesky | examples/raster_mesh.py | examples/raster_mesh.py | from bluesky.examples import Mover, SynGauss, Syn2DGauss
import bluesky.plans as bp
import bluesky.spec_api as bsa
import bluesky.callbacks
from bluesky.standard_config import gs
import bluesky.qt_kicker
bluesky.qt_kicker.install_qt_kicker()
# motors
theta = Mover('theta', ['theta'])
gamma = Mover('gamma', ['gamma'])
... | from bluesky.examples import Mover, SynGauss, Syn2DGauss
import bluesky.simple_scans as bss
import bluesky.spec_api as bsa
import bluesky.callbacks
from bluesky.standard_config import gs
import bluesky.qt_kicker
# motors
theta = Mover('theta', ['theta'])
gamma = Mover('gamma', ['gamma'])
# synthetic detectors coupled... | bsd-3-clause | Python |
f8bb295bf1d10410d36a8a8880ff96303bbda451 | Update announcements.py | Boijangle/GroupMe-Message-Bot | announcements.py | announcements.py | import sys
import icalendar
import requests
import pytz
from datetime import datetime, timedelta
from libs import post_text
from icalendar import Calendar
from database import find_bot_nname
import re
r = requests.get(sys.argv[2])
icsData = r.text
cal = Calendar.from_ical(icsData)
for evt in cal.subcomponents:
p... | import sys
import icalendar
import requests
import pytz
from datetime import datetime, timedelta
from libs import post_text
from icalendar import Calendar
from database import find_bot_nname
import re
r = requests.get(sys.argv[2])
icsData = r.text
cal = Calendar.from_ical(icsData)
for evt in cal.subcomponents:
p... | mit | Python |
c5e13436d7d453bd851e39591f82e2ef0d740d92 | Fix typo | pyfarm/pyfarm-master,pyfarm/pyfarm-master,pyfarm/pyfarm-master | pyfarm/scheduler/celery_app.py | pyfarm/scheduler/celery_app.py | # No shebang line, this module is meant to be imported
#
# Copyright 2014 Ambient Entertainment GmbH & Co. KG
#
# 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/lice... | # No shebang line, this module is meant to be imported
#
# Copyright 2014 Ambient Entertainment GmbH & Co. KG
#
# 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/lice... | apache-2.0 | Python |
f755f9857020cfceaeb3cf9607e96cef66ccb048 | update dev version after 0.21.1 tag [skip ci] | desihub/desitarget,desihub/desitarget | py/desitarget/_version.py | py/desitarget/_version.py | __version__ = '0.21.1.dev2037'
| __version__ = '0.21.1'
| bsd-3-clause | Python |
47527996fe967d8ef713ff8814f71d49ab539fd8 | update version | albertfxwang/grizli | grizli/version.py | grizli/version.py | # git describe --tags
__version__ = "0.6.0-109-g647e4b4"
| # git describe --tags
__version__ = "0.6.0-86-g140db75"
| mit | Python |
b493082352de19ed8d3d52c8eda838064957bbc2 | bump version to 1.2-BETA2 | mirek2580/namebench | libnamebench/version.py | libnamebench/version.py | VERSION = '1.2-BETA2'
| VERSION = '1.2-BETA1'
| apache-2.0 | Python |
19cfe70c69b026429454fb8361ec3e8d6f1a0505 | add show/hide requested signals | zwadar/pyqode.core,pyQode/pyqode.core,pyQode/pyqode.core | pyqode/core/widgets/preview.py | pyqode/core/widgets/preview.py | """
This module contains a widget that can show the html preview of an
editor.
"""
from weakref import proxy
from pyqode.qt import QtCore, QtWebWidgets
from pyqode.core.api import DelayJobRunner
class HtmlPreviewWidget(QtWebWidgets.QWebView):
hide_requested = QtCore.Signal()
show_requested = QtCore.Signal()
... | """
This module contains a widget that can show the html preview of an
editor.
"""
from weakref import proxy
from pyqode.qt import QtCore, QtWebWidgets
from pyqode.core.api import DelayJobRunner
class HtmlPreviewWidget(QtWebWidgets.QWebView):
def __init__(self, parent=None):
super(HtmlPreviewWidget, self)... | mit | Python |
d428bb582c6fe71e39bdedfbed1b355421f48139 | Fix that | MPjct/PyMP | src/mysql_proto/com/stmt/prepare.py | src/mysql_proto/com/stmt/prepare.py | #!/usr/bin/env python
# coding=utf-8
from packet import Packet
from proto import Proto
from flags import Flags
class Prepare(Packet):
query = ""
def getPayload(self):
payload = bytearray()
payload.extend(Proto.build_byte(Flags.COM_STMT_PREPARE))
payload.extend(Proto.build... | #!/usr/bin/env python
# coding=utf-8
from packet import Packet
from proto import Proto
from flags import Flags
class Prepare(Packet):
query = ""
def getPayload(self):
payload = bytearray()
payload.extend(Proto.build_byte(Flags.COM_STMT_PREPARE))
payload.extend(Proto.build... | mit | Python |
76611b7e6e97089b93626b472f91c04f16644034 | Fix up some comments | raphael-boucher/channels,andrewgodwin/channels,raiderrobert/channels,andrewgodwin/django-channels,django/channels,Coread/channels,Krukov/channels,Coread/channels,linuxlewis/channels,Krukov/channels | channels/management/commands/runserver.py | channels/management/commands/runserver.py | import threading
from django.core.management.commands.runserver import \
Command as RunserverCommand
from channels import DEFAULT_CHANNEL_LAYER, channel_layers
from channels.handler import ViewConsumer
from channels.log import setup_logger
from channels.worker import Worker
class Command(RunserverCommand):
... | import threading
from django.core.management.commands.runserver import \
Command as RunserverCommand
from channels import DEFAULT_CHANNEL_LAYER, channel_layers
from channels.handler import ViewConsumer
from channels.log import setup_logger
from channels.worker import Worker
class Command(RunserverCommand):
... | bsd-3-clause | Python |
e451ea4d698450813bd11fed6b501b839cd477a6 | Reformat runworker a bit | raiderrobert/channels,raphael-boucher/channels,Coread/channels,Krukov/channels,andrewgodwin/django-channels,Krukov/channels,linuxlewis/channels,django/channels,Coread/channels,andrewgodwin/channels | channels/management/commands/runworker.py | channels/management/commands/runworker.py | from __future__ import unicode_literals
from django.core.management import BaseCommand, CommandError
from channels import DEFAULT_CHANNEL_LAYER, channel_layers
from channels.log import setup_logger
from channels.worker import Worker
class Command(BaseCommand):
leave_locale_alone = True
def add_arguments(s... | from __future__ import unicode_literals
from django.core.management import BaseCommand, CommandError
from channels import DEFAULT_CHANNEL_LAYER, channel_layers
from channels.log import setup_logger
from channels.worker import Worker
class Command(BaseCommand):
leave_locale_alone = True
def add_arguments(s... | bsd-3-clause | Python |
596f9752a7956c259217b0528bed924812d0631f | Add admin filter to filter attendees with children. | pysv/djep,EuroPython/djep,pysv/djep,zerok/pyconde-website-mirror,zerok/pyconde-website-mirror,zerok/pyconde-website-mirror,EuroPython/djep,pysv/djep,EuroPython/djep,pysv/djep,EuroPython/djep,pysv/djep | pyconde/accounts/admin.py | pyconde/accounts/admin.py | from django.contrib import admin
from django.contrib.admin import SimpleListFilter
from . import models
class WithChildrenFilter(SimpleListFilter):
title = 'Anzahl Kinder'
parameter_name = 'children'
def lookups(self, request, model_admin):
return (('y', 'mit Kindern'),
('n', 'oh... | from django.contrib import admin
from . import models
admin.site.register(models.Profile,
list_display=['user'])
| bsd-3-clause | Python |
1b5b43542fe3ba8f85076c6b6cb1e98a4614a0c6 | reformat JobGroup to match other tables | pyfarm/pyfarm-master,pyfarm/pyfarm-master,pyfarm/pyfarm-master | pyfarm/models/jobgroup.py | pyfarm/models/jobgroup.py | # No shebang line, this module is meant to be imported
#
# Copyright 2015 Ambient Entertainment GmbH & Co. KG
# Copyright 2015 Oliver Palmer
#
# 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
#
... | # No shebang line, this module is meant to be imported
#
# Copyright 2015 Ambient Entertainment GmbH & Co. KG
#
# 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/lice... | apache-2.0 | Python |
f4106e3025c5dbb3136db94081b9998a052c8e70 | Bump version to 2.0.0-alpha2 | pyQode/pyqode.python,pyQode/pyqode.python,zwadar/pyqode.python,mmolero/pyqode.python | pyqode/python/__init__.py | pyqode/python/__init__.py | # -*- coding: utf-8 -*-
"""
pyqode.python is an extension of pyqode.core that brings support
for the python programming language. It does so by providing a set
of additional modes and panels for the frontend and by supplying
dedicated workers for the backend.
"""
__version__ = "2.0.0-alpha2"
| # -*- coding: utf-8 -*-
"""
pyqode.python is an extension of pyqode.core that brings support
for the python programming language. It does so by providing a set
of additional modes and panels for the frontend and by supplying
dedicated workers for the backend.
"""
__version__ = "2.0.0-alpha1"
| mit | Python |
d96aac74b32a166ec724234540dc93a8ea526a3f | fix test error in windows | PyThaiNLP/pythainlp | pythainlp/tag/__init__.py | pythainlp/tag/__init__.py | # -*- coding: utf-8 -*-
# TODO ปรับ API ให้เหมือน nltk
from __future__ import absolute_import,division,print_function,unicode_literals
import sys
def pos_tag(text,engine='old'):
"""
ระบบ postaggers
pos_tag(text,engine='old')
engine ที่รองรับ
* old เป็น UnigramTagger
* artagger เป็น RDR POS Tagger
"""
if engin... | # -*- coding: utf-8 -*-
# TODO ปรับ API ให้เหมือน nltk
from __future__ import absolute_import,division,print_function,unicode_literals
import sys
def pos_tag(text,engine='old'):
"""
ระบบ postaggers
pos_tag(text,engine='old')
engine ที่รองรับ
* old เป็น UnigramTagger
* artagger เป็น RDR POS Tagger
"""
if engin... | apache-2.0 | Python |
adb0c2bd97c6c4ca7272d764b669cef90f81a5bb | Allow non-dev logins to dev builds | mrozekma/Sprint,mrozekma/Sprint,mrozekma/Sprint | handlers/login.py | handlers/login.py | from rorn.Box import LoginBox, ErrorBox, WarningBox, SuccessBox
from rorn.Session import delay
from User import User
from Button import Button
from LoadValues import isDevMode
from Event import Event
from utils import *
@get('login')
def login(handler, request):
handler.title('Login')
if handler.session['user']:
... | from rorn.Box import LoginBox, ErrorBox, WarningBox, SuccessBox
from rorn.Session import delay
from User import User
from Button import Button
from LoadValues import isDevMode
from Event import Event
from utils import *
@get('login')
def login(handler, request):
handler.title('Login')
if handler.session['user']:
... | mit | Python |
64713296cf4f4f3772a1ac23248d4fb930ee23ff | Bump to 0.3 | cogniteev/python-gdrive | python_gdrive/__init__.py | python_gdrive/__init__.py | from client import GoogleDrive
__version__ = '0.3'
| from client import GoogleDrive
__version__ = '0.3-dev'
| apache-2.0 | Python |
3475aee89ef5b22a92a674400ea37430f8255924 | handle Appengine Datastore Key Type | hudora/huTools | huTools/hujson.py | huTools/hujson.py | #!/usr/bin/env python
# encoding: utf-8
"""
hujson.py - extended json - tries to be compatible with simplejson
hujson can encode additional types like decimal and datetime into valid json.
All the heavy lifting is done by John Millikin's `jsonlib`, see
https://launchpad.net/jsonlib
Created by Maximillian Dornseif on ... | #!/usr/bin/env python
# encoding: utf-8
"""
hujson.py - extended json - tries to be compatible with simplejson
hujson can encode additional types like decimal and datetime into valid json.
All the heavy lifting is done by John Millikin's `jsonlib`, see
https://launchpad.net/jsonlib
Created by Maximillian Dornseif on ... | bsd-3-clause | Python |
530844a16a573ab49850a22631f97d8ad89465c9 | Clean Up NLU state | WalkingMachine/sara_behaviors,WalkingMachine/sara_behaviors | sara_flexbe_states/src/sara_flexbe_states/sara_nlu_spr.py | sara_flexbe_states/src/sara_flexbe_states/sara_nlu_spr.py | #!/usr/bin/env python
# encoding=utf8
from __future__ import print_function
from flexbe_core import EventState, Logger
import rospy
from wm_nlu.srv import AnswerQuestion
from std_msgs.msg import String
class SaraNLUspr(EventState):
'''
Use wm_nlu to parse a sentence and return the answer.
># sentence ... | #!/usr/bin/env python
# encoding=utf8
from __future__ import print_function
from flexbe_core import EventState, Logger
import rospy
import re
from wm_nlu.srv import AnswerQuestion
from std_msgs.msg import String
class SaraNLUspr(EventState):
'''
Use wm_nlu to parse a sentence and return the detected actions i... | bsd-3-clause | Python |
142d3ebf66e31aad2363fc0c421dc573dc9b1157 | Simplify current_service() function | scikit-build/scikit-ci | ci/utils.py | ci/utils.py | # -*- coding: utf-8 -*-
"""This module defines functions generally useful in scikit-ci."""
import os
try:
from .constants import SERVICES, SERVICES_ENV_VAR
except (SystemError, ValueError):
from constants import SERVICES, SERVICES_ENV_VAR
def current_service():
for service, env_var in SERVICES_ENV_VAR.... | # -*- coding: utf-8 -*-
"""This module defines functions generally useful in scikit-ci."""
import os
try:
from .constants import SERVICES, SERVICES_ENV_VAR
except (SystemError, ValueError):
from constants import SERVICES, SERVICES_ENV_VAR
def current_service():
for service in SERVICES.keys():
i... | apache-2.0 | Python |
89766874e7ef17bdce4cfa7cae9898336928c19e | Remove satellites from JSON | BrodaNoel/bropy,BrodaNoel/bropy | modules/gy-gps6mv1/core/get.py | modules/gy-gps6mv1/core/get.py | #! /usr/bin/python
# Written by Dan Mandle http://dan.mandle.me September 2012
# Modified by Broda Noel @brodanoel (in all social networks)
# License: GPL 2.0
from gps import *
from time import *
import time
import threading
import sys
gpsd = None #seting the global variable
class GpsPoller(threading.Thread):
def ... | #! /usr/bin/python
# Written by Dan Mandle http://dan.mandle.me September 2012
# Modified by Broda Noel @brodanoel (in all social networks)
# License: GPL 2.0
from gps import *
from time import *
import time
import threading
import sys
gpsd = None #seting the global variable
class GpsPoller(threading.Thread):
def ... | mit | Python |
3685715cd260f4f5ca392caddf7fb0c01af9ebcc | Add in comments for orgs and places too, remove limit | mysociety/pombola,Hutspace/odekro,ken-muturi/pombola,mysociety/pombola,Hutspace/odekro,patricmutwiri/pombola,geoffkilpin/pombola,patricmutwiri/pombola,mysociety/pombola,ken-muturi/pombola,ken-muturi/pombola,ken-muturi/pombola,mysociety/pombola,mysociety/pombola,patricmutwiri/pombola,geoffkilpin/pombola,geoffkilpin/pomb... | mzalendo/comments2/feeds.py | mzalendo/comments2/feeds.py | from disqus.wxr_feed import ContribCommentsWxrFeed
# from comments2.models import Comment
from core.models import Person, Place, Organisation
# http://help.disqus.com/customer/portal/articles/472150-custom-xml-import-format
class CommentWxrFeed(ContribCommentsWxrFeed):
link = "/"
def items(self):
li... | from disqus.wxr_feed import ContribCommentsWxrFeed
# from comments2.models import Comment
from core.models import Person
# http://help.disqus.com/customer/portal/articles/472150-custom-xml-import-format
class CommentWxrFeed(ContribCommentsWxrFeed):
link = "/"
def items(self):
return Person.objects.a... | agpl-3.0 | Python |
fe998a48be769f6a957611584145706b71385cc9 | Fix airflow jobs check cmd for TriggererJob (#19185) | nathanielvarona/airflow,lyft/incubator-airflow,cfei18/incubator-airflow,apache/incubator-airflow,danielvdende/incubator-airflow,bolkedebruin/airflow,bolkedebruin/airflow,nathanielvarona/airflow,apache/airflow,Acehaidrey/incubator-airflow,bolkedebruin/airflow,Acehaidrey/incubator-airflow,Acehaidrey/incubator-airflow,apa... | airflow/jobs/__init__.py | airflow/jobs/__init__.py | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 | Python |
d266de64cbcc7ed8672e9bb61cdb966870fccfdc | Use random.choice() & reduce len() duplication | bowen0701/algorithms_data_structures | alg_percentile_select.py | alg_percentile_select.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import random
def percentile_select(ls, k):
"""Kth percentile selection algorithm.
Just select the kth element, without caring about
the relative ordering of the rest of them.
The algorithm per... | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import random
def percentile_select(ls, k):
"""Kth percentile selection algorithm.
Just select the kth element, without caring about
the relative ordering of the rest of them.
The algorithm per... | bsd-2-clause | Python |
d1c16f90ca86bc1bd11a81f021d8317a82902a69 | print annotation | varnish/varnish-microservice-monitor,varnish/zipnish,varnish/zipnish,varnish/zipnish,varnish/zipnish,varnish/varnish-microservice-monitor,varnish/varnish-microservice-monitor,varnish/zipnish,varnish/varnish-microservice-monitor,varnish/varnish-microservice-monitor | ui/app/models.py | ui/app/models.py | from . import db
class Spans(db.Model):
__tablename__ = 'zipkin_spans'
span_id = db.Column(db.Integer)
parent_id = db.Column(db.Integer)
trace_id = db.Column(db.Integer)
span_name = db.Column(db.String(255))
debug = db.Column(db.Integer)
duration = db.Column(db.Integer)
created_ts = db.... | from . import db
class Spans(db.Model):
__tablename__ = 'zipkin_spans'
span_id = db.Column(db.Integer)
parent_id = db.Column(db.Integer)
trace_id = db.Column(db.Integer)
span_name = db.Column(db.String(255))
debug = db.Column(db.Integer)
duration = db.Column(db.Integer)
created_ts = db.... | bsd-2-clause | Python |
b38555ff465f59333f32c2bb556f6b7a236e288b | disable traceview for now | rsalmond/seabus,rsalmond/seabus,rsalmond/seabus,rsalmond/seabus,rsalmond/seabus | seabus/web/web.py | seabus/web/web.py | from flask import Flask
import oboe
from oboeware import OboeMiddleware
from seabus.web.blueprint import blueprint
from seabus.common.database import db
from seabus.web.socketio import socketio
def create_app(config=None):
app = Flask(__name__)
if config is not None:
app.config.from_object('seabus.web... | from flask import Flask
import oboe
from oboeware import OboeMiddleware
from seabus.web.blueprint import blueprint
from seabus.common.database import db
from seabus.web.socketio import socketio
def create_app(config=None):
app = Flask(__name__)
if config is not None:
app.config.from_object('seabus.web... | mit | Python |
b5241e62cb7cc09b5d469f1cf3908fa1d7cedc21 | Tweak the settings. | openspending/gobble | gobble/settings.py | gobble/settings.py | """User configurable settings"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from future import standard_library
standard_library.install_aliases()
from os import getenv
from logging import DEBUG, INFO
from os.pa... | """User configurable settings"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from future import standard_library
standard_library.install_aliases()
from os import getenv
from logging import DEBUG, INFO
from os.pa... | mit | Python |
2050017ced613f5c0282dcfaf07494b8dbcc8e41 | Update ipc_lista2.05.py | any1m1c/ipc20161 | lista2/ipc_lista2.05.py | lista2/ipc_lista2.05.py | #ipc_lista2.05
#Professor: Jucimar Junior
#Any Mendes Carvalho - 1615310044
#
#
#
#
#Faça um programa para a leitura de duas notas parciais de um aluno. O programa deve calcular a média alcançada por aluno e apresentar:
#--A mensagem "Aprovado", se a média alcançada for maior ou igual a sete;
#--A mensagem "Reprovado"... | #ipc_lista2.05
#Professor: Jucimar Junior
#Any Mendes Carvalho - 1615310044
#
#
#
#
#Faça um programa para a leitura de duas notas parciais de um aluno. O programa deve calcular a média alcançada por aluno e apresentar:
#--A mensagem "Aprovado", se a média alcançada for maior ou igual a sete;
#--A mensagem "Reprovado"... | apache-2.0 | Python |
f3da1fab9af2279182a09922aae00fcee73a92ee | Fix imports for Django >= 1.6 | andialbrecht/django-goog | goog/middleware.py | goog/middleware.py | from django.conf import settings
try:
from django.conf.urls.defaults import patterns, include
except ImportError: # Django >= 1.6
from django.conf.urls import patterns, include
import goog.urls
from goog import utils
class GoogDevelopmentMiddleware(object):
def devmode_enabled(self, request):
""... | from django.conf import settings
from django.conf.urls.defaults import patterns, include
import goog.urls
from goog import utils
class GoogDevelopmentMiddleware(object):
def devmode_enabled(self, request):
"""Returns True iff the devmode is enabled."""
return utils.is_devmode()
def process_r... | bsd-3-clause | Python |
91178909bab31e9db42d86d5783152890f65795d | update cms | hayashizakitakaaki/Introduction_mysite,hayashizakitakaaki/Introduction_mysite,hayashizakitakaaki/Introduction_mysite | cms/urls.py | cms/urls.py | from django.conf.urls import url
from cms import views
from django.contrib.auth import views as auth_views
urlpatterns = [
# 一覧
url(r'^dailyreport/$', views.daily_list, name='daily_list'),
# 日報操作
url(r'^dailyreport/add/$', views.daily_edit, name='daily_add'), # 登録
url(r'^dailyreport/mod/(?P<daily_... | from django.conf.urls import url
from cms import views
from django.contrib.auth import views as auth_views
urlpatterns = [
# 一覧
url(r'^dailyreport/$', views.daily_list, name='daily_list'),
# 日報操作
url(r'^dailyreport/add/$', views.daily_edit, name='daily_add'), # 登録
url(r'^dailyreport/mod/(?P<daily_... | mit | Python |
1212966326eb096e10b52277b0c6b53126262e3b | Improve messages in example | tysonholub/twilio-python,twilio/twilio-python | examples/basic_usage.py | examples/basic_usage.py | import os
from twilio.twiml import Response
from twilio.rest import Client
ACCOUNT_SID = os.environ.get('TWILIO_ACCOUNT_SID')
AUTH_TOKEN = os.environ.get('TWILIO_AUTH_TOKEN')
def example():
"""
Some example usage of different twilio resources.
"""
client = Client(ACCOUNT_SID, AUTH_TOKEN)
# Get... | import os
from twilio.twiml import Response
from twilio.rest import Client
ACCOUNT_SID = os.environ.get('TWILIO_ACCOUNT_SID')
AUTH_TOKEN = os.environ.get('TWILIO_AUTH_TOKEN')
def example():
"""
Some example usage of different twilio resources.
"""
client = Client(ACCOUNT_SID, AUTH_TOKEN)
print... | mit | Python |
5ab3f3d06216381b697781d80069354745110de1 | make yaml put out unicode | adamgot/python-plexlibrary | plexlibrary/utils.py | plexlibrary/utils.py | # -*- coding: utf-8 -*-
import yaml
from yaml import Loader, SafeLoader
class Colors(object):
RED = "\033[1;31m"
BLUE = "\033[1;34m"
CYAN = "\033[1;36m"
GREEN = "\033[0;32m"
RESET = "\033[0;0m"
BOLD = "\033[;1m"
REVERSE = "\033[;7m"
class YAMLBase(object):
def __init__(self, filenam... | # -*- coding: utf-8 -*-
import yaml
class Colors(object):
RED = "\033[1;31m"
BLUE = "\033[1;34m"
CYAN = "\033[1;36m"
GREEN = "\033[0;32m"
RESET = "\033[0;0m"
BOLD = "\033[;1m"
REVERSE = "\033[;7m"
class YAMLBase(object):
def __init__(self, filename):
with open(filename, 'r')... | bsd-3-clause | Python |
201a9d75e9c4a2c84372fe58a674977f2435130f | update fastapi example. | honeybadger-io/honeybadger-python,honeybadger-io/honeybadger-python | examples/fastapi/app.py | examples/fastapi/app.py | from fastapi import FastAPI, HTTPException, APIRouter
from honeybadger import honeybadger, contrib
import pydantic
honeybadger.configure(api_key='c10787cf')
app = FastAPI(title="Honeybadger - FastAPI.")
app.add_middleware(contrib.ASGIHoneybadger, params_filters=["client"])
@app.get("/raise_some_error", tags=["Notify... | from fastapi import FastAPI, HTTPException, APIRouter
from honeybadger import honeybadger, contrib
from honeybadger.contrib import asgi
from honeybadger.contrib import fastapi
import pydantic
honeybadger.configure(api_key='c10787cf')
app = FastAPI()
# contrib.FastAPIHoneybadger(app)
app.add_middleware(asgi.ASGIHoneyb... | mit | Python |
ba084db6c16e5dee9e9ff06a3bee02f4dbfb5c82 | Add environment variable to control use of UNIX socket proxying | Metaswitch/powerstrip,Metaswitch/powerstrip | powerstrip.tac | powerstrip.tac | import os
from twisted.application import service, internet
#from twisted.protocols.policies import TrafficLoggingFactory
from urlparse import urlparse
from powerstrip.powerstrip import ServerProtocolFactory
application = service.Application("Powerstrip")
DOCKER_HOST = os.environ.get('DOCKER_HOST')
ENABLE_UNIX_SOCKE... | import os
from twisted.application import service, internet
#from twisted.protocols.policies import TrafficLoggingFactory
from urlparse import urlparse
from powerstrip.powerstrip import ServerProtocolFactory
application = service.Application("Powerstrip")
DOCKER_HOST = os.environ.get('DOCKER_HOST')
if DOCKER_HOST is... | apache-2.0 | Python |
33e693337ab646eaccb724b9c4b3eb3352c6e412 | fix pagination | makinacorpus/django-mapentity,makinacorpus/django-mapentity,makinacorpus/django-mapentity | mapentity/pagination.py | mapentity/pagination.py | from rest_framework_datatables.pagination import DatatablesPageNumberPagination
class MapentityDatatablePagination(DatatablesPageNumberPagination):
""" Custom datatable pagination for Mapentity list views. """
pass
# def get_count_and_total_count(self, queryset, view):
# """ Handle count for all f... | from rest_framework_datatables.pagination import DatatablesPageNumberPagination
class MapentityDatatablePagination(DatatablesPageNumberPagination):
""" Custom datatable pagination for Mapentity list views. """
def get_count_and_total_count(self, queryset, view):
""" Handle count for all filters """
... | bsd-3-clause | Python |
c7679393ae11766cc9da4474f4db1d0dbe50ac91 | Bump to 0.11.0 | mwarkentin/django-watchman,JBKahn/django-watchman,mwarkentin/django-watchman,JBKahn/django-watchman | watchman/__init__.py | watchman/__init__.py | __version__ = '0.11.0'
| __version__ = '0.10.1'
| bsd-3-clause | Python |
815fecf36f9c0114a9aa8594b58226ead223b313 | fix type bug | tstringer/pypic,tstringer/pypic | app/app.py | app/app.py | """Do work"""
import argparse
import logging
import os
import sys
from cameracontroller.cameracontroller import CameraController
from storage.cloudstorage import CloudStorage
logger = logging.getLogger('pypic')
log_dir = os.path.expanduser('~/log')
if not os.path.exists(log_dir):
os.makedirs(log_dir)
logging.bas... | """Do work"""
import argparse
import logging
import os
import sys
from cameracontroller.cameracontroller import CameraController
from storage.cloudstorage import CloudStorage
logger = logging.getLogger('pypic')
log_dir = os.path.expanduser('~/log')
if not os.path.exists(log_dir):
os.makedirs(log_dir)
logging.bas... | mit | Python |
b0dd7879fbf2000c86a2f77995495d480c890713 | Add search by location | predicthq/sdk-py | usecases/events/search_by_location.py | usecases/events/search_by_location.py | from predicthq import Client
# Please copy paste your access token here
# or read our Quickstart documentation if you don't have a token yet
# https://developer.predicthq.com/guides/quickstart/
ACCESS_TOKEN = 'abc123'
phq = Client(access_token=ACCESS_TOKEN)
# The events endpoint supports three types of search by lo... | from predicthq import Client
# Please copy paste your access token here
# or read our Quickstart documentation if you don't have a token yet
# https://developer.predicthq.com/guides/quickstart/
ACCESS_TOKEN = 'abc123'
phq = Client(access_token=ACCESS_TOKEN)
| mit | Python |
997cd53d1d045840118876227b9c5588e153195b | fix not equal override. thanks @hodgestar | universalcore/unicore-cms,universalcore/unicore-cms,universalcore/unicore-cms | cms/models.py | cms/models.py | import re
import unicodedata
RE_NUMERICAL_SUFFIX = re.compile(r'^[\w-]*-(\d+)+$')
from gitmodel import fields, models
class FilterMixin(object):
@classmethod
def filter(cls, **fields):
items = list(cls.all())
for field, value in fields.items():
if hasattr(cls, field):
... | import re
import unicodedata
RE_NUMERICAL_SUFFIX = re.compile(r'^[\w-]*-(\d+)+$')
from gitmodel import fields, models
class FilterMixin(object):
@classmethod
def filter(cls, **fields):
items = list(cls.all())
for field, value in fields.items():
if hasattr(cls, field):
... | bsd-2-clause | Python |
dbfb095f6b90c2517416652d53b6db6b5ee919a4 | Bump version | vmihailenco/fabdeploy | fabdeploy/__init__.py | fabdeploy/__init__.py | VERSION = (0, 3, 4, 'final', 0)
def get_version():
version = '%s.%s' % (VERSION[0], VERSION[1])
if VERSION[2]:
version = '%s.%s' % (version, VERSION[2])
if VERSION[3:] == ('alpha', 0):
version = '%s pre-alpha' % version
else:
if VERSION[3] != 'final':
version = '%s ... | VERSION = (0, 3, 3, 'final', 0)
def get_version():
version = '%s.%s' % (VERSION[0], VERSION[1])
if VERSION[2]:
version = '%s.%s' % (version, VERSION[2])
if VERSION[3:] == ('alpha', 0):
version = '%s pre-alpha' % version
else:
if VERSION[3] != 'final':
version = '%s ... | bsd-3-clause | Python |
dc49ce292d4e0669598abb7f45ba389efde0dabc | Fix testTeleopPanel | manuelli/director,RobotLocomotion/director,openhumanoids/director,manuelli/director,patmarion/director,patmarion/director,mitdrc/director,mitdrc/director,RobotLocomotion/director,mitdrc/director,mitdrc/director,openhumanoids/director,manuelli/director,patmarion/director,openhumanoids/director,mitdrc/director,RobotLocom... | src/python/tests/testTeleopPanel.py | src/python/tests/testTeleopPanel.py | from director import robotsystem
from director.consoleapp import ConsoleApp
from director import transformUtils
from director import visualization as vis
from director import objectmodel as om
from director import teleoppanel
from director import playbackpanel
from director import planningutils
from PythonQt import Qt... | from director import robotsystem
from director.consoleapp import ConsoleApp
from director import transformUtils
from director import visualization as vis
from director import objectmodel as om
from director import teleoppanel
from director import playbackpanel
from PythonQt import QtCore, QtGui
import numpy as np
d... | bsd-3-clause | Python |
0d056e041f141391b115aef1f1cc5aa684876535 | save signature saliency | rafaelolg/salienpy | view_saliency.py | view_saliency.py | #!/usr/bin/env python
import cv2
import numpy
import sys
import salienpy.frequency_tuned
import salienpy.signature
def main(img):
cv2.imshow('Original Image', img)
ftuned = salienpy.frequency_tuned.frequency_tuned_saliency(img)
cv2.imshow('Frequency Tuned', ftuned)
signa = salienpy.signature.signature_... | #!/usr/bin/env python
import cv2
import numpy
import sys
import salienpy.frequency_tuned
import salienpy.signature
def main(img):
cv2.imshow('Original Image', img)
ftuned = salienpy.frequency_tuned.frequency_tuned_saliency(img)
cv2.imshow('Frequency Tuned', ftuned)
signa = salienpy.signature.signature_... | mit | Python |
28968ca117fc18dfe513c06ce4ead2295830fd94 | remove redundant parenthesis | morgenst/pyfluka | plugins/BasePlugin.py | plugins/BasePlugin.py | __author__ = 'marcusmorgenstern'
__mail__ = ''
from abc import ABCMeta, abstractmethod
class BasePlugin:
"""
Metaclass for guarantee of interface. Each plugin must provide initialisation taking optional configuration
and invoke method taking data
"""
__metaclass__ = ABCMeta
def __init__(sel... | __author__ = 'marcusmorgenstern'
__mail__ = ''
from abc import ABCMeta, abstractmethod
class BasePlugin():
"""
Metaclass for guarantee of interface. Each plugin must provide initialisation taking optional configuration
and invoke method taking data
"""
__metaclass__ = ABCMeta
def __init__(s... | mit | Python |
79e2044380d2d5a9568b76777bc7b1950dcaaeb8 | Bump version to 14.1.0 | hhursev/recipe-scraper | recipe_scrapers/__version__.py | recipe_scrapers/__version__.py | __version__ = "14.1.0"
| __version__ = "14.0.0"
| mit | Python |
7009e1f0b316da5f17247786810676f70d282f93 | Add assertion.__all__ | raviqqe/tensorflow-extenteten,raviqqe/tensorflow-extenteten | extenteten/assertion.py | extenteten/assertion.py | import collections
import numpy
import tensorflow as tf
from .util import func_scope
__all__ = [
'is_int',
'is_natural_num',
'is_natural_num_sequence',
'is_sequence',
'assert_no_nan',
]
def is_int(num):
return (isinstance(num, int)
or isinstance(num, numpy.integer)
o... | import collections
import numpy
import tensorflow as tf
from .util import func_scope
def is_int(num):
return (isinstance(num, int)
or isinstance(num, numpy.integer)
or (isinstance(num, numpy.ndarray)
and num.ndim == 0
and issubclass(num.dtype.type, numpy.in... | unlicense | Python |
0f34d5d685c844dbf1fca2cf60b27d75726fa14b | Adjust internal imports | oemof/feedinlib | feedinlib/__init__.py | feedinlib/__init__.py | __copyright__ = "Copyright oemof developer group"
__license__ = "MIT"
__version__ = '0.1.0rc3'
from .powerplants import Photovoltaic, WindPowerPlant
from .models import (
Pvlib,
WindpowerlibTurbine,
WindpowerlibTurbineCluster,
get_power_plant_data,
)
from . import era5
| __copyright__ = "Copyright oemof developer group"
__license__ = "MIT"
__version__ = '0.1.0rc3'
from feedinlib.powerplants import Photovoltaic, WindPowerPlant
from feedinlib.models import (
Pvlib,
WindpowerlibTurbine,
WindpowerlibTurbineCluster,
get_power_plant_data,
)
| mit | Python |
3876130a94f3a43a6b34dd3be22ef963238bda3b | fix migration | gpodder/mygpo,gpodder/mygpo,gpodder/mygpo,gpodder/mygpo | mygpo/usersettings/migrations/0002_move_existing.py | mygpo/usersettings/migrations/0002_move_existing.py | import json
from django.db import migrations
def move_podcastsettings(apps, schema_editor):
PodcastConfig = apps.get_model("subscriptions", "PodcastConfig")
UserSettings = apps.get_model("usersettings", "UserSettings")
ContentType = apps.get_model('contenttypes', 'ContentType')
for cfg in PodcastCo... | import json
from django.db import migrations
from django.contrib.contenttypes.models import ContentType
def move_podcastsettings(apps, schema_editor):
PodcastConfig = apps.get_model("subscriptions", "PodcastConfig")
UserSettings = apps.get_model("usersettings", "UserSettings")
for cfg in PodcastConfig.... | agpl-3.0 | Python |
b410cbc1d58c5dce85b1bdff85fa881de58bf299 | fix BadArgument | Naught0/qtbot | cogs/error.py | cogs/error.py | #!/bin/env python
from discord.ext.commands import errors
import sys
import traceback
class ErrorHandler:
def __init__(self, bot):
self.bot = bot
async def on_command_error(self, ctx, error):
""" Handle command errors more gracefully """
if isinstance(error, errors.CommandNotFound):... | #!/bin/env python
from discord.ext.commands import errors
import sys
import traceback
class ErrorHandler:
def __init__(self, bot):
self.bot = bot
async def on_command_error(self, ctx, error):
""" Handle command errors more gracefully """
if isinstance(error, errors.CommandNotFound):... | mit | Python |
1a83696454d5be09b07d1e1e6a23ea76c77012a9 | Fix global imports | jvivian/rnaseq-lib,jvivian/rnaseq-lib | src/rnaseq_lib/__init__.py | src/rnaseq_lib/__init__.py | import rnaseq_lib.civic
import rnaseq_lib.data
import rnaseq_lib.diff_exp
import rnaseq_lib.dim_red
import rnaseq_lib.docker
import rnaseq_lib.drugs
import rnaseq_lib.graphs
import rnaseq_lib.gtf
import rnaseq_lib.images
import rnaseq_lib.plot
import rnaseq_lib.plot.dr
import rnaseq_lib.plot.hview
import rnaseq_lib.ti... | import rnaseq_lib.R
import rnaseq_lib.civic
import rnaseq_lib.data
import rnaseq_lib.de
import rnaseq_lib.dim_red
import rnaseq_lib.docker
import rnaseq_lib.drugs
import rnaseq_lib.graphs
import rnaseq_lib.gtf
import rnaseq_lib.images
import rnaseq_lib.plotting
import rnaseq_lib.tissues
import rnaseq_lib.utils
import ... | mit | Python |
918a168b53e9f026393aaa17347fc855f7e4a70a | add background task, remove extra roles code, use .format | imsky/quickstart,imsky/quickstart | files/devops/fabfile.py | files/devops/fabfile.py | # Fabfile from Quickstart
# qkst.io/devops/fabfile
from fabric.api import (
task, parallel, roles,
run, local, sudo, put,
env, settings
)
from fabric.contrib.project import rsync_project
from fabric.context_managers import cd, prefix
from fabric.tasks import execute
env.hosts = ['root@localhost:22']
@t... | # Fabfile from Quickstart
# qkst.io/devops/fabfile
from fabric.api import (
task, parallel, roles,
run, local, sudo, put,
env, settings
)
from fabric.contrib.project import rsync_project
from fabric.context_managers import cd, prefix
from fabric.tasks import execute
env.user = 'root'
env.roledefs = {
... | mit | Python |
a4f69decb2b22822660033265a6517510c8a2eb5 | clean up some convert some strings to fstrings use fewer imports | mralext20/alex-bot | cogs/utils.py | cogs/utils.py | # -*- coding: utf-8 -*-
from discord.ext import commands
from datetime import datetime
from cogs.cog import Cog
import discord
class Utils(Cog):
"""The description for Utils goes here."""
@commands.command(name='reload', hidden=True)
@commands.is_owner()
async def cog_reload(self, ctx, *, cog: str):... | # -*- coding: utf-8 -*-
from discord.ext import commands
from datetime import datetime
from cogs.cog import Cog
import discord
class Utils(Cog):
"""The description for Utils goes here."""
@commands.command(name='reload', hidden=True)
@commands.is_owner()
async def cog_reload(self, ctx, *, cog: str):... | mit | Python |
ba81222c33b4b80c5148c21bb30c60412c85847b | Fix search query | syseleven/puppet-base,syseleven/puppet-base,syseleven/puppet-base,syseleven/puppet-base | files/kernel-cleanup.py | files/kernel-cleanup.py | #!/usr/bin/env python2.7
"""
kernel-cleanup.py
Find all installed kernel-related packages and mark them as automatically
installed. Then, purge those of these packages that APT now considers
auto-removable.
Ubuntu APT has logic that prevents us from removing all kernels this way.
As an additional safeguard, we always... | #!/usr/bin/env python2.7
"""
kernel-cleanup.py
Find all installed kernel-related packages and mark them as automatically
installed. Then, purge those of these packages that APT now considers
auto-removable.
Ubuntu APT has logic that prevents us from removing all kernels this way.
As an additional safeguard, we always... | apache-2.0 | Python |
1c17b4b10374129d9e26f7023a93ea587dfe7fc7 | update version number to 1.0.10-pre as prep for staging/release | mprefer/findingaids,emory-libraries/findingaids,mprefer/findingaids,emory-libraries/findingaids | findingaids/__init__.py | findingaids/__init__.py | __version_info__ = (1, 0, 10, 'pre')
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join(str(i) for i in __version_info__[:-1])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
#THIS IS DUPLICATE CODE FROM DWRANGLER AND SHOULD EVENTUALLY... | __version_info__ = (1, 0, 9, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join(str(i) for i in __version_info__[:-1])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
#THIS IS DUPLICATE CODE FROM DWRANGLER AND SHOULD EVENTUALLY B... | apache-2.0 | Python |
61e67ed5740148f74e67aef09afc65ef1c3fd6a8 | Handle commands in a very trivial way | bboe/hackday_bot,bboe/hackday_bot | hackday_bot/bot.py | hackday_bot/bot.py | """hackday_bot.bot module."""
import logging
import re
import time
from prawcore.exceptions import PrawcoreException
AVAILABLE_COMMANDS = ('help', 'interested', 'join', 'leave', 'uninterested')
COMMAND_RE = re.compile(r'(?:\A|\s)!({})(?=\s|\Z)'
.format('|'.join(AVAILABLE_COMMANDS)))
logger =... | """hackday_bot.bot module."""
import logging
import time
from prawcore.exceptions import PrawcoreException
logger = logging.getLogger(__package__)
class Bot(object):
"""Bot manages comments made to the specified subreddit."""
def __init__(self, subreddit):
"""Initialize an instance of Bot.
... | bsd-2-clause | Python |
61cf4e2feb3d8920179e28719822c7fb34ea6550 | Add defaults to the ibm RNG | JelteF/statistics | 3/ibm_rng.py | 3/ibm_rng.py | def ibm_rng(x1, a=65539, c=0, m=2**31):
x = x1
while True:
x = (a * x + c) % m
yield x / (m-1)
def main():
rng = ibm_rng(1, 65539, 0, 2**31)
while True:
x = next(rng)
print(x)
if __name__ == '__main__':
main()
| def ibm_rng(x1, a, c, m):
x = x1
while True:
x = (a * x + c) % m
yield x / (m-1)
def main():
rng = ibm_rng(1, 65539, 0, 2**31)
while True:
x = next(rng)
print(x)
if __name__ == '__main__':
main()
| mit | Python |
776c2992b64911f86740cdf0af4f05c7587430c7 | Bump version | beerfactory/hbmqtt | hbmqtt/__init__.py | hbmqtt/__init__.py | # Copyright (c) 2015 Nicolas JOUANIN
#
# See the file license.txt for copying permission.
VERSION = (0, 9, 5, 'alpha', 0)
| # Copyright (c) 2015 Nicolas JOUANIN
#
# See the file license.txt for copying permission.
VERSION = (0, 9, 4, 'final', 0)
| mit | Python |
0202eeed429149cbfafd53d9ba6281a0926ea9df | Add labels to account forms and add a NewUserWithPasswordForm that adds password inputs to the new user form. | fin/froide,okfse/froide,CodeforHawaii/froide,stefanw/froide,stefanw/froide,stefanw/froide,CodeforHawaii/froide,ryankanno/froide,okfse/froide,LilithWittmann/froide,CodeforHawaii/froide,catcosmo/froide,ryankanno/froide,fin/froide,catcosmo/froide,LilithWittmann/froide,okfse/froide,catcosmo/froide,LilithWittmann/froide,fin... | froide/account/forms.py | froide/account/forms.py | from django import forms
from django.utils.translation import ugettext as _
from django.utils.safestring import mark_safe
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from helper.widgets import EmailInput
class NewUserForm(forms.Form):
first_name = forms.CharField(max_l... | from django import forms
from django.utils.translation import ugettext as _
from django.utils.safestring import mark_safe
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from helper.widgets import EmailInput
class NewUserForm(forms.Form):
first_name = forms.CharField(max_l... | mit | Python |
2a5fbcd2e3da01150c2690c145100270d3f0ec81 | fix clipnorm | icoxfog417/tying-wv-and-wc | model/lang_model_sgd.py | model/lang_model_sgd.py | import copy
import numpy as np
import tensorflow as tf
from keras import backend as K
from keras.optimizers import Optimizer
from keras.callbacks import LearningRateScheduler
from model.setting import Setting
class LangModelSGD(Optimizer):
def __init__(self, setting, verbose=True):
super(LangModelSGD, se... | import copy
import numpy as np
import tensorflow as tf
from keras import backend as K
from keras.optimizers import Optimizer
from keras.callbacks import LearningRateScheduler
from model.setting import Setting
class LangModelSGD(Optimizer):
def __init__(self, setting, verbose=True):
super(LangModelSGD, se... | mit | Python |
db3cee63baf64d00b2d2ac4fcf726f287b6d7af2 | Update call to proxy fix to use new method signature | alphagov/notifications-admin,alphagov/notifications-admin,alphagov/notifications-admin,alphagov/notifications-admin | app/proxy_fix.py | app/proxy_fix.py | from werkzeug.middleware.proxy_fix import ProxyFix
class CustomProxyFix(object):
def __init__(self, app, forwarded_proto):
self.app = ProxyFix(app, x_for=1, x_proto=1, x_host=1, x_port=0, x_prefix=0)
self.forwarded_proto = forwarded_proto
def __call__(self, environ, start_response):
e... | from werkzeug.middleware.proxy_fix import ProxyFix
class CustomProxyFix(object):
def __init__(self, app, forwarded_proto):
self.app = ProxyFix(app)
self.forwarded_proto = forwarded_proto
def __call__(self, environ, start_response):
environ.update({
"HTTP_X_FORWARDED_PROTO"... | mit | Python |
d56cfbf87c01ac496200341a723ddcee88798a01 | Add setup of default translator object so doctests can run when using _. Fixes #509. | Pylons/pylons,Pylons/pylons,Pylons/pylons,moreati/pylons,moreati/pylons,moreati/pylons | pylons/test.py | pylons/test.py | """Test related functionality
Adds a Pylons plugin to `nose <http://www.somethingaboutorange.com/mrl/projects/nose/>`_
that loads the Pylons app *before* scanning for doc tests.
This can be configured in the projects :file:`setup.cfg` under a
``[nosetests]`` block:
.. code-block:: ini
[nosetests]
with-p... | """Test related functionality
Adds a Pylons plugin to `nose <http://www.somethingaboutorange.com/mrl/projects/nose/>`_
that loads the Pylons app *before* scanning for doc tests.
This can be configured in the projects :file:`setup.cfg` under a
``[nosetests]`` block:
.. code-block:: ini
[nosetests]
with-p... | bsd-3-clause | Python |
747d2563fd566a70420a04d3db209fffc813f147 | fix docs/hash-tree.py for python 3 | dougalsutherland/skl-groups,dougalsutherland/skl-groups | docs/hash-tree.py | docs/hash-tree.py | #!/usr/bin/env python
# Write a directory to the Git index.
# Prints the directory's SHA-1 to stdout.
#
# Copyright 2013 Lars Buitinck / University of Amsterdam.
# License: MIT (http://opensource.org/licenses/MIT)
# Based on:
# https://github.com/larsmans/seqlearn/blob/d7a3d82c/doc/hash-tree.py
import os
from os.pat... | #!/usr/bin/env python
# Write a directory to the Git index.
# Prints the directory's SHA-1 to stdout.
#
# Copyright 2013 Lars Buitinck / University of Amsterdam.
# License: MIT (http://opensource.org/licenses/MIT)
# https://github.com/larsmans/seqlearn/blob/d7a3d82c/doc/hash-tree.py
import os
from os.path import spl... | bsd-3-clause | Python |
34c0c6c73a65da3120aa52600254afc909e9a3bc | Remove unused main and unused imports | gotling/PyTach,gotling/PyTach,gotling/PyTach | pytach/wsgi.py | pytach/wsgi.py | import bottle
import config
from web import web
app = application = bottle.Bottle()
app.merge(web.app)
config.arguments['--verbose'] = True
| import bottle
from bottle import route, run
from web import web
import config
app = application = bottle.Bottle()
app.merge(web.app)
config.arguments['--verbose'] = True
if __name__ == '__main__':
app.run(host='0.0.0.0', port=8082, debug=True)
| mit | Python |
bea0ead3dfcc055d219966c64437652c0eb2cf84 | Update demo.py | Kaceykaso/design_by_roomba,Kaceykaso/design_by_roomba | python/demo.py | python/demo.py | #! /usr/bin/env python
import serial
import time
# Serial port
N = "/dev/ttyUSB0"
def ints2str(lst):
'''
Taking a list of notes/lengths, convert it to a string
'''
s = ""
for i in lst:
if i < 0 or i > 255:
raise Exception
s = s + str(chr(i))
return s
# do some ini... | #! /usr/bin/env python
import serial
import time
import sys
# Serial port
N = "/dev/ttyUSB0"
def ints2str(lst):
'''
Taking a list of notes/lengths, convert it to a string
'''
s = ""
for i in lst:
if i < 0 or i > 255:
raise Exception
s = s + str(chr(i))
return s
# d... | mit | Python |
1ca6ccb50992836720e86a7c3c766a5497cf7588 | Remove unused import | sassoftware/mint,sassoftware/mint,sassoftware/mint,sassoftware/mint,sassoftware/mint | mint/django_rest/rbuilder/querysets/views.py | mint/django_rest/rbuilder/querysets/views.py | #!/usr/bin/python
#
# Copyright (c) 2011 rPath, Inc.
#
# All rights reserved.
#
from mint.django_rest.deco import return_xml, requires
from mint.django_rest.rbuilder import service
class BaseQuerySetService(service.BaseService):
pass
class QuerySetService(BaseQuerySetService):
@return_xml
def rest_GET(s... | #!/usr/bin/python
#
# Copyright (c) 2011 rPath, Inc.
#
# All rights reserved.
#
from mint.django_rest.deco import return_xml, requires
from mint.django_rest.rbuilder import service
from mint.django_rest.rbuilder.querysets import manager
class BaseQuerySetService(service.BaseService):
pass
class QuerySetService(B... | apache-2.0 | Python |
d86bdec5d7d57fe74cb463e391798bd1e5be87ff | Update Ghana code to match current Pombola | geoffkilpin/pombola,mysociety/pombola,mysociety/pombola,mysociety/pombola,mysociety/pombola,mysociety/pombola,geoffkilpin/pombola,geoffkilpin/pombola,geoffkilpin/pombola,geoffkilpin/pombola,geoffkilpin/pombola,mysociety/pombola | pombola/ghana/urls.py | pombola/ghana/urls.py | from django.conf.urls import patterns, url, include
from django.views.generic import TemplateView
from .views import data_upload, info_page_upload
urlpatterns = patterns('',
url(r'^intro$', TemplateView.as_view(template_name='intro.html')),
url(r'^data/upload/mps/$', data_upload, name='data_upload'),
url(... | from django.conf.urls import patterns, include, url, handler404
from django.views.generic import TemplateView
import django.contrib.auth.views
from .views import data_upload, info_page_upload
urlpatterns = patterns('',
url(r'^intro$', TemplateView.as_view(template_name='intro.html')),
url(r'^data/upload/mps/... | agpl-3.0 | Python |
9b75fd09220e61fd511c99e63f8d2b30e6a0f868 | stop using deprecated assertEquals() | rholder/csv2es | test_csv2es.py | test_csv2es.py | ## Copyright 2015 Ray Holder
##
## 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 writi... | ## Copyright 2015 Ray Holder
##
## 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 writi... | apache-2.0 | Python |
97a8a349d26b364e57aaac6f8d920770810aa8d8 | Correct localized strings | looker/sentry,1tush/sentry,wong2/sentry,alexm92/sentry,jean/sentry,pauloschilling/sentry,SilentCircle/sentry,Kryz/sentry,mvaled/sentry,pauloschilling/sentry,BuildingLink/sentry,JTCunning/sentry,JamesMura/sentry,kevinlondon/sentry,alexm92/sentry,korealerts1/sentry,JTCunning/sentry,zenefits/sentry,JamesMura/sentry,mitsuh... | src/sentry/constants.py | src/sentry/constants.py | """
sentry.constants
~~~~~~~~~~~~~~~~
These settings act as the default (base) settings for the Sentry-provided web-server
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from django.utils.datastructures import SortedDict
from django.utils.... | """
sentry.constants
~~~~~~~~~~~~~~~~
These settings act as the default (base) settings for the Sentry-provided web-server
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from django.utils.datastructures import SortedDict
from django.utils.... | bsd-3-clause | Python |
ca2a6d06f09f5f2d511d6cf676fdd9a8f6c411cf | remove cruft, bump heroku | dev-coop/brains,dev-coop/brains | src/settings/production.py | src/settings/production.py | from base import *
DEBUG = False
ALLOWED_HOSTS = ["*"]
SECRET_KEY = os.environ.get("DJANGO_SECRET_KEY", "afaefawe23af")
assert SECRET_KEY, "Set your DJANGO_SECRET_KEY env var"
# Celery
BROKER_URL = os.environ.get('CLOUDAMQP_URL', None)
#assert BROKER_URL, "Celery BROKER_URL env var missing!"
# Memcached
CACHES =... | from base import *
DEBUG = False
ALLOWED_HOSTS = ["*"]
SECRET_KEY = os.environ.get("DJANGO_SECRET_KEY", "afaefawe23af")
assert SECRET_KEY, "Set your DJANGO_SECRET_KEY env var"
# Celery
BROKER_URL = os.environ.get('CLOUDAMQP_URL', None)
# BROKER_URL = os.environ.get("RABBITMQ_BIGWIG_URL", None)
#assert BROKER_URL,... | mit | Python |
5526f8e3dca2f84fce34df5a134bada8479a2f69 | Fix dumpdata ordering for VRFs | digitalocean/netbox,digitalocean/netbox,digitalocean/netbox,digitalocean/netbox | netbox/ipam/models/__init__.py | netbox/ipam/models/__init__.py | # Ensure that VRFs are imported before IPs/prefixes so dumpdata & loaddata work correctly
from .fhrp import *
from .vrfs import *
from .ip import *
from .services import *
from .vlans import *
__all__ = (
'ASN',
'Aggregate',
'IPAddress',
'IPRange',
'FHRPGroup',
'FHRPGroupAssignment',
'Prefi... | from .fhrp import *
from .ip import *
from .services import *
from .vlans import *
from .vrfs import *
__all__ = (
'ASN',
'Aggregate',
'IPAddress',
'IPRange',
'FHRPGroup',
'FHRPGroupAssignment',
'Prefix',
'RIR',
'Role',
'RouteTarget',
'Service',
'ServiceTemplate',
'V... | apache-2.0 | Python |
fe0691595eea7197db07f3505446e1553df3d188 | Bump version number after merging pull request. | cmbruns/pyopenvr,cmbruns/pyopenvr,cmbruns/pyopenvr,cmbruns/pyopenvr | src/openvr/version.py | src/openvr/version.py | # Store the version here so:
# 1) we don't load dependencies by storing it in __init__.py
# 2) we can import it in setup.py for the same reason
# 3) we can import it into your module module
# http://stackoverflow.com/questions/458550/standard-way-to-embed-version-into-python-package
__version__ = '1.0.0602a'
| # Store the version here so:
# 1) we don't load dependencies by storing it in __init__.py
# 2) we can import it in setup.py for the same reason
# 3) we can import it into your module module
# http://stackoverflow.com/questions/458550/standard-way-to-embed-version-into-python-package
__version__ = '1.0.0601'
| bsd-3-clause | Python |
4e74ba40f442dd27ddd29464b518c2a06ad1019a | Bump version | machtfit/django-oscar,machtfit/django-oscar,machtfit/django-oscar | src/oscar/__init__.py | src/oscar/__init__.py | import os
# Use 'dev', 'beta', or 'final' as the 4th element to indicate release type.
VERSION = (1, 0, 1, 'machtfit', 22)
def get_short_version():
return '%s.%s' % (VERSION[0], VERSION[1])
def get_version():
return '{}.{}.{}-{}-{}'.format(*VERSION)
# Cheeky setting that allows each template to be acces... | import os
# Use 'dev', 'beta', or 'final' as the 4th element to indicate release type.
VERSION = (1, 0, 1, 'machtfit', 21)
def get_short_version():
return '%s.%s' % (VERSION[0], VERSION[1])
def get_version():
return '{}.{}.{}-{}-{}'.format(*VERSION)
# Cheeky setting that allows each template to be acces... | bsd-3-clause | Python |
aa7bbd84fa16105417ceb7f9e06d392a4e54fdc6 | Remove unused import | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/beacons/twilio_txt_msg.py | salt/beacons/twilio_txt_msg.py | # -*- coding: utf-8 -*-
'''
Beacon to emit Twilio text messages
'''
# Import Python libs
from __future__ import absolute_import
import logging
# Import 3rd Party libs
try:
from twilio.rest import TwilioRestClient
HAS_TWILIO = True
except ImportError:
HAS_TWILIO = False
log = logging.getLogger(__name__)
... | # -*- coding: utf-8 -*-
'''
Beacon to emit Twilio text messages
'''
# Import Python libs
from __future__ import absolute_import
from datetime import datetime
import logging
# Import 3rd Party libs
try:
from twilio.rest import TwilioRestClient
HAS_TWILIO = True
except ImportError:
HAS_TWILIO = False
log =... | apache-2.0 | Python |
c340c1b92a3d82a25ce2e43b19603ee58de0b146 | Improve celery logging | keaneokelley/home,keaneokelley/home,keaneokelley/home | home/core/async.py | home/core/async.py | """
async.py
~~~~~~~~
Handles running of tasks in an asynchronous fashion. Not explicitly tied to Celery. The `run` method simply must
exist here and handle the execution of whatever task is passed to it, whether or not it is handled asynchronously.
"""
from apscheduler.schedulers.background import BackgroundScheduler... | """
async.py
~~~~~~~~
Handles running of tasks in an asynchronous fashion. Not explicitly tied to Celery. The `run` method simply must
exist here and handle the execution of whatever task is passed to it, whether or not it is handled asynchronously.
"""
from apscheduler.schedulers.background import BackgroundScheduler... | mit | Python |
9b18db54d64e168231079255334649fb9b503f3e | Add murrine back into monodevelop-mac-dev packages list | bl8/bockbuild,BansheeMediaPlayer/bockbuild,BansheeMediaPlayer/bockbuild,BansheeMediaPlayer/bockbuild,mono/bockbuild,bl8/bockbuild,bl8/bockbuild,mono/bockbuild | profiles/monodevelop-mac-dev/packages.py | profiles/monodevelop-mac-dev/packages.py | import os
from bockbuild.darwinprofile import DarwinProfile
class MonoDevelopMacDevPackages:
def __init__ (self):
# Toolchain
self.packages.extend ([
'autoconf.py',
'automake.py',
'libtool.py',
'gettext.py',
'pkg-config.py'
])
# Base Libraries
self.packages.extend ([
'libpng.py',
'libj... | import os
from bockbuild.darwinprofile import DarwinProfile
class MonoDevelopMacDevPackages:
def __init__ (self):
# Toolchain
self.packages.extend ([
'autoconf.py',
'automake.py',
'libtool.py',
'gettext.py',
'pkg-config.py'
])
# Base Libraries
self.packages.extend ([
'libpng.py',
'libj... | mit | Python |
5ca4e1df8fc67f9b56d5ea55cb4e17e78c5c6ed5 | Fix test factory | dbinetti/barberscore,dbinetti/barberscore-django,barberscore/barberscore-api,barberscore/barberscore-api,dbinetti/barberscore,barberscore/barberscore-api,barberscore/barberscore-api,dbinetti/barberscore-django | project/apps/smanager/tests/factories.py | project/apps/smanager/tests/factories.py |
# Standard Library
import datetime
import rest_framework_jwt
# Third-Party
from factory import Faker # post_generation,
from factory import Iterator
from factory import LazyAttribute
from factory import PostGenerationMethodCall
from factory import RelatedFactory
from factory import Sequence
from factory import SubF... |
# Standard Library
import datetime
import rest_framework_jwt
# Third-Party
from factory import Faker # post_generation,
from factory import Iterator
from factory import LazyAttribute
from factory import PostGenerationMethodCall
from factory import RelatedFactory
from factory import Sequence
from factory import SubF... | bsd-2-clause | Python |
f76daf38fb8998bbf5d0b663ff64572fb240fd24 | bump Python API version am: 454844e69f am: 07e940c2de am: 19c98a2e99 am: 9bc9e3d185 am: 4289bd8427 | google/perfetto,google/perfetto,google/perfetto,google/perfetto,google/perfetto,google/perfetto,google/perfetto,google/perfetto | src/trace_processor/python/setup.py | src/trace_processor/python/setup.py | from distutils.core import setup
setup(
name='perfetto',
packages=['perfetto', 'perfetto.trace_processor'],
package_data={'perfetto.trace_processor': ['*.descriptor']},
include_package_data=True,
version='0.3.0',
license='apache-2.0',
description='Python API for Perfetto\'s Trace Processor'... | from distutils.core import setup
setup(
name='perfetto',
packages=['perfetto', 'perfetto.trace_processor'],
package_data={'perfetto.trace_processor': ['*.descriptor']},
include_package_data=True,
version='0.2.9',
license='apache-2.0',
description='Python API for Perfetto\'s Trace Processor'... | apache-2.0 | Python |
3b2730edbbef3f32aef6682d9d446d8416fc7562 | add setWindowMinimizeButtonHint() for dialog | SF-Zhou/quite | quite/controller/dialog_ui_controller.py | quite/controller/dialog_ui_controller.py | from . import WidgetUiController
from ..gui import Shortcut
from PySide.QtCore import Qt
class DialogUiController(WidgetUiController):
def __init__(self, parent=None, ui_file=None):
super().__init__(parent, ui_file)
Shortcut('ctrl+w', self.w).excited.connect(self.w.close)
def exec(self):
... | from . import WidgetUiController
from ..gui import Shortcut
class DialogUiController(WidgetUiController):
def __init__(self, parent=None, ui_file=None):
super().__init__(parent, ui_file)
Shortcut('ctrl+w', self.w).excited.connect(self.w.close)
def exec(self):
return self.w.exec()
... | mit | Python |
a08919c24e1af460ccba8820eb6646492848621e | Bump Version 0.5.4 | douban/libmc,mckelvin/libmc,douban/libmc,mckelvin/libmc,mckelvin/libmc,douban/libmc,douban/libmc,douban/libmc,mckelvin/libmc,mckelvin/libmc | libmc/__init__.py | libmc/__init__.py | from ._client import (
PyClient, ThreadUnsafe,
encode_value,
MC_DEFAULT_EXPTIME,
MC_POLL_TIMEOUT,
MC_CONNECT_TIMEOUT,
MC_RETRY_TIMEOUT,
MC_HASH_MD5,
MC_HASH_FNV1_32,
MC_HASH_FNV1A_32,
MC_HASH_CRC_32,
MC_RETURN_SEND_ERR,
MC_RETURN_RECV_ERR,
MC_RETURN_CONN_POLL_ERR,
... | from ._client import (
PyClient, ThreadUnsafe,
encode_value,
MC_DEFAULT_EXPTIME,
MC_POLL_TIMEOUT,
MC_CONNECT_TIMEOUT,
MC_RETRY_TIMEOUT,
MC_HASH_MD5,
MC_HASH_FNV1_32,
MC_HASH_FNV1A_32,
MC_HASH_CRC_32,
MC_RETURN_SEND_ERR,
MC_RETURN_RECV_ERR,
MC_RETURN_CONN_POLL_ERR,
... | bsd-3-clause | Python |
778f284c2208438b7bc26226cc295f80de6343e0 | Use loop.add_signal_handler for handling SIGWINCH. | jonathanslenders/libpymux | libpymux/utils.py | libpymux/utils.py | import array
import asyncio
import fcntl
import signal
import termios
def get_size(stdout):
# Thanks to fabric (fabfile.org), and
# http://sqizit.bartletts.id.au/2011/02/14/pseudo-terminals-in-python/
"""
Get the size of this pseudo terminal.
:returns: A (rows, cols) tuple.
"""
#assert st... | import array
import asyncio
import fcntl
import signal
import termios
def get_size(stdout):
# Thanks to fabric (fabfile.org), and
# http://sqizit.bartletts.id.au/2011/02/14/pseudo-terminals-in-python/
"""
Get the size of this pseudo terminal.
:returns: A (rows, cols) tuple.
"""
#assert st... | bsd-2-clause | Python |
fa57fa679b575ce871af3c4769828f400e6ab28b | bump version 2.1.3 for issue #70 | industrydive/premailer,BlokeOne/premailer-1,lavr/premailer,peterbe/premailer,peterbe/premailer,lavr/premailer,industrydive/premailer,graingert/premailer,ionelmc/premailer,graingert/premailer,ionelmc/premailer,BlokeOne/premailer-1,peterbe/premailer,kengruven/premailer,kengruven/premailer | premailer/__init__.py | premailer/__init__.py | from premailer import Premailer, transform
__version__ = '2.1.3'
| from premailer import Premailer, transform
__version__ = '2.1.2'
| bsd-3-clause | Python |
0782ba56218e825dea5b76cbf030a522932bcfd6 | Remove unnecessary (and debatable) comment. | nathania/networkx,dhimmel/networkx,RMKD/networkx,sharifulgeo/networkx,chrisnatali/networkx,goulu/networkx,farhaanbukhsh/networkx,jni/networkx,jakevdp/networkx,ionanrozenfeld/networkx,debsankha/networkx,nathania/networkx,tmilicic/networkx,kernc/networkx,ltiao/networkx,michaelpacer/networkx,bzero/networkx,dhimmel/network... | networkx/classes/ordered.py | networkx/classes/ordered.py | """
OrderedDict variants of the default base classes.
"""
try:
# Python 2.7+
from collections import OrderedDict
except ImportError:
# Oython 2.6
try:
from ordereddict import OrderedDict
except ImportError:
OrderedDict = None
from .graph import Graph
from .multigraph import MultiGr... | """
OrderedDict variants of the default base classes.
These classes are especially useful for doctests and unit tests.
"""
try:
# Python 2.7+
from collections import OrderedDict
except ImportError:
# Oython 2.6
try:
from ordereddict import OrderedDict
except ImportError:
OrderedDic... | bsd-3-clause | Python |
8f78c04f6e2f21deb02a285fc78c5da907f0287b | Delete extra print() | raviqqe/tensorflow-extenteten,raviqqe/tensorflow-extenteten | nn/file/cnn_dailymail_rc.py | nn/file/cnn_dailymail_rc.py | import functools
import tensorflow as tf
from .. import flags
from ..flags import FLAGS
class _RcFileReader:
def __init__(self):
# 0 -> null, 1 -> unknown
self._word_indices = flags.word_indices
def read(self, filename_queue):
key, value = tf.WholeFileReader().read(filename_queue)
return (key, ... | import functools
import tensorflow as tf
from .. import flags
from ..flags import FLAGS
class _RcFileReader:
def __init__(self):
# 0 -> null, 1 -> unknown
self._word_indices = flags.word_indices
def read(self, filename_queue):
key, value = tf.WholeFileReader().read(filename_queue)
return (key, ... | unlicense | Python |
16bf079d1b139db08988fdb3cc1ff818cecfc12e | Add ModelTranslationAdminMixin. | ulule/django-linguist | linguist/admin.py | linguist/admin.py | # -*- coding: utf-8 -*-
from django.contrib import admin
from .models import Translation
class ModelTranslationAdminMixin(object):
"""
Mixin for model admin classes.
"""
pass
class TranslationAdmin(admin.ModelAdmin):
"""
Translation model admin options.
"""
pass
admin.site.regist... | # -*- coding: utf-8 -*-
from django.contrib import admin
from .models import Translation
class TranslationAdmin(admin.ModelAdmin):
pass
admin.site.register(Translation, TranslationAdmin)
| mit | Python |
7594763e5e6167c15fa7898b13283e875c13c099 | Update BotPMError.py | DecoraterBot-devs/DecoraterBot | resources/Dependencies/DecoraterBotCore/BotPMError.py | resources/Dependencies/DecoraterBotCore/BotPMError.py | # coding=utf-8
"""
DecoraterBotCore
~~~~~~~~~~~~~~~~~~~
Core to DecoraterBot
:copyright: (c) 2015-2017 Decorater
:license: MIT, see LICENSE for more details.
"""
import discord
__all__ = ['BotPMError']
class BotPMError:
"""
Class for PMing bot errors.
"""
def __init__(self, bot):
self.bot ... | # coding=utf-8
"""
DecoraterBotCore
~~~~~~~~~~~~~~~~~~~
Core to DecoraterBot
:copyright: (c) 2015-2017 Decorater
:license: MIT, see LICENSE for more details.
"""
import discord
__all__ = ['BotPMError']
class BotPMError:
"""
Class for PMing bot errors.
"""
def __init__(self, bot):
self.bot ... | mit | Python |
cb7f6efbbbe640a2c360f7dc93cb2bc87b2e0ab2 | fix example | RaymondKlass/entity-extract | entity_extract/examples/pos_extraction.py | entity_extract/examples/pos_extraction.py |
#from entity_extract.extractor.extractors import PosExtractor
from entity_extract.extractor.utilities import SentSplit, Tokenizer
from entity_extract.extractor.extractors import PosExtractor
from entity_extract.extractor.pos_tagger import PosTagger
# Initialize Services
sentSplitter = SentSplit()
tokenizer = Tokenize... |
#from entity_extract.extractor.extractors import PosExtractor
from entity_extract.extractor.utilities import SentSplit, Tokenizer
from entity_extract.extractor.extractors import PosExtractor
from entity_extract.extractor.pos_tagger import PosTagger
#p = PosExtractor()
sents = p.SentPlit('This is a sentence about the ... | mit | Python |
2e6c80717099fb6c6ca59d9d6193807b1aabfa8b | Update docstring | e4r7hbug/git_update | git_update/actions.py | git_update/actions.py | """Git repo actions."""
import logging
import os
import pathlib
import click
from git import InvalidGitRepositoryError, Repo
from git.exc import GitCommandError
LOG = logging.getLogger(__name__)
def crawl(path):
"""Crawl the path for possible Git directories.
Args:
path (str): Original path to craw... | """Git repo actions."""
import logging
import os
import pathlib
import click
from git import InvalidGitRepositoryError, Repo
from git.exc import GitCommandError
LOG = logging.getLogger(__name__)
def crawl(path):
"""Crawl the path for possible Git directories."""
main_dir = pathlib.Path(path)
if not main... | mit | Python |
ef1f303072307f259e8555e0148c29677b4f7d6f | Fix approve permissions typing | facebook/FBSimulatorControl,facebook/FBSimulatorControl,facebook/FBSimulatorControl,facebook/FBSimulatorControl,facebook/FBSimulatorControl | idb/ipc/approve.py | idb/ipc/approve.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
from typing import Set, Dict, Any
from idb.grpc.types import CompanionClient
from idb.grpc.idb_pb2 import ApproveRequest
MAP: Dict[str, Any] = {
"photos": ApproveRequest.PHOTOS,
"camera": ApproveRequest.CAMERA,
... | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
from typing import Set, Dict # noqa F401
from idb.grpc.types import CompanionClient
from idb.grpc.idb_pb2 import ApproveRequest
MAP = { # type: Dict[str, ApproveRequest.Permission]
"photos": ApproveRequest.PHOTOS,
... | mit | Python |
7cb9703b1af4138e8f1a036245125d723add55a3 | Fix error handling to return sensible HTTP error codes. | 4bic/grano,CodeForAfrica/grano,4bic-attic/grano,granoproject/grano | grano/views/__init__.py | grano/views/__init__.py | from colander import Invalid
from flask import request
from werkzeug.exceptions import HTTPException
from grano.core import app
from grano.lib.serialisation import jsonify
from grano.views.base_api import blueprint as base_api
from grano.views.entities_api import blueprint as entities_api
from grano.views.relations_ap... | from colander import Invalid
from flask import request
from grano.core import app
from grano.lib.serialisation import jsonify
from grano.views.base_api import blueprint as base_api
from grano.views.entities_api import blueprint as entities_api
from grano.views.relations_api import blueprint as relations_api
from grano... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.