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 |
|---|---|---|---|---|---|---|---|---|
4ece9fc12800e672b4e251882e8f5695449bd23f | Add more unit tests | terbolous/cloudstack-ec2stack,terbolous/cloudstack-ec2stack,apache/cloudstack-ec2stack,apache/cloudstack-ec2stack | tests/controller_tests.py | tests/controller_tests.py | #!/usr/bin/env python
# encoding: utf-8
from . import Ec2StackAppTestCase
class ControllerTestCase(Ec2StackAppTestCase):
data = {
'SignatureVersion': '2',
'AWSAccessKeyId': 'ExampleAPIKey',
'Version': '2013-10-15',
'Timestamp': '2014-02-19T23:34:43.868347',
'SignatureMethod... | #!/usr/bin/env python
# encoding: utf-8
from . import Ec2StackAppTestCase
class ControllerTestCase(Ec2StackAppTestCase):
data = {
'Action': 'CreateKeyPair',
'AWSAccessKeyId': 'ExampleAPIKey',
'Signature': '7puh9l03gKeTGmIpZwlKaFzSnW68fBFTKeT83HLINkE=',
'SignatureMethod': 'HmacSHA25... | apache-2.0 | Python |
369a7a95132b7b877baa061b3506df2a3bd0f0a8 | change the way to import alphatwirl | 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 alphatwirl
##__________________________________________________________________||
class Task(object):
def __init__(self, name):
self.name = name
def __call_... | #!/usr/bin/env python
# Tai Sakuma <tai.sakuma@gmail.com>
from __future__ import print_function
from alphatwirl.progressbar import ProgressReport, BProgressMonitor
from alphatwirl.progressbar import ProgressBar
from alphatwirl.progressbar import ProgressPrint
from alphatwirl.concurrently import CommunicationChannel, Mu... | bsd-3-clause | Python |
6dd329d67e00c370be406f672a3eed49be5304a9 | test more credentials | YeelerG/twilio-python,tysonholub/twilio-python,Mobii/twilio-python,johannakate/twilio-python,twilio/twilio-python,Rosy-S/twilio-python,bcorwin/twilio-python,supermanheng21/twilio-python | tests/test_credentials.py | tests/test_credentials.py | from nose.tools import assert_equal, assert_raises
from mock import patch
from twilio import TwilioException
from twilio.rest import TwilioRestClient, find_credentials
def test_creds_not_found():
""" I shouldn't find credentials if they are not there """
assert_equal(find_credentials({'foo': 'bar'}), (None, N... | from nose.tools import assert_equal
from twilio.rest import find_credentials
def test_creds_not_found():
""" I shouldn't find credentials if they are not there """
assert_equal(find_credentials({'foo': 'bar'}), (None, None))
def test_find_creds():
""" I should find the credentials if they are there """
... | mit | Python |
8ef8bb0c46b1ff44eb796ecabd85c45e6d75bf4f | Add TestInheritance*CFuncs2 | tkf/railgun,tkf/railgun | tests/test_inheritance.py | tests/test_inheritance.py | import unittest
from railgun import SimObject
from test_simobj import VectCalc
class VectCalcNoCFuncs(SimObject):
_cstructname_ = 'VectCalc'
_clibname_ = VectCalc._clibname_
_clibdir_ = VectCalc._clibdir_
_cmembers_ = VectCalc._cmembers_
class MixinFullCFuncs(object):
_cfuncs_ = VectCalc._cfunc... | import unittest
from railgun import SimObject
from test_simobj import VectCalc
class VectCalcNoCFuncs(SimObject):
_cstructname_ = 'VectCalc'
_clibname_ = VectCalc._clibname_
_clibdir_ = VectCalc._clibdir_
_cmembers_ = VectCalc._cmembers_
class MixinFullCFuncs(object):
_cfuncs_ = VectCalc._cfunc... | mit | Python |
57d20ec6984d4ab749d702aaace88b273242e163 | Test for retrieve_container_for_inspection_id | DiamondLightSource/ispyb-api,DiamondLightSource/ispyb-api | tests/test_xtalimaging.py | tests/test_xtalimaging.py | from __future__ import absolute_import, division, print_function
def test_xtal_imaging(testdb):
testdb.set_role("ispyb_import")
xtalimaging = testdb.xtal_imaging
container = xtalimaging.retrieve_container_for_barcode("test_plate2")
cid = container[0]["containerId"]
assert cid is not None
ass... | from __future__ import absolute_import, division, print_function
def test_xtal_imaging(testdb):
testdb.set_role("ispyb_import")
xtalimaging = testdb.xtal_imaging
container = xtalimaging.retrieve_container_for_barcode("test_plate2")
cid = container[0]["containerId"]
assert cid is not None
ass... | apache-2.0 | Python |
a24f519ee958e45d64da4d1dd30ce6224b89d6d7 | Make this assertion for testing expires header slightly more tolerant | eriol/circuits,treemo/circuits,eriol/circuits,treemo/circuits,treemo/circuits,eriol/circuits,nizox/circuits | tests/web/test_expires.py | tests/web/test_expires.py | #!/usr/bin/env python
from urllib2 import urlopen
from rfc822 import parsedate
from datetime import datetime
from time import gmtime, mktime
from circuits.web import Controller
class Root(Controller):
def index(self):
self.expires(60)
return "Hello World!"
def nocache(self):
self.ex... | #!/usr/bin/env python
from urllib2 import urlopen
from rfc822 import parsedate
from datetime import datetime
from time import gmtime, mktime
from circuits.web import Controller
class Root(Controller):
def index(self):
self.expires(60)
return "Hello World!"
def nocache(self):
self.ex... | mit | Python |
0b10f97581be9a3b1fdf965a720c2fb143a54ca9 | Add basic test for UNIX servers" | eriol/circuits,treemo/circuits,treemo/circuits,treemo/circuits,eriol/circuits,eriol/circuits,nizox/circuits | tests/web/test_servers.py | tests/web/test_servers.py | #!/usr/bin/env python
from urllib2 import urlopen
from socket import gethostname
from circuits import Component
from circuits.web import Controller
from circuits.web import BaseServer, Server
class BaseRoot(Component):
channel = "web"
def request(self, request, response):
return "Hello World!"
cla... | #!/usr/bin/env python
from urllib2 import urlopen
from socket import gethostname
from circuits import Component
from circuits.web import Controller
from circuits.web import BaseServer, Server
class BaseRoot(Component):
channel = "web"
def request(self, request, response):
return "Hello World!"
cla... | mit | Python |
0211b36159a7e91542bf7cf2b2c26aaa56f471ac | add missing functions | sashs/Ropper,sashs/Ropper | ropperapp/loaders/raw.py | ropperapp/loaders/raw.py | # coding=utf-8
#
# Copyright 2014 Sascha Schirra
#
# This file is part of Ropper.
#
# Ropper is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ver... | # coding=utf-8
#
# Copyright 2014 Sascha Schirra
#
# This file is part of Ropper.
#
# Ropper is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ver... | bsd-3-clause | Python |
08e7bd74f66bea6e77c939963c108f4317ee7d8c | add two worded shutdown for att stt | brad999/nikita-client,brad999/nikita,brad999/nikita-client,brad999/nikita | client/modules/Shutdown.py | client/modules/Shutdown.py | """
Shutdown module
Name: Shutdown.py
Description: Responds to "shutdown", shuts down system
Dependencies: Must run Jasper as root
Author: Brad Ahlers (github - brad999)
"""
import os, re
WORDS = ["SHUTDOWN", "YES", "NO", "SHUT", "DOWN"]
def handle(text, mic, profile):
"""
Responds ... | """
Shutdown module
Name: Shutdown.py
Description: Responds to "shutdown", shuts down system
Dependencies: Must run Jasper as root
Author: Brad Ahlers (github - brad999)
"""
import os, re
WORDS = ["SHUTDOWN", "YES", "NO"]
def handle(text, mic, profile):
"""
Responds to user-input, t... | mit | Python |
7647e46f86eeee63622ef53dcf0f66b57b18ce32 | Fix missing import | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/utils/dictupdate.py | salt/utils/dictupdate.py | # -*- coding: utf-8 -*-
'''
Alex Martelli's soulution for recursive dict update from
http://stackoverflow.com/a/3233356
'''
from __future__ import absolute_import
# Import python libs
import collections
import copy
import logging
import salt.ext.six as six
from salt.utils.serializers.yamlex \
import merge_recursiv... | # -*- coding: utf-8 -*-
'''
Alex Martelli's soulution for recursive dict update from
http://stackoverflow.com/a/3233356
'''
from __future__ import absolute_import
# Import python libs
import collections
import copy
import salt.ext.six as six
from salt.utils.serializers.yamlex \
import merge_recursive as _yamlex_me... | apache-2.0 | Python |
e7e4db594bbbc2a4c5b394e9467c842cfcb551c9 | fix raw sample | paroj/ogre,OGRECave/ogre,OGRECave/ogre,paroj/ogre,paroj/ogre,OGRECave/ogre,OGRECave/ogre,paroj/ogre,paroj/ogre,OGRECave/ogre | Samples/Python/raw_sample.py | Samples/Python/raw_sample.py | import Ogre
import Ogre.RTShader
class SGResolver(Ogre.MaterialManager_Listener):
def __init__(self, shadergen):
Ogre.MaterialManager_Listener.__init__(self)
self.shadergen = shadergen
def handleSchemeNotFound(self, idx, name, mat, lod_idx, rend):
if name != Ogre.RTShader.ShaderGenerat... | import Ogre
import Ogre.RTShader
class SGResolver(Ogre.MaterialManager_Listener):
def __init__(self, shadergen):
Ogre.MaterialManager_Listener.__init__(self)
self.shadergen = shadergen
def handleSchemeNotFound(self, idx, name, mat, lod_idx, rend):
if name != Ogre.RTShader.ShaderGenerat... | mit | Python |
f70c00f70c8c89fd7418f0ac7fc661ec8e9da915 | fix typo in cppcheck script | al2950/mygui,scrawl/mygui,Anomalous-Software/mygui,Anomalous-Software/mygui,fmwviormv/mygui,al2950/mygui,Anomalous-Software/mygui,fmwviormv/mygui,fmwviormv/mygui,al2950/mygui,scrawl/mygui,scrawl/mygui,al2950/mygui,fmwviormv/mygui,Anomalous-Software/mygui,scrawl/mygui | Scripts/cppcheck/cppcheck.py | Scripts/cppcheck/cppcheck.py | # run from root sources directory: python Scripts/cppcheck/cppcheck.py
import os
ignoredEndings = [
"It is safe to deallocate a NULL pointer",
"Throwing exception in destructor",
"::initialise' can be const.",
"::shutdown' can be const."
]
ignoredContent = [
"MyGUI_UString", #ignore warnings from MyGUI_UString, b... | # run from root sources directory: python Scripts/cppcheck/cppcheck.py
import os
ignoredEndings = [
"It is safe to deallocate a NULL pointer",
"Throwing exception in destructor",
"::initialise' can be const.",
"::shutdown' can be const."
]
ignoredContent = [
"MyGUI_UString", #ignore warnings from MyGUI_UString, b... | mit | Python |
1f1ef4cf1b21cd55d93fea545c3c9acc2d3060c0 | Add getExpandedPath to baseplayer/dummyplayer | alby128/syncplay,alby128/syncplay,Syncplay/syncplay,Syncplay/syncplay,NeverDecaf/syncplay,NeverDecaf/syncplay | syncplay/players/basePlayer.py | syncplay/players/basePlayer.py | from syncplay import constants
class BasePlayer(object):
'''
This method is supposed to
execute updatePlayerStatus(paused, position) on client
Given the arguments: boolean paused and float position in seconds
'''
def askForStatus(self):
raise NotImplementedError()
''... | from syncplay import constants
class BasePlayer(object):
'''
This method is supposed to
execute updatePlayerStatus(paused, position) on client
Given the arguments: boolean paused and float position in seconds
'''
def askForStatus(self):
raise NotImplementedError()
''... | apache-2.0 | Python |
83d7b3604203bbe93efe0a6043051f182af581ac | Fix test | cupy/cupy,cupy/cupy,cupy/cupy,cupy/cupy | tests/cupy_tests/sorting_tests/test_count.py | tests/cupy_tests/sorting_tests/test_count.py | import unittest
import numpy
import six
import cupy
from cupy import testing
@testing.gpu
class TestCount(unittest.TestCase):
_multiprocess_can_split_ = True
@testing.for_all_dtypes()
def test_count_nonzero(self, dtype):
def func(xp):
m = testing.shaped_random((2, 3), xp, xp.bool_)... | import unittest
import numpy
import six
import cupy
from cupy import testing
@testing.gpu
class TestCount(unittest.TestCase):
_multiprocess_can_split_ = True
@testing.for_all_dtypes()
def test_count_nonzero(self, dtype):
def func(xp):
m = testing.shaped_random((2, 3), xp, xp.bool_)... | mit | Python |
fc89de5737e123fabc7aaca8feb8fff2119158c4 | Fix run_cmd and scan regex | sjktje/sjkscan,sjktje/sjkscan | scan.py | scan.py | #!/usr/bin/env python
# encoding: utf-8
import os
import subprocess
from wand.image import Image
def run_cmd(args):
"""Run shell command and return its output."""
if isinstance(args, list):
args = ' '.join(args)
print("Running: {}".format(args))
try:
result = subprocess.check_outp... | #!/usr/bin/env python
# encoding: utf-8
import os
import subprocess
from wand.image import Image
def run_cmd(args):
"""Run shell command."""
if isinstance(args, list):
args = ' '.join(args)
subprocess.run(args, stderr=subprocess.STDOUT, shell=True)
def scan(output_directory):
"""Run scan... | bsd-2-clause | Python |
6020bad922bcb3d7c818f7f671132b9574a2b3ec | Remove redundant parenthesis | Rhumbix/django-request-logging,rhumbixsf/django-request-logging,steven-lee-qadium/django-request-logging | request_logging/middleware.py | request_logging/middleware.py | import logging
import re
from django.utils.termcolors import colorize
from django.utils.deprecation import MiddlewareMixin
MAX_BODY_LENGTH = 50000 # log no more than 3k bytes of content
request_logger = logging.getLogger('django.request')
class LoggingMiddleware(MiddlewareMixin):
def process_request(self, requ... | import logging
import re
from django.utils.termcolors import colorize
from django.utils.deprecation import MiddlewareMixin
MAX_BODY_LENGTH = 50000 # log no more than 3k bytes of content
request_logger = logging.getLogger('django.request')
class LoggingMiddleware(MiddlewareMixin):
def process_request(self, requ... | mit | Python |
01a41b7c49af375f06b6c9513874b91c72965ebf | Convert dashes in group names to underscores in the inheritance chain lookup plugin. | galaxyproject/ansible-common-roles,galaxyproject/ansible-common-roles | lookup_plugins/inheritance_chain.py | lookup_plugins/inheritance_chain.py | from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = """
"""
EXAMPLES = """
"""
RETURN = """
"""
from ansible.errors import AnsibleError
from ansible.plugins.lookup import LookupBase
try:
from __main__ import display
except ImportError:
from ansible.util... | from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = """
"""
EXAMPLES = """
"""
RETURN = """
"""
from ansible.errors import AnsibleError
from ansible.plugins.lookup import LookupBase
try:
from __main__ import display
except ImportError:
from ansible.util... | mit | Python |
238578d41beec33d7428cb53d79fc21c028cfc87 | Use auto_register's filter_func to filter tests | moyogo/fontbakery,moyogo/fontbakery,googlefonts/fontbakery,googlefonts/fontbakery,moyogo/fontbakery,graphicore/fontbakery,graphicore/fontbakery,graphicore/fontbakery,googlefonts/fontbakery | tests/specifications/external_spec_test.py | tests/specifications/external_spec_test.py | from fontbakery.checkrunner import Section
from fontbakery.fonts_spec import spec_factory
def check_filter(item_type, item_id, item):
if item_type == "check" and item_id in (
"com.google.fonts/check/035", # ftxvalidator
"com.google.fonts/check/036", # ots-sanitize
"com.google.fonts/check/037", ... | from fontbakery.checkrunner import Section
from fontbakery.fonts_spec import spec_factory
def check_filter(checkid, font=None, **iterargs):
if checkid in (
"com.google.fonts/check/035", # ftxvalidator
"com.google.fonts/check/036", # ots-sanitize
"com.google.fonts/check/037", # Font Validator
... | apache-2.0 | Python |
a7be90536618ac52c91f599bb167e05f831cddfb | Add possibilty to get ResultMessage | chocopoche/mangopay2-python-sdk,Mangopay/mangopay2-python-sdk | mangopaysdk/entities/transaction.py | mangopaysdk/entities/transaction.py | from mangopaysdk.entities.entitybase import EntityBase
from mangopaysdk.types.money import Money
class Transaction (EntityBase):
"""Transaction entity.
Base class for: PayIn, PayOut, Transfer.
"""
def __init__(self, id = None):
self.AuthorId = None
self.CreditedUserId = None
#... | from mangopaysdk.entities.entitybase import EntityBase
from mangopaysdk.types.money import Money
class Transaction (EntityBase):
"""Transaction entity.
Base class for: PayIn, PayOut, Transfer.
"""
def __init__(self, id = None):
self.AuthorId = None
self.CreditedUserId = None
#... | mit | Python |
95166d44eac63a8d1b2a24c3daa491ff20af04b0 | Add Tests for CrudActions.get_all_actions | Aplopio/rip,Aplopio/django_rip | tests/unit_tests/crud/test_crud_actions.py | tests/unit_tests/crud/test_crud_actions.py | import unittest
from rip.crud.crud_actions import CrudActions
class TestResolveAction(unittest.TestCase):
def test_should_resolve_read_detail(self):
assert CrudActions.resolve_action(
'read_detail') == CrudActions.READ_DETAIL
def test_should_resolve_read_list(self):
assert CrudAc... | import unittest
from rip.crud.crud_actions import CrudActions
class TestSomething(unittest.TestCase):
def test_should_resolve_read_detail(self):
assert CrudActions.resolve_action(
'read_detail') == CrudActions.READ_DETAIL
def test_should_resolve_read_list(self):
assert CrudAction... | mit | Python |
2fa97af5a2eb44b499e25e902a61942eab4d8624 | Add local_asn unit tests | BRCDcomm/pynos,brocade/pynos,SivagnanamCiena/pynos | tests/versions/ver_6/ver_6_0_1/test_bgp.py | tests/versions/ver_6/ver_6_0_1/test_bgp.py | #!/usr/bin/env python
"""
Copyright 2015 Brocade Communications Inc.
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... | apache-2.0 | Python | |
4659e03dbd1629675d16a8afa377f4ad8d62aeab | Use Pin 12 (GPIO 18) for fancontrol. | timami/stratux,timami/stratux,westphae/stratux,lukepalmer/stratux,lukepalmer/stratux,ssokol/stratux,lukepalmer/stratux,westphae/stratux,ssokol/stratux,timami/stratux,westphae/stratux,timami/PlaneSense,cyoung/stratux,timami/PlaneSense,cyoung/stratux,timami/PlaneSense,cyoung/stratux,cyoung/stratux,timami/stratux,jpoirier... | image/fancontrol.py | image/fancontrol.py | #!/usr/bin/python
# @Author Ryan Dewsbury (helno)
#
# This script throttles a fan based on CPU temperature.
#
# It expects a fan that's externally powered, and uses GPIO pin 11 for control.
import RPi.GPIO as GPIO``
import time
import os
from daemon import runner
class FanControl():
# Return CPU temperature as f... | #!/usr/bin/python
# @Author Ryan Dewsbury (helno)
#
# This script throttles a fan based on CPU temperature.
#
# It expects a fan that's externally powered, and uses GPIO pin 11 for control.
import RPi.GPIO as GPIO
import time
import os
from daemon import runner
class FanControl():
# Return CPU temperature as flo... | bsd-3-clause | Python |
52ef755debfddcef165925829878f9c3e4243398 | Add test_data_too_old_with_custom_threshold - customize INDEX_DIGEST_DATA_TOO_OLD_THRESHOLD_DAYS | macbre/index-digest,macbre/index-digest | indexdigest/test/linters/test_0028_data_too_old.py | indexdigest/test/linters/test_0028_data_too_old.py | from __future__ import print_function
from unittest import TestCase
from indexdigest.database import Database
from indexdigest.linters.linter_0028_data_too_old import check_data_too_old
from indexdigest.test import DatabaseTestMixin
class LimitedViewDatabase(Database, DatabaseTestMixin):
"""
Limit test to t... | from __future__ import print_function
from unittest import TestCase
from indexdigest.database import Database
from indexdigest.linters.linter_0028_data_too_old import check_data_too_old
from indexdigest.test import DatabaseTestMixin
class LimitedViewDatabase(Database, DatabaseTestMixin):
"""
Limit test to t... | mit | Python |
48cd8cd536379128d4d4067c32c7f900b66a9824 | Return 503 when no data is present | purrcat259/thargoid-search-tools,purrcat259/thargoid-search-tools | unknown-sites-body-data/api.py | unknown-sites-body-data/api.py | import argparse
from flask import Flask, jsonify, request
from flask import json, abort
from gevent.pywsgi import WSGIServer
from flask_cors import CORS
app = Flask(__name__)
CORS(app)
site_data = {}
data_file_path = 'us_data.json'
def load_data():
with open(data_file_path, 'r') as data_file:
global sit... | import argparse
from flask import Flask, jsonify, request
from flask import json
from gevent.pywsgi import WSGIServer
from flask_cors import CORS
app = Flask(__name__)
CORS(app)
site_data = {}
data_file_path = 'us_data.json'
def load_data():
with open(data_file_path, 'r') as data_file:
global site_data
... | mit | Python |
a0e5cafed1ba206e20060ee464d8003b24891422 | Support for old style base36 password reset links | incuna/incuna-auth,incuna/incuna-auth,ghickman/incuna-auth,ghickman/incuna-auth | incuna_auth/urls.py | incuna_auth/urls.py | from django.conf import settings
from django.conf.urls import patterns, url
from django.core.urlresolvers import get_callable, reverse_lazy
from django.utils.translation import ugettext_lazy as _
from django.views.generic import RedirectView
auth_form = get_callable(getattr(settings, 'INCUNA_AUTH_LOGIN_FORM', 'incuna... | from django.conf import settings
from django.conf.urls import patterns, url
from django.core.urlresolvers import get_callable, reverse_lazy
from django.utils.translation import ugettext_lazy as _
from django.views.generic import RedirectView
auth_form = get_callable(getattr(settings, 'INCUNA_AUTH_LOGIN_FORM', 'incuna... | bsd-2-clause | Python |
c2a257cda3d2de88a644860a94e270dda2ec9d49 | Clarify documentation | jupyterhub/kubespawner | kubespawner/clients.py | kubespawner/clients.py | """Shared clients for kubernetes
avoids creating multiple kubernetes client objects,
each of which spawns an unused max-size thread pool
"""
import weakref
from unittest.mock import Mock
import kubernetes_asyncio.client
from kubernetes_asyncio.client import api_client
from kubernetes_asyncio.client import Configurati... | """Shared clients for kubernetes
avoids creating multiple kubernetes client objects,
each of which spawns an unused max-size thread pool
"""
import weakref
from unittest.mock import Mock
import kubernetes_asyncio.client
from kubernetes_asyncio.client import api_client
from kubernetes_asyncio.client import Configurati... | bsd-3-clause | Python |
1a9c5c6cee3b8c31d92ab0949fc312907adf6611 | Fix ConnectedSWFObject: pass default value to pop() | botify-labs/python-simple-workflow,botify-labs/python-simple-workflow | swf/core.py | swf/core.py | # -*- coding:utf-8 -*-
# Copyright (c) 2013, Theo Crevon
# Copyright (c) 2013, Greg Leclercq
#
# See the file LICENSE for copying permission.
import boto.swf
from . import settings
SETTINGS = settings.get()
class ConnectedSWFObject(object):
"""Authenticated object interface
Provides the instance attribu... | # -*- coding:utf-8 -*-
# Copyright (c) 2013, Theo Crevon
# Copyright (c) 2013, Greg Leclercq
#
# See the file LICENSE for copying permission.
import boto.swf
from . import settings
SETTINGS = settings.get()
class ConnectedSWFObject(object):
"""Authenticated object interface
Provides the instance attribu... | mit | Python |
3cacced39d9cb8bd5d6a2b3db8aa4b5aa1b37f58 | Allow attribute to be customized in TagRegistered | jaraco/jaraco.classes | jaraco/util/meta.py | jaraco/util/meta.py | """
meta.py
Some useful metaclasses.
"""
from __future__ import unicode_literals
class LeafClassesMeta(type):
"""
A metaclass for classes that keeps track of all of them that
aren't base classes.
"""
_leaf_classes = set()
def __init__(cls, name, bases, attrs):
if not hasattr(cls, '_leaf_classes'):
cls._... | """
meta.py
Some useful metaclasses.
"""
from __future__ import unicode_literals
class LeafClassesMeta(type):
"""
A metaclass for classes that keeps track of all of them that
aren't base classes.
"""
_leaf_classes = set()
def __init__(cls, name, bases, attrs):
if not hasattr(cls, '_leaf_classes'):
cls._... | mit | Python |
f0c6cca76604c10952d45fad11d4610bf496c75b | fix key name | CartoDB/crankshaft,CartoDB/crankshaft | src/py/crankshaft/test/test_clustering_kmeans.py | src/py/crankshaft/test/test_clustering_kmeans.py | import unittest
import numpy as np
# from mock_plpy import MockPlPy
# plpy = MockPlPy()
#
# import sys
# sys.modules['plpy'] = plpy
from helper import plpy, fixture_file
import crankshaft.clustering as cc
import json
class KMeansTest(unittest.TestCase):
"""Testing class for k-means spatial"""
def setUp(sel... | import unittest
import numpy as np
# from mock_plpy import MockPlPy
# plpy = MockPlPy()
#
# import sys
# sys.modules['plpy'] = plpy
from helper import plpy, fixture_file
import crankshaft.clustering as cc
import json
class KMeansTest(unittest.TestCase):
"""Testing class for k-means spatial"""
def setUp(sel... | bsd-3-clause | Python |
16cf2c8e4cab2fe9e034dc45fcb7a3802a28ed3c | solve metaclass conflict | Ensembl/ensembl-compara,Ensembl/ensembl-compara,Ensembl/ensembl-compara,Ensembl/ensembl-compara,Ensembl/ensembl-compara,Ensembl/ensembl-compara,Ensembl/ensembl-compara,Ensembl/ensembl-compara | src/python/lib/ensembl/compara/citest/_citest.py | src/python/lib/ensembl/compara/citest/_citest.py | """
Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
Copyright [2016-2020] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of... | """
Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
Copyright [2016-2020] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of... | apache-2.0 | Python |
40c254164556f49c67babfc81693a7bdfdd718d8 | Fix broken mesos python tests. | medallia/aurora,mkhutornenko/incubator-aurora,rosmo/aurora,rosmo/aurora,mschenck/aurora,rdelval/aurora,protochron/aurora,thinker0/aurora,rdelval/aurora,rdelval/aurora,medallia/aurora,mschenck/aurora,wfarner/aurora,kidaa/aurora,crashlytics/aurora,shahankhatch/aurora,thinker0/aurora,crashlytics/aurora,mkhutornenko/incuba... | src/python/twitter/mesos/parsers/mesos_thrift.py | src/python/twitter/mesos/parsers/mesos_thrift.py | import copy
import getpass
from gen.twitter.mesos.ttypes import (
CronCollisionPolicy,
Identity,
JobConfiguration,
TwitterTaskInfo,
)
from .base import EntityParser, ThriftCodec
def convert(config):
"""
Convert a Mesos job dictionary (config) to Thrift. The dictionary
should be validated and have ... | import copy
import getpass
from gen.twitter.mesos.ttypes import (
CronCollisionPolicy,
Identity,
JobConfiguration,
TwitterTaskInfo,
)
from .base import EntityParser, ThriftCodec
def convert(config):
"""
Convert a Mesos job dictionary (config) to Thrift. The dictionary
should be validated and have ... | apache-2.0 | Python |
8bdd24d1dd1db5073af0ce013ddd5938dbe15a8f | fix python path | StanfordHCI/termite,BillmanH/termite,kkintaro/termite,StanfordHCI/termite,StanfordHCI/termite,BillmanH/termite,kkintaro/termite,BillmanH/termite,kkintaro/termite,kkintaro/termite,BillmanH/termite | stmt-0.4.0/generate-label-term-distributions.py | stmt-0.4.0/generate-label-term-distributions.py | #!/usr/bin/X11/python
import argparse
import re
parser = argparse.ArgumentParser( description = 'Generate label-term-distributions.csv from topic-term-distributions.csv.' )
parser.add_argument( 'path', type = str, help = 'Path of STMT model output' )
args = parser.parse_args()
path = args.path
######################... | #!/u/jcchuang/python/bin/python
import argparse
import re
parser = argparse.ArgumentParser( description = 'Generate label-term-distributions.csv from topic-term-distributions.csv.' )
parser.add_argument( 'path', type = str, help = 'Path of STMT model output' )
args = parser.parse_args()
path = args.path
############... | bsd-3-clause | Python |
5f9f270a657de427ba031ef7bd34ab0df2265c1c | add bitcoin module | risteon/i3_config,risteon/i3_config | .i3/pystatus_conf.py | .i3/pystatus_conf.py | from i3pystatus import Status
status = Status()
# Displays clock like this:
# Tue 30 Jul 11:59:46 PM KW31
# ^-- calendar week
status.register("clock",
format="%a %-d %b %X KW%V",)
# Shows the average load of the last minute and the last 5 minutes
# (the default value for format is used)
... | from i3pystatus import Status
status = Status()
# Displays clock like this:
# Tue 30 Jul 11:59:46 PM KW31
# ^-- calendar week
status.register("clock",
format="%a %-d %b %X KW%V",)
# Shows the average load of the last minute and the last 5 minutes
# (the default value for format is used)
... | mit | Python |
7b6838ea292e011f96f5212992d00c1009e1f6b2 | Add better instructions to the Gitter example | gunthercox/ChatterBot,vkosuri/ChatterBot | examples/gitter_example.py | examples/gitter_example.py | # -*- coding: utf-8 -*-
from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer
from settings import GITTER
# Uncomment the following lines to enable verbose logging
# import logging
# logging.basicConfig(level=logging.INFO)
'''
To use this example, create a new file called settings.p... | # -*- coding: utf-8 -*-
from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer
from settings import GITTER
# Uncomment the following lines to enable verbose logging
# import logging
# logging.basicConfig(level=logging.INFO)
chatbot = ChatBot(
'GitterBot',
gitter_room=GITTER['... | bsd-3-clause | Python |
b418a74aab5072133dcf5e4819e499f39a0ef1d7 | Update version for PyTorch KFP components 0.1.0.rc-1 release (#5823) | kubeflow/pipelines,kubeflow/pipelines,kubeflow/pipelines,kubeflow/pipelines,kubeflow/pipelines,kubeflow/pipelines | components/PyTorch/pytorch-kfp-components/pytorch_kfp_components/__init__.py | components/PyTorch/pytorch-kfp-components/pytorch_kfp_components/__init__.py | #!/usr/bin/env python3
#
# Copyright (c) Facebook, Inc. and its affiliates.
# 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... | #!/usr/bin/env python3
#
# Copyright (c) Facebook, Inc. and its affiliates.
# 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... | apache-2.0 | Python |
3d5ae7e6f9aadf005f5a7e2b4bd326c78c026c82 | fix up integration tests | cablehead/vanilla | tests/integration/test_http.py | tests/integration/test_http.py | import json
import time
import os
import vanilla
def test_HTTPClient():
# TODO: Just using httpbin until the HTTP Server side of Vanilla is cleaned
# up. There should be an integration suite that could still use httpbin.
h = vanilla.Hub()
conn = h.http.connect('http://httpbin.org')
get1 = conn... | import json
import time
import os
import vanilla
def test_HTTPClient():
# TODO: Just using httpbin until the HTTP Server side of Vanilla is cleaned
# up. There should be an integration suite that could still use httpbin.
h = vanilla.Hub()
conn = h.http.connect('http://httpbin.org')
get1 = conn... | mit | Python |
4ad3681864bfc9f551040fa5c62ffe16e5110214 | Fix unicode in Python 2.7 | radish-bdd/radish,radish-bdd/radish | tests/integration/test_main.py | tests/integration/test_main.py | # -*- coding: utf-8 -*-
"""
radish
~~~~~~
Behavior Driven Development tool for Python - the root from red to green
Copyright: MIT, Timo Furrer <tuxtimo@gmail.com>
"""
import os
import sys
import tempfile
import pytest
from radish.main import main
@pytest.mark.parametrize('given_featurefiles, giv... | # -*- coding: utf-8 -*-
"""
radish
~~~~~~
Behavior Driven Development tool for Python - the root from red to green
Copyright: MIT, Timo Furrer <tuxtimo@gmail.com>
"""
from __future__ import unicode_literals
import os
import sys
import tempfile
import pytest
from radish.main import main
@pytest.... | mit | Python |
260a5601a9b2990374d2f97d92898236e0b9342e | Add diversity to test script | jitseniesen/spyder-memory-profiler,jitseniesen/spyder-memory-profiler,Nodd/spyder_line_profiler,spyder-ide/spyder.line_profiler,spyder-ide/spyder.memory_profiler,spyder-ide/spyder.line-profiler,Nodd/spyder.line_profiler | tests/profiling_test_script.py | tests/profiling_test_script.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
u"""
:author: Joseph Martinot-Lagarde
Created on Sat Jan 19 14:57:57 2013
"""
from __future__ import (
print_function, division, unicode_literals, absolute_import)
import subdir.profiling_test_script2 as script2
@profile
def fact(n):
result = 1
for i in xrange... | #!/usr/bin/python
# -*- coding: utf-8 -*-
u"""
:author: Joseph Martinot-Lagarde
Created on Sat Jan 19 14:57:57 2013
"""
from __future__ import (
print_function, division, unicode_literals, absolute_import)
import subdir.profiling_test_script2 as script2
@profile
def fact(n):
result = 1
for i in xrange... | mit | Python |
880990d8a6abee9068a4f32c17a766721737508a | Implement vil -> NumPy test | mathstuf/sprokit,mathstuf/sprokit,linus-sherrill/sprokit,mathstuf/sprokit,linus-sherrill/sprokit,Kitware/sprokit,linus-sherrill/sprokit,mathstuf/sprokit,Kitware/sprokit,linus-sherrill/sprokit,Kitware/sprokit,Kitware/sprokit | tests/python/image/test-vil.py | tests/python/image/test-vil.py | #!/usr/bin/env python
#ckwg +5
# Copyright 2011 by Kitware, Inc. All Rights Reserved. Please refer to
# KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
# Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.
def log(msg):
import sys
sys.stderr.write("%s\n" % msg)
def ensure_e... | #!/usr/bin/env python
#ckwg +5
# Copyright 2011 by Kitware, Inc. All Rights Reserved. Please refer to
# KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
# Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.
def log(msg):
import sys
sys.stderr.write("%s\n" % msg)
def ensure_e... | bsd-3-clause | Python |
36e305868ec41cf8417c0a892dcf5d1b5cf7f4b9 | use datetime in fb tests, closes #93 | nprapps/graeae,nprapps/graeae,nprapps/graeae,nprapps/graeae | tests/test_facebook_scraper.py | tests/test_facebook_scraper.py | #!/usr/bin/env python
import unittest
import app_config
from datetime import datetime
from scrapers.facebook import FacebookScraper
class TestScrapeFacebook(unittest.TestCase):
def setUp(self):
self.scraper = FacebookScraper()
self.posts = self.scraper.scrape_facebook(
profile_filenam... | #!/usr/bin/env python
import unittest
import app_config
from scrapers.facebook import FacebookScraper
class TestScrapeFacebook(unittest.TestCase):
def setUp(self):
self.scraper = FacebookScraper()
self.posts = self.scraper.scrape_facebook(
profile_filename='tests/snapshots/fb-profile-... | mit | Python |
dea236b089572e61fb813096bbaadbc19361880b | Update betasigma test. | jason-neal/companion_simulations,jason-neal/companion_simulations | tests/utilities/test_errors.py | tests/utilities/test_errors.py | import pytest
from mingle.utilities.errors import get_snrinfo, spectrum_error
@pytest.mark.parametrize("star, obsnum, chip", [
("HD30501", "1", "1"),
("HD30501", 1, 1),
])
def test_get_snrinfo(star, obsnum, chip):
# Has value of 200 and length one
assert len(get_snrinfo(star, obsnum, chip)) == 1
... | import pytest
from mingle.utilities.errors import get_snrinfo, spectrum_error
@pytest.mark.parametrize("star, obsnum, chip", [
("HD30501", "1", "1"),
("HD30501", 1, 1),
])
def test_get_snrinfo(star, obsnum, chip):
# Has value of 200 and length one
assert len(get_snrinfo(star, obsnum, chip)) == 1
... | mit | Python |
8149b9a6e221ea7c1e5aac084a78f8aa56a4317d | Integrate LLVM at llvm/llvm-project@76f734040a54 | tensorflow/tensorflow-pywrap_tf_optimizer,frreiss/tensorflow-fred,paolodedios/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,frreiss/tensorflow-fred,yongtang/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,paolodedios/... | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "76f734040a54622b847729e5acb4480e667d2c74"
LLVM_SHA256 = "28589869f5ae24e7ac1c7324e6965b4751c4823f306ebce8276c23cb84b9bc73"
tf_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "745758acf3c295e3bf9f9dd283a3568c912a1827"
LLVM_SHA256 = "d427c3991c73a628be7b2631ace3d2741fb80df4f5aed731fd771b543b6485a4"
tf_http_archive(
... | apache-2.0 | Python |
6d963f4cfe7631e7b3c217c2d9d5b4a912a77cb8 | Integrate LLVM at llvm/llvm-project@43dc6d5d57d7 | yongtang/tensorflow,gautam1858/tensorflow,yongtang/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-tensorflow/tensorflow,gautam1858/tensorflow,Intel-Corporation/tensorflow,yongtang/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,paolodedios/tensorflow,gautam1858/tensorflow,yongtang/t... | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "43dc6d5d57d7e24d6d965ceac9fa9d292322d922"
LLVM_SHA256 = "bda3e4f4d0b88a87a515ba7077c0fcd9a9cf0eed7a7ee6b3bef2a44ac862ed43"
tf_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "7e1dc12f440b2d4aef71d790be94c65d7e2b86a2"
LLVM_SHA256 = "cffc5f9aca759756a59b77d6c8bc9f2c0c64216c003ce4a8891d4150c556e655"
tf_http_archive(
... | apache-2.0 | Python |
ffc45a7a8e9aad214de9e6f4dca8ef462fa221c4 | Integrate LLVM at llvm/llvm-project@ff1374785f82 | yongtang/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow,yongtang/tensorflow,tensorflow/tensorflow,paolodedios/tensorflow,yongtang/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow,t... | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "ff1374785f82c2c184df7ca09a923acf62e4c277"
LLVM_SHA256 = "01d45f9a6ab6dc44ff1dad953ebace1b9819867749a7767c777485bb3199e844"
tf_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "0ecbb683a2faf0ec5bcb9eb472ebd9921cbe683a"
LLVM_SHA256 = "a4a9d16986411836e09ab6d6cf8b41ea2956fbce7000392feb6187c08f6725ae"
tf_http_archive(
... | apache-2.0 | Python |
ed6f666ac14b939d7303607c950b88b7d5607c46 | Integrate LLVM at llvm/llvm-project@d38b9f1f31b1 | tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "d38b9f1f31b1fa8ee885cfcd4ee7bd69771088c8"
LLVM_SHA256 = "4dac2be3c82bedd137b60b77ffb36ac203c2a2209278d589db6326e6a8fee499"
tfrt_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "8e22539067d9376c4f808b25f543feba728d40c9"
LLVM_SHA256 = "db0a7099e6e1eacbb51338f0b18c237be7354c25e8126c523390bef965a9b6f6"
tfrt_http_archive(
... | apache-2.0 | Python |
eff4bafc41909840d9d2df688940850aa57b14df | Integrate LLVM at llvm/llvm-project@7bb1151ba21e | tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "7bb1151ba21e26d91ddaa83177bb58b4d1c36710"
LLVM_SHA256 = "432b86468e31d80c05f0e5d0f97856293f3ba778d2f763287981a8d80c099267"
tfrt_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "59179d72b2e3d3b99ebc342374c9c797d526ac5d"
LLVM_SHA256 = "f5de1f4b9bcdacd0cad64f55ab4123d1144cc4e679fc17db91b66137b9836b11"
tfrt_http_archive(
... | apache-2.0 | Python |
5e2dd194fc7d6e61f2dd50ffaf497309ee47f7f2 | Integrate LLVM at llvm/llvm-project@42861faa8e17 | tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow,karllessard/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-pywrap_saved_model,yongtang/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tens... | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "42861faa8e17058f0b4a027bba13ef59a600e051"
LLVM_SHA256 = "4679e0cdd2113f518d68127b72c4e77bc4db2764db3b8761164e650f1d7c80a7"
tf_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "5cb14dc5a3a6bcd0f6ca1e56a36ab0d7c4b0b202"
LLVM_SHA256 = "29cf8cbc0ef4818e7d80c67490481303149e5d0d875202934c11f6eb10876ea8"
tf_http_archive(
... | apache-2.0 | Python |
e15b3cbe06a27575db1d5d16052a8deb85fc4504 | Integrate LLVM at llvm/llvm-project@b6fef0885333 | tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "b6fef088533376e16ca6b47f87c6c50f6f6cd014"
LLVM_SHA256 = "f2a269f4c54f9c0aaad23126564680cdd729e365c36d290ac4dc213b555a0e9a"
tfrt_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "0a715c114686806193878e876ed3d50144138263"
LLVM_SHA256 = "b7c468b570cf079b22cc05bd248008cdf732936598efbc5893b583a7c508e9dc"
tfrt_http_archive(
... | apache-2.0 | Python |
e90ab62ccd0f314be89b9d8a430c1720c6000f92 | Update tk2_label_button.py | wangwei7175878/tutorials | tkinterTUT/tk2_label_button.py | tkinterTUT/tk2_label_button.py | # View more python learning tutorial on my Youtube and Youku channel!!!
# Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg
# Youku video tutorial: http://i.youku.com/pythontutorial
import tkinter as tk
window = tk.Tk()
window.title('my window')
window.geometry('200x100')
var = tk.Str... | import tkinter as tk
window = tk.Tk()
window.title('my window')
window.geometry('200x100')
var = tk.StringVar()
l = tk.Label(window, textvariable=var, bg='green', font=('Arial', 12), width=15,
height=2)
#l = tk.Label(root, text='OMG! this is TK!', bg='green', font=('Arial', 12), width=15, height=2)
l.pac... | mit | Python |
99099d680c774c0cafcff50d37a1d1d62b4847ae | Add __all__ to datasets __init__.py | pytorch/text,pytorch/text,pytorch/text,pytorch/text | torchtext/datasets/__init__.py | torchtext/datasets/__init__.py | from .language_modeling import LanguageModelingDataset, WikiText2
from .snli import SNLI
from .sentiment import SST
from .translation import TranslationDataset
__all__ = ['LanguageModelingDataset',
'SNLI',
'SST',
'TranslationDataset',
'WikiText2']
| from .language_modeling import LanguageModelingDataset
from .language_modeling import WikiText2
from .snli import SNLI
from .sentiment import SST
from .translation import TranslationDataset
| bsd-3-clause | Python |
87c5d93fbd59f67c03daf5d3ebd60af4106159af | Set app_name and view names in urls.py (#4) | szopu/django-rest-registration,szopu/django-rest-registration | rest_registration/api/urls.py | rest_registration/api/urls.py | from django.conf.urls import url
from .views import (
change_password,
login,
logout,
profile,
register,
register_email,
reset_password,
send_reset_password_link,
verify_email,
verify_registration
)
app_name = 'rest_registration'
urlpatterns = [
url('register/$', register, ... | from django.conf.urls import url
from .views import (
change_password,
login,
logout,
profile,
register,
register_email,
reset_password,
send_reset_password_link,
verify_email,
verify_registration
)
urlpatterns = [
url('register/$', register),
url('verify-registration/$... | mit | Python |
a85ebf2b3dfb3cb9a4a37cb4c00ed0d4697d20f8 | insert nil into COMMIT_ID when not exist .git | linear-rpc/linear-cpp,linear-rpc/linear-cpp,linear-rpc/linear-cpp,linear-rpc/linear-cpp | tools/create_version_h.py | tools/create_version_h.py | #!/usr/bin/env python
from create_header import do_replace
import optparse
import re
import string
import subprocess
import sys
# for creating version.h
GET_COMMIT_ID = 'gite log --pretty=format:%H -1'
VERSION_ID_KEY = '@LINEAR_VERSION_ID@'
COMMIT_ID_KEY = '@LINEAR_COMMIT_ID@'
_usage = 'usage: %prog [options]'
def... | #!/usr/bin/env python
from create_header import do_replace
import optparse
import re
import string
import subprocess
import sys
# for creating version.h
GET_COMMIT_ID = 'git log --pretty=format:%H -1'
VERSION_ID_KEY = '@LINEAR_VERSION_ID@'
COMMIT_ID_KEY = '@LINEAR_COMMIT_ID@'
_usage = 'usage: %prog [options]'
def ... | mit | Python |
e4d9f24aeb6b73a7508177fb549ff9febaaef7de | Fix typo that by chance didn’t actually have any impact on code | astrofrog/glue-vispy-viewers,PennyQ/astro-vispy,glue-viz/glue-vispy-viewers,astrofrog/glue-3d-viewer,glue-viz/glue-3d-viewer,PennyQ/glue-3d-viewer | glue_vispy_viewers/scatter/scatter_viewer.py | glue_vispy_viewers/scatter/scatter_viewer.py | from ..common.vispy_data_viewer import BaseVispyViewer
from .layer_artist import ScatterLayerArtist
from .layer_style_widget import ScatterLayerStyleWidget
from .scatter_toolbar import ScatterSelectionToolbar
class VispyScatterViewer(BaseVispyViewer):
LABEL = "3D Scatter Plot"
_layer_style_widget_cls = Scatt... | from ..common.vispy_data_viewer import BaseVispyViewer
from .layer_artist import ScatterLayerArtist
from .layer_style_widget import ScatterLayerStyleWidget
from .scatter_toolbar import ScatterSelectionToolbar
class VispyScatterViewer(BaseVispyViewer):
LABEL = "3D Scatter Plot"
_layer_style_widget_cls = Scatt... | bsd-2-clause | Python |
bdd27ec902e58e59638bba7a760ae87b999636ff | add UDP_procCommand() | yasokada/python-160423_footInput | footInput.py | footInput.py | #!/usr/bin/env python
'''
v0.4 2016 Apr 24
- add UDP_procCommand()
v0.3 2016 Apr 23
- add UDP_recvData()
- add UDP_setup()
- add GPIO_setup()
v0.2 2016 Apr 23
- define main()
- change interval to 10 msec base for UDP comm
v0.1 2016 Apr 23
- can check 5 GPIO input
'''
import RPi.GPIO as GPIO
import socke... | #!/usr/bin/env python
'''
v0.3 2016 Apr 23
- add UDP_recvData()
- add UDP_setup()
- add GPIO_setup()
v0.2 2016 Apr 23
- define main()
- change interval to 10 msec base for UDP comm
v0.1 2016 Apr 23
- can check 5 GPIO input
'''
import RPi.GPIO as GPIO
import socket
import time
import os
ins = [40, 38, 36,... | mit | Python |
772517026a31265048d7898748b5dff0c44c12fd | change gravatar size to 80x80 | slava-sh/messenger,slava-sh/messenger,slava-sh/messenger,slava-sh/messenger | web/api/utils.py | web/api/utils.py | import hashlib
GRAVATAR_URL_TEMPLATE = 'https://www.gravatar.com/avatar/{hash}?s={size}'
def gravatar_url(email, size=80):
hash = hashlib.md5(email.lower().encode()).hexdigest()
return GRAVATAR_URL_TEMPLATE.format(hash=hash, size=size)
| import hashlib
GRAVATAR_URL_TEMPLATE = 'https://www.gravatar.com/avatar/{hash}?s={size}'
def gravatar_url(email, size=40):
hash = hashlib.md5(email.lower().encode()).hexdigest()
return GRAVATAR_URL_TEMPLATE.format(hash=hash, size=size)
| mit | Python |
bbc3706eb412d853f0fa683ccdeea17ad4e9ce15 | update example with index name | asrozar/perception | app/config/configuration-example.py | app/config/configuration-example.py | # ------------------
# Configuration File
# ------------------
# -------------
# Database Info
# -------------
db_drivername = 'postgres'
db_host = 'localhost'
database = 'perceptiondb'
db_username = 'perception'
db_password = 'perception_password'
# ----------------
# Application Info
# ----------------
discovery_mo... | # ------------------
# Configuration File
# ------------------
# -------------
# Database Info
# -------------
db_drivername = 'postgres'
db_host = 'localhost'
database = 'perceptiondb'
db_username = 'perception'
db_password = 'perception_password'
# ----------------
# Application Info
# ----------------
discovery_mo... | mit | Python |
0428193098d9dcf6e374bbe424c81e362d48067a | adjust MVGD id to get same MVGD as before (old id=3545) | openego/dingo,openego/dingo | ding0/examples/example_single_grid_district.py | ding0/examples/example_single_grid_district.py | #!/usr/bin/env python3
"""This file is part of DING0, the DIstribution Network GeneratOr.
DING0 is a tool to generate synthetic medium and low voltage power
distribution grids based on open data.
It is developed in the project open_eGo: https://openegoproject.wordpress.com
DING0 lives at github: https://github.com/o... | #!/usr/bin/env python3
"""This file is part of DING0, the DIstribution Network GeneratOr.
DING0 is a tool to generate synthetic medium and low voltage power
distribution grids based on open data.
It is developed in the project open_eGo: https://openegoproject.wordpress.com
DING0 lives at github: https://github.com/o... | agpl-3.0 | Python |
c0db57b52aa0546fd6f7a2cf4fc0242cbcf76537 | Fix the test bot's TPB initialization | karan/TPB,karan/TPB | test_bot.py | test_bot.py | #!/usr/bin/env python
from tpb import TPB
t = TPB()
# when using a proxy site
# t = TPB(domain='http://uberproxy.net/thepiratebay.sx')
for to in t.get_recent_torrents():
print '*' * 50
to.print_torrent()
print '\n'
"""
# search for programming ebooks
results = t.search('hello world', ... | #!/usr/bin/env python
from tpb import TPB
t = TPB()
# when using a proxy site
# t = TPB('http://uberproxy.net/thepiratebay.sx')
for to in t.get_recent_torrents():
print '*' * 50
to.print_torrent()
print '\n'
"""
# search for programming ebooks
results = t.search('hello world', categor... | mit | Python |
73115e5b68015aa122796fdae9ac781b451350fe | Update addItem_kml_sample.py | pLeBlanc93/ArcREST,jgravois/ArcREST,Esri/ArcREST,BrunoCaimar/ArcREST,adegwerth/ArcREST,achapkowski/ArcREST,DShokes/ArcREST | samples/addItem_kml_sample.py | samples/addItem_kml_sample.py | """
This sample shows how to add an item to
AGOL/Portal using ArcREST
"""
import arcrest
if __name__ == "__main__":
username = "<username>"
password = "<password>"
portalId = "<portal Id>"
url = "<portal or AGOL url>"
thumbnail_url = "<url to thumbnail>"
kml_path = r"<path to KML item>"
... | """
This sample shows how to add an item to
AGOL/Portal using ArcREST
"""
import arcrest
if __name__ == "__main__":
username = "<username>"
password = "<password>"
portalId = "<portal Id>"
url = "<portal or AGOL url>"
thumbnail_url = "<url to thumbnail>"
kml_path = r"<path to KML item>"
... | apache-2.0 | Python |
698a8e4b51469aa4203e163d5529554166ca536e | Add recommend by follows | machinalis/machinalis-movie-reviews,machinalis/machinalis-movie-reviews,machinalis/machinalis-movie-reviews | movie_recommendations/recommendation_engines.py | movie_recommendations/recommendation_engines.py | import sys
from sqlalchemy import or_
from sqlalchemy.sql.expression import func
from movie_recommendations import app, db, models
def random_choice(user):
"""Picks a random set of movies"""
return models.Movie.query.order_by(func.random())
def facebook_recommendations(user):
"""Picks movies based on... | import sys
from sqlalchemy import or_
from sqlalchemy.sql.expression import func
from movie_recommendations import app, db, models
def no_recommendations(user):
"""Returns no recommendations"""
[]
def random_choice(user):
"""Picks a random set of movies"""
return models.Movie.query.order_by(func.... | bsd-3-clause | Python |
190936f34ac3d24215a9eadfd82b0ac138dbe1d6 | add odoo access parser | Micronaet/micronaet-docnaet,Micronaet/micronaet-docnaet,Micronaet/micronaet-docnaet | docnaet_remote_odbc_mdb/agent/odbc_creation.py | docnaet_remote_odbc_mdb/agent/odbc_creation.py | # -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License a... | # -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License a... | agpl-3.0 | Python |
97a67e022d094743e806896386bdbe317cb56fb6 | Use argparse instead of sys.argv | shakib609/gitcloner | gitcloner.py | gitcloner.py | #! /usr/bin/env python3
import sys
import argparse
from gitaccount import GitAccount
def main():
parser = argparse.ArgumentParser(
prog='gitcloner',
description='Clone all the repositories from a github user/org\naccount to the current directory')
group = parser.add_mutually_exclusiv... | #! /usr/bin/env python3
import sys
from gitaccount import GitAccount
def main():
if len(sys.argv) < 2:
print("""Usage:
gitcloner.py [OPTION] [NAME]
OPTIONS:
-u - for user repositories
-o - for organization repositories
NAME:
Username or Organization Name
""")
... | mit | Python |
af3cfe430630ff9fef2fafae5b630ca1d5a0e818 | Fix formula | openfisca/country-template,openfisca/country-template | openfisca_country_template/variables/demographics.py | openfisca_country_template/variables/demographics.py | # -*- coding: utf-8 -*-
# This file defines the variables of our legislation.
# A variable is property of a person, or an entity (e.g. a household).
# See https://openfisca.org/doc/variables.html
# Import from openfisca-core the common python objects used to code the legislation in OpenFisca
from openfisca_core.model... | # -*- coding: utf-8 -*-
# This file defines the variables of our legislation.
# A variable is property of a person, or an entity (e.g. a household).
# See https://openfisca.org/doc/variables.html
# Import from openfisca-core the common python objects used to code the legislation in OpenFisca
from openfisca_core.model... | agpl-3.0 | Python |
e9ef563ce346dac5f29e3300b34cf76457668b9c | Modify log message | mjbrewer/testindex,openstack/magnum,eshijia/magnum,eshijia/magnum,dimtruck/magnum,eshijia/SUR,mjbrewer/testindex,dimtruck/magnum,Alzon/SUR,Tennyson53/SUR,eshijia/SUR,Tennyson53/SUR,ArchiFleKs/magnum,Alzon/SUR,mjbrewer/testindex,Tennyson53/magnum,openstack/magnum,jay-lau/magnum,ArchiFleKs/magnum,Tennyson53/magnum | magnum/conductor/handlers/x509keypair_conductor.py | magnum/conductor/handlers/x509keypair_conductor.py | # Copyright 2015 NEC Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | # Copyright 2015 NEC Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 | Python |
d42b9da06d5cde89a6116d711fc6ae216256cabc | Use get/set_property rather than direct accessors | Daksh/sugar-toolkit-gtk3,manuq/sugar-toolkit-gtk3,tchx84/sugar-toolkit-gtk3,quozl/sugar-toolkit-gtk3,tchx84/sugar-toolkit-gtk3,i5o/sugar-toolkit-gtk3,puneetgkaur/backup_sugar_sugartoolkit,quozl/sugar-toolkit-gtk3,godiard/sugar-toolkit-gtk3,tchx84/debian-pkg-sugar-toolkit,tchx84/debian-pkg-sugar-toolkit,ceibal-tatu/suga... | shell/view/home/IconLayout.py | shell/view/home/IconLayout.py | import random
class IconLayout:
def __init__(self, width, height):
self._icons = []
self._width = width
self._height = height
def add_icon(self, icon):
self._icons.append(icon)
self._layout_icon(icon)
def remove_icon(self, icon):
self._icons.remove(icon)
def _is_valid_position(self, icon, x, y):
i... | import random
class IconLayout:
def __init__(self, width, height):
self._icons = []
self._width = width
self._height = height
def add_icon(self, icon):
self._icons.append(icon)
self._layout_icon(icon)
def remove_icon(self, icon):
self._icons.remove(icon)
def _is_valid_position(self, icon, x, y):
i... | lgpl-2.1 | Python |
2dcc8a585fa66f3e8a7ad3f3b809d43265d46a11 | Fix another example | jettify/aiohttp,panda73111/aiohttp,esaezgil/aiohttp,hellysmile/aiohttp,singulared/aiohttp,KeepSafe/aiohttp,moden-py/aiohttp,rutsky/aiohttp,AraHaanOrg/aiohttp,singulared/aiohttp,esaezgil/aiohttp,z2v/aiohttp,moden-py/aiohttp,arthurdarcet/aiohttp,hellysmile/aiohttp,KeepSafe/aiohttp,jettify/aiohttp,alex-eri/aiohttp-1,mind1... | examples/web_classview1.py | examples/web_classview1.py | #!/usr/bin/env python3
"""Example for aiohttp.web class based views
"""
import asyncio
import functools
import json
from aiohttp.web import json_response, Application, Response, View, run_app
class MyView(View):
async def get(self):
return json_response({
'method': 'get',
'args'... | #!/usr/bin/env python3
"""Example for aiohttp.web class based views
"""
import asyncio
import functools
import json
from aiohttp.web import json_response, Application, Response, View
class MyView(View):
async def get(self):
return json_response({
'method': 'get',
'args': dict(se... | apache-2.0 | Python |
0ca83228abed6e7a373e14357cdad9af4501b7b5 | Bump version | markstory/lint-review,markstory/lint-review,markstory/lint-review | lintreview/__init__.py | lintreview/__init__.py | __version__ = '2.32.2'
| __version__ = '2.32.1'
| mit | Python |
320099aab931ba7c2657671c069781a4ac853151 | Update for recent test renaming ("intbig" suffix). | swegener/micropython,alex-robbins/micropython,selste/micropython,oopy/micropython,pozetroninc/micropython,infinnovation/micropython,micropython/micropython-esp32,adafruit/micropython,tralamazza/micropython,infinnovation/micropython,oopy/micropython,tobbad/micropython,trezor/micropython,PappaPeppar/micropython,pramasoul... | tools/tinytest-codegen.py | tools/tinytest-codegen.py | #! /usr/bin/env python3
import os, sys
from glob import glob
from re import sub
def escape(s):
lookup = {
'\0': '\\0',
'\t': '\\t',
'\n': '\\n\"\n\"',
'\r': '\\r',
'\\': '\\\\',
'\"': '\\\"',
}
return "\"\"\n\"{}\"".format(''.join([lookup[x] if x in lookup else x for x in s]))
def chew_... | #! /usr/bin/env python3
import os, sys
from glob import glob
from re import sub
def escape(s):
lookup = {
'\0': '\\0',
'\t': '\\t',
'\n': '\\n\"\n\"',
'\r': '\\r',
'\\': '\\\\',
'\"': '\\\"',
}
return "\"\"\n\"{}\"".format(''.join([lookup[x] if x in lookup else x for x in s]))
def chew_... | mit | Python |
79bb833634a06b8db40a7e7fdd6f40cc3bb9bac0 | Update ipc_lista1.2.py | any1m1c/ipc20161 | lista1/ipc_lista1.2.py | lista1/ipc_lista1.2.py | #ipc_lista1.2
#Professor: Jucimar Junior
#Any Mendes Carvalho - 615310044
#
#
#
#
#Faça um Programa que peça um número e então mostre a mensagem O número informado foi [número].
number = input("Digite um número: ")
print "O número digitado foi ",number
| #ipc_lista1.2
#Professor: Jucimar Junior
#Any Mendes Carvalho - 1615310044
#
#
#
#
#Faça um Programa que peça um número e então mostre a mensagem O número informado foi [número].
number = input("Digite um número: ")
print "O número digitado foi ",number
| apache-2.0 | Python |
fea9af079b438585912640c3833c75239be8dffd | Update ipc_lista1.6.py | any1m1c/ipc20161 | lista1/ipc_lista1.6.py | lista1/ipc_lista1.6.py | #ipc_lista1.6
#Professor: Jucimar Junior
#Any Mendes Carvalho -
#
#
#
#
#Faça um programa que peça o raio de um círculo, calcule e mostre sua área
raio = 0
area = 0
raio = input("Entre com o valor do raio: "
| #ipc_lista1.6
#Professor: Jucimar Junior
#Any Mendes Carvalho -
#
#
#
#
#Faça um programa que peça o raio de um círculo, calcule e mostre sua área
raio = 0
area = 0
raio = input("Entre com o valor do raio:
| apache-2.0 | Python |
e92ff170e096904d7fd83fa78ab146892b4a647f | Update ipc_lista1.7.py | any1m1c/ipc20161 | lista1/ipc_lista1.7.py | lista1/ipc_lista1.7.py | #ipc_lista1.7
#Professor: Jucimar Junior
#Any Mendes Carvalho
#
#
#
#
#Faça um programa que calcule a área de um
| #ipc_lista1.7
#Professor: Jucimar Junior
#Any Mendes Carvalho
#
#
#
#
#Faça um programa que calcule a área
| apache-2.0 | Python |
abd01d116b3570aa06999d6bc19cf5fcdfbd33bc | Fix categorical xentropy when preds are not probas | zhangxujinsh/keras,cheng6076/keras,aleju/keras,wxs/keras,capybaralet/keras,wubr2000/keras,marcelo-amancio/keras,keskarnitish/keras,iScienceLuvr/keras,danielforsyth/keras,iamtrask/keras,ml-lab/keras,MagicSen/keras,gamer13/keras,keras-team/keras,zhmz90/keras,JasonTam/keras,amy12xx/keras,chenych11/keras,jmportilla/keras,n... | keras/objectives.py | keras/objectives.py | import theano
import theano.tensor as T
import numpy as np
epsilon = 1.0e-15
def mean_squared_error(y_true, y_pred):
return T.sqr(y_pred - y_true).mean()
def mean_absolute_error(y_true, y_pred):
return T.abs_(y_pred - y_true).mean()
def squared_hinge(y_true, y_pred):
return T.sqr(T.maximum(1. - y_true *... | import theano
import theano.tensor as T
import numpy as np
epsilon = 1.0e-15
def mean_squared_error(y_true, y_pred):
return T.sqr(y_pred - y_true).mean()
def mean_absolute_error(y_true, y_pred):
return T.abs_(y_pred - y_true).mean()
def squared_hinge(y_true, y_pred):
return T.sqr(T.maximum(1. - y_true *... | mit | Python |
7fedd8c584c5f1f8557dd139dfc1b51ee9e674c2 | remove typo | bcen/vcrpy,yarikoptic/vcrpy,poussik/vcrpy,mgeisler/vcrpy,gwillem/vcrpy,poussik/vcrpy,graingert/vcrpy,kevin1024/vcrpy,graingert/vcrpy,IvanMalison/vcrpy,ByteInternet/vcrpy,agriffis/vcrpy,kevin1024/vcrpy,ByteInternet/vcrpy,aclevy/vcrpy | tests/integration/common.py | tests/integration/common.py | # coding=utf-8
import os
import json
import shutil
import unittest
class TestVCR(unittest.TestCase):
fixtures = os.path.join('does', 'not', 'exist')
def tearDown(self):
# Remove the urllib2 fixtures if they exist
if os.path.exists(self.fixtures):
shutil.rmtree(self.fixtures)
... | # coding=utf-8
import os
import json
import shutil
import unittest
class TestVCR(unittest.TestCase):
fixtures = os.path.join('does', 'not', 'exist')
def tearDown(self):
# Remove th urllib2 fixtures if they exist
if os.path.exists(self.fixtures):
shutil.rmtree(self.fixtures)
... | mit | Python |
fb8d5fe3ea7eb992458501969999c75797320846 | Add test capturing failure. Ref #121. | python/importlib_metadata | importlib_metadata/tests/test_integration.py | importlib_metadata/tests/test_integration.py | # coding: utf-8
from __future__ import unicode_literals
import unittest
import packaging.requirements
import packaging.version
from . import fixtures
from .. import (
_compat,
distributions,
version,
)
class IntegrationTests(fixtures.DistInfoPkg, unittest.TestCase):
def test_package_spec_insta... | import unittest
import packaging.requirements
import packaging.version
from . import fixtures
from .. import (
_compat,
version,
)
class IntegrationTests(fixtures.DistInfoPkg, unittest.TestCase):
def test_package_spec_installed(self):
"""
Illustrate the recommended procedure to deter... | apache-2.0 | Python |
f8e2e95bdda7d067a284688a539cffeb19884105 | Fix duplicate bundle include | pferreir/indico,ThiefMaster/indico,DirkHoffmann/indico,ThiefMaster/indico,DirkHoffmann/indico,ThiefMaster/indico,pferreir/indico,DirkHoffmann/indico,pferreir/indico,indico/indico,ThiefMaster/indico,indico/indico,indico/indico,indico/indico,pferreir/indico,DirkHoffmann/indico | indico/modules/events/contributions/views.py | indico/modules/events/contributions/views.py | # This file is part of Indico.
# Copyright (C) 2002 - 2020 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 __future__ import unicode_literals
from indico.modules.events.management.views import WPEventManagem... | # This file is part of Indico.
# Copyright (C) 2002 - 2020 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 __future__ import unicode_literals
from indico.modules.events.management.views import WPEventManagem... | mit | Python |
8b0fa90bf59e907694e7cea9ba370fa3433cdb0e | update version | wq/wq.io,wq/wq.io | version.py | version.py | VERSION = "0.7.0-dev"
| VERSION = "0.6.2"
| mit | Python |
3413faee14a7bc5b94679ad6149da6726b0aa85d | Bump provision version after clipboard package update. | rht/zulip,timabbott/zulip,hackerkid/zulip,kou/zulip,zulip/zulip,dhcrzf/zulip,tommyip/zulip,eeshangarg/zulip,tommyip/zulip,shubhamdhama/zulip,zulip/zulip,kou/zulip,andersk/zulip,synicalsyntax/zulip,eeshangarg/zulip,punchagan/zulip,andersk/zulip,jackrzhang/zulip,zulip/zulip,synicalsyntax/zulip,rht/zulip,showell/zulip,rht... | version.py | version.py | ZULIP_VERSION = "1.7.1+git"
# Bump the minor PROVISION_VERSION to indicate that folks should provision
# only when going from an old version of the code to a newer version. Bump
# the major version to indicate that folks should provision in both
# directions.
# Typically, adding a dependency only requires a minor ver... | ZULIP_VERSION = "1.7.1+git"
# Bump the minor PROVISION_VERSION to indicate that folks should provision
# only when going from an old version of the code to a newer version. Bump
# the major version to indicate that folks should provision in both
# directions.
# Typically, adding a dependency only requires a minor ver... | apache-2.0 | Python |
54f5965ec8e2131e02446c7f8776a392c2fbdc00 | Bump version number now that the buildbot configuration no longer hard codes this | rackerlabs/pyopenssl,EnerNOC/pyopenssl,elitest/pyopenssl,EnerNOC/pyopenssl,mhils/pyopenssl,kediacorporation/pyopenssl,JensTimmerman/pyopenssl,reaperhulk/pyopenssl,mschmo/pyopenssl,msabramo/pyOpenSSL,reaperhulk/pyopenssl,sorenh/pyopenssl,aalba6675/pyopenssl,alex/pyopenssl,kjav/pyopenssl,msabramo/pyOpenSSL,sholsapp/pyope... | version.py | version.py | # Copyright (C) AB Strakt 2001-2004, All rights reserved
# Copyright (C) Jean-Paul Calderone 2008, All rights reserved
"""
pyOpenSSL - A simple wrapper around the OpenSSL library
"""
__version__ = '0.8dev'
| # Copyright (C) AB Strakt 2001-2004, All rights reserved
# Copyright (C) Jean-Paul Calderone 2008, All rights reserved
"""
pyOpenSSL - A simple wrapper around the OpenSSL library
"""
__version__ = '0.7'
| apache-2.0 | Python |
487429cdc7b4819ecaea8ee76150e5182e82b776 | update version number | Caoimhinmg/PmagPy,lfairchild/PmagPy,lfairchild/PmagPy,Caoimhinmg/PmagPy,lfairchild/PmagPy,Caoimhinmg/PmagPy | version.py | version.py | "pmagpy-3.3.1"
version = 'pmagpy-3.3.1'
| "pmagpy-3.2.11"
version = 'pmagpy-3.2.11'
| bsd-3-clause | Python |
80407e32e91ad774741d0a3a9b7000a62e9a7678 | Bump publish version | codacy/python-codacy-coverage | version.py | version.py | __version__ = '1.2.18'
| __version__ = '1.2.17'
| bsd-3-clause | Python |
fa73eee82100bb06ef080ca5f6fe25e5dd58eb40 | Bump version ahead of release | Nextdoor/ndkale,Nextdoor/ndkale | kale/version.py | kale/version.py | # Copyright 2015 Nextdoor.com, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | # Copyright 2015 Nextdoor.com, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | bsd-2-clause | Python |
49798d76d64f24976a3e52ffc6116bbab2289e1b | create working redirects for legestream > livestream, texplainers > how-session-works | texastribune/txlege84,texastribune/txlege84,texastribune/txlege84,texastribune/txlege84 | txlege84/txlege84/urls.py | txlege84/txlege84/urls.py | from django.conf.urls import patterns, include, url
# from django.conf.urls.static import static
from django.views.generic import TemplateView
from django.views.generic import RedirectView
from django.contrib import admin
from bills.views import (BillDetail, BillSearchJson,
SubjectDetail, Leg... | from django.conf.urls import patterns, include, url
# from django.conf.urls.static import static
from django.views.generic import TemplateView
from django.contrib import admin
from bills.views import (BillDetail, BillSearchJson,
SubjectDetail, LegeStreamDetail)
from core.views import LandingV... | mit | Python |
b95323a89ec3512d41e4d3bc787eeecc4a5d612a | Replace variables to their values | char16t/wa | wa/core.py | wa/core.py | # coding=utf-8
import sys
import os
import re
variables = {}
def main(in_args):
if len(in_args) >= 1:
command_file, args = get_command_file(in_args)
execute_command(command_file, args)
def execute_command(command_file, args = None):
if args == None:
args = [command_file]
else:
... | # coding=utf-8
import sys
import os
def main(in_args):
if len(in_args) >= 1:
command_file, args = get_command_file(in_args)
execute_command(command_file, args)
def execute_command(command_file, args = None):
if args == None:
args = [command_file]
else:
args = [command_file... | mit | Python |
1a58725bba600853e404d209cd4ae7938ac6b0fe | remove if statements from Customer.py | mollie/mollie-api-python | Mollie/API/Object/Customer.py | Mollie/API/Object/Customer.py | from .Base import Base
class Customer(Base):
@property
def id(self):
return self.getProperty('id')
@property
def name(self):
return self.getProperty('name')
@property
def email(self):
return self.getProperty('email')
@property
def locale(self):
return... | from .Base import Base
class Customer(Base):
@property
def id(self):
if 'id' not in self:
return None
return self.getProperty('id')
@property
def name(self):
if 'name' not in self:
return None
return self.getProperty('name')
@property
d... | bsd-2-clause | Python |
1bd8668db9153957cc5f4f8d67b548b44d2f9fea | fix import of VideoFileClip | ssteo/moviepy,Zulko/moviepy,kerstin/moviepy | tests/test_VideoFileClip.py | tests/test_VideoFileClip.py | # -*- coding: utf-8 -*-
"""Video file clip tests meant to be run with pytest."""
import os
import pytest
from moviepy.video.compositing.CompositeVideoClip import clips_array
from moviepy.video.VideoClip import ColorClip
from moviepy.video.io.VideoFileClip import VideoFileClip
def test_setup():
"""Test VideoFileC... | # -*- coding: utf-8 -*-
"""Video file clip tests meant to be run with pytest."""
import os
import pytest
from moviepy.video.compositing.CompositeVideoClip import clips_array
from moviepy.video.VideoClip import ColorClip
from moviepy.video.VideoFileClip import VideoFileClip
def test_setup():
"""Test VideoFileClip... | mit | Python |
9830d953f30d3515c7e371d720065e506404ab70 | add verbose option to test fixture | longaccess/longaccess-client,longaccess/longaccess-client,longaccess/longaccess-client | lacli/t/__init__.py | lacli/t/__init__.py | from boto import set_stream_logger
from lacli.log import setupLogging
from binascii import a2b_hex
from contextlib import contextmanager
from tempfile import mkdtemp
from shutil import rmtree
def setup():
set_stream_logger('boto')
setupLogging(2)
def makeprefs():
return {
'api': {
'u... | from boto import set_stream_logger
from lacli.log import setupLogging
from binascii import a2b_hex
from contextlib import contextmanager
from tempfile import mkdtemp
from shutil import rmtree
def setup():
set_stream_logger('boto')
setupLogging(2)
def makeprefs():
return {
'api': {
'u... | apache-2.0 | Python |
6299110a4b82035e35b97a84bdb86da751a7dc16 | Add fathom to CSP | craiga/unixtimesta.mp,craiga/unixtimesta.mp,craiga/unixtimesta.mp | unixtimestamp/__init__.py | unixtimestamp/__init__.py | """Unix Timestamp Flask application."""
import logging
import os
import re
import sys
from datetime import datetime
import flask
from dateutil.parser import parse
from flask_talisman import Talisman
from pytz import utc
from raven.contrib.flask import Sentry
from unixtimestamp import error_handlers, views
def cre... | """Unix Timestamp Flask application."""
import logging
import os
import re
import sys
from datetime import datetime
import flask
from dateutil.parser import parse
from flask_talisman import Talisman
from pytz import utc
from raven.contrib.flask import Sentry
from unixtimestamp import error_handlers, views
def cre... | mit | Python |
d7b28ee15f98aa4a87edfbdbc20c27bebff9d0ee | Remove unused import and unused instance variable. | dripton/ampchat | guiclient.py | guiclient.py | #!/usr/bin/env python
from twisted.internet import gtk2reactor
gtk2reactor.install()
from twisted.internet import reactor, defer
from twisted.internet.protocol import ClientCreator
from twisted.protocols import amp
import gtk
from diceserver import RollDice, port
class GUIClient(gtk.Window):
def __init__(self):... | #!/usr/bin/env python
from twisted.internet import gtk2reactor
gtk2reactor.install()
from twisted.internet import reactor, defer
from twisted.internet.protocol import ClientCreator
from twisted.protocols import amp
import gtk
import gtk.glade
from diceserver import RollDice, port
class GUIClient(gtk.Window):
de... | mit | Python |
8c34b3bc346646b8f37b77009ad6e3256ec5e251 | fix variables | legonigel/wii-drone-on | wiimote.py | wiimote.py | #! /usr/bin/python
import cwiid
import time
def makeConnection():
print "Press 1 + 2 on the wiimote yo"
wm = cwiid.Wiimote()
wm.led = 1
wm.enable(cwiid.FLAG_MOTIONPLUS)
wm.rpt_mode = cwiid.RPT_BTN | cwiid.RPT_MOTIONPLUS
print "you be connected"
return wm
def determine(wm):
if wm.state['buttons'] & cw... | #! /usr/bin/python
import cwiid
import time
def makeConnection():
print "Press 1 + 2 on the wiimote yo"
wm = cwiid.Wiimote()
wm.led = 1
wm.enable(cwiid.FLAG_MOTIONPLUS)
wm.rpt_mode = cwiid.RPT_BTN | cwiid.RPT_MOTIONPLUS
print "you be connected"
return wm
def determine(wm):
if wm.state['buttons'] & cw... | mit | Python |
e0753456d467446090c5dbb05f8c8e6c2d99984d | fix typo | OSSHealth/ghdata,OSSHealth/ghdata,OSSHealth/ghdata | workers/discourse_analysis_worker/setup.py | workers/discourse_analysis_worker/setup.py | import io
import os
import re
from setuptools import find_packages
from setuptools import setup
def read(filename):
filename = os.path.join(os.path.dirname(__file__), filename)
text_type = type(u"")
with io.open(filename, mode="r", encoding='utf-8') as fd:
return re.sub(text_type(r':[a-z]+:`~?(.*?... | import io
import os
import re
from setuptools import find_packages
from setuptools import setup
def read(filename):
filename = os.path.join(os.path.dirname(__file__), filename)
text_type = type(u"")
with io.open(filename, mode="r", encoding='utf-8') as fd:
return re.sub(text_type(r':[a-z]+:`~?(.*?... | mit | Python |
246344b5a7c9dcaf75904497608bfbc87768080a | fix package import | bappelt/WeatherPi | temp.py | temp.py | import os
import glob
import time
import httplib
import urllib, urllib2
from datetime import datetime
import Adafruit_DHT
station_id = 'KTXARLIN73'
password = "M*qw1%PCF!"
def read_humid_temp():
humidity, temperature = Adafruit_DHT.read_retry(Adafruit_DHT.AM2302, 4)
def upload_data():
try:
temp = read_... | import os
import glob
import time
import httplib
import urllib, urllib2
from datetime import datetime
from Adafruit_Python_DHT import Adafruit_DHT
station_id = 'KTXARLIN73'
password = "M*qw1%PCF!"
def read_humid_temp():
humidity, temperature = Adafruit_DHT.read_retry(Adafruit_DHT.AM2302, 4)
def upload_data():
... | mit | Python |
198569ac962c45e1c5bab9afe479b4390166d567 | Add a test case for 'drop' | jhamrick/dbtools,jhamrick/dbtools | test.py | test.py | import os
from nose.tools import with_setup, raises
from table import Table
from sqlite3 import OperationalError
class TestTable(object):
def setup(self):
self.dtypes = (
('id', int),
('name', str),
('age', int),
('height', float))
self.tbl = Table.... | import os
from nose.tools import with_setup
from table import Table
class TestTable(object):
def setup(self):
self.dtypes = (
('id', int),
('name', str),
('age', int),
('height', float))
self.tbl = Table.create(
"test.db", "Foo", self.dt... | mit | Python |
2805793beeba5073e9c6d804685c3819196fd605 | Test script now runs example story. | zj8487/goconvey,springning/goconvey,springning/goconvey,zj8487/goconvey,yaoshipu/goconvey,leeola/goconvey,wallclockbuilder/goconvey,ansiz/goconvey,ansiz/goconvey,springning/goconvey,aquilax/goconvey,leeola/goconvey,wallclockbuilder/assertions,zj8487/goconvey,leeola/goconvey,wallclockbuilder/convey,aquilax/goconvey,aqui... | test.py | test.py | import os
import subprocess
import sys
import time
def main():
working = os.path.abspath(os.path.join(os.getcwd()))
repetitions = 0
state = 0
while True:
new_state = sum(_checksums(working))
if state != new_state:
repetitions += 1
_display_repetitions_banner(rep... | import os
import subprocess
import sys
import time
def main():
working = os.path.abspath(os.path.join(os.getcwd(), 'convey'))
repetitions = 0
state = 0
while True:
new_state = sum(_checksums(working))
if state != new_state:
repetitions += 1
_display_repetitions_... | mit | Python |
60720a9f34b47d8740e8a51ace54ed76c67d1311 | Add test for spam and ham folders. | benigls/spam,benigls/spam | test.py | test.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import os
import params
class TestDataSet(unittest.TestCase):
"""
Class for testing the enron dataset.
"""
def setUp(self):
self.dataset_path = params.DATASET_PATH
self.dataset_subdirs = params.DATASET_SUBDIRS
sel... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import os
import params
class TestDataSet(unittest.TestCase):
"""
Class for testing the enron dataset.
"""
def setUp(self):
self.dataset_path = params.DATASET_PATH
self.dataset_subdirs = params.DATASET_SUBDIRS
sel... | mit | Python |
e68d3a9fa866b72824907a8c62910d950118c41b | Remove redundant output in unit tests | kefir500/ghstats | test.py | test.py | #!/usr/bin/env python
import unittest
import ghstats
try:
import urllib2
except ImportError:
import urllib.request as urllib2
class TestStats(unittest.TestCase):
def test_releases(self):
"""
Download all releases.
"""
stats = ghstats.download_stats("kefir500", "apk-ico... | #!/usr/bin/env python
import unittest
import ghstats
try:
import urllib2
except ImportError:
import urllib.request as urllib2
class TestStats(unittest.TestCase):
def test_releases(self):
"""
Download all releases.
"""
stats = ghstats.download_stats("kefir500", "apk-ico... | mit | Python |
97080a82f7014b3a6925ef9e20570109409c2b34 | Remove TODO marking from minimap | delicb/SublimeConfig | todo.py | todo.py | import re
from collections import defaultdict
import sublime
import sublime_plugin
FLAGS = (sublime.DRAW_EMPTY | sublime.DRAW_NO_FILL | sublime.DRAW_NO_OUTLINE |
sublime.HIDE_ON_MINIMAP)
PATTERNS = {
re.compile(r'^\s*# ?TODO:\s*(.*)$'): 'todo',
re.compile(r'^\s*# ?XXX:\s*(.*)$'): 'xxx',
}
# ICON = 'P... | import re
from collections import defaultdict
import sublime
import sublime_plugin
FLAGS = sublime.DRAW_EMPTY | sublime.DRAW_NO_FILL | sublime.DRAW_NO_OUTLINE
PATTERNS = {
re.compile(r'^\s*# ?TODO:\s*(.*)$'): 'todo',
re.compile(r'^\s*# ?XXX:\s*(.*)$'): 'xxx',
}
# ICON = 'Packages/User/todo.png'
# TODO_PATTERN... | mit | Python |
288fd7499d37027e5f584e28368af3738ce8e710 | Add new utility functions | hkaju/LennardJones,hkaju/LennardJones,hkaju/LennardJones | util.py | util.py | import subprocess
import os
def write_data(data, density):
if not os.path.exists("data"):
os.mkdir("data")
f = open("data/data-dn{0}.csv".format(density), "w")
f.write("t,K,V,T,P,temp\n")
for item in range(len(data["t"])):
f.write("{0},{1},{2},{3},{4},{5}\n".format(data["t"][it... | import subprocess
import os
def write_data(data):
f = open("output.csv", "w")
f.write("t,K,V,T,P,temp\n")
for item in range(len(data["t"])):
f.write("{0},{1},{2},{3},{4},{5}\n".format(data["t"][item], data["K"][item], data["V"][item], data["T"][item], data["P"][item], data["temp"][item]))
... | mit | Python |
2489e0141395fadb17d8f994d962f2a8a20f8b6d | Add guard for empty migrations (refs #178) | dracidoupe/graveyard,dracidoupe/graveyard,dracidoupe/graveyard,dracidoupe/graveyard | ddcz/migrations/0066_mentat_fix_autoincrement.py | ddcz/migrations/0066_mentat_fix_autoincrement.py | # Generated by Django 2.0.13 on 2021-04-16 16:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("ddcz", "0065_mentat_drop_auto"),
]
operations = [
# Following migration doesn't work because Django generates multiple commands
# t... | # Generated by Django 2.0.13 on 2021-04-16 16:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("ddcz", "0065_mentat_drop_auto"),
]
operations = [
# Following migration doesn't work because Django generates multiple commands
# t... | mit | Python |
e5c213077ac0cdcc90df8c1c3ad6cbb74a0b184a | fix double jeopardy size | FSI-HochschuleTrier/hacker-jeopardy,FSI-HochschuleTrier/hacker-jeopardy | de/hochschuletrier/jpy/overlays/DoubleOverlay.py | de/hochschuletrier/jpy/overlays/DoubleOverlay.py | __author__ = 'georg'
from de.hochschuletrier.jpy.Constants import Constants, Fonts
from de.hochschuletrier.jpy.overlays.Overlay import Overlay
from Tkinter import Label, StringVar
class DoubleOverlay(Overlay):
def __init__(self, *args, **kwargs):
Overlay.__init__(self, *args, **kwargs)
self.label ... | __author__ = 'georg'
from de.hochschuletrier.jpy.Constants import Constants, Fonts
from de.hochschuletrier.jpy.overlays.Overlay import Overlay
from Tkinter import Label, StringVar
class DoubleOverlay(Overlay):
def __init__(self, *args, **kwargs):
Overlay.__init__(self, *args, **kwargs)
self.label ... | mit | Python |
55a4c4b338bcda8ff69e4303f000dae6934b0884 | Add option --create-commands-dir to dodo new-command | mnieber/dodo_commands | dodo_commands/extra/dodo_standard_commands/new-command.py | dodo_commands/extra/dodo_standard_commands/new-command.py | from argparse import ArgumentParser
from dodo_commands.framework import Dodo, CommandError
from dodo_commands.framework.config import CommandPath, ConfigIO
import os
import sys
def _default_commands_basename():
return 'dodo_%s_commands' % Dodo.get_config('/ROOT/project_name')
def _default_commands_dir():
re... | from argparse import ArgumentParser
from dodo_commands.framework import Dodo, CommandError
from dodo_commands.framework.config import CommandPath
import os
def _args():
parser = ArgumentParser(description="Creates a new Dodo command.")
parser.add_argument('name')
parser.add_argument(
'--next-to',
... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.