commit stringlengths 40 40 | old_file stringlengths 4 236 | new_file stringlengths 4 236 | old_contents stringlengths 1 3.26k | new_contents stringlengths 16 4.43k | subject stringlengths 16 624 | message stringlengths 17 3.29k | lang stringclasses 5
values | license stringclasses 13
values | repos stringlengths 5 91.5k |
|---|---|---|---|---|---|---|---|---|---|
b4e5a284201d6d25607ff54aedcf6082e8a4d621 | st2client/st2client/models/reactor.py | st2client/st2client/models/reactor.py | # Licensed to the StackStorm, Inc ('StackStorm') 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 use th... | # Licensed to the StackStorm, Inc ('StackStorm') 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 use th... | Add Trigger model to client and alias it as TriggerSpecification. | Add Trigger model to client and alias it as TriggerSpecification.
| Python | apache-2.0 | pinterb/st2,peak6/st2,pixelrebel/st2,jtopjian/st2,pixelrebel/st2,alfasin/st2,pinterb/st2,Itxaka/st2,Plexxi/st2,lakshmi-kannan/st2,Itxaka/st2,grengojbo/st2,Plexxi/st2,jtopjian/st2,punalpatel/st2,punalpatel/st2,Plexxi/st2,nzlosh/st2,armab/st2,StackStorm/st2,punalpatel/st2,dennybaa/st2,nzlosh/st2,pixelrebel/st2,peak6/st2,... |
0903b18d1e4213cb88aa8cfcd0eb473ae54aa40b | shop/models/fields.py | shop/models/fields.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import connection
from shop.apps import get_tuple_version
try:
if str(connection.vendor) == 'postgresql':
import psycopg2
psycopg2_version = get_tuple_version(psycopg2.__version__[:5])
with connection.cursor()... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
if settings.DATABASES['default']['ENGINE'] == 'django.db.backends.postgresql':
from django.contrib.postgres.fields import JSONField as _JSONField
else:
from jsonfield.fields import JSONField as _JSONField
class... | Fix and simplify the JSONfield wrapper code | Fix and simplify the JSONfield wrapper code
| Python | bsd-3-clause | jrief/django-shop,awesto/django-shop,nimbis/django-shop,khchine5/django-shop,jrief/django-shop,nimbis/django-shop,awesto/django-shop,nimbis/django-shop,khchine5/django-shop,divio/django-shop,nimbis/django-shop,jrief/django-shop,divio/django-shop,awesto/django-shop,divio/django-shop,khchine5/django-shop,khchine5/django-... |
458211091f4408136a4eb6e6a06849d93c3ede8a | tests/test_convert.py | tests/test_convert.py | import pytest # type: ignore
from hypothesis import given
from ppb_vector import Vector2
from utils import vector_likes, vectors
class V(Vector2): pass
@pytest.mark.parametrize('vector_like', vector_likes(), ids=lambda x: type(x).__name__) # type: ignore
@pytest.mark.parametrize('cls', [Vector2, V]) # type: ignore
... | import pytest # type: ignore
from hypothesis import given
from ppb_vector import Vector2
from utils import vector_likes, vectors
class V(Vector2): pass
@pytest.mark.parametrize('vector_like', vector_likes(), ids=lambda x: type(x).__name__) # type: ignore
@pytest.mark.parametrize('cls', [Vector2, V]) # type: ignore
... | Add a list conversion test | tests/convert: Add a list conversion test
| Python | artistic-2.0 | ppb/ppb-vector,ppb/ppb-vector |
bd8901c18a6722660e7af742260ae4b8317a064b | youtube/tasks.py | youtube/tasks.py | import subprocess
import os
from pathlib import Path
from invoke import task
@task
def update(ctx):
"""
Update youtube-dl
"""
cmd = ['pipenv', 'update', 'youtube-dl']
subprocess.call(cmd)
@task
def clean(ctx):
"""
Clean up files
"""
import main
def rm(file_):
if file_.exists():
os.r... | import subprocess
import os
from pathlib import Path
from invoke import task
@task
def update(ctx):
"""
Update dependencies such as youtube-dl, etc.
"""
subprocess.call(['pipenv', 'update'])
@task
def clean(ctx):
"""
Clean up files
"""
import main
def rm(file_):
if file_.exists():
os.... | Update task now updates all dependencies | Update task now updates all dependencies
| Python | apache-2.0 | feihong/chinese-music-processors,feihong/chinese-music-processors |
532df8a669d7e54125c102ef4821272dc24aab23 | weasyprint/logger.py | weasyprint/logger.py | # coding: utf-8
"""
weasyprint.logging
------------------
Logging setup.
The rest of the code gets the logger through this module rather than
``logging.getLogger`` to make sure that it is configured.
:copyright: Copyright 2011-2014 Simon Sapin and contributors, see AUTHORS.
:license: BSD,... | # coding: utf-8
"""
weasyprint.logging
------------------
Logging setup.
The rest of the code gets the logger through this module rather than
``logging.getLogger`` to make sure that it is configured.
:copyright: Copyright 2011-2014 Simon Sapin and contributors, see AUTHORS.
:license: BSD,... | Add a better default formatter for logs | Add a better default formatter for logs
| Python | bsd-3-clause | Kozea/WeasyPrint,Kozea/WeasyPrint |
14b8a2a689414e65efda9b466db430ed09f777d5 | panoptes_client/utils.py | panoptes_client/utils.py | from __future__ import absolute_import, division, print_function
from builtins import range
import functools
ITERABLE_TYPES = (
list,
set,
tuple,
)
try:
from numpy import ndarray
ITERABLE_TYPES = ITERABLE_TYPES + (ndarray,)
except ImportError:
pass
def isiterable(v):
return isinstance(... | from __future__ import absolute_import, division, print_function
from builtins import range
import functools
ITERABLE_TYPES = (
list,
set,
tuple,
)
MISSING_POSITIONAL_ERR = 'Required positional argument (pos 1) not found'
try:
from numpy import ndarray
ITERABLE_TYPES = ITERABLE_TYPES + (ndarray... | Raise TypeError if positional batchable argument is missing | Raise TypeError if positional batchable argument is missing
e.g. if it's erroneously been passed as a named argument.
| Python | apache-2.0 | zooniverse/panoptes-python-client |
6049a916ea3adfe4ef8a7ae9dbfc918b69907ef4 | OnionLauncher/main.py | OnionLauncher/main.py | import sys
from PyQt5.QtWidgets import QApplication, QMainWindow
from PyQt5.uic import loadUi
class MainWindow(QMainWindow):
def __init__(self, *args):
super(MainWindow, self).__init__(*args)
loadUi("ui_files/main.ui", self)
self.tbAdd.clicked.connect(self.addRow)
self.tbRemove.clicked.connect(self.removeRo... | import sys
from PyQt5.QtWidgets import QApplication, QMainWindow
from PyQt5.uic import loadUi
class MainWindow(QMainWindow):
def __init__(self, *args):
super(MainWindow, self).__init__(*args)
loadUi("ui_files/main.ui", self)
buttons = {
self.tbAdd: self.addRow,
self.tbRemove: self.removeRow,
self.btn... | Put mouse clicks in it's own dictionary | Put mouse clicks in it's own dictionary
| Python | bsd-2-clause | neelchauhan/OnionLauncher |
8a827d3e86cf2f6b9d36812e7058560ae120d4b2 | tests/test_watson.py | tests/test_watson.py | from pywatson.watson import Watson
class TestWatson:
def test_init(self, config):
watson = Watson(url=config['url'], username=config['username'], password=config['password'])
| from pywatson.answer.answer import Answer
from pywatson.watson import Watson
class TestWatson:
def test_ask_question_basic(self, watson):
answer = watson.ask_question('What is the Labour Code?')
assert type(answer) is Answer
| Add failing test for ask_question | Add failing test for ask_question
| Python | mit | sherlocke/pywatson |
de324cc798da8694bab510efd51de4bfda528df7 | zinnia/views/entries.py | zinnia/views/entries.py | """Views for Zinnia entries"""
from django.views.generic.dates import BaseDateDetailView
from zinnia.models.entry import Entry
from zinnia.views.mixins.archives import ArchiveMixin
from zinnia.views.mixins.entry_protection import EntryProtectionMixin
from zinnia.views.mixins.callable_queryset import CallableQuerysetMi... | """Views for Zinnia entries"""
from django.views.generic.dates import BaseDateDetailView
from zinnia.models.entry import Entry
from zinnia.views.mixins.archives import ArchiveMixin
from zinnia.views.mixins.entry_preview import EntryPreviewMixin
from zinnia.views.mixins.entry_protection import EntryProtectionMixin
from... | Implement the EntryPreviewMixin in the EntryDetail view | Implement the EntryPreviewMixin in the EntryDetail view
| Python | bsd-3-clause | Maplecroft/django-blog-zinnia,ZuluPro/django-blog-zinnia,petecummings/django-blog-zinnia,Maplecroft/django-blog-zinnia,ZuluPro/django-blog-zinnia,petecummings/django-blog-zinnia,petecummings/django-blog-zinnia,aorzh/django-blog-zinnia,extertioner/django-blog-zinnia,Maplecroft/django-blog-zinnia,ghachey/django-blog-zinn... |
e93a321e3d137fb21a42d0e0bfd257a537be05d3 | diy/parerga/config.py | diy/parerga/config.py | # -*- set coding: utf-8 -*-
import os
# directories constants
PARERGA_ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
PARERGA_ENTRY_DIR = os.path.join(PARERGA_ROOT_DIR, "p")
PARERGA_STATIC_DIR = os.path.join(PARERGA_ROOT_DIR, "static")
PARERGA_TEMPLATE_DIR = os.path.join(PARERGA_ROOT_DIR, "templates")
# databa... | # -*- set coding: utf-8 -*-
import os
# directories constants
PARERGA_ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
PARERGA_ENTRY_DIR = os.path.join(PARERGA_ROOT_DIR, "p")
PARERGA_STATIC_DIR = os.path.join(PARERGA_ROOT_DIR, "static")
PARERGA_TEMPLATE_DIR = os.path.join(PARERGA_ROOT_DIR, "temp... | Update path vars for the new source location | Update path vars for the new source location
| Python | bsd-3-clause | nadirs/parerga,nadirs/parerga |
624d6e4fc5455720badf4315e06f423eb60411ab | scripts/init_tree.py | scripts/init_tree.py | import os
import shutil
def main():
cwd = os.getcwd()
if not cwd.endswith(os.path.join('FRENSIE', 'scripts')):
print 'This script must be run in \"FRENSIE/scipts\"'
print 'Your CWD is', cwd
return 1
os.chdir('../../')
os.mkdir('frensie_build_tree')
#os.renames('FRENSIE'... | import os
import shutil
def main():
cwd = os.getcwd()
if not cwd.endswith(os.path.join('FRENSIE', 'scripts')):
print 'This script must be run in \"FRENSIE/scipts\"'
print 'Your CWD is', cwd
return 1
os.chdir('../../')
os.mkdir('frensie_build_tree')
#os.renames('FRENSIE'... | Update to copy new scripts | Update to copy new scripts
| Python | bsd-3-clause | lkersting/SCR-2123,lkersting/SCR-2123,lkersting/SCR-2123,lkersting/SCR-2123 |
0338f8c66f14d6dbf43a2583ba17a8ae7d690466 | apps/survey/urls.py | apps/survey/urls.py | from django.conf.urls.defaults import *
from . import views
urlpatterns = patterns('',
url(r'^profile/$', views.profile_index, name='survey_profile'),
url(r'^profile/electric/$', views.profile_electric, name='survey_profile_electric'),
url(r'^profile/intake/$', views.survey_intake, name='survey_profile_in... | from django.conf.urls.defaults import *
from . import views
urlpatterns = patterns('',
url(r'^profile/$', views.profile_index, name='survey_profile'),
url(r'^profile/electric/$', views.profile_electric, name='survey_profile_electric'),
#url(r'^profile/intake/$', views.survey_intake, name='survey_profile_i... | Modify call to personal surveis | Modify call to personal surveis
| Python | agpl-3.0 | chispita/epiwork,chispita/epiwork,chispita/epiwork,chispita/epiwork,chispita/epiwork,chispita/epiwork,chispita/epiwork |
2724b4dd7ed350baeae0a8e0ef53475f40b1208b | project_generator/tools/makearmclang.py | project_generator/tools/makearmclang.py | # Copyright 2020 Chris Reed
#
# 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 2020 Chris Reed
#
# 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... | Enable linker preprocessing for armclang. | Enable linker preprocessing for armclang.
This should be temporary; for some reason the .sct cpp shebang isn't working for me. Same result in any case.
| Python | apache-2.0 | project-generator/project_generator |
9ae5ea3876fae6ef0bc092d87c71d9ea86040cf7 | InvenTree/company/api.py | InvenTree/company/api.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import filters
from rest_framework import generics, permissions
from django.conf.urls import url
from .models import Company
from .serializers import CompanySerializer
c... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import filters
from rest_framework import generics, permissions
from django.conf.urls import url
from .models import Company
from .serializers import CompanySerializer
c... | Add RUD endpoint for Company | Add RUD endpoint for Company
| Python | mit | SchrodingersGat/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree,inventree/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree |
a8818e2058fdfaec7f283a5115619d42d23b7dde | anchorhub/builtin/github/writer.py | anchorhub/builtin/github/writer.py | """
File that initializes a Writer object designed for GitHub style markdown files.
"""
from anchorhub.writer import Writer
from anchorhub.builtin.github.wstrategies import MarkdownATXWriterStrategy, \
MarkdownSetextWriterStrategy, MarkdownInlineLinkWriterStrategy
import anchorhub.builtin.github.switches as ghswit... | """
File that initializes a Writer object designed for GitHub style markdown files.
"""
from anchorhub.writer import Writer
from anchorhub.builtin.github.wstrategies import MarkdownATXWriterStrategy, \
MarkdownSetextWriterStrategy, MarkdownInlineLinkWriterStrategy
import anchorhub.builtin.github.switches as ghswit... | Use Setext strategy in GitHub built in Writer | Use Setext strategy in GitHub built in Writer
| Python | apache-2.0 | samjabrahams/anchorhub |
c154d79ba13d95f3240efd9eb4725cf9fc16060f | forms.py | forms.py | from flask_wtf import Form
from wtforms import StringField, PasswordField
from wtforms.validators import DataRequired, Email
class Login(Form):
username = StringField('Username', validators=[DataRequired()])
password = PasswordField('Password', validators=[DataRequired()])
| from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField
from wtforms.validators import DataRequired, Email
class Login(FlaskForm):
username = StringField('Username', validators=[DataRequired()])
password = PasswordField('Password', validators=[DataRequired()])
| Change deprecated flask_wtf.Form with flask_wtf.FlaskForm | Change deprecated flask_wtf.Form with flask_wtf.FlaskForm
| Python | mit | openedoo/module_employee,openedoo/module_employee,openedoo/module_employee |
ce95e50b7cb3ef9bbabddb033352aacb96b9237a | pywikibot/families/wikivoyage_family.py | pywikibot/families/wikivoyage_family.py | # -*- coding: utf-8 -*-
"""Family module for Wikivoyage."""
#
# (C) Pywikibot team, 2012-2016
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, unicode_literals
__version__ = '$Id$'
# The new wikivoyage family that is hosted at wikimedia
from pywikibot import family
clas... | # -*- coding: utf-8 -*-
"""Family module for Wikivoyage."""
#
# (C) Pywikibot team, 2012-2016
#
# Distributed under the terms of the MIT license.
#
# The new wikivoyage family that is hosted at wikimedia
from __future__ import absolute_import, unicode_literals
from pywikibot import family
__version__ = '$Id$'
class... | Add fi:wikivoyage and sort by current article count | Add fi:wikivoyage and sort by current article count
Fix also pycodestyle (former PEP8) E402 problem
Bug: T153470
Change-Id: Id9bc980c7a9cfb21063597a3d5eae11c31d8040c
| Python | mit | Darkdadaah/pywikibot-core,magul/pywikibot-core,jayvdb/pywikibot-core,hasteur/g13bot_tools_new,happy5214/pywikibot-core,magul/pywikibot-core,happy5214/pywikibot-core,Darkdadaah/pywikibot-core,npdoty/pywikibot,wikimedia/pywikibot-core,PersianWikipedia/pywikibot-core,hasteur/g13bot_tools_new,jayvdb/pywikibot-core,hasteur/... |
9cc15bc4a7ed8efb82071fa19e9d1ada8771a87d | app/soc/views/helper/decorators.py | app/soc/views/helper/decorators.py | #!/usr/bin/python2.5
#
# Copyright 2008 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | #!/usr/bin/python2.5
#
# Copyright 2008 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | Remove not needed request argument in view decorator. | Remove not needed request argument in view decorator.
Patch by: Pawel Solyga
Review by: to-be-reviewed
| Python | apache-2.0 | MatthewWilkes/mw4068-packaging,MatthewWilkes/mw4068-packaging,MatthewWilkes/mw4068-packaging,MatthewWilkes/mw4068-packaging |
38216f9d1b875c31b97c80bb9217557e67c92ff3 | spicedham/backend.py | spicedham/backend.py | class BaseBackend(object):
"""
A base class for backend plugins.
"""
def __init__(self, config):
pass
def reset(self):
"""
Resets the training data to a blank slate.
"""
raise NotImplementedError()
def get_key(self, classifier, key, default=None):
... | class BaseBackend(object):
"""
A base class for backend plugins.
"""
def __init__(self, config):
pass
def reset(self):
"""
Resets the training data to a blank slate.
"""
raise NotImplementedError()
def get_key(self, classification_type, classifier, key... | Add classifier type to the base class | Add classifier type to the base class
| Python | mpl-2.0 | mozilla/spicedham,mozilla/spicedham |
ba2f2d7e53f0ffc58c882d78f1b8bc9a468eb164 | predicates.py | predicates.py | class OneOf:
def __init__(self, members):
self.members = members
def __call__(self, candidate):
if candidate in self.members:
return True
return "%s not in %s" % (candidate, self.members)
def __repr__(self):
return "one of %s" % ', '.join(self.members)
def oneof(*members):
return OneOf(members)
class... | class OneOf:
def __init__(self, members):
self.members = members
def __call__(self, candidate):
if candidate in self.members:
return True
return "%s not in %s" % (candidate, self.members)
def __repr__(self):
return "one of %s" % ', '.join(map(repr, self.members))
def oneof(*members):
return OneOf(memb... | Fix problem rendering oneof() predicate when the members aren't strings | Fix problem rendering oneof() predicate when the members aren't strings
| Python | mit | mrozekma/pytypecheck |
7955e777d6ba3bbbd104bd3916f131ab7fa8f8b5 | asyncmongo/__init__.py | asyncmongo/__init__.py | #!/bin/env python
#
# Copyright 2010 bit.ly
#
# 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... | #!/bin/env python
#
# Copyright 2010 bit.ly
#
# 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... | Support Sort Order For TEXT Index | Support Sort Order For TEXT Index
| Python | apache-2.0 | RealGeeks/asyncmongo |
26efd98c88a627f76ebd0865053353eb7a30e3bb | .glerbl/repo_conf.py | .glerbl/repo_conf.py | checks = {
'pre-commit': [
# BEFORE_COMMIT in the root of the working tree can be used as
# reminder to do something before the next commit.
"no_before_commit",
# We only allow ASCII filenames.
"no_non_ascii_filenames",
# We don't allow trailing whitespaces.
... | import sys
import os
dirname = os.path.dirname(__file__)
python_path = os.path.join(os.path.dirname(dirname), "selenium_test", "lib")
if "PYTHONPATH" not in os.environ:
os.environ["PYTHONPATH"] = python_path
else:
os.environ["PYTHONPATH"] = python_path + ":" + os.environ["PYTHONPATH"]
checks = {
'pre-com... | Modify PYTHONPATH so that pylint is able to find wedutil. | Modify PYTHONPATH so that pylint is able to find wedutil.
| Python | mpl-2.0 | mangalam-research/wed,slattery/wed,lddubeau/wed,slattery/wed,mangalam-research/wed,slattery/wed,mangalam-research/wed,lddubeau/wed,mangalam-research/wed,lddubeau/wed,lddubeau/wed |
7608d0e89781f70fcb49e7dc3ee5cd57a094f18c | rx/__init__.py | rx/__init__.py | from .observable import Observable
from .anonymousobservable import AnonymousObservable
from .observer import Observer
from . import checkedobserver
from . import linq
from . import backpressure
try:
from asyncio import Future
except ImportError:
Future = None
# Rx configuration dictionary
config = {
"Fut... | from threading import Lock
from .observable import Observable
from .anonymousobservable import AnonymousObservable
from .observer import Observer
from . import checkedobserver
from . import linq
from . import backpressure
try:
from asyncio import Future
except ImportError:
Future = None
# Rx configuration di... | Make it possible to set custom Lock | Make it possible to set custom Lock
| Python | mit | ReactiveX/RxPY,ReactiveX/RxPY,dbrattli/RxPY |
0aa61fb32df9ae3ef9c465f4b246edf04897cd14 | staticfiles/views.py | staticfiles/views.py | """
Views and functions for serving static files. These are only to be used during
development, and SHOULD NOT be used in a production setting.
"""
from django.views.static import serve as django_serve
from staticfiles.resolvers import resolve
def serve(request, path, show_indexes=False):
"""
Serve static fi... | """
Views and functions for serving static files. These are only to be used during
development, and SHOULD NOT be used in a production setting.
"""
from django import http
from django.views.static import serve as django_serve
from staticfiles.resolvers import resolve
def serve(request, path, show_indexes=False):
... | Make the staticfiles serve view raise a 404 for paths which could not be resolved. | Make the staticfiles serve view raise a 404 for paths which could not be resolved.
| Python | bsd-3-clause | tusbar/django-staticfiles,jezdez-archive/django-staticfiles,tusbar/django-staticfiles |
e640ed3770cd3c3dbab90866a77449d17a633704 | wcsaxes/wcs_utils.py | wcsaxes/wcs_utils.py | # Adapted from Astropy core package until 1.0 is released
#
# Copyright (c) 2011-2014, Astropy Developers
#
# 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 mus... | import numpy as np
| Remove old LICENSE that was there for astropy-ported code | Remove old LICENSE that was there for astropy-ported code
| Python | bsd-3-clause | stargaser/astropy,stargaser/astropy,saimn/astropy,astropy/astropy,DougBurke/astropy,aleksandr-bakanov/astropy,pllim/astropy,mhvk/astropy,AustereCuriosity/astropy,StuartLittlefair/astropy,bsipocz/astropy,tbabej/astropy,StuartLittlefair/astropy,AustereCuriosity/astropy,larrybradley/astropy,larrybradley/astropy,joergdietr... |
979c56f882178ce49194850bd9e78c9dea4692dd | chardet/__init__.py | chardet/__init__.py | ######################## BEGIN LICENSE BLOCK ########################
# 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... | ######################## BEGIN LICENSE BLOCK ########################
# 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... | Remove unnecessary line from detect | Remove unnecessary line from detect
| Python | lgpl-2.1 | ddboline/chardet,chardet/chardet,chardet/chardet,ddboline/chardet |
e0989ff4c2292d0f2d053065bfa71124a3705559 | jarn/mkrelease/colors.py | jarn/mkrelease/colors.py | import os
import functools
import blessed
def color(func):
functools.wraps(func)
def wrapper(string):
if os.environ.get('JARN_NO_COLOR') == '1':
return string
return func(string)
return wrapper
term = blessed.Terminal()
bold = color(term.bold)
blue = color(term.bold_blue)
gr... | import os
import functools
import blessed
def color(func):
assignments = functools.WRAPPER_ASSIGNMENTS
if not hasattr(func, '__name__'):
assignments = [x for x in assignments if x != '__name__']
@functools.wraps(func, assignments)
def wrapper(string):
if os.environ.get('JARN_NO_COLOR'... | Fix wrapping in color decorator. | Fix wrapping in color decorator.
| Python | bsd-2-clause | Jarn/jarn.mkrelease |
9ddc63eb0e1e3612ac4a1ea5b95e405ca0915b52 | setup.py | setup.py | #!/usr/bin/env python
from distutils.core import setup
setup(name="sysops-api",
version="1.0",
description="LinkedIn Redis / Cfengine API",
author = "Mike Svoboda",
author_email = "msvoboda@linkedin.com",
py_modules=['CacheExtractor', 'RedisFinder'],
data_files=[('/usr/local/bin', [... | #!/usr/bin/env python
from distutils.core import setup
setup(name="sysops-api",
version="1.0",
description="LinkedIn Redis / Cfengine API",
author="Mike Svoboda",
author_email="msvoboda@linkedin.com",
py_modules=['CacheExtractor', 'RedisFinder'],
scripts=['scripts/extract_sysops_cac... | Install scripts properly rather than as datafiles | Install scripts properly rather than as datafiles
- also fix whitespace
| Python | apache-2.0 | linkedin/sysops-api,linkedin/sysops-api,slietz/sysops-api,slietz/sysops-api |
2727fccdb3672e1c7b28e4ba94ec743b53298f26 | src/main.py | src/main.py | '''
Created on Aug 12, 2017
@author: Aditya
This is the main file and will import other modules/codes written for python tkinter demonstration
'''
import program1 as p1
import program2 as p2
import program3 as p3
import program4 as p4
import program5 as p5
import program6 as p6
import program7 as p7
i... | '''
Created on Aug 12, 2017
@author: Aditya
This is the main file and will import other modules/codes written for python tkinter demonstration
'''
import program1 as p1
import program2 as p2
import program3 as p3
import program4 as p4
import program5 as p5
import program6 as p6
import program7 as p7
i... | Include Text App in Main | Include Text App in Main | Python | mit | deshadi/python-gui-demos |
e3a2e65199c3d0db9576a25dc039f66e094171b6 | src/passgen.py | src/passgen.py | import string
import random
import argparse
def passgen(length=8):
"""Generate a strong password with *length* characters"""
pool = string.ascii_uppercase + string.ascii_lowercase + string.digits
return ''.join(random.SystemRandom().choice(pool) for _ in range(length))
def main():
parser = argparse.... | import string
import random
import argparse
def passgen(length=12):
"""Generate a strong password with *length* characters"""
pool = string.ascii_uppercase + string.ascii_lowercase + string.digits
return ''.join(random.SystemRandom().choice(pool) for _ in range(length))
def main():
parser = argparse... | Make length optional. Set up defaults. | Make length optional. Set up defaults.
| Python | mit | soslan/passgen |
1e327401d9c020bb7941b20ff51890ad1729973d | tests.py | tests.py | import pytest
from django.contrib.auth import get_user_model
from seleniumlogin import force_login
pytestmark = [pytest.mark.django_db(transaction=True)]
def test_non_authenticated_user_cannot_access_test_page(selenium, live_server):
selenium.get('{}/test/login_required/'.format(live_server.url))
assert 'fa... | import pytest
from django.contrib.auth import get_user_model
from seleniumlogin import force_login
pytestmark = [pytest.mark.django_db(transaction=True)]
def test_non_authenticated_user_cannot_access_test_page(selenium, live_server):
selenium.get('{}/test/login_required/'.format(live_server.url))
assert 'fa... | Rename test. The test tries to access a test page, not a blank page | Rename test. The test tries to access a test page, not a blank page
| Python | mit | feffe/django-selenium-login,feffe/django-selenium-login |
741545dcf58fdfaf882d797d3ce4f7607ca0dad4 | kobo/client/commands/cmd_resubmit_tasks.py | kobo/client/commands/cmd_resubmit_tasks.py | # -*- coding: utf-8 -*-
from __future__ import print_function
import sys
from kobo.client.task_watcher import TaskWatcher
from kobo.client import ClientCommand
class Resubmit_Tasks(ClientCommand):
"""resubmit failed tasks"""
enabled = True
def options(self):
self.parser.usage = "%%prog %s tas... | # -*- coding: utf-8 -*-
from __future__ import print_function
import sys
from kobo.client.task_watcher import TaskWatcher
from kobo.client import ClientCommand
class Resubmit_Tasks(ClientCommand):
"""resubmit failed tasks"""
enabled = True
def options(self):
self.parser.usage = "%%prog %s tas... | Add --nowait option to resubmit-tasks cmd | Add --nowait option to resubmit-tasks cmd
In some use cases, waiting till the tasks finish is undesirable. Nowait
option should be provided.
| Python | lgpl-2.1 | release-engineering/kobo,release-engineering/kobo,release-engineering/kobo,release-engineering/kobo |
8e7a92bce03ca472bc78bb9df5e2c9cf063c29b7 | temba/campaigns/tasks.py | temba/campaigns/tasks.py | from __future__ import unicode_literals
from datetime import datetime
from django.utils import timezone
from djcelery_transactions import task
from redis_cache import get_redis_connection
from .models import Campaign, EventFire
from django.conf import settings
import redis
from temba.msgs.models import HANDLER_QUEUE, ... | from __future__ import unicode_literals
from datetime import datetime
from django.utils import timezone
from djcelery_transactions import task
from redis_cache import get_redis_connection
from .models import Campaign, EventFire
from django.conf import settings
import redis
from temba.msgs.models import HANDLER_QUEUE, ... | Use correct field to get org from | Use correct field to get org from
| Python | agpl-3.0 | harrissoerja/rapidpro,pulilab/rapidpro,pulilab/rapidpro,reyrodrigues/EU-SMS,tsotetsi/textily-web,harrissoerja/rapidpro,tsotetsi/textily-web,pulilab/rapidpro,tsotetsi/textily-web,Thapelo-Tsotetsi/rapidpro,Thapelo-Tsotetsi/rapidpro,ewheeler/rapidpro,praekelt/rapidpro,harrissoerja/rapidpro,praekelt/rapidpro,reyrodrigues/E... |
1e2086b868861034d89138349c4da909f380f19e | feedback/views.py | feedback/views.py | from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_exempt
from rest_framework import serializers, status
from rest_framework.response import Response
from rest_framework.views import APIView
from .models import Feedback
class FeedbackSerializer(serializers.ModelSeriali... | from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_exempt
from rest_framework import serializers, status
from rest_framework.response import Response
from rest_framework.views import APIView
from .models import Feedback
class FeedbackSerializer(serializers.ModelSeriali... | Make feedback compatible with DRF >3.3.0 | Make feedback compatible with DRF >3.3.0
| Python | mit | City-of-Helsinki/digihel,City-of-Helsinki/digihel,City-of-Helsinki/digihel,City-of-Helsinki/digihel |
90bdcad66a6f29c9e3d731b5b09b0a2ba477ae2f | tviit/urls.py | tviit/urls.py | from django.conf.urls import include, url
from django.contrib import admin
from . import views
urlpatterns = [
url(r'^', views.IndexView.as_view(), name='tviit_index'),
]
| from django.conf.urls import include, url
from django.contrib import admin
from . import views
urlpatterns = [
url(r'^$', views.IndexView.as_view(), name='tviit_index'),
url(r'create/$', views.create_tviit, name="create_tviit"),
]
| Create url-patterns for tviit creation | Create url-patterns for tviit creation
| Python | mit | DeWaster/Tviserrys,DeWaster/Tviserrys |
881222a49c6b3e8792adf5754c61992bd12c7b28 | tests/test_conduction.py | tests/test_conduction.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Test Mongo Conduction."""
import logging
import pymongo
from mockupdb import go
from pymongo.errors import OperationFailure
from conduction.server import get_mockup, main_loop
from tests import unittest # unittest2 on Python 2.6.
class ConductionTest(unittest.Test... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Test Mongo Conduction."""
import logging
import pymongo
from mockupdb import go
from pymongo.errors import OperationFailure
from conduction.server import get_mockup, main_loop
from tests import unittest # unittest2 on Python 2.6.
class ConductionTest(unittest.Test... | Test root URI and 404s. | Test root URI and 404s.
| Python | apache-2.0 | ajdavis/mongo-conduction |
e3b1a323921b8331d7fd84c013e80a89a5b21bde | haproxy_status.py | haproxy_status.py | #!/usr/bin/env python
from BaseHTTPServer import BaseHTTPRequestHandler
from helpers.etcd import Etcd
from helpers.postgresql import Postgresql
import sys, yaml, socket
f = open(sys.argv[1], "r")
config = yaml.load(f.read())
f.close()
etcd = Etcd(config["etcd"])
postgresql = Postgresql(config["postgresql"])
class S... | #!/usr/bin/env python
from BaseHTTPServer import BaseHTTPRequestHandler
from helpers.etcd import Etcd
from helpers.postgresql import Postgresql
import sys, yaml, socket
f = open(sys.argv[1], "r")
config = yaml.load(f.read())
f.close()
etcd = Etcd(config["etcd"])
postgresql = Postgresql(config["postgresql"])
class S... | Add the ability to query for the replica status of a PG instance | Add the ability to query for the replica status of a PG instance
| Python | mit | Tapjoy/governor |
d0191c43c784b229ce104700989dfb91c67ec490 | helper/windows.py | helper/windows.py | """
Windows platform support for running the application as a detached process.
"""
import multiprocessing
import subprocess
import sys
DETACHED_PROCESS = 8
class Daemon(object):
def __init__(self, controller, user=None, group=None,
pid_file=None, prevent_core=None, exception_log=None):
... | """
Windows platform support for running the application as a detached process.
"""
import subprocess
import sys
DETACHED_PROCESS = 8
class Daemon(object):
"""Daemonize the helper application, putting it in a forked background
process.
"""
def __init__(self, controller):
raise NotImplemente... | Raise a NotImplementedError for Windows | Raise a NotImplementedError for Windows
| Python | bsd-3-clause | gmr/helper,dave-shawley/helper,gmr/helper |
b8350e91d7bd1e3a775ed230820c96a180a2ad02 | tests/test_solver.py | tests/test_solver.py | from tinyik import Link, Joint, FKSolver
from .utils import x, y, z, theta, approx_eq
def test_forward_kinematics():
fk = FKSolver([
Joint('z'), Link([1., 0., 0.]), Joint('y'), Link([1., 0., 0.])
])
assert all(fk.solve([0., 0.]) == [2., 0., 0.])
assert approx_eq(fk.solve([theta, theta]), [x,... | from tinyik import Link, Joint, FKSolver, CCDFKSolver, CCDIKSolver
from .utils import x, y, z, theta, approx_eq
components = [Joint('z'), Link([1., 0., 0.]), Joint('y'), Link([1., 0., 0.])]
predicted = [2., 0., 0.]
def test_fk():
fk = FKSolver(components)
assert all(fk.solve([0., 0.]) == predicted)
as... | Add tests for CCD IK solver | Add tests for CCD IK solver
| Python | mit | lanius/tinyik |
2f63f134d2c9aa67044eb176a3f81857279f107d | troposphere/utils.py | troposphere/utils.py | import time
def get_events(conn, stackname):
"""Get the events in batches and return in chronological order"""
next = None
event_list = []
while 1:
events = conn.describe_stack_events(stackname, next)
event_list.append(events)
if events.next_token is None:
break
... | import time
def _tail_print(e):
print("%s %s %s" % (e.resource_status, e.resource_type, e.event_id))
def get_events(conn, stackname):
"""Get the events in batches and return in chronological order"""
next = None
event_list = []
while 1:
events = conn.describe_stack_events(stackname, next... | Support a custom logging function and sleep time within tail | Support a custom logging function and sleep time within tail
| Python | bsd-2-clause | mhahn/troposphere |
35594a4f8c549d507c7d7030141ae511aed57c09 | workflowmax/__init__.py | workflowmax/__init__.py | from .api import WorkflowMax # noqa
__version__ = "0.1.0"
| from .api import WorkflowMax # noqa
from .credentials import Credentials # noqa
__version__ = "0.1.0"
| Add Credentials to root namespace | Add Credentials to root namespace
| Python | bsd-3-clause | ABASystems/pyworkflowmax |
ab5aac0c9b0e075901c4cd8dd5d134e79f0e0110 | brasileirao/spiders/results_spider.py | brasileirao/spiders/results_spider.py | import scrapy
import scrapy.selector
from brasileirao.items import BrasileiraoItem
import hashlib
class ResultsSpider(scrapy.Spider):
name = "results"
start_urls = [
'https://esporte.uol.com.br/futebol/campeonatos/brasileirao/jogos/',
]
def parse(self, response):
actual_round = 0
... | # -*- coding: utf-8 -*-
import scrapy
import scrapy.selector
from brasileirao.items import BrasileiraoItem
import hashlib
class ResultsSpider(scrapy.Spider):
name = "results"
start_urls = [
'https://esporte.uol.com.br/futebol/campeonatos/brasileirao/jogos/',
]
def parse(self, response):
... | Set utf-8 as default encoding. | Set utf-8 as default encoding.
| Python | mit | pghilardi/live-football-client |
a3c1822dd2942de4b6bf5cac14039e6789babf85 | wafer/pages/admin.py | wafer/pages/admin.py | from django.contrib import admin
from wafer.pages.models import File, Page
class PageAdmin(admin.ModelAdmin):
prepopulated_fields = {"slug": ("name",)}
list_display = ('name', 'slug', 'get_people_display_names', 'get_in_schedule')
admin.site.register(Page, PageAdmin)
admin.site.register(File)
| from django.contrib import admin
from wafer.pages.models import File, Page
from reversion.admin import VersionAdmin
class PageAdmin(VersionAdmin, admin.ModelAdmin):
prepopulated_fields = {"slug": ("name",)}
list_display = ('name', 'slug', 'get_people_display_names', 'get_in_schedule')
admin.site.register(... | Add reversion support to Pages | Add reversion support to Pages
| Python | isc | CTPUG/wafer,CTPUG/wafer,CTPUG/wafer,CTPUG/wafer |
d30605d82d5f04e8478c785f1bb5086066e50878 | awx/wsgi.py | awx/wsgi.py | # Copyright (c) 2015 Ansible, Inc.
# All Rights Reserved.
import logging
from django.core.wsgi import get_wsgi_application
from awx import prepare_env
from awx import __version__ as tower_version
"""
WSGI config for AWX project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more... | # Copyright (c) 2015 Ansible, Inc.
# All Rights Reserved.
import logging
from awx import __version__ as tower_version
# Prepare the AWX environment.
from awx import prepare_env
prepare_env()
from django.core.wsgi import get_wsgi_application
"""
WSGI config for AWX project.
It exposes the WSGI callable as a module-... | Fix import error by calling prepare_env first | Fix import error by calling prepare_env first
| Python | apache-2.0 | wwitzel3/awx,snahelou/awx,snahelou/awx,snahelou/awx,wwitzel3/awx,wwitzel3/awx,snahelou/awx,wwitzel3/awx |
4076fb322814848d802d1f925d163e90b3d629a9 | selenium_testcase/testcases/forms.py | selenium_testcase/testcases/forms.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from selenium.webdriver.common.by import By
from .utils import wait_for
class FormTestMixin:
# default search element
form_search_list = (
(By.ID, '{}',),
(By.NAME, '{}',),
(By.XPATH, '//form[@action="{}"]',),
(... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from selenium.webdriver.common.by import By
from .utils import wait_for
class FormTestMixin:
# default search element
form_search_list = (
(By.ID, '{}',),
(By.NAME, '{}',),
(By.XPATH, '//form[@action="{}"]',),
(... | Split get_input from set_input in FormTestMixin. | Split get_input from set_input in FormTestMixin.
In order to reduce side-effects, this commit moves the @wait_for to
a get_input method and set_input operates immediately.
| Python | bsd-3-clause | nimbis/django-selenium-testcase,nimbis/django-selenium-testcase |
149a8091333766068cac445db770ea73055d8647 | simuvex/procedures/stubs/UserHook.py | simuvex/procedures/stubs/UserHook.py | import simuvex
class UserHook(simuvex.SimProcedure):
NO_RET = True
# pylint: disable=arguments-differ
def run(self, user_func=None, user_kwargs=None, default_return_addr=None):
result = user_func(self.state, **user_kwargs)
if result is None:
self.add_successor(self.state, defau... | import simuvex
class UserHook(simuvex.SimProcedure):
NO_RET = True
# pylint: disable=arguments-differ
def run(self, user_func=None, user_kwargs=None, default_return_addr=None, length=None):
result = user_func(self.state, **user_kwargs)
if result is None:
self.add_successor(self... | Make the userhook take the length arg b/c why not | Make the userhook take the length arg b/c why not
| Python | bsd-2-clause | axt/angr,schieb/angr,tyb0807/angr,chubbymaggie/angr,chubbymaggie/simuvex,chubbymaggie/angr,chubbymaggie/simuvex,f-prettyland/angr,axt/angr,angr/angr,f-prettyland/angr,tyb0807/angr,schieb/angr,axt/angr,chubbymaggie/angr,f-prettyland/angr,iamahuman/angr,tyb0807/angr,iamahuman/angr,angr/angr,iamahuman/angr,angr/angr,schie... |
8528beef5d10355af07f641b4987df3cd64a7b0f | sprockets/mixins/metrics/__init__.py | sprockets/mixins/metrics/__init__.py | from .influxdb import InfluxDBMixin
from .statsd import StatsdMixin
version_info = (1, 0, 0)
__version__ = '.'.join(str(v) for v in version_info)
__all__ = ['InfluxDBMixin', 'StatsdMixin']
| try:
from .influxdb import InfluxDBMixin
from .statsd import StatsdMixin
except ImportError as error:
def InfluxDBMixin(*args, **kwargs):
raise error
def StatsdMixin(*args, **kwargs):
raise error
version_info = (1, 0, 0)
__version__ = '.'.join(str(v) for v in version_info)
__all__ = ['... | Make it safe to import __version__. | Make it safe to import __version__.
| Python | bsd-3-clause | sprockets/sprockets.mixins.metrics |
afa6687c317191b77949ba246f3dcc0909c435f5 | organizer/urls/tag.py | organizer/urls/tag.py | from django.conf.urls import url
from ..models import Tag
from ..utils import DetailView
from ..views import (
TagCreate, TagDelete, TagList, TagPageList,
TagUpdate)
urlpatterns = [
url(r'^$',
TagList.as_view(),
name='organizer_tag_list'),
url(r'^create/$',
TagCreate.as_view(),... | from django.conf.urls import url
from ..views import (
TagCreate, TagDelete, TagDetail, TagList,
TagPageList, TagUpdate)
urlpatterns = [
url(r'^$',
TagList.as_view(),
name='organizer_tag_list'),
url(r'^create/$',
TagCreate.as_view(),
name='organizer_tag_create'),
ur... | Revert to Tag Detail URL pattern. | Ch17: Revert to Tag Detail URL pattern.
| Python | bsd-2-clause | jambonrose/DjangoUnleashed-1.8,jambonrose/DjangoUnleashed-1.8 |
7b1d520278b8fe33b68103d26f9aa7bb945f6791 | cryptography/hazmat/backends/__init__.py | cryptography/hazmat/backends/__init__.py | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | Make the default backend be a multi-backend | Make the default backend be a multi-backend
| Python | bsd-3-clause | bwhmather/cryptography,Ayrx/cryptography,bwhmather/cryptography,Lukasa/cryptography,Ayrx/cryptography,bwhmather/cryptography,kimvais/cryptography,skeuomorf/cryptography,dstufft/cryptography,kimvais/cryptography,Lukasa/cryptography,dstufft/cryptography,Ayrx/cryptography,skeuomorf/cryptography,Lukasa/cryptography,sholsap... |
0f3b413b269f8b95b6f8073ba39d11f156ae632c | zwebtest.py | zwebtest.py | """ Multicast DNS Service Discovery for Python, v0.14-wmcbrine
Copyright 2003 Paul Scott-Murphy, 2014 William McBrine
This module provides a unit test suite for the Multicast DNS
Service Discovery for Python module.
This library is free software; you can redistribute it and/or
modify it under the ... | from zeroconf import *
import socket
desc = {'path': '/~paulsm/'}
info = ServiceInfo("_http._tcp.local.",
"Paul's Test Web Site._http._tcp.local.",
socket.inet_aton("10.0.1.2"), 80, 0, 0,
desc, "ash-2.local.")
r = Zeroconf()
print "Registration of a service...... | Allow graceful exit from announcement test. | Allow graceful exit from announcement test.
| Python | lgpl-2.1 | basilfx/python-zeroconf,daid/python-zeroconf,jstasiak/python-zeroconf,gbiddison/python-zeroconf,giupo/python-zeroconf,AndreaCensi/python-zeroconf,nameoftherose/python-zeroconf,balloob/python-zeroconf,wmcbrine/pyzeroconf,decabyte/python-zeroconf,jantman/python-zeroconf |
5957999c52f939691cbe6b8dd5aa929980a24501 | tests/unit/test_start.py | tests/unit/test_start.py | import pytest
from iwant_bot import start
def test_add():
assert start.add_numbers(0, 0) == 0
assert start.add_numbers(1, 1) == 2
| from iwant_bot import start
def test_add():
assert start.add_numbers(0, 0) == 0
assert start.add_numbers(1, 1) == 2
| Remove the unused pytest import | Remove the unused pytest import
| Python | mit | kiwicom/iwant-bot |
f5d4da9fa71dbb59a9459e376fde8840037bf39a | account_banking_sepa_credit_transfer/__init__.py | account_banking_sepa_credit_transfer/__init__.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# SEPA Credit Transfer module for OpenERP
# Copyright (C) 2010-2013 Akretion (http://www.akretion.com)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you ... | # -*- encoding: utf-8 -*-
##############################################################################
#
# SEPA Credit Transfer module for OpenERP
# Copyright (C) 2010-2013 Akretion (http://www.akretion.com)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you ... | Remove import models from init in sepa_credit_transfer | Remove import models from init in sepa_credit_transfer
| Python | agpl-3.0 | open-synergy/bank-payment,sergio-incaser/bank-payment,hbrunn/bank-payment,sergio-teruel/bank-payment,ndtran/bank-payment,David-Amaro/bank-payment,rlizana/bank-payment,sergiocorato/bank-payment,damdam-s/bank-payment,CompassionCH/bank-payment,CompassionCH/bank-payment,incaser/bank-payment,Antiun/bank-payment,sergio-terue... |
f1a1272bebcc4edf9063c75d3fe29fdcb9e277eb | rml/unitconversion.py | rml/unitconversion.py | import numpy as np
class UnitConversion():
def __init__(self, coef):
self.p = np.poly1d(coef)
def machine_to_physics(self, machine_value):
return self.p(machine_value)
def physics_to_machine(self, physics_value):
roots = (self.p - physics_value).roots
positive_roots = [ro... | import numpy as np
from scipy.interpolate import PchipInterpolator
class UnitConversion():
def __init__(self, coef):
self.p = np.poly1d(coef)
def machine_to_physics(self, machine_value):
return self.p(machine_value)
def physics_to_machine(self, physics_value):
roots = (self.p - p... | Add PPChipInterpolator unit conversion class | Add PPChipInterpolator unit conversion class
| Python | apache-2.0 | willrogers/pml,razvanvasile/RML,willrogers/pml |
00e4663940ed1d22e768b3de3d1c645c8649aecc | src/WhiteLibrary/keywords/items/textbox.py | src/WhiteLibrary/keywords/items/textbox.py | from TestStack.White.UIItems import TextBox
from WhiteLibrary.keywords.librarycomponent import LibraryComponent
from WhiteLibrary.keywords.robotlibcore import keyword
class TextBoxKeywords(LibraryComponent):
@keyword
def input_text_to_textbox(self, locator, input):
"""
Writes text to a textbox... | from TestStack.White.UIItems import TextBox
from WhiteLibrary.keywords.librarycomponent import LibraryComponent
from WhiteLibrary.keywords.robotlibcore import keyword
class TextBoxKeywords(LibraryComponent):
@keyword
def input_text_to_textbox(self, locator, input_value):
"""
Writes text to a t... | Change to better argument name | Change to better argument name
| Python | apache-2.0 | Omenia/robotframework-whitelibrary,Omenia/robotframework-whitelibrary |
39dbbac659e9ae9c1bbad8a979cc99ef6eafaeff | models.py | models.py | #!/usr/bin/env python
import os
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = os.environ.get('DATABASE_URL')
db = SQLAlchemy(app)
class FoodMenu(db.Model):
id = db.Column(db.Integer, primary_key=True)
result = db.Column(db.Text)
d... | #!/usr/bin/env python
import os
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = os.environ.get('DATABASE_URL')
db = SQLAlchemy(app)
class FoodMenu(db.Model):
id = db.Column(db.Integer, primary_key=True)
result = db.Column(db.Text)
d... | Include class name in model representations | Include class name in model representations
| Python | mit | alykhank/FoodMenu,alykhank/FoodMenu,alykhank/FoodMenu |
e16c65ec8c774cc27f9f7aa43e88521c3854b6b7 | ella/imports/management/commands/fetchimports.py | ella/imports/management/commands/fetchimports.py | from django.core.management.base import BaseCommand
from optparse import make_option
class Command(BaseCommand):
help = 'Fetch all registered imports'
def handle(self, *test_labels, **options):
from ella.imports.models import fetch_all
fetch_all()
| from django.core.management.base import NoArgsCommand
from optparse import make_option
import sys
class Command(NoArgsCommand):
help = 'Fetch all registered imports'
def handle(self, *test_labels, **options):
from ella.imports.models import fetch_all
errors = fetch_all()
if errors:
... | Return exit code (count of errors) | Return exit code (count of errors)
git-svn-id: 6ce22b13eace8fe533dbb322c2bb0986ea4cd3e6@520 2d143e24-0a30-0410-89d7-a2e95868dc81
| Python | bsd-3-clause | MichalMaM/ella,MichalMaM/ella,WhiskeyMedia/ella,whalerock/ella,ella/ella,whalerock/ella,WhiskeyMedia/ella,petrlosa/ella,petrlosa/ella,whalerock/ella |
45c400e02fbeb5b455e27fef81e47e45f274eaec | core/forms.py | core/forms.py |
from django import forms
class GameForm(forms.Form):
amount = forms.IntegerField()
def __init__(self, *args, **kwargs):
super(GameForm, self).__init__(*args, **kwargs)
for name, field in self.fields.items():
if isinstance(field, forms.IntegerField):
self.fields[n... |
from django import forms
class GameForm(forms.Form):
amount = forms.IntegerField(initial=100)
def __init__(self, *args, **kwargs):
super(GameForm, self).__init__(*args, **kwargs)
for name, field in self.fields.items():
if isinstance(field, forms.IntegerField):
se... | Add a default bet amount. | Add a default bet amount.
| Python | bsd-2-clause | stephenmcd/gamblor,stephenmcd/gamblor |
fcc571d2f4c35ac8f0e94e51e6ac94a0c051062d | src/rinoh/__init__.py | src/rinoh/__init__.py | # This file is part of rinohtype, the Python document preparation system.
#
# Copyright (c) Brecht Machiels.
#
# Use of this source code is subject to the terms of the GNU Affero General
# Public License v3. See the LICENSE file or http://www.gnu.org/licenses/.
"""rinohtype
"""
import os
import sys
from importlib ... | # This file is part of rinohtype, the Python document preparation system.
#
# Copyright (c) Brecht Machiels.
#
# Use of this source code is subject to the terms of the GNU Affero General
# Public License v3. See the LICENSE file or http://www.gnu.org/licenses/.
"""rinohtype
"""
import os
import sys
from importlib ... | Update the top-level rinoh package | Update the top-level rinoh package
Make all symbols and modules relevant to users available directly
from the rinoh package.
| Python | agpl-3.0 | brechtm/rinohtype,brechtm/rinohtype,brechtm/rinohtype |
f9293d838a21f495ea9b56cbe0f6f75533360aed | pyinfra/api/config.py | pyinfra/api/config.py | import six
from pyinfra import logger
class Config(object):
'''
The default/base configuration options for a pyinfra deploy.
'''
state = None
# % of hosts which have to fail for all operations to stop
FAIL_PERCENT = None
# Seconds to timeout SSH connections
CONNECT_TIMEOUT = 10
... | import six
class Config(object):
'''
The default/base configuration options for a pyinfra deploy.
'''
state = None
# % of hosts which have to fail for all operations to stop
FAIL_PERCENT = None
# Seconds to timeout SSH connections
CONNECT_TIMEOUT = 10
# Temporary directory (on ... | Remove support for deprecated `Config.TIMEOUT`. | Remove support for deprecated `Config.TIMEOUT`.
| Python | mit | Fizzadar/pyinfra,Fizzadar/pyinfra |
94596f036270f8958afd84eb9788ce2b15f5cbd4 | registration/admin.py | registration/admin.py | from django.contrib import admin
from registration.models import RegistrationProfile
class RegistrationAdmin(admin.ModelAdmin):
list_display = ('__unicode__', 'activation_key_expired')
search_fields = ('user__username', 'user__first_name')
admin.site.register(RegistrationProfile, RegistrationAdmin)
| from django.contrib import admin
from registration.models import RegistrationProfile
class RegistrationAdmin(admin.ModelAdmin):
list_display = ('__unicode__', 'activation_key_expired')
raw_id_fields = ['user']
search_fields = ('user__username', 'user__first_name')
admin.site.register(RegistrationProfil... | Use raw_id_fields for the relation from RegistrationProfile to User, for sites which have huge numbers of users. | Use raw_id_fields for the relation from RegistrationProfile to User, for sites which have huge numbers of users.
| Python | bsd-3-clause | rafaduran/django-pluggable-registration,rbarrois/django-registration,maraujop/django-registration,thedod/django-registration-hg-mirror,CoatedMoose/django-registration,AndrewLvov/django-registration,AndrewLvov/django-registration,aptivate/django-registration,fedenko/django-registration,CoatedMoose/django-registration,ch... |
22f3d6d6fdc3e5f07ead782828b406c9a27d0199 | UDPSender.py | UDPSender.py | from can import Listener
import socket
class UDPSender(Listener):
dataConvert = {"0x600": {"String":"RPM:",
"Slot":0,
"Conversion":1},
"0x601": {"String":"OIL:",
"Slot":2,
"Convers... | from can import Listener
from socket import socket
class UDPSender(Listener):
dataConvert = {"0x600": {"String":"RPM:",
"Slot":0,
"Conversion":1},
"0x601": {"String":"OIL:",
"Slot":2,
... | Change of import of libraries. | Change of import of libraries.
Tried to fix issue displayed below.
[root@alarm BeagleDash]# python3.3 CANtoUDP.py
Traceback (most recent call last):
File "CANtoUDP.py", line 10, in <module>
listeners = [csv, UDPSender()]
TypeError: 'module' object is not callable
Exception AttributeError: "'super' object has no attri... | Python | mit | TAURacing/BeagleDash |
1da2c0e00d43c4fb9a7039e98401d333d387a057 | saleor/search/views.py | saleor/search/views.py | from __future__ import unicode_literals
from django.core.paginator import Paginator, InvalidPage
from django.conf import settings
from django.http import Http404
from django.shortcuts import render
from .forms import SearchForm
from ..product.utils import products_with_details
def paginate_results(results, get_data,... | from __future__ import unicode_literals
from django.core.paginator import Paginator, InvalidPage
from django.conf import settings
from django.http import Http404
from django.shortcuts import render
from .forms import SearchForm
from ..product.utils import products_with_details
def paginate_results(results, get_data,... | Fix empty search results logic | Fix empty search results logic
| Python | bsd-3-clause | mociepka/saleor,jreigel/saleor,itbabu/saleor,maferelo/saleor,KenMutemi/saleor,HyperManTT/ECommerceSaleor,HyperManTT/ECommerceSaleor,HyperManTT/ECommerceSaleor,KenMutemi/saleor,tfroehlich82/saleor,jreigel/saleor,KenMutemi/saleor,itbabu/saleor,car3oon/saleor,maferelo/saleor,car3oon/saleor,UITools/saleor,maferelo/saleor,i... |
6c9b0b0c7e78524ea889f8a89c2eba8acb57f782 | gaphor/ui/iconname.py | gaphor/ui/iconname.py | """
With `get_icon_name` you can retrieve an icon name
for a UML model element.
"""
from gaphor import UML
import re
from functools import singledispatch
TO_KEBAB = re.compile(r"([a-z])([A-Z]+)")
def to_kebab_case(s):
return TO_KEBAB.sub("\\1-\\2", s).lower()
@singledispatch
def get_icon_name(element):
"... | """
With `get_icon_name` you can retrieve an icon name
for a UML model element.
"""
from gaphor import UML
import re
from functools import singledispatch
TO_KEBAB = re.compile(r"([a-z])([A-Z]+)")
def to_kebab_case(s):
return TO_KEBAB.sub("\\1-\\2", s).lower()
@singledispatch
def get_icon_name(element):
"... | Fix stereotype icon in namespace view | Fix stereotype icon in namespace view
| Python | lgpl-2.1 | amolenaar/gaphor,amolenaar/gaphor |
9a33ac3f563ad657129d64cb591f08f9fd2a00a2 | tests/test_command.py | tests/test_command.py | """Unittest of command entry point."""
# Copyright 2015 Masayuki Yamamoto
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | """Unittest of command entry point."""
# Copyright 2015 Masayuki Yamamoto
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | Add command test for '--version' option | Add command test for '--version' option
Check output that is program name, "version" and version number.
| Python | apache-2.0 | ma8ma/yanico |
9d23940c430a4f95ec11b33362141ec2ffc3f533 | src/tempel/models.py | src/tempel/models.py | from datetime import datetime, timedelta
from django.db import models
from django.conf import settings
from tempel import utils
def default_edit_expires():
return datetime.now() + timedelta(seconds=60*settings.TEMPEL_EDIT_AGE)
class Entry(models.Model):
content = models.TextField()
language = models.Cha... | from datetime import datetime, timedelta
from django.db import models
from django.conf import settings
from tempel import utils
def default_edit_expires():
return datetime.now() + timedelta(seconds=60*settings.TEMPEL_EDIT_AGE)
class Entry(models.Model):
content = models.TextField()
language = models.Cha... | Add is_editable and done_editable functions to Entry | Add is_editable and done_editable functions to Entry
| Python | agpl-3.0 | fajran/tempel |
02ca3946662fd996f77c30d9e61d8fc8d9243de7 | trac/upgrades/db20.py | trac/upgrades/db20.py | from trac.db import Table, Column, Index, DatabaseManager
from trac.core import TracError
from trac.versioncontrol.cache import CACHE_YOUNGEST_REV
def do_upgrade(env, ver, cursor):
"""Modify the repository cache scheme (if needed)
Now we use the 'youngest_rev' entry in the system table
to explicit... | from trac.db import Table, Column, Index, DatabaseManager
from trac.core import TracError
from trac.versioncontrol.cache import CACHE_YOUNGEST_REV
def do_upgrade(env, ver, cursor):
"""Modify the repository cache scheme (if needed)
Now we use the 'youngest_rev' entry in the system table
to explicitly store... | Make db upgrade step 20 more robust. | Make db upgrade step 20 more robust.
git-svn-id: f68c6b3b1dcd5d00a2560c384475aaef3bc99487@5815 af82e41b-90c4-0310-8c96-b1721e28e2e2
| Python | bsd-3-clause | exocad/exotrac,dokipen/trac,moreati/trac-gitsvn,exocad/exotrac,dokipen/trac,dafrito/trac-mirror,dafrito/trac-mirror,moreati/trac-gitsvn,dafrito/trac-mirror,dafrito/trac-mirror,exocad/exotrac,dokipen/trac,moreati/trac-gitsvn,exocad/exotrac,moreati/trac-gitsvn |
ceb75d6f58ab16e3afdf3c7b00de539012d790d5 | djangopeoplenet/manage.py | djangopeoplenet/manage.py | #!/usr/bin/env python
import sys
paths = (
'/home/simon/sites/djangopeople.net',
'/home/simon/sites/djangopeople.net/djangopeoplenet',
'/home/simon/sites/djangopeople.net/djangopeoplenet/djangopeople/lib',
)
for path in paths:
if not path in sys.path:
sys.path.insert(0, path)
from django.core.m... | #!/usr/bin/env python
import sys, os
root = os.path.dirname(__file__)
paths = (
os.path.join(root),
os.path.join(root, "djangopeople", "lib"),
)
for path in paths:
if not path in sys.path:
sys.path.insert(0, path)
from django.core.management import execute_manager
try:
import settings # Assume... | Make the lib imports work on other computers than Simon's | Make the lib imports work on other computers than Simon's
Signed-off-by: Simon Willison <088e16a1019277b15d58faf0541e11910eb756f6@simonwillison.net> | Python | mit | brutasse/djangopeople,django/djangopeople,polinom/djangopeople,brutasse/djangopeople,polinom/djangopeople,brutasse/djangopeople,polinom/djangopeople,django/djangopeople,polinom/djangopeople,django/djangopeople,brutasse/djangopeople |
bb34b21ebd2378f944498708ac4f13d16aa61aa1 | src/mist/io/tests/api/features/steps/backends.py | src/mist/io/tests/api/features/steps/backends.py | from behave import *
@given(u'"{text}" backend added')
def given_backend(context, text):
backends = context.client.list_backends()
for backend in backends:
if text in backend['title']:
return
@when(u'I list backends')
def list_backends(context):
context.backends = context.client.lis... | from behave import *
@given(u'"{text}" backend added through api')
def given_backend(context, text):
backends = context.client.list_backends()
for backend in backends:
if text in backend['title']:
return
@when(u'I list backends')
def list_backends(context):
context.backends = contex... | Rename Behave steps for api tests | Rename Behave steps for api tests
| Python | agpl-3.0 | johnnyWalnut/mist.io,DimensionDataCBUSydney/mist.io,zBMNForks/mist.io,afivos/mist.io,Lao-liu/mist.io,Lao-liu/mist.io,munkiat/mist.io,kelonye/mist.io,kelonye/mist.io,afivos/mist.io,Lao-liu/mist.io,Lao-liu/mist.io,DimensionDataCBUSydney/mist.io,johnnyWalnut/mist.io,zBMNForks/mist.io,DimensionDataCBUSydney/mist.io,Dimensi... |
6f42f03f950e4c3967eb1efd7feb9364c9fbaf1f | google.py | google.py | import os
from werkzeug.contrib.fixers import ProxyFix
from flask import Flask, redirect, url_for
from flask_dance.contrib.google import make_google_blueprint, google
from raven.contrib.flask import Sentry
app = Flask(__name__)
app.wsgi_app = ProxyFix(app.wsgi_app)
sentry = Sentry(app)
app.secret_key = os.environ.get(... | import os
from werkzeug.contrib.fixers import ProxyFix
from flask import Flask, redirect, url_for
from flask_dance.contrib.google import make_google_blueprint, google
from raven.contrib.flask import Sentry
app = Flask(__name__)
app.wsgi_app = ProxyFix(app.wsgi_app)
sentry = Sentry(app)
app.secret_key = os.environ.get(... | Use userinfo URI for user profile info | Use userinfo URI for user profile info
| Python | mit | singingwolfboy/flask-dance-google |
2bb8ee6ae30e233f28ea0ae0fb01c0e4a1f8d9f1 | tests/functional/test_warning.py | tests/functional/test_warning.py | import pytest
import textwrap
@pytest.fixture
def warnings_demo(tmpdir):
demo = tmpdir.joinpath('warnings_demo.py')
demo.write_text(textwrap.dedent('''
from logging import basicConfig
from pip._internal.utils import deprecation
deprecation.install_warning_logger()
basicConfig(... | import textwrap
import pytest
@pytest.fixture
def warnings_demo(tmpdir):
demo = tmpdir.joinpath('warnings_demo.py')
demo.write_text(textwrap.dedent('''
from logging import basicConfig
from pip._internal.utils import deprecation
deprecation.install_warning_logger()
basicConfig... | Sort imports for the greater good | Sort imports for the greater good
| Python | mit | xavfernandez/pip,sbidoul/pip,pypa/pip,rouge8/pip,rouge8/pip,pfmoore/pip,xavfernandez/pip,sbidoul/pip,pypa/pip,pradyunsg/pip,xavfernandez/pip,pradyunsg/pip,pfmoore/pip,rouge8/pip |
ad73789f74106a2d6014a2f737578494d2d21fbf | virtool/api/processes.py | virtool/api/processes.py | import virtool.http.routes
import virtool.utils
from virtool.api.utils import json_response
routes = virtool.http.routes.Routes()
@routes.get("/api/processes")
async def find(req):
db = req.app["db"]
documents = [virtool.utils.base_processor(d) async for d in db.processes.find()]
return json_response(d... | import virtool.http.routes
import virtool.utils
from virtool.api.utils import json_response
routes = virtool.http.routes.Routes()
@routes.get("/api/processes")
async def find(req):
db = req.app["db"]
documents = [virtool.utils.base_processor(d) async for d in db.processes.find()]
return json_response(d... | Remove specific process API GET endpoints | Remove specific process API GET endpoints | Python | mit | virtool/virtool,igboyes/virtool,virtool/virtool,igboyes/virtool |
77ad68b04b66feb47116999cf79892f6630d9601 | thefuck/rules/ln_no_hard_link.py | thefuck/rules/ln_no_hard_link.py | """Suggest creating symbolic link if hard link is not allowed.
Example:
> ln barDir barLink
ln: ‘barDir’: hard link not allowed for directory
--> ln -s barDir barLink
"""
import re
from thefuck.specific.sudo import sudo_support
@sudo_support
def match(command):
return (command.stderr.endswith("hard link not al... | # -*- coding: utf-8 -*-
"""Suggest creating symbolic link if hard link is not allowed.
Example:
> ln barDir barLink
ln: ‘barDir’: hard link not allowed for directory
--> ln -s barDir barLink
"""
import re
from thefuck.specific.sudo import sudo_support
@sudo_support
def match(command):
return (command.stderr.en... | Fix encoding error in source file example | Fix encoding error in source file example
| Python | mit | lawrencebenson/thefuck,mlk/thefuck,nvbn/thefuck,PLNech/thefuck,scorphus/thefuck,nvbn/thefuck,SimenB/thefuck,Clpsplug/thefuck,SimenB/thefuck,mlk/thefuck,scorphus/thefuck,lawrencebenson/thefuck,Clpsplug/thefuck,PLNech/thefuck |
d7f3ea41bc3d252d786a339fc34337f01e1cc3eb | django_dbq/migrations/0001_initial.py | django_dbq/migrations/0001_initial.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import jsonfield.fields
import uuid
try:
from django.db.models import UUIDField
except ImportError:
from django_dbq.fields import UUIDField
class Migration(migrations.Migration):
dependencies = [
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import jsonfield.fields
import uuid
from django.db.models import UUIDField
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name=... | Remove reference to old UUIDfield in django migration | Remove reference to old UUIDfield in django migration
| Python | bsd-2-clause | dabapps/django-db-queue |
a5130e32bffa1dbc4d83f349fc3653b690154d71 | vumi/workers/vas2nets/workers.py | vumi/workers/vas2nets/workers.py | # -*- test-case-name: vumi.workers.vas2nets.test_vas2nets -*-
# -*- encoding: utf-8 -*-
from twisted.python import log
from twisted.internet.defer import inlineCallbacks, Deferred
from vumi.message import Message
from vumi.service import Worker
class EchoWorker(Worker):
@inlineCallbacks
def startWorker(sel... | # -*- test-case-name: vumi.workers.vas2nets.test_vas2nets -*-
# -*- encoding: utf-8 -*-
from twisted.python import log
from twisted.internet.defer import inlineCallbacks, Deferred
from vumi.message import Message
from vumi.service import Worker
class EchoWorker(Worker):
@inlineCallbacks
def startWorker(sel... | Add keyword to echo worker. | Add keyword to echo worker.
| Python | bsd-3-clause | TouK/vumi,vishwaprakashmishra/xmatrix,harrissoerja/vumi,TouK/vumi,vishwaprakashmishra/xmatrix,harrissoerja/vumi,vishwaprakashmishra/xmatrix,harrissoerja/vumi,TouK/vumi |
bbf22dc68202d81a8c7e94fbb8e61d819d808115 | wisely_project/pledges/models.py | wisely_project/pledges/models.py | from django.utils import timezone
from django.db import models
from users.models import Course, BaseModel, User
class Pledge(BaseModel):
user = models.ForeignKey(User)
course = models.ForeignKey(Course)
money = models.DecimalField(max_digits=8, decimal_places=2)
pledge_date = models.DateTimeField('da... | from django.utils import timezone
from django.db import models
from users.models import Course, BaseModel, UserProfile
class Pledge(BaseModel):
user = models.ForeignKey(UserProfile)
course = models.ForeignKey(Course)
money = models.DecimalField(max_digits=8, decimal_places=2)
pledge_date = models.Dat... | Make pledge foreignkey to userprofile | Make pledge foreignkey to userprofile
| Python | mit | TejasM/wisely,TejasM/wisely,TejasM/wisely |
8eca7b30865e4d02fd440f55ad3215dee6fab8a1 | gee_asset_manager/batch_remover.py | gee_asset_manager/batch_remover.py | import fnmatch
import logging
import sys
import ee
def delete(asset_path):
root = asset_path[:asset_path.rfind('/')]
all_assets_names = [e['id'] for e in ee.data.getList({'id': root})]
filtered_names = fnmatch.filter(all_assets_names, asset_path)
if not filtered_names:
logging.warning('Nothin... | import fnmatch
import logging
import sys
import ee
def delete(asset_path):
root_idx = asset_path.rfind('/')
if root_idx == -1:
logging.warning('Asset not found. Make sure you pass full asset name, e.g. users/pinkiepie/rainbow')
sys.exit(1)
root = asset_path[:root_idx]
all_assets_names... | Add warning when removing an asset without full path | Add warning when removing an asset without full path
| Python | apache-2.0 | tracek/gee_asset_manager |
18a874f312a57b4b9b7a5ce5cf9857585f0f0fef | truffe2/app/utils.py | truffe2/app/utils.py |
def add_current_unit(request):
"""Template context processor to add current unit"""
return {'CURRENT_UNIT': get_current_unit(request)}
def get_current_unit(request):
"""Return the current unit"""
from units.models import Unit
current_unit_pk = request.session.get('current_unit_pk', 1)
try... | from django.conf import settings
def add_current_unit(request):
"""Template context processor to add current unit"""
return {'CURRENT_UNIT': get_current_unit(request)}
def get_current_unit(request):
"""Return the current unit"""
from units.models import Unit
current_unit_pk = request.session.g... | Fix error if no units | Fix error if no units
| Python | bsd-2-clause | agepoly/truffe2,ArcaniteSolutions/truffe2,ArcaniteSolutions/truffe2,agepoly/truffe2,agepoly/truffe2,ArcaniteSolutions/truffe2,agepoly/truffe2,ArcaniteSolutions/truffe2 |
0a1358f27db3abb04032fac1b8a3da09d846d23e | oauth_provider/utils.py | oauth_provider/utils.py | import oauth.oauth as oauth
from django.conf import settings
from django.http import HttpResponse
from stores import DataStore
OAUTH_REALM_KEY_NAME = 'OAUTH_REALM_KEY_NAME'
def initialize_server_request(request):
"""Shortcut for initialization."""
oauth_request = oauth.OAuthRequest.from_request(request.meth... | import oauth.oauth as oauth
from django.conf import settings
from django.http import HttpResponse
from stores import DataStore
OAUTH_REALM_KEY_NAME = 'OAUTH_REALM_KEY_NAME'
def initialize_server_request(request):
"""Shortcut for initialization."""
# Django converts Authorization header in HTTP_AUTHORIZATION... | Fix a bug introduced in the latest revision, testing auth header in initialize_server_request now, thanks Chris McMichael for the report and patch | Fix a bug introduced in the latest revision, testing auth header in initialize_server_request now, thanks Chris McMichael for the report and patch
| Python | bsd-3-clause | e-loue/django-oauth-plus |
1fa0eb2c792b3cc89d27b322c80548f022b7fbb9 | api/base/exceptions.py | api/base/exceptions.py | from rest_framework.exceptions import APIException
from rest_framework import status
def jsonapi_exception_handler(exc, context):
"""
Custom exception handler that returns errors object as an array with a 'detail' member
"""
from rest_framework.views import exception_handler
response = exception_ha... |
from rest_framework import status
from rest_framework.exceptions import APIException
def json_api_exception_handler(exc, context):
"""
Custom exception handler that returns errors object as an array
"""
from rest_framework.views import exception_handler
response = exception_handler(exc, context)
... | Modify exception handler to cover multiple data types i.e. dict and list and handle when more than one error returned | Modify exception handler to cover multiple data types i.e. dict and list and handle when more than one error returned
| Python | apache-2.0 | monikagrabowska/osf.io,hmoco/osf.io,asanfilippo7/osf.io,njantrania/osf.io,sloria/osf.io,MerlinZhang/osf.io,acshi/osf.io,mluke93/osf.io,asanfilippo7/osf.io,Johnetordoff/osf.io,haoyuchen1992/osf.io,ckc6cz/osf.io,GageGaskins/osf.io,chrisseto/osf.io,ticklemepierce/osf.io,chennan47/osf.io,caseyrygt/osf.io,DanielSBrown/osf.i... |
4c1bf1757baa5beec50377724961c528f5985864 | ptest/screencapturer.py | ptest/screencapturer.py | import threading
import traceback
import plogger
__author__ = 'karl.gong'
def take_screen_shot():
current_thread = threading.currentThread()
active_browser = current_thread.get_property("browser")
if active_browser is not None:
while True:
try:
active_browser.switch... | import threading
import traceback
import StringIO
import plogger
try:
from PIL import ImageGrab
except ImportError:
PIL_installed = False
else:
PIL_installed = True
try:
import wx
except ImportError:
wxpython_installed = False
else:
wxpython_installed = True
__author__ = 'karl.gong'
def t... | Support capture screenshot for no-selenium test | Support capture screenshot for no-selenium test
| Python | apache-2.0 | KarlGong/ptest,KarlGong/ptest |
c82f0f10ea8b96377ebed8a6859ff3cd8ed4cd3f | python/turbodbc/exceptions.py | python/turbodbc/exceptions.py | from __future__ import absolute_import
from functools import wraps
from exceptions import StandardError
from turbodbc_intern import Error as InternError
class Error(StandardError):
pass
class InterfaceError(Error):
pass
class DatabaseError(Error):
pass
def translate_exceptions(f):
@wraps(f)
... | from __future__ import absolute_import
from functools import wraps
from turbodbc_intern import Error as InternError
# Python 2/3 compatibility
try:
from exceptions import StandardError as _BaseError
except ImportError:
_BaseError = Exception
class Error(_BaseError):
pass
class InterfaceError(Error):... | Fix Python 2/3 exception base class compatibility | Fix Python 2/3 exception base class compatibility
| Python | mit | blue-yonder/turbodbc,blue-yonder/turbodbc,blue-yonder/turbodbc,blue-yonder/turbodbc |
80f1ee23f85aee9a54e0c6cae7a30dddbe96541b | scorecard/tests/test_views.py | scorecard/tests/test_views.py | import json
from infrastructure.models import FinancialYear
from django.test import (
TransactionTestCase,
Client,
override_settings,
)
from . import (
import_data,
)
from .resources import (
GeographyResource,
MunicipalityProfileResource,
MedianGroupResource,
RatingCountGroupResource,... | import json
from django.test import (
TransactionTestCase,
Client,
override_settings,
)
@override_settings(
SITE_ID=2,
STATICFILES_STORAGE="django.contrib.staticfiles.storage.StaticFilesStorage",
)
class GeographyDetailViewTestCase(TransactionTestCase):
serialized_rollback = True
fixtures... | Use new fixtures for geography views test | Use new fixtures for geography views test
| Python | mit | Code4SA/municipal-data,Code4SA/municipal-data,Code4SA/municipal-data,Code4SA/municipal-data |
4666849791cad70ae1bb907a2dcc35ccfc0b7de4 | backend/populate_dimkarakostas.py | backend/populate_dimkarakostas.py | from string import ascii_lowercase
import django
import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings')
django.setup()
from breach.models import Target, Victim
endpoint = 'https://dimkarakostas.com/rupture/test.php?ref=%s'
prefix = 'imper'
alphabet = ascii_lowercase
secretlength = 9
target_1 ... | from string import ascii_lowercase
import django
import os
import string
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings')
django.setup()
from breach.models import Target, Victim
endpoint = 'https://dimkarakostas.com/rupture/test.php?ref=%s'
prefix = 'imper'
alphabet = ascii_lowercase
secretlength ... | Update dimkarakostas population with alignmentalphabet | Update dimkarakostas population with alignmentalphabet
| Python | mit | esarafianou/rupture,dionyziz/rupture,esarafianou/rupture,dionyziz/rupture,dimriou/rupture,dionyziz/rupture,dimriou/rupture,esarafianou/rupture,dionyziz/rupture,dimkarakostas/rupture,esarafianou/rupture,dimkarakostas/rupture,dionyziz/rupture,dimriou/rupture,dimkarakostas/rupture,dimkarakostas/rupture,dimkarakostas/ruptu... |
8abdce9c60c9d2ead839e0065d35128ec16a82a1 | chatterbot/__main__.py | chatterbot/__main__.py | import sys
if __name__ == '__main__':
import chatterbot
if '--version' in sys.argv:
print(chatterbot.__version__)
if 'list_nltk_data' in sys.argv:
import nltk.data
print('\n'.join(nltk.data.path))
| import sys
if __name__ == '__main__':
import chatterbot
if '--version' in sys.argv:
print(chatterbot.__version__)
if 'list_nltk_data' in sys.argv:
import os
import nltk.data
data_directories = []
# Find each data directory in the NLTK path that has content
... | Add commad line utility to find NLTK data | Add commad line utility to find NLTK data
| Python | bsd-3-clause | gunthercox/ChatterBot,vkosuri/ChatterBot |
210c7b7fb421a7c083b9d292370b15c0ece17fa7 | source/bark/__init__.py | source/bark/__init__.py | # :coding: utf-8
# :copyright: Copyright (c) 2013 Martin Pengelly-Phillips
# :license: See LICENSE.txt.
from .handler.distribute import Distribute
#: Top level handler responsible for relaying all logs to other handlers.
handle = Distribute()
| # :coding: utf-8
# :copyright: Copyright (c) 2013 Martin Pengelly-Phillips
# :license: See LICENSE.txt.
from .handler.distribute import Distribute
#: Top level handler responsible for relaying all logs to other handlers.
handler = Distribute()
handlers = handler.handlers
handle = handler.handle
| Correct handler reference variable name and add convenient accessors. | Correct handler reference variable name and add convenient accessors.
| Python | apache-2.0 | 4degrees/mill,4degrees/sawmill |
696a79069ad1db1caee4d6da0c3c48dbd79f9157 | sqliteschema/_logger.py | sqliteschema/_logger.py | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
from __future__ import unicode_literals
import logbook
import pytablewriter
import simplesqlite
logger = logbook.Logger("sqliteschema")
logger.disable()
def set_logger(is_enable):
pytablew... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
from __future__ import unicode_literals
import logbook
import pytablewriter
import simplesqlite
logger = logbook.Logger("sqliteschema")
logger.disable()
def set_logger(is_enable):
if is_en... | Modify to avoid excessive logger initialization | Modify to avoid excessive logger initialization
| Python | mit | thombashi/sqliteschema |
1c78dfa0e0d1905910476b4052e42de287a70b74 | runtests.py | runtests.py | #!/usr/bin/env python
import os
import sys
import string
def main():
"""
Executes the tests. Requires the CherryPy live server to be installed.
"""
command = "python manage.py test"
options = "--exe --with-selenium --with-selenium-fixtures --with-cherrypyliveserver"
apps = []
if len(sys.argv) > 1:
... | #!/usr/bin/env python
import os
import sys
import string
def main():
"""
Executes the tests. Requires the CherryPy live server to be installed.
"""
command = "python manage.py test"
options = "--exe --with-selenium --with-selenium-fixtures --with-cherrypyliveserver --noinput"
apps = []
if len(sys.argv)... | Update to the run tests script to force database deletion if the test database exists. | Update to the run tests script to force database deletion if the test database exists.
| Python | mit | jtakayama/makahiki-draft,jtakayama/ics691-setupbooster,csdl/makahiki,yongwen/makahiki,yongwen/makahiki,jtakayama/makahiki-draft,yongwen/makahiki,justinslee/Wai-Not-Makahiki,csdl/makahiki,jtakayama/makahiki-draft,yongwen/makahiki,csdl/makahiki,csdl/makahiki,jtakayama/makahiki-draft,jtakayama/ics691-setupbooster,jtakayam... |
20124d599c6305889315847c15329c02efdd2b8c | migrations/versions/0313_email_access_validated_at.py | migrations/versions/0313_email_access_validated_at.py | """
Revision ID: 0313_email_access_validated_at
Revises: 0312_populate_returned_letters
Create Date: 2020-01-28 18:03:22.237386
"""
from alembic import op
import sqlalchemy as sa
revision = '0313_email_access_validated_at'
down_revision = '0312_populate_returned_letters'
def upgrade():
# ### commands auto gen... | """
Revision ID: 0313_email_access_validated_at
Revises: 0312_populate_returned_letters
Create Date: 2020-01-28 18:03:22.237386
"""
from alembic import op
import sqlalchemy as sa
revision = '0313_email_access_validated_at'
down_revision = '0312_populate_returned_letters'
def upgrade():
# ### commands auto gen... | Make sure email_access_validated_at is not null after being populated | Make sure email_access_validated_at is not null after being populated
| Python | mit | alphagov/notifications-api,alphagov/notifications-api |
78b2978c3e0e56c4c75a3a6b532e02c995ca69ed | openedx/core/djangoapps/user_api/permissions/views.py | openedx/core/djangoapps/user_api/permissions/views.py | """
NOTE: this API is WIP and has not yet been approved. Do not use this API
without talking to Christina or Andy.
For more information, see:
https://openedx.atlassian.net/wiki/display/TNL/User+API
"""
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import stat... | from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from openedx.core.lib.api.authentication import (
SessionAuthenticationAllowInactiveUser,
OAuth2AuthenticationAllowInactiveUser,
)
from openedx.core.lib.api.parsers import MergePatchParser
fr... | Remove unused import and redundant comment | Remove unused import and redundant comment
| Python | agpl-3.0 | mbareta/edx-platform-ft,mbareta/edx-platform-ft,mbareta/edx-platform-ft,mbareta/edx-platform-ft |
cadee051a462de765bab59ac42d6b372fa49c033 | examples/logfile.py | examples/logfile.py | """
Output an Eliot message to a log file using the threaded log writer.
"""
from __future__ import unicode_literals, print_function
from twisted.internet.task import react
from eliot.logwriter import ThreadedFileWriter
from eliot import Message, Logger, addDestination
_logger = Logger()
def main(reactor):
p... | """
Output an Eliot message to a log file using the threaded log writer.
"""
from __future__ import unicode_literals, print_function
from twisted.internet.task import react
from eliot.logwriter import ThreadedFileWriter
from eliot import Message, Logger
_logger = Logger()
def main(reactor):
print("Logging to... | Fix bug where the service was added as a destination one time too many. | Fix bug where the service was added as a destination one time too many.
| Python | apache-2.0 | iffy/eliot,ClusterHQ/eliot,ScatterHQ/eliot,ScatterHQ/eliot,ScatterHQ/eliot |
9f10dbdabe61ed841c0def319f021a4735f39217 | src/sct/templates/__init__.py | src/sct/templates/__init__.py | # -*- coding: utf-8 -*-
'''
Copyright 2014 Universitatea de Vest din Timișoara
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 appli... | # -*- coding: utf-8 -*-
"""
Copyright 2014 Universitatea de Vest din Timișoara
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 appli... | Add provisional (needs to be replaced with pkg_resources entry point discovery) template registry | Add provisional (needs to be replaced with pkg_resources entry point discovery) template registry
| Python | apache-2.0 | mneagul/scape-cloud-toolkit,mneagul/scape-cloud-toolkit,mneagul/scape-cloud-toolkit |
0534c1cdeb92503a90ef309dee6edddb45234bf7 | comrade/users/urls.py | comrade/users/urls.py | from django.conf.urls.defaults import *
urlpatterns = patterns('django.contrib.auth.views',
url(r'^login/', 'login', name='login'),
url(r'^logout/', 'logout', {'next_page':'/'}, name='logout'),
url(r'^password/forgot/$', 'password_reset',
# LH #269 - ideally this wouldn't be hard coded
... | from django.conf.urls.defaults import *
from django.core.urlresolvers import reverse
from django.utils.functional import lazy
reverse_lazy = lazy(reverse, unicode)
urlpatterns = patterns('django.contrib.auth.views',
url(r'^login/', 'login', name='login'),
url(r'^logout/', 'logout', {'next_page':'/'}, name='lo... | Resolve old Django 1.1 bug in URLs to keep it DRY. | Resolve old Django 1.1 bug in URLs to keep it DRY.
| Python | mit | bueda/django-comrade |
e9e4c622ff667e475986e1544ec78b0604b8a511 | girder_worker/tasks.py | girder_worker/tasks.py | import core
from girder_worker.utils import JobStatus
from .app import app
def _cleanup(*args, **kwargs):
core.events.trigger('cleanup')
@app.task(name='girder_worker.run', bind=True, after_return=_cleanup)
def run(tasks, *pargs, **kwargs):
jobInfo = kwargs.pop('jobInfo', {})
retval = 0
kwargs['_jo... | import core
from girder_worker.utils import JobStatus
from .app import app
def _cleanup(*args, **kwargs):
core.events.trigger('cleanup')
@app.task(name='girder_worker.run', bind=True, after_return=_cleanup)
def run(task, *pargs, **kwargs):
kwargs['_job_manager'] = task.job_manager \
if hasattr(task,... | Fix typo from bad conflict resolution during merge | Fix typo from bad conflict resolution during merge
| Python | apache-2.0 | girder/girder_worker,girder/girder_worker,girder/girder_worker |
0a4922dba3367a747d7460b5c1b59c49c67f3026 | hcalendar/hcalendar.py | hcalendar/hcalendar.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from .vcalendar import vCalendar
from bs4 import BeautifulSoup
class hCalendar(object):
def __init__(self, markup, valu... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from .vcalendar import vCalendar
from bs4 import BeautifulSoup
class hCalendar(object):
def __init__(self, markup, valu... | Add missing parser argument to BeautifulSoup instance | Add missing parser argument to BeautifulSoup instance
| Python | mit | mback2k/python-hcalendar |
9a32f922e6d5ec6e5bd22eccbe3dceaef7bbd7dc | tailor/tests/utils/charformat_test.py | tailor/tests/utils/charformat_test.py | import unittest
from tailor.utils import charformat
class MyTestCase(unittest.TestCase):
def is_upper_camel_case_test_upper_camel_case_name(self):
self.assertTrue(charformat.is_upper_camel_case('HelloWorld'))
def is_upper_camel_case_test_lower_camel_case_name(self):
self.assertFalse(charform... | import unittest
from tailor.utils import charformat
class MyTestCase(unittest.TestCase):
def is_upper_camel_case_test_upper_camel_case_name(self):
self.assertTrue(charformat.is_upper_camel_case('HelloWorld'))
def is_upper_camel_case_test_lower_camel_case_name(self):
self.assertFalse(charform... | Add special character name test case | Add special character name test case
| Python | mit | sleekbyte/tailor,sleekbyte/tailor,sleekbyte/tailor,sleekbyte/tailor,sleekbyte/tailor |
fd48211548c8c2d5daec0994155ddb7e8d226882 | tests/test_anki_sync.py | tests/test_anki_sync.py | import pytest
import os
import rememberberry
from rememberscript import RememberMachine, FileStorage
from rememberberry.testing import tmp_data_path, assert_replies, get_isolated_story
@pytest.mark.asyncio
@tmp_data_path('/tmp/data/', delete=True)
async def test_anki_account():
storage = FileStorage()
m, stora... | import pytest
import os
import rememberberry
from rememberscript import RememberMachine, FileStorage
from rememberberry.testing import tmp_data_path, assert_replies, get_isolated_story
@pytest.mark.asyncio
@tmp_data_path('/tmp/data/', delete=True)
async def test_anki_account():
storage = FileStorage()
storage[... | Fix missing username in test | Fix missing username in test
| Python | agpl-3.0 | rememberberry/rememberberry-server,rememberberry/rememberberry-server |
2c38fea1434f8591957c2707359412151c4b6c43 | tests/test_timezones.py | tests/test_timezones.py | import unittest
import datetime
from garage.timezones import TimeZone
class TimeZoneTest(unittest.TestCase):
def test_time_zone(self):
utc = datetime.datetime(2000, 1, 2, 3, 4, 0, 0, TimeZone.UTC)
cst = utc.astimezone(TimeZone.CST)
print('xxx', utc, cst)
self.assertEqual(2000, c... | import unittest
import datetime
from garage.timezones import TimeZone
class TimeZoneTest(unittest.TestCase):
def test_time_zone(self):
utc = datetime.datetime(2000, 1, 2, 3, 4, 0, 0, TimeZone.UTC)
cst = utc.astimezone(TimeZone.CST)
self.assertEqual(2000, cst.year)
self.assertEqu... | Remove print in unit test | Remove print in unit test
| Python | mit | clchiou/garage,clchiou/garage,clchiou/garage,clchiou/garage |
b1d3a0c79a52ca1987ea08a546213e1135539927 | tools/bots/ddc_tests.py | tools/bots/ddc_tests.py | #!/usr/bin/env python
#
# Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
import os
import os.path
import shutil
import sys
import subprocess
import bot
im... | #!/usr/bin/env python
#
# Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
import os
import os.path
import shutil
import sys
import subprocess
import bot
im... | Set CHROME_BIN on DDC bot | Set CHROME_BIN on DDC bot
Noticed the Linux bot is failing on this:
https://build.chromium.org/p/client.dart.fyi/builders/ddc-linux-release-be/builds/1724/steps/ddc%20tests/logs/stdio
R=whesse@google.com
Review-Url: https://codereview.chromium.org/2640093002 .
| Python | bsd-3-clause | dartino/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dartino/dart-sdk,dartino/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-lang/... |
c143bc14be8d486d313056c0d1313e03ac438284 | examples/ex_aps_parser.py | examples/ex_aps_parser.py | from __future__ import print_function
import os
import glob
import pyingest.parsers.aps as aps
import pyingest.parsers.arxiv as arxiv
import pyingest.serializers.classic
import traceback
import json
import xmltodict
from datetime import datetime
input_list = 'bibc.2.out'
testfile=[]
xmldir = '/proj/ads/fulltext/source... | from __future__ import print_function
import os
import glob
import pyingest.parsers.aps as aps
import pyingest.parsers.arxiv as arxiv
import pyingest.serializers.classic
import traceback
import json
import xmltodict
from datetime import datetime
import sys
input_list = 'bibc.2.out'
testfile=[]
xmldir = '/proj/ads/full... | Use open mode syntax on example file | Use open mode syntax on example file
| Python | mit | adsabs/adsabs-pyingest,adsabs/adsabs-pyingest,adsabs/adsabs-pyingest |
bfd166e9679e6fa06e694fd5e587fcf10186d79b | vx_intro.py | vx_intro.py | import vx
import math
import os
import sys
_tick_functions = []
def _register_tick_function(f, front=False):
if front:
_tick_functions.insert(0, f)
else:
_tick_functions.append(f)
def _tick():
for f in _tick_functions:
f()
vx.my_vx = _tick
vx.register_tick_function = _register_tic... | import vx
import math
import os
import sys
_tick_functions = []
def _register_tick_function(f, front=False):
if front:
_tick_functions.insert(0, f)
else:
_tick_functions.append(f)
def _tick():
for f in _tick_functions:
f()
vx.my_vx = _tick
vx.register_tick_function = _register_tic... | Fix a crash if there is no ~/.python/rc.py | Fix a crash if there is no ~/.python/rc.py
| Python | mit | philipdexter/vx,philipdexter/vx |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.