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 |
|---|---|---|---|---|---|---|---|---|
bab1ad914ab9273aa8ab905edef2578b5c760f31 | add django installed apps init opps core | jeanmask/opps,williamroot/opps,opps/opps,opps/opps,williamroot/opps,opps/opps,jeanmask/opps,williamroot/opps,jeanmask/opps,williamroot/opps,opps/opps,YACOWS/opps,YACOWS/opps,YACOWS/opps,YACOWS/opps,jeanmask/opps | opps/core/__init__.py | opps/core/__init__.py | # -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
trans_app_label = _('Opps')
settings.INSTALLED_APPS += ('opps.article',
'opps.image',
'opps.channel',
'opps.source',
'redactor',
'tagging',)
settings.REDACTOR_OPT... | # -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
trans_app_label = _('Opps')
| mit | Python |
de29012d0bf48cf970ad37c62d7db960161f14c0 | Remove unused stat import | kaiyou/freeposte.io,kaiyou/freeposte.io,kaiyou/freeposte.io,kaiyou/freeposte.io | core/dovecot/start.py | core/dovecot/start.py | #!/usr/bin/python3
import os
import glob
import multiprocessing
import logging as log
import sys
from podop import run_server
from socrate import system, conf
log.basicConfig(stream=sys.stderr, level=os.environ.get("LOG_LEVEL", "WARNING"))
def start_podop():
os.setuid(8)
url = "http://" + os.environ["ADMI... | #!/usr/bin/python3
import os
import stat
import glob
import multiprocessing
import logging as log
import sys
from podop import run_server
from socrate import system, conf
log.basicConfig(stream=sys.stderr, level=os.environ.get("LOG_LEVEL", "WARNING"))
def start_podop():
os.setuid(8)
url = "http://" + os.e... | mit | Python |
6593fe983b40a5d4c467cb2ea0847e10e5faae1c | Update Beck_Pang_First_Python_practice_2.7.py | Beck-Sisyphus/Robocup,Beck-Sisyphus/Robocup,Beck-Sisyphus/Robocup,Beck-Sisyphus/Robocup,Beck-Sisyphus/Robocup | Coding_practice/Beck_Pang_First_Python_practice_2.7.py | Coding_practice/Beck_Pang_First_Python_practice_2.7.py | """
Beck Pang 25/07/2014
First practice project for our summer robotics team
"""
import random
def name_to_number (name):
# This helper function converts the string name into a number between 0 an 4
# pre: take a name in String as a parameter
# post: return an represented number in integer
if (name ==... | """
Beck Pang 25/07/2014
First practice project for our summer robotics team
"""
import random
def name_to_number (name):
# This helper function converts the string name into a number between 0 an 4
# pre: take a name in String as a parameter
# post: return an represented number in integer
if (name ==... | mit | Python |
8483de37aad2256266deb404ce4d9eaae31a8142 | Remove backend | conversationai/conversationai-models,conversationai/conversationai-models | kaggle-classification/keras_trainer/rnn.py | kaggle-classification/keras_trainer/rnn.py | """RNN"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from keras.layers import Input, GRU, Dense, Embedding, Dropout, Bidirectional, TimeDistributed, Multiply, Flatten, Reshape, Dot
from keras.models import Model
from keras_trainer import base_model
fro... | """RNN"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from keras.layers import Input, GRU, Dense, Embedding, Dropout, Bidirectional, TimeDistributed, Multiply, Flatten, Reshape, Dot
from keras.models import Model
from keras_trainer import base_model
fro... | apache-2.0 | Python |
7fd0ed0897ffedf117698502cdefac0436ac4f2c | remove MotechTab import | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/tabs/config.py | corehq/tabs/config.py | from corehq.apps.styleguide.tabs import SGExampleTab, SimpleCrispyFormSGExample, \
ControlsDemoSGExample
from corehq.tabs.tabclasses import DashboardTab, ProjectReportsTab, ProjectInfoTab, SetupTab, \
ProjectDataTab, ApplicationsTab, CloudcareTab, MessagingTab, ProjectUsersTab, \
AdminTab, IndicatorAdminTab... | from corehq.apps.styleguide.tabs import SGExampleTab, SimpleCrispyFormSGExample, \
ControlsDemoSGExample
from corehq.tabs.tabclasses import DashboardTab, ProjectReportsTab, ProjectInfoTab, SetupTab, \
ProjectDataTab, ApplicationsTab, CloudcareTab, MessagingTab, ProjectUsersTab, \
AdminTab, IndicatorAdminTab... | bsd-3-clause | Python |
0185a30a340fae956c0e5b9d9f354e56e2e2178a | update the wsgi file | dstufft/jutils | crate_project/wsgi.py | crate_project/wsgi.py | import os
import sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "apps")))
import newrelic.agent
newrelic.agent.initialize()
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
| import newrelic.agent
newrelic.agent.initialize()
import pinax.env
from django.core.wsgi import get_wsgi_application
# setup the environment for Django and Pinax
pinax.env.setup_environ(__file__)
# set application for WSGI processing
application = get_wsgi_application()
| bsd-2-clause | Python |
a0fab69d12d64d4e5371fcb26a4ec70365a76fa6 | Move task results database to data dir | mchelem/cref2,mchelem/cref2,mchelem/cref2 | cref/app/web/tasks.py | cref/app/web/tasks.py | from celery import Celery
from cref.app.terminal import run_cref
app = Celery(
'tasks',
backend='db+sqlite:///data/results.sqlite',
broker='amqp://guest@localhost//'
)
@app.task
def predict_structure(sequence, params={}):
return run_cref(sequence)
| from celery import Celery
from cref.app.terminal import run_cref
app = Celery(
'tasks',
backend='db+sqlite:///results.sqlite',
broker='amqp://guest@localhost//'
)
@app.task
def predict_structure(sequence, params={}):
return run_cref(sequence)
| mit | Python |
6e287393ad87ad09f94f845d372b5835ad4ebaba | Increase plot range | Koheron/zynq-sdk,Koheron/zynq-sdk,Koheron/zynq-sdk,Koheron/zynq-sdk | examples/alpha250-4/adc-bram/test.py | examples/alpha250-4/adc-bram/test.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import os
import time
from adc_bram import AdcBram
from koheron import connect
import matplotlib
matplotlib.use('TKAgg')
from matplotlib import pyplot as plt
from matplotlib.lines import Line2D
host = os.getenv('HOST', '192.168.1.50')
client = connect(... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import os
import time
from adc_bram import AdcBram
from koheron import connect
import matplotlib
matplotlib.use('TKAgg')
from matplotlib import pyplot as plt
from matplotlib.lines import Line2D
host = os.getenv('HOST', '192.168.1.50')
client = connect(... | mit | Python |
63b828983b38eb00e68683c19c51f444102a030d | support p3k on python file | sherzberg/vim-bootstrap-updater | plugin/vim_bootstrap_updater.py | plugin/vim_bootstrap_updater.py | import os
try:
import urllib2
import urllib
except ImportError:
import urllib.request as urllib2
import urllib.parse as urllib
def vimrc_path(editor):
return os.path.expanduser('~/.%src' % editor)
def _generate_vimrc(editor, langs):
params = [('langs', l.strip()) for l in langs]
params.a... | import os
import urllib
import urllib2
def vimrc_path(editor):
return os.path.expanduser('~/.%src' % editor)
def _generate_vimrc(editor, langs):
params = [('langs', l.strip()) for l in langs]
params.append(('editor', editor))
data = urllib.urlencode(params)
resp = urllib2.urlopen("https://vim-bo... | mit | Python |
900d872d4d1f8a593f25ac982e48ac86660955fd | Store name unique | meghabhoj/NEWBAZAAR,meghabhoj/NEWBAZAAR,meghabhoj/NEWBAZAAR,evonove/django-bazaar,evonove/django-bazaar,evonove/django-bazaar | bazaar/listings/models.py | bazaar/listings/models.py | from __future__ import unicode_literals
from django.db import models
from django.utils import timezone
from django.utils.encoding import python_2_unicode_compatible
from ..fields import MoneyField
from ..goods.models import Product
@python_2_unicode_compatible
class Listing(models.Model):
title = models.CharFie... | from __future__ import unicode_literals
from django.db import models
from django.utils import timezone
from django.utils.encoding import python_2_unicode_compatible
from ..fields import MoneyField
from ..goods.models import Product
@python_2_unicode_compatible
class Listing(models.Model):
title = models.CharFie... | bsd-2-clause | Python |
19df232461679b3156f9d5889d59f095e0b97d60 | Add CAN_DETECT | damngamerz/coala-bears,sounak98/coala-bears,Vamshi99/coala-bears,coala/coala-bears,damngamerz/coala-bears,LWJensen/coala-bears,Asnelchristian/coala-bears,Vamshi99/coala-bears,horczech/coala-bears,meetmangukiya/coala-bears,Shade5/coala-bears,damngamerz/coala-bears,Asnelchristian/coala-bears,Shade5/coala-bears,meetmanguk... | bears/yml/RAMLLintBear.py | bears/yml/RAMLLintBear.py | from coalib.bearlib.abstractions.Linter import linter
from coalib.bears.requirements.NpmRequirement import NpmRequirement
@linter(executable='ramllint',
output_format='regex',
output_regex=r'(?P<severity>error|warning|info).*\n (?P<message>.+) '
r'\[(?P<origin>.+)\]')
class RAMLL... | from coalib.bearlib.abstractions.Linter import linter
from coalib.bears.requirements.NpmRequirement import NpmRequirement
@linter(executable='ramllint',
output_format='regex',
output_regex=r'(?P<severity>error|warning|info).*\n (?P<message>.+) '
r'\[(?P<origin>.+)\]')
class RAMLL... | agpl-3.0 | Python |
824a2a547218febf61aed8d99eff5ddeeaf6f5ca | Remove unused imports | polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon | polyaxon/libs/models.py | polyaxon/libs/models.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from django.db import models
from django.core.cache import cache
class DescribableModel(models.Model):
description = models.TextField(blank=True, null=True)
class Meta:
abstract = True
class DiffModel(models.M... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from django.core.validators import validate_slug
from django.db import models
from django.core.cache import cache
from libs.blacklist import validate_blacklist_name
class DescribableModel(models.Model):
description = models... | apache-2.0 | Python |
814cc6cef757c3eef775240c749a098b1288eef3 | Enable searching for an image in the admin | ken-muturi/pombola,geoffkilpin/pombola,patricmutwiri/pombola,geoffkilpin/pombola,hzj123/56th,mysociety/pombola,hzj123/56th,geoffkilpin/pombola,mysociety/pombola,mysociety/pombola,ken-muturi/pombola,geoffkilpin/pombola,geoffkilpin/pombola,geoffkilpin/pombola,patricmutwiri/pombola,patricmutwiri/pombola,hzj123/56th,hzj123... | pombola/images/admin.py | pombola/images/admin.py | from django.contrib import admin
from django.contrib.contenttypes.generic import GenericTabularInline
from sorl.thumbnail import get_thumbnail
from sorl.thumbnail.admin import AdminImageMixin
from pombola.images import models
class ImageAdmin(AdminImageMixin, admin.ModelAdmin):
list_display = [ 'thumbnail',... | from django.contrib import admin
from django.contrib.contenttypes.generic import GenericTabularInline
from sorl.thumbnail import get_thumbnail
from sorl.thumbnail.admin import AdminImageMixin
from pombola.images import models
class ImageAdmin(AdminImageMixin, admin.ModelAdmin):
list_display = [ 'thumbnail',... | agpl-3.0 | Python |
c99d5d30a698aafe3e554c48c9a47dd8be1a5575 | Use imap instead of map | jogo/gerrit-fun | library.py | library.py | import json
import logging
import os
import subprocess
import urllib
import grequests
import numpy
logging.basicConfig()
logger = logging.getLogger("recheck")
logger.setLevel(logging.DEBUG)
def get_change_ids(repo_path, subtree=None, since="6.months"):
"""Return array of change-Ids of merged patches.
retur... | import json
import logging
import os
import subprocess
import urllib
import grequests
import numpy
logging.basicConfig()
logger = logging.getLogger("recheck")
logger.setLevel(logging.DEBUG)
def get_change_ids(repo_path, subtree=None, since="6.months"):
"""Return array of change-Ids of merged patches.
retur... | apache-2.0 | Python |
b0f5913d5f775062b8d5e253e1403b995b67c81a | Bump to version 3.2.0 | jrief/django-post_office,ui/django-post_office,ui/django-post_office | post_office/__init__.py | post_office/__init__.py | VERSION = (3, 2, 0)
from .backends import EmailBackend
default_app_config = 'post_office.apps.PostOfficeConfig'
| VERSION = (3, 2, 0, 'dev')
from .backends import EmailBackend
default_app_config = 'post_office.apps.PostOfficeConfig'
| mit | Python |
f28732596487a2a0fc664c5444e618ce5c23eccd | fix usage | teharrison/pipeline,wgerlach/pipeline,MG-RAST/pipeline,MG-RAST/pipeline,teharrison/pipeline,MG-RAST/pipeline,wgerlach/pipeline,wgerlach/pipeline,teharrison/pipeline | bin/extract_darkmatter.py | bin/extract_darkmatter.py | #!/usr/bin/env python
import argparse
import leveldb
import os
import shutil
import sys
from Bio import SeqIO
def main(args):
parser = argparse.ArgumentParser(description="Script to extract darkmatter - predicted proteins with no similarities")
parser.add_argument("-i", "--input", dest="input", help="Name of ... | #!/usr/bin/env python
import argparse
import leveldb
import os
import shutil
import sys
from Bio import SeqIO
def main(args):
parser = argparse.ArgumentParser(description="Script to extract darkmatter - predicted proteins with no similarities")
parser.add_argument("-i", "--input", help="Name of input genecall... | bsd-2-clause | Python |
a5857bc5b019dda8baca03bd68f08b4a26a85911 | add import module in init file. | biokit/biokit,biokit/biokit | biokit/rtools/__init__.py | biokit/rtools/__init__.py | from .rtools import *
| bsd-2-clause | Python | |
8599480ed93a0117f326689280c7a896d6bf697a | add version 3.1-4 to r-bayesm (#20807) | LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack | var/spack/repos/builtin/packages/r-bayesm/package.py | var/spack/repos/builtin/packages/r-bayesm/package.py | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RBayesm(RPackage):
"""Bayesian Inference for Marketing/Micro-Econometrics
Covers many... | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RBayesm(RPackage):
"""Bayesian Inference for Marketing/Micro-Econometrics"""
homepage... | lgpl-2.1 | Python |
52e0f47a3ff67bd0c8a31c6755b384dedd70ee02 | update scalasca to latest version, simplify recipe (#11999) | iulian787/spack,LLNL/spack,LLNL/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack,iulian787/spack | var/spack/repos/builtin/packages/scalasca/package.py | var/spack/repos/builtin/packages/scalasca/package.py | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Scalasca(AutotoolsPackage):
"""Scalasca is a software tool that supports the performance ... | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Scalasca(AutotoolsPackage):
"""Scalasca is a software tool that supports the performance ... | lgpl-2.1 | Python |
8ffe530025e38d06ffc567fb69e9b96874db3faa | Increase version | crateio/carrier | conveyor/__init__.py | conveyor/__init__.py | __version__ = "0.1.dev3"
| __version__ = "0.1.dev2"
| bsd-2-clause | Python |
20d5f5d5e10dcf118639b4ca538ef7537863145a | add cache 2 hours | IQSS/miniverse,IQSS/miniverse,IQSS/miniverse | dv_apps/dvobject_api/views_dataverses.py | dv_apps/dvobject_api/views_dataverses.py | import json
from collections import OrderedDict
from django.shortcuts import render
from django.http import Http404
from django.conf import settings
from django.http import JsonResponse, HttpResponse
from django.template.loader import render_to_string
from django.forms.models import model_to_dict
from django.views.de... | import json
from collections import OrderedDict
from django.shortcuts import render
from django.http import Http404
from django.conf import settings
from django.http import JsonResponse, HttpResponse
from django.template.loader import render_to_string
from django.forms.models import model_to_dict
from django.views.de... | mit | Python |
4e515f070f844569b84eeb77f7e7eda883bc861e | fix class name | houssine78/vertical-cooperative,houssine78/vertical-cooperative,houssine78/vertical-cooperative | easy_my_coop/wizard/update_share_line.py | easy_my_coop/wizard/update_share_line.py | # -*- coding: utf-8 -*-
from openerp import api, fields, models, _
from openerp.exceptions import UserError
class ShareLineUpdateInfo(models.TransientModel):
_name = "share.line.update.info"
@api.model
def _get_share_line(self):
active_id = self.env.context.get('active_id')
return self.e... | # -*- coding: utf-8 -*-
from openerp import api, fields, models, _
from openerp.exceptions import UserError
class PartnerUpdateInfo(models.TransientModel):
_name = "share.line.update.info"
@api.model
def _get_share_line(self):
active_id = self.env.context.get('active_id')
return self.env... | agpl-3.0 | Python |
38db4b0a23e2c2aaf858d0b2bd9d5ae4df819e66 | Move imports in mythicbeastsdns component (#28033) | tchellomello/home-assistant,sander76/home-assistant,rohitranjan1991/home-assistant,pschmitt/home-assistant,home-assistant/home-assistant,nkgilley/home-assistant,joopert/home-assistant,Danielhiversen/home-assistant,leppa/home-assistant,kennedyshead/home-assistant,mezz64/home-assistant,sander76/home-assistant,pschmitt/ho... | homeassistant/components/mythicbeastsdns/__init__.py | homeassistant/components/mythicbeastsdns/__init__.py | """Support for Mythic Beasts Dynamic DNS service."""
from datetime import timedelta
import logging
import mbddns
import voluptuous as vol
from homeassistant.const import (
CONF_DOMAIN,
CONF_HOST,
CONF_PASSWORD,
CONF_SCAN_INTERVAL,
)
from homeassistant.helpers.aiohttp_client import async_get_clientsess... | """Support for Mythic Beasts Dynamic DNS service."""
import logging
from datetime import timedelta
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.const import (
CONF_DOMAIN,
CONF_HOST,
CONF_PASSWORD,
CONF_SCAN_INTERVAL,
)
from homeassistant.helpers.aio... | apache-2.0 | Python |
5616573372638f2b195714cf02db8a7a02a4678f | Correct column name | RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline | luigi/tasks/rfam/pgload_go_term_mapping.py | luigi/tasks/rfam/pgload_go_term_mapping.py | # -*- coding: utf-8 -*-
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless requir... | # -*- coding: utf-8 -*-
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless requir... | apache-2.0 | Python |
1f3325519a72cb98669185149b03b11c1ec25f70 | Fix line number convention | refeed/coala-bears,refeed/coala-bears,refeed/coala-bears,refeed/coala-bears,coala/coala-bears,coala-analyzer/coala-bears,refeed/coala-bears,coala/coala-bears,refeed/coala-bears,refeed/coala-bears,coala-analyzer/coala-bears,coala/coala-bears,refeed/coala-bears,coala-analyzer/coala-bears,coala/coala-bears,coala-analyzer/... | bears/c_languages/CPPLintBear.py | bears/c_languages/CPPLintBear.py | import sys
from coalib.bearlib.abstractions.Linter import linter
from dependency_management.requirements.PipRequirement import PipRequirement
from coalib.settings.Setting import typed_list
@linter(executable='cpplint',
normalize_line_numbers=True,
use_stdout=False,
use_stderr=True,
ou... | import sys
from coalib.bearlib.abstractions.Linter import linter
from dependency_management.requirements.PipRequirement import PipRequirement
from coalib.settings.Setting import typed_list
@linter(executable='cpplint',
use_stdout=False,
use_stderr=True,
output_format='regex',
output_r... | agpl-3.0 | Python |
df7e5f56fdb2a9bc34a0fdf62b5847ee4183d32e | Update import_gist.py | cosacog/import_gist | lib/import_gist/bin/import_gist.py | lib/import_gist/bin/import_gist.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
def import_gist(url_gist):
'''
import custom functions from gist.github.com
usage: mod_name = import_gist(url_gist)
params:
url_gist: url of gist. be sure to append '/raw/' to the gist url to load script, not html
e.g. https://gist.githubuser... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
def import_gist(url_gist):
'''
import custom functions from gist.github.com
usage: mod_name = import_gist(url_gist)
params:
url_gist: url of gist. be sure to append '/raw/' to the gist url to load script, not html
e.g. https://gist.githubuser... | mit | Python |
7ef1afc579c62fa0c713d8db0bf17eb09b498a0b | Add unittest for random_integers | jnishi/chainer,jnishi/chainer,kikusu/chainer,keisuke-umezawa/chainer,wkentaro/chainer,niboshi/chainer,okuta/chainer,AlpacaDB/chainer,tkerola/chainer,niboshi/chainer,hvy/chainer,hvy/chainer,truongdq/chainer,cemoody/chainer,aonotas/chainer,sinhrks/chainer,muupan/chainer,ktnyt/chainer,cupy/cupy,kashif/chainer,chainer/chai... | tests/cupy_tests/random_tests/test_sample.py | tests/cupy_tests/random_tests/test_sample.py | import mock
import unittest
from cupy import cuda
from cupy import testing
from cupy import random
@testing.gpu
class TestRandint(unittest.TestCase):
_multiprocess_can_split_ = True
def setUp(self):
device_id = cuda.Device().id
self.m = mock.Mock()
self.m.interval.return_value = 0
... | import mock
import unittest
from cupy import cuda
from cupy import testing
from cupy import random
@testing.gpu
class TestRandint(unittest.TestCase):
_multiprocess_can_split_ = True
def setUp(self):
device_id = cuda.Device().id
self.m = mock.Mock()
self.m.interval.return_value = 0
... | mit | Python |
5aa2a3e4b724784bbedaa5a436893e5ce28f7c45 | Bump version to 0.2.3 | edoburu/fluentcms-emailtemplates,edoburu/fluentcms-emailtemplates | fluentcms_emailtemplates/__init__.py | fluentcms_emailtemplates/__init__.py | # following PEP 440
__version__ = "0.2.3"
| # following PEP 440
__version__ = "0.2.2"
| apache-2.0 | Python |
64ae848095215715ea7448c517011d64403dee85 | Remove useless import | makinacorpus/Geotrek,makinacorpus/Geotrek,makinacorpus/Geotrek,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin | geotrek/api/mobile/views/trekking.py | geotrek/api/mobile/views/trekking.py | from __future__ import unicode_literals
from django.conf import settings
from django.db.models import F
from geotrek.api.mobile.serializers import trekking as api_serializers
from geotrek.api.mobile import viewsets as api_viewsets
from geotrek.api.v2.functions import Transform, Length, StartPoint
from geotrek.trekkin... | from __future__ import unicode_literals
from django.conf import settings
from django.db.models import F
from rest_framework_extensions.mixins import DetailSerializerMixin
from geotrek.api.mobile.serializers import trekking as api_serializers
from geotrek.api.mobile import viewsets as api_viewsets
from geotrek.api.v2... | bsd-2-clause | Python |
6105e355cf0275e00f284ac6658454905a9b9a07 | change import of tfpark | intel-analytics/BigDL,intel-analytics/BigDL,yangw1234/BigDL,intel-analytics/BigDL,yangw1234/BigDL,yangw1234/BigDL,yangw1234/BigDL,intel-analytics/BigDL | python/chronos/src/bigdl/chronos/forecaster/tfpark_forecaster.py | python/chronos/src/bigdl/chronos/forecaster/tfpark_forecaster.py | #
# Copyright 2018 Analytics Zoo Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | #
# Copyright 2018 Analytics Zoo Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | apache-2.0 | Python |
60ecc08395eb266f09aa8587bf38aceb59a2b968 | Update Scramble_String.py | UmassJin/Leetcode | Array/Scramble_String.py | Array/Scramble_String.py | """
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.
Below is one possible representation of s1 = "great":
great
/ \
gr eat
/ \ / \
g r e at
/ \
a t
To scramble the string, we may choose any non-leaf nod... | Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.
Below is one possible representation of s1 = "great":
great
/ \
gr eat
/ \ / \
g r e at
/ \
a t
To scramble the string, we may choose any non-leaf node an... | mit | Python |
37e8452ad999f42746be395d193a306f9a893dbf | Update rpc.py | vnitinv/ncclient,joysboy/ncclient,earies/ncclient,einarnn/ncclient,katharh/ncclient,sebastianw/ncclient,cmoberg/ncclient,nwautomator/ncclient,leopoul/ncclient,OpenClovis/ncclient,kroustou/ncclient,nnakamot/ncclient,GIC-de/ncclient,lightlu/ncclient,ncclient/ncclient,aitorhh/ncclient | ncclient/operations/third_party/juniper/rpc.py | ncclient/operations/third_party/juniper/rpc.py | from ncclient.xml_ import *
from ncclient.operations.rpc import RPC
from ncclient.operations.rpc import RPCReply
from ncclient.operations.rpc import RPCError
class GetConfiguration(RPC):
def request(self, format='xml', filter=None):
node = new_ele('get-configuration', {'format':format})
if filter ... | from ncclient.xml_ import *
from ncclient.operations.rpc import RPC
from ncclient.operations.rpc import RPCReply
from ncclient.operations.rpc import RPCError
class GetConfiguration(RPC):
def request(self, format='xml', filter=None):
node = new_ele('get-configuration', {'format':format})
if filter ... | apache-2.0 | Python |
3c33b9d7ea3736329d3e0939b042db08e6365eb5 | Move experiments to ``experiments`` module | jcpeterson/Dallinger,jcpeterson/Dallinger,Dallinger/Dallinger,Dallinger/Dallinger,Dallinger/Dallinger,jcpeterson/Dallinger,Dallinger/Dallinger,jcpeterson/Dallinger,Dallinger/Dallinger,jcpeterson/Dallinger | dallinger/version.py | dallinger/version.py | """Dallinger version number."""
__version__ = "2.7.0"
| """Dallinger version number."""
__version__ = "3.0.0a1"
| mit | Python |
0516ca2a5bfaa162a44f407c13b55ca9487897fe | refresh group/keywords every hour | mctenthij/hortiradar,mctenthij/hortiradar,mctenthij/hortiradar,mctenthij/hortiradar,mctenthij/hortiradar | hortiradar/database/tasks_workers.py | hortiradar/database/tasks_workers.py | from configparser import ConfigParser
from time import time
from redis import StrictRedis
import ujson as json
from keywords import get_frog, get_keywords
from selderij import app
from tasks_master import insert_tweet
keywords = get_keywords()
keywords_sync_time = time()
config = ConfigParser()
config.read("tasks_... | from configparser import ConfigParser
from redis import StrictRedis
import ujson as json
from keywords import get_frog, get_keywords
from selderij import app
from tasks_master import insert_tweet
keywords = get_keywords()
config = ConfigParser()
config.read("tasks_workers.ini")
posprob_minimum = config["workers"].... | apache-2.0 | Python |
993d08b0ca0bcf90af77709e58698b7ecc5ba6b5 | Update log.py | tomturner/django-tenants,tomturner/django-tenants,tomturner/django-tenants | django_tenants/log.py | django_tenants/log.py | import logging
from django.db import connection
class TenantContextFilter(logging.Filter):
"""
Add the current ``schema_name`` and ``domain_url`` to log records.
Thanks to @regolith for the snippet on https://github.com/bernardopires/django-tenant-schemas/issues/248
"""
def filter(self, record):
... | import logging
from django.db import connection
class TenantContextFilter(logging.Filter):
"""
Add the current ``schema_name`` and ``domain_url`` to log records.
Thanks to @regolith for the snippet on https://github.com/bernardopires/django-tenant-schemas/issues/248
"""
def filter(self, record):
... | mit | Python |
2756326b134acc6c343be8458870121baed963cb | fix db url | cekk/pergamena,cekk/pergamena,cekk/pergamena | pergamena/settings.py | pergamena/settings.py | # -*- coding: utf-8 -*-
import os
os_env = os.environ
class Config(object):
SECRET_KEY = os_env.get('PERGAMENA_SECRET', 'secret-key') # TODO: Change me
APP_DIR = os.path.abspath(os.path.dirname(__file__)) # This directory
PROJECT_ROOT = os.path.abspath(os.path.join(APP_DIR, os.pardir))
BCRYPT_LOG_RO... | # -*- coding: utf-8 -*-
import os
os_env = os.environ
class Config(object):
SECRET_KEY = os_env.get('PERGAMENA_SECRET', 'secret-key') # TODO: Change me
APP_DIR = os.path.abspath(os.path.dirname(__file__)) # This directory
PROJECT_ROOT = os.path.abspath(os.path.join(APP_DIR, os.pardir))
BCRYPT_LOG_RO... | bsd-3-clause | Python |
b7c531220fe7a46ad56eeeb160effe94510ba4b0 | Use handler registration in listener | beezz/pg_bawler,beezz/pg_bawler | pg_bawler/listener.py | pg_bawler/listener.py | #!/usr/bin/env python
'''
Listen on given channel for notification.
$ python -m pg_bawler.listener mychannel
If you installed notification trigger with ``pg_bawler.gen_sql`` then
channel is the same as ``tablename`` argument.
'''
import argparse
import asyncio
import importlib
import logging
import sys
import pg... | #!/usr/bin/env python
'''
Listen on given channel for notification.
$ python -m pg_bawler.listener mychannel
If you installed notification trigger with ``pg_bawler.gen_sql`` then
channel is the same as ``tablename`` argument.
'''
import argparse
import asyncio
import importlib
import logging
import sys
import pg... | bsd-3-clause | Python |
5ff6dffeaf757e360a42e22a9df6d74345a4f418 | Fix panda part imports | dls-controls/pymalcolm,dls-controls/pymalcolm,dls-controls/pymalcolm | malcolm/parts/pandabox/__init__.py | malcolm/parts/pandabox/__init__.py | # Find all subpackages, MethodMeta decorated callables, and YAML files
from malcolm.packageutil import prepare_package
__all__ = prepare_package(globals(), __name__)
del prepare_package
| # Don't import all the parts as they need to be created from
# includes.pandabox.hardware_collection()
from malcolm.parts.pandabox.pandaboxdriverpart import PandABoxDriverPart
| apache-2.0 | Python |
d2fdf0d91f41350347ba460e33cc04aa1e59eb96 | Call the run script from the analysis driver | mdpiper/dakota-swash-parameter-study,mdpiper/dakota-swash-parameter-study | analysis_driver.py | analysis_driver.py | #! /usr/bin/env python
# Brokers communication between Dakota and SWASH through files.
#
# Arguments:
# $1 is 'params.in' from Dakota
# $2 is 'results.out' returned to Dakota
import sys
import os
import re
import shutil
from subprocess import call
import numpy as np
def read(output_file, variable=None):
"""R... | #! /usr/bin/env python
# Brokers communication between Dakota and SWASH through files.
#
# Arguments:
# $1 is 'params.in' from Dakota
# $2 is 'results.out' returned to Dakota
import sys
import os
import re
import shutil
from subprocess import call
import numpy as np
def read(output_file, variable=None):
"""R... | mit | Python |
9e95522c847b12a19cff54737a44f569fe2cf6b7 | Add method for getting Candidacy.party_name | opencivicdata/python-opencivicdata-django,opencivicdata/python-opencivicdata,opencivicdata/python-opencivicdata,opencivicdata/python-opencivicdata-django,opencivicdata/python-opencivicdata-django | opencivicdata/elections/admin/candidacy.py | opencivicdata/elections/admin/candidacy.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Custom administration panels for Candidacy-related models.
"""
from django import VERSION as django_version
from django.contrib import admin
from opencivicdata.core.admin import base
from .. import models
class CandidacySourceInline(base.LinkInline):
"""
Custo... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Custom administration panels for Candidacy-related models.
"""
from django import VERSION as django_version
from django.contrib import admin
from opencivicdata.core.admin import base
from .. import models
class CandidacySourceInline(base.LinkInline):
"""
Custo... | bsd-3-clause | Python |
ce266cec800fd921f9b4de82fd9f9666ed2df053 | Fix another shit | BrodaNoel/bropy,BrodaNoel/bropy | modules/gy-271/core/get.py | modules/gy-271/core/get.py | # Distributed with a free-will license.
# Use it any way you want, profit or free, provided it fits in the licenses of its associated works.
# HMC5883
# This code is designed to work with the HMC5883_I2CS I2C Mini Module available from ControlEverything.com.
# https://www.controleverything.com/content/Compass?sku=HMC58... | # Distributed with a free-will license.
# Use it any way you want, profit or free, provided it fits in the licenses of its associated works.
# HMC5883
# This code is designed to work with the HMC5883_I2CS I2C Mini Module available from ControlEverything.com.
# https://www.controleverything.com/content/Compass?sku=HMC58... | mit | Python |
4fccaeefd67c3c736861870a8fe711a934c96e6d | Add some documentation | b-mueller/mythril,b-mueller/mythril,b-mueller/mythril,b-mueller/mythril | mythril/laser/ethereum/transaction.py | mythril/laser/ethereum/transaction.py | import logging
from mythril.laser.ethereum.state import GlobalState, Environment, CalldataType
from mythril.laser.ethereum.cfg import Node, Edge, JumpType
from z3 import BitVec
class CallTransaction:
""" Represents a call value transaction """
def __init__(self, callee_address):
"""
Constructo... | import logging
from mythril.laser.ethereum.state import GlobalState, Environment, CalldataType
from mythril.laser.ethereum.cfg import Node, Edge, JumpType
from z3 import BitVec
class CallTransaction:
def __init__(self, callee_address):
self.callee_address = callee_address
self.caller = BitVec("cal... | mit | Python |
9f3bf2756debb4534ddcbf538577044e2bae6528 | remove unused import | yohanboniface/memopol-core,yohanboniface/memopol-core,yohanboniface/memopol-core | memopol2/search.py | memopol2/search.py | # -*- coding: utf-8 -*-
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
import logging
from django.db.models import signals
from django.conf import settings
from whoosh import fields
from whoosh.filedb.filestore import FileStorage
log = logging.getLogger(__name__)
WHOOSH_SCHEMA = fields.Schema(title=field... | # -*- coding: utf-8 -*-
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
import logging
from django.db.models import signals
from django.conf import settings
from whoosh import fields, index
from whoosh.filedb.filestore import FileStorage
log = logging.getLogger(__name__)
WHOOSH_SCHEMA = fields.Schema(titl... | agpl-3.0 | Python |
bac0b5e09fc172a991fb6b7172025c698c1a23d9 | Add validation that type is type of Rule into MultipleRulesGrammar | PatrikValkovic/grammpy | grammpy/Grammars/MultipleRulesGrammar.py | grammpy/Grammars/MultipleRulesGrammar.py | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 15.08.2017 14:40
:Licence GNUv3
Part of grammpy
"""
import inspect
from grammpy.exceptions import NotRuleException
from .StringGrammar import StringGrammar
from ..HashContainer import HashContainer
from ..IsMethodsRuleExtension import IsMethodsRuleExtension a... | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 15.08.2017 14:40
:Licence GNUv3
Part of grammpy
"""
from .StringGrammar import StringGrammar
from ..HashContainer import HashContainer
from ..IsMethodsRuleExtension import IsMethodsRuleExtension as Rule
class MultipleRulesGrammar(StringGrammar):
def __i... | mit | Python |
6d8b1ea0e459bd3383528fb32e6b1a348b00a9bc | Remove unknown attributes. | kxepal/phoxpy | phoxpy/server/auth.py | phoxpy/server/auth.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
from random import randint
from phoxpy import exceptions
from phoxpy.messages import PhoxRequest, PhoxR... | # -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
from random import randint
from phoxpy import exceptions
from phoxpy.messages import PhoxRequest, PhoxR... | bsd-3-clause | Python |
e2cbc0a3acf793ca8c45eb17cb0071a254a7e2b7 | Update parse_indepexpends.py | SpencerNorris/SuperPACs,SpencerNorris/SuperPACs,SpencerNorris/SuperPACs,SpencerNorris/SuperPACs | server/src/datasource/parse_indepexpends.py | server/src/datasource/parse_indepexpends.py | from datasource import fec
from datasource import propublica
import os
FEC_APIKEY = os.getenv('FEC_API_KEY', '')
ProPublica_APIKEY = os.getenv('PP_API_KEY', '')
FecApiObj = fec.FECAPI(FEC_APIKEY)
committees = FecApiObj.get_committees()
PPCampFinObj = propublica.CampaignFinanceAPI(ProPublica_APIKEY)
PPCong... | from datasource import fec
from datasource import propublica
import os
FEC_APIKEY = os.getenv('FEC_API_KEY', '')
ProPublica_APIKEY = os.getenv('PP_API_KEY', '')
FecApiObj = fec.FECAPI(FEC_APIKEY)
committees = FecApiObj.get_committees()
PPCampFinObj = propublica.CampaignFinanceAPI(ProPublica_APIKEY)
datafi... | apache-2.0 | Python |
e751329b8aacdf51b70537be47172386deaded63 | Fix alembic env | rootio/rootio_web,rootio/rootio_web,rootio/rootio_web,rootio/rootio_web | alembic/env.py | alembic/env.py | from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config file for Python... | from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config file for Python... | agpl-3.0 | Python |
b76e91c4517e52528f8543fce276ff4b5af9a4f6 | fix temp file creation to something more multiplatform friendly | pablodav/burp_server_reports,pablodav/burp_server_reports | burp_reports/lib/files.py | burp_reports/lib/files.py | import tempfile
import os
def temp_file(file='temporal'):
"""
return: str with tempfilename
"""
# Append uid to end of filename
file += '_{}'.format(os.getlogin())
# Simplified and reutilized core funtionally from python
cache_path = os.path.join(tempfile.gettempdir(), file)
return ca... | import tempfile
import os
def temp_file(file='temporal'):
"""
return: str with tempfilename
"""
# Append uid to end of filename
file += '_{}'.format(os.getuid())
# Simplified and reutilized core funtionally from python
cache_path = os.path.join(tempfile.gettempdir(), file)
return cach... | mit | Python |
632b86289ef643381c954adeca1f58c78e2aa8d5 | Add documentation for plugins | danielmorosan/Cactus,ibarria0/Cactus,fjxhkj/Cactus,gone/Cactus,chaudum/Cactus,dreadatour/Cactus,Knownly/Cactus,ibarria0/Cactus,danielmorosan/Cactus,Bluetide/Cactus,dreadatour/Cactus,juvham/Cactus,dreadatour/Cactus,ibarria0/Cactus,PegasusWang/Cactus,koobs/Cactus,koenbok/Cactus,koobs/Cactus,Bluetide/Cactus,eudicots/Cactu... | cactus/plugin/defaults.py | cactus/plugin/defaults.py | #coding:utf-8
# Define no-op plugin methods
def preBuildPage(page, context, data):
"""
Called prior to building a page.
:param page: The page about to be built
:param context: The context for this page (you can modify this, but you must return it)
:param data: The raw body for this page (you can m... | #coding:utf-8
# Define no-op plugin methods
def preBuildPage(page, context, data):
return context, data
def postBuildPage(page):
pass
def preBuildStatic(static):
pass
def postBuildStatic(static):
pass
def preBuild(site):
pass
def postBuild(site):
pass
def preDeploy(site):
pass
... | bsd-3-clause | Python |
04fd80cda56a911289bca20c7ee1bd70ac263bd4 | set readonly from true to false because the cursor is hidded if readonly is true. | ya790206/call_seq | call_seq/TextEdit/rich.py | call_seq/TextEdit/rich.py | from PySide import QtCore
import pyqode.python
# public API
from pyqode.python.bootstrapper import Bootstrapper
from pyqode.python.modes import PyAutoCompleteMode
from pyqode.python.modes import CalltipsMode
from pyqode.python.modes import CommentsMode
from pyqode.python.modes import PyCodeCompletionMode, JediComplet... | from PySide import QtCore
import pyqode.python
# public API
from pyqode.python.bootstrapper import Bootstrapper
from pyqode.python.modes import PyAutoCompleteMode
from pyqode.python.modes import CalltipsMode
from pyqode.python.modes import CommentsMode
from pyqode.python.modes import PyCodeCompletionMode, JediComplet... | apache-2.0 | Python |
29aed8ce12734ac0489a8b4e4aa9b48ff4a320a7 | fix fail | shish/firehose | client/cli.py | client/cli.py | #!/usr/bin/env python
import base64
import sys
import logging
import firehose.common as common
class CLI(common.FirehoseClient):
def __select(self, chums, prompt):
print prompt
for n, chum in enumerate(chums):
print "%02d> %s (%s)" % (n, chum.name, chum.keyid)
inp = raw_input... | #!/usr/bin/env python
import base64
import sys
import logging
import firehose.common as common
class CLI(common.FirehoseClient):
def __select(self, chums, prompt):
print prompt
for n, chum in enumerate(chums):
print "%02d> %s (%s)" % (n, chum.name, chum.keyid)
inp = raw_input... | mit | Python |
3157bbd5cca51ea2ac0c086a9337296c6652fafc | fix url order | sunlightlabs/django-citizendialer3000 | citizendialer3000/urls.py | citizendialer3000/urls.py | from django.conf.urls.defaults import *
urlpatterns = patterns('citizendialer3000.views',
url(r'^$', 'callcampaign_list', name='call_list'),
url(r'^(?P<slug>[\w\-]+)/$', 'callcampaign_detail', name='call_campaign'),
url(r'^(?P<slug>[\w\-]+)/thankyou/$', 'complete', name='call_complete'),
url(r'^(?P<slu... | from django.conf.urls.defaults import *
urlpatterns = patterns('citizendialer3000.views',
url(r'^$', 'callcampaign_list', name='call_list'),
url(r'^(?P<slug>[\w\-]+)/$', 'callcampaign_detail', name='call_campaign'),
url(r'^(?P<slug>[\w\-]+)/(?P<bioguide_id>\w+)/$', 'contact_detail', name='call_contact'),
... | bsd-3-clause | Python |
302934bfd8b30ee1b33cdfb60ca36021df153746 | improve cleanup process of test by removing the downloaded file | oyamad/QuantEcon.py,oyamad/QuantEcon.py,QuantEcon/QuantEcon.py,QuantEcon/QuantEcon.py | quantecon/util/tests/test_notebooks.py | quantecon/util/tests/test_notebooks.py | """
Tests for Notebook Utilities
Functions
---------
fetch_nb_dependencies
"""
from quantecon.util import fetch_nb_dependencies
import unittest
import os
FILES = ['README.md']
REPO = "https://github.com/QuantEcon/QuantEcon.py"
RAW = "raw"
BRANCH = "master"
class TestNotebookUtils(unittest.TestCase):
def test_... | """
Tests for Notebook Utilities
Functions
---------
fetch_nb_dependencies
"""
from quantecon.util import fetch_nb_dependencies
import unittest
FILES = ['README.md']
REPO = "https://github.com/QuantEcon/QuantEcon.py"
RAW = "raw"
BRANCH = "master"
class TestNotebookUtils(unittest.TestCase):
def test_fetch_nb_d... | bsd-3-clause | Python |
02b7d5416ad55b78e256e58ed6a282681d1df48d | Add required get_model for Haystack 2.0 | michaelmcandrew/readthedocs.org,Carreau/readthedocs.org,jerel/readthedocs.org,techtonik/readthedocs.org,wijerasa/readthedocs.org,sunnyzwh/readthedocs.org,rtfd/readthedocs.org,asampat3090/readthedocs.org,Carreau/readthedocs.org,nikolas/readthedocs.org,ojii/readthedocs.org,sunnyzwh/readthedocs.org,safwanrahman/readthedoc... | readthedocs/projects/search_indexes.py | readthedocs/projects/search_indexes.py | # -*- coding: utf-8-*-
import codecs
import os
from django.utils.html import strip_tags
#from haystack import site
from haystack import indexes
from haystack.fields import CharField
#from celery_haystack.indexes import SearchIndex
from projects.models import File, ImportedFile, Project
import logging
log = logging... | # -*- coding: utf-8-*-
import codecs
import os
from django.utils.html import strip_tags
#from haystack import site
from haystack import indexes
from haystack.fields import CharField
#from celery_haystack.indexes import SearchIndex
from projects.models import File, ImportedFile, Project
import logging
log = logging... | mit | Python |
96877f2cb706a465c5e7fb4d316dbd82ff2cb432 | add comment | numerodix/purelyjs,numerodix/purelyjs | purelyjs/interpreter.py | purelyjs/interpreter.py | from .io import invoke
class Interpreter(object):
known_engines = ['js', 'rhino']
def __init__(self, exes=None):
engines = exes if exes else self.known_engines
self.exe = self.detect(engines)
if not self.exe:
raise ValueError("No js engine could be found, tried: %s"
... | from .io import invoke
class Interpreter(object):
known_engines = ['js', 'rhino']
def __init__(self, exes=None):
engines = exes if exes else self.known_engines
self.exe = self.detect(engines)
if not self.exe:
raise ValueError("No js engine could be found, tried: %s"
... | mit | Python |
5aa90e98abcfafa9036f8cc19cd49b33aa638181 | update dev version after 0.26.0 tag [skip ci] | desihub/desispec,desihub/desispec | py/desispec/_version.py | py/desispec/_version.py | __version__ = '0.26.0.dev3104'
| __version__ = '0.26.0'
| bsd-3-clause | Python |
b59b0e12a0f5fc83d69d9eaa1f7652e8e1b4ac81 | Improve tuple and list converters | dean0x7d/pybinding,MAndelkovic/pybinding,MAndelkovic/pybinding,dean0x7d/pybinding,dean0x7d/pybinding,MAndelkovic/pybinding | pybinding/utils/misc.py | pybinding/utils/misc.py | from functools import wraps
import numpy as np
def to_tuple(o):
try:
return tuple(o)
except TypeError:
return (o,) if o is not None else ()
def to_list(o):
try:
return list(o)
except TypeError:
return [o] if o is not None else []
def with_defaults(options: dict, de... | from functools import wraps
import numpy as np
def to_tuple(o):
if isinstance(o, (tuple, list)):
return tuple(o)
else:
return o,
def with_defaults(options: dict, defaults_dict: dict=None, **defaults_kwargs):
"""Return a dict where missing keys are filled in by defaults
>>> options ... | bsd-2-clause | Python |
ee5a85df1d2db8babd8d6df6a188137051c3a48e | Change the improvement policies due to reorganizing reggie. | mwhoffman/pybo | pybo/policies/simple.py | pybo/policies/simple.py | """
Acquisition functions based on the probability or expected value of
improvement.
"""
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
import numpy as np
__all__ = ['EI', 'PI', 'UCB', 'Thompson']
def EI(model, _, xi=0.0):
"""
Expected improveme... | """
Acquisition functions based on the probability or expected value of
improvement.
"""
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
import numpy as np
__all__ = ['EI', 'PI', 'UCB', 'Thompson']
def EI(model, _, xi=0.0):
"""
Expected improveme... | bsd-2-clause | Python |
1a8d7797e691bd5959fc8f7cdc0371e39208aee7 | Update version # | obsidianforensics/hindsight,obsidianforensics/hindsight | pyhindsight/__init__.py | pyhindsight/__init__.py | __author__ = "Ryan Benson"
__version__ = "2.1.0"
__email__ = "ryan@obsidianforensics.com"
| __author__ = "Ryan Benson"
__version__ = "2.0.5"
__email__ = "ryan@obsidianforensics.com"
| apache-2.0 | Python |
c8b89d104d5676c006b39825fcdb4a1e80f6515a | Update wingding | henry232323/Pesterchum-Discord,henry232323/Pesterchum-Discord | pyquirks/quirk_funcs.py | pyquirks/quirk_funcs.py | from random import sample
_wdalpha = {
"!": 9999, "\"": 9986, "#": 9985, "$": 128083, "%": 128365,
"&": 128366, "'": 128367, "(": 9742, ")": 9990, "*": 128386,
"+": 128387, ",": 128234, "-": 128235, ".": 128236, "/": 128237,
"0": 128193, "1": 128194, "2": 128196, "3": 128463, "4": 12846... | from random import sample
_wdalpha = {
"!": 9999, "\"": 9986, "#": 9985, "$": 128083, "%": 128365,
"&": 128366, "'": 128367, "(": 9742, ")": 9990, "*": 128386,
"+": 128387, ",": 128234, "-": 128235, ".": 128236, "/": 128237,
"0": 128193, "1": 128194, "2": 128196, "3": 128463, "4": 12846... | mit | Python |
ea6f60838ae309e5fb0662b2416d3c4450be7823 | correct straight function | fluz/udacity | design_of_computer_programs_cs212/lesson01/poker_game.py | design_of_computer_programs_cs212/lesson01/poker_game.py |
def poker(hands):
"""Return the best hand: poker([hand,...]) => hand"""
return max(hands, key=hand_rank)
def hand_rank(hand):
"""define a rank for a specific hand"""
ranks = card_ranks(hand)
if straight(ranks) and flush(hand): # straight flush
return (8, max(ranks))
elif k... |
def poker(hands):
"""Return the best hand: poker([hand,...]) => hand"""
return max(hands, key=hand_rank)
def hand_rank(hand):
"""define a rank for a specific hand"""
ranks = card_ranks(hand)
if straight(ranks) and flush(hand): # straight flush
return (8, max(ranks))
elif k... | mit | Python |
56c3c373563a38991da72bc235d4e3e40e711968 | Use extra space. | fossilet/leetcode,deput/leetcode,fossilet/leetcode,deput/leetcode | remove_duplicates_from_sorted_array.py | remove_duplicates_from_sorted_array.py | #! /usr/bin/env python3
"""
http://oj.leetcode.com/problems/remove-duplicates-from-sorted-array/
Given a sorted array, remove the duplicates in place such that each element
appear only once and return the new length.
Do not allocate extra space for another array, you must do this in place with
constant memory.
For ... | #! /usr/bin/env python3
"""
http://oj.leetcode.com/problems/remove-duplicates-from-sorted-array/
Given a sorted array, remove the duplicates in place such that each element
appear only once and return the new length.
Do not allocate extra space for another array, you must do this in place with
constant memory.
For ... | mit | Python |
c1cbdf20e6c109ff1586f663cab7e24f1716af08 | Make remove-if-exists function public | ascoderu/opwen-cloudserver,ascoderu/opwen-cloudserver | opwen_email_server/utils/temporary.py | opwen_email_server/utils/temporary.py | from contextlib import contextmanager
from contextlib import suppress
from os import close
from os import remove
from tempfile import mkstemp
from typing import Generator
def create_tempfilename() -> str:
file_descriptor, filename = mkstemp()
close(file_descriptor)
return filename
@contextmanager
def re... | from contextlib import contextmanager
from contextlib import suppress
from os import close
from os import remove
from tempfile import mkstemp
from typing import Generator
def create_tempfilename() -> str:
file_descriptor, filename = mkstemp()
close(file_descriptor)
return filename
@contextmanager
def re... | apache-2.0 | Python |
94763abaf573bfd25cad06da0cffc6b94a7dedc8 | Fix a flaw in the old implementation of checking whether the state has changed. | boronine/discipline,boronine/discipline | pervert/management/commands/pervert_migrate.py | pervert/management/commands/pervert_migrate.py | import json
from django.core.management.base import BaseCommand, CommandError
from pervert.models import AbstractPervert, SchemaState, PervertError
class Command(BaseCommand):
help = "Registers new schema for Pervert-controlled models"
def handle(self, *args, **options):
states = []
print "Rea... | import json
from django.core.management.base import BaseCommand, CommandError
from pervert.models import AbstractPervert, SchemaState, PervertError
class Command(BaseCommand):
help = "Registers new schema for Pervert-controlled models"
def handle(self, *args, **options):
states = []
print "Rea... | mit | Python |
24c83211588ac71492640ce43e3a893e05466a54 | Change old membership migration to null | pbanaszkiewicz/amy,pbanaszkiewicz/amy,pbanaszkiewicz/amy | amy/workshops/migrations/0065_multiple_memberships.py | amy/workshops/migrations/0065_multiple_memberships.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('workshops', '0064_membership'),
]
operations = [
migrations.RemoveField(
model_... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('workshops', '0064_membership'),
]
operations = [
migrations.RemoveField(
model_... | mit | Python |
9bc8b9967631064821112b5c7ff3b65fb0b176f6 | Fix wrong column name in db migration script of ryu plugin | klmitch/neutron,leeseulstack/openstack,sasukeh/neutron,asgard-lab/neutron,oeeagle/quantum,asgard-lab/neutron,apporc/neutron,mahak/neutron,dhanunjaya/neutron,silenci/neutron,takeshineshiro/neutron,NeCTAR-RC/neutron,miyakz1192/neutron,klmitch/neutron,jumpojoy/neutron,wenhuizhang/neutron,igor-toga/local-snat,leeseuljeong/... | neutron/db/migration/alembic_migrations/versions/5a875d0e5c_ryu.py | neutron/db/migration/alembic_migrations/versions/5a875d0e5c_ryu.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 New Dream Network, LLC (DreamHost)
#
# 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/li... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 New Dream Network, LLC (DreamHost)
#
# 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/li... | apache-2.0 | Python |
06f7f0b5d45a4349ee688aaac86b57c74ad0f76c | FIX geocoder model | eicher31/compassion-switzerland,eicher31/compassion-switzerland,ecino/compassion-switzerland,CompassionCH/compassion-switzerland,CompassionCH/compassion-switzerland,ecino/compassion-switzerland,eicher31/compassion-switzerland,ecino/compassion-switzerland,CompassionCH/compassion-switzerland | partner_compassion/models/base_geocoder.py | partner_compassion/models/base_geocoder.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2019 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __manifest__.py... | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2019 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __manifest__.py... | agpl-3.0 | Python |
397f33adb5cafaeda3de624dc9dd1bb24d0b65e5 | remove dup line | christabor/MoAL,christabor/MoAL,christabor/MoAL,christabor/MoAL,christabor/MoAL | MOAL/maths/applied/optimization/strength_reduction.py | MOAL/maths/applied/optimization/strength_reduction.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = """Chris Tabor (dxdstudio@gmail.com)"""
if __name__ == '__main__':
from os import getcwd
from os import sys
sys.path.append(getcwd())
from MOAL.helpers.display import Section
from MOAL.helpers.trials import test_speed
DEBUG = True if __name__ ==... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = """Chris Tabor (dxdstudio@gmail.com)"""
__author__ = """Chris Tabor (dxdstudio@gmail.com)"""
if __name__ == '__main__':
from os import getcwd
from os import sys
sys.path.append(getcwd())
from MOAL.helpers.display import Section
from MOAL.helper... | apache-2.0 | Python |
3f2f069e1c22ee88afb67ef68164046222a009e3 | Create a error class for the API client | att-comdev/drydock,att-comdev/drydock | drydock_provisioner/error.py | drydock_provisioner/error.py | # Copyright 2017 AT&T Intellectual Property. All other 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... | # Copyright 2017 AT&T Intellectual Property. All other 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... | apache-2.0 | Python |
46cd16ff56ff93b2ee8a38363b37c3287c9cb1cc | Update sal checkin module. | salopensource/sal-scripts,salopensource/sal-scripts,salopensource/sal-scripts | payload/usr/local/sal/checkin_modules/sal_checkin.py | payload/usr/local/sal/checkin_modules/sal_checkin.py | #!/usr/local/sal/Python.framework/Versions/3.8/bin/python3
import sal
__version__ = '1.1.0'
def main():
_, _, bu_key = sal.get_server_prefs()
sal_submission = {
'extra_data': {
'sal_version': sal.__version__,
'key': bu_key,},
'facts': {'checkin_module_version': __ve... | #!/usr/local/sal/Python.framework/Versions/3.8/bin/python3
import sys
import sal
__version__ = '1.0.0'
def main():
_, _, bu_key = sal.get_server_prefs()
sal_submission = {
'extra_data': {
'sal_version': sal.__version__,
'key': bu_key,},
'facts': {'checkin_module_ve... | apache-2.0 | Python |
55132ff6740b3c70ddb75dcf7c3615aaea0680ac | Fix typo | zujko/manage-vm,zujko/manage-vm,zujko/manage-vm | main/models.py | main/models.py | from django.db import models
from django.contrib.auth.models import User
class VM(models.Model):
user = models.ForeignKey(User, related_name='user', null=False)
vmid = models.PositiveIntegerField()
template = models.CharField(max_length=100)
hostname = models.CharField(max_length=30)
storage = models.CharFie... | from django.db import models
from django.contrib.auth.models import User
class VM(models.Model):
user = models.ForeignKey(User, related_name='user', null=False)
vmid = models.PositiveIntegerField()
template = models.CharField(max_length=100)
hostname = models.CharField(max_length=30)
storage = models.CharFie... | mit | Python |
b6f54a008cfe1c0a6db06d4f9c23d4699c2ab901 | Update harmonizer.py | Phantasus/intelmq,aaronkaplan/intelmq-old,s4n7h0/intelmq,aaronkaplan/intelmq-old,aaronkaplan/intelmq-old | intelmq/bots/inputs/openbl/harmonizer.py | intelmq/bots/inputs/openbl/harmonizer.py | from intelmq.lib.bot import Bot, sys
class OpenBLHarmonizerBot(Bot):
def process(self):
event = self.receive_message()
if event:
event.add('feed', 'openbl')
event.add('feed_url', 'http://www.openbl.org/lists/date_all.txt')
ip_value = event.value('reported_ip')
... | from intelmq.lib.bot import Bot, sys
class OpenBLHarmonizerBot(Bot):
def process(self):
event = self.receive_message()
if event:
event.add('feed', 'openbl')
event.add('feed_url', 'http://www.openbl.org/lists/date_all.txt')
ip_value = event.value('reported_ip')
... | agpl-3.0 | Python |
93904a11a78d5c58d2baaaa71cb962195becae6e | Change test. | avanzosc/event-wip | event_track_info/tests/test_track_info.py | event_track_info/tests/test_track_info.py | # -*- coding: utf-8 -*-
# © 2016 Oihane Crucelaegui - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp.addons.sale_order_create_event.tests.\
test_sale_order_create_event import TestSaleOrderCreateEvent
class TestTrackInfo(TestSaleOrderCreateEvent):
def setUp(self):
... | # -*- coding: utf-8 -*-
# © 2016 Oihane Crucelaegui - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp.addons.sale_order_create_event.tests.\
test_sale_order_create_event_by_task import TestSaleOrderCreateEvent
class TestTrackInfo(TestSaleOrderCreateEvent):
def setUp(se... | agpl-3.0 | Python |
d32f6dcfcc7bbf8f4d9a8d84673635b1345450f6 | Simplify library includes | vigetlabs/dnsimple | dnsimple/__init__.py | dnsimple/__init__.py | from dnsimple.client import Client
| mit | Python | |
9f790ebf51c7e05e09a39bd18f2597410ea0287d | bump version to 0.6.2 | ivelum/djangoql,artinnok/djangoql,ivelum/djangoql,artinnok/djangoql,ivelum/djangoql,artinnok/djangoql | djangoql/__init__.py | djangoql/__init__.py | __version__ = '0.6.2'
| __version__ = '0.6.1'
| mit | Python |
842e1bac8edaf6f28772067eaffd83351d28332a | add unicode | LeoHeo/fastube,LeoHeo/fastube,LeoHeo/fastube,LeoHeo/fastube | fastube/fastube/settings/partials/auth.py | fastube/fastube/settings/partials/auth.py | # -*- coding: utf-8 -*-
import os
# Password validation
# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.passw... | #-*- coding: utf-8 -*-
import os
# Password validation
# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.passwo... | mit | Python |
61731632b04ca1d9a719b6b4b62fa0a97926e3a9 | clean up unused imports | mnubo/kubernetes-py,mnubo/kubernetes-py,sebastienc/kubernetes-py,froch/kubernetes-py,froch/kubernetes-py,sebastienc/kubernetes-py | kubernetes/K8sHorizontalPodAutoscaler.py | kubernetes/K8sHorizontalPodAutoscaler.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is subject to the terms and conditions defined in
# file 'LICENSE.md', which is part of this source code package.
#
from kubernetes.K8sObject import K8sObject
from kubernetes.models.v1.HorizontalPodAutoscaler import HorizontalPodAutoscaler
class K8sHorizon... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is subject to the terms and conditions defined in
# file 'LICENSE.md', which is part of this source code package.
#
from kubernetes.K8sObject import K8sObject
from kubernetes.K8sDeployment import K8sDeployment
from kubernetes.K8sReplicationController import ... | apache-2.0 | Python |
b6947fa1850c888cd5b3190b2abf315409f01cdc | Add an explicit logfile rollover at the beginning of each Tulsi bazel build. | pinterest/tulsi,bazelbuild/tulsi,pinterest/tulsi,bazelbuild/tulsi,bazelbuild/tulsi,pinterest/tulsi,bazelbuild/tulsi,pinterest/tulsi,bazelbuild/tulsi,pinterest/tulsi,bazelbuild/tulsi,pinterest/tulsi | src/TulsiGenerator/Scripts/tulsi_logging.py | src/TulsiGenerator/Scripts/tulsi_logging.py | # Copyright 2017 The Tulsi 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 applicable ... | # Copyright 2017 The Tulsi 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 applicable ... | apache-2.0 | Python |
48c3a35deffaca384189c8342a65debf03036dff | Remove semicolons | tijme/angularjs-csti-scanner,tijme/angularjs-sandbox-escape-scanner | acstis/Logging.py | acstis/Logging.py | # -*- coding: utf-8 -*-
# MIT License
#
# Copyright (c) 2017 Tijme Gommers
#
# 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
# ... | # -*- coding: utf-8 -*-
# MIT License
#
# Copyright (c) 2017 Tijme Gommers
#
# 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
# ... | mit | Python |
9365a3dce9cc1abe507c36d3dd1d79ca7fcab15c | add admin for Product | byteweaver/django-eca-catalogue | eca_catalogue/abstract_admin.py | eca_catalogue/abstract_admin.py | from django.contrib import admin
from treebeard.admin import TreeAdmin
class AbstractProductCategoryAdmin(admin.ModelAdmin):
prepopulated_fields = {"slug": ("name",)}
class AbstractNestedProductCategoryAdmin(TreeAdmin):
prepopulated_fields = {"slug": ("name",)}
class AbstractProductAdmin(admin.ModelAdmin):... | from django.contrib import admin
from treebeard.admin import TreeAdmin
class AbstractProductCategoryAdmin(admin.ModelAdmin):
prepopulated_fields = {"slug": ("name",)}
class AbstractNestedProductCategoryAdmin(TreeAdmin):
prepopulated_fields = {"slug": ("name",)}
| bsd-3-clause | Python |
9dca7838d8fb495acc02241b55a30870b7eec0ba | fix flake error in apps.py | justquick/django-activity-stream,pombredanne/django-activity-stream,justquick/django-activity-stream,jrsupplee/django-activity-stream,thelabnyc/django-activity-stream,jrsupplee/django-activity-stream,pombredanne/django-activity-stream,thelabnyc/django-activity-stream | actstream/apps.py | actstream/apps.py | from django.core.exceptions import ImproperlyConfigured
from actstream import settings
from actstream.signals import action
from actstream.compat_apps import AppConfig
class ActstreamConfig(AppConfig):
name = 'actstream'
def ready(self):
from actstream.actions import action_handler
action.co... | from django.core.exceptions import ImproperlyConfigured
from actstream import settings
from actstream.signals import action
from actstream.compat_apps import AppConfig
class ActstreamConfig(AppConfig):
name = 'actstream'
def ready(self):
from actstream.actions import action_handler
action.co... | bsd-3-clause | Python |
d8099cd712279afa1c4e73989c7f03bc9de6dd4c | fix performance problem with historian | genome/flow-workflow,genome/flow-workflow,genome/flow-workflow | flow_workflow/historian/operation_data.py | flow_workflow/historian/operation_data.py | import json
class OperationData(object):
def __init__(self, net_key, operation_id, color):
self.net_key = net_key
self.operation_id = int(operation_id)
self.color = int(color)
def dumps(self):
return json.dumps(self.to_dict, sort_keys=True)
@classmethod
def loads(cls, ... | import json
class OperationData(object):
def __init__(self, net_key, operation_id, color):
self.net_key = net_key
self.operation_id = int(operation_id)
self.color = int(color)
def dumps(self):
return json.dumps(self.to_dict, sort_keys=True)
@classmethod
def loads(cls, ... | agpl-3.0 | Python |
71554067936e2355658e6e566e8fcb4a66f24ee7 | Add new keyfile | Code4SA/mma-dexter,Code4SA/mma-dexter,Code4SA/mma-dexter | dexter/config/celeryconfig.py | dexter/config/celeryconfig.py | from celery.schedules import crontab
# uses AWS creds from the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY env variables
BROKER_URL = 'sqs://'
BROKER_TRANSPORT_OPTIONS = {
'region': 'eu-west-1',
'polling_interval': 15 * 1,
'queue_name_prefix': 'mma-dexter-',
'visibility_timeout': 3600*12,
}
# all ou... | from celery.schedules import crontab
# uses AWS creds from the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY env variables
BROKER_URL = 'sqs://'
BROKER_TRANSPORT_OPTIONS = {
'region': 'eu-west-1',
'polling_interval': 15 * 1,
'queue_name_prefix': 'mma-dexter-',
'visibility_timeout': 3600*12,
}
# all ou... | apache-2.0 | Python |
a0b1948261555b724e9c72558a7ca18d793f4748 | Support Ticket - In response to fix | Tejal011089/Medsyn2_app,Tejal011089/paypal_erpnext,Yellowen/Owrang,Suninus/erpnext,gangadharkadam/saloon_erp,rohitwaghchaure/New_Theme_Erp,mbauskar/phrerp,suyashphadtare/vestasi-erp-jan-end,Tejal011089/osmosis_erpnext,meisterkleister/erpnext,ThiagoGarciaAlves/erpnext,suyashphadtare/vestasi-erp-final,mbauskar/omnitech-e... | erpnext/support/doctype/support_ticket/support_ticket.py | erpnext/support/doctype/support_ticket/support_ticket.py | import webnotes
from webnotes.model.doc import make_autoname
from utilities.transaction_base import TransactionBase
from home import update_feed
class DocType(TransactionBase):
def __init__(self, doc, doclist=[]):
self.doc = doc
self.doclist = doclist
def autoname(self):
self.doc.name = make_autoname(self.do... | import webnotes
from webnotes.model.doc import make_autoname
from utilities.transaction_base import TransactionBase
from home import update_feed
class DocType(TransactionBase):
def __init__(self, doc, doclist=[]):
self.doc = doc
self.doclist = doclist
def autoname(self):
self.doc.name = make_autoname(self.do... | agpl-3.0 | Python |
30e44e48bacb1403d4df96df0654bdade324ec3e | Add test for `get_current_shift` | mimischi/django-clock,mimischi/django-clock,mimischi/django-clock,mimischi/django-clock | clock/shifts/tests/test_utils.py | clock/shifts/tests/test_utils.py | """Tests for the shift utilities."""
from test_plus import TestCase
from clock.shifts.factories import ShiftFactory, UserFactory
from clock.shifts.models import Shift
from clock.shifts.utils import get_current_shift, get_last_shifts
from clock.contracts.models import Contract
class TestUtils(TestCase):
"""Test t... | """Tests for the shift utilities."""
from test_plus import TestCase
from clock.shifts.factories import UserFactory, ShiftFactory
from clock.shifts.models import Shift
from clock.shifts.utils import get_last_shifts
class TestUtils(TestCase):
"""Test the functionality of the shift utilities."""
def test_get_l... | mit | Python |
2bbf7bc31b0c7372c143e9d8d062302127ddadd8 | add __version__ package attribute | SiLab-Bonn/online_monitor | online_monitor/__init__.py | online_monitor/__init__.py | # http://stackoverflow.com/questions/17583443/what-is-the-correct-way-to-share-package-version-with-setup-py-and-the-package
from pkg_resources import get_distribution
__version__ = get_distribution('online_monitor').version | mit | Python | |
1bc4c7ff0ecd5df9a1874c1f9930e33268c9524d | fix AddonMan | Alexey-T/CudaText,Alexey-T/CudaText,Alexey-T/CudaText,Alexey-T/CudaText,vhanla/CudaText,Alexey-T/CudaText,vhanla/CudaText,vhanla/CudaText,vhanla/CudaText,vhanla/CudaText,vhanla/CudaText,vhanla/CudaText,vhanla/CudaText,Alexey-T/CudaText,vhanla/CudaText,vhanla/CudaText,Alexey-T/CudaText,Alexey-T/CudaText | app/py/cuda_addonman/work_cudatext_updates__fosshub.py | app/py/cuda_addonman/work_cudatext_updates__fosshub.py | import sys
import os
import re
import platform
import tempfile
import webbrowser
import cudatext as app
from .work_remote import *
p = sys.platform
X64 = platform.architecture()[0]=='64bit'
DOWNLOAD_PAGE = 'https://www.fosshub.com/CudaText.html'
TEXT_CPU = 'x64' if X64 else 'x32'
REGEX_GROUP_VER = 1
DOWNLOAD_REGEX ... | import sys
import os
import re
import platform
import tempfile
import webbrowser
import cudatext as app
from .work_remote import *
p = sys.platform
X64 = platform.architecture()[0]=='64bit'
DOWNLOAD_PAGE = 'https://www.fosshub.com/CudaText.html'
TEXT_CPU = 'x64' if X64 else 'x32'
REGEX_GROUP_VER = 1
DOWNLOAD_REGEX ... | mpl-2.0 | Python |
34d9375de23384b3a5a777f802e93973ef7c4e60 | Fix the ARC test case. | daviddesancho/mdtraj,mdtraj/mdtraj,swails/mdtraj,gph82/mdtraj,daviddesancho/mdtraj,mpharrigan/mdtraj,hainm/mdtraj,hainm/mdtraj,gph82/mdtraj,daviddesancho/mdtraj,mattwthompson/mdtraj,dwhswenson/mdtraj,dwhswenson/mdtraj,kyleabeauchamp/mdtraj,swails/mdtraj,mattwthompson/mdtraj,msultan/mdtraj,mattwthompson/mdtraj,casawa/md... | MDTraj/tests/test_arc.py | MDTraj/tests/test_arc.py | ##############################################################################
# MDTraj: A Python Library for Loading, Saving, and Manipulating
# Molecular Dynamics Trajectories.
# Copyright 2012-2013 Stanford University and the Authors
#
# Authors: Lee-Ping Wang
# Contributors: Robert McGibbon
#
# MDTraj is fr... | ##############################################################################
# MDTraj: A Python Library for Loading, Saving, and Manipulating
# Molecular Dynamics Trajectories.
# Copyright 2012-2013 Stanford University and the Authors
#
# Authors: Lee-Ping Wang
# Contributors: Robert McGibbon
#
# MDTraj is fr... | lgpl-2.1 | Python |
863d0d28fb26007c448610a845caab39b1451326 | Add comparison with TCE output in CCD example | tschijnmo/drudge,tschijnmo/drudge,tschijnmo/drudge | docs/examples/ccd.py | docs/examples/ccd.py | """Automatic derivation of CCD equations.
"""
import urllib.request
from pyspark import SparkConf, SparkContext
from sympy import IndexedBase, Rational
from drudge import PartHoleDrudge, CR, AN
conf = SparkConf().setAppName('CCSD-derivation')
ctx = SparkContext(conf=conf)
dr = PartHoleDrudge(ctx)
p = dr.names
c_ ... | """Automatic derivation of CCD equations.
"""
import pickle
from pyspark import SparkConf, SparkContext
from sympy import IndexedBase, Rational
from drudge import PartHoleDrudge, CR, AN
conf = SparkConf().setAppName('CCSD-derivation')
ctx = SparkContext(conf=conf)
dr = PartHoleDrudge(ctx)
p = dr.names
c_ = dr.op[... | mit | Python |
1fd6fdbdd7c0cf3764fa0707692346675273a764 | allow underscores before quality suffix | crackwitz/videozeug | mp4mark.py | mp4mark.py | #!/usr/bin/env python2
import os
import sys
import re
import glob
from subprocess import call, Popen, PIPE
files = []
for x in sys.argv[1:]:
files += glob.glob(x) or ([x] if os.path.exists(x) else [])
#import pdb; pdb.set_trace()
base = None
for vid in files:
m = re.match(r'(.*)[_-]\d+p[_-]ame?\.mp4$', vid)
if n... | #!/usr/bin/env python2
import os
import sys
import re
import glob
from subprocess import call, Popen, PIPE
files = []
for x in sys.argv[1:]:
files += glob.glob(x) or ([x] if os.path.exists(x) else [])
#import pdb; pdb.set_trace()
base = None
for vid in files:
m = re.match(r'(.*)-\d+p-ame?\.mp4$', vid)
if not m: ... | mit | Python |
b487bad4079773d8537cd46f20164af77e7674fb | change TODO on nice-to-have to avoid triggering code climate | SexualHealthInnovations/callisto-core,SexualHealthInnovations/callisto-core,project-callisto/callisto-core,project-callisto/callisto-core | callisto/delivery/management/commands/find_matches.py | callisto/delivery/management/commands/find_matches.py | import importlib
from django.core.management.base import BaseCommand
from callisto.delivery.report_delivery import PDFMatchReport
from callisto.delivery.matching import find_matches
class Command(BaseCommand):
help = 'finds matches and sends match reports'
def add_arguments(self, parser):
parser.add... | import importlib
from django.core.management.base import BaseCommand
from callisto.delivery.report_delivery import PDFMatchReport
from callisto.delivery.matching import find_matches
class Command(BaseCommand):
help = 'finds matches and sends match reports'
def add_arguments(self, parser):
parser.add... | agpl-3.0 | Python |
b0f4ebf0cd0999debfdec7a6de972666d28eea98 | Update PWM example. | kwagyeman/openmv,openmv/openmv,iabdalkader/openmv,openmv/openmv,kwagyeman/openmv,kwagyeman/openmv,openmv/openmv,iabdalkader/openmv,iabdalkader/openmv,iabdalkader/openmv,kwagyeman/openmv,openmv/openmv | usr/examples/02-Board-Control/pwm_control.py | usr/examples/02-Board-Control/pwm_control.py | # PWM Control Example
#
# This example shows how to do PWM with your OpenMV Cam.
import time
from pyb import Pin, Timer
tim = Timer(4, freq=1000) # Frequency in Hz
# Generate a 1KHz square wave on TIM4 with 50% and 75% duty cycles on channels 1 and 2, respectively.
ch1 = tim.channel(1, Timer.PWM, pin=Pin("P7"), pulse... | # PWM Control Example
#
# This example shows how to do PWM with your OpenMV Cam.
#
# WARNING: PWM control is... not easy with MicroPython. You have to use
# the correct timer with the correct pins and channels. As for what the
# correct values are - who knows. If you need to change the pins from the
# example below ple... | mit | Python |
94af46d678055a667220e1a28da509bf507c91dd | change version | backbohne/docx-xslt | docxxslt/__init__.py | docxxslt/__init__.py | import logging
from . import engines, package
__version__ = '0.1.0'
class DocxXsltTemplate(object):
"""Docx template renderer"""
main_document = 'word/document.xml'
def __init__(self, filename):
self.package = package.Package(filename)
self.package.read()
def save(self, filename=N... | import logging
from . import engines, package
__version__ = '0.0.2'
class DocxXsltTemplate(object):
"""Docx template renderer"""
main_document = 'word/document.xml'
def __init__(self, filename):
self.package = package.Package(filename)
self.package.read()
def save(self, filename=N... | mit | Python |
ac5e24e691089b11abf8a09af862215751d2f401 | duplicate action | Amoki/Amoki-Music,Amoki/Amoki-Music,Amoki/Amoki-Music | music/admin.py | music/admin.py | from django.contrib import admin
from music.models import Music
from player.models import Room
from django.contrib.admin.helpers import ActionForm
from django import forms
from django.db import models
from music.serializers import MusicSerializer
class UpdateActionForm(ActionForm):
rooms = []
for room in Room... | from django.contrib import admin
from music.models import Music
from player.models import Room
from django.contrib.admin.helpers import ActionForm
from django import forms
from django.db import models
from music.serializers import MusicSerializer
class UpdateActionForm(ActionForm):
room = models.CharField(choices... | mit | Python |
d23ffcf338162ad78c646a69f91e4ff36c894a05 | bump to 0.78.1 | efiop/dvc,efiop/dvc,dmpetrov/dataversioncontrol,dmpetrov/dataversioncontrol | dvc/version.py | dvc/version.py | # Used in setup.py, so don't pull any additional dependencies
#
# Based on:
# - https://github.com/python/mypy/blob/master/mypy/version.py
# - https://github.com/python/mypy/blob/master/mypy/git.py
import os
import subprocess
_BASE_VERSION = "0.78.1"
def _generate_version(base_version):
"""Generate a versio... | # Used in setup.py, so don't pull any additional dependencies
#
# Based on:
# - https://github.com/python/mypy/blob/master/mypy/version.py
# - https://github.com/python/mypy/blob/master/mypy/git.py
import os
import subprocess
_BASE_VERSION = "0.78.0"
def _generate_version(base_version):
"""Generate a versio... | apache-2.0 | Python |
43a833dec24f4e0a7dc1d8494a5ad1b44113db15 | bump to 0.40.0 | dmpetrov/dataversioncontrol,efiop/dvc,efiop/dvc,dmpetrov/dataversioncontrol | dvc/version.py | dvc/version.py | # Used in setup.py, so don't pull any additional dependencies
#
# Based on:
# - https://github.com/python/mypy/blob/master/mypy/version.py
# - https://github.com/python/mypy/blob/master/mypy/git.py
import os
import subprocess
_BASE_VERSION = "0.40.0"
def _generate_version(base_version):
"""Generate a versio... | # Used in setup.py, so don't pull any additional dependencies
#
# Based on:
# - https://github.com/python/mypy/blob/master/mypy/version.py
# - https://github.com/python/mypy/blob/master/mypy/git.py
import os
import subprocess
_BASE_VERSION = "0.35.7"
def _generate_version(base_version):
"""Generate a versio... | apache-2.0 | Python |
df26ac758c6a38f2e0128e3511db009f0764947f | Bump version to 2.0.0b6 | rigetticomputing/pyquil | pyquil/__init__.py | pyquil/__init__.py | __version__ = "2.0.0b6"
from pyquil.quil import Program
from pyquil.api import list_quantum_computers, get_qc
| __version__ = "2.0.0b6.dev0"
from pyquil.quil import Program
from pyquil.api import list_quantum_computers, get_qc
| apache-2.0 | Python |
eed8d2b6da6e812cf50f83cf6776c8f0fe63d0f2 | correct naming of services | makinacorpus/formhub,qlands/onadata,GeoODK/formhub,SEL-Columbia/formhub,ultimateprogramer/formhub,ultimateprogramer/formhub,ehealthafrica-ci/formhub,sounay/flaminggo-test,jomolinare/kobocat,SEL-Columbia/formhub,ehealthafrica-ci/onadata,kobotoolbox/kobocat,hnjamba/onaclone,spatialdev/onadata,GeoODK/onadata,spatialdev/on... | restservice/__init__.py | restservice/__init__.py | SERVICE_CHOICES = ((u'f2dhis2', u'f2dhis2'),(u'generic_json', u'JSON POST'),
(u'generic_xml', u'XML POST'),)
| SERVICE_CHOICES = ((u'f2dhis2', u'f2dhis2'),(u'json', u'json_exports'),(u'xml', u'xml_exports'),) | bsd-2-clause | Python |
1ee501468b07951ccceb263f91d5624f679f0321 | Update outputs store setup | polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon | polyaxon_client/stores/stores/outputs_store.py | polyaxon_client/stores/stores/outputs_store.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from polyaxon_client.stores.exceptions import PolyaxonStoresException
from polyaxon_client.stores.stores.base_store import Store
class OutputsStore(object):
"""
A convenient class to store experiment/job outputs to a giv... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from polyaxon_client.stores.exceptions import PolyaxonStoresException
from polyaxon_client.stores.stores.base_store import Store
class OutputsStore(object):
"""
A convenient class to store experiment/job outputs to a giv... | apache-2.0 | Python |
c37f1ca0f8fc73da95d32082ed8dfb8967e38a1c | Check status method | dvhbru/dvhb-hybrid | dvhb_hybrid/tests.py | dvhb_hybrid/tests.py | class BaseTestApi:
"""Base class to test API"""
API_KEY = 'API-KEY'
def __init__(self, client, user):
self.client = client
self.user = user
self.headers = {'content-type': 'application/json'}
@staticmethod
async def check_status(result, response=HTTPOk):
assert resu... | class BaseTestApi:
"""Base class to test API"""
API_KEY = 'API-KEY'
def __init__(self, client, user):
self.client = client
self.user = user
self.headers = {'content-type': 'application/json'}
@staticmethod
async def prepare_result(r):
data = None
if 'applica... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.