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 |
|---|---|---|---|---|---|---|---|---|
4f858059b324de0ec32f3b3f41f81b63254f4fe9 | bump version | vmalloc/weber-utils | weber_utils/__version__.py | weber_utils/__version__.py | __version__ = "1.1.0"
| __version__ = "1.0.2"
| bsd-3-clause | Python |
c4502645291f2ef1a1eaf08801fd4fa99e3beff2 | add perf test for .exists() without caching | xpybuild/xpybuild,xpybuild/xpybuild,xpybuild/xpybuild,xpybuild/xpybuild | tests/performance/microbenchmarks/MicroPerf_FileUtilsCaches/run.py | tests/performance/microbenchmarks/MicroPerf_FileUtilsCaches/run.py | from pysys.constants import *
from xpybuild.microperf_basetest import MicroPerfPySysTest
class PySysTest(MicroPerfPySysTest):
OPERATIONS = [
# resultKey (must be a valid filename), command, setup
('fileutils.exists() non-existent file without caching',"utils.fileutils.exists(OUTPUT_DIR+'/doesntexist%d'%iteration)",... | from pysys.constants import *
from xpybuild.microperf_basetest import MicroPerfPySysTest
class PySysTest(MicroPerfPySysTest):
OPERATIONS = [
# resultKey (must be a valid filename), command, setup
('fileutils.exists() non-existent file with caching',"utils.fileutils.exists(OUTPUT_DIR+'/doesntexist')", ""),
] | apache-2.0 | Python |
c478c9978aa3843d1961f9e475e5d6a85c8092d5 | Fix xrange fallback | jvarho/pylibscrypt,jvarho/pylibscrypt | pylibscrypt/common.py | pylibscrypt/common.py | # Copyright (c) 2014-2018, Jan Varho
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL... | # Copyright (c) 2014-2015, Jan Varho
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL... | isc | Python |
9aa17b90b8f3413f0621cc25a686774dd809dc84 | Add drf serializer for environment variables | frigg/frigg-hq,frigg/frigg-hq,frigg/frigg-hq | frigg/projects/serializers.py | frigg/projects/serializers.py | from rest_framework import serializers
from frigg.builds.serializers import BuildInlineSerializer
from .models import Project
class EnvironmentVariableSerializer(serializers.ModelSerializer):
def to_representation(self, instance):
representation = super().to_representation(instance)
if instance... | from rest_framework import serializers
from frigg.builds.serializers import BuildInlineSerializer
from .models import Project
class ProjectSerializer(serializers.ModelSerializer):
builds = BuildInlineSerializer(read_only=True, many=True)
class Meta:
model = Project
fields = (
'i... | mit | Python |
d0c557547c4aa98cfe47d36a18417557c11b18f9 | Bump version | mostm/pyqiwi | pyqiwi/__version__.py | pyqiwi/__version__.py | # -*- coding: utf-8 -*-
# _ _
# _ __ _ _ __ _(_)_ _(_)
# | '_ \| | | |/ _` | \ \ /\ / / |
# | |_) | |_| | (_| | |\ V V /| |
# | .__/ \__, |\__, |_| \_/\_/ |_|
# |_| |___/ |_|
# Python Qiwi API Wrapper
VERSION = (2, 1, 1)
__version__ = '.'.join(map(str, VERSI... | # -*- coding: utf-8 -*-
# _ _
# _ __ _ _ __ _(_)_ _(_)
# | '_ \| | | |/ _` | \ \ /\ / / |
# | |_) | |_| | (_| | |\ V V /| |
# | .__/ \__, |\__, |_| \_/\_/ |_|
# |_| |___/ |_|
# Python Qiwi API Wrapper
VERSION = (2, 1, 0)
__version__ = '.'.join(map(str, VERSI... | mit | Python |
ca6a330d629050937bc4543a66059068ae6ec504 | update tests | jendrikseipp/vulture,jendrikseipp/vulture | tests/test_script.py | tests/test_script.py | import os.path
import subprocess
import sys
from vulture import __version__
DIR = os.path.dirname(os.path.abspath(__file__))
REPO = os.path.dirname(DIR)
WHITELIST = os.path.join(REPO, 'whitelists', 'stdlib.py')
def call_vulture(args, **kwargs):
return subprocess.call(
[sys.executable, 'vulture.py'] + ar... | import os.path
import subprocess
import sys
from vulture import __version__
DIR = os.path.dirname(os.path.abspath(__file__))
REPO = os.path.dirname(DIR)
WHITELIST = os.path.join(REPO, 'whitelists', 'stdlib.py')
def call_vulture(args, **kwargs):
return subprocess.call(
[sys.executable, 'vulture.py'] + ar... | mit | Python |
f97fbb50bd5f311230c5b005e238a665e096e867 | Fix failing unit test | capybaralet/fuel,chrishokamp/fuel,udibr/fuel,codeaudit/fuel,glewis17/fuel,janchorowski/fuel,bouthilx/fuel,aalmah/fuel,hantek/fuel,rodrigob/fuel,dmitriy-serdyuk/fuel,vdumoulin/fuel,orhanf/fuel,dwf/fuel,udibr/fuel,orhanf/fuel,dhruvparamhans/fuel,dwf/fuel,hantek/fuel,dribnet/fuel,bouthilx/fuel,mila-udem/fuel,janchorowski/... | tests/test_server.py | tests/test_server.py | from multiprocessing import Process
from numpy.testing import assert_allclose, assert_raises
from six.moves import cPickle
from fuel.datasets import MNIST
from fuel.schemes import SequentialScheme
from fuel.server import start_server
from fuel.streams import DataStream, ServerDataStream
def get_stream():
return... | from multiprocessing import Process
from numpy.testing import assert_allclose, assert_raises
from six.moves import cPickle
from fuel.datasets import MNIST
from fuel.schemes import SequentialScheme
from fuel.server import start_server
from fuel.streams import DataStream, ServerDataStream
def get_stream():
return... | mit | Python |
025f6c68844101fb45722e7f27dc7854fc1f6065 | Update tables.py | CADTS-Bachelor/playbook | grade-2015/KuangJia/tables.py | grade-2015/KuangJia/tables.py | # encoding:utf8
# Python使用ORM框架操作数据库
from sqlalchemy import Column, Integer, String, DateTime, create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class Scene(Base):
__tablename__ = 'scene' # 表名
id = Column(Integer, prim... | # encoding:utf8
# Python使用ORM框架操作数据库
from sqlalchemy import Column, Integer, String, DateTime, create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class Scene(Base):
__tablename__ = 'scene' # 表名
id = Column(Integer, prim... | mit | Python |
127a707c7e77f0a1fa8066bc24099addb1f429d2 | Update version for release | great-expectations/great_expectations,great-expectations/great_expectations,great-expectations/great_expectations,great-expectations/great_expectations | great_expectations/version.py | great_expectations/version.py | __version__ = "0.7.6"
| __version__ = "0.7.6__develop"
| apache-2.0 | Python |
c9d4dd153b582470216bc9e01b55753876136fec | add another test since i'm paranoid | spotify/annoy,tjrileywisc/annoy,eddelbuettel/annoy,spotify/annoy,eddelbuettel/annoy,eddelbuettel/annoy,tjrileywisc/annoy,tjrileywisc/annoy,eddelbuettel/annoy,spotify/annoy,spotify/annoy,tjrileywisc/annoy | test/holes_test.py | test/holes_test.py | # Copyright (c) 2013 Spotify AB
#
# 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 (c) 2013 Spotify AB
#
# 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... | apache-2.0 | Python |
4ffa677f0c50d535136d983820b48c39e125b447 | Fix anything tests didn't pick up | apache/cloudstack-gcestack | gstack/controllers/regions.py | gstack/controllers/regions.py | #!/usr/bin/env python
# encoding: utf-8
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Vers... | #!/usr/bin/env python
# encoding: utf-8
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Vers... | apache-2.0 | Python |
3106a712d0a61801857813c98d31591b0937777d | Update __init__.py | zsdonghao/tensorlayer,zsdonghao/tensorlayer | tensorlayer/layers/__init__.py | tensorlayer/layers/__init__.py | #! /usr/bin/python
# -*- coding: utf-8 -*-
from .activation import *
from .convolution import *
from .core import *
from .dense import *
from .dropout import *
from .deprecated import *
from .embedding import *
from .extend import *
# from .flow_control import * # remove for TF 2.0
from .image_resampling import *
from... | #! /usr/bin/python
# -*- coding: utf-8 -*-
"""
TensorLayer provides rich layer implementations trailed for
various benchmarks and domain-specific problems. In addition, we also
support transparent access to native TensorFlow parameters.
For example, we provide not only layers for local response normalization, but also
... | apache-2.0 | Python |
200db2db83d2765413ad62ec43087deee0c1cf6e | Add trailing newline | rhyolight/nupic.son,rhyolight/nupic.son,rhyolight/nupic.son | app/soc/models/__init__.py | app/soc/models/__init__.py | #
# 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 law or agreed to in ... | #
# 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 law or agreed to in ... | apache-2.0 | Python |
b26af5f69b310e35dd871d4d9a7a3b0ed67cf870 | add another stats test | pombredanne/lsh-hdc,escherba/lsh-hdc,escherba/lsh-hdc,escherba/lsh-hdc,pombredanne/lsh-hdc,escherba/lsh-hdc,pombredanne/lsh-hdc,pombredanne/lsh-hdc,pombredanne/lsh-hdc,escherba/lsh-hdc | test/test_stats.py | test/test_stats.py | __author__ = 'escherba'
import unittest
from lsh.stats import UncertaintySummarizer, VarianceSummarizer
from collections import Counter
class MyTestCase(unittest.TestCase):
def test_uncertainty_index(self):
"""
Example from Manning et al. Introduction to Information Retrieval.
CUP. 2009,... | __author__ = 'escherba'
import unittest
from lsh.stats import UncertaintySummarizer
from collections import Counter
class MyTestCase(unittest.TestCase):
def test_uindex(self):
"""
Example from Manning et al. Introduction to Information Retrieval.
CUP. 2009, p. 357.
"""
ui... | bsd-3-clause | Python |
2bde9f7ef0280b0320d8bf4431c636d7ac4f67e3 | Update version number | SimonSapin/tinycss2 | tinycss2/__init__.py | tinycss2/__init__.py | """
tinycss2
========
tinycss2 is a low-level CSS parser and generator: it can parse strings, return
Python objects representing tokens and blocks, and generate CSS strings
corresponding to these objects.
"""
from .bytes import parse_stylesheet_bytes # noqa
from .parser import ( # noqa
parse_declaration_list, ... | """
tinycss2
========
tinycss2 is a low-level CSS parser and generator: it can parse strings, return
Python objects representing tokens and blocks, and generate CSS strings
corresponding to these objects.
"""
from .bytes import parse_stylesheet_bytes # noqa
from .parser import ( # noqa
parse_declaration_list, ... | bsd-3-clause | Python |
12ce300c3b0101ec75ba805bd5a577e191a5b8fc | fix relation for simple deployment test | juju-solutions/layer-apache-kafka | tests/01-deploy.py | tests/01-deploy.py | #!/usr/bin/env python3
import unittest
import amulet
class TestDeploy(unittest.TestCase):
"""
Trivial deployment test for Apache Kafka.
This charm cannot do anything useful by itself, so integration testing
is done in the bundle.
"""
@classmethod
def setUpClass(cls):
cls.d = amu... | #!/usr/bin/env python3
import unittest
import amulet
class TestDeploy(unittest.TestCase):
"""
Trivial deployment test for Apache Kafka.
This charm cannot do anything useful by itself, so integration testing
is done in the bundle.
"""
@classmethod
def setUpClass(cls):
cls.d = amu... | apache-2.0 | Python |
71c837c2792e6b30c5b93a4848b8b6a3c0ca0308 | use parallel in progressbar.py | alphatwirl/alphatwirl,alphatwirl/alphatwirl,alphatwirl/alphatwirl,alphatwirl/alphatwirl | tests/misc/progressbar.py | tests/misc/progressbar.py | #!/usr/bin/env python
# Tai Sakuma <tai.sakuma@gmail.com>
from __future__ import print_function
import sys
import time, random
import uuid
import argparse
import alphatwirl
##__________________________________________________________________||
parser = argparse.ArgumentParser()
parser.add_argument('--parallel-mode',... | #!/usr/bin/env python
# Tai Sakuma <tai.sakuma@gmail.com>
from __future__ import print_function
import sys
import time, random
import uuid
import alphatwirl
##__________________________________________________________________||
class Task(object):
def __init__(self, name):
self.name = name
def __call_... | bsd-3-clause | Python |
0d0a081a8b37066b2000cac3395d59e2cc7b29e1 | Add another smoke test. | chebee7i/buhmm | buhmm/tests/test_smoke.py | buhmm/tests/test_smoke.py | """
Smoke tests.
"""
from nose.tools import *
from nose import SkipTest
import dit
import buhmm
import numpy as np
class TestSmoke:
def setUp(cls):
global machines
try:
from cmpy import machines
except ImportError:
raise SkipTest('cmpy not available')
def tes... | """
Smoke tests.
"""
from nose.tools import *
from nose import SkipTest
import dit
import buhmm
import numpy as np
class TestSmoke:
def setUp(cls):
global machines
try:
from cmpy import machines
except ImportError:
raise SkipTest('cmpy not available')
def tes... | mit | Python |
4a861a9a3a6070c3a9016f788cbda521e11da3d5 | remove test_resolve() test since resolving schema inheritance is now built in to the loadDocument() function when called on schemas; update other calls to work with the latest API | xgds/xgds_planner2,xgds/xgds_planner2,xgds/xgds_planner2,xgds/xgds_planner2 | xgds_planner2/xpjsonTest.py | xgds_planner2/xpjsonTest.py | #!/usr/bin/env python
#__BEGIN_LICENSE__
# Copyright (c) 2015, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All rights reserved.
#
# The xGDS platform is licensed under the Apache License, Version 2.0
# (the "License"); you may not use this file... | #!/usr/bin/env python
#__BEGIN_LICENSE__
# Copyright (c) 2015, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All rights reserved.
#
# The xGDS platform is licensed under the Apache License, Version 2.0
# (the "License"); you may not use this file... | apache-2.0 | Python |
705bcf72367120ac9ffe063c3a0d244f432c6a92 | fix warning message | thinkopensolutions/tkobr-addons,thinkopensolutions/tkobr-addons,thinkopensolutions/tkobr-addons,thinkopensolutions/tkobr-addons | tko_contract_invoicing_product_effective_date/models/account_analytic_account.py | tko_contract_invoicing_product_effective_date/models/account_analytic_account.py | # -*- encoding: utf-8 -*-
from odoo import models, fields, api, _
from odoo.exceptions import Warning
import logging
_logger = logging.getLogger(__name__)
class AccountAnalyticAccont(models.Model):
_inherit = 'account.analytic.account'
end_date = fields.Date(u'End Date')
def _validate_invoice_creatin... | # -*- encoding: utf-8 -*-
from odoo import models, fields, api, _
from odoo.exceptions import Warning
import logging
_logger = logging.getLogger(__name__)
class AccountAnalyticAccont(models.Model):
_inherit = 'account.analytic.account'
end_date = fields.Date(u'End Date')
def _validate_invoice_creatin... | agpl-3.0 | Python |
4a6ab36636039b59fef5f73250c6e54b049f2b9f | Update myglobals.py | NLeSC/ODEX-FAIRDataPoint,NLeSC/ODEX-FAIRDataPoint,NLeSC/ODEX-FAIRDataPoint,NLeSC/ODEX-FAIRDataPoint | tests/myglobals.py | tests/myglobals.py | DUMP_DIR = 'tests/rdf-metadata'
BASE_URL = 'http://0.0.0.0:8080'
# example catalog, dataset and distributions
URL_PATHS = [
'fdp',
'catalog/pbg-ld',
'dataset/sly-genes',
'dataset/spe-genes',
'dataset/stu-genes',
'distribution/sly-genes-gff',
'distribution/spe-genes-gff',
'distribution/s... | DUMP_DIR = 'tests/rdf-metadata'
BASE_URL = 'http://127.0.0.1:8080'
# example catalog, dataset and distributions
URL_PATHS = [
'fdp',
'catalog/pbg-ld',
'dataset/sly-genes',
'dataset/spe-genes',
'dataset/stu-genes',
'distribution/sly-genes-gff',
'distribution/spe-genes-gff',
'distribution... | apache-2.0 | Python |
31d66b0884c7e397f8558ba08796e5cccda89c19 | fix merge | opencivicdata/scrapers-ca,opencivicdata/scrapers-ca | ca_nb_moncton/__init__.py | ca_nb_moncton/__init__.py | from __future__ import unicode_literals
from utils import CanadianJurisdiction
from pupa.scrape import Organization
class Moncton(CanadianJurisdiction):
classification = 'legislature'
division_id = 'ocd-division/country:ca/csd:1307022'
division_name = 'Moncton'
name = 'Moncton City Council'
url = ... | from __future__ import unicode_literals
from utils import CanadianJurisdiction
from pupa.scrape import Organization
class Moncton(CanadianJurisdiction):
classification = 'legislature'
division_id = 'ocd-division/country:ca/csd:1307022'
division_name = 'Moncton'
name = 'Moncton City Council'
url = ... | mit | Python |
0709b37f36fac67fc80d98f67c03b8fe3ab21893 | include last_run_at and total_run_count when loading stored task data | adblair/celerycontrib.sqlalchemyscheduler | celerycontrib/sqlalchemyscheduler/scheduler.py | celerycontrib/sqlalchemyscheduler/scheduler.py | import json
import celery.beat
import sqlalchemy as sqla
from sqlalchemy import orm
from . import model
class SQLAlchemyScheduler(celery.beat.Scheduler):
database_url = 'sqlite:///data.sqlite'
_session = None
@property
def session(self):
if self._session is None:
engine = sqla... | import json
import celery.beat
import sqlalchemy as sqla
from sqlalchemy import orm
from . import model
class SQLAlchemyScheduler(celery.beat.Scheduler):
database_url = 'sqlite:///data.sqlite'
_session = None
@property
def session(self):
if self._session is None:
engine = sqla... | mit | Python |
d88cb7e63bb6b0ef03b3a2b0388a4ec05d39a057 | add pep exception | DrDos0016/z2,DrDos0016/z2,DrDos0016/z2 | tools/_blank-tool.py | tools/_blank-tool.py | import os
import sys
import django
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "museum.settings")
django.setup()
from django.contrib.auth.models import User # noqa: E402
from museum_site.models import * # noqa: E402
def main():
... | import os
import sys
import django
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "museum.settings")
django.setup()
from django.contrib.auth.models import User
from museum_site.models import * # noqa: E402
def main():
return True
... | mit | Python |
5022f61e5eed4d1bb5f8ec491784eb06f168e1ed | Use temporary eclipse workspace directories for DartEditor tests | dartino/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk,dartino/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-lang/sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-lang/sdk,dart-lang/sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-archive/dart-sdk... | tools/bots/editor.py | tools/bots/editor.py | #!/usr/bin/python
# Copyright (c) 2013, 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 shutil
import sys
import tempfile
import bot
class TempDir(object):
... | #!/usr/bin/python
# Copyright (c) 2013, 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 sys
import bot
def GetEditorExecutable(mode, arch):
configuration_d... | bsd-3-clause | Python |
2b2ace4723c7fec68866ce2f74a85a94e5dd6ad3 | Change expiration test times a little bit to pass under valgrind. | mquandalle/rethinkdb,scripni/rethinkdb,sontek/rethinkdb,gavioto/rethinkdb,victorbriz/rethinkdb,yakovenkodenis/rethinkdb,pap/rethinkdb,scripni/rethinkdb,Wilbeibi/rethinkdb,nviennot/rethinkdb,elkingtonmcb/rethinkdb,RubenKelevra/rethinkdb,bchavez/rethinkdb,matthaywardwebdesign/rethinkdb,losywee/rethinkdb,marshall007/rethi... | test/integration/expiration.py | test/integration/expiration.py | #!/usr/bin/python
from test_common import *
import time
def test_function(opts, mc):
print "Testing set with expiration"
if mc.set("a", "aaa", time=5) == 0:
raise ValueError, "Set failed"
print "Make sure we can get the element back after short sleep"
time.sleep(1)
if mc.get("a") != "aaa"... | #!/usr/bin/python
from test_common import *
import time
def test_function(opts, mc):
print "Testing set with expiration"
if mc.set("a", "aaa", time=5) == 0:
raise ValueError, "Set failed"
print "Make sure we can get the element back after short sleep"
time.sleep(3)
if mc.get("a") != "aaa"... | agpl-3.0 | Python |
4feb11086c85ce9b70f59240da638351321ce013 | Fix PEP8 | CompassionCH/compassion-switzerland,CompassionCH/compassion-switzerland,ecino/compassion-switzerland,Secheron/compassion-switzerland,Secheron/compassion-switzerland,MickSandoz/compassion-switzerland,ndtran/compassion-switzerland,eicher31/compassion-switzerland,eicher31/compassion-switzerland,eicher31/compassion-switzer... | child_sync_typo3/wizard/child_depart_wizard.py | child_sync_typo3/wizard/child_depart_wizard.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 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... | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 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 |
3cedde019466570221555fe292fca3faa11b17a4 | Bump version | sigopt/sigopt-python,sigopt/sigopt-python | sigopt/version.py | sigopt/version.py | VERSION = '2.11.2'
| VERSION = '2.11.1'
| mit | Python |
2761c6f70df6db259fa6be2e70f6ff6b537546f0 | Fix typo | bbockelm/glideinWMS,holzman/glideinwms-old,bbockelm/glideinWMS,holzman/glideinwms-old,bbockelm/glideinWMS,bbockelm/glideinWMS,holzman/glideinwms-old | tools/glidein_gdb.py | tools/glidein_gdb.py | #!/bin/env python
#
# glidein_gdb.py
#
# Description:
# Execute a ls command on a condor job working directory
#
# Usage:
# glidein_gdb.py <cluster>.<process> <pid> [<command>] [-name <schedd_name>] [-pool <pool_name> ] [-timeout <nr secs>]
#
# Supported gdb commands:
# where (default)
#
# Author:
# Igor Sfiligoi... | #!/bin/env python
#
# glidein_gdb.py
#
# Description:
# Execute a ls command on a condor job working directory
#
# Usage:
# glidein_gdb.py <cluster>.<process> <pid> [<command>] [-name <schedd_name>] [-pool <pool_name> ] [-timeout <nr secs>]
#
# Supported gdb commands:
# watch (default)
#
# Author:
# Igor Sfiligoi... | bsd-3-clause | Python |
59533cc8fb516429ef1cf4f9b930a75e5ece336e | Add Lady Liadrin's Reinforce to Justicar Trueheart's map | NightKev/fireplace,Ragowit/fireplace,beheh/fireplace,jleclanche/fireplace,smallnamespace/fireplace,smallnamespace/fireplace,Ragowit/fireplace | fireplace/cards/tgt/neutral_legendary.py | fireplace/cards/tgt/neutral_legendary.py | from ..utils import *
##
# Minions
# Confessor Paletress
class AT_018:
inspire = Summon(CONTROLLER, RandomMinion(rarity=Rarity.LEGENDARY))
# Skycap'n Kragg
class AT_070:
cost_mod = -Count(FRIENDLY_MINIONS + PIRATE)
# Gormok the Impaler
class AT_122:
play = (Count(FRIENDLY_MINIONS) >= 4) & Hit(TARGET, 4)
# C... | from ..utils import *
##
# Minions
# Confessor Paletress
class AT_018:
inspire = Summon(CONTROLLER, RandomMinion(rarity=Rarity.LEGENDARY))
# Skycap'n Kragg
class AT_070:
cost_mod = -Count(FRIENDLY_MINIONS + PIRATE)
# Gormok the Impaler
class AT_122:
play = (Count(FRIENDLY_MINIONS) >= 4) & Hit(TARGET, 4)
# C... | agpl-3.0 | Python |
a030e92b46acf27c05500ed2cb47b2cece4e87ac | Work around selenium Edge driver bug | cockpit-project/cockpit,garrett/cockpit,martinpitt/cockpit,cockpit-project/cockpit,martinpitt/cockpit,garrett/cockpit,mvollmer/cockpit,mvollmer/cockpit,cockpit-project/cockpit,mvollmer/cockpit,mvollmer/cockpit,garrett/cockpit,martinpitt/cockpit,garrett/cockpit,cockpit-project/cockpit,martinpitt/cockpit,cockpit-project/... | test/selenium/selenium-base.py | test/selenium/selenium-base.py | #!/usr/bin/python3
# we need to be able to find and import seleniumlib, so add this directory
from testlib_avocado.seleniumlib import SeleniumTest, clickable
import os
import sys
machine_test_dir = os.path.dirname(os.path.abspath(__file__))
if machine_test_dir not in sys.path:
sys.path.insert(1, machine_test_dir)
... | #!/usr/bin/python3
# we need to be able to find and import seleniumlib, so add this directory
from testlib_avocado.seleniumlib import SeleniumTest, clickable
import os
import sys
machine_test_dir = os.path.dirname(os.path.abspath(__file__))
if machine_test_dir not in sys.path:
sys.path.insert(1, machine_test_dir)
... | lgpl-2.1 | Python |
61e280ea32718443895af7619dd750e959ddd629 | Add a complementary test for givers and zero | eXcomm/gratipay.com,gratipay/gratipay.com,gratipay/gratipay.com,gratipay/gratipay.com,mccolgst/www.gittip.com,studio666/gratipay.com,eXcomm/gratipay.com,studio666/gratipay.com,mccolgst/www.gittip.com,eXcomm/gratipay.com,mccolgst/www.gittip.com,gratipay/gratipay.com,studio666/gratipay.com,studio666/gratipay.com,eXcomm/g... | tests/test_communities.py | tests/test_communities.py | from __future__ import absolute_import, division, print_function, unicode_literals
from gittip.testing import Harness
class Tests(Harness):
def setUp(self):
Harness.setUp(self)
self.client.website.NMEMBERS_THRESHOLD = 1
# Alice joins a community.
self.alice = self.make_participa... | from __future__ import absolute_import, division, print_function, unicode_literals
from gittip.testing import Harness
class Tests(Harness):
def setUp(self):
Harness.setUp(self)
self.client.website.NMEMBERS_THRESHOLD = 1
# Alice joins a community.
self.alice = self.make_participa... | mit | Python |
219e0fed56f91954e2132b68d0e606f0d2825060 | Remove unnecessary print in test_missingnode | ktkt2009/disco,discoproject/disco,mozilla/disco,pavlobaron/disco_playground,pavlobaron/disco_playground,pavlobaron/disco_playground,pombredanne/disco,pooya/disco,simudream/disco,scrapinghub/disco,pombredanne/disco,seabirdzh/disco,mwilliams3/disco,simudream/disco,pombredanne/disco,ErikDubbelboer/disco,ErikDubbelboer/dis... | tests/test_missingnode.py | tests/test_missingnode.py | from disco.test import DiscoJobTestFixture, DiscoTestCase
def unique_nodename(nodenames, count=0):
nodename = 'missingnode_%s' % count
if nodename not in nodenames:
return nodename
return unique_nodename(nodenames, count + 1)
class MissingNodeTestCase(DiscoJobTestFixture, Disco... | from disco.test import DiscoJobTestFixture, DiscoTestCase
def unique_nodename(nodenames, count=0):
nodename = 'missingnode_%s' % count
if nodename not in nodenames:
return nodename
return unique_nodename(nodenames, count + 1)
class MissingNodeTestCase(DiscoJobTestFixture, Disco... | bsd-3-clause | Python |
dac2a76051271c52bf9c12874f8345eb0e1c3937 | purge test jobs after requesting them | kalessin/python-hubstorage,scrapinghub/python-hubstorage,torymur/python-hubstorage | tests/test_jobq.py | tests/test_jobq.py | """
Test JobQ
"""
from hstestcase import HSTestCase
class JobqTest(HSTestCase):
def test_basic(self):
#authpos(JOBQ_PUSH_URL, data="", expect=400)
spider1 = self.project.jobq.push('spidey')
spider2 = self.project.jobq.push(spider='spidey')
spider3 = self.project.jobq.push(spider='... | """
Test JobQ
"""
from hstestcase import HSTestCase
class JobqTest(HSTestCase):
def test_basic(self):
#authpos(JOBQ_PUSH_URL, data="", expect=400)
spider1 = self.project.jobq.push('spidey')
spider2 = self.project.jobq.push(spider='spidey')
spider3 = self.project.jobq.push(spider='... | bsd-3-clause | Python |
70fb77dd35fd647e0c4fc8b8c8ef5b30fc099476 | update tests | semio/ddf_utils | tests/test_misc.py | tests/test_misc.py | # -*- coding: utf-8 -*-
import os
wd = os.path.dirname(__file__)
def test_build_dictionary():
from ddf_utils.chef.api import Chef
from ddf_utils.chef.helpers import build_dictionary
d = {'China': 'chn', 'USA': 'usa'}
c = Chef()
assert build_dictionary(c, d) == d
d2 = {
"imr_median... | # -*- coding: utf-8 -*-
import os
wd = os.path.dirname(__file__)
def test_build_dictionary():
from ddf_utils.chef.api import Chef
from ddf_utils.chef.helpers import build_dictionary
d = {'China': 'chn', 'USA': 'usa'}
c = Chef()
assert build_dictionary(c, d) == d
d2 = {
"imr_median... | mit | Python |
57151faa40af3c545e6557bd22de9a80a0d3e49c | Add sqlite url test | funkybob/django-classy-settings | tests/test_urls.py | tests/test_urls.py | from unittest import TestCase
from cbs.urls import parse_dburl
class TestUrlParse(TestCase):
def test_simple(self):
result = parse_dburl(
"postgres://user:password@hostname:1234/dbname?conn_max_age=15&local_option=test"
)
self.assertEqual(
result,
{
... | from unittest import TestCase
from cbs.urls import parse_dburl
class TestUrlParse(TestCase):
def test_simple(self):
result = parse_dburl(
"postgres://user:password@hostname:1234/dbname?conn_max_age=15&local_option=test"
)
self.assertEqual(
result,
{
... | bsd-2-clause | Python |
066281d2e0f571484392dde3ad5ce6372cf1dc55 | test illegal id | basbloemsaat/dartsense,basbloemsaat/dartsense,basbloemsaat/dartsense,basbloemsaat/dartsense,basbloemsaat/dartsense | tests/test_user.py | tests/test_user.py | #!/usr/bin/env python3
import pytest
import os
import sys
from pprint import pprint
sys.path.append(os.path.join(os.path.dirname(__file__), "../lib"))
import dartsense.user
def test_user_init():
user = dartsense.user.User()
assert isinstance(user, dartsense.user.User)
assert hasattr(user, 'id')
... | #!/usr/bin/env python3
import pytest
import os
import sys
from pprint import pprint
sys.path.append(os.path.join(os.path.dirname(__file__), "../lib"))
import dartsense.user
def test_user_init():
user = dartsense.user.User()
assert isinstance(user, dartsense.user.User)
assert hasattr(user, 'id')
... | mit | Python |
60086bd0cd959809b2e15860c39d681474c9a011 | Cover empty link case | CodersOfTheNight/verata | tests/test_util.py | tests/test_util.py | import pytest
from grazer.util import time_convert, grouper, extract_links, trim_link
from .fixtures import example_html
class TestTimeConvert(object):
def test_seconds(self):
assert time_convert("10s") == 10
def test_minutes(self):
assert time_convert("2m") == 120
def test_hours(self)... | import pytest
from grazer.util import time_convert, grouper, extract_links, trim_link
from .fixtures import example_html
class TestTimeConvert(object):
def test_seconds(self):
assert time_convert("10s") == 10
def test_minutes(self):
assert time_convert("2m") == 120
def test_hours(self)... | mit | Python |
acd749504087d1c7fe527ab78b044827b7d9e3a7 | Make ast generation tools silent when BUILDFARM is set. | urbiforge/urbi,aldebaran/urbi,urbiforge/urbi,urbiforge/urbi,urbiforge/urbi,urbiforge/urbi,urbiforge/urbi,urbiforge/urbi,aldebaran/urbi,urbiforge/urbi,aldebaran/urbi,aldebaran/urbi,aldebaran/urbi,urbiforge/urbi,aldebaran/urbi,aldebaran/urbi,aldebaran/urbi | dev/tools.py | dev/tools.py | ## ----------------------------------------------------------------------------
## Tools for python generators
## ----------------------------------------------------------------------------
import string, re, sys
import os, stat, filecmp, shutil
## Display a warning.
def warning (msg):
print >>sys.stderr, "Warning... | ## ----------------------------------------------------------------------------
## Tools for python generators
## ----------------------------------------------------------------------------
import string, re, sys
import os, stat, filecmp, shutil
## Display a warning.
def warning (msg):
print >>sys.stderr, "Warning... | bsd-3-clause | Python |
56e8f247b149862eb66bcfba196eb20a3ed64e4b | reduce number of threads to 8 so don't need a whole node on TSCC so jobs get scheduled faster | YeoLab/gscripts,YeoLab/gscripts,YeoLab/gscripts,YeoLab/gscripts | gscripts/mapping/map_paired_with_STAR.py | gscripts/mapping/map_paired_with_STAR.py | #!/usr/bin/env python
from glob import glob
from gscripts.qtools._Submitter import Submitter
import sys
species = sys.argv[1]
try:
jobname = sys.argv[2] + "_map_to_" + species
except IndexError:
jobname = "map_to_" + species
cmd_list = []
for file in glob('*R1*fastq'):
pair = file.replace('R1', 'R2')
... | #!/usr/bin/env python
from glob import glob
from gscripts.qtools._Submitter import Submitter
import sys
species = sys.argv[1]
try:
jobname = sys.argv[2] + "_map_to_" + species
except IndexError:
jobname = "map_to_" + species
cmd_list = []
for file in glob('*R1*fastq'):
pair = file.replace('R1', 'R2')
... | mit | Python |
863515a72aaf4c881240f47c1fda8129b9b6d96d | add songs to the **end** of the queue... | wtodom/spotipi | spotipi/sandbox/requesthandler.py | spotipi/sandbox/requesthandler.py | from collections import deque
from ConfigParser import SafeConfigParser
import threading
from flask import Flask, request, render_template
import spotify
config = SafeConfigParser()
config.read("spotipi.cfg")
app = Flask(__name__)
app.debug = True
song_queue = deque()
session = spotify.Session()
loop = spotify.Ev... | from collections import deque
from ConfigParser import SafeConfigParser
import threading
from flask import Flask, request, render_template
import spotify
config = SafeConfigParser()
config.read("spotipi.cfg")
app = Flask(__name__)
app.debug = True
song_queue = deque()
session = spotify.Session()
loop = spotify.Ev... | mit | Python |
94695827c8f70e305021a25d2d02a5b1b7241957 | Fix returning `None` if badge ID is unknown | m-ober/byceps,m-ober/byceps,homeworkprod/byceps,homeworkprod/byceps,m-ober/byceps,homeworkprod/byceps | byceps/services/user_badge/service.py | byceps/services/user_badge/service.py | """
byceps.services.user_badge.service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2017 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from collections import defaultdict
from ...database import db
from .models import Badge, BadgeAwarding
def create_badge(label, image_filename, ... | """
byceps.services.user_badge.service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2017 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from collections import defaultdict
from ...database import db
from .models import Badge, BadgeAwarding
def create_badge(label, image_filename, ... | bsd-3-clause | Python |
17e4141703e8b9d2975e8c7de37729aef8905751 | fix test_playlist.test_title | pytube/pytube | tests/contrib/test_playlist.py | tests/contrib/test_playlist.py | # -*- coding: utf-8 -*-
from unittest import mock
from pytube import Playlist
@mock.patch("pytube.contrib.playlist.request.get")
def test_title(request_get):
request_get.return_value = "<title>(149) Python Tutorial for Beginners (For Absolute Beginners) - YouTube</title>"
url = "https://www.fakeurl.com/playl... | # -*- coding: utf-8 -*-
from unittest import mock
from unittest.mock import MagicMock
from pytube import Playlist
@mock.patch("request.get")
def test_title(request_get):
request_get.return_value = ""
list_key = "PLsyeobzWxl7poL9JTVyndKe62ieoN-MZ3"
url = "https://www.fakeurl.com/playlist?list=" + list_key... | unlicense | Python |
fbbd5a7d28cdda0f38e01822b904e24d6b4f232e | Update main.py | rjagerman/aidu,MartienLagerweij/aidu,MartienLagerweij/aidu,rjagerman/aidu,MartienLagerweij/aidu,rjagerman/aidu | aidu_user_management/src/main.py | aidu_user_management/src/main.py | #!/usr/bin/env python
__author__ = 'Rolf Jagerman'
import roslib; roslib.load_manifest('aidu_user_management')
import rospy
from aidu_user_management.srv import Authenticate, AuthenticateResponse
from aidu_user_management.msg import User, Authentication
authenticate_service = None
authentication_publisher = None
de... | #!/usr/bin/env python
__author__ = 'Rolf Jagerman'
import roslib; roslib.load_manifest('aidu_user_management')
import rospy
from aidu_user_management.srv import Authenticate, AuthenticateResponse
from aidu_user_management.msg import User, Authentication
authenticate_service = None
authentication_publisher = None
de... | mit | Python |
6c5fd62262e4194a7ea95f504c01bf686955a052 | Hide root in DirDialog. | shaurz/devo | dirdialog.py | dirdialog.py | import os
import wx
from dirtree import DirTreeCtrl, DirTreeFilter, DirNode
class DirDialog(wx.Dialog):
def __init__(self, parent, size=wx.DefaultSize, message="", path="", select_path=""):
style = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER
if size == wx.DefaultSize:
size = wx.Size(450... | import os
import wx
from dirtree import DirTreeCtrl, DirTreeFilter, DirNode
class DirDialog(wx.Dialog):
def __init__(self, parent, size=wx.DefaultSize, message="", path="", select_path=""):
style = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER
if size == wx.DefaultSize:
size = wx.Size(450... | mit | Python |
6a6682c15324efe5cc617d619f8af1275f32770a | update with ssl | fedspendingtransparency/data-act-build-tools,fedspendingtransparency/data-act-build-tools,fedspendingtransparency/data-act-build-tools | databricks/databricks-jobs.py | databricks/databricks-jobs.py | import sys
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
import json
INSTANCE_ID = sys.argv[1]
JOB_NAME = sys.argv[2]
API_VERSION = '/api/2.1'
print("----------RUNNING JOB " + JOB_NAME )
# Run Get request with api_command param
# /jobs/list/ with api 2.0 returns all jobs, 2.... | import sys
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
import json
# REMOVE WHEN SSL IS ENABLED
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
INSTANCE_ID = sys.argv[1]
JOB_NAME = sys.argv[2]
API_VERSION = '/api/2.1'
print("----------RUNNING JOB " + JOB... | cc0-1.0 | Python |
0c27d4ab049b436b1bd54d09ca457c64c1b9e3f1 | add dynamic cache expiration time | akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem | htdocs/json/nwstext_search.py | htdocs/json/nwstext_search.py | #!/usr/bin/env python
"""
Search for NWS Text, return JSON
"""
import memcache
import cgi
import sys
import datetime
import pytz
import json
def run(sts, ets, awipsid):
""" Actually do some work! """
import psycopg2
dbconn = psycopg2.connect(database='afos', host='iemdb', user='nobody')
cursor = ... | #!/usr/bin/env python
"""
Search for NWS Text, return JSON
"""
import memcache
import cgi
import sys
import datetime
import pytz
import json
def run(sts, ets, awipsid):
""" Actually do some work! """
import psycopg2
dbconn = psycopg2.connect(database='afos', host='iemdb', user='nobody')
cursor = ... | mit | Python |
71df41f93eaf80279ab32c865096269739918d66 | update to keep additional track record | pravj/Doga,KorayAgaya/Doga | Doga/statistics.py | Doga/statistics.py | # -*- coding: utf-8 -*-
"""
Doga.statistics
This module manage information about log statistics
Shows data summary periodically in each 10 seconds
"""
import threading
from collections import Counter
from thread_timer import ThreadTimer
class Statistics():
def __init__(self):
self.queue = []
... | # -*- coding: utf-8 -*-
"""
Doga.statistics
This module manage information about log statistics
Shows data summary periodically in each 10 seconds
"""
import time
import threading
from thread_timer import ThreadTimer
#class ThreadTimer(threading.Thread):
#
# def __init__(self, event, callback):
# thread... | mit | Python |
85537b6bee3efdd1862726a7e68bd79f693ecd4f | Make still class available when decorating class with @page | tornado-utils/tornado-menumaker | tornado_menumaker/helper/Page.py | tornado_menumaker/helper/Page.py | #!/usr/bin/python
# -*- encoding: utf-8 -*-
"""
"""
import inspect
from tornado.web import Application
from .Route import Route
from .Index import IndexRoute
__author__ = 'Martin Martimeo <martin@martimeo.de>'
__date__ = '16.06.13 - 23:46'
class Page(Route):
"""
A Page
"""
def __init__(self, u... | #!/usr/bin/python
# -*- encoding: utf-8 -*-
"""
"""
import inspect
from tornado.web import Application
from .Route import Route
from .Index import IndexRoute
__author__ = 'Martin Martimeo <martin@martimeo.de>'
__date__ = '16.06.13 - 23:46'
class Page(Route):
"""
A Page
"""
def __init__(self, u... | agpl-3.0 | Python |
8d888d735b0a061f07e20531843e578aea97b770 | Make opp_player required | davidrobles/mlnd-capstone-code | capstone/rl/utils/plot.py | capstone/rl/utils/plot.py | from __future__ import division
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from matplotlib.ticker import FuncFormatter
from .callbacks import Callback
from ...game.players import GreedyQ, RandPlayer
from ...game.utils import play_series
class EpisodicWLDPlotter(Callback):
'''
Plot... | from __future__ import division
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from matplotlib.ticker import FuncFormatter
from .callbacks import Callback
from ...game.players import GreedyQ, RandPlayer
from ...game.utils import play_series
class EpisodicWLDPlotter(Callback):
'''
Plot... | mit | Python |
de9e48174f921a84408d9fb0d48e59a7d0693336 | Change unnecessary Sonos coroutine to callback (#60643) | w1ll1am23/home-assistant,mezz64/home-assistant,GenericStudent/home-assistant,w1ll1am23/home-assistant,nkgilley/home-assistant,rohitranjan1991/home-assistant,rohitranjan1991/home-assistant,toddeye/home-assistant,rohitranjan1991/home-assistant,home-assistant/home-assistant,GenericStudent/home-assistant,jawilson/home-assi... | homeassistant/components/sonos/number.py | homeassistant/components/sonos/number.py | """Entity representing a Sonos number control."""
from __future__ import annotations
from homeassistant.components.number import NumberEntity
from homeassistant.const import ENTITY_CATEGORY_CONFIG
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from .const... | """Entity representing a Sonos number control."""
from __future__ import annotations
from homeassistant.components.number import NumberEntity
from homeassistant.const import ENTITY_CATEGORY_CONFIG
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from .const import SONOS_CREATE_LEVELS
from .entity... | apache-2.0 | Python |
93157800175722eb36ef1f8a920f0052f6c64495 | Update honeypot.py | FabioChiodini/ProjectSpawnSwarmtc,FabioChiodini/ProjectSpawnSwarmtc | honeypot/honeypot.py | honeypot/honeypot.py | from flask import Flask, jsonify, request
import os
import logging
import logstash
import sys
if 'LOG_HOST' not in os.environ:
raise(Exception("LOG_HOST NOT DEFINED"))
host = os.environ['LOG_HOST']
test_logger = logging.getLogger('python-logstash-logger')
test_logger.setLevel(logging.INFO)
test_logger.addHandler... | from flask import Flask, jsonify, request
import os
import requests
from pprint import pprint
import json
if 'LOG_HOST' not in os.environ or 'LOG_PORT' not in os.environ:
raise(Exception("LOG_HOST OR LOG_PORT NOT DEFINED"))
POST_URL = "http://{host}:{port}/log".format(host=os.environ['LOG_HOST'],port=os.environ['... | mit | Python |
d2110e629ea38c6ed7bfffd87a771ec3177c0c75 | Bump version: 0.4.1 → 0.5.2 | rwanyoike/time2relax | time2relax/__version__.py | time2relax/__version__.py | __title__ = 'time2relax'
__description__ = 'A CouchDB driver for Python.'
__url__ = 'https://github.com/rwanyoike/time2relax'
__version__ = '0.5.2'
__author__ = 'Raymond Wanyoike'
__author_email__ = 'raymond.wanyoike@gmail.com'
__license__ = 'MIT'
__copyright__ = '2017 Raymond Wanyoike'
__couch__ = u'\u2728 \U0001f6cb ... | __title__ = 'time2relax'
__description__ = 'A CouchDB driver for Python.'
__url__ = 'https://github.com/rwanyoike/time2relax'
__version__ = '0.4.1'
__author__ = 'Raymond Wanyoike'
__author_email__ = 'raymond.wanyoike@gmail.com'
__license__ = 'MIT'
__copyright__ = '2017 Raymond Wanyoike'
__couch__ = u'\u2728 \U0001f6cb ... | mit | Python |
4a36798e38703f890452c2c03b99e8abf00c8e0d | Add tornado and bokeh to get_versions (#1181) | dask/distributed,blaze/distributed,mrocklin/distributed,dask/distributed,dask/distributed,blaze/distributed,mrocklin/distributed,dask/distributed,mrocklin/distributed | distributed/versions.py | distributed/versions.py | """ utilities for package version introspection """
from __future__ import print_function, division, absolute_import
import platform
import struct
import os
import sys
import locale
import importlib
required_packages = [('dask', lambda p: p.__version__),
('distributed', lambda p: p.__version__)... | """ utilities for package version introspection """
from __future__ import print_function, division, absolute_import
import platform
import struct
import os
import sys
import locale
import importlib
required_packages = [('dask', lambda p: p.__version__),
('distributed', lambda p: p.__version__)... | bsd-3-clause | Python |
2fa968d7ad9123b9b45712357ec5b844336056e7 | fix #6 | DataKind-BLR/ichangemycity | dedupe/scripts/icmc.py | dedupe/scripts/icmc.py | import json
import math
import codecs
import pandas as pd
import requests
import argparse
import sys
import time
ID_FIELD = "complaint_complaint_iid"
TEXT_FIELDS = {
"" : "title",
"complaint_description" : "description",
}
LATITUDE = "complaint_latitude"
LONGITUDE = "complaint_longitude"
HOST = "http://localhost:50... | import json
import math
import codecs
import pandas as pd
import requests
PATH = "/home/samarth/workspaces/datakind-workspace/ichangemycity/Sprint-ComplaintsDeduplication/icmyc_complaints.csv"
ID_FIELD = "complaint_complaint_iid"
TEXT_FIELDS = {
"" : "title",
"complaint_description" : "description",
}
LATITUDE = "c... | mit | Python |
f09a870a3246462f73096f0d95a13f770aabb599 | Move logging format to settings | AustralianAntarcticDataCentre/metadata_xml_convert,AustralianAntarcticDataCentre/metadata_xml_convert | delete_old_converts.py | delete_old_converts.py | import argparse
import logging
import os
from file_checks import get_files_in_folder, get_input_path
from settings import CONVERSIONS, EXPORT_PATH, LOGGING_FORMAT
logger = logging.getLogger(__name__)
def get_arg_parser():
"""
Return an argument parser for this script.
Does not include any subparsers.
Return... | import argparse
import logging
import os
from file_checks import get_files_in_folder, get_input_path
from settings import CONVERSIONS, EXPORT_PATH
logger = logging.getLogger(__name__)
def get_arg_parser():
"""
Return an argument parser for this script.
Does not include any subparsers.
Returns
-------
arg... | mit | Python |
6d0a6f70ddf8ee23a53e6933445f11a736a13a3c | correct worker2 | mhallett/MeDaReDa,mhallett/MeDaReDa | demos/demo1/worker2.py | demos/demo1/worker2.py | # worker2.py
import datetime
import pyrax
import medareda_lib
import os
class Worker2(object):
def __init__(self,in_table):
self.conn = medareda_lib.get_conn()
self.in_table = in_table
self.server_id = self._getServerId()
self.setStatusIdle()
def _getSer... | # worker2.py
import datetime
import pyrax
import medareda_worker_lib
import os
class Worker2(object):
def __init__(self,in_table):
self.conn = medareda_worker_lib.get_conn()
self.in_table = in_table
self.server_id = self._getServerId()
self.setStatusIdle()
... | mit | Python |
da37c4c7504568ede5ce12487887eceb4dd1e5c4 | Update djrill/mail/__init__.py | barseghyanartur/Djrill,janusnic/Djrill,idlweb/Djrill,janusnic/Djrill,brack3t/Djrill,idlweb/Djrill,barseghyanartur/Djrill | djrill/mail/__init__.py | djrill/mail/__init__.py | from django.core.exceptions import ImproperlyConfigured
from django.core.mail import EmailMultiAlternatives
class DjrillMessage(EmailMultiAlternatives):
alternative_subtype = "mandrill"
def __init__(self, subject='', body='', from_email=None, to=None, bcc=None,
connection=None, attachments=None, head... | from django.core.exceptions import ImproperlyConfigured
from django.core.mail import EmailMultiAlternatives
class DjrillMessage(EmailMultiAlternatives):
alternative_subtype = "mandrill"
def __init__(self, subject='', body='', from_email=None, to=None, bcc=None,
connection=None, attachments=None, head... | bsd-3-clause | Python |
4bcf35efcfc751a1c337fdcf50d23d9d06549717 | Fix typo in doc string | pgovers/oscar-wagtail-demo,pgovers/oscar-wagtail-demo | demo/apps/catalogue/models.py | demo/apps/catalogue/models.py | from django.db import models
from django.utils.translation import ugettext_lazy as _
from wagtail.wagtailcore.models import Page
class Category(Page):
"""
The Oscars Category as a Wagtail Page
This works because they both use Treebeard
"""
name = models.CharField(
verbose_name=_('name'),
... | from django.db import models
from django.utils.translation import ugettext_lazy as _
from wagtail.wagtailcore.models import Page
class Category(Page):
"""
user oscars category as a wagtail Page.
this works becuase they both use treebeard
"""
name = models.CharField(
verbose_name=_('name')... | mit | Python |
a33b05785b2b2710670b9ad974239c9cb0cffa14 | Add TwrTimelineError | tchx84/twitter-gobject | twitter/twr_error.py | twitter/twr_error.py | #!/usr/bin/env python
#
# Copyright (c) 2013 Martin Abente Lahaye. - tch@sugarlabs.org
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the righ... | #!/usr/bin/env python
#
# Copyright (c) 2013 Martin Abente Lahaye. - tch@sugarlabs.org
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the righ... | lgpl-2.1 | Python |
96cdeac4dbb1ac2e3863cbc98438750701198563 | fix imports for __init__ (CircuitListenerMixin misisng) | meejah/txtorcon,david415/txtorcon,meejah/txtorcon,david415/txtorcon | txtorcon/__init__.py | txtorcon/__init__.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import with_statement
from txtorcon._metadata import __version__, __author__, __contact__
from txtorcon._metadata import __license__, __copyright__, __url__
fro... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import with_statement
from txtorcon._metadata import __version__, __author__, __contact__
from txtorcon._metadata import __license__, __copyright__, __url__
fro... | mit | Python |
b37bbf65e1211f1c398e43072c27a1a20c409d6b | Update models.py | IT-PM-OpenAdaptronik/Webapp,IT-PM-OpenAdaptronik/Webapp,IT-PM-OpenAdaptronik/Webapp | apps/projects/models.py | apps/projects/models.py | from django.db import models
from django.conf import settings
'''crates model Projects with
userId as ForeignKey from User
name as CharField
category as ForeignKey from Category
subcategory as ForeignKey from Subategory
producer as CharField
typ as CharField
note as TextField
'''
class Project(models.Model):
use... | from django.db import models
from django.conf import settings
'''crates model Projects with
userId as ForeignKey from User
name as CharField
category as ForeignKey from Category
subcategory as ForeignKey from Subategory
producer as CharField
typ as CharField
note as TextField
'''
class Project(models.Model):
pro... | mit | Python |
0a69133e44810dd0469555f62ec49eba120e6ecc | Add utility function to convert a language code to a its full name | denverfoundation/storybase,denverfoundation/storybase,denverfoundation/storybase,denverfoundation/storybase | apps/storybase/utils.py | apps/storybase/utils.py | """Shared utility functions"""
from django.conf import settings
from django.template.defaultfilters import slugify as django_slugify
from django.utils.translation import ugettext as _
def get_language_name(language_code):
"""Convert a language code into its full (localized) name"""
languages = dict(settings.L... | """Shared utility functions"""
from django.template.defaultfilters import slugify as django_slugify
def slugify(value):
"""
Normalizes string, converts to lowercase, removes non-alpha characters,
converts spaces to hyphens, and truncates to 50 characters.
"""
slug = django_slugify(value)
slug ... | mit | Python |
193327d17072324cffa6275ea4c2e2a69c2ce7c3 | Use Python 3 supported import | venmo/nose-detecthttp | detecthttp/__init__.py | detecthttp/__init__.py | from ._version import __version__ # noqa
from .plugin import DetectHTTP # noqa
| from ._version import __version__ # noqa
from plugin import DetectHTTP # noqa
| mit | Python |
0e3cad231e3010ad69b92ce9470cf09a5433d9d6 | Fix display of output in Bash kernel | Calysto/metakernel | metakernel_bash/metakernel_bash.py | metakernel_bash/metakernel_bash.py | from __future__ import print_function
from metakernel import MetaKernel
class MetaKernelBash(MetaKernel):
implementation = 'MetaKernel Bash'
implementation_version = '1.0'
language = 'bash'
language_version = '0.1'
banner = "MetaKernel Bash - interact with bash"
language_info = {
'mim... | from __future__ import print_function
from metakernel import MetaKernel
class MetaKernelBash(MetaKernel):
implementation = 'MetaKernel Bash'
implementation_version = '1.0'
language = 'bash'
language_version = '0.1'
banner = "MetaKernel Bash - interact with bash"
language_info = {
'mim... | bsd-3-clause | Python |
052a14ad0af6ed0ac8eb44d2ff7a208d101aff7b | disable refreshing the cache | crate-archive/crate-site,crateio/crate.pypi,crate-archive/crate-site | crate_project/apps/pypi/models.py | crate_project/apps/pypi/models.py | from django.core.urlresolvers import reverse
from django.db import models
from django.db.models.signals import post_save, post_delete
from django.dispatch import receiver
from model_utils import Choices
from model_utils.models import TimeStampedModel
class PyPIMirrorPage(TimeStampedModel):
package = models.Fore... | from django.core.urlresolvers import reverse
from django.db import models
from django.db.models.signals import post_save, post_delete
from django.dispatch import receiver
from model_utils import Choices
from model_utils.models import TimeStampedModel
class PyPIMirrorPage(TimeStampedModel):
package = models.Fore... | bsd-2-clause | Python |
f86bf4a7f3b194cd75ca8b58bd0960f18c23ff8d | Handle exceptions with generating thumbnails on demand (return "") | ZG-Tennis/django-cropduster,ZG-Tennis/django-cropduster,ZG-Tennis/django-cropduster | cropduster/templatetags/images.py | cropduster/templatetags/images.py | from coffin import template
from coffin.template.loader import get_template
register = template.Library()
from django.conf import settings
from cropduster.models import Size
from cropduster.models import AUTO_SIZE
from os.path import exists
CROPDUSTER_CROP_ONLOAD = getattr(settings, "CROPDUSTER_CROP_ONLOAD", True)
CRO... | from coffin import template
from coffin.template.loader import get_template
register = template.Library()
from django.conf import settings
from cropduster.models import Size
from cropduster.models import AUTO_SIZE
from os.path import exists
CROPDUSTER_CROP_ONLOAD = getattr(settings, "CROPDUSTER_CROP_ONLOAD", True)
CRO... | bsd-2-clause | Python |
1d3e0822243d2a48d756ae8371795342767e4338 | remove unnecessary constructor | pmbarrett314/curses-menu | cursesmenu/items/external_item.py | cursesmenu/items/external_item.py | import curses
import cursesmenu.curses_menu
from cursesmenu.curses_menu import MenuItem
class ExternalItem(MenuItem):
"""
A base class for items that need to do stuff on the console outside of curses mode.
Sets the terminal back to standard mode until the action is done.
Should probably be subclassed... | import curses
import cursesmenu.curses_menu
from cursesmenu.curses_menu import MenuItem
class ExternalItem(MenuItem):
"""
A base class for items that need to do stuff on the console outside of curses mode.
Sets the terminal back to standard mode until the action is done.
Should probably be subclassed... | mit | Python |
62b1c49c67c72c36d4177c657df49a4700586c06 | Change the url patters from python_social_auth to social_django | tosp/djangoTemplate,tosp/djangoTemplate | djangoTemplate/urls.py | djangoTemplate/urls.py | """djangoTemplate 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.urls import url, include
from django.contrib import admin
urlpatterns = [
url('', include('base.urls')),
url('', ... | """djangoTemplate 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.urls import url, include
from django.contrib import admin
urlpatterns = [
url('', include('base.urls')),
url('', ... | mit | Python |
e14599ce03c7c326479655ead88246047eee7c16 | bump version | benjaoming/django-nyt,benjaoming/django-nyt | django_nyt/__init__.py | django_nyt/__init__.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
_disable_notifications = False
VERSION = "0.9.8"
def notify(*args, **kwargs):
"""
DEPRECATED - please access django_nyt.utils.notify
"""
from django_nyt.utils import notify
return notify(*args,... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
_disable_notifications = False
VERSION = "0.9.7.3"
def notify(*args, **kwargs):
"""
DEPRECATED - please access django_nyt.utils.notify
"""
from django_nyt.utils import notify
return notify(*arg... | apache-2.0 | Python |
62f4c6b7d24176284054b13c4e1e9b6d631c7b42 | Update basic test Now uses the new format by @BookOwl. | PySlither/Slither,PySlither/Slither | basicTest.py | basicTest.py | import slither, pygame, time
snakey = slither.Sprite()
snakey.setCostumeByName("costume0")
SoExcited = slither.Sprite()
SoExcited.addCostume("SoExcited.png", "avatar")
SoExcited.setCostumeByNumber(0)
SoExcited.goTo(300, 300)
SoExcited.setScaleTo(0.33)
slither.slitherStage.setColor(40, 222, 40)
screen = slither.se... | import slither, pygame, time
snakey = slither.Sprite()
snakey.setCostumeByName("costume0")
SoExcited = slither.Sprite()
SoExcited.addCostume("SoExcited.png", "avatar")
SoExcited.setCostumeByNumber(0)
SoExcited.goTo(300, 300)
SoExcited.setScaleTo(0.33)
slither.slitherStage.setColor(40, 222, 40)
screen = slither.se... | mit | Python |
6c8cc6d25d078bd0ce6000e650338017703a76cb | mark no sleep etag test as xfail if it fails | pdav/khal,sdx23/khal,geier/khal,hobarrera/khal,pimutils/khal | tests/vdir_test.py | tests/vdir_test.py | # Copyright (c) 2013-2016 Christian Geier et al.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, ... | # Copyright (c) 2013-2016 Christian Geier et al.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, ... | mit | Python |
9492ab707d92693559fa50922fa15f9bff096f02 | Bump to 0.2.3 | alexmojaki/snoop,alexmojaki/snoop | snoop/__init__.py | snoop/__init__.py | '''
Usage:
import snoop
@snoop
def your_function(x):
...
A log will be written to stderr showing the lines executed and variables
changed in the decorated function.
For more information, see https://github.com/alexmojaki/snoop
'''
from .configuration import install, Config
from .variables impor... | '''
Usage:
import snoop
@snoop
def your_function(x):
...
A log will be written to stderr showing the lines executed and variables
changed in the decorated function.
For more information, see https://github.com/alexmojaki/snoop
'''
from .configuration import install, Config
from .variables impor... | mit | Python |
99aaf537197b8f652780cbbb16fb2090e448ecc5 | increment minor version to 1.8.0 | tony/tmuxp | tmuxp/__about__.py | tmuxp/__about__.py | __title__ = 'tmuxp'
__package_name__ = 'tmuxp'
__version__ = '1.8.0'
__description__ = 'tmux session manager'
__email__ = 'tony@git-pull.com'
__author__ = 'Tony Narlock'
__github__ = 'https://github.com/tmux-python/tmuxp'
__docs__ = 'https://tmuxp.git-pull.com'
__tracker__ = 'https://github.com/tmux-python/tmuxp/issues... | __title__ = 'tmuxp'
__package_name__ = 'tmuxp'
__version__ = '1.7.0a3'
__description__ = 'tmux session manager'
__email__ = 'tony@git-pull.com'
__author__ = 'Tony Narlock'
__github__ = 'https://github.com/tmux-python/tmuxp'
__docs__ = 'https://tmuxp.git-pull.com'
__tracker__ = 'https://github.com/tmux-python/tmuxp/issu... | bsd-3-clause | Python |
da5555301e1d837a8ca39a48913f825e772bd2de | Update to Milestone v0.4 complete. Addresses #6 & #7 | abhinavbom/Threat-Intelligence-Hunter | bin/md5vt.py | bin/md5vt.py | #stdlib imports
import json
import argparse
import sys
import requests
#local imports
from bin.parse import *
#Add your public API key before starting.
api = '100e582a15884a9c5cc37e298766065695e551fb1fc88ee05eadc85eacc3b61e'
base = 'https://www.virustotal.com/vtapi/v2/'
if api == '':
print "No API key provided.... | #stdlib imports
import json
import argparse
import sys
import requests
#local imports
from bin.parse import *
#Add your public API key before starting.
api = ''
base = 'https://www.virustotal.com/vtapi/v2/'
if api == '':
print "No API key provided. Please add your VirusTotal public API key to /bin/md5vt.py"
... | mit | Python |
adfe03b431f13d6982fdb7a85e57f52d765e54f2 | handle all errors coming from an attempt to connect | ceph/ceph-deploy,ghxandsky/ceph-deploy,jumpstarter-io/ceph-deploy,branto1/ceph-deploy,Vicente-Cheng/ceph-deploy,Vicente-Cheng/ceph-deploy,ddiss/ceph-deploy,trhoden/ceph-deploy,SUSE/ceph-deploy,shenhequnying/ceph-deploy,alfredodeza/ceph-deploy,ktdreyer/ceph-deploy,SUSE/ceph-deploy-to-be-deleted,codenrhoden/ceph-deploy,c... | ceph_deploy/connection.py | ceph_deploy/connection.py | from ceph_deploy.lib.remoto import Connection
from sudo_pushy import needs_sudo # TODO move this to utils once pushy is out
def get_connection(hostname, logger):
"""
A very simple helper, meant to return a connection
that will know about the need to use sudo.
"""
try:
return Connection(
... | from ceph_deploy.lib.remoto import Connection
from sudo_pushy import needs_sudo # TODO move this to utils once pushy is out
def get_connection(hostname, logger):
"""
A very simple helper, meant to return a connection
that will know about the need to use sudo.
"""
return Connection(
hostna... | mit | Python |
6bdbfe74813744476681074f5578737795d9b728 | remove bootstrap-rgw key via forgetkeys | codenrhoden/ceph-deploy,osynge/ceph-deploy,Vicente-Cheng/ceph-deploy,SUSE/ceph-deploy,SUSE/ceph-deploy,zhouyuan/ceph-deploy,isyippee/ceph-deploy,isyippee/ceph-deploy,trhoden/ceph-deploy,Vicente-Cheng/ceph-deploy,zhouyuan/ceph-deploy,shenhequnying/ceph-deploy,ceph/ceph-deploy,codenrhoden/ceph-deploy,ceph/ceph-deploy,trh... | ceph_deploy/forgetkeys.py | ceph_deploy/forgetkeys.py | import logging
import errno
from .cliutil import priority
LOG = logging.getLogger(__name__)
def forgetkeys(args):
import os
for f in [
'mon',
'client.admin',
'bootstrap-osd',
'bootstrap-mds',
'bootstrap-rgw',
]:
try:
os.unlink('{cluster}.{... | import logging
import errno
from .cliutil import priority
LOG = logging.getLogger(__name__)
def forgetkeys(args):
import os
for f in [
'mon',
'client.admin',
'bootstrap-osd',
'bootstrap-mds',
]:
try:
os.unlink('{cluster}.{what}.keyring'.format(
... | mit | Python |
de0e8c54827d8c79c47f28c93c6951b2921fe8e1 | create a working dev sub-command | ceph/ceph-installer,ceph/ceph-installer,ceph/mariner-installer,ceph/ceph-installer | ceph_installer/cli/dev.py | ceph_installer/cli/dev.py | from os import path
from textwrap import dedent
from tambo import Transport
from ceph_installer import process
from ceph_installer.cli import log
this_dir = path.abspath(path.dirname(__file__))
top_dir = path.dirname(path.dirname(this_dir))
playbook_path = path.join(top_dir, 'deploy/playbooks')
class Dev(object):
... |
class Dev(object):
help = "Development options"
def __init__(self, arguments):
self.arguments = arguments
def main(self):
raise SystemExit(0)
| mit | Python |
ce5c26ea73ac9764dc45d6f0cef7b7958dc06a30 | FIx minor bugs and styles | chainer/chainer,chainer/chainer,niboshi/chainer,hvy/chainer,chainer/chainer,niboshi/chainer,wkentaro/chainer,hvy/chainer,chainer/chainer,hvy/chainer,wkentaro/chainer,niboshi/chainer,pfnet/chainer,wkentaro/chainer,niboshi/chainer,wkentaro/chainer,hvy/chainer | chainer/testing/matrix.py | chainer/testing/matrix.py | import numpy
from chainer.utils import argument
def generate_matrix(shape, dtype=float, **kwargs):
r"""Generates a random matrix with given singular values.
This function generates a random NumPy matrix (or a set of matrices) that
has specified singular values. It can be used to generate the inputs for ... | import numpy
from chainer.utils import argument
def generate_matrix(shape, dtype=float, **kwargs):
"""Generates a random matrix with given singular values.
This function generates a random NumPy matrix (or a set of matrices) that
has specified singular values. It can be used to generate the inputs for a... | mit | Python |
ed0484931b104026ebd7ac9a411c89e50efa9bdb | Revert "fix" | chainer/chainercv,pfnet/chainercv,chainer/chainercv,yuyu2172/chainercv,yuyu2172/chainercv | chainercv/testing/attr.py | chainercv/testing/attr.py | from chainer.testing import attr
from attr import cudnn # NOQA
from attr import slow # NOQA
from attr import multi_gpu # NOQA
from attr import gpu # NOQA
try:
import pytest
disk = pytest.mark.disk
except ImportError:
disk = attr._dummy_callable
| from chainer.testing.attr import cudnn # NOQA
from chainer.testing.attr import slow # NOQA
from chainer.testing.attr import multi_gpu # NOQA
from chainer.testing.attr import gpu # NOQA
try:
import pytest
disk = pytest.mark.disk
except ImportError:
from chainer.testing.attr import _dummy_callable
di... | mit | Python |
395fec516acdfe1a8ed6fc2ec8025e317fee311e | bump master for jenkins | istresearch/traptor,istresearch/traptor | traptor/version.py | traptor/version.py | __version__ = '1.4.13.0'
if __name__ == '__main__':
print(__version__)
| __version__ = '1.4.13.0'
if __name__ == '__main__':
print(__version__)
| mit | Python |
7bf848b17e892d9c99c2d4632d4ac1acda78d939 | make it work | whosonfirst/whosonfirst-www-iamhere,whosonfirst/whosonfirst-www-iamhere,whosonfirst/whosonfirst-www-iamhere | bin/start.py | bin/start.py | #!/usr/bin/env python
# -*-python-*-
import os
import sys
import logging
import subprocess
import signal
import time
# please rewrite me in go (so it can be cross-compiled)
if __name__ == '__main__':
import optparse
opt_parser = optparse.OptionParser()
opt_parser.add_option('-d', '--data', dest='data',... | #!/usr/bin/env python
# -*-python-*-
import os
import sys
import logging
import subprocess
import signal
import time
# please rewrite me in go (so it can be cross-compiled)
if __name__ == '__main__':
import optparse
opt_parser = optparse.OptionParser()
opt_parser.add_option('-d', '--data', dest='data',... | bsd-3-clause | Python |
db5072f372e7e5d68955641ff801461e4ec4038e | Change the redrawing strategy in the watch script | learning-on-chip/example,learning-on-chip/example | bin/watch.py | bin/watch.py | #!/usr/bin/env python3
import os, sys
sys.path.append(os.path.dirname(__file__))
import matplotlib.pyplot as pp
import numpy as np
import socket
def main(dimension_count, address):
print('Connecting to {}...'.format(address))
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect(addre... | #!/usr/bin/env python3
import os, sys
sys.path.append(os.path.dirname(__file__))
import matplotlib.pyplot as pp
import numpy as np
import socket
def main(dimension_count, address):
print('Connecting to {}...'.format(address))
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect(addre... | mit | Python |
9850ec3200ac80fd85f400fbbe115483ce0c3173 | Create symlink instead of copy | danielcorreia/dotfiles,danielcorreia/dotfiles | bootstrap.py | bootstrap.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import shutil
import subprocess
commands = {
'ssh_key': "ssh-keygen -t rsa -b 4096 -C '{email}'"
}
DOTFILES = [
'.aliases',
'.bash_profile',
'.bash_prompt',
'.exports',
'.functions',
'.gitconfig',
'.gitignore',
'.hushlogin',
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import shutil
import subprocess
commands = {
'ssh_key': "ssh-keygen -t rsa -b 4096 -C '{email}'"
}
DOTFILES = [
'.aliases',
'.bash_profile',
'.bash_prompt',
'.exports',
'.functions',
'.gitconfig',
'.gitignore',
'.hushlogin',
... | mit | Python |
8aab608efa6f7a53de061f57da64bebc54adf143 | Update to check_next_launch() | ItsCalebJones/SpaceLaunchNow-Server,ItsCalebJones/SpaceLaunchNow-Server,ItsCalebJones/SpaceLaunchNow-Server | bot/tasks.py | bot/tasks.py | from bot.app.DailyDigest import DailyDigestServer
from celery.schedules import crontab
from celery.task import task, periodic_task
from celery.utils.log import get_task_logger
from bot.app.Notifications import NotificationServer
logger = get_task_logger('bot')
TAG = 'Digest Server'
@periodic_task(
run_every=(c... | from bot.app.DailyDigest import DailyDigestServer
from celery.schedules import crontab
from celery.task import task, periodic_task
from celery.utils.log import get_task_logger
from bot.app.Notifications import NotificationServer
logger = get_task_logger('bot')
TAG = 'Digest Server'
@periodic_task(
run_every=(c... | apache-2.0 | Python |
516ea71d120eca94a76245fbcb62811b7980b63c | Fix run. | philippebeaudoin/mmomie,philippebeaudoin/mmomie | build/run.py | build/run.py | #!/usr/bin/env python
# Copyright (c) 2015 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.
import argparse
import os
import sys
import game_project
import vinn
def _RelPathToUnixPath(p):
return p.replace(os.sep, '/')
... | #!/usr/bin/env python
# Copyright (c) 2015 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.
import argparse
import os
import sys
import game_project
import vinn
def _RelPathToUnixPath(p):
return p.replace(os.sep, '/')
... | apache-2.0 | Python |
974fa61b0ea26c07d7b16ff8d53eb682d3f0c21f | Fix tests for IPython.testing | ipython/ipython,ipython/ipython | IPython/testing/plugin/show_refs.py | IPython/testing/plugin/show_refs.py | """Simple script to show reference holding behavior.
This is used by a companion test case.
"""
from __future__ import print_function
import gc
class C(object):
def __del__(self):
pass
#print 'deleting object...' # dbg
if __name__ == '__main__':
c = C()
c_refs = gc.get_referrers(c)
ref_ids... | """Simple script to show reference holding behavior.
This is used by a companion test case.
"""
from __future__ import print_function
import gc
class C(object):
def __del__(self):
pass
#print 'deleting object...' # dbg
if __name__ == '__main__':
c = C()
c_refs = gc.get_referrers(c)
ref_ids... | bsd-3-clause | Python |
a3d2cc9f86342859d7ad6d68689e03f8e1b1266e | Fix docstring style | fnielsen/dasem,fnielsen/dasem | dasem/__main__.py | dasem/__main__.py | """dasem.
Usage:
dasem
"""
def main():
"""Handle command-line interface."""
raise NotImplementedError
if __name__ == '__main__':
main()
| """
Usage:
dasem <query>
Options:
--max-n-pages=<int> Maximum number of pages
-v --verbose Verbose debug messaging
"""
def main():
raise NotImplementedError
if __name__ == '__main__':
main()
| apache-2.0 | Python |
19a7e6bab3bf497ef23d72f3d5bbecde5c7a8cc5 | Fix error message for php mess detector | hglattergotz/sfdeploy | bin/tools.py | bin/tools.py | # -*- coding: utf-8 -*-
# config.py
#
# Copyright (c) 2012-2013 Henning Glatter-Götz
#
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
# tools.py - Collection of configuration tasks for fabric
#
# To include it in the fabfile.py add this near... | # -*- coding: utf-8 -*-
# config.py
#
# Copyright (c) 2012-2013 Henning Glatter-Götz
#
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
# tools.py - Collection of configuration tasks for fabric
#
# To include it in the fabfile.py add this near... | mit | Python |
385f190d782c7d2edbba8b425db2418e6891ea86 | Consolidate hasattr + getter to single statement with default value. | kch8qx/osf.io,aaxelb/osf.io,chrisseto/osf.io,baylee-d/osf.io,billyhunt/osf.io,acshi/osf.io,SSJohns/osf.io,kwierman/osf.io,emetsger/osf.io,icereval/osf.io,DanielSBrown/osf.io,mattclark/osf.io,njantrania/osf.io,jmcarp/osf.io,HalcyonChimera/osf.io,emetsger/osf.io,Nesiehr/osf.io,bdyetton/prettychart,doublebits/osf.io,lynds... | framework/mongo/__init__.py | framework/mongo/__init__.py | # -*- coding: utf-8 -*-
from flask import request
from modularodm.storedobject import StoredObject as GenericStoredObject
from modularodm.ext.concurrency import with_proxies, proxied_members
from bson import ObjectId
from .handlers import client, database, set_up_storage
from api.base.api_globals import api_globals... | # -*- coding: utf-8 -*-
from flask import request
from modularodm.storedobject import StoredObject as GenericStoredObject
from modularodm.ext.concurrency import with_proxies, proxied_members
from bson import ObjectId
from .handlers import client, database, set_up_storage
from api.base.api_globals import api_globals... | apache-2.0 | Python |
2fb48c09362f30935396bde06fcdeb16f504a67f | add scene ownership tests | gopro/gopro-lib-node.gl,gopro/gopro-lib-node.gl,gopro/gopro-lib-node.gl,gopro/gopro-lib-node.gl | tests/api.py | tests/api.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2019 GoPro Inc.
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
#... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2019 GoPro Inc.
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
#... | apache-2.0 | Python |
37771791dea67d5df88afdd2e5720731a5303ce8 | Fix test running for running from src dir. | aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygmen... | tests/run.py | tests/run.py | # -*- coding: utf-8 -*-
"""
Pygments unit tests
~~~~~~~~~~~~~~~~~~
Usage::
python run.py [testfile ...]
:copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import sys, os
if sys.version_info >= (3,):
# copy test suite over ... | # -*- coding: utf-8 -*-
"""
Pygments unit tests
~~~~~~~~~~~~~~~~~~
Usage::
python run.py [testfile ...]
:copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import sys, os
if sys.version_info >= (3,):
# copy test suite over ... | bsd-2-clause | Python |
890190f40b9061f7bfa15bbd7e56abc0f1b7d44a | Make fitters available at main import level. | erykoff/redmapper,erykoff/redmapper | redmapper/__init__.py | redmapper/__init__.py | from __future__ import division, absolute_import, print_function
from ._version import __version__, __version_info__
version = __version__
from .configuration import Configuration
from .runcat import RunCatalog
from .solver_nfw import Solver
from .catalog import DataObject, Entry, Catalog
from .redsequence import Re... | from __future__ import division, absolute_import, print_function
from ._version import __version__, __version_info__
version = __version__
from .configuration import Configuration
from .runcat import RunCatalog
from .solver_nfw import Solver
from .catalog import DataObject, Entry, Catalog
from .redsequence import Re... | apache-2.0 | Python |
e148c2a01272b5aa2e131e6b67e21bbe6b8c37b4 | remove obsoleted python filter for `\cboxbegin` and `\cboxend` | cagix/pandoc-lecture | textohtml.py | textohtml.py | #!/usr/bin/env python
# Author: Carsten Gips <carsten.gips@fh-bielefeld.de>
# Copyright: (c) 2016 Carsten Gips
# License: MIT
"""
Pandoc filter to replace certain LaTeX macros with matching HTML tags.
In my beamer slides I use certain macros like `\blueArrow` which produces an
arrow in deep blue color. This filter ... | #!/usr/bin/env python
# Author: Carsten Gips <carsten.gips@fh-bielefeld.de>
# Copyright: (c) 2016 Carsten Gips
# License: MIT
"""
Pandoc filter to replace certain LaTeX macros with matching HTML tags.
In my beamer slides I use certain macros like `\blueArrow` which produces an
arrow in deep blue color. This filter ... | mit | Python |
cc71c674e044f31ff154b8cc7a8f55975e4ff2ad | Fix conf.py | arpras/Zopkio,pubnub/Zopkio,jdehrlich/zopkio,pubnub/Zopkio,pubnub/Zopkio,linkedin/Zopkio,jdehrlich/zopkio,arpras/Zopkio,arpras/Zopkio,jdehrlich/zopkio,linkedin/Zopkio,linkedin/Zopkio,arpras/Zopkio,jdehrlich/zopkio,pubnub/Zopkio,linkedin/Zopkio,pubnub/Zopkio | docs/conf.py | docs/conf.py | #!/usr/bin/env
# Copyright 2014 LinkedIn Corp.
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache Lice... | #!/usr/bin/env
# Copyright 2014 LinkedIn Corp.
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache Lice... | apache-2.0 | Python |
165b02d35bf88456a96c0b5e4f63f3033eb3091d | Fix for changed Need datamodel | coders4help/volunteer_planner,MRigal/volunteer_planner,klinger/volunteer_planner,tordans/volunteer_planner,slevon/volunteer_planner,coders4help/volunteer_planner,juliabiro/volunteer_planner,coders4help/volunteer_planner,volunteer-planner/volunteer_planner,FriedrichK/volunteer_planner,FriedrichK/volunteer_planner,christ... | registration/admin.py | registration/admin.py | from django.contrib import admin
from django.contrib.sites.models import RequestSite
from django.contrib.sites.models import Site
from django.utils.translation import ugettext_lazy as _
from models import RegistrationProfile
from scheduler.models import Need
class RegistrationAdmin(admin.ModelAdmin):
actions = [... | from django.contrib import admin
from django.contrib.sites.models import RequestSite
from django.contrib.sites.models import Site
from django.utils.translation import ugettext_lazy as _
from models import RegistrationProfile
from scheduler.models import Need
class RegistrationAdmin(admin.ModelAdmin):
actions = [... | agpl-3.0 | Python |
ae2e8cc85b6b4d2202e42d704dde8757ffd31da6 | Make make_rel_symlink.py use python3. | stb-tester/lirc,stb-tester/lirc,stb-tester/lirc,stb-tester/lirc,stb-tester/lirc,stb-tester/lirc | tools/make_rel_symlink.py | tools/make_rel_symlink.py | #!/usr/bin/env python3
import os
import os.path
import sys
import pdb
import shutil
def relative_ln_s( from_, to_ ):
"""
This is just so dirty & boring: create a relative symlink, making the
to_ path relative to from_. No errorchecks. Both arguments must be
files, a destination directory doesn't work... | #!/usr/bin/env python
import os
import os.path
import sys
import pdb
import shutil
def relative_ln_s( from_, to_ ):
"""
This is just so dirty & boring: create a relative symlink, making the
to_ path relative to from_. No errorchecks. Both arguments must be
files, a destination directory doesn't work ... | mit | Python |
e4879d5cb5cf266ac8f755c947bb693ed7bebc05 | print hello | Giangblackk/python-togeojson | togeojson.py | togeojson.py | # simple create copycat functions from togeojson.js
# generate a short, numeric hash of a string
def okhash(x):
print('hello')
| # simple create copycat functions from togeojson.js
# generate a short, numeric hash of a string
def okhash(x):
| bsd-2-clause | Python |
aa8234d1e6b4916e6945468a2bc5772df2d53e28 | Add Discord Admin for debugging. | ItsCalebJones/SpaceLaunchNow-Server,ItsCalebJones/SpaceLaunchNow-Server,ItsCalebJones/SpaceLaunchNow-Server | bot/admin.py | bot/admin.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from . import models
@admin.register(models.Notification)
class NotificationAdmin(admin.ModelAdmin):
list_display = ('launch', 'last_net_stamp', 'last_twitter_post', 'last_notification_sent',
'las... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from . import models
@admin.register(models.Notification)
class NotificationAdmin(admin.ModelAdmin):
list_display = ('launch', 'last_net_stamp', 'last_twitter_post', 'last_notification_sent',
'las... | apache-2.0 | Python |
716db272743944f8adc18f6af10282c91030a7ac | Fix spelling and test | python-dirbtuves/akl.lt,python-dirbtuves/akl.lt,python-dirbtuves/akl.lt,python-dirbtuves/akl.lt,python-dirbtuves/akl.lt | src/akllt/tests/test_news_import.py | src/akllt/tests/test_news_import.py | import datetime
import unittest
import pkg_resources
import django.test
from django.core.management import call_command
from wagtail.wagtailcore.models import Page
from akllt.dataimport.news import import_news
from akllt.models import NewsStory
def shorten_values(item):
shortened = {}
for key, value in ite... | import datetime
import unittest
import pkg_resources
import django.test
from django.core.management import call_command
from wagtail.wagtailcore.models import Page
from akllt.dataimport.news import import_news
from akllt.models import NewsStory
def shorten_values(item):
shortened = {}
for key, value in ite... | agpl-3.0 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.