commit stringlengths 40 40 | subject stringlengths 4 1.73k | repos stringlengths 5 127k | old_file stringlengths 2 751 | new_file stringlengths 2 751 | new_contents stringlengths 1 8.98k | old_contents stringlengths 0 6.59k | license stringclasses 13
values | lang stringclasses 23
values |
|---|---|---|---|---|---|---|---|---|
0844a0fa39ca8589584bf43aa9808513170ce3b2 | Add tests for find_app_configs... changes | tony/django-docutils,tony/django-docutils | django_docutils/lib/fixtures/tests/test_utils.py | django_docutils/lib/fixtures/tests/test_utils.py | import py
import pytest
from django.apps import apps
from django_docutils.lib.fixtures.tests.conftest import create_bare_app
from django_docutils.lib.fixtures.utils import (
find_app_configs_with_fixtures,
find_rst_files,
find_rst_files_in_app,
get_model_from_post_app,
)
@pytest.fixture(scope='funct... | from django.apps import apps
from django_docutils.lib.fixtures.utils import (
find_app_configs_with_fixtures,
find_rst_files,
find_rst_files_in_app,
get_model_from_post_app,
)
def test_find_rst_files(tmpdir):
tmpdir.join('hi.rst').write('')
tmpdir.join('not_at_rst_file.html').write('')
tm... | mit | Python |
df9df049e804bd626f8b87cf406168311b5135f7 | remove unused import | praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go | go/base/management/commands/go_send_app_worker_command.py | go/base/management/commands/go_send_app_worker_command.py | from go.vumitools.api import VumiApiCommand
from go.base.utils import vumi_api_for_user
from go.base.command_utils import (
BaseGoCommand, CommandError, get_user_by_account_key)
class Command(BaseGoCommand):
help = "Send a VumiApi command to an application worker"
args = "<worker-name> <command> key1=valu... | from django.core.management.base import BaseCommand, CommandError
from go.vumitools.api import VumiApiCommand
from go.base.utils import vumi_api_for_user
from go.base.command_utils import BaseGoCommand, get_user_by_account_key
class Command(BaseGoCommand):
help = "Send a VumiApi command to an application worker"... | bsd-3-clause | Python |
33e4516fe95884f551d8f84f01435c505b9fc566 | remove organic for the app | dragoon/kilogram,dragoon/kilogram,dragoon/kilogram | mapreduce/wikipedia/typograms/evaluation/flask_service.py | mapreduce/wikipedia/typograms/evaluation/flask_service.py | #!/usr/bin/env python
"""
./flask_service.py unambig_labels_file.txt
"""
from flask import Flask, jsonify, request
from functools import partial
from kilogram.entity_linking.unambig_labels.link_generators import generate_links, unambig_generator,\
get_unambiguous_labels
__author__ = 'dragoon'
import sys
unambi... | #!/usr/bin/env python
"""
./flask_service.py unambig_labels_file.txt
"""
from flask import Flask, jsonify, request
from functools import partial
from kilogram.entity_linking.unambig_labels.link_generators import generate_organic_precise_plus, generate_links, unambig_generator,\
get_unambiguous_labels
__author__ ... | apache-2.0 | Python |
2d921e92b2cc9270c46b1b6929ee50f9b4a10884 | Delete worfklows at migration | CompassionCH/compassion-accounting,CompassionCH/compassion-accounting | recurring_contract/migrations/11.0.1.0.0/pre-migration.py | recurring_contract/migrations/11.0.1.0.0/pre-migration.py | ##############################################################################
#
# Copyright (C) 2018 Compassion CH (http://www.compassion.ch)
# @author: Nathan Fluckiger <nathan.fluckiger@hotmail.ch>
#
# The licence is in the file __manifest__.py
#
############################################################... | ##############################################################################
#
# Copyright (C) 2018 Compassion CH (http://www.compassion.ch)
# @author: Nathan Fluckiger <nathan.fluckiger@hotmail.ch>
#
# The licence is in the file __manifest__.py
#
############################################################... | agpl-3.0 | Python |
88645e23f5ccce09a701efc1c2e177decc5e99be | Update contributors | ElementalAlchemist/txircd,Heufneutje/txircd | txircd/modules/rfc/cmd_info.py | txircd/modules/rfc/cmd_info.py | from twisted.plugin import IPlugin
from twisted.words.protocols import irc
from txircd import version
from txircd.module_interface import Command, ICommand, IModuleData, ModuleData
from zope.interface import implements
class InfoCommand(ModuleData, Command):
implements(IPlugin, IModuleData, ICommand)
name = "InfoC... | from twisted.plugin import IPlugin
from twisted.words.protocols import irc
from txircd import version
from txircd.module_interface import Command, ICommand, IModuleData, ModuleData
from zope.interface import implements
class InfoCommand(ModuleData, Command):
implements(IPlugin, IModuleData, ICommand)
name = "InfoC... | bsd-3-clause | Python |
b99a8ab154d0baace50ed65761e576c38be82022 | Add notes for the PLUGIN_DIR and PLUGIN_NAME in global_vars.py | kungfusheep/TypeScript-Sublime-Plugin,zhengbli/TypeScript-Sublime-Plugin,Microsoft/TypeScript-Sublime-Plugin,hoanhtien/TypeScript-Sublime-Plugin,fongandrew/TypeScript-Sublime-JSX-Plugin,hoanhtien/TypeScript-Sublime-Plugin,zhengbli/TypeScript-Sublime-Plugin,zhengbli/TypeScript-Sublime-Plugin,RyanCavanaugh/TypeScript-Sub... | typescript/libs/global_vars.py | typescript/libs/global_vars.py | import os
import re
import logging
import sublime
from os.path import dirname
# Get the directory path to this file;
# Note: MODULE_DIR, PLUGIN_DIR and PLUGIN_NAME only works correctly when:
# 1. Using sublime 3
# 2. Using sublime 2, and the plugin folder is not a symbol link
# On sublime 2 with the plugin folder bei... | import os
import re
import logging
import sublime
from os.path import dirname
# get the directory path to this file;
if os.name == "nt":
MODULE_DIR = dirname(dirname(os.path.abspath(__file__)))
else:
MODULE_DIR = dirname(os.environ["PWD"])
PLUGIN_DIR = dirname(MODULE_DIR)
PLUGIN_NAME = os.path.basename(PLUGI... | apache-2.0 | Python |
75fc78a9e2a94af1f8e49bd2f13fe56b33d704d3 | Add model (LdapSyncLog). | alexsilva/django-ldap-sync,alexsilva/django-ldap-sync | ldap_sync/models.py | ldap_sync/models.py | from django.db import models
from django.conf import settings
class LdapObject(models.Model):
"""Data information for a synchronized ldap object"""
user = models.OneToOneField(settings.AUTH_USER_MODEL)
data = models.TextField()
date_created = models.DateTimeField(auto_now_add=True)
date_updated ... | from django.db import models
from django.conf import settings
class LdapObject(models.Model):
"""Data information for a synchronized ldap object"""
user = models.OneToOneField(settings.AUTH_USER_MODEL)
data = models.TextField()
date_created = models.DateTimeField(auto_now_add=True)
date_updated ... | bsd-3-clause | Python |
2d39cdb61ad9c906175641719d37e109b712e1a8 | fix Venue photo CharField max_length | pycontw/pycontw2016,pycontw/pycontw2016,pycontw/pycontw2016,pycontw/pycontw2016 | src/ext2020/models.py | src/ext2020/models.py | from django.db import models
from django.utils.translation import gettext_lazy as _
from django.templatetags.static import StaticNode
# Create your models here.
class Attendee(models.Model):
token = models.CharField(_('token'), max_length=64, unique=True)
verified = models.BooleanField(_('verified'), default=F... | from django.db import models
from django.utils.translation import gettext_lazy as _
from django.templatetags.static import StaticNode
# Create your models here.
class Attendee(models.Model):
token = models.CharField(_('token'), max_length=64, unique=True)
verified = models.BooleanField(_('verified'), default=F... | mit | Python |
40e5474251c875d36dd8ec2b7a3f4cb4cd01b404 | Update largest-bst-subtree.py | tudennis/LeetCode---kamyu104-11-24-2015,githubutilities/LeetCode,yiwen-luo/LeetCode,jaredkoontz/leetcode,githubutilities/LeetCode,kamyu104/LeetCode,yiwen-luo/LeetCode,jaredkoontz/leetcode,githubutilities/LeetCode,githubutilities/LeetCode,githubutilities/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,tudennis/LeetCode... | Python/largest-bst-subtree.py | Python/largest-bst-subtree.py | # Time: O(n)
# Space: O(h)
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def largestBSTSubtree(self, root):
"""
:type root: TreeNode
:rtype: ... | # Time: O(n)
# Space: O(h)
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def largestBSTSubtree(self, root):
"""
:type root: TreeNode
:rtype: ... | mit | Python |
ca9120c654a31218ec006cd0b3c8341e78e0f236 | add id to user type allowed attributes | masschallenge/impact-api,masschallenge/impact-api,masschallenge/impact-api,masschallenge/impact-api | web/impact/impact/graphql/types/user_type.py | web/impact/impact/graphql/types/user_type.py | from graphene_django import DjangoObjectType
from django.contrib.auth import get_user_model
User = get_user_model()
class UserType(DjangoObjectType):
class Meta:
model = User
only_fields = ('id', 'first_name', 'last_name', 'email')
| from graphene_django import DjangoObjectType
from django.contrib.auth import get_user_model
User = get_user_model()
class UserType(DjangoObjectType):
class Meta:
model = User
only_fields = ('first_name', 'last_name', 'email')
| mit | Python |
9704525d27bd91b005bfe9b9be1c56db9b3a9a91 | Remove unused import | lepture/raven-python,NickPresta/sentry,SilentCircle/sentry,icereval/raven-python,jmagnusson/raven-python,Goldmund-Wyldebeast-Wunderliebe/raven-python,chayapan/django-sentry,Kronuz/django-sentry,fotinakis/sentry,primepix/django-sentry,mvaled/sentry,jokey2k/sentry,looker/sentry,songyi199111/sentry,daevaorn/sentry,beni55/... | djangodblog/handlers.py | djangodblog/handlers.py | from djangodblog.models import Error
import logging
class DBLogHandler(logging.Handler):
def emit(self, record):
Error.objects.create_from_record(record) | from djangodblog.models import Error
from django.conf import settings
import logging
class DBLogHandler(logging.Handler):
def emit(self, record):
Error.objects.create_from_record(record) | bsd-3-clause | Python |
8ce4ff263d5733f5a1b517f5b20fec325934d6c0 | Set redirect to iif-books instead of admin | Princeton-CDH/winthrop-django,Princeton-CDH/winthrop-django,Princeton-CDH/winthrop-django | winthrop/urls.py | winthrop/urls.py | """winthrop URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
"""
from django.conf import settings
from django.conf.urls import url, include
from django.contrib import admin
from django.contrib.admin.views.decora... | """winthrop URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
"""
from django.conf import settings
from django.conf.urls import url, include
from django.contrib import admin
from django.contrib.admin.views.decora... | apache-2.0 | Python |
b7df144fdaec148c5df1f77652fb52749fa91d6f | Add a --with-aws flag to the debug-value command | alphagov/digitalmarketplace-aws,alphagov/digitalmarketplace-aws,alphagov/digitalmarketplace-aws | dmaws/commands/debug.py | dmaws/commands/debug.py | import click
from ..cli import cli_command
from ..stacks import StackPlan
@cli_command('debug-value', max_apps=0)
@click.argument('values', nargs=-1)
@click.option('--with-aws', is_flag=True)
def debug_value_cmd(ctx, values, with_aws):
"""Get values of the given dotted variables."""
plan = StackPlan.from_ct... | import click
from ..cli import cli_command
from ..stacks import StackPlan
@cli_command('debug-value', max_apps=0)
@click.argument('values', nargs=-1)
def debug_value_cmd(ctx, values):
"""Get values of the given dotted variables."""
plan = StackPlan.from_ctx(ctx, apps=['all'], logger=None)
plan.info(with... | mit | Python |
161cd07fca220494e675b1da674dbf57254a28b3 | Change to ensure that the Svals were handled as a list | weecology/mete-spatial,weecology/mete-spatial,weecology/mete-spatial,weecology/mete-spatial | scripts/spat_gencomms.py | scripts/spat_gencomms.py | import spat_community_generation as sg
import sys
Svals = [10, 11, 13, 14, 16, 18, 21, 23, 26, 30, 34, 38, 43, 48, 55, 62, 70,
78, 89, 100]
Nvals = [120, 186, 289, 447, 694, 1076, 1668, 2587, 4011, 6220, 9646, 14957,
23193, 35965, 55769, 86479, 134099, 207941, 322444, 500000]
if len... | import spat_community_generation as sg
import sys
Svals = [10, 11, 13, 14, 16, 18, 21, 23, 26, 30, 34, 38, 43, 48, 55, 62, 70,
78, 89, 100]
Nvals = [120, 186, 289, 447, 694, 1076, 1668, 2587, 4011, 6220, 9646, 14957,
23193, 35965, 55769, 86479, 134099, 207941, 322444, 500000]
if len... | mit | Python |
911094754fc908d99009c5cfec22ac9033ffd472 | Fix comment header on init | Secheron/compassion-switzerland,CompassionCH/compassion-switzerland,eicher31/compassion-switzerland,eicher31/compassion-switzerland,CompassionCH/compassion-switzerland,Secheron/compassion-switzerland,CompassionCH/compassion-switzerland,ecino/compassion-switzerland,MickSandoz/compassion-switzerland,ecino/compassion-swit... | my_account_helper/model/__init__.py | my_account_helper/model/__init__.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emmanuel Mathier <emmanuel.mathier@gmail.ch>
#
# The licence is in the f... | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __open... | agpl-3.0 | Python |
2d16d84764ad84ffe53918d414766ef16c5bbccd | add an import | dit/dit,Autoplectic/dit,dit/dit,dit/dit,dit/dit,Autoplectic/dit,Autoplectic/dit,Autoplectic/dit,Autoplectic/dit,dit/dit | dit/inference/__init__.py | dit/inference/__init__.py | """
Module for basic inference tools.
"""
from .binning import binned
from .counts import get_counts, distribution_from_data
from .estimators import entropy_0, entropy_1, entropy_2
from .knn_estimators import differential_entropy_knn, total_correlation_ksg
from .time_series import dist_from_timeseries
| """
Module for basic inference tools.
"""
from .binning import binned
from .counts import get_counts, distribution_from_data
from .estimators import entropy_0, entropy_1, entropy_2
from .knn_estimators import total_correlation_ksg
from .time_series import dist_from_timeseries
| bsd-3-clause | Python |
2ee268234fe0b619238ecb36b83b1d32ec4f7219 | improve --help | smcl/xsms | xsms/__main__.py | xsms/__main__.py | # flake8: noqa
"""
__main__.py
Main launch script for xsms system. Has two distinct behaviours - will connect to the modem, download messages and merge into ~/.xsms/inbox.json then either
1. (if --check is supplied) print one of two strings to stdout, depending on if there are any unread messages
2. (otherwise) will ... | # flake8: noqa
"""
__main__.py
Main launch script for xsms system. Has two distinct behaviours - will connect to the modem, download messages and merge into ~/.xsms/inbox.json then either
1. (if --check is supplied) print one of two strings to stdout, depending on if there are any unread messages
2. (otherwise) will ... | mit | Python |
993ff30b63e8d0d73e4d5bd3ca0d950a8cfc1026 | add some setup keywords | rsalmond/ytsnarf | ytsnarf/setup.py | ytsnarf/setup.py | from setuptools import setup, find_packages
setup(name='ytsnarf',
version='0.0.1',
description='Execute youtube-dl remotely',
long_description='ytsnarf will ssh into a host, execute youtube-dl on your behalf, and download the resulting file.',
classifiers=[
'Development Status :: 3 - Alpha',
... | from setuptools import setup, find_packages
setup(name='ytsnarf',
version='0.0.1',
description='Execute youtube-dl remotely',
long_description='ytsnarf will ssh into a host, execute youtube-dl on your behalf, and download the resulting file.',
classifiers=[
'Development Status :: 3 - Alpha',
... | mit | Python |
f3d3da15bf14442247aa10ff0fd0f7d869379039 | Ajoute un countdown pour s'assurer qu'une transaction courante est finie quand celery reçoit la tâche. | dezede/dezede,dezede/dezede,dezede/dezede,dezede/dezede | libretto/signals.py | libretto/signals.py | # coding: utf-8
from __future__ import unicode_literals
from celery_haystack.signals import CelerySignalProcessor
from django.contrib.admin.models import LogEntry
from django.contrib.sessions.models import Session
from reversion.models import Version, Revision
from .tasks import auto_invalidate
class CeleryAutoInval... | # coding: utf-8
from __future__ import unicode_literals
from celery_haystack.signals import CelerySignalProcessor
from django.contrib.admin.models import LogEntry
from django.contrib.sessions.models import Session
from reversion.models import Version, Revision
from .tasks import auto_invalidate
class CeleryAutoInval... | bsd-3-clause | Python |
e392ac0514912b401e9a149eace90e57e5b07731 | check ed2k hash | GeassDB/xunlei-lixian,sndnvaps/xunlei-lixian,xieyanhao/xunlei-lixian,wangjun/xunlei-lixian,ccagg/xunlei,davies/xunlei-lixian,windygu/xunlei-lixian,myself659/xunlei-lixian,iambus/xunlei-lixian,wogong/xunlei-lixian,sdgdsffdsfff/xunlei-lixian,liujianpc/xunlei-lixian | lixian_hash_ed2k.py | lixian_hash_ed2k.py |
import hashlib
chunk_size = 9728000
buffer_size = 1024*1024
def md4():
return hashlib.new('md4')
def hash_stream(stream):
total_md4 = None
while True:
chunk_md4 = md4()
chunk_left = chunk_size
while chunk_left:
n = min(chunk_left, buffer_size)
part = stream.read(n)
chunk_md4.update(part)
if len... |
import hashlib
chunk_size = 9728000
def md4():
return hashlib.new('md4')
def hash_stream(stream):
total_md4 = None
while True:
chunk_md4 = md4()
chunk_left = chunk_size
while chunk_left:
n = min(chunk_left, 1024*1024)
part = stream.read(n)
chunk_md4.update(part)
if len(part) < n:
if total_m... | mit | Python |
3806c72a99af8dad6216451893840f59790899da | Bump droplet-planning package version | wheeler-microfluidics/microdrop | pavement.py | pavement.py | import sys
import os
import pkg_resources
from paver.easy import task, needs, path
from paver.setuputils import setup
root_dir = path(__file__).parent.abspath()
if root_dir not in sys.path:
sys.path.insert(0, str(root_dir))
import version
install_requires = ['application_repository>=0.5', 'blinker', 'configobj'... | import sys
import os
import pkg_resources
from paver.easy import task, needs, path
from paver.setuputils import setup
root_dir = path(__file__).parent.abspath()
if root_dir not in sys.path:
sys.path.insert(0, str(root_dir))
import version
install_requires = ['application_repository>=0.5', 'blinker', 'configobj'... | bsd-3-clause | Python |
d9b4121743f253b6d1f2b4032517f8f53fb70ed2 | remove '\r' from xpath before validation | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/apps/app_manager/xpath_validator/wrapper.py | corehq/apps/app_manager/xpath_validator/wrapper.py | from __future__ import absolute_import
from __future__ import unicode_literals
from collections import namedtuple
from corehq.apps.app_manager.xpath_validator.config import get_xpath_validator_path
from corehq.apps.app_manager.xpath_validator.exceptions import XpathValidationError
from dimagi.utils.subprocess_manager i... | from __future__ import absolute_import
from __future__ import unicode_literals
from collections import namedtuple
from corehq.apps.app_manager.xpath_validator.config import get_xpath_validator_path
from corehq.apps.app_manager.xpath_validator.exceptions import XpathValidationError
from dimagi.utils.subprocess_manager i... | bsd-3-clause | Python |
148419d8824764a5ea0b47f7c69b3b1916fcfe73 | Bump emulator limit. | pebble/cloudpebble-qemu-controller | settings.py | settings.py | __author__ = 'katharine'
from os import environ as env
import multiprocessing
LAUNCH_AUTH_HEADER = env.get('LAUNCH_AUTH_HEADER', 'secret')
EMULATOR_LIMIT = int(env.get('EMULATOR_FIXED_LIMIT', (multiprocessing.cpu_count() - 1) * 6))
QEMU_DIR = env['QEMU_DIR']
QEMU_BIN = env.get('QEMU_BIN', 'qemu-system-arm')
PKJS_BIN ... | __author__ = 'katharine'
from os import environ as env
import multiprocessing
LAUNCH_AUTH_HEADER = env.get('LAUNCH_AUTH_HEADER', 'secret')
EMULATOR_LIMIT = int(env.get('EMULATOR_FIXED_LIMIT', multiprocessing.cpu_count() * 3 - 2))
QEMU_DIR = env['QEMU_DIR']
QEMU_BIN = env.get('QEMU_BIN', 'qemu-system-arm')
PKJS_BIN = ... | mit | Python |
4357b41bdc405815c6d190d0255708825162b96a | Make /management available to is_staff users | eduNEXT/edunext-ecommerce,eduNEXT/edunext-ecommerce,eduNEXT/edunext-ecommerce,edx/ecommerce,eduNEXT/edunext-ecommerce,edx/ecommerce,edx/ecommerce,edx/ecommerce | ecommerce/management/views.py | ecommerce/management/views.py | import logging
from django.contrib import messages
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
from django.utils.translation import ugettext as _
from django.views.generic import TemplateView
from ecommerce.management.utils import FulfillFrozenBaskets, refund_basket_transactions
lo... | import logging
from django.contrib import messages
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
from django.utils.translation import ugettext as _
from django.views.generic import TemplateView
from ecommerce.management.utils import FulfillFrozenBaskets, refund_basket_transactions
lo... | agpl-3.0 | Python |
43d760533b9be8209db6c35a992e1e9bfc1cb574 | use cStringIO to improve perforamce in python 2, fix #19 | chfw/pyexcel-io,chfw/pyexcel-io | pyexcel_io/_compact.py | pyexcel_io/_compact.py | """
pyexcel_io._compact
~~~~~~~~~~~~~~~~~~~
Compatibles
:copyright: (c) 2014-2017 by Onni Software Ltd.
:license: New BSD License, see LICENSE for more details
"""
# flake8: noqa
# pylint: disable=import-error
# pylint: disable=invalid-name
# pylint: disable=too-few-public-methods
# pylint: disabl... | """
pyexcel_io._compact
~~~~~~~~~~~~~~~~~~~
Compatibles
:copyright: (c) 2014-2017 by Onni Software Ltd.
:license: New BSD License, see LICENSE for more details
"""
# flake8: noqa
# pylint: disable=import-error
# pylint: disable=invalid-name
# pylint: disable=too-few-public-methods
# pylint: disabl... | bsd-3-clause | Python |
cf457a8ba688b33748bb03baa5a77d9b4e638e9d | Add partially implemented list option. | d6e/emotion | emote/emote.py | emote/emote.py | """ A simple CLI tool for quickly copying common emoticon/emoji to your
clipboard. """
import pyperclip
import json
import sys
import argparse
with open("mapping.json") as f:
emotes = json.load(f)
def parse_arguments():
parser = argparse.ArgumentParser(
description=sys.modules[__name__].__doc__,
... | """ A simple CLI tool for quickly copying common emoticon/emoji to your
clipboard. """
import pyperclip
import json
import sys
import argparse
with open("mapping.json") as f:
emotes = json.load(f)
def main():
parser = argparse.ArgumentParser(
description=sys.modules[__name__].__doc__,
... | mit | Python |
e23657d6311b8b6c1b283c3d10ca3c25586f7d84 | Enforce SVN mirror URL for WebRTC trybot recipe. | eunchong/build,eunchong/build,eunchong/build,eunchong/build | scripts/slave/recipe_modules/webrtc/api.py | scripts/slave/recipe_modules/webrtc/api.py | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from slave import recipe_api
class WebRTCApi(recipe_api.RecipeApi):
def __init__(self, **kwargs):
super(WebRTCApi, self).__init__(**kwargs)
self._... | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from slave import recipe_api
class WebRTCApi(recipe_api.RecipeApi):
def __init__(self, **kwargs):
super(WebRTCApi, self).__init__(**kwargs)
self._... | bsd-3-clause | Python |
759642aa9dbd8646daf66a6154d9a78182d7d18c | Handle blank assignees in Jira. | jk0/pyhole,jk0/pyhole,jk0/pyhole | pyhole/plugins/jira.py | pyhole/plugins/jira.py | # Copyright 2016 Josh Kearney
#
# 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... | # Copyright 2016 Josh Kearney
#
# 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... | apache-2.0 | Python |
f44b6a8ab36a6c9c23c912ed32c76c44daefbc91 | Update __init__.py | jklenzing/pysat,rstoneback/pysat | pysat/ssnl/__init__.py | pysat/ssnl/__init__.py | """
pysat.ssnl is a pysat module that provides
the interface to perform seasonal analysis on
data managed by pysat. These analysis methods
are independent of instrument type.
Main Features
-------------
- Seasonal averaging routine for 1D and 2D data.
- Occurrence probability routines, daily or by orbit.
- Scatterplo... | """
pysat.ssnl is a pysat module that provides
the interface to perform seasonal analysis on
data managed by pysat. These analysis methods
are independent of instrument type.
Main Features
-------------
- Seasonal averaging routine for 1D and 2D data.
- Occurrence probability routines, daily or by orbit.
- Scatterplo... | bsd-3-clause | Python |
8df06e425ac0b445c1b30dac5359f315d7be5101 | add reference to ansible-sshkeys repo | sadsfae/misc-scripts,sadsfae/misc-scripts,sadsfae/misc-scripts,sadsfae/misc-scripts | python/ssh-key-copy.py | python/ssh-key-copy.py | #!/usr/bin/env python
#-*- coding: iso-8859-15 -*-
# simple tool to interactively copy additional ssh keys to hosts
# assumes you have root credentials or key already in place
# you should use the Ansible authorized_key module if you want
# to truly manage your keys properly however:
# http://docs.ansible.com/ansible/a... | #!/usr/bin/env python
#-*- coding: iso-8859-15 -*-
# simple tool to interactively copy additional ssh keys to hosts
# assumes you have root credentials or key already in place
# you should use the Ansible authorized_key module if you want
# to truly manage your keys properly however:
# http://docs.ansible.com/ansible/a... | bsd-3-clause | Python |
86876dd4d960a20b19f8df567dd065b32faa4e5a | Fix file open with non-ascii characters | karamanolev/WhatManager2,MADindustries/WhatManager2,karamanolev/WhatManager2,karamanolev/WhatManager2,MADindustries/WhatManager2,MADindustries/WhatManager2,karamanolev/WhatManager2,MADindustries/WhatManager2 | qiller/make_torrent.py | qiller/make_torrent.py | from __future__ import unicode_literals
import logging
import os
from subprocess import call
import os.path
from qiller.utils import q_enc, q_dec
from what_transcode.utils import pthify_torrent
BAD_FILES = ['.ds_store', 'thumbs.db']
logger = logging.getLogger(__name__)
def remove_bad_files(temp_dir):
for f i... | from __future__ import unicode_literals
import logging
import os
from subprocess import call
import os.path
from qiller.utils import q_enc, q_dec
from what_transcode.utils import pthify_torrent
BAD_FILES = ['.ds_store', 'thumbs.db']
logger = logging.getLogger(__name__)
def remove_bad_files(temp_dir):
for f i... | mit | Python |
b3978be8bcec55b0b8b41109068807269962f58e | add flush method to burst handler | loomchild/burstlogging | python/burstlogging.py | python/burstlogging.py | import logging
from logging import Handler, NullHandler
from collections import deque
DEFAULT_CAPACITY = 1000
DEFAULT_THRESHOLD = 0.8
class BurstHandler(Handler):
def __init__(self, target=NullHandler(), emitLevel=logging.INFO,
burstLevel=logging.ERROR, level=logging.NOTSET,
capacity=DE... | import logging
from logging import Handler, NullHandler
from collections import deque
DEFAULT_CAPACITY = 1000
DEFAULT_THRESHOLD = 0.8
class BurstHandler(Handler):
def __init__(self, target=NullHandler(), emitLevel=logging.INFO,
burstLevel=logging.ERROR, level=logging.NOTSET,
capacity=DE... | mit | Python |
f76a66809237af29de8bfaeacd017d8f8b60df78 | Save test results to XML added | amazpyel/sqa_training,amazpyel/sqa_training,amazpyel/sqa_training | python/http_checker.py | python/http_checker.py | import unittest
import requests
import lxml.html
import xmlrunner
class TestHtmlTask(unittest.TestCase):
def setUp(self):
self.urls = open("urls.txt", 'r')
self.url_google = self.urls.readline()
self.url_habr = self.urls.readline()
self.urls.close()
def test_1(self):
e... | import unittest
import requests
import lxml.html
class TestHtmlTask(unittest.TestCase):
def setUp(self):
self.ulr_google = "https://www.google.com.ua/"
self.url_habr = "http://habrahabr.ru/hub/gdev/"
def test_1(self):
expected_response_1 = 200
r = requests.get(self.ulr_google)... | mit | Python |
b8415123e73ba681007d3c0204023df962418f49 | Add actor.instrument {"PFS", "CHARIS"} | CraigLoomis/ics_hxActor,CraigLoomis/ics_hxActor | python/hxActor/main.py | python/hxActor/main.py | #!/usr/bin/env python
import actorcore.ICC
class OurActor(actorcore.ICC.ICC):
def __init__(self, name,
productName=None, configFile=None,
modelNames=('hx'),
debugLevel=30):
""" Setup an Actor instance. See help for actorcore.Actor for details. """
... | #!/usr/bin/env python
import actorcore.ICC
class OurActor(actorcore.ICC.ICC):
def __init__(self, name,
productName=None, configFile=None,
modelNames=('hx'),
debugLevel=30):
""" Setup an Actor instance. See help for actorcore.Actor for details. """
... | mit | Python |
97850a2f8f5f31308cb81ff480c249a3084e48fd | fix bugs | open-cloud/xos,wathsalav/xos,xmaruto/mcord,cboling/xos,open-cloud/xos,jermowery/xos,cboling/xos,cboling/xos,opencord/xos,cboling/xos,opencord/xos,wathsalav/xos,jermowery/xos,zdw/xos,cboling/xos,wathsalav/xos,jermowery/xos,zdw/xos,zdw/xos,jermowery/xos,xmaruto/mcord,zdw/xos,wathsalav/xos,opencord/xos,open-cloud/xos,xmar... | plstackapi/planetstack/api/roles.py | plstackapi/planetstack/api/roles.py | from plstackapi.openstack.client import OpenStackClient
from plstackapi.openstack.driver import OpenStackDriver
from plstackapi.planetstack.api.auth import auth_check
from plstackapi.planetstack.models import *
def add_role(auth, name):
driver = OpenStackDriver(client = auth_check(auth))
keystone_role = ... | from plstackapi.openstack.client import OpenStackClient
from plstackapi.openstack.driver import OpenStackDriver
from plstackapi.planetstack.api.auth import auth_check
from plstackapi.planetstack.models import *
def add_role(auth, name):
driver = OpenStackDriver(client = auth_check(auth))
keystone_role = ... | apache-2.0 | Python |
858a6dd2b5c530251e6eef85db1d655331808ac9 | Add ei-manage profile link | dpaleino/pollirio,dpaleino/pollirio | pollirio/modules/erep_ei.py | pollirio/modules/erep_ei.py | # -*- coding: utf-8 -*-
from pollirio.modules import expose
from pollirio.dbutils import *
from pollirio import choose_dest
from pollirio import conf
from erepublik import get_uid
def reclute_link(bot, ievent, link):
if ievent.channel not in ['#reclute-war']:
return
bot.sendLine('WHO %s' % ievent.cha... | # -*- coding: utf-8 -*-
from pollirio.modules import expose
from pollirio.dbutils import *
from pollirio import choose_dest
from pollirio import conf
def reclute_link(bot, ievent, link):
if ievent.channel not in ['#reclute-war']:
return
bot.sendLine('WHO %s' % ievent.channel)
modes = bot.userlist... | mit | Python |
514406e94aa71571c3babd9154174eb5a1ca9312 | Remove even more testing vestiges. | llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb | packages/Python/lldbsuite/test/expression_command/persist_objc_pointeetype/TestPersistObjCPointeeType.py | packages/Python/lldbsuite/test/expression_command/persist_objc_pointeetype/TestPersistObjCPointeeType.py | """
Test that we can p *objcObject
"""
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class PersistObjCPointeeType(TestBase):
mydir = TestBase.compute_mydir(__file__)
def setUp(self):
... | """
Test that we can p *objcObject
"""
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class PersistObjCPointeeType(TestBase):
mydir = TestBase.compute_mydir(__file__)
def setUp(self):
... | apache-2.0 | Python |
1aff310838a205a1ee03fd91b29c868ef3f05bba | add tabs | lbryio/lbryum,imrehg/electrum,pknight007/electrum-vtc,spesmilo/electrum,asfin/electrum,fireduck64/electrum,molecular/electrum,kyuupichan/electrum,fujicoin/electrum-fjc,cryptapus/electrum,fireduck64/electrum,FairCoinTeam/electrum-fair,imrehg/electrum,procrasti/electrum,cryptapus/electrum-myr,fyookball/electrum,imrehg/el... | client/gui_qt.py | client/gui_qt.py | import sys
# todo: see PySide
from PyQt4.QtGui import *
from PyQt4.QtCore import *
import PyQt4.QtCore as QtCore
import PyQt4.QtGui as QtGui
def restore_create_dialog(wallet):
pass
class BitcoinWidget(QWidget):
def __init__(self, wallet):
super(BitcoinWidget, self).__init__()
self.wallet =... | import sys
from PyQt4.QtGui import *
import PyQt4.QtCore as QtCore
def restore_create_dialog(wallet):
pass
class BitcoinWidget(QWidget):
def __init__(self, wallet):
super(BitcoinWidget, self).__init__()
self.wallet = wallet
self.initUI()
def initUI(self):
qbtn = QPushBu... | mit | Python |
9335abc9e96d5a32ffe7ec6dcddf03389d9895d4 | change description | Pexego/account-financial-tools,syci/account-financial-tools,raycarnes/account-financial-tools,lepistone/account-financial-tools,VitalPet/account-financial-tools,Nowheresly/account-financial-tools,yelizariev/account-financial-tools,factorlibre/account-financial-tools,luc-demeyer/account-financial-tools,yvaucher/account-... | account_tax_update/__openerp__.py | account_tax_update/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012 Therp BV (<http://therp.nl>).
# Copyright (C) 2013 Camptocamp SA.
#
# This program is free software: you can redistribute it and/or modify
... | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012 Therp BV (<http://therp.nl>).
# Copyright (C) 2013 Camptocamp SA.
#
# This program is free software: you can redistribute it and/or modify
... | agpl-3.0 | Python |
7d56fb84b38439840af2aca0b4b54e493d2afe04 | bump version | arvkevi/kneed,arvkevi/kneed | kneed/version.py | kneed/version.py | __version__ = "0.6.0"
| __version__ = "0.5.3"
| bsd-3-clause | Python |
20bcd63a02785aaef188fe9bcf5336b32cf5f704 | Add __repr__ to Token | funkybob/knights-templater,funkybob/knights-templater | knights/lexer.py | knights/lexer.py | from enum import Enum
import re
TokenType = Enum('Token', 'comment text var block',)
tag_re = re.compile(
'|'.join([
r'{%\s*(?P<block>.+?)\s*%}',
r'{{\s*(?P<var>.+?)\s*}}',
r'{#\s*(?P<comment>.+?)\s*#}'
]),
re.DOTALL
)
class Token:
__slots__ = ('mode', 'content', 'lineno')
... | from enum import Enum
import re
TokenType = Enum('Token', 'comment text var block',)
tag_re = re.compile(
'|'.join([
r'{%\s*(?P<block>.+?)\s*%}',
r'{{\s*(?P<var>.+?)\s*}}',
r'{#\s*(?P<comment>.+?)\s*#}'
]),
re.DOTALL
)
class Token:
__slots__ = ('mode', 'content', 'lineno')
... | mit | Python |
7b8e0e8e3a716229aefdd70370a6c2b2aadc435f | add optional message after key hit | jamesabel/pressenter2exit | pressenter2exit/__init__.py | pressenter2exit/__init__.py |
import time
import threading
__version__ = '0.0.10'
class PressEnter2Exit(threading.Thread):
"""
Press Enter to Exit class. Facilitates exit of a Python CLI program in a controlled way.
"""
def __init__(self, message=None):
super().__init__(daemon=True)
self.message = message
... |
import time
import threading
__version__ = '0.0.9'
class PressEnter2Exit(threading.Thread):
"""
Press Enter to Exit class. Facilitates exit of a Python CLI program in a controlled way.
"""
def __init__(self):
super().__init__(daemon=True)
self.start_time = time.time()
self.e... | mit | Python |
3f271feb695135064edfa9dd2a9824bbc9bee142 | install vocab | bendichter/tenseflow,bendichter/tenseflow,bendichter/tenseflow,bendichter/change_tense,bendichter/change_tense | change_tense/__init__.py | change_tense/__init__.py | import subprocess
#subprocess.check_output(['ls','-l']) #all that is technically needed...
print subprocess.check_output(['python', '-m', 'spacy', 'download', 'en'])
| mit | Python | |
ec5bcd6a2ea41651e9a64ee1e5315b3bb4d06306 | Clarify comment around inclusion of static serving | ResearchSoftwareInstitute/MyHPOM,ResearchSoftwareInstitute/MyHPOM,ResearchSoftwareInstitute/MyHPOM,ResearchSoftwareInstitute/MyHPOM,ResearchSoftwareInstitute/MyHPOM | hydroshare/urls.py | hydroshare/urls.py | from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.auth import views as auth_views
admin.autodiscover()
urlpatterns = [
url("^mmh-admin/", include(admin.site.urls)),
url(r'^accounts/login/$'... | from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.auth import views as auth_views
admin.autodiscover()
urlpatterns = [
url("^mmh-admin/", include(admin.site.urls)),
url(r'^accounts/login/$'... | bsd-3-clause | Python |
cce91f1c4f029beea420bf2c8fe1eec4506c2168 | remove monkeypatch | pipermerriam/eth-testrpc,ConsenSys/eth-testrpc,ConsenSys/testrpc | eth_tester_client/__init__.py | eth_tester_client/__init__.py | import pkg_resources
from .client import EthTesterClient # NOQA
__version__ = pkg_resources.get_distribution('ethereum-tester-client').version
| import pkg_resources
from gevent import monkey
monkey.patch_all()
from .client import EthTesterClient # NOQA
__version__ = pkg_resources.get_distribution('ethereum-tester-client').version
| mit | Python |
ebdff91269f6b32c9fbdc99dc246a03ebf784b0b | Fix pyvmomi 6 support | dahuebi/vsmomi,dahuebi/vsmomi | vsmomi/_service_instance.py | vsmomi/_service_instance.py | # -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
from future.builtins.disabled import *
import base64
import atexit
import ssl
import requests
# disable warnings
try:
requests.packages.urllib3.disable_warnings()
except At... | # -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
from future.builtins.disabled import *
import base64
import atexit
import requests
# disable warnings
try:
requests.packages.urllib3.disable_warnings()
except AttributeErro... | apache-2.0 | Python |
a1e8de2da4cfcc90d8e34b3489d0f577967904a9 | Remove the output file after testing | Floato/electron,Floato/electron,Floato/electron,Floato/electron,Floato/electron,Floato/electron | script/test.py | script/test.py | #!/usr/bin/env python
import os
import subprocess
import sys
from lib.util import atom_gyp, rm_rf
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
PROJECT_NAME = atom_gyp()['project_name%']
PRODUCT_NAME = atom_gyp()['product_name%']
def main():
os.chdir(SOURCE_ROOT)
config = 'D'
i... | #!/usr/bin/env python
import os
import subprocess
import sys
from lib.util import atom_gyp
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
PROJECT_NAME = atom_gyp()['project_name%']
PRODUCT_NAME = atom_gyp()['product_name%']
def main():
os.chdir(SOURCE_ROOT)
config = 'D'
if len(s... | mit | Python |
9864f9c60e65fa73f15504950df5ce71baf23dcb | Use the API as it was intended | ideascube/ideascube,ideascube/ideascube,ideascube/ideascube,ideascube/ideascube | ideascube/utils.py | ideascube/utils.py | import sys
from django.conf import settings
class classproperty(property):
"""
Use it to decorate a classmethod to make it a "class property".
"""
def __get__(self, cls, owner):
return self.fget.__get__(None, owner)()
def get_server_name():
# Import here to avoid cyclic import
from ... | import sys
from django.conf import settings
class classproperty(property):
"""
Use it to decorate a classmethod to make it a "class property".
"""
def __get__(self, cls, owner):
return self.fget.__get__(None, owner)()
def get_server_name():
# Import here to avoid cyclic import
from ... | agpl-3.0 | Python |
50b5add094a9a598a77f5999f434da848437b289 | update version to 0.3.1 | JinnLynn/alfred-python | alfred/__init__.py | alfred/__init__.py | # -*- coding: utf-8 -*-
'''
Alfred Python
A simple python module for alfred workflow。
JinnLynn
http://jeeker.net
The MIT License
For more information, see the project page:
https://github.com/JinnLynn/alfred-python
'''
from __future__ import absolute_import, division, unicode_literals
__version__ = '0.3.1'
__aut... | # -*- coding: utf-8 -*-
'''
Alfred Python
A simple python module for alfred workflow。
JinnLynn
http://jeeker.net
The MIT License
For more information, see the project page:
https://github.com/JinnLynn/alfred-python
'''
from __future__ import absolute_import, division, unicode_literals
__version__ = '0.3'
__autho... | mit | Python |
9c76fa58fac25e6720055883c34030630cb55fe4 | add support email | it-projects-llc/website-addons,it-projects-llc/website-addons,it-projects-llc/website-addons | product_price_factor/__openerp__.py | product_price_factor/__openerp__.py | # -*- coding: utf-8 -*-
{
'name': "Product price factor",
'summary': """Variate your product prices with multiplier""",
'license': 'LGPL-3',
'author': "IT-Projects LLC, Ildar Nasyrov",
"support": "apps@it-projects.info",
'website': "https://twitter.com/nasyrov_ildar",
'category': 'Sales Mana... | # -*- coding: utf-8 -*-
{
'name': "Product price factor",
'summary': """Variate your product prices with multiplier""",
'license': 'LGPL-3',
'author': "IT-Projects LLC, Ildar Nasyrov",
'website': "https://twitter.com/nasyrov_ildar",
'category': 'Sales Management',
'images': ['images/1.png'],... | mit | Python |
9257550e52f8e4d2e10995fa3f36f6c01842cf66 | bump version | slash-testing/backslash-python,vmalloc/backslash-python | backslash/__version__.py | backslash/__version__.py | __version__ = "2.10.2"
| __version__ = "2.10.1"
| bsd-3-clause | Python |
9db6054084eb1393396081d4728bec4409337082 | Update to 1.6.0 | HighwayThree/ckanext-bcgov,Mbrownshoes/ckanext-bcgov,bcgov/ckanext-bcgov,Mbrownshoes/ckanext-bcgov,Mbrownshoes/ckanext-bcgov,HighwayThree/ckanext-bcgov,HighwayThree/ckanext-bcgov | ckanext/bcgov/version.py | ckanext/bcgov/version.py | # Copyright 2015, Province of British Columbia
# License: https://github.com/bcgov/ckanext-bcgov/blob/master/license
version = '1.6.0'
| # Copyright 2015, Province of British Columbia
# License: https://github.com/bcgov/ckanext-bcgov/blob/master/license
version = '1.5.3'
| agpl-3.0 | Python |
b9f3d2f419c744aee693be5f0f452f30d86f3027 | Undo header required init variables | cemsbr/python-openflow,kytos/python-openflow | ofp/v0x01/common/header.py | ofp/v0x01/common/header.py | """Defines Header classes and related items"""
# System imports
import enum
# Third-party imports
# Local source tree imports
from ofp.v0x01.foundation import base
from ofp.v0x01.foundation import basic_types
# Enums
class OFPType(enum.Enum):
"""Enumeration of Message Types"""
# Symetric/Immutable message... | """Defines Header classes and related items"""
# System imports
import enum
# Third-party imports
# Local source tree imports
from ofp.v0x01.foundation import base
from ofp.v0x01.foundation import basic_types
# Enums
class OFPType(enum.Enum):
"""Enumeration of Message Types"""
# Symetric/Immutable message... | mit | Python |
df5568204566f3607c8fc895fd2330465c39de02 | Bump version to 3.2-dev | indico/indico,indico/indico,DirkHoffmann/indico,DirkHoffmann/indico,DirkHoffmann/indico,indico/indico,indico/indico,DirkHoffmann/indico | indico/__init__.py | indico/__init__.py | # This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from indico.util.mimetypes import register_custom_mimetypes
__version__ = '3.2-dev'
PREFERRED_PYTHON_VER... | # This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from indico.util.mimetypes import register_custom_mimetypes
__version__ = '3.1-dev'
PREFERRED_PYTHON_VER... | mit | Python |
e3a1fb9c2b794490b5bf028f2f7454324c0f017e | Enhance swap with pixel blanking and a small state machine; buggy | jonspeicher/blinkyfun | animations/swap.py | animations/swap.py | from blinkytape import animation, color
import random
class Swap(animation.Animation):
def __init__(self, pattern, frame_period_sec):
super(Swap, self).__init__(frame_period_sec)
self._pixels = pattern.pixels
@property
def finished(self):
# TBD: There is some weird off-by-one here;... | from blinkytape import animation
import random
class Swap(animation.Animation):
def __init__(self, pattern, frame_period_sec):
super(Swap, self).__init__(frame_period_sec)
self._pixels = pattern.pixels
@property
def finished(self):
return not self._index_pairs
def begin(self):... | mit | Python |
bbf02d71817365f77f9c87d0360e0639f9c61313 | Include template engine | cmichal/python-social-auth,lneoe/python-social-auth,S01780/python-social-auth,DhiaEddineSaidi/python-social-auth,JJediny/python-social-auth,MSOpenTech/python-social-auth,falcon1kr/python-social-auth,alrusdi/python-social-auth,henocdz/python-social-auth,jneves/python-social-auth,webjunkie/python-social-auth,degs098/pyth... | examples/pyramid_example/example/__init__.py | examples/pyramid_example/example/__init__.py | import sys
sys.path.append('../..')
from pyramid.config import Configurator
from pyramid.session import UnencryptedCookieSessionFactoryConfig
from sqlalchemy import engine_from_config
from social.apps.pyramid_app.models import init_social
from .models import DBSession, Base
def main(global_config, **settings):
... | import sys
sys.path.append('../..')
from pyramid.config import Configurator
from pyramid.session import UnencryptedCookieSessionFactoryConfig
from sqlalchemy import engine_from_config
from social.apps.pyramid_app.models import init_social
from .models import DBSession, Base
def main(global_config, **settings):
... | bsd-3-clause | Python |
7cea4bf3dd52af8efcaa676217d3c413a60cdbdf | Bump package version 1.30.1 | instana/python-sensor,instana/python-sensor | instana/version.py | instana/version.py | # Module version file. Used by setup.py and snapshot reporting.
VERSION = '1.30.1'
| # Module version file. Used by setup.py and snapshot reporting.
VERSION = '1.30.0'
| mit | Python |
ddcb71c0433897cf418237cf00fd2811f29ee145 | Replace arrow with pytz | gcavallo/iRO2-Status-API,gcavallo/iRO2-Status-API,gcavallo/iRO2-Status-API | iro2-status-api.py | iro2-status-api.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
# iRO2-Status-API
# http://github.com/gcavallo/iro2-status-api/
# Copyright (c) 2014 by Gabriel Cavallo <gabrielcavallo@mail.com>
# BSD 3-Clause License http://opensource.org/licenses/BSD-3-Clause
import json, socket
from datetime import datetime
import redis, bottle
... | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
# iRO2-Status-API
# http://github.com/gcavallo/iro2-status-api/
# Copyright (c) 2014 by Gabriel Cavallo <gabrielcavallo@mail.com>
# BSD 3-Clause License http://opensource.org/licenses/BSD-3-Clause
from gevent import monkey; monkey.patch_all()
import redis, bottle, arro... | bsd-3-clause | Python |
df029f32adb6e93e6fbd2d00e37b6fbe8b3c531f | Fix assumption in admin.py, works fine on 2.6 but errors on 2.5 | nikdoof/test-auth | hr/admin.py | hr/admin.py | from django.contrib import admin
from django.contrib.auth.models import User
from django.contrib.auth.admin import UserAdmin
from hr.models import Application, Recommendation, Audit, Blacklist, BlacklistSource
class ApplicationAdmin(admin.ModelAdmin):
list_display = ('user', 'character', 'corporation', 'status', '... | from django.contrib import admin
from django.contrib.auth.models import User
from django.contrib.auth.admin import UserAdmin
from hr.models import Application, Recommendation, Audit, Blacklist, BlacklistSource
class ApplicationAdmin(admin.ModelAdmin):
list_display = ('user', 'character', 'corporation', 'status', '... | bsd-3-clause | Python |
bfe9d7fcf315c6cff062f207941990f07f88e632 | Add buchgr@google.com to Jenkins ADMIN_USERS. | bazelbuild/continuous-integration,bazelbuild/continuous-integration,bazelbuild/continuous-integration,bazelbuild/continuous-integration,bazelbuild/continuous-integration,bazelbuild/continuous-integration,bazelbuild/continuous-integration,bazelbuild/continuous-integration | jenkins/config.bzl | jenkins/config.bzl | ADMIN_USERS = [
"dmarting@google.com",
"dslomov@google.com",
"kchodorow@google.com",
"laszlocsomor@google.com",
"lberki@google.com",
"pcloudy@google.com",
"yueg@google.com",
"jcater@google.com",
"aehlig@google.com",
"elenairina@google.com",
"hlopko@google.com",
"vladmos@g... | ADMIN_USERS = [
"dmarting@google.com",
"dslomov@google.com",
"kchodorow@google.com",
"laszlocsomor@google.com",
"lberki@google.com",
"pcloudy@google.com",
"yueg@google.com",
"jcater@google.com",
"aehlig@google.com",
"elenairina@google.com",
"hlopko@google.com",
"vladmos@g... | apache-2.0 | Python |
a5a5a950e97af043574de284d148cf8741ecbac1 | Check add_lambda_permissions | gogoair/foremast,gogoair/foremast | tests/apigateway/test_api.py | tests/apigateway/test_api.py | """Test API Gateway functions."""
from unittest import mock
import botocore
from foremast.awslambda.api_gateway_event.api_gateway_event import APIGateway
ERROR_RESPONSE = {'Error': {}}
TEST_RULES = {'api_name': 1, 'method': 'PUT'}
@mock.patch('foremast.awslambda.api_gateway_event.api_gateway_event.boto3')
@mock.pat... | """Test API Gateway functions."""
from unittest import mock
from foremast.awslambda.api_gateway_event.api_gateway_event import APIGateway
TEST_RULES = {'api_name': 1, 'method': 'PUT'}
@mock.patch('foremast.awslambda.api_gateway_event.api_gateway_event.boto3')
@mock.patch('foremast.awslambda.api_gateway_event.api_ga... | apache-2.0 | Python |
8605cb324e72744d693531002225f313af681d8a | Disable locale related test on FreeBSD | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | tests/integration/modules/test_localemod.py | tests/integration/modules/test_localemod.py | import pytest
import salt.utils.platform
from tests.support.case import ModuleCase
from tests.support.helpers import destructiveTest, requires_salt_modules, slowTest
from tests.support.unit import skipIf
def _find_new_locale(current_locale):
for locale in ["en_US.UTF-8", "de_DE.UTF-8", "fr_FR.UTF-8"]:
if ... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import pytest
import salt.utils.platform
from tests.support.case import ModuleCase
from tests.support.helpers import destructiveTest, requires_salt_modules, slowTest
from tests.support.unit import skipIf
def _find_new_l... | apache-2.0 | Python |
088eb8d51f0092c9cfa62c490ae5a9ad111061e0 | Mark HTML generated by custom template filter as safe if auto-escaping is enabled. | homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps,m-ober/byceps,m-ober/byceps,m-ober/byceps | webapp/byceps/util/templatefilters.py | webapp/byceps/util/templatefilters.py | # -*- coding: utf-8 -*-
"""
byceps.util.templatefilters
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provide and register custom template filters.
:Copyright: 2006-2015 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from jinja2 import evalcontextfilter, Markup
from . import dateformat, money
@evalconte... | # -*- coding: utf-8 -*-
"""
byceps.util.templatefilters
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provide and register custom template filters.
:Copyright: 2006-2015 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from . import dateformat, money
def dim(value):
"""Render value in a way so that it ... | bsd-3-clause | Python |
a7eac2eb307fea1f55c5924b34999444ae40b12c | Revert to using metadata/ endpoint because it was breaking uploads | haoyuchen1992/osf.io,HalcyonChimera/osf.io,danielneis/osf.io,amyshi188/osf.io,kushG/osf.io,haoyuchen1992/osf.io,mluo613/osf.io,caseyrygt/osf.io,abought/osf.io,cosenal/osf.io,kushG/osf.io,saradbowman/osf.io,abought/osf.io,DanielSBrown/osf.io,haoyuchen1992/osf.io,kwierman/osf.io,HarryRybacki/osf.io,Ghalko/osf.io,kch8qx/o... | website/addons/dropbox/views/hgrid.py | website/addons/dropbox/views/hgrid.py | # -*- coding: utf-8 -*-
import os
import logging
from website.project.decorators import must_be_contributor_or_public, must_have_addon
from website.util import rubeus
from website.addons.dropbox.client import get_node_client
from website.addons.dropbox.utils import (
clean_path, list_dropbox_files, metadata_to_hg... | # -*- coding: utf-8 -*-
import os
import logging
from framework.sessions import session
from website.project.decorators import must_be_contributor_or_public, must_have_addon
from website.util import rubeus
from website.addons.dropbox.client import get_node_client
from website.addons.dropbox.utils import (
clean_... | apache-2.0 | Python |
fccaa0234417fb73ad3aace9054c4aaf5a1e9780 | modify payment message field to blank True | pythonkr/pyconapac-2016,pythonkr/pyconapac-2016,pythonkr/pyconapac-2016 | registration/models.py | registration/models.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from django.contrib.auth.models import User
class Option(models.Model):
name = models.CharField(max_length=50)
description = models.TextField()
is_active = models.BooleanField(default=False)
price = models.Int... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from django.contrib.auth.models import User
class Option(models.Model):
name = models.CharField(max_length=50)
description = models.TextField()
is_active = models.BooleanField(default=False)
price = models.Int... | mit | Python |
f165d8a293dfaa1ae4af84a484392de9e3da02ef | Update what is shown admin page for jobs | crcollins/chemtools-webapp,crcollins/chemtools-webapp,crcollins/chemtools-webapp,crcollins/chemtools-webapp,crcollins/chemtools-webapp | cluster/admin.py | cluster/admin.py | from django.contrib import admin
from models import Job, Cluster, Credential, CredentialAdminForm
class JobAdmin(admin.ModelAdmin):
date_hierarchy = "created"
list_display = ("jobid", "molecule", "name", "email", "credential")
class ClusterAdmin(admin.ModelAdmin):
list_display = ("name", "hostname", "p... | from django.contrib import admin
from models import Job, Cluster, Credential, CredentialAdminForm
class JobAdmin(admin.ModelAdmin):
date_hierarchy = "created"
list_display = ("molecule", "name", "email", "credential", "nodes",
"walltime", "jobid", "created", "started", "ended")
class Cl... | mit | Python |
010043caaf1bf791ab23315d7f5977472e312276 | Add "tracing" to try-reraise2.py test. It now fails. | methoxid/micropystat,alex-march/micropython,tobbad/micropython,mgyenik/micropython,adafruit/circuitpython,tuc-osg/micropython,ericsnowcurrently/micropython,pfalcon/micropython,ChuckM/micropython,trezor/micropython,danicampora/micropython,aethaniel/micropython,xuxiaoxin/micropython,utopiaprince/micropython,lowRISC/micro... | tests/basics/try-reraise2.py | tests/basics/try-reraise2.py | # Reraise not the latest occured exception
def f():
try:
raise ValueError("val", 3)
except:
try:
print(1)
raise TypeError
except:
print(2)
try:
print(3)
try:
print(4)
r... | # Reraise not the latest occured exception
def f():
try:
raise ValueError("val", 3)
except:
try:
raise TypeError
except:
try:
try:
raise AttributeError
except:
pass
raise
... | mit | Python |
78edb47cc53e52504f2ceb8efa23ae1e50b66946 | Add runtime checks on startup to enforce that JPEG/PNG support is included when installing pillow. | rzr/synapse,matrix-org/synapse,illicitonion/synapse,rzr/synapse,matrix-org/synapse,howethomas/synapse,matrix-org/synapse,iot-factory/synapse,matrix-org/synapse,rzr/synapse,howethomas/synapse,illicitonion/synapse,matrix-org/synapse,matrix-org/synapse,howethomas/synapse,TribeMedia/synapse,iot-factory/synapse,iot-factory/... | synapse/media/v1/__init__.py | synapse/media/v1/__init__.py | # -*- coding: utf-8 -*-
import PIL.Image
# check for JPEG support.
try:
PIL.Image._getdecoder("rgb", "jpeg", None)
except IOError as e:
if str(e).startswith("decoder jpeg not available"):
raise Exception(
"FATAL: jpeg codec not supported. Install pillow correctly! "
" 'sudo apt-... | apache-2.0 | Python | |
a28b93f185199ae732c4f156188e55562698d8e2 | set focus on input box, on a click. | jaredly/pyjamas,jaredly/pyjamas,jaredly/pyjamas,jaredly/pyjamas | examples/gridedit/GridEdit.py | examples/gridedit/GridEdit.py | from pyjamas.ui import Button, RootPanel
from pyjamas.ui import Label, Grid, CellFormatter, RowFormatter
from pyjamas.ui import HTMLTable, TextBox
from pyjamas.ui import KeyboardListener
from pyjamas import Window
class GridEdit:
def onModuleLoad(self):
self.input = TextBox()
self.input.s... | from pyjamas.ui import Button, RootPanel
from pyjamas.ui import Label, Grid, CellFormatter, RowFormatter
from pyjamas.ui import HTMLTable, TextBox
from pyjamas.ui import KeyboardListener
from pyjamas import Window
class GridEdit:
def onModuleLoad(self):
self.input = TextBox()
self.input.s... | apache-2.0 | Python |
6624549ab7c1c0bdc4cc38839298ab7210f07935 | Remove unneeded imports | sbc/django-uploadify-s3 | uploadify_s3/templatetags/uploadify_tags.py | uploadify_s3/templatetags/uploadify_tags.py | from django import template
from django.conf import settings
register = template.Library()
@register.inclusion_tag('uploadify_head.html')
def uploadify_head():
return {
'MEDIA_URL': settings.MEDIA_URL,
}
@register.inclusion_tag('uploadify_widget.html')
def uploadify_widget(options):
return {... | from django import template
from django.conf import settings
import base64
import hmac, sha
register = template.Library()
@register.inclusion_tag('uploadify_head.html')
def uploadify_head():
return {
'MEDIA_URL': settings.MEDIA_URL,
}
@register.inclusion_tag('uploadify_widget.html')
def uploadif... | bsd-3-clause | Python |
4212fe7afd26767d870b05027e9437685773b46f | Update pbe_bandstructure example. | henniggroup/MPInterfaces,henniggroup/MPInterfaces,joshgabriel/MPInterfaces,joshgabriel/MPInterfaces | examples/pbe_bandstructure.py | examples/pbe_bandstructure.py | """
Relaxes 2D materials in all subdirectories of the current working
directory, along with their most stable competing species. At a
specified INTERVAL, checks if all relaxations have converged. Once all
are converged, calculates and plots the formation energies of all 2D
materials as stability_plot.pdf.
"""
import o... | """
Relaxes 2D materials in all subdirectories of the current working
directory, along with their most stable competing species. At a
specified INTERVAL, checks if all relaxations have converged. Once all
are converged, calculates and plots the formation energies of all 2D
materials as stability_plot.pdf.
"""
import o... | mit | Python |
531e0122cc48f8ae5a03b5a0b2ceb0e6ae964032 | make catch-exceptions a cli option | planetlabs/datalake,planetlabs/datalake,planetlabs/datalake,planetlabs/datalake-ingester,planetlabs/datalake,planetlabs/atl | datalake_backend/cli.py | datalake_backend/cli.py | import click
import simplejson as json
import os
from conf import set_config
from ingester import Ingester
DEFAULT_CONFIG = '/etc/datalake-backend.json'
@click.group(invoke_without_command=True)
@click.version_option()
@click.option('-c', '--config',
help=('config file. The format is just a flat json w... | import click
import simplejson as json
import os
from conf import set_config
from ingester import Ingester
DEFAULT_CONFIG = '/etc/datalake-backend.json'
@click.group(invoke_without_command=True)
@click.version_option()
@click.option('-c', '--config',
help=('config file. The format is just a flat json w... | apache-2.0 | Python |
367b6c76cac341918503163f19647872af4ddc2a | bump version to 2.1 | chhantyal/taggit-selectize,chhantyal/taggit-selectize | taggit_selectize/__init__.py | taggit_selectize/__init__.py | __version__ = '2.1'
| __version__ = '2.0'
| bsd-3-clause | Python |
08cec67186cb71a56ecae1fa84771c897111ca3f | make sure skip_warning works with no files | softwaredoug/flake8_doctest,fivestars/flake8 | flake8/util.py | flake8/util.py | import re
import os
def skip_warning(warning):
# XXX quick dirty hack, just need to keep the line in the warning
if not os.path.isfile(warning.filename):
return False
line = open(warning.filename).readlines()[warning.lineno - 1]
return skip_line(line)
def skip_line(line):
return line.str... | import re
def skip_warning(warning):
# XXX quick dirty hack, just need to keep the line in the warning
line = open(warning.filename).readlines()[warning.lineno - 1]
return skip_line(line)
def skip_line(line):
return line.strip().lower().endswith('# noqa')
_NOQA = re.compile(r'flake8[:=]\s*noqa', r... | mit | Python |
937e06fe8e69fba1f2911bbb3d60bd69b2e59501 | Use a relative path for the mxml compiler. | windmill/windmill,windmill/windmill,windmill/windmill,windmill/windmill,windmill/windmill,windmill/windmill | flash/build.py | flash/build.py | #!/usr/bin/env python
import optparse
import os
import re
import shutil
# Location of compiler
MXMLC_PATH = 'mxmlc'
# For replacing .as with .swf
as_re = re.compile('\.as$|\.mxml$')
def windmill():
cmd = MXMLC_PATH + ' -source-path=. ./org/windmill/Windmill.as -o ./org/windmill/Windmill.swf'
os.system(cmd)
... | #!/usr/bin/env python
import optparse
import os
import re
import shutil
# Location of compiler
MXMLC_PATH = '/Users/mde/flex_sdk_3/bin/mxmlc'
# For replacing .as with .swf
as_re = re.compile('\.as$|\.mxml$')
def windmill():
cmd = MXMLC_PATH + ' -source-path=. ./org/windmill/Windmill.as -o ./org/windmill/Windmil... | apache-2.0 | Python |
87fcfa9b008bc14e3ab0613c0ffc4590352b4981 | Revert "Add temporary broken view to test traceback emails on dev." | mozilla/firefox-flicks,mozilla/firefox-flicks,mozilla/firefox-flicks,mozilla/firefox-flicks | flicks/urls.py | flicks/urls.py | from django.conf import settings
from django.conf.urls import include, patterns, url
from django.contrib import admin
from django.contrib.admin import autodiscover
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.http import HttpResponse
from django.shortcuts import render
from commonwar... | from django.conf import settings
from django.conf.urls import include, patterns, url
from django.contrib import admin
from django.contrib.admin import autodiscover
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.http import HttpResponse
from django.shortcuts import render
from commonwar... | bsd-3-clause | Python |
411d51b3c668e5b5e036a6f401f4d1d3428311b5 | Add sparsity and width | numenta-archive/nupic.fluent,BoltzmannBrain/nupic.fluent,subutai/nupic.fluent,numenta/nupic.fluent,akhilaananthram/nupic.fluent | fluent/term.py | fluent/term.py | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditions apply:
#
# This pro... | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditions apply:
#
# This pro... | agpl-3.0 | Python |
ece19212e782596d2c5679ed74907d02fecd0fe5 | Allow modifying threads in admin panel. | xfix/NextBoard | forum/admin.py | forum/admin.py | from django.contrib import admin
from forum.models import Forum, Thread
admin.site.register(Forum)
admin.site.register(Thread)
| from django.contrib import admin
from forum.models import Forum
admin.site.register(Forum)
| mit | Python |
82ede7df00f6d346e49de65ad668bc69b5a6afd0 | write overall acceptance test for carpenter | IanDCarroll/xox | tests/test_carpenter_shop.py | tests/test_carpenter_shop.py | import unittest
from source.carpenter_shop import *
class CarpenterTestCase(unittest.TestCase):
def setUp(self):
self.carpenter = Carpenter()
self.mock_board = [1,10,1, 0,10,0, 1,0,10]
self.rendered_board = '''
\033[91m X \033[0m|\033[34m O \033[0m|\033[91m X \033[0m
---+---+---
\033[30m 4... | import unittest
from source.carpenter_shop import *
class CarpenterTestCase(unittest.TestCase):
def setUp(self):
self.carpenter = Carpenter()
self.mock_board = [1,10,1, 0,10,0, 1,0,10]
self.rendered_board = '''
\033[91m X \033[0m|\033[34m O \033[0m|\033[91m X \033[0m
---+---+---
\033[30m 4... | mit | Python |
4ba6e930b58e374ab19f9decd4ba46958ec780cb | add tests for main and main without curses | FunTimeCoding/python-utility,FunTimeCoding/python-utility | tests/test_python_utility.py | tests/test_python_utility.py | from sys import modules
import pytest
from python_utility.python_utility import PythonUtility
def test_return_code(capfd):
with pytest.raises(SystemExit):
PythonUtility(['--help'])
standard_output, standard_error = capfd.readouterr()
assert 'Example' in standard_output.strip()
assert standa... | from sys import modules
import pytest
from python_utility.python_utility import PythonUtility
def test_return_code(capfd):
with pytest.raises(SystemExit):
PythonUtility(['--help'])
standard_output, standard_error = capfd.readouterr()
assert 'Example' in standard_output.strip()
assert standa... | mit | Python |
1d3c1caca5869367c9abb9a4d7afeab6663c3f43 | Enforce ordering | dropbox/changes-lxc-wrapper,dropbox/changes-lxc-wrapper | tests/test_snapshot_cache.py | tests/test_snapshot_cache.py | import os.path
from mock import Mock
from subprocess import check_call
from uuid import UUID
from changes_lxc_wrapper.snapshot_cache import SnapshotCache
CACHE_PATH = '/tmp/changes-lxc-wrapper-snapshot-cache-test'
def setup_dummy_cache(path):
snapshot_1_id = '311a862b-dd15-4c44-90f1-fa95a7621860'
snapshot... | import os.path
from mock import Mock
from subprocess import check_call
from uuid import UUID
from changes_lxc_wrapper.snapshot_cache import SnapshotCache
CACHE_PATH = '/tmp/changes-lxc-wrapper-snapshot-cache-test'
def setup_dummy_cache(path):
snapshot_1_id = '311a862b-dd15-4c44-90f1-fa95a7621860'
snapshot... | apache-2.0 | Python |
724c3548d657c10de15eb830810a89b94af6d978 | Use comma in CSV POST. | ddsc/dikedata-api | dikedata_api/parsers.py | dikedata_api/parsers.py | # (c) Nelen & Schuurmans. MIT licensed, see LICENSE.rst.
from __future__ import unicode_literals
from rest_framework.parsers import BaseParser, DataAndFiles
class SimpleFileUploadParser(BaseParser):
"""
A naive raw file upload parser.
"""
media_type = '*/*' # Accept anything
def parse(self, st... | # (c) Nelen & Schuurmans. MIT licensed, see LICENSE.rst.
from __future__ import unicode_literals
from rest_framework.parsers import BaseParser, DataAndFiles
class SimpleFileUploadParser(BaseParser):
"""
A naive raw file upload parser.
"""
media_type = '*/*' # Accept anything
def parse(self, st... | mit | Python |
a43042a89d9feb9632d6cd2bfc20ff4220c3b333 | Add section | jdfreder/jupyter-tree-filter,jdfreder/jupyter-tree-filter | jupyter-tree-filter/__init__.py | jupyter-tree-filter/__init__.py | def _jupyter_nbextension_paths():
return [{
'section': 'tree',
'src': 'amd',
'dest': 'jupyter-tree-filter',
'require': 'jupyter-tree-filter/index'
}]
| def _jupyter_nbextension_paths():
return [{
'src': 'amd',
'dest': 'jupyter-tree-filter',
'require': 'jupyter-tree-filter/index'
}]
| bsd-3-clause | Python |
5ea286ba2a24daef92841d243744408a925666c2 | Print pygpu version. | senarvi/theanolm,senarvi/theanolm | theanolm/commands/version.py | theanolm/commands/version.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""A module that implements the "theanolm version" command.
"""
import theano
import pygpu
from theanolm import __version__
def version(args):
"""A function that performs the "theanolm version" command.
:type args: argparse.Namespace
:param args: a collecti... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""A module that implements the "theanolm version" command.
"""
from theanolm import __version__
import theano
def version(args):
"""A function that performs the "theanolm version" command.
:type args: argparse.Namespace
:param args: a collection of command... | apache-2.0 | Python |
4320fbbac21677a56c1f9d9e8538c40a77a169d2 | remove vim_ prefix | hoffie/hieratime | hieratime/vim_integration.py | hieratime/vim_integration.py | import sys
import vim
from .parser import parse_lines
from .clock import Clock
def refresh():
new = parse_lines(vim.current.buffer[:])
update(new)
msg("refreshed")
def clock_in():
node = node_under_cursor()
if not node:
error("unable to map current line to node")
return
node.... | import sys
import vim
from .parser import parse_lines
from .clock import Clock
def vim_refresh():
new = parse_lines(vim.current.buffer[:])
vim_update(new)
msg("refreshed")
def vim_clock_in():
node = vim_node_under_cursor()
if not node:
error("unable to map current line to node")
... | mit | Python |
0b40e035638dc019d51c53e80c8ac52a3082bbcd | Implement Acidmaw and Dreadscale | Meerkov/fireplace,NightKev/fireplace,oftc-ftw/fireplace,Meerkov/fireplace,Ragowit/fireplace,smallnamespace/fireplace,beheh/fireplace,jleclanche/fireplace,amw2104/fireplace,oftc-ftw/fireplace,amw2104/fireplace,liujimj/fireplace,smallnamespace/fireplace,liujimj/fireplace,Ragowit/fireplace | fireplace/cards/tgt/hunter.py | fireplace/cards/tgt/hunter.py | from ..utils import *
##
# Minions
# Ram Wrangler
class AT_010:
play = Find(FRIENDLY_MINIONS + BEAST) & Summon(CONTROLLER, RandomBeast())
# Stablemaster
class AT_057:
play = Buff(TARGET, "AT_057o")
# Brave Archer
class AT_059:
inspire = Find(CONTROLLER_HAND) | Hit(ENEMY_HERO, 2)
# Acidmaw
class AT_063:
eve... | from ..utils import *
##
# Minions
# Ram Wrangler
class AT_010:
play = Find(FRIENDLY_MINIONS + BEAST) & Summon(CONTROLLER, RandomBeast())
# Stablemaster
class AT_057:
play = Buff(TARGET, "AT_057o")
# Brave Archer
class AT_059:
inspire = Find(CONTROLLER_HAND) | Hit(ENEMY_HERO, 2)
##
# Spells
# Powershot
cla... | agpl-3.0 | Python |
f0165cadfde9b0b1f3f6e8b85a8a8aa7c01dac34 | refactor a bunch of monkey patching into some classes | oss/shrunk,oss/shrunk,oss/shrunk,oss/shrunk,oss/shrunk | shrunk/util.py | shrunk/util.py | # shrunk - Rutgers University URL Shortener
"""Utility functions for shrunk."""
#client=None
def get_db_client(app, g = None):
"""Gets a reference to a ShrunkClient for database operations.
:Parameters:
- `app`: A Flask application object.
- `g`: Flask's magical global state object.
:Returns... | # shrunk - Rutgers University URL Shortener
"""Utility functions for shrunk."""
import logging
#client=None
def get_db_client(app, g = None):
"""Gets a reference to a ShrunkClient for database operations.
:Parameters:
- `app`: A Flask application object.
- `g`: Flask's magical global state objec... | mit | Python |
c575c67eff9fb904c35e1e52aa12973fd29a93df | add legend_on for regplot | huangyh09/hilearn,huangyh09/hilearn | hilearn/plot/seaborn_plot.py | hilearn/plot/seaborn_plot.py | # some wrapped functions from seaborn
import numpy as np
import scipy.stats as st
import matplotlib.pyplot as plt
def regplot(x, y, hue=None, hue_values=None, show_corr=True, legend_on=True,
**kwargs):
"""Wrap plot of `seaborn.regplot` with supporting hue and showing
correlation coeffecient.
... | # some wrapped functions from seaborn
import numpy as np
import scipy.stats as st
def regplot(x, y, hue=None, hue_values=None, show_corr=True, **kwargs):
"""Wrap plot of `seaborn.regplot` with supporting hue and showing
correlation coeffecient.
Parameters
----------
x: `array_like`, (1, ) for val... | apache-2.0 | Python |
7d8ab3e9d29bc40f428a693f79f24eb99be5fde0 | Update ft_init.py | aldmbmtl/toolbox | tools/Nuke/Python/ft_init.py | tools/Nuke/Python/ft_init.py | import FloatingTools
pritn FloatingTools.cloudImport('aldmbmtl/toolbox', 'tools/Nuke/Python/HatfieldKit')
| import FloatingTools
print 'yes?'
| mit | Python |
be04a10d0e020033ac96c65a3353dab426e42c70 | read some scheduler daemon options from the settings file | OSSystems/lava-server,Linaro/lava-server,OSSystems/lava-server,Linaro/lava-server,Linaro/lava-server,Linaro/lava-server,OSSystems/lava-server | lava_scheduler_app/extension.py | lava_scheduler_app/extension.py | # Copyright (C) 2010, 2011 Linaro Limited
#
# Author: Zygmunt Krynicki <zygmunt.krynicki@linaro.org>
#
# This file is part of LAVA Server.
#
# LAVA Server is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License version 3
# as published by the Free Software F... | # Copyright (C) 2010, 2011 Linaro Limited
#
# Author: Zygmunt Krynicki <zygmunt.krynicki@linaro.org>
#
# This file is part of LAVA Server.
#
# LAVA Server is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License version 3
# as published by the Free Software F... | agpl-3.0 | Python |
1ed7b7adc0bec4ce62ebd3fc882a93285ebf3056 | fix mypy for demo deploy | SFTtech/abrechnung,SFTtech/abrechnung,SFTtech/abrechnung,SFTtech/abrechnung,SFTtech/abrechnung | tools/demo_deploy_webhook.py | tools/demo_deploy_webhook.py | #!/usr/bin/python3
# type: ignore # mypy does not like aiohttp multipart for some reason
import argparse
import os
import subprocess
from aiohttp import web
routes = web.RouteTableDef()
async def copy_file_to_container(request: web.Request, srcfile: str, destfile: str):
container = request.app["container_ho... | #!/usr/bin/python3
import argparse
import os
import subprocess
from aiohttp import web
routes = web.RouteTableDef()
async def copy_file_to_container(request: web.Request, srcfile: str, destfile: str):
container = request.app["container_host"]
subprocess.check_call(["scp", srcfile, f"root@{container}:{dest... | agpl-3.0 | Python |
6575fe1edccc6516b6d1669355d2cfe690b5c66e | use proper provider name | Impactstory/total-impact-webapp,total-impact/total-impact-webapp,total-impact/total-impact-webapp,Impactstory/total-impact-webapp,total-impact/total-impact-webapp,Impactstory/total-impact-webapp,total-impact/total-impact-webapp,Impactstory/total-impact-webapp | totalimpactwebapp/account.py | totalimpactwebapp/account.py | import logging
from totalimpactwebapp.util import cached_property
from totalimpactwebapp.util import dict_from_dir
logger = logging.getLogger("ti.account")
def account_factory(product):
account = None
if product.is_account_product:
if product.host == "twitter":
account = TwitterAccount(pr... | import logging
from totalimpactwebapp.util import cached_property
from totalimpactwebapp.util import dict_from_dir
logger = logging.getLogger("ti.account")
def account_factory(product):
account = None
if product.is_account_product:
if product.host == "twitter":
account = TwitterAccount(pr... | mit | Python |
fdbe36ae8ce5154b090df781cccfce3f4facc77c | update logic for unanswered_ticket count to match the widget | hawkrives/stolaf-ubersicht-widgets,hawkrives/stolaf-ubersicht-widgets,hawkrives/stolaf-ubersicht-widgets | lib/count_unanswered_tickets.py | lib/count_unanswered_tickets.py | from .get_tickets import get_tickets
def is_normal_priority(t):
return t['prioritytype'] and t['prioritytype']['priorityTypeName'] == 'Normal Svc Req'
def is_unanswered(t):
return len(t['notes']) == 0
def is_client_response_ticket(t):
return len(t['notes']) and t['notes'][0]['isTechNote'] == True
de... | from .get_tickets import get_tickets
def is_unanswered(t):
return len(t['notes']) == 0
def is_client_response_ticket(t):
return len(t['notes']) and t['notes'][0]['isTechNote'] == True
def count_unanswered_tickets():
tickets = get_tickets('open')
# get only the tickets with no responses at all
... | mit | Python |
b3b2e89e82abd3d86f3fb5d5381160cb36865604 | bump version to 2.1.5 | daikeren/opbeat_python,1tush/sentry,boneyao/sentry,songyi199111/sentry,smarkets/raven-python,llonchj/sentry,beniwohli/apm-agent-python,ifduyue/sentry,zenefits/sentry,Photonomie/raven-python,inspirehep/raven-python,daikeren/opbeat_python,ewdurbin/raven-python,dbravender/raven-python,nicholasserra/sentry,dirtycoder/opbea... | djangodblog/__init__.py | djangodblog/__init__.py | __version__ = (2, 1, 5) | __version__ = (2, 1, 4) | bsd-3-clause | Python |
cf3d83bf39dad745f53c8d1d080dc3c6c42c6c4b | Add product and version arguments | desihub/desiutil,desihub/desiutil | py/desiUtil/install/main.py | py/desiUtil/install/main.py | # License information goes here
# -*- coding: utf-8 -*-
"""Install DESI software.
"""
from __future__ import print_function
# The line above will help with 2to3 support.
def main():
"""Main program.
Parameters
----------
None
Returns
-------
main : int
Exit status that will be pass... | # License information goes here
# -*- coding: utf-8 -*-
"""Install DESI software.
"""
from __future__ import print_function
# The line above will help with 2to3 support.
def main():
"""Main program.
Parameters
----------
None
Returns
-------
main : int
Exit status that will be pass... | bsd-3-clause | Python |
191c59645ff58061ef3e27b6d4893ab0b6b4f30b | Use a QTimer object instead of QTimer::singleShot. | The-Compiler/pytest-qt,pytest-dev/pytest-qt | pytestqt/_tests/test_wait_signal.py | pytestqt/_tests/test_wait_signal.py | import pytest
import time
from pytestqt.qt_compat import QtCore, Signal
class Signaller(QtCore.QObject):
signal = Signal()
def test_signal_blocker_exception(qtbot):
"""
Make sure waitSignal without signals and timeout doesn't hang, but raises
ValueError instead.
"""
with pytest.raises(Valu... | import pytest
import time
from pytestqt.qt_compat import QtCore, Signal
class Signaller(QtCore.QObject):
signal = Signal()
def test_signal_blocker_exception(qtbot):
"""
Make sure waitSignal without signals and timeout doesn't hang, but raises
ValueError instead.
"""
with pytest.raises(Valu... | mit | Python |
e27e017522363706d3b8c21eb220d50fff23f844 | fix docstring | higumachan/pyscalambda | pyscalambda/scalambdable.py | pyscalambda/scalambdable.py | import functools
from pyscalambda.formula import Formula
from pyscalambda.formula_nodes import FunctionCall
from pyscalambda.utility import convert_oprand, vmap
def scalambdable_func(fn, *funcs):
"""
Wrap function to scalambdable.
:type fn: (T)->U
:type funcs: ((Any)->Any, ...)
:rtype: (T)->U
... | import functools
from pyscalambda.formula import Formula
from pyscalambda.formula_nodes import FunctionCall
from pyscalambda.utility import convert_oprand, vmap
def scalambdable_func(fn, *funcs):
"""
:type fn: (T)->U
:type funcs: ((Any)->Any, ...)
:rtype: (T)->U
"""
def wrapped(*args, **kwa... | mit | Python |
a83cb59d29688ea64e8de3257f4d1ccf61b9fbb1 | prepare 1.8.5 release | pytest-dev/pytest-splinter | pytest_splinter/__init__.py | pytest_splinter/__init__.py | """pytest-splinter package."""
__version__ = '1.8.5'
| """pytest-splinter package."""
__version__ = '1.8.4'
| mit | Python |
709c573b65196dd93826c51e29e76dc0be7e8500 | Refactor config-tests | Thor77/TeamspeakStats,Thor77/TeamspeakStats | tsstats/tests/test_config.py | tsstats/tests/test_config.py | import pytest
from tsstats.config import load
@pytest.fixture
def config():
return load()
def test_config(config):
assert not config.getboolean('General', 'debug')
assert config.getboolean('General', 'onlinedc')
config.set('General', 'idmap', 'tsstats/tests/res/id_map.json')
assert config.get('... | try:
from configparser import ConfigParser
except ImportError:
from ConfigParser import ConfigParser
from os import remove
from os.path import abspath, exists
import pytest
from tsstats.config import load
configpath = abspath('tsstats/tests/res/test.cfg')
def create_config(values, key='General'):
conf... | mit | Python |
6a80a275580b5e230669307a9f7f53c17918384e | Add StateMachineName to StepFunctions::StateMachine | ikben/troposphere,cloudtools/troposphere,cloudtools/troposphere,ikben/troposphere,johnctitus/troposphere,pas256/troposphere,pas256/troposphere,johnctitus/troposphere | troposphere/stepfunctions.py | troposphere/stepfunctions.py | # Copyright (c) 2012-2013, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject
class Activity(AWSObject):
resource_type = "AWS::StepFunctions::Activity"
props = {
'Name': (basestring, True),
}
class StateMachine(AWSObject):
resourc... | # Copyright (c) 2012-2013, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject
class Activity(AWSObject):
resource_type = "AWS::StepFunctions::Activity"
props = {
'Name': (basestring, True),
}
class StateMachine(AWSObject):
resourc... | bsd-2-clause | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.