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 |
|---|---|---|---|---|---|---|---|---|
fbb5f3a716ae4cc2f74622bfec1f98964303adbf | write output into file | iGusev/devschool.hh | task1.py | task1.py | #task1.py
import sys
def rotate(A,B,C):
return (B[0]-A[0])*(C[1]-B[1])-(B[1]-A[1])*(C[0]-B[0])
def grahamscan(A):
n = len(A)
P = range(n)
for i in range(1,n):
if A[P[i]][0]<A[P[0]][0]:
P[i], P[0] = P[0], P[i]
for i in range(2,n):
j = i
while j>1 and (rotate(A[P[0]], A[P[j-1]], A[P[j]]) < 0... | #task1.py
import sys
def rotate(A,B,C):
return (B[0]-A[0])*(C[1]-B[1])-(B[1]-A[1])*(C[0]-B[0])
def grahamscan(A):
n = len(A)
P = range(n)
for i in range(1,n):
if A[P[i]][0]<A[P[0]][0]:
P[i], P[0] = P[0], P[i]
for i in range(2,n):
j = i
while j>1 and (rotate(A[P[0]], A[P[j-1]], A[P[j]]) < 0... | mit | Python |
1e2224733bc5d2daa1c6fc4ef142214c0f4a6caa | create full pylint report for CI | Feed-The-Web/javaprops | tasks.py | tasks.py | # -*- coding: utf-8 -*-
# pylint: disable=wildcard-import, unused-wildcard-import, bad-continuation
""" Project automation for Invoke.
"""
from invoke import run, task
from rituals.invoke_tasks import * # pylint: disable=redefined-builtin
@task
def ci(): # pylint: disable=invalid-name
"""Perform continuous integ... | # -*- coding: utf-8 -*-
# pylint: disable=wildcard-import, unused-wildcard-import, bad-continuation
""" Project automation for Invoke.
"""
from invoke import run, task
from rituals.invoke_tasks import * # pylint: disable=redefined-builtin
@task
def ci(): # pylint: disable=invalid-name
"""Perform continuous integ... | apache-2.0 | Python |
edc0103f65237d30368c9c925d1330afe764f80e | fix string comparison | metametadata/carry,metametadata/reagent-mvsa | tasks.py | tasks.py | from invoke import task, run, call
import contextlib
import os
import shutil
@task
def graphs():
""" Compiles graphs into project site folder. """
site_path = os.path.join(os.getcwd(), "site")
run("plantuml -tsvg -o {0} {1}".format(os.path.join(site_path, "graphs"), os.path.join("docs", "graphs")), echo=Tr... | from invoke import task, run, call
import contextlib
import os
import shutil
@task
def graphs():
""" Compiles graphs into project site folder. """
site_path = os.path.join(os.getcwd(), "site")
run("plantuml -tsvg -o {0} {1}".format(os.path.join(site_path, "graphs"), os.path.join("docs", "graphs")), echo=Tr... | mit | Python |
5d3e5997d456c2f7a2e35374af83a678f31431fe | test verbose option | kwierman/waterbutler,cosenal/waterbutler,hmoco/waterbutler,Ghalko/waterbutler,TomBaxter/waterbutler,Johnetordoff/waterbutler,felliott/waterbutler,chrisseto/waterbutler,icereval/waterbutler,CenterForOpenScience/waterbutler,RCOSDP/waterbutler,rafaeldelucena/waterbutler,rdhyee/waterbutler | tasks.py | tasks.py | import sys
from invoke import task, run
from waterbutler.server import settings
@task
def install(upgrade=False, pip_cache=None, wheel_repo=None):
cmd = 'pip install -r dev-requirements.txt'
if upgrade:
cmd += ' --upgrade'
if pip_cache:
cmd += ' --download-cache={}'.format(pip_cache)
... | import sys
from invoke import task, run
from waterbutler.server import settings
@task
def install(upgrade=False, pip_cache=None, wheel_repo=None):
cmd = 'pip install -r dev-requirements.txt'
if upgrade:
cmd += ' --upgrade'
if pip_cache:
cmd += ' --download-cache={}'.format(pip_cache)
... | apache-2.0 | Python |
a79416070391188cc7c3527493b3a019603b1964 | Update libsodium to 0.3 | xueyumusic/pynacl,lmctv/pynacl,reaperhulk/pynacl,pyca/pynacl,pyca/pynacl,hoffmabc/pynacl,xueyumusic/pynacl,lmctv/pynacl,dstufft/pynacl,JackWink/pynacl,ucoin-io/cutecoin,reaperhulk/pynacl,reaperhulk/pynacl,alex/pynacl,ucoin-bot/cutecoin,alex/pynacl,hoffmabc/pynacl,scholarly/pynacl,xueyumusic/pynacl,lmctv/pynacl,JackWink... | tasks.py | tasks.py | import hashlib
import os
import urllib2
from invoke import task, run
LIBSODIUM_VERSION = "0.3"
LIBSODIUM_URL = "http://download.dnscrypt.org/libsodium/releases/libsodium-0.3.tar.gz"
LIBSODIUM_HASH = b"908a26f84bedb432305c81ec6773aa95b8e724ba2ece6234840685a74e033750"
LIBSODIUM_AUTOGEN = False
@task(aliases=["instal... | import hashlib
import os
import urllib2
from invoke import task, run
LIBSODIUM_VERSION = "c6fa04725f394891576c9b9b7e912d45c39843db"
LIBSODIUM_URL = "https://github.com/jedisct1/libsodium/archive/c6fa04725f394891576c9b9b7e912d45c39843db.tar.gz"
LIBSODIUM_HASH = b"8a7d61c4cb1cf9c89570b2981a5f5cbdd5f13cb913c8342638f56f... | apache-2.0 | Python |
57d1b271584aea5977c329d508958d278681304f | add attribute event | develersrl/rooms,develersrl/rooms,develersrl/rooms,develersrl/rooms,develersrl/rooms,develersrl/rooms,develersrl/rooms | trunk/editor/structData/item.py | trunk/editor/structData/item.py | #!/usr/bin/env python
from origin import OriginData
class Item(OriginData):
tag_name = 'item'
def __init__(self, id, x, y, height, width, room, image, event):
super(Item, self).__init__()
self.id = id
self.x = x
self.y = y
self.height = height
self.width = wid... | #!/usr/bin/env python
from origin import OriginData
class Item(OriginData):
tag_name = 'item'
def __init__(self, id, x, y, height, width, room, image):
super(Item, self).__init__()
self.id = id
self.x = x
self.y = y
self.height = height
self.width = width
... | mit | Python |
8590392a48a830c281e284496cefede665c9dec1 | Update XENVIF, XENNET and XENVBD to latest tags | OwenSmith/win-installer,kostaslamda/win-installer,benchalmers/win-installer,kostaslamda/win-installer,xenserver/win-installer,kostaslamda/win-installer,OwenSmith/win-installer,kostaslamda/win-installer,OwenSmith/win-installer,OwenSmith/win-installer,benchalmers/win-installer,OwenSmith/win-installer,kostaslamda/win-inst... | manifestspecific.py | manifestspecific.py | # Copyright (c) Citrix Systems Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms,
# with or without modification, are permitted provided
# that the following conditions are met:
#
# * Redistributions of source code must retain the above
# copyright notice, this list of conditions a... | # Copyright (c) Citrix Systems Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms,
# with or without modification, are permitted provided
# that the following conditions are met:
#
# * Redistributions of source code must retain the above
# copyright notice, this list of conditions a... | bsd-2-clause | Python |
aeb6ce26bdde8697e7beb3d06391a04f500f574a | Change MARA_XXX variables to functions to delay importing of imports (requires updating mara-app to 2.0.0) | mara/mara-db,mara/mara-db | mara_db/__init__.py | mara_db/__init__.py | """Make the functionalities of this package auto-discoverable by mara-app"""
def MARA_CONFIG_MODULES():
from . import config
return [config]
def MARA_FLASK_BLUEPRINTS():
from . import views
return [views.blueprint]
def MARA_AUTOMIGRATE_SQLALCHEMY_MODELS():
return []
def MARA_ACL_RESOURCES():... | from mara_db import config, views, cli
MARA_CONFIG_MODULES = [config]
MARA_NAVIGATION_ENTRY_FNS = [views.navigation_entry]
MARA_ACL_RESOURCES = [views.acl_resource]
MARA_FLASK_BLUEPRINTS = [views.blueprint]
MARA_CLICK_COMMANDS = [cli.migrate]
| mit | Python |
19a7a44449b4e08253ca9379dd23db50f27d6488 | Remove some more ST2 specific code | revolunet/sublimetext-markdown-preview,revolunet/sublimetext-markdown-preview | markdown_wrapper.py | markdown_wrapper.py | from __future__ import absolute_import
import sublime
import traceback
from markdown import Markdown, util
from markdown.extensions import Extension
import importlib
class StMarkdown(Markdown):
def __init__(self, *args, **kwargs):
Markdown.__init__(self, *args, **kwargs)
self.Meta = {}
def r... | from __future__ import absolute_import
import sublime
import traceback
ST3 = int(sublime.version()) >= 3000
if ST3:
from markdown import Markdown, util
from markdown.extensions import Extension
import importlib
else:
from markdown import Markdown, util
from markdown.extensions import Extension
c... | mit | Python |
d75cef40d695800ac4e8f60d5e5dc69fd7475d8c | fix a statistics test | cosmoharrigan/pyrolog | prolog/builtin/test/test_statistics.py | prolog/builtin/test/test_statistics.py | import py
import time
from prolog.interpreter.continuation import Engine
from prolog.interpreter.test.tool import collect_all, assert_false, assert_true
from prolog.builtin.statistics import clock_time, reset_clocks, walltime
e = Engine()
def test_statistics():
assert_true("statistics(runtime, X).", e)
def te... | import py
import time
from prolog.interpreter.continuation import Engine
from prolog.interpreter.test.tool import collect_all, assert_false, assert_true
from prolog.builtin.statistics import clock_time, reset_clocks, walltime
e = Engine()
def test_statistics():
assert_true("statistics(runtime, X).", e)
def te... | mit | Python |
612476913aa7086e403f0fbbd284685e64bb4b4f | Fix setup.py keywords in datadog-checks-downloader (#12951) | DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core | datadog_checks_downloader/setup.py | datadog_checks_downloader/setup.py | # (C) Datadog, Inc. 2019-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from codecs import open # To use a consistent encoding
from os import path
from setuptools import setup
HERE = path.abspath(path.dirname(__file__))
ABOUT = {}
with open(path.join(HERE, "datadog_checks"... | # (C) Datadog, Inc. 2019-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from codecs import open # To use a consistent encoding
from os import path
from setuptools import setup
HERE = path.abspath(path.dirname(__file__))
ABOUT = {}
with open(path.join(HERE, "datadog_checks"... | bsd-3-clause | Python |
66eedac012f647d6976155ccbe2195a8eddbc43b | Add SeeOtherResponse and split permanent redirects into PermanentRedirectResponse | sassoftware/restlib,sassoftware/restlib | restlib/response.py | restlib/response.py | #
# Copyright (c) 2008 rPath, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.rpath.com/permanent/... | #
# Copyright (c) 2008 rPath, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.rpath.com/permanent/... | apache-2.0 | Python |
ab3a10e0f433a2a2a14e0e4a3d238e87eb56500e | improve BaseLiveServer | eliostvs/django-budget,eliostvs/django-budget | django-budget/functional_tests/tests/functional_base.py | django-budget/functional_tests/tests/functional_base.py | from django.conf import settings
from django.contrib.auth import BACKEND_SESSION_KEY, get_user_model, SESSION_KEY
from django.contrib.sessions.backends.db import SessionStore
from django.test import LiveServerTestCase
from selenium.webdriver import DesiredCapabilities
from splinter import Browser
class BaseLiveServer... | from django.conf import settings
from django.contrib.auth import BACKEND_SESSION_KEY, get_user_model, SESSION_KEY
from django.contrib.sessions.backends.db import SessionStore
from django.test import LiveServerTestCase
from selenium.webdriver import DesiredCapabilities
from splinter import Browser
User = get_user_model... | mit | Python |
c1ed5befe3081f6812fc77fc694ea3e82d90f39c | Set facebook_crendentials_backend_2's url to https | benschmaus/catapult,SummerLW/Perf-Insight-Report,sahiljain/catapult,SummerLW/Perf-Insight-Report,sahiljain/catapult,catapult-project/catapult,benschmaus/catapult,SummerLW/Perf-Insight-Report,catapult-project/catapult,sahiljain/catapult,catapult-project/catapult-csm,benschmaus/catapult,catapult-project/catapult-csm,sahi... | telemetry/telemetry/core/backends/facebook_credentials_backend.py | telemetry/telemetry/core/backends/facebook_credentials_backend.py | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.core.backends import form_based_credentials_backend
class FacebookCredentialsBackend(
form_based_credentials_backend.FormBasedCredential... | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.core.backends import form_based_credentials_backend
class FacebookCredentialsBackend(
form_based_credentials_backend.FormBasedCredential... | bsd-3-clause | Python |
007531e72fd0e0668b24c0fc889a8aff4f515e35 | remove param check from master | radical-cybertools/ExTASY | src/radical/ensemblemd/extasy/bin/Preprocessor/Amber/preprocessor.py | src/radical/ensemblemd/extasy/bin/Preprocessor/Amber/preprocessor.py | __author__ = 'vivek'
import radical.pilot
import saga
import glob
import sys
import os
def Preprocessing(Kconfig,umgr,cycle,paths):
list_of_files = []
print 'Preprocessing stage ....'
if(cycle==0):
curdir = os.path.dirname(os.path.realpath(__file__))
list_of_files = [Kconfig.initial_cr... | __author__ = 'vivek'
import radical.pilot
import saga
import glob
import sys
import os
def Preprocessing(Kconfig,umgr,cycle,paths):
list_of_files = []
print 'Preprocessing stage ....'
if(cycle==0):
param_check(Kconfig)
curdir = os.path.dirname(os.path.realpath(__file__))
list_... | mit | Python |
8360bebbd4bf2b2e9d51c7aa16bdb9506a91883e | Add unit test to pass Trigger instance. | okuta/chainer,hvy/chainer,keisuke-umezawa/chainer,ktnyt/chainer,cupy/cupy,kiyukuta/chainer,rezoo/chainer,keisuke-umezawa/chainer,okuta/chainer,ktnyt/chainer,hvy/chainer,tkerola/chainer,niboshi/chainer,cupy/cupy,niboshi/chainer,jnishi/chainer,okuta/chainer,wkentaro/chainer,wkentaro/chainer,jnishi/chainer,cupy/cupy,cupy/... | tests/chainer_tests/training_tests/extensions_tests/test_snapshot.py | tests/chainer_tests/training_tests/extensions_tests/test_snapshot.py | import unittest
import mock
from chainer import testing
from chainer.training import extensions
from chainer.training import trigger
@testing.parameterize(
{'trigger': ('epoch', 2)},
{'trigger': ('iteration', 10)},
{'trigger': trigger.IntervalTrigger(5, 'epoch')},
{'trigger': trigger.IntervalTrigger... | import unittest
import mock
from chainer import testing
from chainer.training import extensions
@testing.parameterize(
{'trigger': ('epoch', 2)},
{'trigger': ('iteration', 10)},
)
class TestSnapshotObject(unittest.TestCase):
def test_trigger(self):
target = mock.MagicMock()
snapshot_obj... | mit | Python |
3d8c9a4b529fdffff1c351af3747a29468e59364 | Fix test. | GoogleCloudPlatform/cloud-foundation-fabric,GoogleCloudPlatform/cloud-foundation-fabric,GoogleCloudPlatform/cloud-foundation-fabric,GoogleCloudPlatform/cloud-foundation-fabric | tests/examples/data_solutions/data_platform_foundations/test_plan.py | tests/examples/data_solutions/data_platform_foundations/test_plan.py | # Copyright 2022 Google LLC
#
# 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, ... | # Copyright 2022 Google LLC
#
# 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, ... | apache-2.0 | Python |
89a74c252329ca4a77cded3a3e125d3064bcc383 | Rewrite push_github_enterprise | TankerApp/tsrc | tsrc/cli/push_github_enterprise.py | tsrc/cli/push_github_enterprise.py | import argparse
from tsrc.cli.push import RepositoryInfo
from tsrc.cli.push_github import PullRequestProcessor
def post_push(args: argparse.Namespace, repository_info: RepositoryInfo) -> None:
from tsrc.github_client.api_client import GitHubApiClient
client = GitHubApiClient(enterprise_url=repository_info.l... | import tsrc.cli.push_github
import argparse
from typing import Optional
from github3 import GitHub
import tsrc
from tsrc.github_client.api_client import login as github_login
from tsrc.cli.push import RepositoryInfo
class PushAction(tsrc.cli.push_github.PushAction):
def __init__(
self,
repositor... | bsd-3-clause | Python |
e83eea20d76393168e69f06585f07f9c9fd3e2c6 | Fix in Centrifugo hook | synw/django-mqueue,synw/django-mqueue,synw/django-mqueue | mqueue/hooks/centrifugo/__init__.py | mqueue/hooks/centrifugo/__init__.py | from django.conf import settings
from ...conf import DOMAIN
try:
from instant.conf import SITE_SLUG
from instant.producers import publish
except ImportError:
pass
def save(event, conf):
data = {}
if event.data:
data = event.data
user = "anonymous"
if event.user:
user = even... | from django.conf import settings
from ...conf import DOMAIN
try:
from instant.conf import SITE_SLUG
from instant.producers import publish
except ImportError:
pass
def save(event, conf):
data = {}
if event.data:
data = event.data
user = "anonymous"
if event.user:
user = even... | mit | Python |
04939189efdc55164af8dc04223c7733664f091f | Fix `prompt_from_list` misbehaving with nonlist_validator | valohai/valohai-cli | valohai_cli/cli_utils.py | valohai_cli/cli_utils.py | import click
def prompt_from_list(options, prompt, nonlist_validator=None):
for i, option in enumerate(options, 1):
click.echo('{number} {name} {description}'.format(
number=click.style('[%3d]' % i, fg='cyan'),
name=option['name'],
description=(
click.st... | import click
def prompt_from_list(options, prompt, nonlist_validator=None):
for i, option in enumerate(options, 1):
click.echo('{number} {name} {description}'.format(
number=click.style('[%3d]' % i, fg='cyan'),
name=option['name'],
description=(
click.st... | mit | Python |
54a66292c6f361e6820f8be04898cf3004aa625b | add wikikg90mv2 import | snap-stanford/ogb | ogb/lsc/__init__.py | ogb/lsc/__init__.py | try:
from .pcqm4m import PCQM4MDataset, PCQM4MEvaluator
except ImportError:
pass
try:
from .pcqm4m_pyg import PygPCQM4MDataset
except ImportError:
pass
try:
from .pcqm4m_dgl import DglPCQM4MDataset
except (ImportError, OSError):
pass
from .mag240m import MAG240MDataset, MAG240MEvaluator
fr... | try:
from .pcqm4m import PCQM4MDataset, PCQM4MEvaluator
except ImportError:
pass
try:
from .pcqm4m_pyg import PygPCQM4MDataset
except ImportError:
pass
try:
from .pcqm4m_dgl import DglPCQM4MDataset
except (ImportError, OSError):
pass
from .mag240m import MAG240MDataset, MAG240MEvaluator
fr... | mit | Python |
8aaf6cae7dda542394b5cfce3d66029a902a2ea6 | update logger | anthonyserious/okdataset,anthonyserious/okdataset | okdataset/logger.py | okdataset/logger.py | import datetime
import json
import os
import platform
import sys
"""
Logger compatible with node.js's llog.
{
"name":"myapp",
"hostname":"banana.local",
"pid":40161,
"level":30,
"msg":"hi",
"time":"2013-01-04T18:46:23.851Z",
"v":0
}
Log levels:
60: fatal
50: error
40: warn
... | import datetime
import json
import os
import platform
"""
Logger compatible with node.js's llog.
{
"name":"myapp",
"hostname":"banana.local",
"pid":40161,
"level":30,
"msg":"hi",
"time":"2013-01-04T18:46:23.851Z",
"v":0
}
Log levels:
60: fatal
50: error
40: warn
30: info
... | mit | Python |
7fd639d6fcc8487ea156a778b28930c198ffb15e | Update libjpeg-turbo: added new version and removed redundant dependency. (#1897) | LLNL/spack,mfherbst/spack,lgarren/spack,lgarren/spack,matthiasdiener/spack,matthiasdiener/spack,EmreAtes/spack,EmreAtes/spack,EmreAtes/spack,iulian787/spack,skosukhin/spack,lgarren/spack,iulian787/spack,TheTimmy/spack,matthiasdiener/spack,krafczyk/spack,mfherbst/spack,skosukhin/spack,krafczyk/spack,LLNL/spack,mfherbst/... | var/spack/repos/builtin/packages/libjpeg-turbo/package.py | var/spack/repos/builtin/packages/libjpeg-turbo/package.py | ##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | ##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 | Python |
b1e236f64a62c57ce9271b40ce8e28a39f10da62 | Upgrade to v1.20.0 | biolink/ontobio,biolink/ontobio | ontobio/__init__.py | ontobio/__init__.py | from __future__ import absolute_import
__version__ = '1.20.0'
from .ontol_factory import OntologyFactory
from .ontol import Ontology, Synonym, TextDefinition
from .assoc_factory import AssociationSetFactory
from .io.ontol_renderers import GraphRenderer
import logging
import logging.handlers
from logging.config impor... | from __future__ import absolute_import
__version__ = '1.19.3'
from .ontol_factory import OntologyFactory
from .ontol import Ontology, Synonym, TextDefinition
from .assoc_factory import AssociationSetFactory
from .io.ontol_renderers import GraphRenderer
import logging
import logging.handlers
from logging.config impor... | bsd-3-clause | Python |
2c46159a887d4f26ae047b89e9770993c14f8a57 | Fix result status decision | colajam93/aurpackager,colajam93/aurpackager,colajam93/aurpackager,colajam93/aurpackager | packager/manager.py | packager/manager.py | from packager.builder import Builder, BuilderError
import threading
import queue
import time
from lib.singleton import Singleton
from manager.models import Build
import django.utils.timezone as timezone
import packager.path
class BuilderManager(metaclass=Singleton):
def __init__(self):
self.build_queue = ... | from packager.builder import Builder, BuilderError
import threading
import queue
import time
from lib.singleton import Singleton
from manager.models import Build
import django.utils.timezone as timezone
class BuilderManager(metaclass=Singleton):
def __init__(self):
self.build_queue = queue.Queue()
... | mit | Python |
04b1912ea0f285ce36b8dc72b1406b331d1be248 | Add file handling to logging | danjac/ownblock,danjac/ownblock,danjac/ownblock | ownblock/ownblock/settings/production.py | ownblock/ownblock/settings/production.py | """Production settings and globals."""
from __future__ import absolute_import
from os import environ
from .base import *
# Normally you should not import ANYTHING from Django directly
# into your settings, but ImproperlyConfigured is an exception.
# HOST CONFIGURATION
# See:
# https://docs.djangoproject.com/en/1.... | """Production settings and globals."""
from __future__ import absolute_import
from os import environ
from .base import *
# Normally you should not import ANYTHING from Django directly
# into your settings, but ImproperlyConfigured is an exception.
# HOST CONFIGURATION
# See:
# https://docs.djangoproject.com/en/1.... | mit | Python |
126ad427833421a9cfdcf01100758efca2a01cb5 | Bump version to 0.1.2 | aromanovich/jinja2schema,aromanovich/jinja2schema,aromanovich/jinja2schema | jinja2schema/__init__.py | jinja2schema/__init__.py | # coding: utf-8
"""
jinja2schema
============
Type inference for Jinja2 templates.
See http://jinja2schema.rtfd.org/ for documentation.
:copyright: (c) 2014 Anton Romanovich
:license: BSD
"""
__title__ = 'jinja2schema'
__author__ = 'Anton Romanovich'
__license__ = 'BSD'
__copyright__ = 'Copyright 2014 Anton Roman... | # coding: utf-8
"""
jinja2schema
============
Type inference for Jinja2 templates.
See http://jinja2schema.rtfd.org/ for documentation.
:copyright: (c) 2014 Anton Romanovich
:license: BSD
"""
__title__ = 'jinja2schema'
__author__ = 'Anton Romanovich'
__license__ = 'BSD'
__copyright__ = 'Copyright 2014 Anton Roman... | bsd-3-clause | Python |
ee2187a4cb52acbedf89c3381459b33297371f6e | Add new Flask MethodView called CreateUnikernel | adyasha/dune,onyb/dune,adyasha/dune,adyasha/dune | core/api/views/endpoints.py | core/api/views/endpoints.py | from flask import Module, jsonify, request
from flask.views import MethodView
from core.api.decorators import jsonp
api = Module(
__name__,
url_prefix='/api'
)
def jsonify_status_code(*args, **kw):
response = jsonify(*args, **kw)
response.status_code = kw['code']
return response
@api.route('/'... | from flask import Module, jsonify
from flask.views import MethodView
from core.api.decorators import jsonp
api = Module(
__name__,
url_prefix='/api'
)
def jsonify_status_code(*args, **kw):
response = jsonify(*args, **kw)
response.status_code = kw['code']
return response
@api.route('/')
def ind... | apache-2.0 | Python |
fcb060c598f3010de9e702ba419f8c8aa5c0097b | Clean up the upgrader logic and add a config option for it | twschum/mix-mind,twschum/mix-mind,twschum/mix-mind,twschum/mix-mind | mixmind/database.py | mixmind/database.py | from flask_sqlalchemy import SQLAlchemy
from flask_alembic import Alembic
from . import app
db = SQLAlchemy()
alembic = Alembic()
def init_db():
# import all modules here that might define models so that
# they will be registered properly on the metadata. Otherwise
# you will have to import them first be... | from flask_sqlalchemy import SQLAlchemy
from flask_alembic import Alembic
db = SQLAlchemy()
alembic = Alembic()
def init_db():
# import all modules here that might define models so that
# they will be registered properly on the metadata. Otherwise
# you will have to import them first before calling init_... | apache-2.0 | Python |
4f93d03ef1c3733fc96322139558ca055746749d | Update version to 5.0 | cornhundred/ipywidgets,SylvainCorlay/ipywidgets,ipython/ipywidgets,ipython/ipywidgets,ipython/ipywidgets,jupyter-widgets/ipywidgets,cornhundred/ipywidgets,jupyter-widgets/ipywidgets,jupyter-widgets/ipywidgets,cornhundred/ipywidgets,ipython/ipywidgets,ipython/ipywidgets,cornhundred/ipywidgets,SylvainCorlay/ipywidgets,ju... | ipywidgets/_version.py | ipywidgets/_version.py | # DO NOT EDIT! NPM AUTOMATICALLY WRITES THIS FILE!
version_info = (5, 0, 0, 'dev')
__version__ = '.'.join(map(str, version_info))
| # DO NOT EDIT! NPM AUTOMATICALLY WRITES THIS FILE!
version_info = (4, 2, 0, 'dev')
__version__ = '.'.join(map(str, version_info))
| bsd-3-clause | Python |
21e91efbf9cb064f1fcd19ba7a77ba81a6c843f5 | Save the session-key as a unicode string in the db | posativ/isso,xuhdev/isso,Mushiyo/isso,jelmer/isso,princesuke/isso,jiumx60rus/isso,janusnic/isso,janusnic/isso,Mushiyo/isso,Mushiyo/isso,posativ/isso,mathstuf/isso,janusnic/isso,jiumx60rus/isso,WQuanfeng/isso,jelmer/isso,princesuke/isso,jelmer/isso,Mushiyo/isso,WQuanfeng/isso,xuhdev/isso,mathstuf/isso,xuhdev/isso,prince... | isso/db/preferences.py | isso/db/preferences.py | # -*- encoding: utf-8 -*-
import os
import binascii
class Preferences:
defaults = [
("session-key", binascii.b2a_hex(os.urandom(24)).decode('utf-8')),
]
def __init__(self, db):
self.db = db
self.db.execute([
'CREATE TABLE IF NOT EXISTS preferences (',
' ... | # -*- encoding: utf-8 -*-
import os
import binascii
class Preferences:
defaults = [
("session-key", binascii.b2a_hex(os.urandom(24))),
]
def __init__(self, db):
self.db = db
self.db.execute([
'CREATE TABLE IF NOT EXISTS preferences (',
' key VARCHAR PR... | mit | Python |
a5e53cd38f87e357916b65d4d375d2029566e733 | Bump version to 0.5.0 | clb6/jarvis-cli | jarvis_cli/__init__.py | jarvis_cli/__init__.py |
__version__ = '0.5.0'
|
__version__ = '0.4.0'
| apache-2.0 | Python |
7d78b988cd2b986edf2e6290c75544b5e235e334 | Prepare for v0.6.0 | iffy/parsefin | parsefin/version.py | parsefin/version.py | # Copyright (c) Matt Haggard.
# See LICENSE for details.
__version__ = "0.6.0-dev"
| # Copyright (c) Matt Haggard.
# See LICENSE for details.
__version__ = "0.5.0"
| apache-2.0 | Python |
4d5af4869871b45839952dd9f881635bd07595c1 | Exclude Videos article and non-scrapable info-galleries and picture-galleries via URL-pattern | catcosmo/newsdiffs,catcosmo/newsdiffs,catcosmo/newsdiffs | parsers/RPOnline.py | parsers/RPOnline.py | from baseparser import BaseParser
from BeautifulSoup import BeautifulSoup, Tag
class RPOParser(BaseParser):
domains = ['www.rp-online.de']
feeder_pat = '(?<!(vid|bid|iid))(-1\.\d*)$'
feeder_pages = ['http://www.rp-online.de/']
def _parse(self, html):
soup = BeautifulSoup(html, convertEntitie... | from baseparser import BaseParser
from BeautifulSoup import BeautifulSoup, Tag
class RPOParser(BaseParser):
domains = ['www.rp-online.de']
feeder_pat = '1\.\d*$'
feeder_pages = ['http://www.rp-online.de/']
def _parse(self, html):
soup = BeautifulSoup(html, convertEntities=BeautifulSoup.HTML_... | mit | Python |
9d3f616a0276f04b20cce021cff1527e12117c40 | bump version to 3.4.1 | kronenthaler/mod-pbxproj | pbxproj/__init__.py | pbxproj/__init__.py | # MIT License
#
# Copyright (c) 2016 Ignacio Calderon aka kronenthaler
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use,... | # MIT License
#
# Copyright (c) 2016 Ignacio Calderon aka kronenthaler
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use,... | mit | Python |
6b81d595c61450d9344e1c7ffe3d3d871b758222 | update version number in order to upload to pypi | colinhoglund/piprepo | piprepo/__init__.py | piprepo/__init__.py | __version__ = '0.0.2'
__description__ = 'piprepo creates PEP-503 compliant package repositories.'
| __version__ = '0.0.1'
__description__ = 'piprepo creates PEP-503 compliant package repositories.'
| mit | Python |
df25b6cb1af8fb39d81261e76ad74c387416b210 | remove committed add | sassoftware/mirrorball,sassoftware/mirrorball | scripts/gengroup.py | scripts/gengroup.py | #!/usr/bin/python
import os
import sys
sys.path.insert(0, os.environ['HOME'] + '/hg/conary')
sys.path.insert(0, os.environ['HOME'] + '/hg/xobj/py')
sys.path.insert(0, os.environ['HOME'] + '/hg/rbuilder-trunk/rpath-xmllib')
from conary.lib import util
sys.excepthook = util.genExcepthook()
mbdir = os.path.abspath('..... | #!/usr/bin/python
import os
import sys
sys.path.insert(0, os.environ['HOME'] + '/hg/conary')
sys.path.insert(0, os.environ['HOME'] + '/hg/xobj/py')
sys.path.insert(0, os.environ['HOME'] + '/hg/rbuilder-trunk/rpath-xmllib')
from conary.lib import util
sys.excepthook = util.genExcepthook()
mbdir = os.path.abspath('..... | apache-2.0 | Python |
8c61eddf473e0aa1b1971acd3387f884a9c7f2b2 | Fix plot_dos script for new pymatgen electronic_structure. | rousseab/pymatgen,yanikou19/pymatgen,migueldiascosta/pymatgen,ctoher/pymatgen,yanikou19/pymatgen,rousseab/pymatgen,rousseab/pymatgen,yanikou19/pymatgen,sonium0/pymatgen,Dioptas/pymatgen,sonium0/pymatgen,Bismarrck/pymatgen,migueldiascosta/pymatgen,ctoher/pymatgen,ctoher/pymatgen,Bismarrck/pymatgen,Bismarrck/pymatgen,son... | scripts/plot_dos.py | scripts/plot_dos.py | #!/usr/bin/env python
from __future__ import division
'''
Created on Nov 8, 2011
'''
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2011, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Shyue Ping Ong"
__email__ = "shyue@mit.edu"
__date__ = "Nov 8, 2011"
import argparse
from collections impor... | #!/usr/bin/env python
from __future__ import division
'''
Created on Nov 8, 2011
'''
__author__="Shyue Ping Ong"
__copyright__ = "Copyright 2011, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Shyue Ping Ong"
__email__ = "shyue@mit.edu"
__date__ = "Nov 8, 2011"
import argparse
from collections import ... | mit | Python |
fa35e97037bb9dd68eb1c6022d6d2eac918b20ed | Update ppo.py | qsheeeeen/Self-Driving-Car | agent/ppo.py | agent/ppo.py | # coding: utf-8
import numpy as np
import torch
from torch import nn
from torch import optim
from torch import cuda
from torch.autograd import Variable
from .core import Agent
from .replay_buffer import ReplayBuffer
# TODO
class PPOAgent(Agent):
def __init__(self):
raise NotImplementedError
def act... | # coding: utf-8
import numpy as np
import torch
from torch import nn
from torch import optim
from torch import cuda
from torch.autograd import Variable
from .core import Agent
from .replay_buffer import ReplayBuffer
# TODO
class PPOAgent(Agent):
def __init__(self):
pass
def act(self, observation, r... | mit | Python |
ace0d80e8165b43310befe0b5f384f290fa96c0e | Use preprocess script template in startapp. | mrshu/iepy,machinalis/iepy,machinalis/iepy,machinalis/iepy,mrshu/iepy,mrshu/iepy | scripts/startapp.py | scripts/startapp.py | """
Create a IEPY application from the default template.
Usage:
startapp.py <name>
"""
import os
import shutil
from docopt import docopt
import iepy
def startapp(name):
# Sanitize name:
san_name = name.decode("ascii", "ignore").lower().replace(" ", "_")
# Create the folder structure
folder = sa... | """
Create a IEPY application from the default template.
Usage:
startapp.py <name>
"""
import os
from docopt import docopt
def startapp(name):
# Sanitize name:
san_name = name.decode("ascii", "ignore").lower().replace(" ", "_")
# Create the folder structure
folder = san_name
if os.path.exis... | bsd-3-clause | Python |
8812e8ac0234ee7790d28f27e0708e1208220308 | Add content-type for userscripts. | MADindustries/WhatManager2,karamanolev/WhatManager2,grandmasterchef/WhatManager2,davols/WhatManager2,MADindustries/WhatManager2,grandmasterchef/WhatManager2,karamanolev/WhatManager2,davols/WhatManager2,MADindustries/WhatManager2,grandmasterchef/WhatManager2,MADindustries/WhatManager2,karamanolev/WhatManager2,karamanole... | userscript/views.py | userscript/views.py | from django.shortcuts import render
from WhatManager2.settings import USERSCRIPT_WM_ROOT
def bibliotik(request):
data = {
'root': USERSCRIPT_WM_ROOT
}
return render(request, 'userscript/bibliotik.user.js', data, content_type='text/javascript')
def whatcd(request):
data = {
'root': U... | from django.shortcuts import render
from WhatManager2.settings import USERSCRIPT_WM_ROOT
def bibliotik(request):
data = {
'root': USERSCRIPT_WM_ROOT
}
return render(request, 'userscript/bibliotik.user.js', data)
def whatcd(request):
data = {
'root': USERSCRIPT_WM_ROOT
}
retu... | mit | Python |
891a2514fd0084fa67941322f5c041e10823955e | Clean mentions for Context embed reply fallback method | Harmon758/Harmonbot,Harmon758/Harmonbot | Discord/utilities/context.py | Discord/utilities/context.py |
import discord
from discord.ext import commands
from modules import utilities
from utilities import errors
class Context(commands.Context):
def embed_reply(self, *args, **kwargs):
return self.embed_say(*args, author_name = self.author.display_name, author_icon_url = self.author.avatar_url, **kwargs)
# TODO: ... |
import discord
from discord.ext import commands
from utilities import errors
class Context(commands.Context):
def embed_reply(self, *args, **kwargs):
return self.embed_say(*args, author_name = self.author.display_name, author_icon_url = self.author.avatar_url, **kwargs)
# TODO: optimize/improve clarity
asyn... | mit | Python |
2ad446fd374a2a034ea69dabf444639b716784cf | Fix wrong image URL for 'anleggsplassen' | datagutten/comics,jodal/comics,jodal/comics,datagutten/comics,datagutten/comics,jodal/comics,jodal/comics,datagutten/comics | comics/comics/anleggsplassen.py | comics/comics/anleggsplassen.py | # encoding: utf-8
import re
from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "Anleggsplassen"
language = "no"
url = "https://www.at.no/"
rights = "Trond J. Stavås"
class Crawler(CrawlerBase):
... | # encoding: utf-8
import re
from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "Anleggsplassen"
language = "no"
url = "https://www.at.no/"
rights = "Trond J. Stavås"
class Crawler(CrawlerBase):
... | agpl-3.0 | Python |
9cbdb449a8d18d83b81d8af5e85d0dfbb48da4a1 | Improve sandbox tests. | OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft | test/test_sandbox.py | test/test_sandbox.py | import pytest
import torch
import syft as sy
# Import Hook
from syft.frameworks.torch import TorchHook
# Import grids
from syft.grid import VirtualGrid
def test_sandbox():
sy.create_sandbox(globals(), download_data=False)
assert alice == alice # noqa: F821
assert isinstance(alice, sy.VirtualWorker) #... | import pytest
import torch
import syft as sy
def test_sandbox():
sy.create_sandbox(globals(), download_data=False)
# check to make sure global variable gets set for alice
assert alice == alice # noqa: F821
assert isinstance(alice, sy.VirtualWorker) # noqa: F821
| apache-2.0 | Python |
014f7d9ef9a10264f78f42a63ffa03dd9cd4e122 | Remove tests depending on pyglet entirely | greenmoss/PyWavefront | test/test_texture.py | test/test_texture.py | import unittest
import os
import pywavefront.texture
def prepend_dir(file):
return os.path.join(os.path.dirname(__file__), file)
class TestTexture(unittest.TestCase):
def testPathedImageName(self):
"""For Texture objects, the image name should be the last component of the path."""
my_textu... | import unittest
import os
import pywavefront.texture
import pywavefront.visualization # power of two test
def prepend_dir(file):
return os.path.join(os.path.dirname(__file__), file)
class TestTexture(unittest.TestCase):
def testPathedImageName(self):
"""For Texture objects, the image name should ... | bsd-3-clause | Python |
941525a56bdb32545f386e7fadc5ff8b0df1f591 | Fix indentation in showmove.py | GunshipPenguin/shallow-blue,GunshipPenguin/shallow-blue,GunshipPenguin/shallow-blue,GunshipPenguin/shallow-blue | scripts/showmove.py | scripts/showmove.py | '''
Showmove.py
Given the value of a move's internal _move variable, print the move and all
it's associated info.
'''
import sys
FILES = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']
FLAGS = {
1<<0: 'NULL_MOVE',
1<<1: 'CAPTURE',
1<<2: 'DOUBLE_PAWN_PUSH',
1<<3: 'KSIDE_CASTLE',
1<<4: 'QSIDE_CASTLE',
... | '''
Showmove.py
Given the value of a move's internal _move variable, print the move and all
it's associated info.
'''
import sys
FILES = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']
FLAGS = {
1<<0: 'NULL_MOVE',
1<<1: 'CAPTURE',
1<<2: 'DOUBLE_PAWN_PUSH',
1<<3: 'KSIDE_CASTLE',
1<<4: 'QSIDE_CASTLE',
... | mit | Python |
29cf128a62f66d924980a5a48156045d88f644c5 | Increase size of `password` column | anfederico/Flaskex,anfederico/Flaskex,anfederico/Flaskex | scripts/tabledef.py | scripts/tabledef.py | # -*- coding: utf-8 -*-
import sys
from sqlalchemy import create_engine
from sqlalchemy import Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
SQLALCHEMY_DATABASE_URI = 'sqlite:///accounts.db'
Base = declarative_base()
def db_connect():
"""
Performs database connection using... | # -*- coding: utf-8 -*-
import sys
from sqlalchemy import create_engine
from sqlalchemy import Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
SQLALCHEMY_DATABASE_URI = 'sqlite:///accounts.db'
Base = declarative_base()
def db_connect():
"""
Performs database connection using... | mit | Python |
000a4bc3587d2b3df2f7c7b4e0b4a9578aa37f29 | add dirname for output | peccu/find-duplicates-from-bookmarks.plist | selectDuplicates.py | selectDuplicates.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import Folder
def select_each(item):
def select_print(path):
# print str(Folder.getDepth(item)) + ': folder:' + Folder.getPath(item) + ' => ' + path
if item['path'] == path:
return
if (len(item['path']) < len(path)) or (len(item['path']) == len(path) an... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import Folder
def select_each(item):
def select_print(path):
# print str(Folder.getDepth(item)) + ': folder:' + Folder.getPath(item) + ' => ' + path
if item['path'] == path:
return
if (len(item['path']) < len(path)) or (len(item['path']) == len(path) an... | mit | Python |
b8a54a3bef04b43356d2472c59929ad15a0b6d4b | Use gmpy2 instead of numpy | admk/soap | semantics/common.py | semantics/common.py | #!/usr/bin/env python
# vim: set fileencoding=UTF-8 :
import gmpy2
from gmpy2 import mpq, mpfr
def ulp(v):
return mpq(2) ** v.as_mantissa_exp()[1]
def round(mode):
def decorator(f):
def wrapped(v1, v2):
with gmpy2.local_context(round=mode):
return f(v1, v2)
retu... | #!/usr/bin/env python
# vim: set fileencoding=UTF-8 :
import numpy as np
def get_exponent(v):
if isinstance(v, np.float32):
mask, shift, offset = 0x7f800000, 23, 127
else:
raise NotImplementedError('The value v can only be of type np.float32')
return ((v.view('i') & mask) >> shift) - off... | mit | Python |
bef40a5589a5f917274a9dbdc1b294a284672ea8 | Remove unneeded print statement | hepix-virtualisation/vmcatcher | vmcatcher/tests/test_vmcatcher_vmcatcher_subscribe_retrieveFacard.py | vmcatcher/tests/test_vmcatcher_vmcatcher_subscribe_retrieveFacard.py | import sys, os
sys.path = [os.path.abspath(os.path.dirname(os.path.dirname(__file__)))] + sys.path
import vmcatcher.vmcatcher_subscribe.retrieveFacard
import logging
import smimeX509validation
import unittest
import nose
class TestRetrieveFacard(unittest.TestCase):
def setUp(self):
self.log = logging.getLo... | import sys, os
sys.path = [os.path.abspath(os.path.dirname(os.path.dirname(__file__)))] + sys.path
import vmcatcher.vmcatcher_subscribe.retrieveFacard
import logging
import smimeX509validation
import unittest
import nose
class TestRetrieveFacard(unittest.TestCase):
def setUp(self):
self.log = logging.getLo... | apache-2.0 | Python |
71a49be2e6a0b270e2e18e8e9759feca5a07e76c | Set motor interface pwm node non-anonymous | vortexntnu/rov-control,vortexntnu/rov-control,vortexntnu/rov-control | motor_interface/scripts/PwmNode.py | motor_interface/scripts/PwmNode.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import ForceToPwmLookup
import Adafruit_PCA9685
import rospy
from vortex_msgs.msg import ThrusterForces
from vortex_msgs.msg import ThrusterPwm
def callback_thruster(ForceInput):
# Publish status message
PwmStatusMsg.pwm1 = int(ForceToPwmLookup.ForceToPwm(ForceIn... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import ForceToPwmLookup
import Adafruit_PCA9685
import rospy
from vortex_msgs.msg import ThrusterForces
from vortex_msgs.msg import ThrusterPwm
def callback_thruster(ForceInput):
# Publish status message
PwmStatusMsg.pwm1 = int(ForceToPwmLookup.ForceToPwm(ForceIn... | mit | Python |
733e2fe1ea09799a8574c330668b28e7bfb4d273 | Update __init__.py | ruansteve/neutron-dynamic-routing | neutron_dynamic_routing/__init__.py | neutron_dynamic_routing/__init__.py | # Copyright 2011 OpenStack Foundation
# 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 requ... | apache-2.0 | Python | |
e4056d9a04af114a4df85ffed9f67cb46abd4b2e | increase version | sequana/sequana,sequana/sequana,sequana/sequana,sequana/sequana,sequana/sequana | sequana/__init__.py | sequana/__init__.py |
import pkg_resources
try:
version = pkg_resources.require("sequana")[0].version
except:
version = ">=0.20.0"
import colorlog as logger
def sequana_debug_level(level="WARNING"):
"""A deubg level setter at top level of the library"""
assert level in ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"]
... |
import pkg_resources
try:
version = pkg_resources.require("sequana")[0].version
except:
version = ">=0.18.0"
import colorlog as logger
def sequana_debug_level(level="WARNING"):
"""A deubg level setter at top level of the library"""
assert level in ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"]
... | bsd-3-clause | Python |
4ab292657002f6af195117e986fbe4e56285eff9 | Switch to the forked process pool server to get around GIL performance limitations. | AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,berkmancenter/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,berkmancenter/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,berkmancenter/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,berkmancenter/mediacloud,berkmancenter... | python_scripts/extractor_python_readability_server.py | python_scripts/extractor_python_readability_server.py | #!/usr/bin/python
import sys
import os
import glob
#sys.path.append(os.path.join(os.path.dirname(__file__), "gen-py"))
sys.path.append(os.path.join(os.path.dirname(__file__),"gen-py/thrift_solr/"))
sys.path.append(os.path.dirname(__file__) )
from thrift.transport import TSocket
from thrift.transport import TTranspor... | #!/usr/bin/python
import sys
import os
import glob
#sys.path.append(os.path.join(os.path.dirname(__file__), "gen-py"))
sys.path.append(os.path.join(os.path.dirname(__file__),"gen-py/thrift_solr/"))
sys.path.append(os.path.dirname(__file__) )
from thrift.transport import TSocket
from thrift.transport import TTranspor... | agpl-3.0 | Python |
31b5018c2bdaf30985208d6fbdbca9107fc4aa3a | Create HlsLs | simondolle/hls-autocomplete,simondolle/hls-autocomplete | hls_autocomplete/hls.py | hls_autocomplete/hls.py | from __future__ import print_function
import sys
import subprocess
import os.path
from hls_autocomplete.update import update
from hls_autocomplete.utils import load_cache
class HlsSubprocess(object):
def __init__(self):
pass
def list_status(self, path):
return self.hls_with_update(self)
... | from __future__ import print_function
import sys
import subprocess
from hls_autocomplete.update import update
from hls_autocomplete.utils import load_cache
class HlsHdfs(object):
def __init__(self):
pass
def list_status(self, path):
return self.hls_with_update(self)
def hls_with_update(... | mit | Python |
fa2fd31ebd189625ee47aacbf75aa7c217169c01 | Revert "Add fileno implementation to _LoggingOutputStream class in run_chromeos_tests.py" | catapult-project/catapult,catapult-project/catapult,catapult-project/catapult,catapult-project/catapult,catapult-project/catapult,catapult-project/catapult,catapult-project/catapult | telemetry/telemetry/testing/run_chromeos_tests.py | telemetry/telemetry/testing/run_chromeos_tests.py | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
from telemetry.testing import run_tests
def RunChromeOSTests(browser_type, tests_to_run):
""" Run ChromeOS tests.
Args:
|browser_typ... | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import sys
from telemetry.testing import run_tests
def RunChromeOSTests(browser_type, tests_to_run):
""" Run ChromeOS tests.
Args:
|... | bsd-3-clause | Python |
91ae64beb68bf11b8b84cc4d0b4ac8e957e04ed8 | test should run without command line arguments | xia2/xia2,xia2/xia2 | Handlers/test_CommandLine.py | Handlers/test_CommandLine.py | from __future__ import absolute_import, division, print_function
import mock
import pytest
import sys
from dials.util import Sorry
@pytest.mark.parametrize("name", ("foo_001", "_foo_001", "foo", "_foo_", "_1foo"))
def test_validate_project_crystal_name(name, ccp4, tmpdir):
with tmpdir.as_cwd():
with moc... | from __future__ import absolute_import, division, print_function
import pytest
from dials.util import Sorry
@pytest.mark.parametrize("name", ("foo_001", "_foo_001", "foo", "_foo_", "_1foo"))
def test_validate_project_crystal_name(name, ccp4, tmpdir):
with tmpdir.as_cwd():
# import creates droppings as s... | bsd-3-clause | Python |
26ec6300110bc26a70946e9f62b8c692e471ea49 | Update __manifest__.py | rockcesar/odoo_addons,rockcesar/odoo_addons,rockcesar/odoo_addons,rockcesar/odoo_addons | translator_odoo/__manifest__.py | translator_odoo/__manifest__.py | # -*- coding: utf-8 -*-
{ 'active': True,
'author': u'César Cordero Rodríguez <cesar.cordero.r@gmail.com>',
'website': 'https://cr-innova.negocio.site/',
'category': 'Translation',
'demo_xml': [],
'depends': [
'base',
],
'description': '''
This is a new translator.
... | # -*- coding: utf-8 -*-
{ 'active': True,
'author': u'Lcdo. César Cordero Rodríguez, part of CR-Innova Consultants and University of Zulia professionals',
'website': 'https://cr-innova.negocio.site/',
'category': 'Translation',
'demo_xml': [],
'depends': [
'base',
],
'description':... | agpl-3.0 | Python |
bdd232d9b20fc0a48c57fb3d90854ee710b48fd9 | make link-creation in template-tags more flexible | gpodder/mygpo,gpodder/mygpo,gpodder/mygpo,gpodder/mygpo | mygpo/web/templatetags/facebook.py | mygpo/web/templatetags/facebook.py | from django import template
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext as _
import hashlib
from mygpo.constants import PODCAST_LOGO_BIG_SIZE
from mygpo.web.templatetags.podcasts import create_podcast_logo
from mygpo.web.utils import get_episode_link_target, get_podcast_... | from django import template
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext as _
import hashlib
from mygpo.constants import PODCAST_LOGO_BIG_SIZE
from mygpo.web.templatetags.podcasts import create_podcast_logo
register = template.Library()
LIKE_BUTTON_STR = """<iframe cla... | agpl-3.0 | Python |
6a33e9b2a5812d64303b963a156125310e81685d | update test for new model | n0stack/n0core | n0core/target/network/test_flat.py | n0core/target/network/test_flat.py | from uuid import uuid4
from n0core.model.resource.network import Network
from n0core.model.resource.nic import NIC
from n0core.target.network.flat import Flat
INTERFACE_NAME = ""
NETWORK_ID = "00f967af-0cc6-443e-b2a9-277b158f42f0"
up_network = Network(NETWORK_ID, "flat", Network.STATES.UP, "test_network")
up_networ... | from uuid import uuid4
from n0core.model import Model
from n0core.target.network.flat import Flat
INTERFACE_NAME = ""
NETWORK_ID = "00f967af-0cc6-443e-b2a9-277b158f42f0"
up_network = Model("resource/network/flat", "up", id=NETWORK_ID)
up_network["subnets"] = [{
"cidr": "192.168.0.0/24",
"dhcp": {
"r... | bsd-2-clause | Python |
8e59e9c764a0a0fbeac90cf1f82898ac0613c3aa | Fix minimum compatible model version | RasaHQ/rasa_nlu,RasaHQ/rasa_nlu,RasaHQ/rasa_nlu | rasa/constants.py | rasa/constants.py | import os
DEFAULT_REQUEST_TIMEOUT = 60 * 5 # 5 minutes
DEFAULT_RESPONSE_TIMEOUT = 60 * 60 # 1 hour
TEST_DATA_FILE = "test.md"
TRAIN_DATA_FILE = "train.md"
NLG_DATA_FILE = "responses.md"
RESULTS_FILE = "results.json"
NUMBER_OF_TRAINING_STORIES_FILE = "num_stories.json"
PERCENTAGE_KEY = "__percentage__"
PACKAGE_NAME... | import os
DEFAULT_REQUEST_TIMEOUT = 60 * 5 # 5 minutes
DEFAULT_RESPONSE_TIMEOUT = 60 * 60 # 1 hour
TEST_DATA_FILE = "test.md"
TRAIN_DATA_FILE = "train.md"
NLG_DATA_FILE = "responses.md"
RESULTS_FILE = "results.json"
NUMBER_OF_TRAINING_STORIES_FILE = "num_stories.json"
PERCENTAGE_KEY = "__percentage__"
PACKAGE_NAME... | apache-2.0 | Python |
0a0db00eb7f82ad3f21b72ceff6d885628ce8f3a | Fix linter warnings around equality of None | jaraco/irc | irc/tests/test_bot.py | irc/tests/test_bot.py | import irc.bot
from irc.bot import ServerSpec
class TestServerSpec(object):
def test_with_host(self):
server_spec = ServerSpec('irc.example.com')
assert server_spec.host == 'irc.example.com'
assert server_spec.port == 6667
assert server_spec.password is None
def test_with_host... | import irc.bot
from irc.bot import ServerSpec
class TestServerSpec(object):
def test_with_host(self):
server_spec = ServerSpec('irc.example.com')
assert server_spec.host == 'irc.example.com'
assert server_spec.port == 6667
assert server_spec.password == None
def test_with_host... | mit | Python |
3a3efca9653ebb2180197dce3f5669a7199f48fa | Rework on tensorflow_io/hadoop/python/ops/hadoop_dataset_ops.py | tensorflow/io,tensorflow/io,tensorflow/io,tensorflow/io,tensorflow/io,tensorflow/io,tensorflow/io | tensorflow_io/hadoop/python/ops/hadoop_dataset_ops.py | tensorflow_io/hadoop/python/ops/hadoop_dataset_ops.py | # Copyright 2018 The TensorFlow Authors. 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 by applica... | # Copyright 2018 The TensorFlow Authors. 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 by applica... | apache-2.0 | Python |
612a5945f1942729cac713db1927e9544e7d8e55 | Remove spurious print statement | modulexcite/nbgrader,jdfreder/nbgrader,MatKallada/nbgrader,EdwardJKim/nbgrader,jupyter/nbgrader,alope107/nbgrader,jupyter/nbgrader,EdwardJKim/nbgrader,jdfreder/nbgrader,jhamrick/nbgrader,MatKallada/nbgrader,modulexcite/nbgrader,ellisonbg/nbgrader,jupyter/nbgrader,jupyter/nbgrader,ellisonbg/nbgrader,EdwardJKim/nbgrader,... | nbgrader/preprocessors/findstudentid.py | nbgrader/preprocessors/findstudentid.py | import os
import re
from textwrap import dedent
from IPython.nbconvert.preprocessors import Preprocessor
from IPython.utils.traitlets import Unicode
class FindStudentID(Preprocessor):
"""Try to discover the student id given the full notebook path and a
regular expression."""
regexp = Unicode(
r''... | import os
import re
from textwrap import dedent
from IPython.nbconvert.preprocessors import Preprocessor
from IPython.utils.traitlets import Unicode
class FindStudentID(Preprocessor):
"""Try to discover the student id given the full notebook path and a
regular expression."""
regexp = Unicode(
r''... | bsd-3-clause | Python |
8504986c7bcaf0ca1ae00983cd31c742637a4ad3 | add crime to admin | jayArnel/crimemapping,jayArnel/crimemapping,jayArnel/crimemapping | crimemapping/crime/admin.py | crimemapping/crime/admin.py | from django.contrib import admin
from crimemapping.crime import models
admin.site.register(models.Crime) | from django.contrib import admin
# Register your models here.
| bsd-2-clause | Python |
cfe8d934488275c131a7d5bbe0172df2689789fc | Allow IRFieldChain to be passed IRField types in addition to instantiated types. | kata198/indexedredis,kata198/indexedredis | IndexedRedis/fields/chain.py | IndexedRedis/fields/chain.py | # Copyright (c) 2014, 2015, 2016 Timothy Savannah under LGPL version 2.1. See LICENSE for more information.
#
# chain - Support for chaining multiple IRField's (so for example to compress a json value)
#
# vim:set ts=8 shiftwidth=8 softtabstop=8 noexpandtab :
from ..compat_str import to_unicode
from . import IRFiel... | # Copyright (c) 2014, 2015, 2016 Timothy Savannah under LGPL version 2.1. See LICENSE for more information.
#
# chain - Support for chaining multiple IRField's (so for example to compress a json value)
#
# vim:set ts=8 shiftwidth=8 softtabstop=8 noexpandtab :
from ..compat_str import to_unicode
from . import IRFiel... | lgpl-2.1 | Python |
dab93788e8f055f50bedd6ba7d88317072af4012 | Bump version to 1.5.2 | SpotlightKid/jack-select,SpotlightKid/jack-select | jackselect/version.py | jackselect/version.py | # -*- coding: utf-8 -*-
__version__ = "1.5.2"
| # -*- coding: utf-8 -*-
__version__ = "1.5.1"
| mit | Python |
5a687d226635041d5fdb3367dffd0c09cf45d862 | fix bad encodings in buttcoin plugin | TeamPeggle/ppp-helpdesk | plugins/buttcoin.py | plugins/buttcoin.py | import random
import re
from time import strptime, strftime
from urllib import quote
import unicodedata
from util import http, hook
import twitter
@hook.api_key('twitter')
@hook.command('btc', autohelp=False)
@hook.command('bitcoin', autohelp=False)
@hook.command('bit', autohelp=False)
@hook.command(autohelp=False)
... | import random
import re
from time import strptime, strftime
from urllib import quote
from util import http, hook
import twitter
@hook.api_key('twitter')
@hook.command('btc', autohelp=False)
@hook.command('bitcoin', autohelp=False)
@hook.command('bit', autohelp=False)
@hook.command(autohelp=False)
def buttcoin(inp, a... | unlicense | Python |
94c532a57782925fe01942c37ee063badd2566b1 | fix NormalizeAug example | makcedward/nlpaug,makcedward/nlpaug | nlpaug/augmenter/audio/normalization.py | nlpaug/augmenter/audio/normalization.py | """
Augmenter that apply mask normalization to audio.
"""
from nlpaug.augmenter.audio import AudioAugmenter
import nlpaug.model.audio as nma
from nlpaug.util import Action, WarningMessage
class NormalizeAug(AudioAugmenter):
"""
:param str method: It supports 'minmax', 'max' and 'standard'. For 'minmax', ... | """
Augmenter that apply mask normalization to audio.
"""
from nlpaug.augmenter.audio import AudioAugmenter
import nlpaug.model.audio as nma
from nlpaug.util import Action, WarningMessage
class NormalizeAug(AudioAugmenter):
"""
:param str method: It supports 'minmax', 'max' and 'standard'. For 'minmax', ... | mit | Python |
2e1de74d3afa622ba0b9190f1859cd9a0a8ebbdb | Use tf.nn.rnn | raviqqe/tensorflow-extenteten,raviqqe/tensorflow-extenteten | nn/embedding/embeddings_to_embedding.py | nn/embedding/embeddings_to_embedding.py | import tensorflow as tf
from ..util import static_shape, static_rank
from ..linear import linear
from ..variable import variable
def embeddings_to_embedding(child_embeddings,
output_embedding_size,
context_vector_size):
assert static_rank(child_embeddings) =... | import tensorflow as tf
from ..util import static_shape, static_rank
from ..linear import linear
from ..variable import variable
def embeddings_to_embedding(child_embeddings,
output_embedding_size,
context_vector_size):
assert static_rank(child_embeddings) =... | unlicense | Python |
a20b36f0f74e2422b6dde85c609b69004ff1e7e3 | Fix __ne__ | adsr303/etobj,artbookspirit/etobj | etobj.py | etobj.py | """Convert an ElementTree to an objectified API."""
import collections
import re
NS_RE = re.compile(r'\{.+\}')
class Element(collections.Sequence):
def __init__(self, elem, parent=None):
self._elem = elem
self._parent = parent
def __getitem__(self, key):
if self._parent is None:
... | """Convert an ElementTree to an objectified API."""
import collections
import re
NS_RE = re.compile(r'\{.+\}')
class Element(collections.Sequence):
def __init__(self, elem, parent=None):
self._elem = elem
self._parent = parent
def __getitem__(self, key):
if self._parent is None:
... | mit | Python |
1996b923053073bfd814c5eeea2bc4d8ef25471d | Modify test setup | pistatium/houkago_app,pistatium/houkago_app,pistatium/houkago_app,pistatium/houkago_app,pistatium/houkago_app | server_appengine/tests/__init__.py | server_appengine/tests/__init__.py | # coding: utf-8
from __future__ import absolute_import, division, print_function
import django.conf
from .. import settings
'''
load setting file
http://stackoverflow.com/questions/5122414/django-googleappengine-error-django-settings-module-is-undefined
'''
# Filter out all the non-setting attributes of the set... | # coding: utf-8
from __future__ import absolute_import, division, print_function
from django.conf import settings
settings.configure(
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": ":memory:",
}
}
)
| apache-2.0 | Python |
fcf65931b28480b74bc9079fedfc4bd971de81d8 | use title in RCV1 | jpbottaro/anna | anna/main.py | anna/main.py | """Main entry point for all experiments."""
import os
import sys
import anna.model.premade as models
import anna.data.dataset.reuters21578 as reuters
import anna.data.dataset.fullrcv1 as rcv1
import anna.data.dataset.bioasq as bioasq
if __name__ == "__main__":
if len(sys.argv) < 2:
print("Usage: main.py ... | """Main entry point for all experiments."""
import os
import sys
import anna.model.premade as models
import anna.data.dataset.reuters21578 as reuters
import anna.data.dataset.fullrcv1 as rcv1
import anna.data.dataset.bioasq as bioasq
if __name__ == "__main__":
if len(sys.argv) < 2:
print("Usage: main.py ... | mit | Python |
aefe3cb4843192b891ebef9d6db7aa0adf1ba1a4 | Add some tests for the various RuleMapping implementations | LogicalDash/LiSE,LogicalDash/LiSE | LiSE/LiSE/tests/test_rule.py | LiSE/LiSE/tests/test_rule.py | import pytest
import os
from LiSE.engine import Engine
@pytest.fixture(scope='function')
def engy():
codefiles = ('trigger.py', 'prereq.py', 'action.py', 'method.py', 'function.py')
for file in codefiles:
if os.path.exists(file):
os.remove(file)
with Engine(":memory:") as eng:
... | agpl-3.0 | Python | |
ddefbe344e24a0bb1eb01e2a535a3bc84036b0f9 | write downloaded Selenium Webdriver version to file | lcmtwn/webdriver_controller | webdriver_controller/controller.py | webdriver_controller/controller.py | import json
from pathlib import Path
import shutil
from webdriver_controller import config
from webdriver_controller.drivers.chromedriver import ChromeDriver
from webdriver_controller.drivers.selenium_standalone import SeleniumStandalone
class WebdriverController(object):
__installation_folder = Path('{}{}'.form... | from pathlib import Path
import shutil
from webdriver_controller import config
from webdriver_controller.drivers.chromedriver import ChromeDriver
from webdriver_controller.drivers.selenium_standalone import SeleniumStandalone
class WebdriverController(object):
_installation_folder = Path('{}{}'.format(Path.cwd()... | mit | Python |
f5373fef7c0085bc48405be359e0a2811804bbcc | rename parameters to exercise placeholder | pheanex/xpython,exercism/xpython,exercism/python,behrtam/xpython,smalley/python,smalley/python,N-Parsons/exercism-python,mweb/python,exercism/python,exercism/xpython,mweb/python,jmluy/xpython,N-Parsons/exercism-python,jmluy/xpython,pheanex/xpython,behrtam/xpython | exercises/book-store/book_store.py | exercises/book-store/book_store.py | def calculate_total(books):
pass
| def calculate_total(array, number=None):
pass
| mit | Python |
17a3bd11d5383537f43fbf20f3dbd4c9021eb48c | Rename before_request() to setup_git_repo(). | s3rvac/git-branch-viewer,s3rvac/git-branch-viewer | viewer/web/views.py | viewer/web/views.py | """
viewer.web.views
~~~~~~~~~~~~~~~~
Views for the web.
:copyright: © 2014 by Petr Zemek <s3rvac@gmail.com> and contributors
:license: BSD, see LICENSE for more details
"""
from flask import render_template
from flask import g
from viewer import git
from viewer.format import format_date
from vi... | """
viewer.web.views
~~~~~~~~~~~~~~~~
Views for the web.
:copyright: © 2014 by Petr Zemek <s3rvac@gmail.com> and contributors
:license: BSD, see LICENSE for more details
"""
from flask import render_template
from flask import g
from viewer import git
from viewer.format import format_date
from vi... | bsd-3-clause | Python |
b19a23c7e306844ddf66b8067dfa64fa899e5c87 | Update run.py | qobilidop/srcnn,qobilidop/srcnn | experiments/srcnn-9-1-5_sc4/run.py | experiments/srcnn-9-1-5_sc4/run.py | from functools import partial
from toolbox.data import load_set
from toolbox.models import compile_srcnn
from toolbox.experiment import Experiment
from toolbox.preprocessing import bicubic_resize
# Model
scale = 4
model = compile_srcnn(c=1, f1=9, f2=1, f3=5, n1=64, n2=32)
model.summary()
# Data
train_set = '91-imag... | mit | Python | |
dd10de3265dc60e55f1718ea264723ead93d077f | Bump version for release. | hendrikx-itc/minerva,hendrikx-itc/minerva | python-package/src/minerva/__init__.py | python-package/src/minerva/__init__.py | # -*- coding: utf-8 -*-
__version__ = "4.6.19"
| # -*- coding: utf-8 -*-
__version__ = "4.6.18"
| agpl-3.0 | Python |
d5da5b04952eee6c96968364ccf93bb4120ceb04 | fix reduce writer to use new BaseWriter API | scrapinghub/exporters | exporters/writers/reduce_writer.py | exporters/writers/reduce_writer.py | from .base_writer import BaseWriter
from exporters.exceptions import ConfigurationError
def compile_reduce_function(reduce_code):
# XXX: potential security hole -- only use this in contained environments
exec(reduce_code)
try:
return locals()['reduce_function']
except KeyError:
raise C... | from .base_writer import BaseWriter
from exporters.exceptions import ConfigurationError
def compile_reduce_function(reduce_code):
# XXX: potential security hole -- only use this in contained environments
exec(reduce_code)
try:
return locals()['reduce_function']
except KeyError:
raise C... | bsd-3-clause | Python |
4fbf5c8ebc545f80caf82a7f52b4676d40ade5e5 | Check service name to decide who will create the first user | OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft | packages/grid/backend/grid/db/init_db.py | packages/grid/backend/grid/db/init_db.py | # stdlib
import os
import time
from typing import Optional
# third party
from nacl.encoding import HexEncoder
from nacl.signing import SigningKey
from sqlalchemy.orm import Session
# grid absolute
from grid.core.config import settings
from grid.core.node import node
def init_db(db: Session, signing_key: Optional[Si... | # stdlib
from typing import Optional
# third party
from nacl.encoding import HexEncoder
from nacl.signing import SigningKey
from sqlalchemy.orm import Session
# grid absolute
from grid.core.config import settings
from grid.core.node import node
def init_db(db: Session, signing_key: Optional[SigningKey] = None) -> N... | apache-2.0 | Python |
84e41e39921b33fc9c84a99fe498587ca7ac30ae | Add CSV folder setting comment | AustralianAntarcticDataCentre/save_emails_to_files,AustralianAntarcticDataCentre/save_emails_to_files | settings_example.py | settings_example.py | import os
import re
from imap import EmailCheckError, EmailServer
from postgresql import DatabaseServer
# If this is set to a valid path, all CSV files extracted from emails will be
# stored in sub-folders within it.
CSV_FOLDER = os.getcwd()
# Values come from `EMAIL_SUBJECT_RE`.
CSV_NAME_FORMAT = '{year}-{month}-{... | import os
import re
from imap import EmailCheckError, EmailServer
from postgresql import DatabaseServer
CSV_FOLDER = os.getcwd()
# Values come from `EMAIL_SUBJECT_RE`.
CSV_NAME_FORMAT = '{year}-{month}-{day}T{hour}{minute}.csv'
# Restrict emails by sender.
EMAIL_FROM = 'sender@example.com'
# Restrict emails by su... | mit | Python |
d5032b139dccef63d6025a6db76ed54fceabbf56 | set relative path for activate_this and PROJECT_ROOT | euroscipy/esp_2015,euroscipy/esp_2015 | esp_2015/wsgi.py | esp_2015/wsgi.py | """
WSGI config for esp_2015 project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
import sys
VENV_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), os.par... | """
WSGI config for esp_2015 project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "esp_2015.settings")
from django.cor... | mit | Python |
c2a090772e8aaa3a1f2239c0ca7abc0cb8978c88 | Add -c option to continue if one file has a SyntaxError | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | Tools/compiler/compile.py | Tools/compiler/compile.py | import sys
import getopt
from compiler import compile, visitor
##import profile
def main():
VERBOSE = 0
DISPLAY = 0
CONTINUE = 0
opts, args = getopt.getopt(sys.argv[1:], 'vqdc')
for k, v in opts:
if k == '-v':
VERBOSE = 1
visitor.ASTVisitor.VERBOSE = visitor.ASTVis... | import sys
import getopt
from compiler import compile, visitor
def main():
VERBOSE = 0
DISPLAY = 0
opts, args = getopt.getopt(sys.argv[1:], 'vqd')
for k, v in opts:
if k == '-v':
VERBOSE = 1
visitor.ASTVisitor.VERBOSE = visitor.ASTVisitor.VERBOSE + 1
if k == '-q... | mit | Python |
9a0fd1daf7d35ae1b29e3d1dbbc11272fcb13847 | Enable sort keys in json dumps to make sure json is stable | c0d3m0nkey/xml-to-json-converter | app/start.py | app/start.py | from lxml import objectify, etree
import simplejson as json
from converter.nsl.nsl_converter import NslConverter
from converter.nsl.other.nsl_other_converter import NslOtherConverter
import sys
xml = open("SEnsl_ssi.xml")
xml_string = xml.read()
xml_obj = objectify.fromstring(xml_string)
nsl_other_xml_string = open(... | from lxml import objectify, etree
import simplejson as json
from converter.nsl.nsl_converter import NslConverter
from converter.nsl.other.nsl_other_converter import NslOtherConverter
import sys
xml = open("SEnsl_ssi.xml")
xml_string = xml.read()
xml_obj = objectify.fromstring(xml_string)
nsl_other_xml_string = open(... | bsd-2-clause | Python |
8c9414aa3badd31a60ce88f37fed41e98c867d9f | Update custom permissions after migration | janLo/Windberg-web,janLo/Windberg-web | windberg_web/__init__.py | windberg_web/__init__.py | # register a signal do update permissions every migration.
# This is based on app django_extensions update_permissions command
from south.signals import post_migrate
def update_permissions_after_migration(app,**kwargs):
"""
Update app permission just after every migration.
This is based on app django_exten... | bsd-3-clause | Python | |
79101c22efd5b5d787b651cd2a362ac7b5da95c3 | Update move_arm.py | WalkingMachine/sara_behaviors,WalkingMachine/sara_behaviors | sara_flexbe_states/src/sara_flexbe_states/move_arm.py | sara_flexbe_states/src/sara_flexbe_states/move_arm.py | #!/usr/bin/env python
from __future__ import print_function
from flexbe_core import EventState, Logger
from geometry_msgs.msg import Pose
from sara_moveit.srv import *
import rospy
class MoveArm(EventState):
'''
MoveArm receive a ROS pose as input and launch a ROS service with the same pose
># pose P... | #!/usr/bin/env python
from __future__ import print_function
from flexbe_core import EventState, Logger
import rospy
class MoveArm(EventState):
'''
MoveArm receive a ROS pose as input and launch a ROS service with the same pose
># pose Pose2D Target waypoint for navigation.
<= done Finis... | bsd-3-clause | Python |
02b855f6df05fdf279317d4afe1bb338018469e0 | fix mass import | shortdudey123/gbot | modules/__init__.py | modules/__init__.py | import os
for module in os.listdir(os.path.dirname(__file__)):
if module == '__init__.py' or module[-3:] != '.py' or module[-4:] != '.pyc' or module[-4:] != '.pyo':
continue
__import__(module[:-3], locals(), globals())
del os | import os
for module in os.listdir(os.path.dirname(__file__)):
if module == '__init__.py' or module[-3:] != '.py':
continue
__import__(module[:-3], locals(), globals())
del module | apache-2.0 | Python |
1fed581c05462ad57cfa1ead64a59ab686ede2eb | Remove print statement | atmtools/typhon,atmtools/typhon | typhon/tests/test_topography.py | typhon/tests/test_topography.py | """Testing interfaces to digital elevation models.
"""
import os
import pytest
import numpy as np
from typhon.topography import SRTM30
class TestEnvironment:
"""Testing the environment handler."""
def setup_method(self):
"""No setup required."""
pass
def teardown_method(self):
"""N... | """Testing interfaces to digital elevation models.
"""
import os
import pytest
import numpy as np
from typhon.topography import SRTM30
class TestEnvironment:
"""Testing the environment handler."""
def setup_method(self):
"""No setup required."""
pass
def teardown_method(self):
"""N... | mit | Python |
65536f16ae84df2227fbb8c3a47a94d412520a15 | Add fc details command | ccubed/Smurf | ffxiv.py | ffxiv.py | import json
import discord
from discord.ext import commands
class Ffxiv():
def __init__(self, bot):
self.bot = bot
self.parties = {'Light': {'dps': 2, 'tank': 1, 'healer': 1}, 'Full': {'dps': 4, 'tank': 2, 'healer': 2},
'Raid': {'dps': 12, 'tank': 6, 'healer': 6}}
s... | import discord
from discord.ext import commands
class Ffxiv():
def __init__(self, bot):
self.bot = bot
self.parties = {'Light': {'dps': 2, 'tank': 1, 'healer': 1}, 'Full': {'dps': 4, 'tank': 2, 'healer': 2},
'Raid': {'dps': 12, 'tank': 6, 'healer': 6}}
self.roles = ... | mit | Python |
50a8650046f76cb41c525b56cabf93c798f2ef05 | Add more invalid services names to dtube request test | freedesktop-unofficial-mirror/telepathy__telepathy-salut,freedesktop-unofficial-mirror/telepathy__telepathy-salut,freedesktop-unofficial-mirror/telepathy__telepathy-salut,freedesktop-unofficial-mirror/telepathy__telepathy-salut | tests/twisted/avahi/test-request-invalid-dbus-tube.py | tests/twisted/avahi/test-request-invalid-dbus-tube.py | from saluttest import exec_test
from avahitest import AvahiAnnouncer, AvahiListener
from avahitest import get_host_name
import avahi
import dbus
import os
import errno
import string
from xmppstream import setup_stream_listener, connect_to_stream
from servicetest import make_channel_proxy, Event, EventPattern, call_asy... | from saluttest import exec_test
from avahitest import AvahiAnnouncer, AvahiListener
from avahitest import get_host_name
import avahi
import dbus
import os
import errno
import string
from xmppstream import setup_stream_listener, connect_to_stream
from servicetest import make_channel_proxy, Event, EventPattern, call_asy... | lgpl-2.1 | Python |
e2b1636f079d0b7b5924ba1d0da571ced32daf79 | Add contrib.sites to testproj | edoburu/django-parler-rest | testproj/settings.py | testproj/settings.py | """
Django settings for testproj project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
from __future__ import unicode_literals
import os.path
from django.util... | """
Django settings for testproj project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
from __future__ import unicode_literals
import os.path
from django.util... | apache-2.0 | Python |
02956b782749e253b7882ddeb1d29177ea8f2444 | fix image pull | rancher/rancher,rancher/rancher,rancher/rancher,cjellick/rancher,cjellick/rancher,cjellick/rancher,rancherio/rancher,rancher/rancher,rancherio/rancher | tests/validation/tests/v3_api/test_windows_cluster.py | tests/validation/tests/v3_api/test_windows_cluster.py |
from .common import TEST_IMAGE
from .common import TEST_IMAGE_NGINX
from .common import TEST_IMAGE_OS_BASE
from .common import cluster_cleanup
from .common import get_user_client
from .common import random_test_name
from .test_rke_cluster_provisioning import create_custom_host_from_nodes
from .test_rke_cluster_provisi... |
from .common import TEST_IMAGE
from .common import TEST_IMAGE_NGINX
from .common import TEST_IMAGE_OS_BASE
from .common import cluster_cleanup
from .common import get_user_client
from .common import random_test_name
from .test_rke_cluster_provisioning import create_custom_host_from_nodes
from .test_rke_cluster_provisi... | apache-2.0 | Python |
8ab6eb6cc86fdb7e7af366a0acccd6d02c901e37 | add SAM/BAM/CRAM in the API | sequana/sequana,sequana/sequana,sequana/sequana,sequana/sequana,sequana/sequana | sequana/__init__.py | sequana/__init__.py |
import pkg_resources
try:
version = pkg_resources.require("sequana")[0].version
except:
version = ">=0.7.1"
try:
from easydev.logging_tools import Logging
logger = Logging("sequana", "WARNING")
except:
import colorlog
logger = colorlog.getLogger("sequana")
from easydev import CustomConfig
... |
import pkg_resources
try:
version = pkg_resources.require("sequana")[0].version
except:
version = ">=0.7.1"
try:
from easydev.logging_tools import Logging
logger = Logging("sequana", "WARNING")
except:
import colorlog
logger = colorlog.getLogger("sequana")
from easydev import CustomConfig
... | bsd-3-clause | Python |
a728a49927fa4e8d2856070c626a2adef10024ac | Add method to retrieve token string | depa77/flask-simplejwt | flask_simplejwt/flask_simplejwt.py | flask_simplejwt/flask_simplejwt.py | from functools import wraps
from flask import request, abort
import jwt
class SimpleJWT:
"""
Class to manage JWT Token in Flask
"""
def __init__(self, secret, realm=None, algorithms=None):
"""
Class constructor
Initializes the secret key for the token
:param secret: s... | from functools import wraps
from flask import request, abort
import jwt
class SimpleJWT:
"""
Class to manage JWT Token in Flask
"""
def __init__(self, secret, realm=None, algorithms=None):
"""
Class constructor
Initializes the secret key for the token
:param secret: s... | mit | Python |
b32520e0fb2ff72498b16ea75bea53fbbe96854f | Update failure key in test | anchore/anchore-engine,anchore/anchore-engine,anchore/anchore-engine | tests/functional/services/api/images/test_post.py | tests/functional/services/api/images/test_post.py | class TestOversizedImageReturns400:
# Expectation for this test is that the image with tag is greater than the value defined in config
def test_oversized_image_post(self, make_image_analysis_request):
resp = make_image_analysis_request("anchore/test_images:oversized_image")
details = resp.body[... | class TestOversizedImageReturns400:
# Expectation for this test is that the image with tag is greater than the value defined in config
def test_oversized_image_post(self, make_image_analysis_request):
resp = make_image_analysis_request("anchore/test_images:oversized_image")
details = resp.body[... | apache-2.0 | Python |
0bbcff495b9012a06f721121395f37290b37d354 | add a convenience function | soerendip42/rdkit,rvianello/rdkit,rvianello/rdkit,ptosco/rdkit,AlexanderSavelyev/rdkit,soerendip42/rdkit,greglandrum/rdkit,jandom/rdkit,rvianello/rdkit,ptosco/rdkit,adalke/rdkit,bp-kelley/rdkit,ptosco/rdkit,strets123/rdkit,rdkit/rdkit,AlexanderSavelyev/rdkit,bp-kelley/rdkit,adalke/rdkit,soerendip42/rdkit,greglandrum/rd... | Python/Chem/Draw/__init__.py | Python/Chem/Draw/__init__.py | # $Id$
#
# Copyright (C) 2006-2008 Greg Landrum
# All Rights Reserved
#
def MolToImageFile(mol,filename,size=(300,300),kekulize=True, wedgeBonds=True):
import MolDrawing
try:
from aggdraw import Draw
from PIL import Image
MolDrawing.registerCanvas('agg')
useAGG=True
except:
import traceback... | bsd-3-clause | Python | |
e9381894e523485a29bf4bb2a91465b14526c190 | use string events | ciappi/Yaranullin | yaranullin/run_client.py | yaranullin/run_client.py | # yaranullin/run_client.py
#
# Copyright (c) 2012 Marco Scopesi <marco.scopesi@gmail.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWAR... | # yaranullin/run_client.py
#
# Copyright (c) 2012 Marco Scopesi <marco.scopesi@gmail.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWAR... | isc | Python |
17cda9a08e85d0ef71e973a6306c087c47e89452 | bump version | seatgeek/sixpack-py | sixpack/__init__.py | sixpack/__init__.py | __version__ = '1.0.0'
| __version__ = '0.3.0'
| bsd-3-clause | Python |
9c5a4000006de003bc6d736ce4cfdd4e238f8cfd | fix TypedFileField bug: set file pointer back to begining of the file refactor TypedFileField | steelkiwi/django-skd-tools | skd_tools/fields.py | skd_tools/fields.py | import magic
from django import forms
from django.utils.translation import ugettext_lazy as _
class TypedFileField(forms.FileField):
"""
Field for validation type of uploaded file
Field take either "allowed_mimes" or "allowed_exts" lists
with mimes or exts respectively
Max size taking MB(megabyt... | import magic
from django import forms
from django.utils.translation import ugettext_lazy as _
class TypedFileField(forms.FileField):
"""
Field for validation type of uploaded file
Field take either "allowed_mimes" or "allowed_exts" lists
with mimes or exts respectively
Max size taking MB(megaby... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.