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 |
|---|---|---|---|---|---|---|---|---|
92cecda5aa82165dd45a62b57c57574ad65fdb35 | remove leftovers from flake8 copy i started with | TimYi/pybuilder,Designist/pybuilder,arcivanov/pybuilder,arcivanov/pybuilder,locolupo/pybuilder,Designist/pybuilder,alex-dow/pybuilder,Danielweber7624/pybuilder,Danielweber7624/pybuilder,paolodedios/pybuilder,elkingtonmcb/pybuilder,pybuilder/pybuilder,locolupo/pybuilder,paolodedios/pybuilder,esc/pybuilder,onesfreedom/py... | src/main/python/pybuilder/plugins/python/cram_plugin.py | src/main/python/pybuilder/plugins/python/cram_plugin.py | # cram Plugin for PyBuilder
#
# Copyright 2011-2014 PyBuilder Team
#
# 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 applic... | # cram Plugin for PyBuilder
#
# Copyright 2011-2014 PyBuilder Team
#
# 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 applic... | apache-2.0 | Python |
3a7d154f6561f9b3c8db4620049244d5ba74e06a | Adjust formatting to match the lint check. | jazzband/django-axes | axes/middleware.py | axes/middleware.py | from typing import Callable
from django.conf import settings
from axes.helpers import (
get_lockout_response,
get_failure_limit,
get_client_username,
get_credentials,
)
from axes.handlers.proxy import AxesProxyHandler
class AxesMiddleware:
"""
Middleware that calculates necessary HTTP reque... | from typing import Callable
from django.conf import settings
from axes.helpers import (
get_lockout_response,
get_failure_limit,
get_client_username,
get_credentials,
)
from axes.handlers.proxy import AxesProxyHandler
class AxesMiddleware:
"""
Middleware that calculates necessary HTTP reque... | mit | Python |
40f4c4ee43c3625b8aec81f37b221f500b047b87 | add comment | ingadhoc/account-financial-tools | base_currency_inverse_rate/models/res_currency_rate.py | base_currency_inverse_rate/models/res_currency_rate.py | ##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from odoo import models, fields, api
class ResCurrencyRate(models.Model... | ##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from odoo import models, fields, api
class ResCurrencyRate(models.Model... | agpl-3.0 | Python |
e8345b44b1e05adbb48f7ef0e2ef2201196ad06c | remove blank line in the end of file of model perceptron. | ntucllab/libact,ntucllab/libact,ntucllab/libact | libact/models/perceptron.py | libact/models/perceptron.py | from libact.base.interfaces import Model
import sklearn.linear_model
"""
A interface for scikit-learn's perceptron model
"""
class Perceptron(Model):
def __init__(self, *args, **kwargs):
self.model = sklearn.linear_model.Perceptron(*args, **kwargs)
def fit(self, dataset, *args, **kwargs):
ret... | from libact.base.interfaces import Model
import sklearn.linear_model
"""
A interface for scikit-learn's perceptron model
"""
class Perceptron(Model):
def __init__(self, *args, **kwargs):
self.model = sklearn.linear_model.Perceptron(*args, **kwargs)
def fit(self, dataset, *args, **kwargs):
re... | bsd-2-clause | Python |
a9a1a5fda5ff9633cba362d79110e816eea4265a | add def greeting(msg) | erc7as/cs3240-labdemo | hello.py | hello.py | __author__ = 'erc7as'
def greeting(msg):
print(msg)
greeting('hello') | __author__ = 'erc7as'
print('hello') | mit | Python |
f06a406772d73a9ec9b61185b227341a0059abea | Update altair/examples/natural_disasters.py | altair-viz/altair | altair/examples/natural_disasters.py | altair/examples/natural_disasters.py | """
Global Deaths from Natural Disasters
------------------------------------
This example shows a proportional symbols visualization of deaths from natural disasters by year and type.
"""
# category: case studies
import altair as alt
from vega_datasets import data
source = data.disasters.url
alt.Chart(source).transf... | """
Global Deaths from Natural Disasters
------------------------------------
This example shows a proportional symbols visualization of deaths from natural disasters by year and type.
"""
# category: case studies
import altair as alt
from vega_datasets import data
source = data.disasters.url
alt.Chart(source).transf... | bsd-3-clause | Python |
37260f9e8618a63e7e1be695bfa7766e3cfa4418 | Use DummyProcess() not to raise exceptions. | kcaa/kcaa,kcaa/kcaa,kcaa/kcaa,kcaa/kcaa | server/controller.py | server/controller.py | #!/usr/bin/env python
import logging
import multiprocessing
import time
import traceback
import browser
import kcsapi_util
import proxy_util
class DummyProcess(object):
def join(self):
pass
def control(args, server_conn, to_exit):
# It seems that uncaught exceptions are silently buffered after cr... | #!/usr/bin/env python
import logging
import multiprocessing
import time
import traceback
import browser
import kcsapi_util
import proxy_util
def control(args, server_conn, to_exit):
# It seems that uncaught exceptions are silently buffered after creating
# another multiprocessing.Process.
try:
l... | apache-2.0 | Python |
3300a66a421d5110093c02011c305d501daf069a | Fix search_fields | HerraLampila/django-newswall,registerguard/django-newswall,michaelkuty/django-newswall,matthiask/django-newswall,registerguard/django-newswall,michaelkuty/django-newswall,matthiask/django-newswall,HerraLampila/django-newswall | newswall/admin.py | newswall/admin.py | from django.contrib import admin
from newswall.models import Source, Story
admin.site.register(Source,
list_display=('name', 'is_active', 'ordering'),
list_editable=('is_active', 'ordering'),
list_filter=('is_active',),
prepopulated_fields={'slug': ('name',)},
)
admin.site.register(Story,
da... | from django.contrib import admin
from newswall.models import Source, Story
admin.site.register(Source,
list_display=('name', 'is_active', 'ordering'),
list_editable=('is_active', 'ordering'),
list_filter=('is_active',),
prepopulated_fields={'slug': ('name',)},
)
admin.site.register(Story,
da... | bsd-3-clause | Python |
6ecb6a784723048dbdc36082ffecee284f49c10e | fix setting name | alacritythief/django-rest-auth,serxoz/django-rest-auth,Tivix/django-rest-auth,roopesh90/django-rest-auth,SakuradaJun/django-rest-auth,flexpeace/django-rest-auth,caruccio/django-rest-auth,julioeiras/django-rest-auth,caruccio/django-rest-auth,philippeluickx/django-rest-auth,ZachLiuGIS/django-rest-auth,bopo/django-rest-au... | rest_auth/app_settings.py | rest_auth/app_settings.py | from django.conf import settings
from rest_auth.serializers import (
TokenSerializer as DefaultTokenSerializer,
UserDetailsSerializer as DefaultUserDetailsSerializer,
LoginSerializer as DefaultLoginSerializer,
PasswordResetSerializer as DefaultPasswordResetSerializer,
PasswordResetConfirmSerializer... | from django.conf import settings
from rest_auth.serializers import (
TokenSerializer as DefaultTokenSerializer,
UserDetailsSerializer as DefaultUserDetailsSerializer,
LoginSerializer as DefaultLoginSerializer,
PasswordResetSerializer as DefaultPasswordResetSerializer,
PasswordResetConfirmSerializer... | mit | Python |
d7ffd790976de4db8011d0d2e61ba0b486c098da | split config files into long term support and deprecated ones | Woile/commitizen,Woile/commitizen | commitizen/defaults.py | commitizen/defaults.py | name: str = "cz_conventional_commits"
# TODO: .cz, setup.cfg, .cz.cfg should be removed in 2.0
long_term_support_config_files: list = ["pyproject.toml", ".cz.toml"]
deprcated_config_files: list = [".cz", "setup.cfg", ".cz.cfg"]
config_files: list = long_term_support_config_files + deprcated_config_files
DEFAULT_SETTIN... | name: str = "cz_conventional_commits"
# TODO: .cz, setup.cfg, .cz.cfg should be removed in 2.0
config_files: list = ["pyproject.toml", ".cz.toml", ".cz", "setup.cfg", ".cz.cfg"]
DEFAULT_SETTINGS = {
"name": "cz_conventional_commits",
"version": None,
"version_files": [],
"tag_format": None, # example ... | mit | Python |
5e0e22eb6e709eb5291ac50a28b96c2c05909a2d | Return value of get_result is a pair of (task, result data) | dMaggot/ArtistGraph | src/artgraph/miner.py | src/artgraph/miner.py | import pymw
import pymw.interfaces
import artgraph.plugins.infobox
from artgraph.node import NodeTypes
from artgraph.node import Node
class Miner(object):
nodes = []
relationships = []
master = None
task_queue = []
def __init__(self, debug=False):
mwinterface = pymw.interfaces.Generi... | import pymw
import pymw.interfaces
import artgraph.plugins.infobox
from artgraph.node import NodeTypes
from artgraph.node import Node
class Miner(object):
nodes = []
relationships = []
master = None
task_queue = []
def __init__(self, debug=False):
mwinterface = pymw.interfaces.Generi... | mit | Python |
ab9da6108ae2b554bb956daa0b61a6e8678bf5eb | Add Build.__unicode__ | debian-live/live-studio,debian-live/live-studio,debian-live/live-studio | live_studio/build/models.py | live_studio/build/models.py | import uuid
import datetime
from django.db import models
from django.conf import settings
from .managers import BuildManager
class Build(models.Model):
ident = models.CharField(max_length=40, unique=True, default=uuid.uuid4)
config = models.ForeignKey('config.Config', related_name='builds')
enqueued = ... | import uuid
import datetime
from django.db import models
from django.conf import settings
from .managers import BuildManager
class Build(models.Model):
ident = models.CharField(max_length=40, unique=True, default=uuid.uuid4)
config = models.ForeignKey('config.Config', related_name='builds')
enqueued = ... | agpl-3.0 | Python |
d1d3109bdeffc229ed897f35ef50554e8a0f5549 | Simplify conditionals | bazelbuild/gmaven_rules,bazelbuild/gmaven_rules,bazelbuild/rules_jvm_external,bazelbuild/rules_jvm_external,bazelbuild/rules_jvm_external | defs.bzl | defs.bzl | def gmaven_artifact(fqn):
parts = fqn.split(":")
packaging = "aar"
if len(parts) == 3:
group_id, artifact_id, version = parts
elif len(parts) == 4:
group_id, artifact_id, version, packaging = parts
elif len(parts) == 5:
_, _, _, _, classifier = parts
fail("Classifiers are currently not suppor... | def gmaven_artifact(fqn):
parts = fqn.split(":")
packaging = "aar"
if len(parts) < 2 or len(parts) > 5:
fail("Invalid qualified name for artifact: %s" % fqn)
elif len(parts) == 3:
group_id, artifact_id, version = parts
elif len(parts) == 4:
group_id, artifact_id, version, packaging = parts
elif... | apache-2.0 | Python |
e95cc37db097e13cc0582c0d5429fb5f747f95aa | use alternate com port addressing | andrewramsay/pytia | examples/pytia_sk7imu.py | examples/pytia_sk7imu.py | import time, sys, itertools
from pyshake import *
import pytia
from pytia import TiAServer, TiAConnectionHandler, TiASignalConfig
# Runs a TiA server configured to stream data from an SK7 with 5
# wired IMUs attached
def data_callback(data):
(sig_id, sig_data) = data
sk7_dev = sig_data[0]
# each time t... | import time, sys, itertools
from pyshake import *
import pytia
from pytia import TiAServer, TiAConnectionHandler, TiASignalConfig
# Runs a TiA server configured to stream data from an SK7 with 5
# wired IMUs attached
def data_callback(data):
(sig_id, sig_data) = data
sk7_dev = sig_data[0]
# each time t... | mit | Python |
e6080b6f5997e1462ed97fbda0e13b0299742527 | Update version for 4.0 RC3 | HtmlUnit/selenium,HtmlUnit/selenium,titusfortner/selenium,titusfortner/selenium,joshmgrant/selenium,valfirst/selenium,joshmgrant/selenium,joshmgrant/selenium,titusfortner/selenium,SeleniumHQ/selenium,joshmgrant/selenium,titusfortner/selenium,HtmlUnit/selenium,valfirst/selenium,SeleniumHQ/selenium,titusfortner/selenium,... | dotnet/selenium-dotnet-version.bzl | dotnet/selenium-dotnet-version.bzl | # BUILD FILE SYNTAX: STARLARK
SE_VERSION = "4.0.0-rc3"
ASSEMBLY_VERSION = "4.0.0.0"
SUPPORTED_NET_FRAMEWORKS = ["net45", "net46", "net47", "net48"]
SUPPORTED_NET_STANDARD_VERSIONS = ["netstandard2.0", "netstandard2.1", "net5.0"]
SUPPORTED_DEVTOOLS_VERSIONS = [
"v85",
"v93",
"v94",
]
ASSEMBLY_COMPANY = "S... | # BUILD FILE SYNTAX: STARLARK
SE_VERSION = "4.0.0"
ASSEMBLY_VERSION = "4.0.0.0"
SUPPORTED_NET_FRAMEWORKS = ["net45", "net46", "net47", "net48"]
SUPPORTED_NET_STANDARD_VERSIONS = ["netstandard2.0", "netstandard2.1", "net5.0"]
SUPPORTED_DEVTOOLS_VERSIONS = [
"v85",
"v93",
"v94",
]
ASSEMBLY_COMPANY = "Selen... | apache-2.0 | Python |
140700d03da37e3a01c6a76346141c7af0ef68cd | Update benchmark with new capabilities | sirmarcel/floq | benchmark/spins.py | benchmark/spins.py | import sys
sys.path.append('..')
sys.path.append('museum_of_forks')
from floq.systems.spins import SpinEnsemble
import numpy as np
import timeit
def wrapper(func, *args, **kwargs):
def wrapped():
return func(*args, **kwargs)
return wrapped
def get_f(fid, base_controls):
fid(np.random.rand(1)*bas... | import sys
sys.path.append('..')
sys.path.append('museum_of_forks')
from floq.systems.spins import SpinEnsemble
import numpy as np
import timeit
def wrapper(func, *args, **kwargs):
def wrapped():
return func(*args, **kwargs)
return wrapped
def get_f(fid, base_controls):
fid(np.random.rand(1)*bas... | mit | Python |
c3911af29983181e593ca89fb52739c616bdb7bb | add cluster and clustertemplate to fake_policy.py | openstack/magnum,ArchiFleKs/magnum,ArchiFleKs/magnum,openstack/magnum | magnum/tests/fake_policy.py | magnum/tests/fake_policy.py | # Copyright (c) 2012 OpenStack Foundation
#
# 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 t... | # Copyright (c) 2012 OpenStack Foundation
#
# 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 t... | apache-2.0 | Python |
0bdffe52aca802377e288b7a1ceb24ecacd926c3 | Update Version number | suipotryot/django-saas-userdb | userdb/__init__.py | userdb/__init__.py | __version__ = '0.1.dev15'
| __version__ = '0.1.dev14'
| mit | Python |
404127ffae808690ba83fa506fd402dc267007f9 | Update version to 3.1 | copasi/condor-copasi,copasi/condor-copasi | web_frontend/version.py | web_frontend/version.py | version = '0.3.1 beta'
| version = '0.3.0 beta'
| artistic-2.0 | Python |
b7e8154511df708844d0f6d07adcc40f36b33b7b | Bump the version to 0.3.7 | sulami/feed2maildir | feed2maildir/__init__.py | feed2maildir/__init__.py | VERSION = '0.3.7'
| VERSION = '0.3.6'
| isc | Python |
29bd597ce983b64bce5fb19348c7b94f8ce9d0fd | Fix tests, so that they use a hostname rather than an IP address. | wonderslug/mongo-orchestration,10gen/mongo-orchestration,10gen/mongo-orchestration,agilemobiledev/mongo-orchestration,llvtt/mongo-orchestration-1,wonderslug/mongo-orchestration,llvtt/mongo-orchestration-1,agilemobiledev/mongo-orchestration | tests/__init__.py | tests/__init__.py | # Copyright 2014 MongoDB, 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 writing, so... | # Copyright 2014 MongoDB, 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 writing, so... | apache-2.0 | Python |
a78b4e2ee35a404c06d4bdbed95e3ffa5ad2d061 | Use Python 3 style print. | GrahamDumpleton/mod_wsgi,GrahamDumpleton/mod_wsgi,GrahamDumpleton/mod_wsgi | tests/access.wsgi | tests/access.wsgi | def allow_access(environ, host):
print(environ, host)
return True
| def allow_access(environ, host):
print environ, host
return True
| apache-2.0 | Python |
5fd3f1afc564f154fdce7512e553a0f211e6d527 | add engine attribute to Engine class | CaptainDesAstres/Blender-Render-Manager,CaptainDesAstres/Simple-Blender-Render-Manager | settingMod/Engine.py | settingMod/Engine.py | #!/usr/bin/python3.4
# -*-coding:Utf-8 -*
'''module to manage Engine Settings'''
import xml.etree.ElementTree as xmlMod
import os
class Engine:
'''class to manage Engine Settings'''
def __init__(self, xml= None):
'''initialize Engine Settings with default value or values extracted from an xml object'''
if xm... | #!/usr/bin/python3.4
# -*-coding:Utf-8 -*
'''module to manage Engine Settings'''
import xml.etree.ElementTree as xmlMod
import os
class Engine:
'''class to manage Engine Settings'''
def __init__(self, xml= None):
'''initialize Engine Settings with default value or values extracted from an xml object'''
if xm... | mit | Python |
54bc9e4d75d36684a9524688a593eab5ef8a7333 | Fix typo | yuvipanda/jupyterhub-kubernetes-spawner,jupyterhub/kubespawner | tests/conftest.py | tests/conftest.py | """pytest fixtures for kubespawner"""
import os
from kubernetes.client import V1Namespace
from kubernetes.config import load_kube_config
import pytest
from traitlets.config import Config
from kubespawner.clients import shared_client
@pytest.fixture(scope="session")
def kube_ns():
"""Fixture for the kubernetes ... | """pytest fixtures for kubespawner"""
import os
from kubernetes.client import V1Namespace
from kubernetes.config import load_kube_config
import pytest
from traitlets.config import Config
from kubespawner.clients import shared_client
@pytest.fixture(scope="session")
def kube_ns():
"""Fixture for the kubernetes ... | bsd-3-clause | Python |
bad660465f87dfa5f3edfc7b50049cc6dab2df80 | fix new format | cpvargas/stacklib | tests/ez_stack.py | tests/ez_stack.py | '''
Simple script to test some functions and methods
Creates a fake catalog of 100 sources at [RA,DEC] inside fullmap area
at each position pastes beammaps of amplitude -150 on a zero fullmap,
then it performs a stack of all beams.
'''
from datetime import datetime
startTime = datetime.now()
import sys
import os
sy... | '''
Simple script to test some functions and methods
Creates a fake catalog of 100 sources at [RA,DEC] inside fullmap area
at each position pastes beammaps of amplitude -150 on a zero fullmap,
then it performs a stack of all beams.
'''
from datetime import datetime
startTime = datetime.now()
import stacklib as sl
i... | mit | Python |
de23cf5344fbd3b3a3b13111edb22bb1e519d806 | create a temp file for cookies in phantomjs if not specified | joshmgrant/selenium,Ardesco/selenium,chrisblock/selenium,Dude-X/selenium,gurayinan/selenium,Jarob22/selenium,valfirst/selenium,jabbrwcky/selenium,alb-i986/selenium,asashour/selenium,HtmlUnit/selenium,valfirst/selenium,dibagga/selenium,Dude-X/selenium,5hawnknight/selenium,asashour/selenium,juangj/selenium,SeleniumHQ/sel... | py/selenium/webdriver/phantomjs/service.py | py/selenium/webdriver/phantomjs/service.py | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 | Python |
bddcdfb59357ca5e27750d2bdbfc6d974e1a2a09 | add try-except for the user column removal shit | pajlada/pajbot,pajlada/tyggbot,pajlada/pajbot,pajlada/pajbot,pajlada/pajbot,pajlada/tyggbot,pajlada/tyggbot,pajlada/tyggbot | alembic/versions/25cf8a00d471_removed_unused_columns_in_user_table.py | alembic/versions/25cf8a00d471_removed_unused_columns_in_user_table.py | """removed unused columns in user table
Revision ID: 25cf8a00d471
Revises: 34d6f5a24cbe
Create Date: 2016-04-10 13:29:45.695493
"""
# revision identifiers, used by Alembic.
revision = '25cf8a00d471'
down_revision = '34d6f5a24cbe'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
... | """removed unused columns in user table
Revision ID: 25cf8a00d471
Revises: 34d6f5a24cbe
Create Date: 2016-04-10 13:29:45.695493
"""
# revision identifiers, used by Alembic.
revision = '25cf8a00d471'
down_revision = '34d6f5a24cbe'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
... | mit | Python |
b2f5c65cd623d01f00064c33c563ae6d4e4f5ec3 | test unicode str removed | fata1ex/django-statsy,zhebrak/django-statsy,zhebrak/django-statsy,zhebrak/django-statsy,fata1ex/django-statsy,fata1ex/django-statsy | tests/settings.py | tests/settings.py | # coding: utf-8
test_group = 'test_group'
test_event = 'test_event'
test_value_str = 'test_value'
test_value_int = 123
test_value_float = 123.0
test_label = 'test_label'
test_value_list = [test_value_str, test_value_int, test_value_float]
| # coding: utf-8
test_group = 'test_group'
test_event = 'test_event'
test_value_str = 'test_value'
test_value_unicode = u'test_value'
test_value_int = 123
test_value_float = 123.0
test_label = 'test_label'
test_value_list = [
test_value_str, test_value_unicode,
test_value_int, test_value_float
]
| mit | Python |
8f374f9e91fd8ff9527920767ac48b7c01567fd1 | Fix for Py3 | ganehag/pyMeterBus | tests/test_aux.py | tests/test_aux.py | import os
import sys
myPath = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, myPath + '/../')
import unittest
import meterbus
from meterbus.exceptions import *
class TestSequenceFunctions(unittest.TestCase):
def setUp(self):
pass
def test_manufacturer_encode(self):
intval = m... | import os
import sys
myPath = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, myPath + '/../')
import unittest
import meterbus
from meterbus.exceptions import *
class TestSequenceFunctions(unittest.TestCase):
def setUp(self):
pass
def test_manufacturer_encode(self):
intval = m... | bsd-3-clause | Python |
4c41de1307e5666d65a2e70e39d043c144709c31 | Test unsubscribe works. | ambitioninc/django-entity-emailer,ambitioninc/django-entity-emailer,wesleykendall/django-entity-emailer,wesleykendall/django-entity-emailer | entity_emailer/tests/test_tasks.py | entity_emailer/tests/test_tasks.py | from entity.models import Entity, EntityRelationship
from django.contrib.contenttypes.models import ContentType
from django.test import TestCase
from django_dynamic_fixture import G, N
from entity_emailer import tasks
from entity_emailer.models import Email, EmailType, Unsubscribed
class Test_get_email_addresses(Tes... | from entity.models import Entity, EntityRelationship
from django.contrib.contenttypes.models import ContentType
from django.test import TestCase
from django_dynamic_fixture import G, N
from entity_emailer import tasks
from entity_emailer.models import Email, Unsubscribed
class Test_get_email_addresses(TestCase):
... | mit | Python |
872151f32e0fe04340da722e10a0910019c0166e | fix patch to pluralize list view setting | StrellaGroup/frappe,frappe/frappe,yashodhank/frappe,frappe/frappe,saurabh6790/frappe,yashodhank/frappe,almeidapaulopt/frappe,mhbu50/frappe,saurabh6790/frappe,almeidapaulopt/frappe,StrellaGroup/frappe,yashodhank/frappe,almeidapaulopt/frappe,saurabh6790/frappe,saurabh6790/frappe,mhbu50/frappe,mhbu50/frappe,almeidapaulopt... | frappe/patches/v13_0/rename_list_view_setting_to_list_view_settings.py | frappe/patches/v13_0/rename_list_view_setting_to_list_view_settings.py | # Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
if frappe.db.table_exists('List View Setting'):
if not frappe.db.table_exists('List View Settings'):
frappe.reload_doctype("List View Settings... | # Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
if frappe.db.table_exists('List View Setting'):
existing_list_view_settings = frappe.get_all('List View Settings', as_list=True)
for list_view_... | mit | Python |
bfbb1e4fb8324df9a039c18359c053190f9e7e64 | Make config list able to handle long values | gamechanger/dusty,gamechanger/dusty,gamechanger/dusty,gamechanger/dusty,gamechanger/dusty | dusty/commands/manage_config.py | dusty/commands/manage_config.py | import textwrap
from prettytable import PrettyTable
from ..config import get_config, save_config_value
from .. import constants
from ..log import log_to_client
def _eligible_config_keys_for_setting():
config = get_config()
return [key for key in sorted(constants.CONFIG_SETTINGS.keys())
if key ... | import textwrap
from prettytable import PrettyTable
from ..config import get_config, save_config_value
from .. import constants
from ..log import log_to_client
def _eligible_config_keys_for_setting():
config = get_config()
return [key for key in sorted(constants.CONFIG_SETTINGS.keys())
if key ... | mit | Python |
d34fbc70d5873d159c311caed41b745b05534ce9 | Read Input: Read file complete or by lines | unstko/adventofcode2016 | lib/solution.py | lib/solution.py | class Solution:
def __init__(self, nr):
self.nr = nr
self.test = False
self.input = ""
self.solution = ["(not calculated)", "(not calculated)"]
self.calculated = [False, False]
def __str__(self):
return "Solution 1: {}\nSolution 2: {}".format(self.solution[0], se... | class Solution:
def __init__(self, nr):
self.nr = nr
self.test = False
self.input = ""
self.solution = ["(not calculated)", "(not calculated)"]
self.calculated = [False, False]
def __str__(self):
return "Solution 1: {}\nSolution 2: {}".format(self.solution[0], se... | mit | Python |
0f8b6f4a12c23e5498e8135a3f39da40c4333788 | Add a function which allows packet dumps to be produced easily for inserting into regression tests. | gvnn3/PCS,gvnn3/PCS | tests/hexdumper.py | tests/hexdumper.py | # This hack by: Raymond Hettinger
class hexdumper:
"""Given a byte array, turn it into a string. hex bytes to stdout."""
def __init__(self):
self.FILTER=''.join([(len(repr(chr(x)))==3) and chr(x) or '.' \
for x in range(256)])
# pretty dumping hate machine.
def dump(self, src, length=8):
re... | # This hack by: Raymond Hettinger
class hexdumper:
"""Given a byte array, turn it into a string. hex bytes to stdout."""
def __init__(self):
self.FILTER=''.join([(len(repr(chr(x)))==3) and chr(x) or '.' \
for x in range(256)])
def dump(self, src, length=8):
result=[]
for i in xrange(0, len(src... | bsd-3-clause | Python |
f3b0d41054df95a762557a96d93d49fbd9bf00ff | Remove network parameter input | backpacker69/pypeerassets,PeerAssets/pypeerassets | tests/kutiltest.py | tests/kutiltest.py | import unittest
from hashlib import sha256
from pypeerassets.kutil import Kutil
class KutilTestCase(unittest.TestCase):
@classmethod
def setUpClass(cls):
print('''Starting Kutil class tests.
This class handles all things cryptography.''')
def test_network_parameter_load(self):
... | import unittest
from hashlib import sha256
from pypeerassets.kutil import Kutil
class KutilTestCase(unittest.TestCase):
@classmethod
def setUpClass(cls):
print('''Starting Kutil class tests.
This class handles all things cryptography.''')
def test_network_parameter_load(self):
... | bsd-3-clause | Python |
15bf95dad618b605de0ac46a0fc19e7132e81245 | add test for login | gitgik/flask-rest-api,gitgik/flask-rest-api | tests/test_auth.py | tests/test_auth.py | import unittest
import json
from app import create_app, db
class AuthTestCase(unittest.TestCase):
"""Test case for the authentication blueprint."""
def setUp(self):
"""Set up test variables."""
self.app = create_app(config_name="testing")
self.client = self.app.test_client
sel... | import unittest
import json
from app import create_app, db
class AuthTestCase(unittest.TestCase):
"""Test case for the authentication blueprint."""
def setUp(self):
"""Set up test variables."""
self.app = create_app(config_name="testing")
self.client = self.app.test_client
sel... | mit | Python |
72036d3d65a78973e98d1a2085cf4b1f444852ff | fix test class | devlights/try-python | tests/test_libs.py | tests/test_libs.py | import io
import os
import re
import time
import trypython.common.commonfunc as libs
def test_chdir():
# arrange
orig_dir = os.path.abspath('.')
dest_dir = os.path.abspath('/tmp')
os.chdir(orig_dir)
assert orig_dir == os.path.abspath(os.curdir)
# act
with libs.chdir(dest_dir) as current... | import io
import os
import re
import time
import trypython.common.commonfunc as libs
def test_chdir():
# arrange
orig_dir = os.path.abspath('.')
dest_dir = os.path.abspath('/tmp')
os.chdir(orig_dir)
assert orig_dir == os.path.abspath(os.curdir)
# act
with libs.chdir(dest_dir) as current... | mit | Python |
713572fa6f68899955de4d9f7c5e3c685d89cf2e | test with broken link source conflict | arecarn/dploy | tests/test_link.py | tests/test_link.py | """
Tests for the link sub command
"""
# pylint: disable=unused-argument
# pylint: disable=missing-docstring
# disable lint errors for function names longer that 30 characters
# pylint: disable=invalid-name
import os
import pytest
import dploy
import util
def test_link_directory(source_a, dest):
dploy.link(['sou... | """
Tests for the link sub command
"""
# pylint: disable=unused-argument
# pylint: disable=missing-docstring
# disable lint errors for function names longer that 30 characters
# pylint: disable=invalid-name
import os
import pytest
import dploy
import util
def test_link_directory(source_a, dest):
dploy.link(['sou... | mit | Python |
b46cf19729a101b5c31492c420c0bbef37b05323 | Update auth finalize to request permanent auth_token given code after installing app | Shopify/shopify_django_app,Shopify/shopify_django_app | shopify_app/views.py | shopify_app/views.py | from django.shortcuts import render_to_response, redirect
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.template import RequestContext
from django.conf import settings
import shopify
def _return_address(request):
return request.session.get('return_to') or reverse('roo... | from django.shortcuts import render_to_response, redirect
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.template import RequestContext
from django.conf import settings
import shopify
def _return_address(request):
return request.session.get('return_to') or reverse('roo... | mit | Python |
601a31de9c4175fcd112c3cee2248e490de55eb9 | Add more tests | wong2/pick | tests/test_pick.py | tests/test_pick.py | #-*-coding:utf-8-*-
import unittest
from pick import Picker
class TestPick(unittest.TestCase):
def test_move_up_down(self):
title = 'Please choose an option: '
options = ['option1', 'option2', 'option3']
picker = Picker(options, title)
picker.move_up()
assert picker.get_s... | #-*-coding:utf-8-*-
import unittest
from pick import pick, Picker
class TestPick(unittest.TestCase):
def test_pick(self):
title = 'Please choose an option: '
options = ['option1', 'option2', 'option3']
picker = Picker(options, title)
picker.move_up()
assert picker.get_sel... | mit | Python |
9d87b19a1a5a39e4b18278fad4851dbe2e7459c3 | clean up formatting in settings.py | tobiasmcnulty/django-cache-machine,janusnic/django-cache-machine,blag/django-cache-machine,django-cache-machine/django-cache-machine | examples/cache_machine/settings.py | examples/cache_machine/settings.py | CACHES = {
'default': {
'BACKEND': 'caching.backends.memcached.PyLibMCCache',
'LOCATION': 'localhost:11211',
},
}
TEST_RUNNER = 'django_nose.runner.NoseTestSuiteRunner'
DATABASES = {
'default': {
'NAME': ':memory:',
'ENGINE': 'django.db.backends.sqlite3',
},
'slave'... | CACHES = {
'default': {
'BACKEND': 'caching.backends.memcached.PyLibMCCache',
'LOCATION': 'localhost:11211',
},
}
TEST_RUNNER = 'django_nose.runner.NoseTestSuiteRunner'
DATABASES = {
'default': {
'NAME': ':memory:',
'ENGINE': 'django.db.backends.sqlite3',
},
'slave'... | bsd-3-clause | Python |
40ba5a610cb51944f70250c9f005c3d2307c4d3f | Update cli parameters | AlexMathew/litslist | litslist/cmd.py | litslist/cmd.py | """
Usage:
litslist (-h | --help | --version)
litslist create <count>
Options:
-h, --help
Show this help message and exit
--version
Display the version of Scrapple
"""
from __future__ import print_function
from docopt import docopt
from . import commands
def runCLI():
"""
CLI... | """
Usage:
litslist create
Options:
-h, --help
Show this help message and exit
--version
Display the version of Scrapple
"""
from __future__ import print_function
from docopt import docopt
from . import commands
def runCLI():
"""
CLI controller for litslist command
"""
ar... | mit | Python |
8d43f902fc24217bbed3e703c8c87654fd4e4d8f | fix typo | dmargala/tpcorr | examples/find_validation_plates.py | examples/find_validation_plates.py | #!/usr/bin/env python
import numpy as np
import astropy.table
import bossdata.meta
def main():
meta_db = bossdata.meta.Database(lite=False, verbose=True)
meta_db.cursor.execute('SELECT PLATE,MJD,FIBER FROM meta WHERE ((ANCILLARY_TARGET2&(1<<20))>0)')
rows = meta_db.cursor.fetchall()
table = astropy.table.Table... | #!/usr/bin/env python
import numpy as np
import astropy.table
import bossdata.meta
def main():
meta_db = bossdata.meta.Database(lite=False, verbose=True)
meta_db.cursor.execute('SELECT PLATE,MJD,FIBER FROM meta WHERE ((ANCILLARY_TARGET2&(1<<20))>0)')
rows = meta_db.cursor.fetchall()
table = astropy.table.Table... | mit | Python |
93ba3a0f51cd1d48b4f21950c962019ce8b20d7a | Update version.py | sagasurvey/saga,sagasurvey/saga | SAGA/version.py | SAGA/version.py | """
SAGA package version
"""
__version__ = "0.12.1"
| """
SAGA package version
"""
__version__ = "0.12.0"
| mit | Python |
48bde7a86956610bafd9c4dd4bf45c6a15ac9828 | adjust cache time of bridge account | uw-it-aca/bridge-sis-provisioner,uw-it-aca/bridge-sis-provisioner | sis_provisioner/cache_implementation.py | sis_provisioner/cache_implementation.py | import re
from django.conf import settings
from restclients.cache_implementation import MemcachedCache, TimedCache
from restclients.exceptions import DataFailureException
FIVE_SECONDS = 5
FIFTEEN_MINS = 60 * 15
HALF_HOUR = 60 * 30
ONE_HOUR = 60 * 60
FOUR_HOURS = 60 * 60 * 4
EIGHT_HOURS = 60 * 60 * 8
ONE_DAY = 60 * 60... | import re
from django.conf import settings
from restclients.cache_implementation import MemcachedCache, TimedCache
from restclients.exceptions import DataFailureException
FIVE_SECONDS = 5
FIFTEEN_MINS = 60 * 15
ONE_HOUR = 60 * 60
FOUR_HOURS = 60 * 60 * 4
ONE_DAY = 60 * 60 * 24
ONE_WEEK = 60 * 60 * 24 * 7
def get_ca... | apache-2.0 | Python |
253fae940c78df55f0dcdaf2515ba0ed157a8f15 | load System Settings graph when setting up the system, re #1631 | archesproject/arches,archesproject/arches,cvast/arches,archesproject/arches,cvast/arches,cvast/arches,cvast/arches,archesproject/arches | arches/app/models/migrations/0002.py | arches/app/models/migrations/0002.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2017-04-24 13:08
from __future__ import unicode_literals
import os
import uuid
import django.db.models.deletion
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
from django.core import management
from arches.app.models.system_se... | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2017-04-24 13:08
from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
dependencies = [
('mode... | agpl-3.0 | Python |
c648d397049a600a5434441ea4a6f1a5f05a511a | Update makeBuild.py to actually create lower-case vessel object with Vessel as alias | shiplab/vesseljs,shiplab/vesseljs,shiplab/vesseljs | tools/makeBuild.py | tools/makeBuild.py | #Now the "geeky" md5 hash and archiving is disabled. It was of no practical use, really.
from datetime import datetime
classes = ["JSONSpecObject.js", "Ship.js", "Structure.js", "Hull.js", "BaseObject.js", "DerivedObject.js", "ShipState.js", "StateModule.js", "WaveCreator.js", "WaveMotion.js", "Positioning.js", "Fuel... | #Now the "geeky" md5 hash and archiving is disabled. It was of no practical use, really.
from datetime import datetime
classes = ["JSONSpecObject.js", "Ship.js", "Structure.js", "Hull.js", "BaseObject.js", "DerivedObject.js", "ShipState.js", "StateModule.js", "WaveCreator.js", "WaveMotion.js", "Positioning.js", "Fuel... | mit | Python |
503ba661c388e2fcae6d648dd80f05843442bdd6 | Clean up GLM example | yarikoptic/pystatsmodels,detrout/debian-statsmodels,rgommers/statsmodels,wdurhamh/statsmodels,wdurhamh/statsmodels,bert9bert/statsmodels,wkfwkf/statsmodels,wzbozon/statsmodels,detrout/debian-statsmodels,bzero/statsmodels,DonBeo/statsmodels,nguyentu1602/statsmodels,nguyentu1602/statsmodels,bsipocz/statsmodels,josef-pkt/... | examples/example_formula_glm.py | examples/example_formula_glm.py | """GLM Formula Example
"""
import statsmodels.api as sm
import numpy as np
star98 = sm.datasets.star98.load_pandas().data
formula = 'SUCCESS ~ LOWINC + PERASIAN + PERBLACK + PERHISP + PCTCHRT '
formula += '+ PCTYRRND + PERMINTE*AVYRSEXP*AVSALK + PERSPENK*PTRATIO*PCTAF'
dta = star98[["NABOVE", "NBELOW", "LOWINC", "P... | import statsmodels.api as sm
import numpy as np
star98 = sm.datasets.star98.load_pandas().data
formula = 'SUCCESS ~ LOWINC + PERASIAN + PERBLACK + PERHISP + PCTCHRT '
formula += '+ PCTYRRND + PERMINTE*AVYRSEXP*AVSALK + PERSPENK*PTRATIO*PCTAF'
dta = star98[["NABOVE", "NBELOW", "LOWINC", "PERASIAN", "PERBLACK", "PERHI... | bsd-3-clause | Python |
21830028c62dd551646002021d5518813b0b407c | Delete Makefiles after cmake is generated | f0rki/cb-multios,f0rki/cb-multios,f0rki/cb-multios,f0rki/cb-multios,f0rki/cb-multios | tools/makefiles.py | tools/makefiles.py | #!/usr/bin/env python
import glob
import os
import re
TOOLS_DIR = os.path.dirname(os.path.abspath(__file__))
CHAL_DIR = os.path.join(os.path.dirname(TOOLS_DIR), 'cqe-challenges')
def generate_cmake(path):
# Path to the new CMakelists.txt
cmake_path = os.path.join(os.path.dirname(path), 'CMakeLists.txt')
... | #!/usr/bin/env python
import glob
import os
import re
TOOLS_DIR = os.path.dirname(os.path.abspath(__file__))
CHAL_DIR = os.path.join(os.path.dirname(TOOLS_DIR), 'cqe-challenges')
def generate_cmake(path):
# Path to the new CMakelists.txt
cmake_path = os.path.join(os.path.dirname(path), 'CMakeLists.txt')
... | mit | Python |
06e84c25bb783490c963963ccb44cf07d521a197 | Reword docstrings for exception classes | piotr-rusin/spam-lists | spam_lists/exceptions.py | spam_lists/exceptions.py | # -*- coding: utf-8 -*-
class SpamBLError(Exception):
'''There was an error during testing a url or host'''
class UnknownCodeError(SpamBLError):
'''The classification code from the service was not recognized'''
class UnathorizedAPIKeyError(SpamBLError):
'''The API key used to query the service wa... | # -*- coding: utf-8 -*-
class SpamBLError(Exception):
''' Base exception class for spambl module '''
class UnknownCodeError(SpamBLError):
''' Raise when trying to use an unexpected value of dnsbl return code '''
class UnathorizedAPIKeyError(SpamBLError):
''' Raise when trying to use an unathorize... | mit | Python |
e92ffbebf8affb93837d196e830c58ec5c8a87cc | update script | daftscience/Labrador,daftscience/Labrador,daftscience/Labrador,daftscience/Labrador | scripts/gpio_functions.py | scripts/gpio_functions.py | from gpiozero import Button
import git
import subprocess
GIT_PATH = '/home/pi/projects/labrador/'
restart_supervisor = "supervisorctl reload"
def update():
print("Update")
g = git.cmd.Git(GIT_PATH)
g.pull()
process = subprocess.Popen(restart_supervisor.split(), stdout=subprocess.PIPE)
output, err... | from gpiozero import Button
import git
import subprocess
GIT_PATH = '/home/pi/projects/labrador/'
restart_supervisor = "supervisorctl reload"
def update():
print("Update")
g = git.cmd.Git(GIT_PATH)
g.pull()
process = subprocess.Popen(bashCommand.split(), stdout=subprocess.PIPE)
output, error = pr... | bsd-3-clause | Python |
9175f999c2394b1b1e5f2fa9bfb962f120a831a0 | Add actions and id as part of the constructor | brainbots/assistant | assisstant/bots/bots/abstract_bot.py | assisstant/bots/bots/abstract_bot.py | from abc import ABC, abstractmethod, abstractproperty
class AbstractBot(ABC):
def __init__(self, id, actions):
self.id = id
self.actions = actions
@abstractmethod
def validate_intent(self, intent):
return
@abstractmethod
def execute(self, intent):
return
| from abc import ABC, abstractmethod, abstractproperty
class AbstractBot(ABC):
# @abstractmethod
# @abstractproperty
# def id(self, id):
# pass
# @abstractmethod
def __init__(self, id):
self.id = id
@abstractmethod
def validate_intent(self, intent):
pass
@abstractmethod
def validate_intent(self, intent... | apache-2.0 | Python |
260e3a546e56edb59b6d04f754e6033734ee1c7a | Tweak runner_spec descriptions. | winstonwolff/expectorant | specs/runner_spec.py | specs/runner_spec.py | from expectorant import *
from expectorant import runner
import glob
@describe('runner')
def _():
@describe('find_files()')
def _():
@it('returns *_spec.py files in current directory when args=[]')
def _():
args = []
expect(runner.find_files(args)) == glob.glob('./**/*... | from expectorant import *
from expectorant import runner
import glob
@describe('runner')
def _():
@describe('find_files()')
def _():
@it('returns fileenames in spec/ when args=[]')
def _():
args = []
expect(runner.find_files(args)) == glob.glob('./**/*_spec.py', recurs... | mit | Python |
04f4d01914c72c664b2d3e2f362dd7d37a06e326 | Bump version | atugushev/django-static-pages | static_pages/__init__.py | static_pages/__init__.py | VERSION = '0.1.1'
| VERSION = '0.1'
| mit | Python |
d5bcfd724966a497d0bde02da7f2061a228c67cd | Update dependencies for apidoc. | dart-archive/dart-sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-lang/sdk,dart-lang/sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-lang/sdk,... | utils/apidoc/apidoc.gyp | utils/apidoc/apidoc.gyp | # Copyright (c) 2012, 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.
{
'targets': [
{
'target_name': 'api_docs',
'type': 'none',
'dependencies': [
... | # Copyright (c) 2012, 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.
{
'targets': [
{
'target_name': 'api_docs',
'type': 'none',
'dependencies': [
... | bsd-3-clause | Python |
903c192657b6b714b9c8aada7c08c7e6dc013d45 | Check if the post_to_twitter value has been submitted in the form. | disqus/overseer | overseer/admin.py | overseer/admin.py | from django import forms
from django.contrib import admin
from overseer import conf
from overseer.models import Service, Event, EventUpdate
class ServiceAdmin(admin.ModelAdmin):
list_display = ('name', 'status', 'order', 'date_updated')
search_fields = ('name', 'description')
prepopulated_fields = {'slug'... | from django import forms
from django.contrib import admin
from overseer import conf
from overseer.models import Service, Event, EventUpdate
class ServiceAdmin(admin.ModelAdmin):
list_display = ('name', 'status', 'order', 'date_updated')
search_fields = ('name', 'description')
prepopulated_fields = {'slug'... | apache-2.0 | Python |
b06630128e4fe91000a27c9dbbc70656d5347bfd | Change name in conflicts | catroot/rethinkdb,eliangidoni/rethinkdb,4talesa/rethinkdb,captainpete/rethinkdb,Qinusty/rethinkdb,mbroadst/rethinkdb,KSanthanam/rethinkdb,wkennington/rethinkdb,4talesa/rethinkdb,alash3al/rethinkdb,captainpete/rethinkdb,robertjpayne/rethinkdb,pap/rethinkdb,JackieXie168/rethinkdb,nviennot/rethinkdb,spblightadv/rethinkdb,... | test/interface/conflict.py | test/interface/conflict.py | #!/usr/bin/env python
import sys, os, time
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir, 'common')))
import driver, http_admin, scenario_common
from vcoptparse import *
op = OptParser()
scenario_common.prepare_option_parser_mode_flags(op)
opts = op.parse(sys.argv)
with driver... | #!/usr/bin/env python
import sys, os, time
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir, 'common')))
import driver, http_admin, scenario_common
from vcoptparse import *
op = OptParser()
scenario_common.prepare_option_parser_mode_flags(op)
opts = op.parse(sys.argv)
with driver... | apache-2.0 | Python |
934f5d9060516bd8866fe217cd30666efba66fbf | Fix ORF TVthek plugin (#113) | melmorabity/streamlink,fishscene/streamlink,bastimeyer/streamlink,gravyboat/streamlink,back-to/streamlink,melmorabity/streamlink,ethanhlc/streamlink,beardypig/streamlink,mmetak/streamlink,sbstp/streamlink,wlerin/streamlink,gravyboat/streamlink,bastimeyer/streamlink,chhe/streamlink,mmetak/streamlink,back-to/streamlink,f... | src/streamlink/plugins/orf_tvthek.py | src/streamlink/plugins/orf_tvthek.py | import re, json
from streamlink.plugin import Plugin, PluginError
from streamlink.plugin.api import http
from streamlink.stream import HLSStream
_stream_url_re = re.compile(r'https?://tvthek\.orf\.at/(index\.php/)?live/(?P<title>[^/]+)/(?P<id>[0-9]+)')
_vod_url_re = re.compile(r'https?://tvthek\.orf\.at/pro(gram|file... | import re, json
from streamlink.plugin import Plugin, PluginError
from streamlink.plugin.api import http
from streamlink.stream import HLSStream
_stream_url_re = re.compile(r'https?://tvthek\.orf\.at/live/(?P<title>[^/]+)/(?P<id>[0-9]+)')
_vod_url_re = re.compile(r'https?://tvthek\.orf\.at/program/(?P<showtitle>[^/]+... | bsd-2-clause | Python |
4ca292e53710dd4ef481e7fa5965e22d3f94e65b | Index and code improve cnab.return.move.code | akretion/l10n-brazil,OCA/l10n-brazil,akretion/l10n-brazil,akretion/l10n-brazil,OCA/l10n-brazil,OCA/l10n-brazil | l10n_br_account_payment_order/models/cnab_return_move_code.py | l10n_br_account_payment_order/models/cnab_return_move_code.py | # Copyright 2020 Akretion
# @author Magno Costa <magno.costa@akretion.com.br>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, api, fields
class CNABReturnMoveCode(models.Model):
"""
CNAB return code, each Bank can has a list of Codes
"""
_name = 'cnab.retu... | # Copyright 2020 Akretion
# @author Magno Costa <magno.costa@akretion.com.br>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, api, fields
class CNABReturnMoveCode(models.Model):
"""
CNAB return code, each Bank can has a list of Codes
"""
_name = 'cnab.retu... | agpl-3.0 | Python |
379966b284c7273c0039689521d0e8f40463ad10 | fix progress.py | wujf/rethinkdb,yaolinz/rethinkdb,KSanthanam/rethinkdb,elkingtonmcb/rethinkdb,alash3al/rethinkdb,Wilbeibi/rethinkdb,sontek/rethinkdb,wkennington/rethinkdb,mbroadst/rethinkdb,tempbottle/rethinkdb,yakovenkodenis/rethinkdb,sbusso/rethinkdb,dparnell/rethinkdb,JackieXie168/rethinkdb,mcanthony/rethinkdb,wujf/rethinkdb,jessedi... | test/interface/progress.py | test/interface/progress.py | #!/usr/bin/env python
import sys, os, time
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir, 'common')))
import driver, http_admin, scenario_common
from memcached_workload_common import MemcacheConnection
from vcoptparse import *
op = OptParser()
scenario_common.prepare_option_par... | #!/usr/bin/env python
import sys, os, time
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir, 'common')))
import driver, http_admin, scenario_common
from workload_common import MemcacheConnection
from vcoptparse import *
op = OptParser()
scenario_common.prepare_option_parser_mode_f... | agpl-3.0 | Python |
7fab76d312e20f0419274836e93415f632f398e2 | clean up | yassersouri/omgh,yassersouri/omgh | src/storage.py | src/storage.py | import os
import scipy.io
import numpy as np
class datastore(object):
LARGE_FILE_FORMAT = '%s_%d.mat'
def __init__(self, base_path, global_key='global_key'):
self.base_path = base_path
self.global_key = global_key
@classmethod
def ensure_dir(cls, path):
if not os.path.exists... | import os
import scipy.io
import numpy as np
from glob import glob
class datastore(object):
LARGE_FILE_FORMAT = '%s_%d.mat'
def __init__(self, base_path, global_key='global_key'):
self.base_path = base_path
self.global_key = global_key
@classmethod
def ensure_dir(cls, path):
... | mit | Python |
79d19d20cdabc7c139bc55704523f8a1ea050292 | sort commands properly | rgs1/xcmd | xcmd/tests/test_xcmd.py | xcmd/tests/test_xcmd.py | # -*- coding: utf-8 -*-
""" test xcmd proper """
import unittest
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from xcmd.xcmd import (
ensure_params,
Optional,
Required,
XCmd
)
class XCmdTestCase(unittest.TestCase):
""" Xcmd tests cases """
@classm... | # -*- coding: utf-8 -*-
""" test xcmd proper """
import unittest
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from xcmd.xcmd import (
ensure_params,
Optional,
Required,
XCmd
)
class XCmdTestCase(unittest.TestCase):
""" Xcmd tests cases """
@classm... | apache-2.0 | Python |
23a1e1a9963412a33c2a4d91b63b29a76237644b | Set default feature value to 0.0 | fawcettc/planning-features,fawcettc/planning-features,fawcettc/planning-features,fawcettc/planning-features | extractors/feature_extractor.py | extractors/feature_extractor.py | #!/usr/bin/env python2.7
# encoding: utf-8
import os
import sys
from subprocess import Popen, PIPE
import tempfile
class FeatureExtractor(object):
'''
abstract feature extractor
'''
def __init__(self, args):
self.memory_limit = args.mem_limit
self.runtime_limit = args.per_extractio... | #!/usr/bin/env python2.7
# encoding: utf-8
import os
import sys
from subprocess import Popen, PIPE
import tempfile
class FeatureExtractor(object):
'''
abstract feature extractor
'''
def __init__(self, args):
self.memory_limit = args.mem_limit
self.runtime_limit = args.per_extractio... | agpl-3.0 | Python |
6675586f061cf2cde25a36b0df04e0d22d7bfdee | Update version.py | istresearch/traptor,istresearch/traptor | traptor/version.py | traptor/version.py | __version__ = '4.0.9'
if __name__ == '__main__':
print(__version__)
| __version__ = '4.0.8'
if __name__ == '__main__':
print(__version__)
| mit | Python |
25e5157785ee9dd7a3bbb606b1f7642342936d18 | call drop # 2 | wfxiang08/sqlalchemy,olemis/sqlalchemy,monetate/sqlalchemy,dstufft/sqlalchemy,elelianghh/sqlalchemy,inspirehep/sqlalchemy,j5int/sqlalchemy,ThiefMaster/sqlalchemy,WinterNis/sqlalchemy,pdufour/sqlalchemy,bdupharm/sqlalchemy,davidjb/sqlalchemy,Akrog/sqlalchemy,Cito/sqlalchemy,Cito/sqlalchemy,sandan/sqlalchemy,276361270/sq... | test/profiling/compiler.py | test/profiling/compiler.py | import testenv; testenv.configure_for_tests()
from sqlalchemy import *
from testlib import *
class CompileTest(TestBase, AssertsExecutionResults):
def setUpAll(self):
global t1, t2, metadata
metadata = MetaData()
t1 = Table('t1', metadata,
Column('c1', Integer, primary_key=True... | import testenv; testenv.configure_for_tests()
from sqlalchemy import *
from testlib import *
class CompileTest(TestBase, AssertsExecutionResults):
def setUpAll(self):
global t1, t2, metadata
metadata = MetaData()
t1 = Table('t1', metadata,
Column('c1', Integer, primary_key=True... | mit | Python |
fb95fb39861e4924af729fd1512d6de89ebdef94 | Add parameter for change report path | sequana/sequana,sequana/sequana,sequana/sequana,sequana/sequana,sequana/sequana | sequana/report_mapping.py | sequana/report_mapping.py | # Import -----------------------------------------------------------------------
import os
from reports import HTMLTable
from sequana.report_main import BaseReport
# Class ------------------------------------------------------------------------
class MappingReport(BaseReport):
"""
"""
def __init__(self, l... | # Import -----------------------------------------------------------------------
import os
from reports import HTMLTable
from sequana.report_main import BaseReport
# Class ------------------------------------------------------------------------
class MappingReport(BaseReport):
"""
"""
def __init__(self, l... | bsd-3-clause | Python |
bb588a10240c53ebd5b161ae81352bbf0d5cd985 | fix league ordering | a2ultimate/ultimate-league-app,rdonnelly/ultimate-league-app,rdonnelly/ultimate-league-app,a2ultimate/ultimate-league-app,rdonnelly/ultimate-league-app,a2ultimate/ultimate-league-app,a2ultimate/ultimate-league-app,rdonnelly/ultimate-league-app | src/ultimate/templatetags/leagues.py | src/ultimate/templatetags/leagues.py | from django import template
from django.utils import timezone
from ultimate.leagues.models import League
register = template.Library()
@register.filter
def sort_by_league_start_date_weekday(league_divisions):
divisions = [d for d in league_divisions if d.type == League.LEAGUE_TYPE_LEAGUE]
divisions.sort(ke... | from django import template
from django.utils import timezone
from ultimate.leagues.models import League
register = template.Library()
@register.filter
def sort_by_league_start_date_weekday(divisions):
leagues = filter(lambda k: k.type == League.LEAGUE_TYPE_LEAGUE, divisions)
leagues.sort(key=lambda k: k.l... | bsd-3-clause | Python |
3b9e9d6ac573472aa68bc1d34e22fc27109045c0 | Update the build version | vlegoff/cocomud | src/version.py | src/version.py | BUILD = 11
| BUILD = 9
| bsd-3-clause | Python |
327a255a1ab7fd4b50898ebbeadf27235d6331e6 | Print auth url to console | commaai/openpilot,commaai/openpilot,commaai/openpilot,commaai/openpilot,commaai/openpilot,commaai/openpilot | tools/lib/auth.py | tools/lib/auth.py | #!/usr/bin/env python3
import json
import os
import sys
import webbrowser
from http.server import HTTPServer, BaseHTTPRequestHandler
from urllib.parse import urlencode, parse_qs
from common.file_helpers import mkdirs_exists_ok
from tools.lib.api import CommaApi, APIError
from tools.lib.auth_config import set_token
cl... | #!/usr/bin/env python3
import json
import os
import sys
import webbrowser
from http.server import HTTPServer, BaseHTTPRequestHandler
from urllib.parse import urlencode, parse_qs
from common.file_helpers import mkdirs_exists_ok
from tools.lib.api import CommaApi, APIError
from tools.lib.auth_config import set_token
cl... | mit | Python |
c93eff1b0d9e8a833829c2c697868a5fee5b33fd | Add JSON decoder for datetime timestamp | hoh/Billabong,hoh/Billabong | billabong/utils.py | billabong/utils.py | # Copyright (c) 2015 "Hugo Herter http://hugoherter.com"
#
# This file is part of Billabong.
#
# Intercom is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your o... | # Copyright (c) 2015 "Hugo Herter http://hugoherter.com"
#
# This file is part of Billabong.
#
# Intercom is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your o... | agpl-3.0 | Python |
3a8d78b024033e6cd74ebd787aab2e3cef719f82 | modify models to return human friendly repr | texastribune/tribwire,texastribune/tribwire,texastribune/tribwire,texastribune/tribwire | tribwire/models.py | tribwire/models.py | from django.db import models
from django.contrib import admin
from django.contrib.auth import get_user_model
class Link(models.Model):
url = models.URLField(unique=True)
headline = models.CharField(max_length=128)
blurb = models.CharField(max_length=128)
date_suggested = models.DateField()
user = ... | from django.db import models
from django.contrib import admin
from django.contrib.auth import get_user_model
class Link(models.Model):
url = models.URLField(unique=True)
headline = models.CharField(max_length=128)
blurb = models.CharField(max_length=128)
date_suggested = models.DateField()
user = ... | apache-2.0 | Python |
e7cc149ed3a338956dc5003e100890395f50c9cd | fix get_probe | 20c/vaping,20c/vaping | vaping/__init__.py | vaping/__init__.py | from __future__ import absolute_import
# import to namespace
from .config import Config # noqa
from pluginmgr.config import ConfigPluginManager
class PluginManager(ConfigPluginManager):
def get_probe(self, node, pctx):
obj = self.get_instance(node, pctx)
if not hasattr(obj, 'probe'):
... | from __future__ import absolute_import
# import to namespace
from .config import Config # noqa
from pluginmgr.config import ConfigPluginManager
class PluginManager(ConfigPluginManager):
def get_probe(self, node, pctx):
obj = self.get_instance(node, pctx)
if not hasattr(obj, 'probe'):
... | apache-2.0 | Python |
b6a20a1743cf6a4aaa31ebd6c946e63c997612ee | add read method to service | mylokin/servy | servy/client.py | servy/client.py | from __future__ import absolute_import
import urllib2
import urlparse
import servy.proto as proto
import servy.exc as exc
class Service(object):
def __init__(self, name, host):
self.name = name
self.host = host
@property
def url(self):
url = {
'scheme': 'http',
... | from __future__ import absolute_import
import urllib2
import urlparse
import servy.proto as proto
import servy.exc as exc
class Service(object):
def __init__(self, name, host):
self.name = name
self.host = host
@property
def url(self):
url = {
'scheme': 'http',
... | mit | Python |
b8c2a8713b5b6e95f671adfbf446c1030507f117 | add concat and mapcat to top level imports | jcrist/toolz,simudream/toolz,quantopian/toolz,jdmcbr/toolz,berrytj/toolz,JNRowe/toolz,machinelearningdeveloper/toolz,llllllllll/toolz,whilo/toolz,quantopian/toolz,machinelearningdeveloper/toolz,Julian-O/toolz,karansag/toolz,bartvm/toolz,llllllllll/toolz,Julian-O/toolz,jdmcbr/toolz,pombredanne/toolz,obmarg/toolz,karansa... | toolz/__init__.py | toolz/__init__.py | from .itertoolz import (groupby, countby, frequencies, reduceby,
first, second, nth, take, drop, rest, last, get,
merge_sorted, concat, mapcat,
interleave, unique, intersection, iterable, distinct)
from .functoolz import (remove, iterate, accumulate,
memoize, curry, comp,
thread... | from .itertoolz import (groupby, countby, frequencies, reduceby,
first, second, nth, take, drop, rest, last, get,
merge_sorted,
interleave, unique, intersection, iterable, distinct)
from .functoolz import (remove, iterate, accumulate,
memoize, curry, comp,
thread_first, thread_l... | bsd-3-clause | Python |
c6942fd8ad26d4d31e07fa6ef1554b6d83501255 | Support for ValuesQuerySet / ValuesListQuerySet | acdha/django-queryset-transform | queryset_transform/__init__.py | queryset_transform/__init__.py | from django.db import models
class TransformQuerySetMixin(object):
def __init__(self, *args, **kwargs):
super(TransformQuerySetMixin, self).__init__(*args, **kwargs)
self._transform_fns = []
def _clone(self, klass=None, setup=False, **kwargs):
c = super(TransformQuerySetMixin, self)._... | from django.db import models
class TransformQuerySetMixin(object):
def __init__(self, *args, **kwargs):
super(TransformQuerySetMixin, self).__init__(*args, **kwargs)
self._transform_fns = []
def _clone(self, klass=None, setup=False, **kw):
c = super(TransformQuerySetMixin, self)._clone... | bsd-3-clause | Python |
8db28d6d27b63535d21a44e6f9a20f991ec2556a | Update AWS::EFS::FileSystem per 2020-06-16 changes | cloudtools/troposphere,cloudtools/troposphere | troposphere/efs.py | troposphere/efs.py | from . import AWSObject, AWSProperty, Tags
from .validators import boolean
Bursting = 'bursting'
Provisioned = 'provisioned'
def throughput_mode_validator(mode):
valid_modes = [Bursting, Provisioned]
if mode not in valid_modes:
raise ValueError(
'ThroughputMode must be one of: "%s"' % (',... | from . import AWSObject, AWSProperty, Tags
from .validators import boolean
Bursting = 'bursting'
Provisioned = 'provisioned'
def throughput_mode_validator(mode):
valid_modes = [Bursting, Provisioned]
if mode not in valid_modes:
raise ValueError(
'ThroughputMode must be one of: "%s"' % (',... | bsd-2-clause | Python |
d21676fca075009ee4ff8d1bb979989ea4460c7c | compress output addin files. | genegis/genegis,genegis/genegis,genegis/genegis | makeaddin.py | makeaddin.py | import os
import re
import zipfile
current_path = os.path.dirname(os.path.abspath(__file__))
out_zip_name = os.path.join(current_path,
os.path.basename(current_path) + ".esriaddin")
backup_patterns = {
'PLUGIN_BACKUP_PATTERN': re.compile(".*_addin_[0-9]+[.]py$", re.IGNORECA... | import os
import re
import zipfile
current_path = os.path.dirname(os.path.abspath(__file__))
out_zip_name = os.path.join(current_path,
os.path.basename(current_path) + ".esriaddin")
backup_patterns = {
'PLUGIN_BACKUP_PATTERN': re.compile(".*_addin_[0-9]+[.]py$", re.IGNORECA... | mpl-2.0 | Python |
a1d9e6452e055cb0d5a597b62f8a2c8ba8afd148 | Bump version to 9.1.1 | hhursev/recipe-scraper | recipe_scrapers/__version__.py | recipe_scrapers/__version__.py | __version__ = "9.1.1"
| __version__ = "9.1.0"
| mit | Python |
25090769e50426d61c56ca86d6970ea49c61f040 | test convolutions for many bands. Lower wavelengths take longer! hench no VIS here | jason-neal/eniric,jason-neal/eniric | bin/nIR_testing.py | bin/nIR_testing.py | #!/usr/bin/python
# Testing script for nIR analysis
# Run new and old code to test output.S
# Jason Neal
# December 2016
from __future__ import division, print_function
from eniric.nIRanalysis import convolution, resample_allfiles
from eniric.original_code.nIRanalysis import convolution as old_convolution
from eniric.o... | #!/usr/bin/python
# Testing script for nIR analysis
# Run new and old code to test output.S
# Jason Neal
# December 2016
from __future__ import division, print_function
from eniric.nIRanalysis import convolution, resample_allfiles
from eniric.original_code.nIRanalysis import convolution as old_convolution
from eniric.o... | mit | Python |
1e9999ee1292809565dc9fc39f8ed86b2b06eebe | Fix test | robinedwards/neomodel,robinedwards/neomodel | test/test_label_install.py | test/test_label_install.py | from six import StringIO
import pytest
from neo4j.exceptions import DatabaseError
from neomodel import (
config, StructuredNode, StringProperty, install_all_labels, install_labels,
UniqueIdProperty)
from neomodel.core import db
config.AUTO_INSTALL_LABELS = False
class NoConstraintsSetup(StructuredNode):
... | from six import StringIO
import pytest
from neo4j.exceptions import DatabaseError
from neomodel import (
config, StructuredNode, StringProperty, install_all_labels, install_labels,
UniqueIdProperty)
from neomodel.core import db
config.AUTO_INSTALL_LABELS = False
class NoConstraintsSetup(StructuredNode):
... | mit | Python |
9953fab4a88e18bb95b03626c39a88d50cd1c671 | Update issue 49 | Letractively/rdflib,Letractively/rdflib,Letractively/rdflib | test/test_sparql/leaves.py | test/test_sparql/leaves.py | import unittest
import doctest
data = """
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix : <tag:example.org,2007;stuff/> .
:a foaf:knows :b .
:a foaf:knows :c .
:a foaf:knows :d .
:b foaf:knows :a .
:b foaf:knows :c .
:c foaf:knows :a .
"""
query = """
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
select disti... | import unittest
import doctest
data = """
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix : <tag:example.org,2007;stuff/> .
:a foaf:knows :b .
:a foaf:knows :c .
:a foaf:knows :d .
:b foaf:knows :a .
:b foaf:knows :c .
:c foaf:knows :a .
"""
query = """
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
select disti... | bsd-3-clause | Python |
24b689510ad66019097cd8d22f3eae5504dbe6fa | add b-flag for windows | cheery/lever,cheery/lever,cheery/lever,cheery/lever | bincode/decoder.py | bincode/decoder.py | from space import *
from rpython.rlib import rfile
from rpython.rlib.rstruct import ieee
from rpython.rtyper.lltypesystem import rffi
import os
import struct
class Stream(object):
def __init__(self, data, index=0):
self.data = data
assert index >= 0
self.index = index
def read(self, co... | from space import *
from rpython.rlib import rfile
from rpython.rlib.rstruct import ieee
from rpython.rtyper.lltypesystem import rffi
import os
import struct
class Stream(object):
def __init__(self, data, index=0):
self.data = data
assert index >= 0
self.index = index
def read(self, co... | mit | Python |
9d30163302486b572fea985034675e94735f26b8 | bump version to 0.4.1 dev | tao12345666333/app-turbo,wecatch/app-turbo,tao12345666333/app-turbo,tao12345666333/app-turbo | turbo/__init__.py | turbo/__init__.py | #!/usr/bin/env python
#
# Copyright 2014 Wecatch
#
# 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 ag... | #!/usr/bin/env python
#
# Copyright 2014 Wecatch
#
# 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 ag... | apache-2.0 | Python |
dfcd9cf114aea683371c7a5d59ec8c4e2c570c2f | Update enrichment class interface | jeffakolb/Gnip-Analysis-Pipeline,jeffakolb/Gnip-Analysis-Pipeline | tweet_enricher.py | tweet_enricher.py | #!/usr/bin/env python
import importlib
import argparse
import os
import sys
try:
import ujson as json
except ImportError:
import json
class_list = []
parser = argparse.ArgumentParser()
parser.add_argument('-c','-configuration-file',dest='config_file',default=None,help='python file defining "enrichment_class_... | #!/usr/bin/env python
import importlib
import argparse
import os
import sys
try:
import ujson as json
except ImportError:
import json
class_list = []
parser = argparse.ArgumentParser()
parser.add_argument('-c','-configuration-file',dest='config_file',default=None,help='python file defining "enrichment_class_... | mit | Python |
fc2cc22ad853764358bbd1209e4411a1608d0c45 | Bump version for release | twilio/twilio-python,tysonholub/twilio-python | twilio/__init__.py | twilio/__init__.py | __version_info__ = ('6', '0rc6')
__version__ = '.'.join(__version_info__)
| __version_info__ = ('6', '0rc5')
__version__ = '.'.join(__version_info__)
| mit | Python |
b1dab10e80119a358bb291e96a420911a9f634b4 | Change formatting of problem.py | jackstanek/BotBot,jackstanek/BotBot | botbot/problems.py | botbot/problems.py | """Problems a file can have"""
class Problem:
"""Defines a problem that a file could have."""
def __init__(self, code, message, fix):
self.code = code
self.message = message
self.fix = fix
every_problem = {
'PROB_DIR_NOT_WRITABLE': Problem(1,
'D... | """Problems a file can have"""
class Problem:
"""Defines a problem that a file could have."""
def __init__(self, code, message, fix):
self.code = code
self.message = message
self.fix = fix
every_problem = {
'PROB_DIR_NOT_WRITABLE': Problem(1, 'Directory not writable.', 'Run \'chmod... | mit | Python |
f0766ff22a7ee7c3e9a48c468f7e1f41e9d7e92c | Update repo version to v0.0.5.dev | google/vizier,google/vizier | vizier/__init__.py | vizier/__init__.py | """Init file."""
import os
import sys
THIS_DIR = os.path.dirname(os.path.realpath(__file__))
PROTO_ROOT = os.path.realpath(os.path.join(THIS_DIR, "service"))
sys.path.append(PROTO_ROOT)
__version__ = "0.0.5.dev"
| """Init file."""
import os
import sys
THIS_DIR = os.path.dirname(os.path.realpath(__file__))
PROTO_ROOT = os.path.realpath(os.path.join(THIS_DIR, "service"))
sys.path.append(PROTO_ROOT)
__version__ = "0.0.3.alpha"
| apache-2.0 | Python |
ccf1b6762e7f395aab9540941f232a272f2b6d22 | Update __init__.py | google/vizier,google/vizier | vizier/__init__.py | vizier/__init__.py | """Init file."""
import os
import sys
THIS_DIR = os.path.dirname(os.path.realpath(__file__))
PROTO_ROOT = os.path.realpath(os.path.join(THIS_DIR, "service"))
sys.path.append(PROTO_ROOT)
__version__ = "0.0.7a0"
| """Init file."""
import os
import sys
THIS_DIR = os.path.dirname(os.path.realpath(__file__))
PROTO_ROOT = os.path.realpath(os.path.join(THIS_DIR, "service"))
sys.path.append(PROTO_ROOT)
__version__ = "0.0.7"
| apache-2.0 | Python |
ad7b950bd0ea091fa5c6079fc6cfbb6300664c9c | Add new method getBindCredentials method to CR script to allow dynamically change AD password oxTrust #1197 | GluuFederation/oxExternal | cache_refresh/sample/SampleScript.py | cache_refresh/sample/SampleScript.py | # oxAuth is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text.
# Copyright (c) 2016, Gluu
#
# Author: Yuriy Movchan
#
from org.xdi.model.custom.script.type.user import CacheRefreshType
from org.xdi.util import StringHelper, ArrayHelper
from java.util import Arrays, ArrayList
... | # oxAuth is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text.
# Copyright (c) 2016, Gluu
#
# Author: Yuriy Movchan
#
from org.xdi.model.custom.script.type.user import CacheRefreshType
from org.xdi.util import StringHelper, ArrayHelper
from java.util import Arrays, ArrayList
... | mit | Python |
aa1ba8b4ba437552d9431eac023add95fa717c83 | Check if fallback UnixIPParser is actually available and warn if not | ftao/python-ifcfg | src/ifcfg/__init__.py | src/ifcfg/__init__.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import platform
from . import parser, tools
__version__ = "0.19"
Log = tools.minimal_logger(__name__)
#: Module instance properties, can be mocked for testing
distro = platform.system()
def get_parser_class():
"""
Returns the pars... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import platform
from . import parser, tools
__version__ = "0.19"
Log = tools.minimal_logger(__name__)
#: Module instance properties, can be mocked for testing
distro = platform.system()
def get_parser_class():
"""
Returns the pars... | bsd-3-clause | Python |
654d125a3b672f627d73b1ffade1bf5c5a850124 | Update error message | saurabh6790/frappe,adityahase/frappe,almeidapaulopt/frappe,saurabh6790/frappe,adityahase/frappe,mhbu50/frappe,yashodhank/frappe,yashodhank/frappe,frappe/frappe,frappe/frappe,saurabh6790/frappe,mhbu50/frappe,yashodhank/frappe,adityahase/frappe,vjFaLk/frappe,StrellaGroup/frappe,saurabh6790/frappe,frappe/frappe,almeidapau... | frappe/desk/doctype/dashboard_chart_source/dashboard_chart_source.py | frappe/desk/doctype/dashboard_chart_source/dashboard_chart_source.py | # -*- coding: utf-8 -*-
# Copyright (c) 2019, Frappe Technologies and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe.modules.export_file import export_to_files
class DashboardChartSource(Docum... | # -*- coding: utf-8 -*-
# Copyright (c) 2019, Frappe Technologies and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe.modules.export_file import export_to_files
class DashboardChartSource(Docum... | mit | Python |
17440f58ccaef82988131a42dfc487c6e4d6129f | create userseen upon user creation | johnstcn/whatsnew,johnstcn/whatsnew | whatsnew/models.py | whatsnew/models.py | from __future__ import unicode_literals
from datetime import timedelta, datetime, date
from pytz import utc
from django.db import models
from django.core.exceptions import ObjectDoesNotExist
from django.contrib.postgres.fields import JSONField
from django.contrib.auth.models import User
from django.db.models import s... | from __future__ import unicode_literals
from datetime import timedelta, datetime, date
from pytz import utc
from django.db import models
from django.core.exceptions import ObjectDoesNotExist
from django.contrib.postgres.fields import JSONField
from django.contrib.auth.models import User
class Site(models.Model):
... | mit | Python |
b8587ed7d95f50d510e671a13ed5dc32dbeff6ab | Update setuptools.py | vadimkantorov/wigwam | wigs/setuptools.py | wigs/setuptools.py | class setuptools(PythonWig):
git_uri = 'https://github.com/pypa/setuptools'
tarball_uri = 'https://github.com/pypa/setuptools/archive/v$RELEASE_VERSION$.tar.gz'
dependencies = ['pypa', 'pyparsing', 'appdirs']
last_release_version = 'v34.3.1'
| class setuptools(PythonWig):
git_uri = 'https://github.com/pypa/setuptools'
tarball_uri = 'https://github.com/pypa/setuptools/archive/v$RELEASE_VERSION$.tar.gz'
dependencies = ['pypa', 'pyparsing']
last_release_version = 'v34.3.1'
| mit | Python |
958dffb2b345bde93d6129fd0d2f58b6ccb84972 | Add logElementTree to meta_line prefixes | JBarberU/strawberry_py | util/meta_line.py | util/meta_line.py | from colors import Colors
from line import Line
import re
prefixes = [
("Start", "", Colors.GREEN),
("Pass", "", Colors.GREEN),
("Debug", "", Colors.BLUE),
("Error", "", Colors.RED),
("Fail", "", Colors.RED),
("Duration", "s;", Colors.BLUE),
... | from colors import Colors
from line import Line
import re
prefixes = [
("Start", "", Colors.GREEN),
("Pass", "", Colors.GREEN),
("Debug", "", Colors.BLUE),
("Error", "", Colors.RED),
("Fail", "", Colors.RED),
("Duration", "s;", Colors.BLUE)
... | mit | Python |
09cf7a81eb57dfb39634788b81a565fda3c3d377 | Use new 'test_user/admin' fixtures | RBE-Avionik/skylines,Turbo87/skylines,TobiasLohner/SkyLines,snip/skylines,RBE-Avionik/skylines,kerel-fs/skylines,Harry-R/skylines,skylines-project/skylines,kerel-fs/skylines,shadowoneau/skylines,snip/skylines,skylines-project/skylines,RBE-Avionik/skylines,Harry-R/skylines,shadowoneau/skylines,TobiasLohner/SkyLines,Harr... | tests/model/test_search.py | tests/model/test_search.py | from skylines.model import User, Club, Airport
from skylines.model.search import (
combined_search_query, escape_tokens, text_to_tokens
)
MODELS = [User, Club, Airport]
def search(text):
# Split the search text into tokens and escape them properly
tokens = text_to_tokens(text)
tokens = escape_tokens(... | from skylines.model import User, Club, Airport
from skylines.model.search import (
combined_search_query, escape_tokens, text_to_tokens
)
MODELS = [User, Club, Airport]
def search(text):
# Split the search text into tokens and escape them properly
tokens = text_to_tokens(text)
tokens = escape_tokens(... | agpl-3.0 | Python |
1891469e5d3eb34efbe3c5feed1f7770e680120e | Fix incorrect docstring for NFA class | caleb531/automata | automata/nfa.py | automata/nfa.py | #!/usr/bin/env python3
import automata.automaton as automaton
class NFA(automaton.Automaton):
"""a nondeterministic finite automaton"""
def validate_automaton(self):
"""returns True if this NFA is internally consistent;
raises the appropriate exception if this NFA is invalid"""
for ... | #!/usr/bin/env python3
import automata.automaton as automaton
class NFA(automaton.Automaton):
"""a deterministic finite automaton"""
def validate_automaton(self):
"""returns True if this NFA is internally consistent;
raises the appropriate exception if this NFA is invalid"""
for sta... | mit | Python |
440fcebdcc06c0fbb26341764a0df529cec6587d | Support for angular + API added. | gcavalcante8808/flask-wiki,gcavalcante8808/flask-wiki,gcavalcante8808/flask-wiki | flask_wiki/frontend/frontend.py | flask_wiki/frontend/frontend.py | from flask import Flask, render_template, abort, redirect, url_for
from flask.ext.script import Manager
from jinja2 import TemplateNotFound
app = Flask(__name__)
app.config['TESTING'] = True
manager = Manager(app)
@app.route('/', endpoint='frontend-index')
def root():
# Redirect Base URL for the real Index Page.... | from flask import Flask, render_template, abort, redirect, url_for
from flask.ext.script import Manager
from jinja2 import TemplateNotFound
app = Flask(__name__)
app.config['TESTING'] = True
manager = Manager(app)
@app.route('/', endpoint='frontend-index')
def root():
# Redirect Base URL for the real Index Page... | bsd-2-clause | Python |
2e324cf7f847cfc8f6c4da6aa0bc1f133405fa5d | Add test of object with a __wrapped__ attribute | etgalloway/fullqualname | tests/test_fullqualname.py | tests/test_fullqualname.py | """Tests for fullqualname."""
import decorator
import inspect
import nose
import sys
from fullqualname import fullqualname
def decorator_(f_):
def wrapper_(f_, *args, **kw):
return f_(*args, **kw)
return decorator.decorator(wrapper_, f_)
class C_(object):
@decorator_
def decorated_method_(... | """Tests for fullqualname."""
import inspect
import nose
import sys
from fullqualname import fullqualname
def test_builtin_function():
# Test built-in function object.
obj = len
# Type is 'builtin_function_or_method'.
assert type(obj).__name__ == 'builtin_function_or_method'
# Object is a fun... | bsd-3-clause | Python |
fb6e5b11492675b7a7c94424737c91acbb541d69 | REFACTOR Change order of tests. | matatk/tdd-bdd-commit,matatk/tdd-bdd-commit | tests/test_message_body.py | tests/test_message_body.py | from tddcommitmessage.messagebody import MessageBody
from tddcommitmessage import Kind
def test_message_is_wrapped_in_quotes():
msg = MessageBody(Kind.red, 'Forty-two')
assert str(msg) == '"RED Forty-two"'
def test_first_letter_capitalised():
msg = MessageBody(Kind.red, 'forty-two')
assert str(msg) ==... | from tddcommitmessage.messagebody import MessageBody
from tddcommitmessage import Kind
def test_message_is_wrapped_in_quotes():
msg = MessageBody(Kind.red, 'Forty-two')
assert str(msg) == '"RED Forty-two"'
def test_message_with_double_quote_is_wrapped_with_single():
msg = MessageBody(Kind.red, 'But what a... | mit | Python |
a1d4053365f434e2c950fab1de17a05bbf8ff7a2 | Check permission when listing messages | yunity/foodsaving-backend,yunity/yunity-core,yunity/foodsaving-backend,yunity/foodsaving-backend,yunity/yunity-core | foodsaving/conversations/api.py | foodsaving/conversations/api.py | from django.utils.translation import ugettext_lazy as _
from rest_framework import mixins
from rest_framework.permissions import IsAuthenticated, BasePermission
from rest_framework.response import Response
from rest_framework.viewsets import GenericViewSet
from foodsaving.conversations.models import Conversation, Conv... | from rest_framework import mixins
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework.viewsets import GenericViewSet
from foodsaving.conversations.models import Conversation, ConversationMessage
from foodsaving.conversations.serializers import Convers... | agpl-3.0 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.