commit stringlengths 40 40 | old_file stringlengths 5 117 | new_file stringlengths 5 117 | old_contents stringlengths 0 1.93k | new_contents stringlengths 19 3.3k | subject stringlengths 17 320 | message stringlengths 18 3.28k | lang stringclasses 1
value | license stringclasses 13
values | repos stringlengths 7 42.4k | completion stringlengths 19 3.3k | prompt stringlengths 21 3.65k |
|---|---|---|---|---|---|---|---|---|---|---|---|
80f35ad0d3a6a1f04eb0339bb1088ebe6eb27af5 | mongomock/results.py | mongomock/results.py | try:
from pymongo.results import InsertOneResult
from pymongo.results import InsertManyResult
from pymongo.results import UpdateResult
from pymongo.results import DeleteResult
except ImportError:
class _WriteResult(object):
def __init__(self, acknowledged=True):
self.__acknowled... | Add result classes for update/insert/delete ops | Add result classes for update/insert/delete ops
| Python | bsd-3-clause | vmalloc/mongomock,marcinbarczynski/mongomock,mdomke/mongomock,drorasaf/mongomock,magaman384/mongomock,StarfishStorage/mongomock,julianhille/mongomock | try:
from pymongo.results import InsertOneResult
from pymongo.results import InsertManyResult
from pymongo.results import UpdateResult
from pymongo.results import DeleteResult
except ImportError:
class _WriteResult(object):
def __init__(self, acknowledged=True):
self.__acknowled... | Add result classes for update/insert/delete ops
| |
aab9efbcec0bbded807bf207e2324266573fa3a6 | tensorflow/python/tf2.py | tensorflow/python/tf2.py | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Remove the redundant `else` condition. | Remove the redundant `else` condition.
PiperOrigin-RevId: 302901741
Change-Id: I65281a07fc2789fbc13775c1365fd01789a1bb7e
| Python | apache-2.0 | petewarden/tensorflow,yongtang/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,cxxgtxy/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,yongtang/tensorflow,petewarden/tensorflow,paolodedios/tensorflow,aldian/tensorflow,yongtang/tensorflow,davidzchen/tensorflow,tensorflow/tensorflow-experime... | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Remove the redundant `else` condition.
PiperOrigin-RevId: 302901741
Change-Id: I65281a07fc2789fbc13775c1365fd01789a1bb7e
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
... |
ac111399e390a5f62b35467b9cf5b9af613317b2 | setup.py | setup.py | from setuptools import setup
from setuptools import find_packages
setup(name='DSPP-Keras',
version='0.0.3',
description='Integration of DSPP database with Keral Machine Learning Library',
author='Jan Domanski',
author_email='jan@peptone.io',
url='https://github.com/PeptoneInc/dspp-keras',... | from setuptools import setup
from setuptools import find_packages
setup(name='DSPP-Keras',
version='0.0.3',
description='Integration of Database of structural propensities of proteins (dSPP) with Keras Machine Learning Library',
author='Jan Domanski',
author_email='jan@peptone.io',
url='h... | Change title and fix spelling for pip package | Change title and fix spelling for pip package
| Python | agpl-3.0 | PeptoneInc/dspp-keras | from setuptools import setup
from setuptools import find_packages
setup(name='DSPP-Keras',
version='0.0.3',
description='Integration of Database of structural propensities of proteins (dSPP) with Keras Machine Learning Library',
author='Jan Domanski',
author_email='jan@peptone.io',
url='h... | Change title and fix spelling for pip package
from setuptools import setup
from setuptools import find_packages
setup(name='DSPP-Keras',
version='0.0.3',
description='Integration of DSPP database with Keral Machine Learning Library',
author='Jan Domanski',
author_email='jan@peptone.io',
... |
f58a9c6aff57ccd157d8734b6d89411fc29da706 | src/poliastro/tests/test_patched_conics.py | src/poliastro/tests/test_patched_conics.py | # coding: utf-8
from astropy import units as u
from astropy.tests.helper import assert_quantity_allclose
from poliastro.bodies import Sun, Mercury, Venus, Earth, Moon, Mars
from poliastro.bodies import Jupiter, Saturn, Uranus, Neptune, Pluto
from poliastro.patched_conics import compute_soi
def test_compute_soi():
... | Add test to r_SOI computation | Add test to r_SOI computation
| Python | mit | Juanlu001/poliastro,newlawrence/poliastro,poliastro/poliastro,newlawrence/poliastro,anhiga/poliastro,anhiga/poliastro,Juanlu001/poliastro,anhiga/poliastro,Juanlu001/poliastro,newlawrence/poliastro | # coding: utf-8
from astropy import units as u
from astropy.tests.helper import assert_quantity_allclose
from poliastro.bodies import Sun, Mercury, Venus, Earth, Moon, Mars
from poliastro.bodies import Jupiter, Saturn, Uranus, Neptune, Pluto
from poliastro.patched_conics import compute_soi
def test_compute_soi():
... | Add test to r_SOI computation
| |
73e3cee19d0330154f36157b762cd1a69e055b19 | setup.py | setup.py | from setuptools import setup, find_packages
with open('README.rst') as f:
readme = f.read()
with open('LICENSE') as f:
license = f.read()
setup(
name='pycc',
version='0.0.1',
url='https://github.com/kevinconway/pycc',
license=license,
description='Python code optimizer..',
author='Ke... | from setuptools import setup, find_packages
with open('README.rst') as f:
readme = f.read()
with open('LICENSE') as f:
license = f.read()
setup(
name='pycc',
version='0.0.1',
url='https://github.com/kevinconway/pycc',
license=license,
description='Python code optimizer..',
author='Ke... | Add package dependencies for printing and testing | Add package dependencies for printing and testing
Signed-off-by: Kevin Conway <3473c1f185ca03eadc40ad288d84425b54fd7d57@gmail.com>
| Python | apache-2.0 | kevinconway/pycc,kevinconway/pycc | from setuptools import setup, find_packages
with open('README.rst') as f:
readme = f.read()
with open('LICENSE') as f:
license = f.read()
setup(
name='pycc',
version='0.0.1',
url='https://github.com/kevinconway/pycc',
license=license,
description='Python code optimizer..',
author='Ke... | Add package dependencies for printing and testing
Signed-off-by: Kevin Conway <3473c1f185ca03eadc40ad288d84425b54fd7d57@gmail.com>
from setuptools import setup, find_packages
with open('README.rst') as f:
readme = f.read()
with open('LICENSE') as f:
license = f.read()
setup(
name='pycc',
version='... |
e946f239695f74d83fcb1b4929ed2281846add4c | avalon/fusion/pipeline.py | avalon/fusion/pipeline.py |
def imprint_container(tool,
name,
namespace,
context,
loader=None):
"""Imprint a Loader with metadata
Containerisation enables a tracking of version, author and origin
for loaded assets.
Arguments:
tool (... |
def imprint_container(tool,
name,
namespace,
context,
loader=None):
"""Imprint a Loader with metadata
Containerisation enables a tracking of version, author and origin
for loaded assets.
Arguments:
tool (... | Store tool's name when parsing container | Store tool's name when parsing container
| Python | mit | MoonShineVFX/core,MoonShineVFX/core,getavalon/core,getavalon/core,mindbender-studio/core,mindbender-studio/core |
def imprint_container(tool,
name,
namespace,
context,
loader=None):
"""Imprint a Loader with metadata
Containerisation enables a tracking of version, author and origin
for loaded assets.
Arguments:
tool (... | Store tool's name when parsing container
def imprint_container(tool,
name,
namespace,
context,
loader=None):
"""Imprint a Loader with metadata
Containerisation enables a tracking of version, author and origin
for loa... |
ccf285c30a0110f2ff59b91ec0166f9b5306239d | dukpy/evaljs.py | dukpy/evaljs.py | import json
from . import _dukpy
try:
from collections.abc import Iterable
except ImportError:
from collections import Iterable
try: # pragma: no cover
unicode
string_types = (str, unicode)
except NameError: # pragma: no cover
string_types = (bytes, str)
class JSInterpreter(object):
"""Jav... | import json
from . import _dukpy
try:
from collections.abc import Iterable
except ImportError:
from collections import Iterable
try: # pragma: no cover
unicode
string_types = (str, unicode)
jscode_type = str
except NameError: # pragma: no cover
string_types = (bytes, str)
jscode_type = s... | Fix unicode source code on py3 | Fix unicode source code on py3
| Python | mit | amol-/dukpy,amol-/dukpy,amol-/dukpy | import json
from . import _dukpy
try:
from collections.abc import Iterable
except ImportError:
from collections import Iterable
try: # pragma: no cover
unicode
string_types = (str, unicode)
jscode_type = str
except NameError: # pragma: no cover
string_types = (bytes, str)
jscode_type = s... | Fix unicode source code on py3
import json
from . import _dukpy
try:
from collections.abc import Iterable
except ImportError:
from collections import Iterable
try: # pragma: no cover
unicode
string_types = (str, unicode)
except NameError: # pragma: no cover
string_types = (bytes, str)
class J... |
101de91508d918b90c6254dc0b1cc5e0744bbd71 | setup.py | setup.py | from setuptools import setup
import sys
setup(
# Basic package information.
name = 'zdesk',
author = 'Brent Woodruff',
version = '2.4.0',
author_email = 'brent@fprimex.com',
packages = ['zdesk'],
include_package_data = True,
install_requires = ['requests'],
license='LICENSE.txt',
... | from setuptools import setup
import sys
setup(
# Basic package information.
name = 'zdesk',
author = 'Brent Woodruff',
version = '2.3.0',
author_email = 'brent@fprimex.com',
packages = ['zdesk'],
include_package_data = True,
install_requires = ['requests'],
license='LICENSE.txt',
... | Revert "bump version for impending release" | Revert "bump version for impending release"
This reverts commit c9c46f1bd4593cd1b13df404b2dba89c75c4f1ec.
| Python | mit | fprimex/zdesk,blade2005/zdesk,fprimex/zdgen | from setuptools import setup
import sys
setup(
# Basic package information.
name = 'zdesk',
author = 'Brent Woodruff',
version = '2.3.0',
author_email = 'brent@fprimex.com',
packages = ['zdesk'],
include_package_data = True,
install_requires = ['requests'],
license='LICENSE.txt',
... | Revert "bump version for impending release"
This reverts commit c9c46f1bd4593cd1b13df404b2dba89c75c4f1ec.
from setuptools import setup
import sys
setup(
# Basic package information.
name = 'zdesk',
author = 'Brent Woodruff',
version = '2.4.0',
author_email = 'brent@fprimex.com',
packages = ['... |
8552542f6e23f886bae467f96e847b00327fa164 | scripts/ci/guideline_check.py | scripts/ci/guideline_check.py | #!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2021 Intel Corporation
import os
import sh
import argparse
import re
from unidiff import PatchSet
if "ZEPHYR_BASE" not in os.environ:
exit("$ZEPHYR_BASE environment variable undefined.")
repository_path = os.environ['ZEPHYR_BASE']
sh_s... | Apply coccinelle scripts in git diffs | ci: Apply coccinelle scripts in git diffs
This scripts receives the same parameter of what_changed.py. And run
coccinelle scripts for code guideline compliance in the given git
commits. e.g: ./guideline_check.py --commits origin/master..HEAD
Signed-off-by: Flavio Ceolin <979b9165500b0741b9d0500e2efd74fc1547bff7@intel... | Python | apache-2.0 | zephyrproject-rtos/zephyr,finikorg/zephyr,zephyrproject-rtos/zephyr,nashif/zephyr,nashif/zephyr,galak/zephyr,finikorg/zephyr,finikorg/zephyr,zephyrproject-rtos/zephyr,Vudentz/zephyr,zephyrproject-rtos/zephyr,galak/zephyr,nashif/zephyr,Vudentz/zephyr,zephyrproject-rtos/zephyr,galak/zephyr,nashif/zephyr,galak/zephyr,Vude... | #!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2021 Intel Corporation
import os
import sh
import argparse
import re
from unidiff import PatchSet
if "ZEPHYR_BASE" not in os.environ:
exit("$ZEPHYR_BASE environment variable undefined.")
repository_path = os.environ['ZEPHYR_BASE']
sh_s... | ci: Apply coccinelle scripts in git diffs
This scripts receives the same parameter of what_changed.py. And run
coccinelle scripts for code guideline compliance in the given git
commits. e.g: ./guideline_check.py --commits origin/master..HEAD
Signed-off-by: Flavio Ceolin <979b9165500b0741b9d0500e2efd74fc1547bff7@intel... | |
5bcb267761e6c2694111757ee4fcf2a050f6c556 | byceps/blueprints/site/guest_server/forms.py | byceps/blueprints/site/guest_server/forms.py | """
byceps.blueprints.site.guest_server.forms
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2021 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from flask_babel import lazy_gettext
from wtforms import StringField, TextAreaField
from wtforms.validators import Optional
fro... | """
byceps.blueprints.site.guest_server.forms
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2021 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
import re
from flask_babel import lazy_gettext
from wtforms import StringField, TextAreaField
from wtforms.validators import Le... | Make guest server form validation more strict | Make guest server form validation more strict
| Python | bsd-3-clause | homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps | """
byceps.blueprints.site.guest_server.forms
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2021 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
import re
from flask_babel import lazy_gettext
from wtforms import StringField, TextAreaField
from wtforms.validators import Le... | Make guest server form validation more strict
"""
byceps.blueprints.site.guest_server.forms
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2021 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from flask_babel import lazy_gettext
from wtforms import StringField, TextAreaFie... |
8a577edcc723ad30cc1b84c00435474e980353d3 | gaphor/diagram/profiles/extension.py | gaphor/diagram/profiles/extension.py | """
ExtensionItem -- Graphical representation of an association.
"""
# TODO: for Extension.postload(): in some cases where the association ends
# are connected to the same Class, the head_end property is connected to the
# tail end and visa versa.
from gaphor import UML
from gaphor.diagram.diagramline import NamedLin... | """
ExtensionItem -- Graphical representation of an association.
"""
# TODO: for Extension.postload(): in some cases where the association ends
# are connected to the same Class, the head_end property is connected to the
# tail end and visa versa.
from gaphor import UML
from gaphor.UML.modelfactory import stereotypes... | Convert Extension item to new line style | Convert Extension item to new line style
| Python | lgpl-2.1 | amolenaar/gaphor,amolenaar/gaphor | """
ExtensionItem -- Graphical representation of an association.
"""
# TODO: for Extension.postload(): in some cases where the association ends
# are connected to the same Class, the head_end property is connected to the
# tail end and visa versa.
from gaphor import UML
from gaphor.UML.modelfactory import stereotypes... | Convert Extension item to new line style
"""
ExtensionItem -- Graphical representation of an association.
"""
# TODO: for Extension.postload(): in some cases where the association ends
# are connected to the same Class, the head_end property is connected to the
# tail end and visa versa.
from gaphor import UML
from ... |
86cede2c228e2e6bccb4adbdfe81d9d4bd34ac6f | teams/blog_fetch.py | teams/blog_fetch.py | """Fetches the blogs configured on the website to local files.
The local files dumped to are 'BLOGNAME.incoming.yml' in the
assets/blogs directory.
Should be run as a regular cron-job. Must be run from within the
website virtual environment.
---
Copyright (c) 2013, University Radio York.
All rights reserved.
Redi... | Move the Python end of blog-fetch to LASS. | Move the Python end of blog-fetch to LASS.
| Python | bsd-2-clause | UniversityRadioYork/lass-pyramid | """Fetches the blogs configured on the website to local files.
The local files dumped to are 'BLOGNAME.incoming.yml' in the
assets/blogs directory.
Should be run as a regular cron-job. Must be run from within the
website virtual environment.
---
Copyright (c) 2013, University Radio York.
All rights reserved.
Redi... | Move the Python end of blog-fetch to LASS.
| |
7a8b041ce9e0f115f3c5daad159a03c13c5cd72d | python/pycandela/pycandela/__init__.py | python/pycandela/pycandela/__init__.py | import IPython.core.displaypub as displaypub
import json
import DataFrame from pandas
class DataFrameEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, DataFrame):
return obj.to_records()
return json.JSONEncoder.default(self, obj)
def publish_display_data(data):
... | import IPython.core.displaypub as displaypub
import json
from pandas import DataFrame
class DataFrameEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, DataFrame):
return obj.to_records()
return json.JSONEncoder.default(self, obj)
def publish_display_data(data):
... | Fix import and call render() on vis | Fix import and call render() on vis
| Python | apache-2.0 | Kitware/candela,Kitware/candela,Kitware/candela,Kitware/candela,Kitware/candela | import IPython.core.displaypub as displaypub
import json
from pandas import DataFrame
class DataFrameEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, DataFrame):
return obj.to_records()
return json.JSONEncoder.default(self, obj)
def publish_display_data(data):
... | Fix import and call render() on vis
import IPython.core.displaypub as displaypub
import json
import DataFrame from pandas
class DataFrameEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, DataFrame):
return obj.to_records()
return json.JSONEncoder.default(self, obj)
... |
f54fd0bf65d731b4f25cfc2ddffb8d6f472e0d7c | examples/eiger_use_case.py | examples/eiger_use_case.py | '''Virtual datasets: The 'Eiger' use case
https://support.hdfgroup.org/HDF5/docNewFeatures/VDS/HDF5-VDS-requirements-use-cases-2014-12-10.pdf
'''
import h5py
import numpy as np
files = ['1.h5', '2.h5', '3.h5', '4.h5', '5.h5']
entry_key = 'data' # where the data is inside of the source files.
sh = h5py.File(files[0]... | '''Virtual datasets: The 'Eiger' use case
https://support.hdfgroup.org/HDF5/docNewFeatures/VDS/HDF5-VDS-requirements-use-cases-2014-12-10.pdf
'''
import h5py
import numpy as np
files = ['1.h5', '2.h5', '3.h5', '4.h5', '5.h5']
entry_key = 'data' # where the data is inside of the source files.
sh = h5py.File(files[0]... | Fix layout for Eiger example | Fix layout for Eiger example
| Python | bsd-3-clause | h5py/h5py,h5py/h5py,h5py/h5py | '''Virtual datasets: The 'Eiger' use case
https://support.hdfgroup.org/HDF5/docNewFeatures/VDS/HDF5-VDS-requirements-use-cases-2014-12-10.pdf
'''
import h5py
import numpy as np
files = ['1.h5', '2.h5', '3.h5', '4.h5', '5.h5']
entry_key = 'data' # where the data is inside of the source files.
sh = h5py.File(files[0]... | Fix layout for Eiger example
'''Virtual datasets: The 'Eiger' use case
https://support.hdfgroup.org/HDF5/docNewFeatures/VDS/HDF5-VDS-requirements-use-cases-2014-12-10.pdf
'''
import h5py
import numpy as np
files = ['1.h5', '2.h5', '3.h5', '4.h5', '5.h5']
entry_key = 'data' # where the data is inside of the source ... |
6c1c38a9c293527bfb4bb5689675f0ef6b385f75 | setup.py | setup.py | from setuptools import setup, find_packages
import sys, os
version = '0.1'
setup(name='kotti_contactform',
version=version,
description="Simple contact form for Kotti sites",
long_description="""\
This is an extension to Kotti that allows to add simple contact forms to your website.""",
classi... | from setuptools import setup, find_packages
import sys, os
version = '0.1'
setup(name='kotti_contactform',
version=version,
description="Simple contact form for Kotti sites",
long_description="""\
This is an extension to Kotti that allows to add simple contact forms to your website.""",
classi... | Add translation files to package data | Add translation files to package data
| Python | bsd-2-clause | Kotti/kotti_contactform | from setuptools import setup, find_packages
import sys, os
version = '0.1'
setup(name='kotti_contactform',
version=version,
description="Simple contact form for Kotti sites",
long_description="""\
This is an extension to Kotti that allows to add simple contact forms to your website.""",
classi... | Add translation files to package data
from setuptools import setup, find_packages
import sys, os
version = '0.1'
setup(name='kotti_contactform',
version=version,
description="Simple contact form for Kotti sites",
long_description="""\
This is an extension to Kotti that allows to add simple contact ... |
64c9d2c53f0dc4c9ae92b5675248a8f11c2b4e9e | pyqode/python/managers/file.py | pyqode/python/managers/file.py | """
Contains the python specific FileManager.
"""
import ast
import re
from pyqode.core.managers import FileManager
class PyFileManager(FileManager):
"""
Extends file manager to override detect_encoding. With python, we can
detect encoding by reading the two first lines of a file and extracting its
en... | """
Contains the python specific FileManager.
"""
import ast
import re
from pyqode.core.managers import FileManager
class PyFileManager(FileManager):
"""
Extends file manager to override detect_encoding. With python, we can
detect encoding by reading the two first lines of a file and extracting its
en... | Fix encoding detection in python (shebang line was not parsed anymore) | Fix encoding detection in python (shebang line was not parsed anymore)
| Python | mit | pyQode/pyqode.python,mmolero/pyqode.python,pyQode/pyqode.python,zwadar/pyqode.python | """
Contains the python specific FileManager.
"""
import ast
import re
from pyqode.core.managers import FileManager
class PyFileManager(FileManager):
"""
Extends file manager to override detect_encoding. With python, we can
detect encoding by reading the two first lines of a file and extracting its
en... | Fix encoding detection in python (shebang line was not parsed anymore)
"""
Contains the python specific FileManager.
"""
import ast
import re
from pyqode.core.managers import FileManager
class PyFileManager(FileManager):
"""
Extends file manager to override detect_encoding. With python, we can
detect enc... |
34a96c9824bef5d735f521b303fe9f9755b431ee | dataportal/utils/diagnostics.py | dataportal/utils/diagnostics.py | from __future__ import (absolute_import, division, print_function,
unicode_literals)
from collections import OrderedDict
import importlib
import six
def watermark():
"""
Give the version of each of the dependencies -- useful for bug reports.
Returns
-------
result : dict
... | from __future__ import (absolute_import, division, print_function,
unicode_literals)
from collections import OrderedDict
import importlib
import sys
import six
def watermark():
"""
Give the version of each of the dependencies -- useful for bug reports.
Returns
-------
resu... | Make watermark robust if __version__ attribute is missing. | FIX: Make watermark robust if __version__ attribute is missing.
| Python | bsd-3-clause | danielballan/dataportal,danielballan/dataportal,danielballan/datamuxer,tacaswell/dataportal,tacaswell/dataportal,ericdill/datamuxer,NSLS-II/dataportal,NSLS-II/datamuxer,ericdill/datamuxer,NSLS-II/dataportal,ericdill/databroker,danielballan/datamuxer,ericdill/databroker | from __future__ import (absolute_import, division, print_function,
unicode_literals)
from collections import OrderedDict
import importlib
import sys
import six
def watermark():
"""
Give the version of each of the dependencies -- useful for bug reports.
Returns
-------
resu... | FIX: Make watermark robust if __version__ attribute is missing.
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from collections import OrderedDict
import importlib
import six
def watermark():
"""
Give the version of each of the dependencies -- use... |
30ec6a7be967d1c4041539cf80f6ae3709460af5 | wtfhack/base/models.py | wtfhack/base/models.py | """ Basic models, such as user profile """
from django.db import models
class Language(models.Model):
name = models.CharField(max_length=40, null=False)
learn_url = models.URLField(null=True, blank=True)
@staticmethod
def all():
return [l.name for l in Language.objects.all()]
def __unicode... | """ Basic models, such as user profile """
from django.db import models
class Language(models.Model):
name = models.CharField(max_length=40, null=False)
learn_url = models.URLField(null=True, blank=True)
@staticmethod
def all():
return [l.name for l in Language.objects.all()]
def __unicode... | Increase max length for repo names | Increase max length for repo names
| Python | bsd-3-clause | sloria/wtfhack,sloria/wtfhack,sloria/wtfhack,sloria/wtfhack,sloria/wtfhack | """ Basic models, such as user profile """
from django.db import models
class Language(models.Model):
name = models.CharField(max_length=40, null=False)
learn_url = models.URLField(null=True, blank=True)
@staticmethod
def all():
return [l.name for l in Language.objects.all()]
def __unicode... | Increase max length for repo names
""" Basic models, such as user profile """
from django.db import models
class Language(models.Model):
name = models.CharField(max_length=40, null=False)
learn_url = models.URLField(null=True, blank=True)
@staticmethod
def all():
return [l.name for l in Langu... |
7c2548f7f4cf01d0a5cf389c290a47cdf029a7ac | apps/explorer/tests/views/test_mixins.py | apps/explorer/tests/views/test_mixins.py | import pytest
from django.test import TestCase
from apps.explorer.views.mixins import DataTableMixin, SubsetSelectionMixin
class DataTableMixinTestCase(TestCase):
def test_get_omics_units_must_be_implemented(self):
class DataTableWithNoGetOmicsUnits(DataTableMixin):
pass
with pyte... | Add tests for explorer views mixins | Add tests for explorer views mixins
| Python | bsd-3-clause | Candihub/pixel,Candihub/pixel,Candihub/pixel,Candihub/pixel,Candihub/pixel | import pytest
from django.test import TestCase
from apps.explorer.views.mixins import DataTableMixin, SubsetSelectionMixin
class DataTableMixinTestCase(TestCase):
def test_get_omics_units_must_be_implemented(self):
class DataTableWithNoGetOmicsUnits(DataTableMixin):
pass
with pyte... | Add tests for explorer views mixins
| |
9e7d3c35857600445cb6df42ba18d289dc0e37a9 | wsgi.py | wsgi.py |
from os import getenv
from webapp import create_app
from argparse import ArgumentParser
app = create_app(getenv('FLASK_CONFIG') or 'development')
def main():
parser = ArgumentParser()
parser.add_argument("-p", "--port", help="port number")
args = parser.parse_args()
port = int(args.port or None)
... |
from os import getenv
from webapp import create_app
from argparse import ArgumentParser
app = create_app(getenv('FLASK_CONFIG') or 'development')
def main():
parser = ArgumentParser()
parser.add_argument("-p", "--port", help="port number")
args = parser.parse_args()
port = int(args.port or 5000)
... | Fix in port number initialisation | Fix in port number initialisation
| Python | bsd-3-clause | aleksandergurin/news,aleksandergurin/news,aleksandergurin/news |
from os import getenv
from webapp import create_app
from argparse import ArgumentParser
app = create_app(getenv('FLASK_CONFIG') or 'development')
def main():
parser = ArgumentParser()
parser.add_argument("-p", "--port", help="port number")
args = parser.parse_args()
port = int(args.port or 5000)
... | Fix in port number initialisation
from os import getenv
from webapp import create_app
from argparse import ArgumentParser
app = create_app(getenv('FLASK_CONFIG') or 'development')
def main():
parser = ArgumentParser()
parser.add_argument("-p", "--port", help="port number")
args = parser.parse_args()
... |
98c07739702fbf3951ccd0359d04be80a303d9ce | run_time/src/gae_server/font_mapper.py | run_time/src/gae_server/font_mapper.py | """
Copyright 2014 Google Inc. 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 law or ... | Add a fontname to TachyFont Jar file mapper. | Add a fontname to TachyFont Jar file mapper. | Python | apache-2.0 | bstell/TachyFont,bstell/TachyFont,moyogo/tachyfont,bstell/TachyFont,moyogo/tachyfont,bstell/TachyFont,googlei18n/TachyFont,googlefonts/TachyFont,moyogo/tachyfont,googlefonts/TachyFont,googlei18n/TachyFont,googlefonts/TachyFont,googlei18n/TachyFont,googlefonts/TachyFont,bstell/TachyFont,googlefonts/TachyFont,googlei18n/... | """
Copyright 2014 Google Inc. 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 law or ... | Add a fontname to TachyFont Jar file mapper.
| |
ff9de1ab494ee5d48dba7aa84dfa1ce114464f09 | py/tests/global_alpha_test.py | py/tests/global_alpha_test.py | #!/usr/bin/python3
import pykms
import time
card = pykms.Card()
res = pykms.ResourceManager(card)
conn = res.reserve_connector("")
crtc = res.reserve_crtc(conn)
mode = conn.get_default_mode()
modeb = mode.to_blob(card)
format = pykms.PixelFormat.ARGB8888
plane1 = res.reserve_generic_plane(crtc, format)
plane2 = res.r... | Add globa_alpha_test.py for DRM per plane "alpha" property testing | Add globa_alpha_test.py for DRM per plane "alpha" property testing
| Python | mpl-2.0 | tomba/kmsxx,tomba/kmsxx,tomba/kmsxx,tomba/kmsxx | #!/usr/bin/python3
import pykms
import time
card = pykms.Card()
res = pykms.ResourceManager(card)
conn = res.reserve_connector("")
crtc = res.reserve_crtc(conn)
mode = conn.get_default_mode()
modeb = mode.to_blob(card)
format = pykms.PixelFormat.ARGB8888
plane1 = res.reserve_generic_plane(crtc, format)
plane2 = res.r... | Add globa_alpha_test.py for DRM per plane "alpha" property testing
| |
5056586586becb94bba265bdd90e46f2e2366534 | factory/checkFactory.py | factory/checkFactory.py | #!/bin/env python
#
# Description:
# Check if a glideinFactory is running
#
# Arguments:
# $1 = glidein submit_dir (i.e. factory dir)
#
# Author:
# Igor Sfiligoi Jul 9th 2008
#
import sys
import glideFactoryPidLib
try:
startup_dir=sys.argv[1]
factory_pid=glideFactoryPidLib.get_gfactory_pid(startup_dir)... | Check if a glideinFactory is running | Check if a glideinFactory is running
| Python | bsd-3-clause | holzman/glideinwms-old,bbockelm/glideinWMS,bbockelm/glideinWMS,bbockelm/glideinWMS,holzman/glideinwms-old,holzman/glideinwms-old,bbockelm/glideinWMS | #!/bin/env python
#
# Description:
# Check if a glideinFactory is running
#
# Arguments:
# $1 = glidein submit_dir (i.e. factory dir)
#
# Author:
# Igor Sfiligoi Jul 9th 2008
#
import sys
import glideFactoryPidLib
try:
startup_dir=sys.argv[1]
factory_pid=glideFactoryPidLib.get_gfactory_pid(startup_dir)... | Check if a glideinFactory is running
| |
4d7df38e056d0132af41759062cf8e380c736250 | django_backend_test/noras_menu/urls.py | django_backend_test/noras_menu/urls.py | # -*- encoding: utf-8 -*-
from django.conf.urls import url, include
from django.views.decorators.csrf import csrf_exempt
from .views import CreateMenu,ListMenu,UpdateMenu,CreateSelection,ListSelection,CreateSubscriber
urlpatterns = [
url(r'^menu/new$',CreateMenu.as_view(),name='Create Menu'),
url(r'^menu/edit/... | Update Urls from nora_menu app | Update Urls from nora_menu app
| Python | mit | semorale/backend-test,semorale/backend-test,semorale/backend-test | # -*- encoding: utf-8 -*-
from django.conf.urls import url, include
from django.views.decorators.csrf import csrf_exempt
from .views import CreateMenu,ListMenu,UpdateMenu,CreateSelection,ListSelection,CreateSubscriber
urlpatterns = [
url(r'^menu/new$',CreateMenu.as_view(),name='Create Menu'),
url(r'^menu/edit/... | Update Urls from nora_menu app
| |
015ecbbe112edaa3ada4cb1af70f62f03654dfe4 | py/app.py | py/app.py | import json
import functools
from flask import Flask, Response
from foxgami.red import Story
app = Flask(__name__)
def return_as_json(inner_f):
@functools.wraps(inner_f)
def new_f(*args, **kwargs):
result = inner_f(*args, **kwargs)
return Response(json.dumps(
result,
i... | import json
import functools
from flask import Flask, Response
from foxgami.red import Story
app = Flask(__name__)
@app.after_response
def add_content_headers(response):
response.headers['Access-Control-Allow-Origin'] = '*'
return response
def return_as_json(inner_f):
@functools.wraps(inner_f)
def n... | Add Access-Control headers to python | Add Access-Control headers to python
| Python | mit | flubstep/foxgami.com,flubstep/foxgami.com | import json
import functools
from flask import Flask, Response
from foxgami.red import Story
app = Flask(__name__)
@app.after_response
def add_content_headers(response):
response.headers['Access-Control-Allow-Origin'] = '*'
return response
def return_as_json(inner_f):
@functools.wraps(inner_f)
def n... | Add Access-Control headers to python
import json
import functools
from flask import Flask, Response
from foxgami.red import Story
app = Flask(__name__)
def return_as_json(inner_f):
@functools.wraps(inner_f)
def new_f(*args, **kwargs):
result = inner_f(*args, **kwargs)
return Response(json.du... |
6b49f7b1948ab94631c79304c91f8d5590d03e40 | addons/project/models/project_config_settings.py | addons/project/models/project_config_settings.py | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class ProjectConfiguration(models.TransientModel):
_name = 'project.config.settings'
_inherit = 'res.config.settings'
company_id = fields.Many2one('res.company', string... | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class ProjectConfiguration(models.TransientModel):
_name = 'project.config.settings'
_inherit = 'res.config.settings'
company_id = fields.Many2one('res.company', string... | Enable `Timesheets` option if `Time Billing` is enabled | [IMP] project: Enable `Timesheets` option if `Time Billing` is enabled
| Python | agpl-3.0 | ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class ProjectConfiguration(models.TransientModel):
_name = 'project.config.settings'
_inherit = 'res.config.settings'
company_id = fields.Many2one('res.company', string... | [IMP] project: Enable `Timesheets` option if `Time Billing` is enabled
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class ProjectConfiguration(models.TransientModel):
_name = 'project.config.settings'
_inherit = 'res.... |
1f6cac883995cfaf4d1b19c6c13f3fc13e9ddc7a | tools/scyllatop/views/base.py | tools/scyllatop/views/base.py | import time
import curses
import curses.panel
import logging
class Base(object):
def __init__(self, window):
lines, columns = window.getmaxyx()
self._window = curses.newwin(lines, columns)
self._panel = curses.panel.new_panel(self._window)
def writeStatusLine(self, measurements):
... | import time
import curses
import curses.panel
import logging
class Base(object):
def __init__(self, window):
lines, columns = window.getmaxyx()
self._window = curses.newwin(lines, columns)
self._panel = curses.panel.new_panel(self._window)
def writeStatusLine(self, measurements):
... | Use 'erase' to clear the screen | tools/scyllatop: Use 'erase' to clear the screen
The 'clear' function explicitly clears the screen and repaints it which
causes really annoying flicker. Use 'erase' to make scyllatop more
pleasant on the eyes.
Message-Id: <2bf04f96d7d510dddf38de01959db6b168f25a31@scylladb.com>
| Python | agpl-3.0 | raphaelsc/scylla,avikivity/scylla,scylladb/scylla,duarten/scylla,avikivity/scylla,scylladb/scylla,kjniemi/scylla,kjniemi/scylla,duarten/scylla,duarten/scylla,scylladb/scylla,kjniemi/scylla,raphaelsc/scylla,scylladb/scylla,avikivity/scylla,raphaelsc/scylla | import time
import curses
import curses.panel
import logging
class Base(object):
def __init__(self, window):
lines, columns = window.getmaxyx()
self._window = curses.newwin(lines, columns)
self._panel = curses.panel.new_panel(self._window)
def writeStatusLine(self, measurements):
... | tools/scyllatop: Use 'erase' to clear the screen
The 'clear' function explicitly clears the screen and repaints it which
causes really annoying flicker. Use 'erase' to make scyllatop more
pleasant on the eyes.
Message-Id: <2bf04f96d7d510dddf38de01959db6b168f25a31@scylladb.com>
import time
import curses
import curses... |
89a7a834638a1384bd9f1a560902b4d3aab29423 | smoked/loader.py | smoked/loader.py | # coding: utf-8
from __future__ import unicode_literals
from importlib import import_module
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
def load_test_module():
"""
Import test module and trigger registration of tests. Test module is
defined in `SMOKE_TESTS` se... | # coding: utf-8
from __future__ import unicode_literals
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
def load_test_module():
"""
Import test module and trigger registration of tests. Test module is
defined in `SM... | Fix import of import_module for Py2.6 | Fix import of import_module for Py2.6
| Python | mit | djentlemen/django-smoked | # coding: utf-8
from __future__ import unicode_literals
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
def load_test_module():
"""
Import test module and trigger registration of tests. Test module is
defined in `SM... | Fix import of import_module for Py2.6
# coding: utf-8
from __future__ import unicode_literals
from importlib import import_module
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
def load_test_module():
"""
Import test module and trigger registration of tests. Test mo... |
0e30e73ffa928b11fd6ee6c0ea12709100623e5f | pltpreview/view.py | pltpreview/view.py | """Convenience functions for matplotlib plotting and image viewing."""
import numpy as np
from matplotlib import pyplot as plt
def show(image, blocking=False, title='', **kwargs):
"""Show *image*. If *blocking* is False the call is nonblocking. *title*
is the image title. *kwargs* are passed to matplotlib's ... | """Convenience functions for matplotlib plotting and image viewing."""
import numpy as np
from matplotlib import pyplot as plt
def show(image, blocking=False, title='', **kwargs):
"""Show *image*. If *blocking* is False the call is nonblocking. *title*
is the image title. *kwargs* are passed to matplotlib's ... | Use pop for getting blocking parameter | Use pop for getting blocking parameter
| Python | mit | tfarago/pltpreview | """Convenience functions for matplotlib plotting and image viewing."""
import numpy as np
from matplotlib import pyplot as plt
def show(image, blocking=False, title='', **kwargs):
"""Show *image*. If *blocking* is False the call is nonblocking. *title*
is the image title. *kwargs* are passed to matplotlib's ... | Use pop for getting blocking parameter
"""Convenience functions for matplotlib plotting and image viewing."""
import numpy as np
from matplotlib import pyplot as plt
def show(image, blocking=False, title='', **kwargs):
"""Show *image*. If *blocking* is False the call is nonblocking. *title*
is the image titl... |
19ee49c57fd17f14efffd946019734f1cb4ed18e | pipes/s3/__main__.py | pipes/s3/__main__.py | """Add application.properties to Application's S3 Bucket directory."""
import logging
import argparse
from .create_archaius import init_properties
LOG = logging.getLogger(__name__)
def main():
"""Create application.properties for a given application."""
logging.basicConfig()
parser = argparse.ArgumentPar... | """Add application.properties to Application's S3 Bucket directory."""
import logging
import argparse
from .create_archaius import init_properties
LOG = logging.getLogger(__name__)
def main():
"""Create application.properties for a given application."""
logging.basicConfig()
parser = argparse.ArgumentPar... | Add build as a possible environment option | Add build as a possible environment option
| Python | apache-2.0 | gogoair/foremast,gogoair/foremast | """Add application.properties to Application's S3 Bucket directory."""
import logging
import argparse
from .create_archaius import init_properties
LOG = logging.getLogger(__name__)
def main():
"""Create application.properties for a given application."""
logging.basicConfig()
parser = argparse.ArgumentPar... | Add build as a possible environment option
"""Add application.properties to Application's S3 Bucket directory."""
import logging
import argparse
from .create_archaius import init_properties
LOG = logging.getLogger(__name__)
def main():
"""Create application.properties for a given application."""
logging.bas... |
6ce72c5b0726fc2e3ae78c6f0a22e4f03f26a2ca | erpnext/patches/v5_4/update_purchase_cost_against_project.py | erpnext/patches/v5_4/update_purchase_cost_against_project.py | # Copyright (c) 2015, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
for p in frappe.get_all("Project"):
project = frappe.get_doc("Project", p.name)
project.update_purchase_costing()
... | # Copyright (c) 2015, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
for p in frappe.get_all("Project", filters={"docstatus": 0}):
project = frappe.get_doc("Project", p.name)
project.... | Update project cost for draft project only | [fix] Update project cost for draft project only
| Python | agpl-3.0 | mbauskar/helpdesk-erpnext,hernad/erpnext,gangadharkadam/saloon_erp_install,mbauskar/omnitech-demo-erpnext,indictranstech/trufil-erpnext,mbauskar/helpdesk-erpnext,susuchina/ERPNEXT,njmube/erpnext,aruizramon/alec_erpnext,ShashaQin/erpnext,anandpdoshi/erpnext,pombredanne/erpnext,aruizramon/alec_erpnext,mahabuber/erpnext,g... | # Copyright (c) 2015, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
for p in frappe.get_all("Project", filters={"docstatus": 0}):
project = frappe.get_doc("Project", p.name)
project.... | [fix] Update project cost for draft project only
# Copyright (c) 2015, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
for p in frappe.get_all("Project"):
project = frappe.get_doc("Proj... |
5b0d308d1859920cc59e7241626472edb42c7856 | djangosanetesting/testrunner.py | djangosanetesting/testrunner.py | from django.test.utils import setup_test_environment, teardown_test_environment
from django.db.backends.creation import create_test_db, destroy_test_db
import nose
def run_tests(test_labels, verbosity=1, interactive=True, extra_tests=[]):
""" Run tests with nose instead of defualt test runner """
setup_test_en... | import sys
from django.conf import settings
from django.test.utils import setup_test_environment, teardown_test_environment
import nose
from nose.config import Config, all_config_files
from nose.plugins.manager import DefaultPluginManager
def run_tests(test_labels, verbosity=1, interactive=True, extra_tests=[]):
... | Use database connection instead of old-style functions | Use database connection instead of old-style functions
| Python | bsd-3-clause | Almad/django-sane-testing | import sys
from django.conf import settings
from django.test.utils import setup_test_environment, teardown_test_environment
import nose
from nose.config import Config, all_config_files
from nose.plugins.manager import DefaultPluginManager
def run_tests(test_labels, verbosity=1, interactive=True, extra_tests=[]):
... | Use database connection instead of old-style functions
from django.test.utils import setup_test_environment, teardown_test_environment
from django.db.backends.creation import create_test_db, destroy_test_db
import nose
def run_tests(test_labels, verbosity=1, interactive=True, extra_tests=[]):
""" Run tests with n... |
b211306824db0a10a79cdab4153c457813b44bca | linter.py | linter.py | #
# linter.py
# Markdown Linter for SublimeLinter, a code checking framework
# for Sublime Text 3
#
# Written by Jon LaBelle
# Copyright (c) 2018 Jon LaBelle
#
# License: MIT
#
"""This module exports the Markdownlint plugin class."""
from SublimeLinter.lint import NodeLinter, util
class MarkdownLint(NodeLinter):
... | #
# linter.py
# Markdown Linter for SublimeLinter, a code checking framework
# for Sublime Text 3
#
# Written by Jon LaBelle
# Copyright (c) 2018 Jon LaBelle
#
# License: MIT
#
"""This module exports the Markdownlint plugin class."""
from SublimeLinter.lint import NodeLinter, util
class MarkdownLint(NodeLinter):
... | Remove deprecated version requirement settings | Remove deprecated version requirement settings
Linter plugins can no longer set version requirements.
https://github.com/SublimeLinter/SublimeLinter/issues/1087 | Python | mit | jonlabelle/SublimeLinter-contrib-markdownlint,jonlabelle/SublimeLinter-contrib-markdownlint | #
# linter.py
# Markdown Linter for SublimeLinter, a code checking framework
# for Sublime Text 3
#
# Written by Jon LaBelle
# Copyright (c) 2018 Jon LaBelle
#
# License: MIT
#
"""This module exports the Markdownlint plugin class."""
from SublimeLinter.lint import NodeLinter, util
class MarkdownLint(NodeLinter):
... | Remove deprecated version requirement settings
Linter plugins can no longer set version requirements.
https://github.com/SublimeLinter/SublimeLinter/issues/1087
#
# linter.py
# Markdown Linter for SublimeLinter, a code checking framework
# for Sublime Text 3
#
# Written by Jon LaBelle
# Copyright (c) 2018 Jon LaBelle... |
1fd87ad0cab5d45602192c83681340d5da27a6db | examples/custom_context.py | examples/custom_context.py | import random
import discord
from discord.ext import commands
class MyContext(commands.Context):
async def tick(self, value):
# reacts to the message with an emoji
# depending on whether value is True or False
# if its True, it'll add a green check mark
# otherwise, it'll add a re... | Add example on subclassing commands.Context | Add example on subclassing commands.Context
| Python | mit | Rapptz/discord.py,Harmon758/discord.py,khazhyk/discord.py,rapptz/discord.py,Harmon758/discord.py | import random
import discord
from discord.ext import commands
class MyContext(commands.Context):
async def tick(self, value):
# reacts to the message with an emoji
# depending on whether value is True or False
# if its True, it'll add a green check mark
# otherwise, it'll add a re... | Add example on subclassing commands.Context
| |
f7aa9e986abd9fb55cb72ac4661f319a867e059d | scripts/ms_jsfs.py | scripts/ms_jsfs.py | #!/usr/bin/env python
"""
Convert the output of ms to an N-dimensional frequency spectrum.
"""
import sys
import dadi
if __name__ == '__main__':
average = ('-av' in sys.argv)
input = sys.stdin
output = sys.stdout
sfs,header = dadi.Spectrum.from_ms_file(input, average, mask_corners=True,
... | Rename so we can import it and thus get useful epydoc documentation. | Rename so we can import it and thus get useful epydoc documentation.
git-svn-id: 4c7b13231a96299fde701bb5dec4bd2aaf383fc6@132 979d6bd5-6d4d-0410-bece-f567c23bd345
| Python | bsd-3-clause | beni55/dadi,cheese1213/dadi,paulirish/dadi,yangjl/dadi,ChenHsiang/dadi,cheese1213/dadi,RyanGutenkunst/dadi,paulirish/dadi,niuhuifei/dadi,beni55/dadi,ChenHsiang/dadi,yangjl/dadi,niuhuifei/dadi,RyanGutenkunst/dadi | #!/usr/bin/env python
"""
Convert the output of ms to an N-dimensional frequency spectrum.
"""
import sys
import dadi
if __name__ == '__main__':
average = ('-av' in sys.argv)
input = sys.stdin
output = sys.stdout
sfs,header = dadi.Spectrum.from_ms_file(input, average, mask_corners=True,
... | Rename so we can import it and thus get useful epydoc documentation.
git-svn-id: 4c7b13231a96299fde701bb5dec4bd2aaf383fc6@132 979d6bd5-6d4d-0410-bece-f567c23bd345
| |
db6dafeabdade2cc8f2e14be3ed06938d3dff644 | tests/test_classes.py | tests/test_classes.py | import unittest
from classes import Paladin
from models.spells.loader import load_paladin_spells_for_level
class PaladinTests(unittest.TestCase):
def setUp(self):
self.name = "Netherblood"
self.level = 3
self.dummy = Paladin(name=self.name, level=self.level, health=100, mana=100, strength... | Test for the __init__ function of the Paladin class | Test for the __init__ function of the Paladin class
| Python | mit | Enether/python_wow | import unittest
from classes import Paladin
from models.spells.loader import load_paladin_spells_for_level
class PaladinTests(unittest.TestCase):
def setUp(self):
self.name = "Netherblood"
self.level = 3
self.dummy = Paladin(name=self.name, level=self.level, health=100, mana=100, strength... | Test for the __init__ function of the Paladin class
| |
6e58e0fbf059f137bfcfef070968191f2ea42655 | tests/libpeas/plugins/extension-python/extension-python.py | tests/libpeas/plugins/extension-python/extension-python.py | # -*- coding: utf-8 -*-
# ex:set ts=4 et sw=4 ai:
from gi.repository import GObject, Introspection, Peas
class ExtensionPythonPlugin(GObject.Object, Peas.Activatable,
Introspection.Base, Introspection.Callable,
Introspection.PropertiesPrerequisite,
... | # -*- coding: utf-8 -*-
# ex:set ts=4 et sw=4 ai:
from gi.repository import GObject, Introspection, Peas
class ExtensionPythonPlugin(GObject.Object, Peas.Activatable,
Introspection.Base, Introspection.Callable,
Introspection.PropertiesPrerequisite,
... | Fix style issues in python test plugin | Fix style issues in python test plugin
https://bugzilla.gnome.org/show_bug.cgi?id=678339 | Python | lgpl-2.1 | Distrotech/libpeas,chergert/libpeas,gregier/libpeas,chergert/libpeas,GNOME/libpeas,gregier/libpeas,gregier/libpeas,gregier/libpeas,Distrotech/libpeas,Distrotech/libpeas,GNOME/libpeas,chergert/libpeas | # -*- coding: utf-8 -*-
# ex:set ts=4 et sw=4 ai:
from gi.repository import GObject, Introspection, Peas
class ExtensionPythonPlugin(GObject.Object, Peas.Activatable,
Introspection.Base, Introspection.Callable,
Introspection.PropertiesPrerequisite,
... | Fix style issues in python test plugin
https://bugzilla.gnome.org/show_bug.cgi?id=678339
# -*- coding: utf-8 -*-
# ex:set ts=4 et sw=4 ai:
from gi.repository import GObject, Introspection, Peas
class ExtensionPythonPlugin(GObject.Object, Peas.Activatable,
Introspection.Base, Introspection... |
af566e0cd0958dadd0de55d51b50ad026a8f2b99 | build_android_prepare.py | build_android_prepare.py | """Configuration for the Caffe2 installation.
"""
from build import Config
import sys
Config.USE_SYSTEM_PROTOBUF = False
Config.PROTOC_BINARY = 'gen/third_party/google/protoc'
Config.USE_OPENMP = False
if __name__ == '__main__':
from brewtool.brewery import Brewery
Brewery.Run(
Config,
['buil... | Add a simple script to help build android. | Add a simple script to help build android.
| Python | apache-2.0 | davinwang/caffe2,sf-wind/caffe2,davinwang/caffe2,bwasti/caffe2,pietern/caffe2,xzturn/caffe2,davinwang/caffe2,sf-wind/caffe2,bwasti/caffe2,davinwang/caffe2,bwasti/caffe2,bwasti/caffe2,sf-wind/caffe2,caffe2/caffe2,pietern/caffe2,pietern/caffe2,Yangqing/caffe2,xzturn/caffe2,Yangqing/caffe2,davinwang/caffe2,Yangqing/caffe2... | """Configuration for the Caffe2 installation.
"""
from build import Config
import sys
Config.USE_SYSTEM_PROTOBUF = False
Config.PROTOC_BINARY = 'gen/third_party/google/protoc'
Config.USE_OPENMP = False
if __name__ == '__main__':
from brewtool.brewery import Brewery
Brewery.Run(
Config,
['buil... | Add a simple script to help build android.
| |
2de823ae11e1337f114457bf4e49275d8d2eda99 | recursive_binary_search.py | recursive_binary_search.py |
def binary_search(array, low, high, item):
if(low>high) :
return -1
mid = (low + high)//2
if(item == array[mid]):
return mid
elif item < array[mid]:
return binary_search(array, low, mid-1, item)
elif item > array[mid]:
return binary_search(array, mid+1, high, item... | Add recursive binary search implementation | Add recursive binary search implementation
| Python | mit | arafat-al-mahmud/algorithms-python |
def binary_search(array, low, high, item):
if(low>high) :
return -1
mid = (low + high)//2
if(item == array[mid]):
return mid
elif item < array[mid]:
return binary_search(array, low, mid-1, item)
elif item > array[mid]:
return binary_search(array, mid+1, high, item... | Add recursive binary search implementation
| |
3e54119f07b0fdcbbe556e86de3c161a3eb20ddf | mwikiircbot.py | mwikiircbot.py | import ircbotframe
import sys
class Handler:
def __init__(self, host, port=6667, name="MediaWiki", description="MediaWiki recent changes bot", channels=[]):
self.channels = channels
self.bot = ircbotframe.ircBot(host, port, name, description)
self.bot.bind("376", self.endMOTD)
self.... | import ircbotframe
import sys
class Handler:
def __init__(self, host, port=6667, name="MediaWiki", description="MediaWiki recent changes bot", channels=[]):
self.channels = channels
self.bot = ircbotframe.ircBot(host, port, name, description)
self.bot.bind("376", self.endMOTD)
self.... | Fix bot not joining any channels | Fix bot not joining any channels
Also removed unnecessary usage comment.
| Python | mit | fenhl/mwikiircbot | import ircbotframe
import sys
class Handler:
def __init__(self, host, port=6667, name="MediaWiki", description="MediaWiki recent changes bot", channels=[]):
self.channels = channels
self.bot = ircbotframe.ircBot(host, port, name, description)
self.bot.bind("376", self.endMOTD)
self.... | Fix bot not joining any channels
Also removed unnecessary usage comment.
import ircbotframe
import sys
class Handler:
def __init__(self, host, port=6667, name="MediaWiki", description="MediaWiki recent changes bot", channels=[]):
self.channels = channels
self.bot = ircbotframe.ircBot(host, port, ... |
fde47133da8c5157f2cae04abb77eccbace6c831 | netbox/netbox/forms.py | netbox/netbox/forms.py | from __future__ import unicode_literals
from django import forms
from utilities.forms import BootstrapMixin
OBJ_TYPE_CHOICES = (
('', 'All Objects'),
('Circuits', (
('provider', 'Providers'),
('circuit', 'Circuits'),
)),
('DCIM', (
('site', 'Sites'),
('rack', 'Racks')... | from __future__ import unicode_literals
from django import forms
from utilities.forms import BootstrapMixin
OBJ_TYPE_CHOICES = (
('', 'All Objects'),
('Circuits', (
('provider', 'Providers'),
('circuit', 'Circuits'),
)),
('DCIM', (
('site', 'Sites'),
('rack', 'Racks')... | Fix global search placeholder text | Fix global search placeholder text
| Python | apache-2.0 | digitalocean/netbox,digitalocean/netbox,digitalocean/netbox,lampwins/netbox,lampwins/netbox,lampwins/netbox,digitalocean/netbox,lampwins/netbox | from __future__ import unicode_literals
from django import forms
from utilities.forms import BootstrapMixin
OBJ_TYPE_CHOICES = (
('', 'All Objects'),
('Circuits', (
('provider', 'Providers'),
('circuit', 'Circuits'),
)),
('DCIM', (
('site', 'Sites'),
('rack', 'Racks')... | Fix global search placeholder text
from __future__ import unicode_literals
from django import forms
from utilities.forms import BootstrapMixin
OBJ_TYPE_CHOICES = (
('', 'All Objects'),
('Circuits', (
('provider', 'Providers'),
('circuit', 'Circuits'),
)),
('DCIM', (
('site',... |
27a0226ec444523034d739a00a999b089ce116ba | enthought/chaco/tools/api.py | enthought/chaco/tools/api.py | from better_zoom import BetterZoom
from better_selecting_zoom import BetterSelectingZoom
from broadcaster import BroadcasterTool
from dataprinter import DataPrinter
from data_label_tool import DataLabelTool
from drag_zoom import DragZoom
from enthought.enable.tools.drag_tool import DragTool
from draw_points_tool import... | from better_zoom import BetterZoom
from better_selecting_zoom import BetterSelectingZoom
from broadcaster import BroadcasterTool
from dataprinter import DataPrinter
from data_label_tool import DataLabelTool
from enthought.enable.tools.drag_tool import DragTool
from draw_points_tool import DrawPointsTool
from highlight_... | Remove deprecated DragZoom from Chaco tools API to eliminate irrelevant BaseZoomTool deprecation warning. DragZoom is still used in 4 Chaco examples | [Chaco] Remove deprecated DragZoom from Chaco tools API to eliminate irrelevant BaseZoomTool deprecation warning. DragZoom is still used in 4 Chaco examples
| Python | bsd-3-clause | ContinuumIO/chaco,tommy-u/chaco,tommy-u/chaco,ContinuumIO/chaco,tommy-u/chaco,ContinuumIO/chaco,burnpanck/chaco,burnpanck/chaco,ContinuumIO/chaco,burnpanck/chaco | from better_zoom import BetterZoom
from better_selecting_zoom import BetterSelectingZoom
from broadcaster import BroadcasterTool
from dataprinter import DataPrinter
from data_label_tool import DataLabelTool
from enthought.enable.tools.drag_tool import DragTool
from draw_points_tool import DrawPointsTool
from highlight_... | [Chaco] Remove deprecated DragZoom from Chaco tools API to eliminate irrelevant BaseZoomTool deprecation warning. DragZoom is still used in 4 Chaco examples
from better_zoom import BetterZoom
from better_selecting_zoom import BetterSelectingZoom
from broadcaster import BroadcasterTool
from dataprinter import DataPrint... |
68ae2de4b51a2fe0f02c40bad8731d34b1092521 | narcissa.py | narcissa.py | #!/usr/bin/env python3
import subprocess
import atexit
import sys
from utils.safe_schedule import SafeScheduler
from time import sleep
from glob import glob
META_IMPORT = '# narcissa import '
scheduler = SafeScheduler()
def make_exit_graceful():
original_hook = sys.excepthook
def new_hook(type, value, tra... | #!/usr/bin/env python3
import subprocess
import atexit
import sys
from utils.safe_schedule import SafeScheduler
from time import sleep
from glob import glob
META_IMPORT = '# narcissa import '
scheduler = SafeScheduler()
def make_exit_graceful():
original_hook = sys.excepthook
def new_hook(type, value, tra... | Change name of start_scrapers() to be more accurate | Change name of start_scrapers() to be more accurate
| Python | mit | mplewis/narcissa | #!/usr/bin/env python3
import subprocess
import atexit
import sys
from utils.safe_schedule import SafeScheduler
from time import sleep
from glob import glob
META_IMPORT = '# narcissa import '
scheduler = SafeScheduler()
def make_exit_graceful():
original_hook = sys.excepthook
def new_hook(type, value, tra... | Change name of start_scrapers() to be more accurate
#!/usr/bin/env python3
import subprocess
import atexit
import sys
from utils.safe_schedule import SafeScheduler
from time import sleep
from glob import glob
META_IMPORT = '# narcissa import '
scheduler = SafeScheduler()
def make_exit_graceful():
original_hoo... |
54f70d759b2e0d384d626f4b55016166f9b26f16 | camelot/roundtable/migrations/0002_add_knight_data.py | camelot/roundtable/migrations/0002_add_knight_data.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.core.management import call_command
def add_knight_data(apps, schema_editor):
call_command('loaddata', 'knight_data.json')
def remove_knight_data(apps, schema_editor):
pass
class Migration(... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def add_knight_data(apps, schema_editor):
Knight = apps.get_model('roundtable', 'Knight')
Knight.objects.bulk_create([
Knight(name='Arthur'),
Knight(name='Bedevere'),
Knight(name='B... | Implement add_knight_data to generate data directly. | Implement add_knight_data to generate data directly.
| Python | bsd-2-clause | jambonrose/djangocon2014-updj17 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def add_knight_data(apps, schema_editor):
Knight = apps.get_model('roundtable', 'Knight')
Knight.objects.bulk_create([
Knight(name='Arthur'),
Knight(name='Bedevere'),
Knight(name='B... | Implement add_knight_data to generate data directly.
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.core.management import call_command
def add_knight_data(apps, schema_editor):
call_command('loaddata', 'knight_data.json')
def remove_knight_... |
417b3caf2a64a68e0da56b3caa9213c2c64087c3 | grammpy/Terminal.py | grammpy/Terminal.py | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
class Terminal:
def __init__(self, symbol, grammar):
self.__symbol = symbol
self.__grammar = grammar
def __hash__(self):
return hash((self.__symbol, id(self.__grammar)))
... | Add class represents terminal symbol | Add class represents terminal symbol
| Python | mit | PatrikValkovic/grammpy | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
class Terminal:
def __init__(self, symbol, grammar):
self.__symbol = symbol
self.__grammar = grammar
def __hash__(self):
return hash((self.__symbol, id(self.__grammar)))
... | Add class represents terminal symbol
| |
c4ab1ebcbc9d452972732ef5b15c0cf1b09bd8bc | changes/jobs/sync_repo.py | changes/jobs/sync_repo.py | from datetime import datetime
from changes.config import db, queue
from changes.models import Repository
def sync_repo(repo_id):
repo = Repository.query.get(repo_id)
if not repo:
return
vcs = repo.get_vcs()
if vcs is None:
return
repo.last_update_attempt = datetime.utcnow()
... | from datetime import datetime
from flask import current_app
from changes.config import db, queue
from changes.models import Repository
def sync_repo(repo_id):
repo = Repository.query.get(repo_id)
if not repo:
return
vcs = repo.get_vcs()
if vcs is None:
return
repo.last_update_at... | Use app logging instead of celery | Use app logging instead of celery
| Python | apache-2.0 | wfxiang08/changes,dropbox/changes,bowlofstew/changes,bowlofstew/changes,wfxiang08/changes,dropbox/changes,wfxiang08/changes,bowlofstew/changes,dropbox/changes,dropbox/changes,wfxiang08/changes,bowlofstew/changes | from datetime import datetime
from flask import current_app
from changes.config import db, queue
from changes.models import Repository
def sync_repo(repo_id):
repo = Repository.query.get(repo_id)
if not repo:
return
vcs = repo.get_vcs()
if vcs is None:
return
repo.last_update_at... | Use app logging instead of celery
from datetime import datetime
from changes.config import db, queue
from changes.models import Repository
def sync_repo(repo_id):
repo = Repository.query.get(repo_id)
if not repo:
return
vcs = repo.get_vcs()
if vcs is None:
return
repo.last_upda... |
5cb049385aa3d3ae57d18dc4b7d12f3d5e6f1ae4 | tests/intervaltrigger_test.py | tests/intervaltrigger_test.py | import time
import mock
import pytest
import spreadsplug.intervaltrigger as intervaltrigger
@pytest.fixture
def plugin(config):
config['intervaltrigger']['interval'] = 0.1
return intervaltrigger.IntervalTrigger(config)
def test_trigger_loop(plugin):
cbmock = mock.Mock()
plugin.start_trigger_loop(c... | import time
import mock
import pytest
import spreadsplug.intervaltrigger as intervaltrigger
@pytest.fixture
def plugin(config):
config['intervaltrigger']['interval'] = 0.1
return intervaltrigger.IntervalTrigger(config)
def test_trigger_loop(plugin):
cbmock = mock.Mock()
plugin.start_trigger_loop(c... | Increase sleep-time in intervaltrigger tests | Increase sleep-time in intervaltrigger tests
| Python | agpl-3.0 | jbaiter/spreads,DIYBookScanner/spreads,nafraf/spreads,adongy/spreads,jbaiter/spreads,miloh/spreads,gareth8118/spreads,gareth8118/spreads,nafraf/spreads,gareth8118/spreads,jbaiter/spreads,DIYBookScanner/spreads,DIYBookScanner/spreads,nafraf/spreads,adongy/spreads,miloh/spreads,adongy/spreads,miloh/spreads | import time
import mock
import pytest
import spreadsplug.intervaltrigger as intervaltrigger
@pytest.fixture
def plugin(config):
config['intervaltrigger']['interval'] = 0.1
return intervaltrigger.IntervalTrigger(config)
def test_trigger_loop(plugin):
cbmock = mock.Mock()
plugin.start_trigger_loop(c... | Increase sleep-time in intervaltrigger tests
import time
import mock
import pytest
import spreadsplug.intervaltrigger as intervaltrigger
@pytest.fixture
def plugin(config):
config['intervaltrigger']['interval'] = 0.1
return intervaltrigger.IntervalTrigger(config)
def test_trigger_loop(plugin):
cbmock... |
e8c6be3565bd8b33dfb7a01dfb77938534ce9d09 | pysswords/crypt.py | pysswords/crypt.py | import os
import gnupg
import logging
from .utils import which
def create_key_input(gpg, passphrase, testing=False):
key_input = gpg.gen_key_input(
name_real='Pysswords',
name_email='pysswords@pysswords',
name_comment='Autogenerated by Pysswords',
passphrase=passphrase,
te... | import os
import gnupg
import logging
from .utils import which
def create_key_input(gpg, passphrase, testing=False):
key_input = gpg.gen_key_input(
name_real='Pysswords',
name_email='pysswords@pysswords',
name_comment='Autogenerated by Pysswords',
passphrase=passphrase,
te... | Add load gpg to get an instance of gpg | Add load gpg to get an instance of gpg
| Python | mit | scorphus/passpie,scorphus/passpie,marcwebbie/passpie,eiginn/passpie,marcwebbie/pysswords,marcwebbie/passpie,eiginn/passpie | import os
import gnupg
import logging
from .utils import which
def create_key_input(gpg, passphrase, testing=False):
key_input = gpg.gen_key_input(
name_real='Pysswords',
name_email='pysswords@pysswords',
name_comment='Autogenerated by Pysswords',
passphrase=passphrase,
te... | Add load gpg to get an instance of gpg
import os
import gnupg
import logging
from .utils import which
def create_key_input(gpg, passphrase, testing=False):
key_input = gpg.gen_key_input(
name_real='Pysswords',
name_email='pysswords@pysswords',
name_comment='Autogenerated by Pysswords',
... |
ba942aa988e049779a717c41d068547f5bce8b0b | setup.py | setup.py | #!/usr/bin/env python
# coding: utf-8
import glob as _glob
import setuptools as _st
import tues as _tues
if __name__ == '__main__':
_st.setup(
name='tues',
version=_tues.__version__,
url='https://github.com/wontfix-org/tues/',
license='MIT',
author='Michael van Bracht',
... | #!/usr/bin/env python
# coding: utf-8
import glob as _glob
import setuptools as _st
import tues as _tues
if __name__ == '__main__':
_st.setup(
name='tues',
version=_tues.__version__,
url='https://github.com/wontfix-org/tues/',
license='MIT',
author='Michael van Bracht',
... | Move to native markdown parsing | packaging: Move to native markdown parsing
setuptools-markdown is deprecated
| Python | mit | wontfix-org/tues | #!/usr/bin/env python
# coding: utf-8
import glob as _glob
import setuptools as _st
import tues as _tues
if __name__ == '__main__':
_st.setup(
name='tues',
version=_tues.__version__,
url='https://github.com/wontfix-org/tues/',
license='MIT',
author='Michael van Bracht',
... | packaging: Move to native markdown parsing
setuptools-markdown is deprecated
#!/usr/bin/env python
# coding: utf-8
import glob as _glob
import setuptools as _st
import tues as _tues
if __name__ == '__main__':
_st.setup(
name='tues',
version=_tues.__version__,
url='https://github.com/won... |
342d3791aa80084309ffc00a9e5e936fa8277401 | AFQ/viz.py | AFQ/viz.py | import tempfile
import os.path as op
import numpy as np
import IPython.display as display
import nibabel as nib
from dipy.viz import fvtk
from palettable.tableau import Tableau_20
def visualize_bundles(trk, ren=None, inline=True, interact=False):
"""
Visualize bundles in 3D using fvtk
"""
if isinst... | import tempfile
import os.path as op
import numpy as np
import IPython.display as display
import nibabel as nib
from dipy.viz import fvtk
from dipy.viz.colormap import line_colors
from palettable.tableau import Tableau_20
def visualize_bundles(trk, ren=None, inline=True, interact=False):
"""
Visualize bundl... | Enable visualizing trk files without bundle designations. | Enable visualizing trk files without bundle designations.
| Python | bsd-2-clause | yeatmanlab/pyAFQ,arokem/pyAFQ,yeatmanlab/pyAFQ,arokem/pyAFQ | import tempfile
import os.path as op
import numpy as np
import IPython.display as display
import nibabel as nib
from dipy.viz import fvtk
from dipy.viz.colormap import line_colors
from palettable.tableau import Tableau_20
def visualize_bundles(trk, ren=None, inline=True, interact=False):
"""
Visualize bundl... | Enable visualizing trk files without bundle designations.
import tempfile
import os.path as op
import numpy as np
import IPython.display as display
import nibabel as nib
from dipy.viz import fvtk
from palettable.tableau import Tableau_20
def visualize_bundles(trk, ren=None, inline=True, interact=False):
"""
... |
99469256b4585b5c0056d69e153e7c628f4430c1 | leak_matcher.py | leak_matcher.py | #!/usr/bin/python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import sys
import re
# If you add a line like this to the ctor for a class:
# printf_stderr("ZZZ C... | Add leak matcher for figuring out which test is leaking objects of a type | Add leak matcher for figuring out which test is leaking objects of a type
| Python | mpl-2.0 | amccreight/mochitest-logs | #!/usr/bin/python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import sys
import re
# If you add a line like this to the ctor for a class:
# printf_stderr("ZZZ C... | Add leak matcher for figuring out which test is leaking objects of a type
| |
fadb99ce3a93b2e4be7a654277c921fb5ed562ad | replace-jars.py | replace-jars.py | #!/usr/bin/env python
import os
import re
import shutil
import sys
""" Automate updating multiple HDP jars for debugging/hotfix purposes.
Agnostic to the target directory layout which can differ across HDP versions.
"""
if (len(sys.argv) != 4):
print("Usage: replace-jars.pl <source-dir> <source-version> <dst-versi... | Add script to automate replacing HDP jars. | Add script to automate replacing HDP jars.
| Python | apache-2.0 | arp7/HadoopTools,arp7/HadoopTools,arp7/HadoopTools | #!/usr/bin/env python
import os
import re
import shutil
import sys
""" Automate updating multiple HDP jars for debugging/hotfix purposes.
Agnostic to the target directory layout which can differ across HDP versions.
"""
if (len(sys.argv) != 4):
print("Usage: replace-jars.pl <source-dir> <source-version> <dst-versi... | Add script to automate replacing HDP jars.
| |
0c3f5008dd66b0bb8dfd2a4993def7d0c7a5bf84 | greyjay/articles/migrations/0091_articlepage_reading_time.py | greyjay/articles/migrations/0091_articlepage_reading_time.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-05-03 18:13
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('articles', '0090_auto_20170502_1621'),
]
operations = [
migrations.AddField... | Add reading_time to article pages. | Add reading_time to article pages.
| Python | mit | CIGIHub/greyjay,CIGIHub/greyjay,CIGIHub/greyjay | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-05-03 18:13
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('articles', '0090_auto_20170502_1621'),
]
operations = [
migrations.AddField... | Add reading_time to article pages.
| |
ff1b1f8c61ea14c598443b54024357dc05d4dda2 | shapes.py | shapes.py | #Create a function to get a mesh file 'f'
def getMesh(fname):
#Open the file
f = open(fname, "r")
#Store the lines as a list
f = list(f)
#Strip newlines from the list
for l in range(len(f)):
f[l] = f[l].replace("\n","")
#Store the number of vertices, edges and sides
v = int(f[0])
e = int(f[1])
s = i... | Write function to read in vertices, edges and sides from file. | Write function to read in vertices, edges and sides from file.
| Python | mit | thebillington/pyPhys3D | #Create a function to get a mesh file 'f'
def getMesh(fname):
#Open the file
f = open(fname, "r")
#Store the lines as a list
f = list(f)
#Strip newlines from the list
for l in range(len(f)):
f[l] = f[l].replace("\n","")
#Store the number of vertices, edges and sides
v = int(f[0])
e = int(f[1])
s = i... | Write function to read in vertices, edges and sides from file.
| |
2d688f97b9869fdfed9237b91fdce287278e3c6c | wsgi.py | wsgi.py | import os
from elasticsearch_raven.transport import ElasticsearchTransport
from elasticsearch_raven.utils import get_index
host = os.environ.get('ELASTICSEARCH_HOST', 'localhost:9200')
transport = ElasticsearchTransport(host)
def application(environ, start_response):
index = get_index(environ)
transport.sen... | import os
from queue import Queue
from threading import Thread
from elasticsearch_raven.transport import ElasticsearchTransport
from elasticsearch_raven.utils import get_index
host = os.environ.get('ELASTICSEARCH_HOST', 'localhost:9200')
transport = ElasticsearchTransport(host)
blocking_queue = Queue()
def send():
... | Send data to elasticsearch asynchronously. | Send data to elasticsearch asynchronously.
| Python | mit | socialwifi/elasticsearch-raven,pozytywnie/elasticsearch-raven,serathius/elasticsearch-raven | import os
from queue import Queue
from threading import Thread
from elasticsearch_raven.transport import ElasticsearchTransport
from elasticsearch_raven.utils import get_index
host = os.environ.get('ELASTICSEARCH_HOST', 'localhost:9200')
transport = ElasticsearchTransport(host)
blocking_queue = Queue()
def send():
... | Send data to elasticsearch asynchronously.
import os
from elasticsearch_raven.transport import ElasticsearchTransport
from elasticsearch_raven.utils import get_index
host = os.environ.get('ELASTICSEARCH_HOST', 'localhost:9200')
transport = ElasticsearchTransport(host)
def application(environ, start_response):
... |
2fdf35f8a9bf7a6249bc92236952655314a47080 | swapify/__init__.py | swapify/__init__.py | # -*- encoding: utf-8 -*-
__version__ = VERSION = '0.0.0' | # -*- encoding: utf-8 -*-
__author__ = 'Sebastian Vetter'
__version__ = VERSION = '0.0.0'
__license__ = 'MIT'
| Add author and lincense variables | Add author and lincense variables
| Python | mit | elbaschid/swapify | # -*- encoding: utf-8 -*-
__author__ = 'Sebastian Vetter'
__version__ = VERSION = '0.0.0'
__license__ = 'MIT'
| Add author and lincense variables
# -*- encoding: utf-8 -*-
__version__ = VERSION = '0.0.0' |
2c1673930a40fc94c3d7c7d4f764ea423b638d26 | mccurse/cli.py | mccurse/cli.py | """Package command line interface."""
import click
from .curse import Game, Mod
# Static data
MINECRAFT = {'id': 432, 'name': 'Minecraft'}
@click.group()
def cli():
"""Minecraft Curse CLI client."""
@cli.command()
@click.option(
'--refresh', is_flag=True, default=False,
help='Force refreshing of sea... | """Package command line interface."""
import click
from .curse import Game, Mod
# Static data
MINECRAFT = {'id': 432, 'name': 'Minecraft'}
@click.group()
def cli():
"""Minecraft Curse CLI client."""
@cli.command()
@click.option(
'--refresh', is_flag=True, default=False,
help='Force refreshing of sea... | Raise error when there is no term to search for | Raise error when there is no term to search for
| Python | agpl-3.0 | khardix/mccurse | """Package command line interface."""
import click
from .curse import Game, Mod
# Static data
MINECRAFT = {'id': 432, 'name': 'Minecraft'}
@click.group()
def cli():
"""Minecraft Curse CLI client."""
@cli.command()
@click.option(
'--refresh', is_flag=True, default=False,
help='Force refreshing of sea... | Raise error when there is no term to search for
"""Package command line interface."""
import click
from .curse import Game, Mod
# Static data
MINECRAFT = {'id': 432, 'name': 'Minecraft'}
@click.group()
def cli():
"""Minecraft Curse CLI client."""
@cli.command()
@click.option(
'--refresh', is_flag=True,... |
abac33bc2c8713f5187529e13557ea6b58472079 | Problems/shapeAreaCF.py | Problems/shapeAreaCF.py | def shapeArea(n):
if n < 1 or n > 10**4:
raise ValueError
if n == 1:
return 1
else:
innerArea = shapeArea(n - 1)
return innerArea + (n - 1) * 4
def main():
tests = [-1, 10**5, 1, 2, 3, 4]
results = [False, False, 1, 5, 13, 25]
for i, t in enumerate(tests):
... | Add code fight shape area solution | Add code fight shape area solution
| Python | mit | HKuz/Test_Code | def shapeArea(n):
if n < 1 or n > 10**4:
raise ValueError
if n == 1:
return 1
else:
innerArea = shapeArea(n - 1)
return innerArea + (n - 1) * 4
def main():
tests = [-1, 10**5, 1, 2, 3, 4]
results = [False, False, 1, 5, 13, 25]
for i, t in enumerate(tests):
... | Add code fight shape area solution
| |
69fe4ba3cc0338b4cd962e0571b9ae1d54e139ee | website/addons/base/serializer.py | website/addons/base/serializer.py | import abc
from website.util import web_url_for
class AddonSerializer(object):
__metaclass__ = abc.ABCMeta
def __init__(self, addon_node_settings, user):
self.addon_node_settings = addon_node_settings
self.user = user
@abc.abstractproperty
def serialized_urls(self):
pass
... | Add base class for serializing addons. | Add base class for serializing addons.
| Python | apache-2.0 | SSJohns/osf.io,chrisseto/osf.io,aaxelb/osf.io,Nesiehr/osf.io,petermalcolm/osf.io,kwierman/osf.io,MerlinZhang/osf.io,ZobairAlijan/osf.io,SSJohns/osf.io,caseyrygt/osf.io,DanielSBrown/osf.io,baylee-d/osf.io,jmcarp/osf.io,ticklemepierce/osf.io,CenterForOpenScience/osf.io,njantrania/osf.io,asanfilippo7/osf.io,HarryRybacki/o... | import abc
from website.util import web_url_for
class AddonSerializer(object):
__metaclass__ = abc.ABCMeta
def __init__(self, addon_node_settings, user):
self.addon_node_settings = addon_node_settings
self.user = user
@abc.abstractproperty
def serialized_urls(self):
pass
... | Add base class for serializing addons.
| |
0907bef1a0f92f9f7fef628afba75e1d02db1d70 | thermof/__init__.py | thermof/__init__.py | # Date: August 2017
# Author: Kutay B. Sezginel
"""
Thermal conductivity calculations of porous crystals using Lammps
"""
from .simulation import Simulation
from .trajectory import Trajectory
from .mof import MOF
| # Date: August 2017
# Author: Kutay B. Sezginel
"""
Thermal conductivity calculations of porous crystals using Lammps
"""
from .simulation import Simulation
from .trajectory import Trajectory
from .parameters import Parameters
from .mof import MOF
| Add parameter import to main module | Add parameter import to main module
| Python | mit | kbsezginel/tee_mof,kbsezginel/tee_mof | # Date: August 2017
# Author: Kutay B. Sezginel
"""
Thermal conductivity calculations of porous crystals using Lammps
"""
from .simulation import Simulation
from .trajectory import Trajectory
from .parameters import Parameters
from .mof import MOF
| Add parameter import to main module
# Date: August 2017
# Author: Kutay B. Sezginel
"""
Thermal conductivity calculations of porous crystals using Lammps
"""
from .simulation import Simulation
from .trajectory import Trajectory
from .mof import MOF
|
612ae3adb2636fb3a926cd29d87b4b388ca48476 | scripts/delete_old_user_login_events.py | scripts/delete_old_user_login_events.py | #!/usr/bin/env python
"""Delete login user events older than a given number of days.
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from datetime import datetime, timedelta
import click
from byceps.database import db
from byceps.services.user.models.event import Use... | Add script to delete user login events older than a number of days | Add script to delete user login events older than a number of days
| Python | bsd-3-clause | homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps | #!/usr/bin/env python
"""Delete login user events older than a given number of days.
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from datetime import datetime, timedelta
import click
from byceps.database import db
from byceps.services.user.models.event import Use... | Add script to delete user login events older than a number of days
| |
0ebfe4a0777850aa851c7d7bc0f642d692a1515a | 2016/qualification_round/revenge_of_the_pancakes.py | 2016/qualification_round/revenge_of_the_pancakes.py | #!/usr/bin/env python
# Google Code Jam
# Google Code Jam 2016
# Qualification Round 2016
# Problem B. Revenge of the Pancakes
# Solved all test sets
from __future__ import print_function
def calc_min_flip_step(s):
grouped_height = 1 + s.count('-+') + s.count('+-')
if s.endswith('-'):
return grouped... | Add revenge of the pancakes | Add revenge of the pancakes
| Python | apache-2.0 | laichunpongben/CodeJam | #!/usr/bin/env python
# Google Code Jam
# Google Code Jam 2016
# Qualification Round 2016
# Problem B. Revenge of the Pancakes
# Solved all test sets
from __future__ import print_function
def calc_min_flip_step(s):
grouped_height = 1 + s.count('-+') + s.count('+-')
if s.endswith('-'):
return grouped... | Add revenge of the pancakes
| |
49c99399c5b0e741e356cf320e338d019e06567d | taca/utils/config.py | taca/utils/config.py | """Load and parse configuration file."""
import yaml
from io import open
CONFIG = {}
def load_config(config_file):
"""Loads a configuration file."""
config = {}
if type(config_file) is file:
config.update(yaml.load(config_file, Loader=yaml.FullLoader) or {})
return config
else:
... | """Load and parse configuration file."""
import yaml
from io import open
CONFIG = {}
def load_config(config_file):
"""Loads a configuration file."""
config = {}
try:
with open(config_file, 'r') as f:
content = yaml.load(f, Loader=yaml.FullLoader)
config.update(content)
... | Remove unused file type check | Remove unused file type check
| Python | mit | SciLifeLab/TACA,SciLifeLab/TACA,SciLifeLab/TACA | """Load and parse configuration file."""
import yaml
from io import open
CONFIG = {}
def load_config(config_file):
"""Loads a configuration file."""
config = {}
try:
with open(config_file, 'r') as f:
content = yaml.load(f, Loader=yaml.FullLoader)
config.update(content)
... | Remove unused file type check
"""Load and parse configuration file."""
import yaml
from io import open
CONFIG = {}
def load_config(config_file):
"""Loads a configuration file."""
config = {}
if type(config_file) is file:
config.update(yaml.load(config_file, Loader=yaml.FullLoader) or {})
... |
5f7a694c72821110091d6aff5ee854681137bdcc | tests/testuser.py | tests/testuser.py | import unittest
from steam import user
class ProfileTestCase(unittest.TestCase):
VALID_ID64 = 76561198014028523
INVALID_ID64 = 123
# This is weird but there should be no reason that it's invalid
# So Valve, if you see this, be gewd guys and make 33 bit (condensed)
# IDs work properly. Or at least p... | Add initial steam.user test fixtures | Add initial steam.user test fixtures
| Python | isc | miedzinski/steamodd,Lagg/steamodd | import unittest
from steam import user
class ProfileTestCase(unittest.TestCase):
VALID_ID64 = 76561198014028523
INVALID_ID64 = 123
# This is weird but there should be no reason that it's invalid
# So Valve, if you see this, be gewd guys and make 33 bit (condensed)
# IDs work properly. Or at least p... | Add initial steam.user test fixtures
| |
00cea9f8e51f53f338e19adf0165031d2f9cad77 | c2corg_ui/templates/utils/format.py | c2corg_ui/templates/utils/format.py | import bbcode
import markdown
import html
from c2corg_ui.format.wikilinks import C2CWikiLinkExtension
_markdown_parser = None
_bbcode_parser = None
def _get_markdown_parser():
global _markdown_parser
if not _markdown_parser:
extensions = [
C2CWikiLinkExtension(),
]
_mark... | import bbcode
import markdown
import html
from c2corg_ui.format.wikilinks import C2CWikiLinkExtension
from markdown.extensions.nl2br import Nl2BrExtension
from markdown.extensions.toc import TocExtension
_markdown_parser = None
_bbcode_parser = None
def _get_markdown_parser():
global _markdown_parser
if no... | Enable markdown extensions for TOC and linebreaks | Enable markdown extensions for TOC and linebreaks
| Python | agpl-3.0 | Courgetteandratatouille/v6_ui,Courgetteandratatouille/v6_ui,olaurendeau/v6_ui,c2corg/v6_ui,c2corg/v6_ui,c2corg/v6_ui,Courgetteandratatouille/v6_ui,olaurendeau/v6_ui,olaurendeau/v6_ui,c2corg/v6_ui,Courgetteandratatouille/v6_ui,olaurendeau/v6_ui | import bbcode
import markdown
import html
from c2corg_ui.format.wikilinks import C2CWikiLinkExtension
from markdown.extensions.nl2br import Nl2BrExtension
from markdown.extensions.toc import TocExtension
_markdown_parser = None
_bbcode_parser = None
def _get_markdown_parser():
global _markdown_parser
if no... | Enable markdown extensions for TOC and linebreaks
import bbcode
import markdown
import html
from c2corg_ui.format.wikilinks import C2CWikiLinkExtension
_markdown_parser = None
_bbcode_parser = None
def _get_markdown_parser():
global _markdown_parser
if not _markdown_parser:
extensions = [
... |
131033fa3ab170ac2a66c1dd89074ea74702fb52 | icekit/page_types/articles/migrations/0002_auto_20161012_2231.py | icekit/page_types/articles/migrations/0002_auto_20161012_2231.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('icekit_articles', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='article',
name=... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('icekit_articles', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='article',
name=... | Remove vestigial (?) "woo" default for article slug and title fields. | Remove vestigial (?) "woo" default for article slug and title fields.
| Python | mit | ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('icekit_articles', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='article',
name=... | Remove vestigial (?) "woo" default for article slug and title fields.
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('icekit_articles', '0001_initial'),
]
operations = [
m... |
7946b8fe8a8cddeef675cc60b5ebb64a250ea2c4 | smugmug_test.py | smugmug_test.py | import smugmug
import unittest
class MockNode(object):
def __init__(self):
self._reset_times = 0
def reset_cache(self):
self._reset_times += 1
class TestChildCacheGarbageCollector(unittest.TestCase):
def test_clears_child_cache(self):
gc = smugmug.ChildCacheGarbageCollector(3)
nodes = [MockNo... | Add a unit test for the ChildCacheGarbageColleector class. | Add a unit test for the ChildCacheGarbageColleector class.
| Python | mit | graveljp/smugcli | import smugmug
import unittest
class MockNode(object):
def __init__(self):
self._reset_times = 0
def reset_cache(self):
self._reset_times += 1
class TestChildCacheGarbageCollector(unittest.TestCase):
def test_clears_child_cache(self):
gc = smugmug.ChildCacheGarbageCollector(3)
nodes = [MockNo... | Add a unit test for the ChildCacheGarbageColleector class.
| |
7a6e8af11ac28cf10e5ce33637bc883324dde641 | game/models.py | game/models.py | from django.db import models
from django.utils import timezone
class Task(models.Model):
EQUALS_CHECK = 'EQ'
REGEX_CHECK = 'RE'
CHECK_CHOICES = (
(EQUALS_CHECK, 'Equals'),
(REGEX_CHECK, 'Regex'),
)
title_ru = models.CharField(null=False, blank=False, max_length=256)
title_en... | from django.db import models
from django.utils import timezone
class Task(models.Model):
EQUALS_CHECK = 'EQ'
REGEX_CHECK = 'RE'
CHECK_CHOICES = (
(EQUALS_CHECK, 'Equals'),
(REGEX_CHECK, 'Regex'),
)
title_ru = models.CharField(null=False, blank=False, max_length=256)
title_en... | Add new fields to the task model | Add new fields to the task model
| Python | bsd-3-clause | stefantsov/blackbox3,stefantsov/blackbox3,stefantsov/blackbox3 | from django.db import models
from django.utils import timezone
class Task(models.Model):
EQUALS_CHECK = 'EQ'
REGEX_CHECK = 'RE'
CHECK_CHOICES = (
(EQUALS_CHECK, 'Equals'),
(REGEX_CHECK, 'Regex'),
)
title_ru = models.CharField(null=False, blank=False, max_length=256)
title_en... | Add new fields to the task model
from django.db import models
from django.utils import timezone
class Task(models.Model):
EQUALS_CHECK = 'EQ'
REGEX_CHECK = 'RE'
CHECK_CHOICES = (
(EQUALS_CHECK, 'Equals'),
(REGEX_CHECK, 'Regex'),
)
title_ru = models.CharField(null=False, blank=F... |
6c349621dd3331bf92f803d2d66c96868f8e94c6 | src/geelweb/django/editos/runtests.py | src/geelweb/django/editos/runtests.py | import os
import sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'test_settings'
test_dir = os.path.dirname(__file__)
sys.path.insert(0, test_dir)
from django.test.utils import get_runner
from django.conf import settings
def runtests():
TestRunner = get_runner(settings)
test_runner = TestRunner(verbosity=1, int... | import os
import sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'test_settings'
test_dir = os.path.dirname(__file__)
sys.path.insert(0, test_dir)
import django
from django.test.utils import get_runner
from django.conf import settings
def runtests():
if django.VERSION[0] == 1 and django.VERSION[1] < 7:
from... | Upgrade to test using django 1.7 and 1.8 | Upgrade to test using django 1.7 and 1.8
| Python | mit | geelweb/django-editos,geelweb/django-editos | import os
import sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'test_settings'
test_dir = os.path.dirname(__file__)
sys.path.insert(0, test_dir)
import django
from django.test.utils import get_runner
from django.conf import settings
def runtests():
if django.VERSION[0] == 1 and django.VERSION[1] < 7:
from... | Upgrade to test using django 1.7 and 1.8
import os
import sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'test_settings'
test_dir = os.path.dirname(__file__)
sys.path.insert(0, test_dir)
from django.test.utils import get_runner
from django.conf import settings
def runtests():
TestRunner = get_runner(settings)
... |
e6807ad6d71e3b115828870bb068777ad865f329 | tests/test_client.py | tests/test_client.py | import pylibmc
from pylibmc.test import make_test_client
from tests import PylibmcTestCase
from nose.tools import eq_, ok_
class ClientTests(PylibmcTestCase):
def test_zerokey(self):
bc = make_test_client(binary=True)
k = "\x00\x01"
ok_(bc.set(k, "test"))
rk = bc.get_multi([k]).keys... | Add tests for CAS and other things | Add tests for CAS and other things
Refs #63
| Python | bsd-3-clause | lericson/pylibmc,lericson/pylibmc,lericson/pylibmc | import pylibmc
from pylibmc.test import make_test_client
from tests import PylibmcTestCase
from nose.tools import eq_, ok_
class ClientTests(PylibmcTestCase):
def test_zerokey(self):
bc = make_test_client(binary=True)
k = "\x00\x01"
ok_(bc.set(k, "test"))
rk = bc.get_multi([k]).keys... | Add tests for CAS and other things
Refs #63
| |
1bd57b89cb0deed5081540e5b29f7531215fa121 | polyaxon_client/transport/socket_transport.py | polyaxon_client/transport/socket_transport.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import json
import websocket
from polyaxon_client.logger import logger
class SocketTransportMixin(object):
"""Socket operations transport."""
def socket(self, url, message_handler, headers=None):
webs = websock... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import json
import six
import websocket
from polyaxon_client.logger import logger
class SocketTransportMixin(object):
"""Socket operations transport."""
def socket(self, url, message_handler, headers=None):
web... | Check if string before decoding | Check if string before decoding
| Python | apache-2.0 | polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import json
import six
import websocket
from polyaxon_client.logger import logger
class SocketTransportMixin(object):
"""Socket operations transport."""
def socket(self, url, message_handler, headers=None):
web... | Check if string before decoding
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import json
import websocket
from polyaxon_client.logger import logger
class SocketTransportMixin(object):
"""Socket operations transport."""
def socket(self, url, message_handler, head... |
5a680d25a5e5a697440f17639d1a0617b903aa06 | opps/__init__.py | opps/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
VERSION = (0, 0, 1)
__version__ = ".".join(map(str, VERSION))
__status__ = "Development"
__description__ = u"Opps CMS websites magazines and high-traffic"
__author__ = u"Thiago Avelino"
__credits__ = []
__email__ = u"opps-developers@googlegroups.com"
__license__ = u"BSD"... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.conf import settings
VERSION = (0, 0, 1)
__version__ = ".".join(map(str, VERSION))
__status__ = "Development"
__description__ = u"Opps CMS websites magazines and high-traffic"
__author__ = u"Thiago Avelino"
__credits__ = []
__email__ = u"opps-developers@googl... | Add installed app on opps init | Add installed app on opps init
| Python | mit | jeanmask/opps,jeanmask/opps,opps/opps,opps/opps,jeanmask/opps,williamroot/opps,YACOWS/opps,opps/opps,YACOWS/opps,williamroot/opps,YACOWS/opps,williamroot/opps,YACOWS/opps,williamroot/opps,opps/opps,jeanmask/opps | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.conf import settings
VERSION = (0, 0, 1)
__version__ = ".".join(map(str, VERSION))
__status__ = "Development"
__description__ = u"Opps CMS websites magazines and high-traffic"
__author__ = u"Thiago Avelino"
__credits__ = []
__email__ = u"opps-developers@googl... | Add installed app on opps init
#!/usr/bin/env python
# -*- coding: utf-8 -*-
VERSION = (0, 0, 1)
__version__ = ".".join(map(str, VERSION))
__status__ = "Development"
__description__ = u"Opps CMS websites magazines and high-traffic"
__author__ = u"Thiago Avelino"
__credits__ = []
__email__ = u"opps-developers@google... |
d9a8d30ba12f4fb61fdffe353d225c2ffcd074fa | fabfile.py | fabfile.py | from fabric.api import cd, run, sudo, env, execute
from datetime import datetime
env.hosts = ['andrewlorente.com']
apps = {
'bloge': ['bloge@andrewlorente.com'],
'andrewlorente': ['andrewlorente@andrewlorente.com'],
}
def deploy(app):
if app not in apps.keys():
raise Exception("Unknown deploy targ... | from fabric.api import cd, run, sudo, env, execute, task
from datetime import datetime
env.hosts = ['andrewlorente.com']
apps = {
'bloge': ['bloge@andrewlorente.com'],
'andrewlorente': ['andrewlorente@andrewlorente.com'],
}
@task
def deploy(app):
if app not in apps.keys():
raise Exception("Unknown... | Hide support functions from the public interface | Hide support functions from the public interface
| Python | mit | ErinCall/andrewlorente | from fabric.api import cd, run, sudo, env, execute, task
from datetime import datetime
env.hosts = ['andrewlorente.com']
apps = {
'bloge': ['bloge@andrewlorente.com'],
'andrewlorente': ['andrewlorente@andrewlorente.com'],
}
@task
def deploy(app):
if app not in apps.keys():
raise Exception("Unknown... | Hide support functions from the public interface
from fabric.api import cd, run, sudo, env, execute
from datetime import datetime
env.hosts = ['andrewlorente.com']
apps = {
'bloge': ['bloge@andrewlorente.com'],
'andrewlorente': ['andrewlorente@andrewlorente.com'],
}
def deploy(app):
if app not in apps.ke... |
33535ae325e15c7341c6330cf1caa756cfa09831 | tests/lib/test_coins.py | tests/lib/test_coins.py | import electrumx.lib.coins as coins
def test_bitcoin_cash():
raw_header = bytes.fromhex(
"00000020df975c121dcbc18bbb7ddfd0419fc368b45db86b48c87e0"
"1000000000000000036ae3dd40a10a40d3050de13ca546a2f81589d"
"e2d2f317925a43a115437e2381f5bf535b94da0118ac8df8c5"
)
height = 540000
el... | Add test for BCH electrum header | Add test for BCH electrum header
| Python | mit | thelazier/electrumx,thelazier/electrumx | import electrumx.lib.coins as coins
def test_bitcoin_cash():
raw_header = bytes.fromhex(
"00000020df975c121dcbc18bbb7ddfd0419fc368b45db86b48c87e0"
"1000000000000000036ae3dd40a10a40d3050de13ca546a2f81589d"
"e2d2f317925a43a115437e2381f5bf535b94da0118ac8df8c5"
)
height = 540000
el... | Add test for BCH electrum header
| |
0b76510e58c4eaa71fb37c563b00fa6cc67d49fc | tests/print_view_hierarchy_test.py | tests/print_view_hierarchy_test.py | """Tests for scripts/print_view_hierarchy.py."""
import re
import unittest
from test_utils import import_utils
import_utils.prepare_lldb_import_or_exit()
import lldb
import_utils.prepare_for_scripts_imports()
from scripts import print_view_hierarchy
class PrintViewHierarchyTest(unittest.TestCase):
def testPrintV... | Add a test for |pv| command. | Add a test for |pv| command.
| Python | mit | mrhappyasthma/HappyDebugging,mrhappyasthma/happydebugging | """Tests for scripts/print_view_hierarchy.py."""
import re
import unittest
from test_utils import import_utils
import_utils.prepare_lldb_import_or_exit()
import lldb
import_utils.prepare_for_scripts_imports()
from scripts import print_view_hierarchy
class PrintViewHierarchyTest(unittest.TestCase):
def testPrintV... | Add a test for |pv| command.
| |
594923a44d80a2879eb1ed5b9b0a6be11e13c88f | tests/Epsilon_tests/ImportTest.py | tests/Epsilon_tests/ImportTest.py | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import TestCase, main
from grammpy import EPS
from grammpy import EPSILON
class ImportTest(TestCase):
def test_idSame(self):
self.assertEqual(id(EPS),id(EPSILON)... | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import TestCase, main
from grammpy import EPS
from grammpy import EPSILON
class ImportTest(TestCase):
def test_idSame(self):
self.assertEqual(id(EPS), id(EPSILON))... | Revert "Revert "Add tests to compare epsilon with another objects"" | Revert "Revert "Add tests to compare epsilon with another objects""
This reverts commit d13b3d89124d03f563c2ee2143ae16eec7d0b191.
| Python | mit | PatrikValkovic/grammpy | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import TestCase, main
from grammpy import EPS
from grammpy import EPSILON
class ImportTest(TestCase):
def test_idSame(self):
self.assertEqual(id(EPS), id(EPSILON))... | Revert "Revert "Add tests to compare epsilon with another objects""
This reverts commit d13b3d89124d03f563c2ee2143ae16eec7d0b191.
#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import TestCase, main
from grammpy import EPS
from... |
8905993c0daa140b10cb04dca1e7bed7b813ea7a | imagedownloader/libs/console.py | imagedownloader/libs/console.py | import sys
import pyttsx
import aspects
from datetime import datetime
engine = pyttsx.init()
def show(*objs):
begin = '' if '\r' in objs[0] or '\b' in objs[0] else '\n'
sys.stdout.write(begin)
for part in objs:
sys.stdout.write(str(part))
sys.stdout.flush()
def say(speech):
#NOT engine.startLoop()
show(speec... | import sys
import pyttsx
import aspects
from datetime import datetime
engine = pyttsx.init()
def show(*objs):
begin = '' if '\r' in objs[0] or '\b' in objs[0] else '\n'
sys.stdout.write(begin)
for part in objs:
sys.stdout.write(str(part))
sys.stdout.flush()
def say(speech):
#NOT engine.startLoop()
show(speec... | Add UTC timezone to datetimes in the libs folder. | Add UTC timezone to datetimes in the libs folder.
| Python | mit | ahMarrone/solar_radiation_model,scottlittle/solar_radiation_model,gersolar/solar_radiation_model | import sys
import pyttsx
import aspects
from datetime import datetime
engine = pyttsx.init()
def show(*objs):
begin = '' if '\r' in objs[0] or '\b' in objs[0] else '\n'
sys.stdout.write(begin)
for part in objs:
sys.stdout.write(str(part))
sys.stdout.flush()
def say(speech):
#NOT engine.startLoop()
show(speec... | Add UTC timezone to datetimes in the libs folder.
import sys
import pyttsx
import aspects
from datetime import datetime
engine = pyttsx.init()
def show(*objs):
begin = '' if '\r' in objs[0] or '\b' in objs[0] else '\n'
sys.stdout.write(begin)
for part in objs:
sys.stdout.write(str(part))
sys.stdout.flush()
de... |
c4e1059b387269b6098d05d2227c085e7931b140 | setup.py | setup.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from distutils.core import setup, Extension
cpp_args = ['-std=c++11', '-stdlib=libc++', '-mmacosx-version-min=10.7']
e... | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from distutils.core import setup, Extension
cpp_args = ['-std=c++11', '-stdlib=libc++', '-mmacosx-version-min=10.7']
e... | Update module description for clarity | Update module description for clarity
| Python | mpl-2.0 | natelust/least_asymmetry,natelust/least_asymmetry,natelust/least_asymmetry | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from distutils.core import setup, Extension
cpp_args = ['-std=c++11', '-stdlib=libc++', '-mmacosx-version-min=10.7']
e... | Update module description for clarity
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from distutils.core import setup, Extension
cpp_args = ['-std=c++11', '-stdlib=l... |
563220ef19395201aed7f6392519f84db4ec7a77 | tests/test_midas.py | tests/test_midas.py | import datetime
from midas import mix
from midas.midas import estimate, forecast
def test_estimate(gdp_data, farmpay_data):
y, yl, x, yf, ylf, xf = mix.mix_freq(gdp_data.gdp, farmpay_data.farmpay, 3, 1, 1,
start_date=datetime.datetime(1985, 1, 1),
... | import datetime
import numpy as np
from midas import mix
from midas.midas import estimate, forecast
def test_estimate(gdp_data, farmpay_data):
y, yl, x, yf, ylf, xf = mix.mix_freq(gdp_data.gdp, farmpay_data.farmpay, 3, 1, 1,
start_date=datetime.datetime(1985, 1, 1),
... | Add assertion for forecast test | Add assertion for forecast test
| Python | mit | mikemull/midaspy | import datetime
import numpy as np
from midas import mix
from midas.midas import estimate, forecast
def test_estimate(gdp_data, farmpay_data):
y, yl, x, yf, ylf, xf = mix.mix_freq(gdp_data.gdp, farmpay_data.farmpay, 3, 1, 1,
start_date=datetime.datetime(1985, 1, 1),
... | Add assertion for forecast test
import datetime
from midas import mix
from midas.midas import estimate, forecast
def test_estimate(gdp_data, farmpay_data):
y, yl, x, yf, ylf, xf = mix.mix_freq(gdp_data.gdp, farmpay_data.farmpay, 3, 1, 1,
start_date=datetime.datetime(198... |
0d58d7c7a3eee8748efbf7405aba7a5f3e0f7eb3 | bluebottle/funding_telesom/admin.py | bluebottle/funding_telesom/admin.py | from django.contrib import admin
from bluebottle.funding.admin import PaymentChildAdmin, PaymentProviderChildAdmin, BankAccountChildAdmin
from bluebottle.funding.models import PaymentProvider, Payment
from bluebottle.funding_telesom.models import TelesomPayment, TelesomPaymentProvider, TelesomBankAccount
@admin.regi... | from django.contrib import admin
from bluebottle.funding.admin import PaymentChildAdmin, PaymentProviderChildAdmin, BankAccountChildAdmin
from bluebottle.funding.models import PaymentProvider, Payment
from bluebottle.funding_telesom.models import TelesomPayment, TelesomPaymentProvider, TelesomBankAccount
@admin.regi... | Add some search fields to Zaad | Add some search fields to Zaad
| Python | bsd-3-clause | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | from django.contrib import admin
from bluebottle.funding.admin import PaymentChildAdmin, PaymentProviderChildAdmin, BankAccountChildAdmin
from bluebottle.funding.models import PaymentProvider, Payment
from bluebottle.funding_telesom.models import TelesomPayment, TelesomPaymentProvider, TelesomBankAccount
@admin.regi... | Add some search fields to Zaad
from django.contrib import admin
from bluebottle.funding.admin import PaymentChildAdmin, PaymentProviderChildAdmin, BankAccountChildAdmin
from bluebottle.funding.models import PaymentProvider, Payment
from bluebottle.funding_telesom.models import TelesomPayment, TelesomPaymentProvider, ... |
8db643b23716e3678ec02bcea6ade0f10a81bf76 | setup.py | setup.py | #!/usr/bin/env python
"""Setup script for PythonTemplateDemo."""
import setuptools
from demo import __project__, __version__
import os
if os.path.exists('README.rst'):
README = open('README.rst').read()
else:
README = "" # a placeholder until README is generated on release
CHANGES = open('CHANGES.md').read... | #!/usr/bin/env python
"""Setup script for PythonTemplateDemo."""
import setuptools
from demo import __project__, __version__
import os
if os.path.exists('README.rst'):
README = open('README.rst').read()
else:
README = "" # a placeholder until README is generated on release
CHANGES = open('CHANGES.md').read... | Deploy Travis CI build 623 to GitHub | Deploy Travis CI build 623 to GitHub
| Python | mit | jacebrowning/template-python-demo | #!/usr/bin/env python
"""Setup script for PythonTemplateDemo."""
import setuptools
from demo import __project__, __version__
import os
if os.path.exists('README.rst'):
README = open('README.rst').read()
else:
README = "" # a placeholder until README is generated on release
CHANGES = open('CHANGES.md').read... | Deploy Travis CI build 623 to GitHub
#!/usr/bin/env python
"""Setup script for PythonTemplateDemo."""
import setuptools
from demo import __project__, __version__
import os
if os.path.exists('README.rst'):
README = open('README.rst').read()
else:
README = "" # a placeholder until README is generated on rel... |
33f050ab022626846510a7cbcd4b299612f2ff85 | tvmaze/tests.py | tvmaze/tests.py | import unittest
from tvmazereader import main
class TestMethods(unittest.TestCase):
def test_readerMain(self):
data = main()
self.assertEqual(len(data),2)
if __name__ == '__main__':
unittest.main() | import unittest
from tvmazereader import main
class TestMethods(unittest.TestCase):
def test_readerMain(self):
data = main()
self.assertEqual(len(data),2)
if __name__ == '__main__':
unittest.main()
#python -m unittest discover -v | Add comment show test usage from console. | Add comment show test usage from console.
| Python | mit | LairdStreak/MyPyPlayGround,LairdStreak/MyPyPlayGround,LairdStreak/MyPyPlayGround | import unittest
from tvmazereader import main
class TestMethods(unittest.TestCase):
def test_readerMain(self):
data = main()
self.assertEqual(len(data),2)
if __name__ == '__main__':
unittest.main()
#python -m unittest discover -v | Add comment show test usage from console.
import unittest
from tvmazereader import main
class TestMethods(unittest.TestCase):
def test_readerMain(self):
data = main()
self.assertEqual(len(data),2)
if __name__ == '__main__':
unittest.main() |
12b8cd254bad5c2cb15de3f0c3e69ab78083fc48 | server/app.py | server/app.py | """This module contains basic functions to instantiate the BigchainDB API.
The application is implemented in Flask and runs using Gunicorn.
"""
import os
from flask import Flask
from flask.ext.cors import CORS
from server.lib.api.views import api_views
def create_app(debug):
"""Return an instance of the Flask ... | """This module contains basic functions to instantiate the BigchainDB API.
The application is implemented in Flask and runs using Gunicorn.
"""
import os
from flask import Flask
from flask.ext.cors import CORS
from server.lib.api.views import api_views
def create_app(debug):
"""Return an instance of the Flask ... | Fix CORS when running the api server with Docker | Fix CORS when running the api server with Docker
| Python | apache-2.0 | bigchaindb/bigchaindb-examples,bigchaindb/bigchaindb-examples,bigchaindb/bigchaindb-examples | """This module contains basic functions to instantiate the BigchainDB API.
The application is implemented in Flask and runs using Gunicorn.
"""
import os
from flask import Flask
from flask.ext.cors import CORS
from server.lib.api.views import api_views
def create_app(debug):
"""Return an instance of the Flask ... | Fix CORS when running the api server with Docker
"""This module contains basic functions to instantiate the BigchainDB API.
The application is implemented in Flask and runs using Gunicorn.
"""
import os
from flask import Flask
from flask.ext.cors import CORS
from server.lib.api.views import api_views
def create_a... |
d6f4afa82118d8c1ced7ddc8152f7b31b4cb898a | setup.py | setup.py | # coding: utf-8
from distutils.core import setup
# python setup.py sdist --formats=bztar
# python setup.py sdist --formats=bztar upload
description = 'National characters transcription module.'
import trans
long_description = open('documentation.rst', 'rb').read()
version = trans.__version__
setup(
name =... | # coding: utf-8
from distutils.core import setup
# python setup.py sdist --formats=bztar
# python setup.py sdist --formats=bztar upload
description = 'National characters transcription module.'
import trans
long_description = open('documentation.rst', 'rb').read()
version = trans.__version__
setup(
name =... | Change license to BSD. 1.4 | Change license to BSD. 1.4
| Python | bsd-2-clause | zzzsochi/trans | # coding: utf-8
from distutils.core import setup
# python setup.py sdist --formats=bztar
# python setup.py sdist --formats=bztar upload
description = 'National characters transcription module.'
import trans
long_description = open('documentation.rst', 'rb').read()
version = trans.__version__
setup(
name =... | Change license to BSD. 1.4
# coding: utf-8
from distutils.core import setup
# python setup.py sdist --formats=bztar
# python setup.py sdist --formats=bztar upload
description = 'National characters transcription module.'
import trans
long_description = open('documentation.rst', 'rb').read()
version = trans.__versi... |
216a9176ecf395a7461c6f8ec926d48fa1634bad | manager/__init__.py | manager/__init__.py | import os
from flask import Flask
from flask.ext.assets import Bundle, Environment
app = Flask(__name__)
# Load the app config
app.config.from_object("config.Config")
assets = Environment(app)
assets.load_path = [
os.path.join(os.path.dirname(__file__), 'static'),
os.path.join(os.path.dirname(__file__), 's... | import os
from flask import Flask
from flask.ext.assets import Bundle, Environment
app = Flask(__name__)
# Load the app config
app.config.from_object("config.Config")
assets = Environment(app)
assets.load_path = [
os.path.join(os.path.dirname(__file__), 'static'),
os.path.join(os.path.dirname(__file__), 's... | Change theme to sandstone (bootswatch) | Change theme to sandstone (bootswatch)
| Python | mit | hreeder/ignition,hreeder/ignition,hreeder/ignition | import os
from flask import Flask
from flask.ext.assets import Bundle, Environment
app = Flask(__name__)
# Load the app config
app.config.from_object("config.Config")
assets = Environment(app)
assets.load_path = [
os.path.join(os.path.dirname(__file__), 'static'),
os.path.join(os.path.dirname(__file__), 's... | Change theme to sandstone (bootswatch)
import os
from flask import Flask
from flask.ext.assets import Bundle, Environment
app = Flask(__name__)
# Load the app config
app.config.from_object("config.Config")
assets = Environment(app)
assets.load_path = [
os.path.join(os.path.dirname(__file__), 'static'),
os... |
bcc6d199186953b5ae05f7e93bf61c169ac89c77 | opps/archives/admin.py | opps/archives/admin.py | from django.contrib import admin
from django.contrib.auth import get_user_model
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from opps.core.admin import apply_opps_rules
from opps.contrib.multisite.admin import AdminViewPermission
from .models import File
@apply_opps_rul... | # coding: utf-8
from django.contrib import admin
from django.contrib.auth import get_user_model
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from opps.core.admin import apply_opps_rules
from opps.contrib.multisite.admin import AdminViewPermission
from .models import File
... | Add list_display on FileAdmin and download_link def | Add list_display on FileAdmin and download_link def
| Python | mit | YACOWS/opps,opps/opps,opps/opps,jeanmask/opps,williamroot/opps,jeanmask/opps,opps/opps,YACOWS/opps,YACOWS/opps,williamroot/opps,williamroot/opps,YACOWS/opps,jeanmask/opps,jeanmask/opps,williamroot/opps,opps/opps | # coding: utf-8
from django.contrib import admin
from django.contrib.auth import get_user_model
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from opps.core.admin import apply_opps_rules
from opps.contrib.multisite.admin import AdminViewPermission
from .models import File
... | Add list_display on FileAdmin and download_link def
from django.contrib import admin
from django.contrib.auth import get_user_model
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from opps.core.admin import apply_opps_rules
from opps.contrib.multisite.admin import AdminViewP... |
100e0a406551707e92826c2374f9c135613f6858 | bin/index_to_contig.py | bin/index_to_contig.py | """
Given a tuple of index1, index2, correlation and a tuple of index, contig
rewrite the correlation to be contig1, contig2, correlation
"""
import os
import sys
import argparse
__author__ = 'Rob Edwards'
if __name__ == "__main__":
parser = argparse.ArgumentParser(description=' ')
parser.add_argument('-i',... | Convert an index to a contig | Convert an index to a contig
| Python | mit | linsalrob/EdwardsLab,linsalrob/EdwardsLab,linsalrob/EdwardsLab,linsalrob/EdwardsLab,linsalrob/EdwardsLab | """
Given a tuple of index1, index2, correlation and a tuple of index, contig
rewrite the correlation to be contig1, contig2, correlation
"""
import os
import sys
import argparse
__author__ = 'Rob Edwards'
if __name__ == "__main__":
parser = argparse.ArgumentParser(description=' ')
parser.add_argument('-i',... | Convert an index to a contig
| |
dfeb82974768e96efc4cba1388ac4bf098d3fbf4 | UM/Qt/Bindings/MeshFileHandlerProxy.py | UM/Qt/Bindings/MeshFileHandlerProxy.py | from PyQt5.QtCore import QObject, pyqtSlot, pyqtProperty, pyqtSignal
from UM.Application import Application
from UM.Logger import Logger
class MeshFileHandlerProxy(QObject):
def __init__(self, parent = None):
super().__init__(parent)
self._mesh_handler = Application.getInstance().getMeshFileHandle... | from PyQt5.QtCore import QObject, pyqtSlot, pyqtProperty, pyqtSignal
from UM.Application import Application
from UM.Logger import Logger
class MeshFileHandlerProxy(QObject):
def __init__(self, parent = None):
super().__init__(parent)
self._mesh_handler = Application.getInstance().getMeshFileHandle... | Update the supported file types list exposed to QML to use the new dict correctly | Update the supported file types list exposed to QML to use the new dict correctly
| Python | agpl-3.0 | onitake/Uranium,onitake/Uranium | from PyQt5.QtCore import QObject, pyqtSlot, pyqtProperty, pyqtSignal
from UM.Application import Application
from UM.Logger import Logger
class MeshFileHandlerProxy(QObject):
def __init__(self, parent = None):
super().__init__(parent)
self._mesh_handler = Application.getInstance().getMeshFileHandle... | Update the supported file types list exposed to QML to use the new dict correctly
from PyQt5.QtCore import QObject, pyqtSlot, pyqtProperty, pyqtSignal
from UM.Application import Application
from UM.Logger import Logger
class MeshFileHandlerProxy(QObject):
def __init__(self, parent = None):
super().__init... |
cd97e8d8f8578abef246f3780b4c0ec10eebc8fa | tests/test_WListBox.py | tests/test_WListBox.py | import unittest
from picotui.widgets import WListBox
from picotui.defs import KEY_DOWN
from picotui.context import Context
class User:
def __init__(self, name, age):
self.name = name
self.age = age
class UserListBox(WListBox):
def __init__(self, width, height, items):
super().__init_... | Add test for rendering WListBox in case of non-str content. | tests: Add test for rendering WListBox in case of non-str content.
| Python | mit | pfalcon/picotui | import unittest
from picotui.widgets import WListBox
from picotui.defs import KEY_DOWN
from picotui.context import Context
class User:
def __init__(self, name, age):
self.name = name
self.age = age
class UserListBox(WListBox):
def __init__(self, width, height, items):
super().__init_... | tests: Add test for rendering WListBox in case of non-str content.
| |
35f267249955b4c09cbf4432e452dc987488454e | tests/test_session.py | tests/test_session.py | #!/usr/bin/env python
# coding=utf-8
try:
import unittest.mock as mock
except ImportError:
import mock
import unittest
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from nessusapi.session import Session
from nessusapi.session import Request
class SessionTestCase(unit... | Add basic tests for session | Add basic tests for session
| Python | mit | sait-berkeley-infosec/pynessus-api | #!/usr/bin/env python
# coding=utf-8
try:
import unittest.mock as mock
except ImportError:
import mock
import unittest
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from nessusapi.session import Session
from nessusapi.session import Request
class SessionTestCase(unit... | Add basic tests for session
| |
d8c1c7da47e2568cecc1fd6dff0fec7661b39125 | turbosms/routers.py | turbosms/routers.py |
class SMSRouter(object):
app_label = 'sms'
db_name = 'sms'
def db_for_read(self, model, **hints):
if model._meta.app_label == self.app_label:
return self.db_name
return None
def db_for_write(self, model, **hints):
if model._meta.app_label == self.app_label:
... |
class TurboSMSRouter(object):
app_label = 'turbosms'
db_name = 'turbosms'
def db_for_read(self, model, **hints):
if model._meta.app_label == self.app_label:
return self.db_name
return None
def db_for_write(self, model, **hints):
if model._meta.app_label == self... | Fix bug in sms router. | Fix bug in sms router.
| Python | isc | pmaigutyak/mp-turbosms |
class TurboSMSRouter(object):
app_label = 'turbosms'
db_name = 'turbosms'
def db_for_read(self, model, **hints):
if model._meta.app_label == self.app_label:
return self.db_name
return None
def db_for_write(self, model, **hints):
if model._meta.app_label == self... | Fix bug in sms router.
class SMSRouter(object):
app_label = 'sms'
db_name = 'sms'
def db_for_read(self, model, **hints):
if model._meta.app_label == self.app_label:
return self.db_name
return None
def db_for_write(self, model, **hints):
if model._meta.app_labe... |
27112881583e53d790e66d31a2bb4d2a996ee405 | python/sparknlp/functions.py | python/sparknlp/functions.py | from pyspark.sql.functions import udf
from pyspark.sql.types import *
from pyspark.sql import DataFrame
import sys
import sparknlp
def map_annotations(f, output_type: DataType):
sys.modules['sparknlp.annotation'] = sparknlp # Makes Annotation() pickle serializable in top-level
return udf(
lambda con... | from pyspark.sql.functions import udf
from pyspark.sql.types import *
from pyspark.sql import DataFrame
from sparknlp.annotation import Annotation
import sys
import sparknlp
def map_annotations(f, output_type: DataType):
sys.modules['sparknlp.annotation'] = sparknlp # Makes Annotation() pickle serializable in t... | Move import to top level to avoid import fail after fist time on sys.modules hack | Move import to top level to avoid import fail after fist time on sys.modules hack
| Python | apache-2.0 | JohnSnowLabs/spark-nlp,JohnSnowLabs/spark-nlp,JohnSnowLabs/spark-nlp,JohnSnowLabs/spark-nlp | from pyspark.sql.functions import udf
from pyspark.sql.types import *
from pyspark.sql import DataFrame
from sparknlp.annotation import Annotation
import sys
import sparknlp
def map_annotations(f, output_type: DataType):
sys.modules['sparknlp.annotation'] = sparknlp # Makes Annotation() pickle serializable in t... | Move import to top level to avoid import fail after fist time on sys.modules hack
from pyspark.sql.functions import udf
from pyspark.sql.types import *
from pyspark.sql import DataFrame
import sys
import sparknlp
def map_annotations(f, output_type: DataType):
sys.modules['sparknlp.annotation'] = sparknlp # Make... |
9f0b9b68a3c9dfaa64942e55fc97e435b8eb6f50 | bayespy/nodes/__init__.py | bayespy/nodes/__init__.py | ################################################################################
# Copyright (C) 2013 Jaakko Luttinen
#
# This file is licensed under the MIT License.
################################################################################
"""
Package for nodes used to construct the model.
Stochastic nodes
=... | ################################################################################
# Copyright (C) 2013 Jaakko Luttinen
#
# This file is licensed under the MIT License.
################################################################################
"""
Package for nodes used to construct the model.
Stochastic nodes
=... | Include Add node in user API documentation | DOC: Include Add node in user API documentation
| Python | mit | bayespy/bayespy,jluttine/bayespy | ################################################################################
# Copyright (C) 2013 Jaakko Luttinen
#
# This file is licensed under the MIT License.
################################################################################
"""
Package for nodes used to construct the model.
Stochastic nodes
=... | DOC: Include Add node in user API documentation
################################################################################
# Copyright (C) 2013 Jaakko Luttinen
#
# This file is licensed under the MIT License.
################################################################################
"""
Package for nodes... |
67a0f6c0aa8015f5dea7dcc8c7bc6cae809016f5 | setup.py | setup.py | import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='windpowerlib',
version='0.1.2dev',
description='Creating time series of wind power plants.',
url='http://github.com/wind-python/windpowerlib',
author='oe... | import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='windpowerlib',
version='0.1.2dev',
description='Creating time series of wind power plants.',
url='http://github.com/wind-python/windpowerlib',
author='oe... | Add upper limit of pandas | Add upper limit of pandas
| Python | mit | wind-python/windpowerlib | import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='windpowerlib',
version='0.1.2dev',
description='Creating time series of wind power plants.',
url='http://github.com/wind-python/windpowerlib',
author='oe... | Add upper limit of pandas
import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='windpowerlib',
version='0.1.2dev',
description='Creating time series of wind power plants.',
url='http://github.com/wind-python/wind... |
21af3dbed471c9f6c860db4d2ae84d1e0fed4077 | demo/option_example.py | demo/option_example.py | from sparts.tasks.periodic import PeriodicTask
from sparts.vservice import VService
from sparts.sparts import option
import socket
class HostCheckTask(PeriodicTask):
INTERVAL=5
check_name = option(default=socket.getfqdn(), type=str,
help='Name to check [%(default)s]')
def execute(se... | from sparts.tasks.periodic import PeriodicTask
from sparts.vservice import VService
from sparts.sparts import option, samples, SampleType
import socket
class HostCheckTask(PeriodicTask):
INTERVAL=5
check_name = option(default=socket.getfqdn(), type=str,
help='Name to check [%(default)s]... | Update option example to highlight samples as well | Update option example to highlight samples as well
And overriding samples
| Python | bsd-3-clause | facebook/sparts,fmoo/sparts,bboozzoo/sparts,djipko/sparts,pshuff/sparts,pshuff/sparts,fmoo/sparts,facebook/sparts,djipko/sparts,bboozzoo/sparts | from sparts.tasks.periodic import PeriodicTask
from sparts.vservice import VService
from sparts.sparts import option, samples, SampleType
import socket
class HostCheckTask(PeriodicTask):
INTERVAL=5
check_name = option(default=socket.getfqdn(), type=str,
help='Name to check [%(default)s]... | Update option example to highlight samples as well
And overriding samples
from sparts.tasks.periodic import PeriodicTask
from sparts.vservice import VService
from sparts.sparts import option
import socket
class HostCheckTask(PeriodicTask):
INTERVAL=5
check_name = option(default=socket.getfqdn(), type=str,
... |
b67b677d4092e5bec445649321b142d31cfc0fb6 | linkatos/activities.py | linkatos/activities.py | from . import parser
from . import printer
from . import firebase as fb
from . import reaction as react
def is_empty(events):
return ((events is None) or (len(events) == 0))
def is_url(url_cache):
return url_cache is not None
def is_reaction(index):
return index is not None
def event_consumer(expect... | from . import parser
from . import printer
from . import firebase as fb
from . import reaction as react
def is_empty(events):
return ((events is None) or (len(events) == 0))
def is_url(url_cache):
return url_cache is not None
def is_reaction(index):
return index is not None
def remove_url_from(url_c... | Add function to remove reacted to urls | feat: Add function to remove reacted to urls
| Python | mit | iwi/linkatos,iwi/linkatos | from . import parser
from . import printer
from . import firebase as fb
from . import reaction as react
def is_empty(events):
return ((events is None) or (len(events) == 0))
def is_url(url_cache):
return url_cache is not None
def is_reaction(index):
return index is not None
def remove_url_from(url_c... | feat: Add function to remove reacted to urls
from . import parser
from . import printer
from . import firebase as fb
from . import reaction as react
def is_empty(events):
return ((events is None) or (len(events) == 0))
def is_url(url_cache):
return url_cache is not None
def is_reaction(index):
return... |
d8bcdced24e9787711cbf5787011d88a086d4956 | seleniumbase/console_scripts/logo_helper.py | seleniumbase/console_scripts/logo_helper.py | """ SeleniumBase Logo Processing (for the console scripts interface)
Logo generated from:
http://www.patorjk.com/software/taag/#p=display&f=Slant&t=SeleniumBase """
import colorama
r'''
______ __ _ ____
/ ____/__ / /__ ____ (_)_ ______ ___ / __ `____ ________
\__ \/... | Create a SeleniumBase logo for console interfaces | Create a SeleniumBase logo for console interfaces
| Python | mit | mdmintz/seleniumspot,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/seleniumspot,mdmintz/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase | """ SeleniumBase Logo Processing (for the console scripts interface)
Logo generated from:
http://www.patorjk.com/software/taag/#p=display&f=Slant&t=SeleniumBase """
import colorama
r'''
______ __ _ ____
/ ____/__ / /__ ____ (_)_ ______ ___ / __ `____ ________
\__ \/... | Create a SeleniumBase logo for console interfaces
| |
91165642fb40165987ab0ff734959f88712e514c | humblemedia/resources/migrations/0001_initial.py | humblemedia/resources/migrations/0001_initial.py | # encoding: utf8
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
... | # encoding: utf8
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('auth', '__first__'),
('contenttypes', '_... | Add dependencies to contenttypes to the migration | Add dependencies to contenttypes to the migration
| Python | mit | vladimiroff/humble-media,vladimiroff/humble-media | # encoding: utf8
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('auth', '__first__'),
('contenttypes', '_... | Add dependencies to contenttypes to the migration
# encoding: utf8
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
... |
9145be89c1a5ba1a2c47bfeef571d40b9eb060bc | test/integration/test_user_args.py | test/integration/test_user_args.py | from . import *
class TestUserArgs(IntegrationTest):
def __init__(self, *args, **kwargs):
IntegrationTest.__init__(
self, os.path.join(examples_dir, '10_custom_args'),
configure=False, *args, **kwargs
)
def test_build_default(self):
self.configure()
sel... | from six import assertRegex
from . import *
class TestUserArgs(IntegrationTest):
def __init__(self, *args, **kwargs):
IntegrationTest.__init__(
self, os.path.join(examples_dir, '10_custom_args'),
configure=False, *args, **kwargs
)
def test_build_default(self):
... | Add integration test for user-args help | Add integration test for user-args help
| Python | bsd-3-clause | jimporter/bfg9000,jimporter/bfg9000,jimporter/bfg9000,jimporter/bfg9000 | from six import assertRegex
from . import *
class TestUserArgs(IntegrationTest):
def __init__(self, *args, **kwargs):
IntegrationTest.__init__(
self, os.path.join(examples_dir, '10_custom_args'),
configure=False, *args, **kwargs
)
def test_build_default(self):
... | Add integration test for user-args help
from . import *
class TestUserArgs(IntegrationTest):
def __init__(self, *args, **kwargs):
IntegrationTest.__init__(
self, os.path.join(examples_dir, '10_custom_args'),
configure=False, *args, **kwargs
)
def test_build_default(se... |
b0f47f2d9b75ac777c3cf4a45c1930de9a42c6bc | heutagogy/heutagogy.py | heutagogy/heutagogy.py | from heutagogy import app
import heutagogy.persistence
import os
from datetime import timedelta
app.config.from_object(__name__)
app.config.update(dict(
USERS={
'myuser': {'password': 'mypassword'},
'user2': {'password': 'pass2'},
},
JWT_AUTH_URL_RULE='/api/v1/login',
JWT_EXPIRATION_DEL... | from heutagogy import app
import heutagogy.persistence
import os
from datetime import timedelta
app.config.from_object(__name__)
app.config.update(dict(
USERS={
'myuser': {'password': 'mypassword'},
'user2': {'password': 'pass2'},
},
JWT_AUTH_URL_RULE='/api/v1/login',
JWT_EXPIRATION_DEL... | Initialize database if it does not exist | Initialize database if it does not exist
| Python | agpl-3.0 | heutagogy/heutagogy-backend,heutagogy/heutagogy-backend | from heutagogy import app
import heutagogy.persistence
import os
from datetime import timedelta
app.config.from_object(__name__)
app.config.update(dict(
USERS={
'myuser': {'password': 'mypassword'},
'user2': {'password': 'pass2'},
},
JWT_AUTH_URL_RULE='/api/v1/login',
JWT_EXPIRATION_DEL... | Initialize database if it does not exist
from heutagogy import app
import heutagogy.persistence
import os
from datetime import timedelta
app.config.from_object(__name__)
app.config.update(dict(
USERS={
'myuser': {'password': 'mypassword'},
'user2': {'password': 'pass2'},
},
JWT_AUTH_URL_RU... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.