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 |
|---|---|---|---|---|---|---|---|---|
02f59b60062004fc23dbfbfc6201b326b08513a8 | Add 404 exception | jiocloudservices/jcsclient | src/client/exceptions.py | src/client/exceptions.py | class HTTP4xx(Exception):
pass
class HTTP400(HTTP4xx):
pass
class HTTP404(HTTP4xx):
pass
class HTTP409(HTTP4xx):
pass
| class HTTP4xx(Exception):
pass
class HTTP400(HTTP4xx):
pass
class HTTP409(HTTP4xx):
pass
| apache-2.0 | Python |
8d06ccd7aeefe5945bab44b01764bd62685a2e17 | Add missing member to API. | MoonShineVFX/core,mindbender-studio/core,MoonShineVFX/core,mindbender-studio/core,getavalon/core,getavalon/core | mindbender/api.py | mindbender/api.py | """Public API
Anything that is not defined here is **internal** and
unreliable for external use.
Motivation for api.py:
Storing the API in a module, as opposed to in __init__.py, enables
use of it internally.
For example, from `pipeline.py`:
>> from . import api
>> api.do_this()
The ... | """Public API
Anything that is not defined here is **internal** and
unreliable for external use.
Motivation for api.py:
Storing the API in a module, as opposed to in __init__.py, enables
use of it internally.
For example, from `pipeline.py`:
>> from . import api
>> api.do_this()
The ... | mit | Python |
f68e8612f1e8198a4b300b67536d654e13809eb4 | Allow SHA256 hashes in URLs | kkampardi/Plinth,harry-7/Plinth,harry-7/Plinth,freedomboxtwh/Plinth,harry-7/Plinth,freedomboxtwh/Plinth,freedomboxtwh/Plinth,harry-7/Plinth,kkampardi/Plinth,kkampardi/Plinth,vignanl/Plinth,vignanl/Plinth,vignanl/Plinth,freedomboxtwh/Plinth,kkampardi/Plinth,freedomboxtwh/Plinth,kkampardi/Plinth,vignanl/Plinth,vignanl/Pl... | plinth/modules/monkeysphere/urls.py | plinth/modules/monkeysphere/urls.py | #
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | #
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | agpl-3.0 | Python |
547c9e36255870bcee8a800a3fa95c3806a95c2c | Update links when it starts getting redirected | adityabansal/newsAroundMe,adityabansal/newsAroundMe,adityabansal/newsAroundMe | newsApp/linkManager.py | newsApp/linkManager.py | import os
import time
from constants import *
from dbhelper import *
from dbItemManagerV2 import DbItemManagerV2
from link import Link
LINK_EXPIRY_TIME_IN_DAYS = 80
class LinkManager(DbItemManagerV2):
"""
Manage links stored on AWS dynamo db database.
Contains functions for CRUD operations on the links ... | import os
import time
from constants import *
from dbhelper import *
from dbItemManagerV2 import DbItemManagerV2
from link import Link
LINK_EXPIRY_TIME_IN_DAYS = 80
class LinkManager(DbItemManagerV2):
"""
Manage links stored on AWS dynamo db database.
Contains functions for CRUD operations on the links ... | mit | Python |
366ecdd77520004c307cbbf127bb374ab546ce7e | Use windows API to change the AppID and use our icon. | BBN-Q/Quince | run-quince.py | run-quince.py | #!/usr/bin/env python3
# coding: utf-8
# Raytheon BBN Technologies 2016
# Contributiors: Graham Rowlands
#
# This file runs the main loop
# Use PyQt5 by default
import os
os.environ["QT_API"] = 'pyqt5'
from qtpy.QtWidgets import QApplication
import sys
import argparse
import ctypes
from quince.view import *
if __na... | #!/usr/bin/env python3
# coding: utf-8
# Raytheon BBN Technologies 2016
# Contributiors: Graham Rowlands
#
# This file runs the main loop
# Use PyQt5 by default
import os
os.environ["QT_API"] = 'pyqt5'
from qtpy.QtWidgets import QApplication
import sys
import argparse
from quince.view import *
if __name__ == "__mai... | apache-2.0 | Python |
9e6b596aa856e1d50a9c2c2882289cf1a5d8c0c0 | Fix up plotting script | petebachant/waveFlapper-OpenFOAM,petebachant/waveFlapper-OpenFOAM,petebachant/waveFlapper-OpenFOAM | plot.py | plot.py | #!/usr/bin/env python
"""Processing routines for the waveFlapper case."""
import foampy
import numpy as np
import matplotlib.pyplot as plt
width_2d = 0.1
width_3d = 3.66
m_paddle = 1270.0 # Paddle mass in kg, from OMB manual
h_piston = 3.3147
I_paddle = 1/3*m_paddle*h_piston**2
def plot_force():
"""Plots the s... | #!/usr/bin/env python
"""Processing routines for the waveFlapper case."""
import foampy
import numpy as np
import matplotlib.pyplot as plt
width_2d = 0.1
width_3d = 3.66
m_paddle = 1270.0 # Paddle mass in kg, from OMB manual
h_piston = 3.3147
I_paddle = 1/3*m_paddle*h_piston**2
def plot_force():
"""Plots the ... | cc0-1.0 | Python |
5a6cdb9dc08924dc90a24271dc45f4412250b06a | bump version | hsharrison/experimentator | src/experimentator/__version__.py | src/experimentator/__version__.py | __version__ = '0.2.1'
| __version__ = '0.2.0'
| mit | Python |
52dd018d08e00356218cb2789cee10976eff4359 | Disable automatic geocoding for addresses in Django admin | FireCARES/firecares,FireCARES/firecares,FireCARES/firecares,FireCARES/firecares,FireCARES/firecares | firecares/firecares_core/admin.py | firecares/firecares_core/admin.py | import autocomplete_light
from .models import Address, ContactRequest, AccountRequest, RegistrationWhitelist
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.contrib.gis import admin
from import_export.admin impo... | import autocomplete_light
from .models import Address, ContactRequest, AccountRequest, RegistrationWhitelist
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.contrib.gis import admin
from import_export.admin impo... | mit | Python |
7b3f239964c6663a9b655553202567fccead85c8 | Add 'me' to profile IdentifierError | mollie/mollie-api-python | mollie/api/resources/profiles.py | mollie/api/resources/profiles.py | from ..error import IdentifierError
from ..objects.profile import Profile
from .base import Base
class Profiles(Base):
RESOURCE_ID_PREFIX = 'pfl_'
def get_resource_object(self, result):
return Profile(result, self.client)
def get(self, profile_id, **params):
if not profile_id or \
... | from ..error import IdentifierError
from ..objects.profile import Profile
from .base import Base
class Profiles(Base):
RESOURCE_ID_PREFIX = 'pfl_'
def get_resource_object(self, result):
return Profile(result, self.client)
def get(self, profile_id, **params):
if not profile_id or \
... | bsd-2-clause | Python |
5efdd29804249b40c9b9e589cb00cf10c56decb0 | Add the standard imports | crateio/carrier | conveyor/tasks/bulk.py | conveyor/tasks/bulk.py | from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import datetime
import logging
import time
from requests.exceptions import ConnectionError, HTTPError
from ..core import Conveyor
logger = logging.getLogger(__name__)
# We ignore the last component as w... | import datetime
import logging
import time
from requests.exceptions import ConnectionError, HTTPError
from ..core import Conveyor
logger = logging.getLogger(__name__)
# We ignore the last component as we cannot properly handle it
def get_jobs(last=0):
current = time.mktime(datetime.datetime.utcnow().timetuple... | bsd-2-clause | Python |
00203b7fbf8ed8f8728ce18838acb21eb6224723 | Disable unused code | flumotion-mirror/flumotion,flumotion-mirror/flumotion,Flumotion/flumotion,Flumotion/flumotion,timvideos/flumotion,timvideos/flumotion,Flumotion/flumotion,timvideos/flumotion,Flumotion/flumotion | flumotion/test/test_common_vfs.py | flumotion/test/test_common_vfs.py | # -*- Mode: Python; test-case-name: flumotion.test.test_common_planet -*-
# vi:si:et:sw=4:sts=4:ts=4
#
# Flumotion - a streaming media server
# Copyright (C) 2008 Fluendo, S.L. (www.fluendo.com).
# All rights reserved.
# This file may be distributed and/or modified under the terms of
# the GNU General Public License v... | # -*- Mode: Python; test-case-name: flumotion.test.test_common_planet -*-
# vi:si:et:sw=4:sts=4:ts=4
#
# Flumotion - a streaming media server
# Copyright (C) 2008 Fluendo, S.L. (www.fluendo.com).
# All rights reserved.
# This file may be distributed and/or modified under the terms of
# the GNU General Public License v... | lgpl-2.1 | Python |
8a010b6601ecf2eed216b3aa0b604a0985d06544 | Update chainer/training/extensions/__init__.py | wkentaro/chainer,niboshi/chainer,wkentaro/chainer,hvy/chainer,hvy/chainer,hvy/chainer,chainer/chainer,hvy/chainer,tkerola/chainer,niboshi/chainer,chainer/chainer,chainer/chainer,wkentaro/chainer,okuta/chainer,niboshi/chainer,wkentaro/chainer,keisuke-umezawa/chainer,pfnet/chainer,okuta/chainer,niboshi/chainer,keisuke-um... | chainer/training/extensions/__init__.py | chainer/training/extensions/__init__.py | # import classes and functions
from chainer.training.extensions._snapshot import snapshot # NOQA
from chainer.training.extensions._snapshot import snapshot_object # NOQA
from chainer.training.extensions.computational_graph import DumpGraph # NOQA
from chainer.training.extensions.evaluator import Evaluator # NOQA
fr... | # import classes and functions
from chainer.training.extensions._snapshot import snapshot # NOQA
from chainer.training.extensions._snapshot import snapshot_object # NOQA
from chainer.training.extensions.computational_graph import DumpGraph # NOQA
from chainer.training.extensions.evaluator import Evaluator # NOQA
fr... | mit | Python |
105dc001e5e0f2e1e02409cf77e5b31f0df30ffe | put on two lines | analyst-collective/dbt,fishtown-analytics/dbt,fishtown-analytics/dbt,fishtown-analytics/dbt,analyst-collective/dbt | core/dbt/task/clean.py | core/dbt/task/clean.py | import os.path
import os
import shutil
from dbt.task.base import ProjectOnlyTask
from dbt.logger import GLOBAL_LOGGER as logger
class CleanTask(ProjectOnlyTask):
def __is_project_path(self, path):
proj_path = os.path.abspath('.')
return not os.path.commonprefix(
[proj_path, os.path.a... | import os.path
import os
import shutil
from dbt.task.base import ProjectOnlyTask
from dbt.logger import GLOBAL_LOGGER as logger
class CleanTask(ProjectOnlyTask):
def __is_project_path(self, path):
proj_path = os.path.abspath('.')
return not os.path.commonprefix(
[proj_path, os.path.a... | apache-2.0 | Python |
5860d28e0f8f08f1bf4ca2426c08a83b687f33f8 | Fix Python3 issue (#173) | code-disaster/fips,floooh/fips,code-disaster/fips,floooh/fips,floooh/fips | mod/tools/node.py | mod/tools/node.py | """wrapper for node.js, only check_exists"""
import subprocess
name = 'node'
platforms = ['linux']
optional = True
not_found = 'node.js required for emscripten cross-compiling'
#------------------------------------------------------------------------------
def check_exists(fips_dir) :
try :
out = subproce... | """wrapper for node.js, only check_exists"""
import subprocess
name = 'node'
platforms = ['linux']
optional = True
not_found = 'node.js required for emscripten cross-compiling'
#------------------------------------------------------------------------------
def check_exists(fips_dir) :
try :
out = subproce... | mit | Python |
1794fb8865241e22a5af30020111471ea00a6250 | check if you the plugins really need to be reloaded | inventree/InvenTree,inventree/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree,SchrodingersGat/InvenTree,SchrodingersGat/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree | InvenTree/plugin/admin.py | InvenTree/plugin/admin.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from django.apps import apps
import plugin.models as models
def plugin_update(queryset, new_status: bool):
"""general function for bulk changing plugins"""
apps_changed = False
# run through all plugins in ... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from django.apps import apps
import plugin.models as models
def plugin_update(queryset, new_status: bool):
"""general function for bulk changing plugins"""
for model in queryset:
model.active = new_statu... | mit | Python |
3747f72e81a3c143145dcbbdcfbfc13b292f19e1 | add filter plot test | srcole/neurodsp,voytekresearch/neurodsp,srcole/neurodsp | neurodsp/tests/test_plts_filt.py | neurodsp/tests/test_plts_filt.py | """
test_plts_filt.py
Test filtering plots
"""
import numpy as np
from neurodsp.filt import filter_signal
from neurodsp.plts.filt import plot_frequency_response
def test_plot_frequency_response():
"""
Confirm frequency response plotting function works
"""
# Test plotting through the filter function
... | """
test_burst.py
Test burst detection functions
"""
import os
import numpy as np
import neurodsp
from .util import _load_example_data
def test_detect_bursts_dual_threshold():
"""
Confirm consistency in burst detection results on a generated neural signal
"""
# Load data and ground-truth filtered sig... | apache-2.0 | Python |
d57c3ad63b737fda4632f5896c8049329bcd4fe2 | Make this test work under Windows as well. | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | Lib/test/test_fpformat.py | Lib/test/test_fpformat.py | '''
Tests for fpformat module
Nick Mathewson
'''
from test_support import run_unittest
import unittest
from fpformat import fix, sci, NotANumber
StringType = type('')
# Test the old and obsolescent fpformat module.
#
# (It's obsolescent because fix(n,d) == "%.*f"%(d,n) and
# sci(n,d) =... | '''
Tests for fpformat module
Nick Mathewson
'''
from test_support import run_unittest
import unittest
from fpformat import fix, sci, NotANumber
StringType = type('')
# Test the old and obsolescent fpformat module.
#
# (It's obsolescent because fix(n,d) == "%.*f"%(d,n) and
# sci(n,d) =... | mit | Python |
d3c7f5de6a4c1d15ab3ffe19da18faaecd466fb6 | replace mysteriously missing haystack settings from staging | izzyalonso/tndata_backend,tndatacommons/tndata_backend,izzyalonso/tndata_backend,tndatacommons/tndata_backend,izzyalonso/tndata_backend,tndatacommons/tndata_backend,izzyalonso/tndata_backend,tndatacommons/tndata_backend | tndata_backend/tndata_backend/settings/staging.py | tndata_backend/tndata_backend/settings/staging.py | from .base import *
DEBUG = False
#DEBUG = True
STAGING = True
# Site's FQDN and URL. For building links in email.
SITE_DOMAIN = "staging.tndata.org"
SITE_URL = "https://{0}".format(SITE_DOMAIN)
INSTALLED_APPS = INSTALLED_APPS + (
'debug_toolbar',
'querycount',
)
# Just like production, but without the cach... | from .base import *
DEBUG = False
#DEBUG = True
STAGING = True
# Site's FQDN and URL. For building links in email.
SITE_DOMAIN = "staging.tndata.org"
SITE_URL = "https://{0}".format(SITE_DOMAIN)
INSTALLED_APPS = INSTALLED_APPS + (
'debug_toolbar',
'querycount',
)
# Just like production, but without the cach... | mit | Python |
ec4c9a07dc5ca2fab6b341932f65d0cfbd6a332b | Bump version to 1.1 | mollyproject/mollyproject,mollyproject/mollyproject,mollyproject/mollyproject | molly/__init__.py | molly/__init__.py | """
Molly Project
http://mollyproject.org
A framework for creating Mobile Web applications for HE/FE institutions.
"""
__version__ = '1.1' | """
Molly Project
http://mollyproject.org
A framework for creating Mobile Web applications for HE/FE institutions.
"""
__version__ = '1.0' | apache-2.0 | Python |
75e61ecf5efebe78676512d714fc7551f3dfac4c | Fix test | Igalia/snabbswitch,eugeneia/snabb,alexandergall/snabbswitch,SnabbCo/snabbswitch,Igalia/snabbswitch,alexandergall/snabbswitch,snabbco/snabb,eugeneia/snabb,snabbco/snabb,snabbco/snabb,eugeneia/snabb,eugeneia/snabb,Igalia/snabb,Igalia/snabb,Igalia/snabbswitch,eugeneia/snabb,alexandergall/snabbswitch,eugeneia/snabb,snabbco... | src/program/lwaftr/tests/subcommands/generate_binding_table_test.py | src/program/lwaftr/tests/subcommands/generate_binding_table_test.py | """
Test uses "snabb lwaftr generate-configuration" subcommand. Does not
need NICs as it doesn't use any network functionality. The command is
just to produce a binding table config result.
"""
from test_env import ENC, SNABB_CMD, BaseTestCase
NUM_SOFTWIRES = 10
class TestGenerateBindingTable(BaseTestCase):
ge... | """
Test uses "snabb lwaftr generate-binding-table" subcommand. Does not
need NICs as it doesn't use any network functionality. The command is
just to produce a binding table config result.
"""
from test_env import ENC, SNABB_CMD, BaseTestCase
NUM_SOFTWIRES = 10
class TestGenerateBindingTable(BaseTestCase):
ge... | apache-2.0 | Python |
224522e88347d4eafd68202222bb83c2d596524b | Modify SCons tools | StatisKit/StatisKit,StatisKit/StatisKit | conda/python-dev/boost_python.py | conda/python-dev/boost_python.py | from types import MethodType
import itertools
def generate(env):
"""Add Builders and construction variables to the Environment."""
if not 'boost_python' in env['TOOLS'][:-1]:
env.Tool('system')
env.AppendUnique(LIBS = ['boost_python'])
env.AppendUnique(CPPDEFINES = ['BOOST_PYTHON_D... | from types import MethodType
import itertools
def generate(env):
"""Add Builders and construction variables to the Environment."""
if not 'boost_python' in env['TOOLS'][:-1]:
env.Tool('system')
env.AppendUnique(LIBS = ['boost_python'])
env.AppendUnique(CPPDEFINES = ['BOOST_PYTHON_D... | apache-2.0 | Python |
fc22465decac6a33543e5232097af7ea847c4029 | Bump version to 1.0.1-machtfit-41 | machtfit/django-oscar,machtfit/django-oscar,machtfit/django-oscar | src/oscar/__init__.py | src/oscar/__init__.py | import os
# Use 'dev', 'beta', or 'final' as the 4th element to indicate release type.
VERSION = (1, 0, 1, 'machtfit', 41)
def get_short_version():
return '%s.%s' % (VERSION[0], VERSION[1])
def get_version():
return '{}.{}.{}-{}-{}'.format(*VERSION)
# Cheeky setting that allows each template to be acces... | import os
# Use 'dev', 'beta', or 'final' as the 4th element to indicate release type.
VERSION = (1, 0, 1, 'machtfit', 40)
def get_short_version():
return '%s.%s' % (VERSION[0], VERSION[1])
def get_version():
return '{}.{}.{}-{}-{}'.format(*VERSION)
# Cheeky setting that allows each template to be acces... | bsd-3-clause | Python |
14ee6e2e9986c58fdeb8e482f3426b756ab1d2cb | Bump dev version | rueckstiess/mtools,rueckstiess/mtools | mtools/version.py | mtools/version.py | #!/usr/bin/env python3
"""Mtools version."""
__version__ = '1.7.0-dev'
| #!/usr/bin/env python3
"""Mtools version."""
__version__ = '1.6.4'
| apache-2.0 | Python |
f83ce11dccd7209e4c124e9dadbcbbd86568e320 | Comment reason why the example is commented out | stefanseefeld/numba,cpcloud/numba,sklam/numba,pitrou/numba,stuartarchibald/numba,numba/numba,cpcloud/numba,stonebig/numba,sklam/numba,cpcloud/numba,stuartarchibald/numba,jriehl/numba,stuartarchibald/numba,jriehl/numba,sklam/numba,IntelLabs/numba,seibert/numba,sklam/numba,IntelLabs/numba,stonebig/numba,stonebig/numba,pi... | numba/tests/compile_with_pycc.py | numba/tests/compile_with_pycc.py | import cmath
import numpy as np
from numba import exportmany, export
from numba.pycc import CC
#
# New API
#
cc = CC('pycc_test_simple')
@cc.export('multf', 'f4(f4, f4)')
@cc.export('multi', 'i4(i4, i4)')
def mult(a, b):
return a * b
_two = 2
# This one can't be compiled by the legacy API as it doesn't exec... | import cmath
import numpy as np
from numba import exportmany, export
from numba.pycc import CC
#
# New API
#
cc = CC('pycc_test_simple')
@cc.export('multf', 'f4(f4, f4)')
@cc.export('multi', 'i4(i4, i4)')
def mult(a, b):
return a * b
_two = 2
# This one can't be compiled by the legacy API as it doesn't exec... | bsd-2-clause | Python |
6eedd6e5b96d9ee051e7708c4c127fdfb6c2a92b | modify file : add class Report and Score | KIKUYA-Takumi/NippoKun,KIKUYA-Takumi/NippoKun,KIKUYA-Takumi/NippoKun | NippoKun/report/models.py | NippoKun/report/models.py | from django.contrib.auth.models import User
from django.db import models
# Create your models here.
class Report(models.Model):
report_author = models.ForeignKey(User, related_name='report_author')
report_title = models.CharField(max_length=50)
report_content = models.TextField(max_length=999)
creat... | from django.db import models
# Create your models here.
| mit | Python |
a2eae87fc76ba1e9fbfa8102c3e19c239445a62a | Fix form retrieval in ModelForm | exekias/droplet,exekias/droplet,exekias/droplet | nazs/web/forms.py | nazs/web/forms.py | from achilles.forms import * # noqa
from nazs.models import SingletonModel
# Override forms template
Form.template_name = 'web/form.html'
class ModelForm(ModelForm):
def get_form(self, form_data=None, *args, **kwargs):
# manage SingletonModels
if issubclass(self.form_class.Meta.model, Singleto... | from achilles.forms import * # noqa
from nazs.models import SingletonModel
# Override forms template
Form.template_name = 'web/form.html'
class ModelForm(ModelForm):
def get_form(self, form_data=None, *args, **kwargs):
# manage SingletonModels
if issubclass(self.form_class.Meta.model, Singleto... | agpl-3.0 | Python |
a4ee20e078175c5d75380afca7b02305440ab32f | Add a couple numeric columns to better portray overall performance. | python-postgres/fe,python-postgres/fe | postgresql/test/perf_query_io.py | postgresql/test/perf_query_io.py | #!/usr/bin/env python
##
# copyright 2009, James William Pye
# http://python.projects.postgresql.org
##
# Statement I/O: Mass insert and select performance
##
import os
import time
import sys
import decimal
def insertSamples(count, insert_records):
recs = [
(-3, 123, 0xfffffea023, decimal.Decimal("90900023123.40031... | #!/usr/bin/env python
##
# copyright 2009, James William Pye
# http://python.projects.postgresql.org
##
# Statement I/O: Mass insert and select performance
##
import os
import time
import sys
def insertSamples(count, insert_records):
recs = [
(-3, 123, 0xfffffea023, 'some_óäæ_thing', 'varying', 'æ')
for x in rang... | bsd-3-clause | Python |
b6dff8fcd7dec56703006f2a7bcf1c8c72d0c21b | FIX price sec. related field as readonly | ingadhoc/product,ingadhoc/product | price_security/models/invoice.py | price_security/models/invoice.py | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
from openerp import fields, models, api
class ac... | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
from openerp import fields, models, api
class ac... | agpl-3.0 | Python |
fb142d3324ca974c9308cb8ab18dd9db2c2aae0b | Use monospace font | Aldenis2112/qutepart,Aldenis2112/qutepart,Aldenis2112/qutepart,hlamer/qutepart,Aldenis2112/qutepart,hlamer/qutepart,andreikop/qutepart,hlamer/qutepart,Aldenis2112/qutepart,andreikop/qutepart,Aldenis2112/qutepart,hlamer/qutepart,andreikop/qutepart,andreikop/qutepart,hlamer/qutepart,Aldenis2112/qutepart,andreikop/qutepar... | editor.py | editor.py | #!/usr/bin/env python
import sys
import sip
sip.setapi('QString', 2)
from PyQt4.QtGui import QApplication, QFont, QPlainTextEdit, QSyntaxHighlighter, \
QTextCharFormat, QTextBlockUserData
from qutepart.SyntaxHighlighter import SyntaxHighlighter
from qutepart.syntax_manager import SyntaxManager
def main():
... | #!/usr/bin/env python
import sys
import sip
sip.setapi('QString', 2)
from PyQt4.QtGui import QApplication, QPlainTextEdit, QSyntaxHighlighter, \
QTextCharFormat, QTextBlockUserData
from qutepart.SyntaxHighlighter import SyntaxHighlighter
from qutepart.syntax_manager import SyntaxManager
def main():
if len... | lgpl-2.1 | Python |
a098efa1b69d2de3b1e2437a056b0c6937cbf998 | add documentation | armijnhemel/binaryanalysis | src/bat/images.py | src/bat/images.py | #!/usr/bin/python
## Binary Analysis Tool
## Copyright 2012 Armijn Hemel for Tjaldur Software Governance Solutions
## Licensed under Apache 2.0, see LICENSE file for details
'''
This is a plugin for the Binary Analysis Tool. It generates images of files, both
full files and thumbnails. The files can be used for infor... | #!/usr/bin/python
## Binary Analysis Tool
## Copyright 2012 Armijn Hemel for Tjaldur Software Governance Solutions
## Licensed under Apache 2.0, see LICENSE file for details
'''
This is a plugin for the Binary Analysis Tool. It generates images of files, both
full files and thumbnails. The files can be used for infor... | apache-2.0 | Python |
7a60bd74b3af40223553c64dafed07c46c5db639 | add a --jit commandline option | cosmoharrigan/pyrolog | prolog/targetprologstandalone.py | prolog/targetprologstandalone.py | """
A simple standalone target for the prolog interpreter.
"""
import sys
from prolog.interpreter.translatedmain import repl, execute
# __________ Entry point __________
from prolog.interpreter.continuation import Engine, jitdriver
from prolog.interpreter import term
from prolog.interpreter import arithmetic # for... | """
A simple standalone target for the prolog interpreter.
"""
import sys
from prolog.interpreter.translatedmain import repl, execute
# __________ Entry point __________
from prolog.interpreter.continuation import Engine
from prolog.interpreter import term
from prolog.interpreter import arithmetic # for side effec... | mit | Python |
3f1f86c358efc6d38012191c4b613aa775861805 | Fix 'graph3d.py' to read from VTKData directory | ashray/VTK-EVM,cjh1/VTK,gram526/VTK,demarle/VTK,johnkit/vtk-dev,demarle/VTK,jmerkow/VTK,candy7393/VTK,hendradarwin/VTK,SimVascular/VTK,gram526/VTK,cjh1/VTK,collects/VTK,keithroe/vtkoptix,candy7393/VTK,demarle/VTK,ashray/VTK-EVM,keithroe/vtkoptix,jmerkow/VTK,ashray/VTK-EVM,gram526/VTK,aashish24/VTK-old,candy7393/VTK,kei... | Examples/Infovis/Python/graph3d.py | Examples/Infovis/Python/graph3d.py | from vtk import *
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
reader = vtkXGMLReader()
reader.SetFileName(VTK_DATA_ROOT + "/Data/Infovis/fsm.gml")
reader.Update()
strategy = vtkSpanTreeLayoutStrategy()
strategy.DepthFirstSpanningTreeOn()
view = vtkGraphLayoutView()
view.AddRepresentat... | from vtk import *
reader = vtkXGMLReader()
reader.SetFileName("fsm.gml")
reader.Update()
strategy = vtkSpanTreeLayoutStrategy()
strategy.DepthFirstSpanningTreeOn()
view = vtkGraphLayoutView()
view.AddRepresentationFromInputConnection(reader.GetOutputPort())
view.SetVertexLabelArrayName("vertex id")
view.SetVertexL... | bsd-3-clause | Python |
0cd2af0f20b6b544f0d36140a098ca8e3058d8fa | Update constants | bankonme/OpenBazaar,must-/OpenBazaar,must-/OpenBazaar,saltduck/OpenBazaar,bglassy/OpenBazaar,atsuyim/OpenBazaar,STRML/OpenBazaar,hoffmabc/OpenBazaar,im0rtel/OpenBazaar,atsuyim/OpenBazaar,kordless/OpenBazaar,bankonme/OpenBazaar,dlcorporation/openbazaar,habibmasuro/OpenBazaar,STRML/OpenBazaar,Renelvon/OpenBazaar,must-/Op... | node/constants.py | node/constants.py | ######### KADEMLIA CONSTANTS ###########
#: Small number Representing the degree of parallelism in network calls
alpha = 3
#: Maximum number of contacts stored in a bucket; this should be an even number
k = 8
#: Timeout for network operations (in seconds)
rpcTimeout = 5
# Delay between iterations of iterative node ... | ######### KADEMLIA CONSTANTS ###########
#: Small number Representing the degree of parallelism in network calls
alpha = 3
#: Maximum number of contacts stored in a bucket; this should be an even number
k = 8
# Delay between iterations of iterative node lookups (for loose parallelism) (in seconds)
iterativeLookupDe... | mit | Python |
8765ac953047ba1c63eb2eb2eb087ba92e9213bc | fix switch template | zpriddy/Firefly,zpriddy/Firefly,zpriddy/Firefly,zpriddy/Firefly | Firefly/core/templates/__init__.py | Firefly/core/templates/__init__.py | # -*- coding: utf-8 -*-
# @Author: Zachary Priddy
# @Date: 2016-04-12 13:33:30
# @Last Modified by: Zachary Priddy
# @Last Modified time: 2016-04-12 13:33:30
class Templates(object):
def __init__(self):
self._filepath = 'core/templates/'
self._switch_template = self.get_template('switch')
def get_tem... | # -*- coding: utf-8 -*-
# @Author: Zachary Priddy
# @Date: 2016-04-12 13:33:30
# @Last Modified by: Zachary Priddy
# @Last Modified time: 2016-04-12 13:33:30
class Templates(object):
def __init__(self):
self._filepath = 'core/templates/'
self._switch_template = self.get_template('switch')
def get_tem... | apache-2.0 | Python |
38de795103748ca757a03a62da8ef3d89b0bf682 | Fix bug that prevent commands with no values from being added | Nzaga/GoProController,joshvillbrandt/GoProController,Nzaga/GoProController,joshvillbrandt/GoProController | GoProController/models.py | GoProController/models.py | from django.db import models
class Camera(models.Model):
ssid = models.CharField(max_length=255)
password = models.CharField(max_length=255)
date_added = models.DateTimeField(auto_now_add=True)
last_attempt = models.DateTimeField(auto_now=True)
last_update = models.DateTimeField(null=True, blank=T... | from django.db import models
class Camera(models.Model):
ssid = models.CharField(max_length=255)
password = models.CharField(max_length=255)
date_added = models.DateTimeField(auto_now_add=True)
last_attempt = models.DateTimeField(auto_now=True)
last_update = models.DateTimeField(null=True, blank=T... | apache-2.0 | Python |
e1ad05fb19577aa108b94ea500106e36b29915fc | update indentation | Statistica/676-candidates | amount_raised_by_candidate.py | amount_raised_by_candidate.py | # Written by Jonathan Saewitz, released May 24th, 2016 for Statisti.ca
# Released under the MIT License (https://opensource.org/licenses/MIT)
import csv, plotly.plotly as plotly, plotly.graph_objs as go, requests
from bs4 import BeautifulSoup
candidates=[]
with open('presidential_candidates.csv', 'r') as f:
reader=... | # Written by Jonathan Saewitz, released May 24th, 2016 for Statisti.ca
# Released under the MIT License (https://opensource.org/licenses/MIT)
import csv, plotly.plotly as plotly, plotly.graph_objs as go, requests
from bs4 import BeautifulSoup
candidates=[]
with open('presidential_candidates.csv', 'r') as f:
reader=... | mit | Python |
caff96633ce29a2139bc61bb5ee333efd69d50ef | Remove default classifier path from default config | ruipgil/ProcessMySteps,ruipgil/ProcessMySteps | processmysteps/default_config.py | processmysteps/default_config.py | """
Base line settings
"""
CONFIG = {
'input_path': None,
'backup_path': None,
'dest_path': None,
'life_all': None,
'db': {
'host': None,
'port': None,
'name': None,
'user': None,
'pass': None
},
# 'preprocess': {
# 'max_acc': 30.0
# },
... | """
Base line settings
"""
CONFIG = {
'input_path': None,
'backup_path': None,
'dest_path': None,
'life_all': None,
'db': {
'host': None,
'port': None,
'name': None,
'user': None,
'pass': None
},
# 'preprocess': {
# 'max_acc': 30.0
# },
... | mit | Python |
d8fc3888f0b40a8b7a476fc3fec0ca3dfe7a2416 | make API able to work with single names | block8437/gender.py | gender.py | gender.py | import requests, json
def getGenders(names):
url = ""
cnt = 0
if not isinstance(names,list):
names = [names,]
for name in names:
if url == "":
url = "name[0]=" + name
else:
cnt += 1
url = url + "&name[" + str(cnt) + "]=" + name
req = requests.get("http://api.genderize.io?" + url)
results = j... | import requests, json
def getGenders(names):
url = ""
cnt = 0
for name in names:
if url == "":
url = "name[0]=" + name
else:
cnt += 1
url = url + "&name[" + str(cnt) + "]=" + name
req = requests.get("http://api.genderize.io?" + url)
results = json.loads(req.text)
retrn = []
for result in resu... | mit | Python |
fc6c6f9ecbf694198c650cf86151423226304c51 | put import statement in try | alphatwirl/alphatwirl,alphatwirl/alphatwirl,alphatwirl/alphatwirl,alphatwirl/alphatwirl,TaiSakuma/AlphaTwirl,TaiSakuma/AlphaTwirl | alphatwirl/delphes/load_delphes.py | alphatwirl/delphes/load_delphes.py | # Tai Sakuma <tai.sakuma@cern.ch>
try:
import ROOT
except ImportError:
pass
_loaded = False
##__________________________________________________________________||
def load_delphes():
global _loaded
if _loaded:
return
# https://root.cern.ch/phpBB3/viewtopic.php?t=21603
ROOT.gInterpret... | # Tai Sakuma <tai.sakuma@cern.ch>
import ROOT
_loaded = False
##__________________________________________________________________||
def load_delphes():
global _loaded
if _loaded:
return
# https://root.cern.ch/phpBB3/viewtopic.php?t=21603
ROOT.gInterpreter.Declare('#include "classes/DelphesC... | bsd-3-clause | Python |
1eb648b14c52c9a2e715774ec71b2c8e6228efc4 | add vtkNumpy.numpyToImageData() function | patmarion/director,patmarion/director,patmarion/director,patmarion/director,patmarion/director | src/python/director/vtkNumpy.py | src/python/director/vtkNumpy.py | from director.shallowCopy import shallowCopy
import director.vtkAll as vtk
from vtk.util import numpy_support
import numpy as np
def numpyToPolyData(pts, pointData=None, createVertexCells=True):
pd = vtk.vtkPolyData()
pd.SetPoints(getVtkPointsFromNumpy(pts.copy()))
if pointData is not None:
for ... | from director.shallowCopy import shallowCopy
import director.vtkAll as vtk
from vtk.util import numpy_support
import numpy as np
def numpyToPolyData(pts, pointData=None, createVertexCells=True):
pd = vtk.vtkPolyData()
pd.SetPoints(getVtkPointsFromNumpy(pts.copy()))
if pointData is not None:
for ... | bsd-3-clause | Python |
5f522cf58a1566513e874002bdaeb063e8a02497 | Update model and add TODO | harunurhan/repologist,harunurhan/repodoctor,harunurhan/repologist,harunurhan/repodoctor | server/models/checkup.py | server/models/checkup.py | # -*- coding: utf-8 -*-
from datetime import datetime
from app import db
class Checkup(db.Model):
__tablename__ = 'checkup'
id = db.Column(db.Integer, primary_key=True)
created = db.Column(db.DateTime, default=datetime.utcnow)
# TODO: add one unique constraint on the column group of owner and repo
... | # -*- coding: utf-8 -*-
from datetime import datetime
from app import db
class Checkup(db.Model):
__tablename__ = 'checkup'
id = db.Column(db.Integer, primary_key=True)
created = db.Column(db.DateTime, default=datetime.utcnow)
repo_name = db.Column(db.String, unique=True) # github-user/repo-name
... | mit | Python |
fb1ddcdd789d1c1be02a9f6d63a21548a8cf584e | Fix undo of PlatformPhysicsOperation after the SceneNode changes | onitake/Uranium,onitake/Uranium | printer/PlatformPhysicsOperation.py | printer/PlatformPhysicsOperation.py | from UM.Operations.Operation import Operation
from UM.Operations.AddSceneNodeOperation import AddSceneNodeOperation
from UM.Operations.TranslateOperation import TranslateOperation
from UM.Operations.GroupedOperation import GroupedOperation
## A specialised operation designed specifically to modify the previous operat... | from UM.Operations.Operation import Operation
from UM.Operations.AddSceneNodeOperation import AddSceneNodeOperation
from UM.Operations.TranslateOperation import TranslateOperation
from UM.Operations.GroupedOperation import GroupedOperation
## A specialised operation designed specifically to modify the previous operat... | agpl-3.0 | Python |
e89c20e1ecfadb7e63a1fe80d821afafb8860352 | add missing import | tensorflow/tfx,tensorflow/tfx | tfx/experimental/templates/taxi/launcher/stub_component_launcher.py | tfx/experimental/templates/taxi/launcher/stub_component_launcher.py | # Lint as: python3
# Copyright 2020 Google LLC. 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 ... | # Lint as: python3
# Copyright 2020 Google LLC. 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 ... | apache-2.0 | Python |
7f4a02f7058c4e7dfd4bbb01ba847e6990b5e391 | update admin | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/apps/userreports/admin.py | corehq/apps/userreports/admin.py | from __future__ import absolute_import, unicode_literals
from django.contrib import admin
from .models import AsyncIndicator, DataSourceActionLog, InvalidUCRData
@admin.register(AsyncIndicator)
class AsyncIndicatorAdmin(admin.ModelAdmin):
model = AsyncIndicator
list_display = [
'doc_id',
'do... | from __future__ import absolute_import, unicode_literals
from django.contrib import admin
from .models import AsyncIndicator, DataSourceActionLog, InvalidUCRData
@admin.register(AsyncIndicator)
class AsyncIndicatorAdmin(admin.ModelAdmin):
model = AsyncIndicator
list_display = [
'doc_id',
'do... | bsd-3-clause | Python |
5450303c975e34265f6fda3c014b9aed7d002a3c | Fix download path, the existing one has been removed from nvidia's site (#10253) | iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack | var/spack/repos/builtin/packages/cudnn/package.py | var/spack/repos/builtin/packages/cudnn/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 Cudnn(Package):
"""NVIDIA cuDNN is a GPU-accelerated library of primitives for deep
ne... | # 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 Cudnn(Package):
"""NVIDIA cuDNN is a GPU-accelerated library of primitives for deep
ne... | lgpl-2.1 | Python |
bb042f7bd76e364c3be6791c580b9426a4007627 | fix url and add shared variant (#5358) | LLNL/spack,iulian787/spack,EmreAtes/spack,tmerrick1/spack,TheTimmy/spack,tmerrick1/spack,lgarren/spack,EmreAtes/spack,tmerrick1/spack,matthiasdiener/spack,skosukhin/spack,mfherbst/spack,krafczyk/spack,lgarren/spack,lgarren/spack,LLNL/spack,lgarren/spack,lgarren/spack,LLNL/spack,TheTimmy/spack,mfherbst/spack,iulian787/s... | var/spack/repos/builtin/packages/latte/package.py | var/spack/repos/builtin/packages/latte/package.py | ##############################################################################
# Copyright (c) 2017, Los Alamos National Security, LLC
# Produced at the Los Alamos National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
#
# For details, ... | ##############################################################################
# Copyright (c) 2017, Los Alamos National Security, LLC
# Produced at the Los Alamos National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
#
# For details, ... | lgpl-2.1 | Python |
08b5b565666d42a6802e136fc8e7cf8d355929b0 | add v2019.1 and v2020.1 (#17648) | iulian787/spack,LLNL/spack,iulian787/spack,iulian787/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,LLNL/spack,LLNL/spack | var/spack/repos/builtin/packages/qhull/package.py | var/spack/repos/builtin/packages/qhull/package.py | # Copyright 2013-2020 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 Qhull(CMakePackage):
"""Qhull computes the convex hull, Delaunay triangulation, Voronoi
... | # Copyright 2013-2020 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 Qhull(CMakePackage):
"""Qhull computes the convex hull, Delaunay triangulation, Voronoi
... | lgpl-2.1 | Python |
1f6b1d2aca3995a4ac295f7e6a8ab6bf84d6e79b | add logging for ShotDetectorPlotService | w495/python-video-shot-detector,w495/python-video-shot-detector | shot_detector/services/shot_detector_service.py | shot_detector/services/shot_detector_service.py | # -*- coding: utf8 -*-
from __future__ import absolute_import, division, print_function
import logging
from shot_detector.detectors import SimpleDetector
from .base_detector_service import BaseDetectorService
from .plot_service import PlotService
from shot_detector.utils.common import yes_no
from shot_detector.ut... | # -*- coding: utf8 -*-
from __future__ import absolute_import, division, print_function
import time
from shot_detector.detectors import SimpleDetector
from .base_detector_service import BaseDetectorService
from .plot_service import PlotService
from shot_detector.utils.common import yes_no
class ShotDetectorPlotSer... | bsd-3-clause | Python |
251e11ef777ece9542b21af1ed43fa580c2186b3 | Bump to 2.1.2 | OpenCanada/website,OpenCanada/website,OpenCanada/website,OpenCanada/website | opencanada/__init__.py | opencanada/__init__.py | from django.utils.version import get_version
VERSION = (2, 1, 2, 'final', 0)
__version__ = get_version(VERSION)
| from django.utils.version import get_version
VERSION = (2, 1, 1, 'final', 0)
__version__ = get_version(VERSION)
| mit | Python |
baa024a9e09607f8295cfe526a9eb25906aca806 | modify the filename | HengLin/PyStudyAlgorithms,HengLin/PyStudyAlgorithms | PyStudy/loadfile_speed.py | PyStudy/loadfile_speed.py | #!/usr/bin/env python
import datetime
count = 0
begin_time = datetime.datetime.now()
def readInChunks(fileObj, chunkSize=2048):
"""
Lazy function to read a file piece by piece.
Default chunk size: 2kB.
"""
while True:
data = fileObj.read(chunkSize)
if not data:
break
... | #!/usr/bin/env python
import datetime
count = 0
begin_time = datetime.datetime.now()
def readInChunks(fileObj, chunkSize=2048):
"""
Lazy function to read a file piece by piece.
Default chunk size: 2kB.
"""
while True:
data = fileObj.read(chunkSize)
if not data:
break
... | apache-2.0 | Python |
96e26b74851c0b54493f3c269ceefb6b2ae53e7d | implement fromXml toXml and defaultInit method of Resolution class | CaptainDesAstres/Simple-Blender-Render-Manager,CaptainDesAstres/Blender-Render-Manager | settingMod/Resolution.py | settingMod/Resolution.py | #!/usr/bin/python3.4
# -*-coding:Utf-8 -*
'''module to manage resolution settings'''
import xml.etree.ElementTree as xmlMod
from settingMod.Size import *
import os
class Resolution:
'''class to manage resolution settings'''
def __init__(self, xml= None):
'''initialize resolution settings with default value or ... | #!/usr/bin/python3.4
# -*-coding:Utf-8 -*
'''module to manage resolution settings'''
import xml.etree.ElementTree as xmlMod
from settingMod.Size import *
import os
class Resolution:
'''class to manage resolution settings'''
def __init__(self, xml= None):
'''initialize resolution settings with default value or ... | mit | Python |
44dcbfe606377331a40777a7b387768c816b0e61 | Increment to .2.11 for new package | cloudtools/nymms | nymms/__init__.py | nymms/__init__.py | __version__ = '0.2.11'
| __version__ = '0.2.10'
| bsd-2-clause | Python |
7095380ff71947f76ff60765e699da8e31fde944 | Build - remove dir directory - not used | molejar/project_generator,hwfwgrp/project_generator,ohagendorf/project_generator,0xc0170/project_generator,sarahmarshy/project_generator,project-generator/project_generator | project_generator/commands/build.py | project_generator/commands/build.py | # Copyright 2015 0xc0170
#
# 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, soft... | # Copyright 2015 0xc0170
#
# 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, soft... | apache-2.0 | Python |
9ec02a7cc31766d2b0d46547addddc0ca350e8ed | make pylint even more happy | juliakreutzer/bandit-neuralmonkey,bastings/neuralmonkey,bastings/neuralmonkey,ufal/neuralmonkey,ufal/neuralmonkey,ufal/neuralmonkey,bastings/neuralmonkey,juliakreutzer/bandit-neuralmonkey,juliakreutzer/bandit-neuralmonkey,ufal/neuralmonkey,bastings/neuralmonkey,ufal/neuralmonkey,juliakreutzer/bandit-neuralmonkey,juliak... | neuralmonkey/runners/perplexity_runner.py | neuralmonkey/runners/perplexity_runner.py | """
This module contains an implementation of a runner that is supposed to be
used in case we train a language model. Instead of decoding sentences in
computes its perplexities given the decoder.
"""
#tests: lint
from neuralmonkey.learning_utils import feed_dicts
#pylint: disable=too-few-public-methods
class Perplexi... | """
This module contains an implementation of a runner that is supposed to be
used in case we train a language model. Instead of decoding sentences in
computes its perplexities given the decoder.
"""
#tests: lint
from neuralmonkey.learning_utils import feed_dicts
class PerplexityRunner(object):
def __init__(self,... | bsd-3-clause | Python |
1fc9561148402c4eb558d183f4d8f3ecce0a0330 | Set version to 0.4.1 | Alignak-monitoring-contrib/alignak-backend,Alignak-monitoring-contrib/alignak-backend,Alignak-monitoring-contrib/alignak-backend,Alignak-monitoring-contrib/alignak-backend | alignak_backend/__init__.py | alignak_backend/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Alignak REST backend
"""
# Application manifest
VERSION = (0, 4, 1)
__application__ = u"Alignak_Backend"
__version__ = '.'.join((str(each) for each in VERSION[:4]))
__author__ = u"Alignak team"
__copyright__ = u"(c) 2015 - %s" % __author__
__license__ = u"GNU Affero ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Alignak REST backend
"""
# Application manifest
VERSION = (0, 4, 0)
__application__ = u"Alignak_Backend"
__version__ = '.'.join((str(each) for each in VERSION[:4]))
__author__ = u"Alignak team"
__copyright__ = u"(c) 2015 - %s" % __author__
__license__ = u"GNU Affero ... | agpl-3.0 | Python |
e77381b087acd935bc3dae1f6c2e809970506db9 | remove SECRET_KEY, again | makefu/bepasty-server,bepasty/bepasty-server,makefu/bepasty-server,bepasty/bepasty-server,makefu/bepasty-server,bepasty/bepasty-server,bepasty/bepasty-server | bepasty/config.py | bepasty/config.py | # Copyright: 2013 Bastian Blank <bastian@waldi.eu.org>
# License: BSD 2-clause, see LICENSE for details.
class Config(object):
"""This is the basic configuration class for bepasty."""
#: name of this site (put YOUR bepasty fqdn here)
SITENAME = 'bepasty.example.org'
UPLOAD_UNLOCKED = True
"""
... | # Copyright: 2013 Bastian Blank <bastian@waldi.eu.org>
# License: BSD 2-clause, see LICENSE for details.
class Config(object):
"""This is the basic configuration class for bepasty."""
#: name of this site (put YOUR bepasty fqdn here)
SITENAME = 'bepasty.example.org'
UPLOAD_UNLOCKED = True
"""
... | bsd-2-clause | Python |
b8e53ed353bf28bc1e532ae1577bf4a8b4ce976f | Add missing import | hackeriet/nfcd,hackeriet/pyhackeriet,hackeriet/pyhackeriet,hackeriet/nfcd,hackeriet/nfcd,hackeriet/pyhackeriet | hackeriet/cardreaderd/__init__.py | hackeriet/cardreaderd/__init__.py | #!/usr/bin/env python
from hackeriet import mifare
from hackeriet.mqtt import MQTT
from hackeriet.door import users
import os, logging, time
logging.basicConfig(level=logging.INFO, format='%(asctime)-15s %(message)s')
door_name = os.getenv("DOOR_NAME", 'hackeriet')
door_topic = "hackeriet/door/%s/open" % door_name
do... | #!/usr/bin/env python
from hackeriet import mifare
from hackeriet.mqtt import MQTT
from hackeriet.door import users
import os, logging
logging.basicConfig(level=logging.INFO, format='%(asctime)-15s %(message)s')
door_name = os.getenv("DOOR_NAME", 'hackeriet')
door_topic = "hackeriet/door/%s/open" % door_name
door_tim... | apache-2.0 | Python |
2e042201d6c0e0709d7056d399052389d1ea54b0 | Move imports inside initialize() method so that we don’t break things on initial setup. | RafaAguilar/django-shopify-auth,discolabs/django-shopify-auth,RafaAguilar/django-shopify-auth,funkybob/django-shopify-auth,funkybob/django-shopify-auth,discolabs/django-shopify-auth | shopify_auth/__init__.py | shopify_auth/__init__.py | VERSION = (0, 1, 6)
__version__ = '.'.join(map(str, VERSION))
__author__ = 'Gavin Ballard'
def initialize():
import shopify
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
if not settings.SHOPIFY_APP_API_KEY or not settings.SHOPIFY_APP_API_SECRET:
... | import shopify
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
VERSION = (0, 1, 5)
__version__ = '.'.join(map(str, VERSION))
__author__ = 'Gavin Ballard'
def initialize():
if not settings.SHOPIFY_APP_API_KEY or not settings.SHOPIFY_APP_API_SECRET:
raise Imp... | mit | Python |
c33b23e1d5263321cc29e2fe1f9871e36d97c5e5 | add method get on opps db redis | opps/opps,jeanmask/opps,jeanmask/opps,YACOWS/opps,jeanmask/opps,opps/opps,opps/opps,williamroot/opps,williamroot/opps,williamroot/opps,YACOWS/opps,YACOWS/opps,opps/opps,YACOWS/opps,jeanmask/opps,williamroot/opps | opps/db/_redis.py | opps/db/_redis.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from opps.db.conf import settings
from redis import ConnectionPool
from redis import Redis as RedisClient
class Redis:
def __init__(self, key_prefix, key_sufix):
self.key_prefix = key_prefix
self.key_sufix = key_sufix
self.host = settings.OPPS... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from opps.db.conf import settings
from redis import ConnectionPool
from redis import Redis as RedisClient
class Redis:
def __init__(self, key_prefix, key_sufix):
self.key_prefix = key_prefix
self.key_sufix = key_sufix
self.host = settings.OPPS... | mit | Python |
b03b168cd752d50f1091106d3f4fcc0a79b22203 | Fix tests | Siyavula/siyavula.latex2image | siyavula/latex2image/tests/latex2image_tests.py | siyavula/latex2image/tests/latex2image_tests.py | # coding=utf-8
from unittest import TestCase
from lxml import etree, html
from siyavula.latex2image.imageutils import replace_latex_with_images
class TestBaseEquationToImageConversion(TestCase):
"""Test the equation to image conversion."""
def setUp(self):
self.element_input = etree.Element('xml')
... | # coding=utf-8
from unittest import TestCase
from lxml import etree
from siyavula.latex2image.imageutils import replace_latex_with_images
class TestBaseEquationToImageConversion(TestCase):
"""Test the equation to image conversion."""
def setUp(self):
self.element_input = etree.Element('xml')
... | mit | Python |
3989abf6de879af6982a76ea3522f11f789c6569 | Increment version for speedup release | rhiever/MarkovNetwork,rhiever/MarkovNetwork | MarkovNetwork/_version.py | MarkovNetwork/_version.py | # -*- coding: utf-8 -*-
"""
Copyright 2016 Randal S. Olson
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge... | # -*- coding: utf-8 -*-
"""
Copyright 2016 Randal S. Olson
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge... | mit | Python |
0a9bd97598bc63450bcf0956242d3b67e2a52d9b | Remove testing code | sustainableis/python-sis | pysis/reqs/buildings/__init__.py | pysis/reqs/buildings/__init__.py | # -*- encoding: utf-8 -*-
from pysis.reqs.base import Request
from pysis.resources.buildings import Buildings
from pysis.resources.outputs import Outputs
from pysis.resources.blastcells import Blastcells
from pysis.resources.metrics import Metrics
class Get(Request):
uri = 'buildings/{id}'
resource = Building... | # -*- encoding: utf-8 -*-
from pysis.reqs.base import Request
from pysis.resources.buildings import Buildings
from pysis.resources.outputs import Outputs
from pysis.resources.blastcells import Blastcells
from pysis.resources.metrics import Metrics
class Get(Request):
uri = 'buildings/{id}'
resource = Building... | isc | Python |
d2ae65564c173789578c0119be7d1143d7c59641 | Fix mistaken variable name. | chbrown/pybtex,chbrown/pybtex,andreas-h/pybtex,andreas-h/pybtex | pybtex/style/formatting/__init__.py | pybtex/style/formatting/__init__.py | # Copyright (C) 2006, 2007, 2008, 2009 Andrey Golovizin
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This pr... | # Copyright (C) 2006, 2007, 2008, 2009 Andrey Golovizin
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This pr... | mit | Python |
43294bc83d013d79d909cadfcf2508aca0c575f6 | Fix for bad y param. | charanpald/APGL | exp/sandbox/predictors/profile/DecisionTreeLearnerProfile.py | exp/sandbox/predictors/profile/DecisionTreeLearnerProfile.py |
import numpy
import logging
import sys
from apgl.util.ProfileUtils import ProfileUtils
from exp.sandbox.predictors.DecisionTreeLearner import DecisionTreeLearner
from apgl.data.ExamplesGenerator import ExamplesGenerator
from sklearn.tree import DecisionTreeRegressor
logging.basicConfig(stream=sys.stdout, level=lo... |
import numpy
import logging
import sys
from apgl.util.ProfileUtils import ProfileUtils
from exp.sandbox.predictors.DecisionTreeLearner import DecisionTreeLearner
from apgl.data.ExamplesGenerator import ExamplesGenerator
from sklearn.tree import DecisionTreeRegressor
logging.basicConfig(stream=sys.stdout, level=lo... | bsd-3-clause | Python |
ca4f942656429021bc0ff9276dab70f28bc00023 | reduce to 1 iteration. | daStrauss/subsurface | src/testOptRoutine.py | src/testOptRoutine.py | '''
Created on Oct 17, 2012
@author: dstrauss
'''
import numpy as np
D = {'solverType':'projection', 'flavor':'TE', 'numRuns':1, 'expt':'testSolver'}
def getMyVars(parseNumber, D):
'''routine to return the parameters to test at the current iteration.'''
D['rho'] = 0.00001
D['xi'] = 1e-9
D[... | '''
Created on Oct 17, 2012
@author: dstrauss
'''
import numpy as np
D = {'solverType':'projection', 'flavor':'TE', 'numRuns':1, 'expt':'testSolver'}
def getMyVars(parseNumber, D):
'''routine to return the parameters to test at the current iteration.'''
D['rho'] = 0.00001
D['xi'] = 1e-9
D[... | apache-2.0 | Python |
3de3e4bf2f0df0d602c2f69dd5a06016bf31eb9d | rebuild checkpoints when something breaks while updating group exports | qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq | couchexport/groupexports.py | couchexport/groupexports.py | from couchexport.models import GroupExportConfiguration, SavedBasicExport
from couchdbkit.exceptions import ResourceNotFound
from datetime import datetime
import os
import json
from couchexport.tasks import Temp, rebuild_schemas
from couchexport.export import SchemaMismatchException
from dimagi.utils.logging import not... | from couchexport.models import GroupExportConfiguration, SavedBasicExport
from couchdbkit.exceptions import ResourceNotFound
from datetime import datetime
import os
import json
from couchexport.tasks import Temp
def export_for_group(export_id, output_dir):
try:
config = GroupExportConfiguration.get(export_... | bsd-3-clause | Python |
1746dad3e5bb218aede86cdb38e458a3f7ce270c | Update Inputkey.py | gotankgo/practice | python/inputkeyboard/Inputkey.py | python/inputkeyboard/Inputkey.py | import sys, tty, termios
class _Getch:
def __call__(self, a):
return self._get_key(a)
def _get_key(self, a):
fd = sys.stdin.fileno()
old = termios.tcgetattr(fd)
try:
tty.setraw(sys.stdin.fileno())
ch = sys.stdin.read(a)
finally:
termi... | import sys, tty, termios, time
class _Getch:
def __call__(self, a):
return self._get_key(a)
def _get_key(self, a):
fd = sys.stdin.fileno()
old = termios.tcgetattr(fd)
try:
tty.setraw(sys.stdin.fileno())
ch = sys.stdin.read(a)
finally:
... | mit | Python |
2c43cf3368742d7bb0acb91118ff07aeb1fe4183 | Fix comment typo. | ohsu-qin/qipipe | qipipe/staging/sarcoma_config.py | qipipe/staging/sarcoma_config.py | import os
from six.moves.configparser import ConfigParser as Config
from six.moves.configparser import NoOptionError
CFG_FILE = os.path.abspath(
os.path.join( os.path.dirname(__file__), '..', 'conf', 'sarcoma.cfg')
)
"""
The Sarcoma Tumor Location configuration file. This file contains
properties that associate th... | import os
from six.moves.configparser import ConfigParser as Config
from six.moves.configparser import NoOptionError
CFG_FILE = os.path.abspath(
os.path.join( os.path.dirname(__file__), '..', 'conf', 'sarcoma.cfg')
)
"""
The Sarcoma Tumor Location configuration file. This file contains
properties that associat the... | bsd-2-clause | Python |
f0e07f97fd43a0f54c8b0996944038a07e9a0e96 | Add error handling for when the meter name does not match the NEM file | aguinane/energyusage,aguinane/energyusage,aguinane/energyusage,aguinane/energyusage | metering/loader.py | metering/loader.py | """
metering.loader
~~~~~~~~~
Define the meter data models
"""
import logging
from nemreader import read_nem_file
from sqlalchemy.orm import sessionmaker
from energy_shaper import split_into_daily_intervals
from . import get_db_engine
from . import save_energy_reading
from . import refresh_daily_stats
from... | """
metering.loader
~~~~~~~~~
Define the meter data models
"""
from nemreader import read_nem_file
from sqlalchemy.orm import sessionmaker
from energy_shaper import split_into_daily_intervals
from . import get_db_engine
from . import save_energy_reading
from . import refresh_daily_stats
from . import refre... | agpl-3.0 | Python |
6a1b5003547833ffb0cddea933594c0322ad1bf2 | Add complete utils instead | frappe/frappe,vjFaLk/frappe,almeidapaulopt/frappe,StrellaGroup/frappe,yashodhank/frappe,frappe/frappe,almeidapaulopt/frappe,saurabh6790/frappe,saurabh6790/frappe,adityahase/frappe,mhbu50/frappe,mhbu50/frappe,adityahase/frappe,yashodhank/frappe,mhbu50/frappe,yashodhank/frappe,adityahase/frappe,adityahase/frappe,saurabh6... | frappe/social/doctype/energy_point_rule/energy_point_rule.py | frappe/social/doctype/energy_point_rule/energy_point_rule.py | # -*- coding: utf-8 -*-
# Copyright (c) 2018, Frappe Technologies and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
import frappe.cache_manager
from frappe.model.document import Document
from frappe.social.doctype.energy_point_... | # -*- coding: utf-8 -*-
# Copyright (c) 2018, Frappe Technologies and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
import frappe.cache_manager
from frappe.model.document import Document
from frappe.social.doctype.energy_point_... | mit | Python |
c906e675bb4c75286d98d78e4625d12a158652c7 | Update accel.py | jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi | apps/accelerometer/accel.py | apps/accelerometer/accel.py | #!/usr/bin/python
# Author : ipmstyle, https://github.com/ipmstyle
# : jeonghoonkang, https://github.com/jeonghoonkang
# for the detail of HW connection, see lcd_connect.py
import sys
from time import strftime, localtime
# beware the dir location, it should exist
sys.path.append("../lcd_berepi/lib")
sys.path.ap... | #!/usr/bin/python
# Author : ipmstyle, https://github.com/ipmstyle
# : jeonghoonkang, https://github.com/jeonghoonkang
# for the detail of HW connection, see lcd_connect.py
import sys
from time import strftime, localtime
# beware the dir location, it should exist
sys.path.append("../lcd_berepi/lib")
sys.path.ap... | bsd-2-clause | Python |
1ed14e9231d295c6db83337f7cf2b586a39dc3dc | Add timestamp to payment log list display | onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site | apps/cowry_docdata/admin.py | apps/cowry_docdata/admin.py | from babel.numbers import format_currency
from django.contrib import admin
from django.core.urlresolvers import reverse
from django.utils import translation
from .models import DocDataPaymentOrder, DocDataPayment, DocDataPaymentLogEntry
class DocDataPaymentLogEntryInine(admin.TabularInline):
model = DocDataPaymen... | from babel.numbers import format_currency
from django.contrib import admin
from django.core.urlresolvers import reverse
from django.utils import translation
from .models import DocDataPaymentOrder, DocDataPayment, DocDataPaymentLogEntry
class DocDataPaymentLogEntryInine(admin.TabularInline):
model = DocDataPaymen... | bsd-3-clause | Python |
8064be72de340fca963da2cade2b73aa969fbdbd | Add string representation for Activity model | uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged | csunplugged/activities/models.py | csunplugged/activities/models.py | from django.db import models
class Activity(models.Model):
name = models.CharField(max_length=200)
description = models.TextField()
def __str__(self):
return self.name
| from django.db import models
class Activity(models.Model):
name = models.CharField(max_length=200)
description = models.TextField()
| mit | Python |
dd4e62667da94469a8bbb6dd0ccd881124e7665f | Fix return value of terraform.render | elifesciences/builder,elifesciences/builder | src/buildercore/terraform.py | src/buildercore/terraform.py | import json
from buildercore.utils import ensure
RESOURCE_TYPE_FASTLY = 'fastly_service_v1'
RESOURCE_NAME_FASTLY = 'fastly-cdn'
def render(context):
if not context['fastly']:
return '{}'
ensure(len(context['fastly']['subdomains']) == 1, "Only 1 subdomain for Fastly CDNs is supported")
tf_file = ... | import json
from buildercore.utils import ensure
RESOURCE_TYPE_FASTLY = 'fastly_service_v1'
RESOURCE_NAME_FASTLY = 'fastly-cdn'
def render(context):
if not context['fastly']:
return None
ensure(len(context['fastly']['subdomains']) == 1, "Only 1 subdomain for Fastly CDNs is supported")
tf_file = ... | mit | Python |
a98e536334eb3d3376efe93c1bdc639ecdc4a2a0 | remove unused code | approvals/ApprovalTests.Python,approvals/ApprovalTests.Python,tdpreece/ApprovalTests.Python,approvals/ApprovalTests.Python | approvaltests/reporters/generic_diff_reporter_factory.py | approvaltests/reporters/generic_diff_reporter_factory.py | import json
from approvaltests.reporters.generic_diff_reporter import GenericDiffReporter
from approvaltests.utils import get_adjacent_file
class GenericDiffReporterFactory(object):
reporters = []
def __init__(self):
self.load(get_adjacent_file('reporters.json'))
self.add_fallback_reporter_c... | import json
from approvaltests.reporters.generic_diff_reporter import GenericDiffReporter
from approvaltests.utils import get_adjacent_file
class GenericDiffReporterFactory(object):
reporters = []
def __init__(self):
self.load(get_adjacent_file('reporters.json'))
self.add_fallback_reporter_c... | apache-2.0 | Python |
ae2981b26fce2641a9bae5af68a3d5043fdd8b46 | Fix disapear exception message (#31) | arnaudmorin/python-ovh,arnaudmorin/python-ovh | ovh/exceptions.py | ovh/exceptions.py | # -*- encoding: utf-8 -*-
#
# Copyright (c) 2013-2016, OVH SAS.
# 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, t... | # -*- encoding: utf-8 -*-
#
# Copyright (c) 2013-2016, OVH SAS.
# 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, t... | bsd-3-clause | Python |
63f6637228153b1f77ca860c297ff3554d802ce9 | Fix order history sorting logic, #sort() should be called before #reverse(). | supistar/OandaOrderbook,supistar/OandaOrderbook,supistar/OandaOrderbook | model/orderbook.py | model/orderbook.py | # -*- encoding:utf8 -*-
import os
from model.oandapy import oandapy
class OrderBook(object):
def get_latest_orderbook(self, instrument, period, history):
oanda_token = os.environ.get('OANDA_TOKEN')
oanda = oandapy.API(environment="practice", access_token=oanda_token)
orders = oanda.get_o... | # -*- encoding:utf8 -*-
import os
from model.oandapy import oandapy
class OrderBook(object):
def get_latest_orderbook(self, instrument, period, history):
oanda_token = os.environ.get('OANDA_TOKEN')
oanda = oandapy.API(environment="practice", access_token=oanda_token)
orders = oanda.get_o... | mit | Python |
6741c59d726f1ceaf6edba82b6e97f501fc265ee | fix zero shape bug! | yassersouri/omgh,yassersouri/omgh | src/scripts/make_parts_dataset.py | src/scripts/make_parts_dataset.py | import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
import settings
sys.path.append(settings.CAFFE_PYTHON_PATH)
import skimage.io
import caffe
import numpy as np
import click
from glob import glob
import utils
from dataset import CUB_200_2011
from parts import Parts
@click.command()
@cli... | import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
import settings
sys.path.append(settings.CAFFE_PYTHON_PATH)
import skimage.io
import caffe
import numpy as np
import click
from glob import glob
import utils
from dataset import CUB_200_2011
from parts import Parts
@click.command()
@cli... | mit | Python |
48cd6af0e138dd28b18ca3a71f41976c71483445 | Add --forceuninstall option | boltomli/MyMacScripts,boltomli/MyMacScripts | Python/brewcaskupgrade.py | Python/brewcaskupgrade.py | #! /usr/bin/env python3
# -*- coding: utf8 -*-
import argparse
import shutil
from subprocess import check_output, run
parser = argparse.ArgumentParser(description='Update every entries found in cask folder.')
parser.add_argument('--pretend', dest='pretend', action='store_true',
help='Pretend to t... | #! /usr/bin/env python3
# -*- coding: utf8 -*-
import argparse
import shutil
from subprocess import check_output, run
parser = argparse.ArgumentParser(description='Update every entries found in cask folder.')
parser.add_argument('--pretend', dest='pretend', action='store_true',
help='Pretend to t... | cc0-1.0 | Python |
a4bc6c0c4d13629dbdfef30edcba262efce0eaff | fix up config for heroku | Jaza/colorsearchtest,Jaza/colorsearchtest,Jaza/colorsearchtest | colorsearchtest/settings.py | colorsearchtest/settings.py | # -*- coding: utf-8 -*-
import os
os_env = os.environ
class Config(object):
SECRET_KEY = os_env.get('COLORSEARCHTEST_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))
SQLALC... | # -*- coding: utf-8 -*-
import os
os_env = os.environ
class Config(object):
SECRET_KEY = os_env.get('COLORSEARCHTEST_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))
SQLALC... | apache-2.0 | Python |
f20eb91dcf04bc8e33fbb48ebfbef1b56acbf02d | Make functions that pull a number of tweets and pics | samanehsan/spark_github,samanehsan/spark_github,samanehsan/learn-git,samanehsan/learn-git | web.py | web.py | """ Heroku/Python Quickstart: https://blog.heroku.com/archives/2011/9/28/python_and_django"""
import os
import random
import requests
from flask import Flask
import tweepy
import settings
app = Flask(__name__)
@app.route('/')
def home_page():
return 'Hello from the SPARK learn-a-thon!'
def get_instagram_im... | """ Heroku/Python Quickstart: https://blog.heroku.com/archives/2011/9/28/python_and_django"""
import os
from flask import Flask
app = Flask(__name__)
@app.route('/')
def home_page():
return 'Hello from the SPARK learn-a-thon!'
if __name__ == '__main__':
port = int(os.environ.get("PORT", 5000))
app.run(h... | apache-2.0 | Python |
0d58c2ffc8ec6afc353a242f942f668b0b7f362c | Correct shipping repository method calls | enodyt/django-oscar-paypal,evonove/django-oscar-paypal,bharling/django-oscar-worldpay,FedeDR/django-oscar-paypal,nfletton/django-oscar-paypal,django-oscar/django-oscar-paypal,vintasoftware/django-oscar-paypal,bharling/django-oscar-worldpay,enodyt/django-oscar-paypal,embedded1/django-oscar-paypal,ZachGoldberg/django-osc... | sandbox/apps/shipping/repository.py | sandbox/apps/shipping/repository.py | from decimal import Decimal as D
from oscar.apps.shipping.methods import Free, FixedPrice
from oscar.apps.shipping.repository import Repository as CoreRepository
class Repository(CoreRepository):
"""
This class is included so that there is a choice of shipping methods.
Oscar's default behaviour is to onl... | from decimal import Decimal as D
from oscar.apps.shipping.methods import Free, FixedPrice
from oscar.apps.shipping.repository import Repository as CoreRepository
class Repository(CoreRepository):
"""
This class is included so that there is a choice of shipping methods.
Oscar's default behaviour is to onl... | bsd-3-clause | Python |
edec18a82d6027c8a011fbef84c8aa3b80e18826 | Update forward_device1.py | VitorHugoAguiar/ProBot,VitorHugoAguiar/ProBot,VitorHugoAguiar/ProBot,VitorHugoAguiar/ProBot | Server/forward_device1.py | Server/forward_device1.py | import zmq
def main():
print "\nServer for ProBot is running..."
try:
context = zmq.Context(1)
# Socket facing clients
frontend = context.socket(zmq.SUB)
frontend.bind("tcp://*:5559")
frontend.setsockopt(zmq.SUBSCRIBE, "")
# Socket facing services
backen... | import zmq
def main():
print "\nServer for ProBot is running..."
try:
context = zmq.Context(1)
# Socket facing clients
frontend = context.socket(zmq.SUB)
frontend.bind("tcp://*:5559")
frontend.setsockopt(zmq.SUBSCRIBE, "")
# Socket facing services
backe... | agpl-3.0 | Python |
2100b512ffb188374e1d883cd2f359586182596b | ADD migration name | OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft | packages/grid/backend/alembic/versions/2021-09-20_916812f40fb4.py | packages/grid/backend/alembic/versions/2021-09-20_916812f40fb4.py | """ADD daa_document column at setup table
Revision ID: 916812f40fb4
Revises: 5796f6ceb314
Create Date: 2021-09-20 01:07:37.239186
"""
# third party
from alembic import op # type: ignore
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "916812f40fb4"
down_revision = "5796f6ceb314"
branch_l... | """empty message
Revision ID: 916812f40fb4
Revises: 5796f6ceb314
Create Date: 2021-09-20 01:07:37.239186
"""
# third party
from alembic import op # type: ignore
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "916812f40fb4"
down_revision = "5796f6ceb314"
branch_labels = None
depends_on =... | apache-2.0 | Python |
80ede493f698395176d3c67dd1e4f3723b0d5859 | Add initial pass at writing the git commit hook | EliRibble/mothermayi | mothermayi/hook.py | mothermayi/hook.py | import logging
import os
LOGGER = logging.getLogger(__name__)
class NoRepoFoundError(Exception):
pass
class PreCommitExists(Exception):
pass
def find_git_repo():
location = os.path.abspath('.')
while location != '/':
check = os.path.join(location, '.git')
if os.path.exists(check) and... | import logging
import os
LOGGER = logging.getLogger(__name__)
class NoRepoFoundError(Exception):
pass
def find_git_repo():
location = os.path.abspath('.')
while location != '/':
check = os.path.join(location, '.git')
if os.path.exists(check) and os.path.isdir(check):
return ch... | mit | Python |
5d5f73ac411873c0ec82e233b74ce70f4de4ab03 | Optimize migration process | openprocurement/openprocurement.planning.api | openprocurement/planning/api/migration.py | openprocurement/planning/api/migration.py | # -*- coding: utf-8 -*-
import logging
from openprocurement.planning.api.traversal import Root
from openprocurement.planning.api.models import Plan
LOGGER = logging.getLogger(__name__)
SCHEMA_VERSION = 1
SCHEMA_DOC = 'openprocurement_plans_schema'
def get_db_schema_version(db):
schema_doc = db.get(SCHEMA_DOC, {"... | # -*- coding: utf-8 -*-
import logging
from openprocurement.planning.api.traversal import Root
from openprocurement.planning.api.models import Plan
LOGGER = logging.getLogger(__name__)
SCHEMA_VERSION = 1
SCHEMA_DOC = 'openprocurement_plans_schema'
def get_db_schema_version(db):
schema_doc = db.get(SCHEMA_DOC, {"... | apache-2.0 | Python |
d0a9d10d0df25de670e8bf9a1e603ed1fbe5ca29 | use helpers | alexoneill/py3status,valdur55/py3status,Andrwe/py3status,ultrabug/py3status,docwalter/py3status,tobes/py3status,tobes/py3status,valdur55/py3status,vvoland/py3status,ultrabug/py3status,guiniol/py3status,guiniol/py3status,ultrabug/py3status,valdur55/py3status,Andrwe/py3status | py3status/modules/taskwarrior.py | py3status/modules/taskwarrior.py | # -*- coding: utf-8 -*-
"""
Display tasks currently running in taskwarrior.
Configuration parameters:
cache_timeout: refresh interval for this module (default 5)
format: display format for this module (default '{task}')
Format placeholders:
{task} active tasks
Requires
task: https://taskwarrior.org/d... | # -*- coding: utf-8 -*-
"""
Display tasks currently running in taskwarrior.
Configuration parameters:
cache_timeout: how often we refresh this module in seconds (default 5)
format: display format for taskwarrior (default '{task}')
Format placeholders:
{task} active tasks
Requires
task: https://taskwa... | bsd-3-clause | Python |
c9b7e886f9276079fc79fbe394f5b15595f04603 | Test fixes | danjac/ownblock,danjac/ownblock,danjac/ownblock | ownblock/ownblock/apps/messaging/tests.py | ownblock/ownblock/apps/messaging/tests.py | from unittest.mock import Mock
from django.test import TestCase
from rest_framework import serializers
from apps.accounts.tests import ResidentFactory
from apps.buildings.tests import ApartmentFactory
from .serializers import MessageSerializer
class SerializerTests(TestCase):
def test_validate_recipient_if_s... | from unittest.mock import Mock
from django.test import TestCase
from rest_framework import serializers
from apps.accounts.tests import ResidentFactory
from apps.buildings.tests import ApartmentFactory
from .serializers import MessageSerializer
class SerializerTests(TestCase):
def test_validate_recipient_if_s... | mit | Python |
5e9eda407832d9b97e7f78219f20236e04306a32 | fix test, probably broken by a epydoc change this code is dead though so i don't much care | chevah/pydoctor,chevah/pydoctor,hawkowl/pydoctor,hawkowl/pydoctor,jelmer/pydoctor,jelmer/pydoctor,jelmer/pydoctor | pydoctor/test/test_formatting.py | pydoctor/test/test_formatting.py | from pydoctor import html, model
from py import test
def test_signatures():
argspec = [['a', 'b', 'c'], None, None, (1,2)]
assert html.getBetterThanArgspec(argspec) == (['a'], [('b', 1), ('c', 2)])
def test_strsig():
argspec = [['a', 'b', 'c'], None, None, (1,2)]
assert html.signature(argspec) == "a, ... | from pydoctor import html, model
from py import test
def test_signatures():
argspec = [['a', 'b', 'c'], None, None, (1,2)]
assert html.getBetterThanArgspec(argspec) == (['a'], [('b', 1), ('c', 2)])
def test_strsig():
argspec = [['a', 'b', 'c'], None, None, (1,2)]
assert html.signature(argspec) == "a, ... | isc | Python |
d9189f91370abd1e20e5010bb70d9c47efd58215 | Change read_chrom_sizes to read from a FAIDX index if available | NIEHS/muver | muver/reference.py | muver/reference.py | import os
from wrappers import bowtie2, picard, samtools
def create_reference_indices(ref_fn):
'''
For a given reference FASTA file, generate several indices.
'''
bowtie2.build(ref_fn)
samtools.faidx_index(ref_fn)
picard.create_sequence_dictionary(ref_fn)
def read_chrom_sizes(... | from wrappers import bowtie2, picard, samtools
def create_reference_indices(ref_fn):
'''
For a given reference FASTA file, generate several indices.
'''
bowtie2.build(ref_fn)
samtools.faidx_index(ref_fn)
picard.create_sequence_dictionary(ref_fn)
def read_chrom_sizes(reference_ass... | mit | Python |
8e1610570a50282594a5516ee473cf13bec2ce71 | fix typo | cmu-db/db-webcrawler,cmu-db/db-webcrawler,cmu-db/cmdbac,cmu-db/cmdbac,cmu-db/cmdbac,cmu-db/cmdbac,cmu-db/db-webcrawler,cmu-db/cmdbac,cmu-db/db-webcrawler,cmu-db/db-webcrawler | core/drivers/count/count.py | core/drivers/count/count.py | keywords = ['SELECT', 'INSERT', 'UPDATE', 'DELETE']
def count_query(queries):
ret = {}
for keyword in keywords:
ret[keyword] = 0
for query in queries:
for keyword in keywords:
if query.startswith(keyword):
ret[keyword] += 1
break
return ret | keywords = ['SET', 'INSERT', 'UPDATE', 'DELETE']
def count_query(queries):
ret = {}
for keyword in keywords:
ret[keyword] = 0
for query in queries:
for keyword in keywords:
if query.startswith(keyword):
ret[keyword] += 1
break
return ret | apache-2.0 | Python |
4657acf6408b2fb416e2c9577ac09d18d81f8a68 | Remove unused NHS database mockup | jawrainey/sris | nameless/config.py | nameless/config.py | import os
_basedir = os.path.abspath(os.path.dirname(__file__))
# Plugin settings
DATABASE_NAMES = ['atc', 'sms']
# Using sqlite for local development, will be SQL on production.
SQLALCHEMY_BINDS = {
'atc': 'sqlite:///' + os.path.join(_basedir, 'db/atc.db'),
'sms': 'sqlite:///' + os.path.join(_basedir, 'db/sms.... | import os
_basedir = os.path.abspath(os.path.dirname(__file__))
# Plugin settings
DATABASE_NAMES = ['atc', 'nhs', 'sms']
# Using sqlite for local development, will be SQL on production.
SQLALCHEMY_BINDS = {
'atc': 'sqlite:///' + os.path.join(_basedir, 'db/atc.db'),
'nhs': 'sqlite:///' + os.path.join(_basedir, '... | mit | Python |
10801bca03c03d6b6bb7b6108733178dcf5a8b53 | Revert 87dbc5eb9665b5a145a3c2a190f64e2ce4c09fd4^..HEAD | mlabsnl/zengarden,mlabsnl/zengarden,mlabsnl/zengarden | shop/views.py | shop/views.py | from django.http import HttpResponse, Http404, HttpResponseRedirect
from django.views.generic.simple import direct_to_template
from shop.forms import OrderForm
from shop.models import EmailEntry, Order
from datetime import datetime
import urllib
from xml.dom import minidom
def index(request):
print request.META['H... | from django.http import HttpResponse, Http404, HttpResponseRedirect
from django.views.generic.simple import direct_to_template
from shop.forms import OrderForm
from shop.models import EmailEntry, Order
from datetime import datetime
import urllib
from xml.dom import minidom
def index(request):
print request.META['H... | apache-2.0 | Python |
c81f4d0659366e1512a4b64f0cce65d50de25927 | update to 3.29.0 | DeadSix27/python_cross_compile_script | packages/dependencies/sqlite3.py | packages/dependencies/sqlite3.py | {
'repo_type' : 'archive',
'custom_cflag' : '-O2', # make sure we build it without -ffast-math
'download_locations' : [
{ 'url' : 'https://www.sqlite.org/2019/sqlite-autoconf-3290000.tar.gz', 'hashes' : [ { 'type' : 'sha256', 'sum' : '8e7c1e2950b5b04c5944a981cb31fffbf9d2ddda939d536838ebc854481afd5b' }, ], },
{ '... | {
'repo_type' : 'archive',
'custom_cflag' : '-O2', # make sure we build it without -ffast-math
'download_locations' : [
{ 'url' : 'https://www.sqlite.org/2019/sqlite-autoconf-3280000.tar.gz', 'hashes' : [ { 'type' : 'sha256', 'sum' : 'd61b5286f062adfce5125eaf544d495300656908e61fca143517afcc0a89b7c3' }, ], },
{ '... | mpl-2.0 | Python |
0fee973ea7a4ca7b79c84ed55fa1d327c754beee | Add tests and some fixes for class extension pattern | pombredanne/readthedocs.org,pombredanne/readthedocs.org,safwanrahman/readthedocs.org,tddv/readthedocs.org,tddv/readthedocs.org,pombredanne/readthedocs.org,davidfischer/readthedocs.org,davidfischer/readthedocs.org,safwanrahman/readthedocs.org,tddv/readthedocs.org,rtfd/readthedocs.org,davidfischer/readthedocs.org,rtfd/re... | readthedocs/core/utils/extend.py | readthedocs/core/utils/extend.py | """Patterns for extending Read the Docs"""
import inspect
from django.conf import settings
from django.utils.module_loading import import_by_path
from django.utils.functional import LazyObject
class SettingsOverrideObject(LazyObject):
"""Base class for creating class that can be overridden
This is used fo... | """Patterns for extending Read the Docs"""
from django.conf import settings
from django.utils.module_loading import import_by_path
from django.utils.functional import LazyObject
class SettingsOverrideObject(LazyObject):
"""Base class for creating class that can be overridden
This is used for extension poin... | mit | Python |
f1e071957214e787521c7de887ca1fe369671bc7 | Add constants | lakewik/storj-gui-client | UI/resources/constants.py | UI/resources/constants.py | # -*- coding: utf-8 -*-
SAVE_PASSWORD_HASHED = True
MAX_RETRIES_DOWNLOAD_FROM_SAME_FARMER = 3
MAX_RETRIES_UPLOAD_TO_SAME_FARMER = 3
MAX_RETRIES_NEGOTIATE_CONTRACT = 1000
MAX_RETRIES_GET_FILE_POINTERS = 100
GET_DEFAULT_TMP_PATH_FROM_ENV_VARIABLES = True
GET_HOME_PATH_FROM_ENV_VARIABLES = True
FILE_POINTERS_REQUEST_DE... | # -*- coding: utf-8 -*-
SAVE_PASSWORD_HASHED = True
MAX_RETRIES_DOWNLOAD_FROM_SAME_FARMER = 3
MAX_RETRIES_UPLOAD_TO_SAME_FARMER = 3
MAX_RETRIES_NEGOTIATE_CONTRACT = 1000
MAX_RETRIES_GET_FILE_POINTERS = 100
GET_DEFAULT_TMP_PATH_FROM_ENV_VARIABLES = True
GET_HOME_PATH_FROM_ENV_VARIABLES = True
FILE_POINTERS_REQUEST_DE... | mit | Python |
f2a0bbee61a144bf0d1de77dd4b41393fe7428bf | fix Ntests in simuNtests | plguhur/random-sets | simuNtests.py | simuNtests.py | # lance simulations pour different nombre d'electeurs
import multiprocessing
import os, sys
import shutil
import time
import numpy as np
from randomSets import *
def worker(((Ncandidats,q, Nwinners))):
"""worker function"""
sys.stdout.write('\nSTART -- %i candidats -- \n' % Ncandidats)
sys.stdout.flush()
... | # lance simulations pour different nombre d'electeurs
import multiprocessing
import os, sys
import shutil
import time
import numpy as np
from randomSets import *
def worker(((Ncandidats,q, Nwinners))):
"""worker function"""
sys.stdout.write('\nSTART -- %i candidats -- \n' % Ncandidats)
sys.stdout.flush()
... | apache-2.0 | Python |
3bf9ab0da4b06b8b0383fb6db64947886742899c | Add newline in log of builds after successful rebuild of website. | chebee7i/dit,Autoplectic/dit,dit/dit,dit/dit,Autoplectic/dit,Autoplectic/dit,dit/dit,Autoplectic/dit,chebee7i/dit,Autoplectic/dit,dit/dit,chebee7i/dit,chebee7i/dit,dit/dit | site/build.py | site/build.py | #!/usr/bin/env python
# -*- coding: ascii -*-
"""
This script can be used to build the website.
It is also run on each commit to github.
Example: ./build public_html
"""
from __future__ import print_function
import datetime
import os
import shutil
import subprocess
import sys
import time
BUILD_DIR = 'build'
de... | #!/usr/bin/env python
# -*- coding: ascii -*-
"""
This script can be used to build the website.
It is also run on each commit to github.
Example: ./build public_html
"""
import datetime
import os
import shutil
import subprocess
import sys
import time
BUILD_DIR = 'build'
def get_build_dir():
try:
bui... | bsd-3-clause | Python |
798f80c3efe06869194adf7073af574cc94481b9 | add to init | tamasgal/km3pipe,tamasgal/km3pipe | km3modules/__init__.py | km3modules/__init__.py | # coding=utf-8
# Filename: __init__.py
# pylint: disable=locally-disabled
"""
A collection of commonly used modules.
"""
from km3modules.common import (Dump, Delete, HitCounter, BlobIndexer, Keep,
StatusBar, MemoryObserver, Wrap, Cut)
from km3modules.reco import SvdFit as PrimFit
from km... | # coding=utf-8
# Filename: __init__.py
# pylint: disable=locally-disabled
"""
A collection of commonly used modules.
"""
from km3modules.common import (Dump, Delete, HitCounter, BlobIndexer, Keep,
StatusBar, MemoryObserver, Wrap)
from km3modules.reco import SvdFit as PrimFit
from km3modu... | mit | Python |
e5ed0e4e6dea58a1412e3c596612e647bd22c619 | Update __init__.py | bittracker/krempelair,bittracker/krempelair,KrempelEv/krempelair,bittracker/krempelair,KrempelEv/krempelair,KrempelEv/krempelair | krempelair/__init__.py | krempelair/__init__.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import jinja2
import flask
import views
class Krempelair(flask.Flask):
jinja_options = {
'extensions': ['jinja2.ext.autoescape'],
'undefined': jinja2.StrictUndefined
}
def __init__(self):
"""(See `make_app` for parameter descripti... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import jinja2
import flask
import views
class Krempelair(flask.Flask):
jinja_options = {
'extensions': ['jinja2.ext.autoescape'],
'undefined': jinja2.StrictUndefined
}
def __init__(self):
"""(See `make_app` for parameter descripti... | agpl-3.0 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.