commit stringlengths 40 40 | subject stringlengths 4 1.73k | repos stringlengths 5 127k | old_file stringlengths 2 751 | new_file stringlengths 2 751 | new_contents stringlengths 1 8.98k | old_contents stringlengths 0 6.59k | license stringclasses 13
values | lang stringclasses 23
values |
|---|---|---|---|---|---|---|---|---|
faa683d04e307b0a2bf4cbedb463686a65c61645 | disable buggy test stup | dmaticzka/EDeN,smautner/EDeN,fabriziocosta/EDeN,fabriziocosta/EDeN,smautner/EDeN,dmaticzka/EDeN | test/test_bin_model.py | test/test_bin_model.py | import re
# from filecmp import cmp
from scripttest import TestFileEnvironment
testdir = "test/"
bindir = "bin/"
datadir = "test/data/"
testenv = testdir + 'testenv_bin_model/'
env = TestFileEnvironment(testenv)
# relative to test file environment: testenv
bindir_rel = "../../" + bindir
datadir_rel = "../../" + datad... | import re
# from filecmp import cmp
from scripttest import TestFileEnvironment
testdir = "test/"
bindir = "bin/"
datadir = "test/data/"
testenv = testdir + 'testenv_bin_model/'
env = TestFileEnvironment(testenv)
# relative to test file environment: testenv
bindir_rel = "../../" + bindir
datadir_rel = "../../" + datad... | mit | Python |
981300a70bce72bfa76958eefc1dd494a94e7b77 | Fix coding separation issue | MuhammadAlkarouri/hug,timothycrosley/hug,timothycrosley/hug,MuhammadAlkarouri/hug,timothycrosley/hug,MuhammadAlkarouri/hug | hug/input_format.py | hug/input_format.py | """hug/input_formats.py
Defines the built-in Hug input_formatting handlers
Copyright (C) 2016 Timothy Edmund Crosley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, includi... | """hug/input_formats.py
Defines the built-in Hug input_formatting handlers
Copyright (C) 2016 Timothy Edmund Crosley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, includi... | mit | Python |
0eebc40a74b35fccbe79abdca4afb4aa1cc25d25 | Simplify test skipping using `importorskip()` | d-grossman/pelops,Lab41/pelops,dave-lab41/pelops,dave-lab41/pelops,Lab41/pelops,d-grossman/pelops | testci/test_chipper.py | testci/test_chipper.py | import pytest
import datetime as dt
# OpenCV is *VERY* hard to install in CircleCI, so if we don't have it, skip these tests
cv2 = pytest.importorskip("cv2") # Skip all tests if not found
from pelops.datasets.chipper import FrameProducer
@pytest.fixture
def frame_time_fp(tmpdir):
# Define a FrameProducer with ... | import pytest
import datetime as dt
# OpenCV is *VERY* hard to install in CircleCI, so if we don't have it, skip these tests
try:
cv2 = pytest.importorskip("cv2")
from pelops.datasets.chipper import FrameProducer
except ImportError:
pass
@pytest.fixture
def frame_time_fp(tmpdir):
# Define a FramePro... | apache-2.0 | Python |
3c735d18bdcff28bbdd765b131649ba57fb612b0 | Revert "Revert "Remove useless code"" | ALSchwalm/hy,aisk/hy,paultag/hy,tianon/hy,hcarvalhoalves/hy,Foxboron/hy,Tritlo/hy,mtmiller/hy,michel-slm/hy,farhaven/hy,freezas/hy,zackmdavis/hy,tianon/hy,gilch/hy,aisk/hy,larme/hy,tuturto/hy,timmartin/hy,farhaven/hy,kirbyfan64/hy,farhaven/hy,algernon/hy,Foxboron/hy,hcarvalhoalves/hy,kirbyfan64/hy,adamfeuer/hy,jakirkha... | hy/models/string.py | hy/models/string.py | # Copyright (c) 2013 Paul Tagliamonte <paultag@debian.org>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modif... | # Copyright (c) 2013 Paul Tagliamonte <paultag@debian.org>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modif... | mit | Python |
f594d211b0e95c17edc9eca693f05d307515e1a7 | remove unused "event" parameter in I18nFieldMixin (#34) | raphaelm/django-i18nfield | i18nfield/fields.py | i18nfield/fields.py | import json
import django
from django.conf import settings
from django.db import models
from .forms import I18nFormField, I18nTextarea, I18nTextInput
from .strings import LazyI18nString
class I18nFieldMixin:
form_class = I18nFormField
widget = I18nTextInput
def to_python(self, value):
if isinst... | import json
import django
from django.conf import settings
from django.db import models
from .forms import I18nFormField, I18nTextarea, I18nTextInput
from .strings import LazyI18nString
class I18nFieldMixin:
form_class = I18nFormField
widget = I18nTextInput
def __init__(self, *args, **kwargs):
... | apache-2.0 | Python |
26c589ba0758c34516455803647d98e91c1bd47d | Print detected image class on top of the video stream. | google/aiyprojects-raspbian,google/aiyprojects-raspbian,google/aiyprojects-raspbian,google/aiyprojects-raspbian,google/aiyprojects-raspbian | src/examples/vision/image_classification_camera.py | src/examples/vision/image_classification_camera.py | #!/usr/bin/env python3
#
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | #!/usr/bin/env python3
#
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | apache-2.0 | Python |
ba7397cf5954ad5ab2d243b540c4d0629c9d42ca | Add test for MTanhProfile | PlasmaControl/DESC,PlasmaControl/DESC | tests/test_profiles.py | tests/test_profiles.py | import numpy as np
import unittest
import pytest
from desc.io import InputReader
from desc.equilibrium import Equilibrium
from desc.profiles import PowerSeriesProfile
class TestProfiles(unittest.TestCase):
def test_same_result(self):
input_path = "examples/DESC/SOLOVEV"
ir = InputReader(input_path... | import numpy as np
import unittest
from desc.io import InputReader
from desc.equilibrium import Equilibrium
from desc.profiles import PowerSeriesProfile
class TestProfiles(unittest.TestCase):
def test_same_result(self):
input_path = "examples/DESC/SOLOVEV"
ir = InputReader(input_path)
eq1... | mit | Python |
22967375441f2a40c255cd2933f9cefb69129f8b | Remove JBluesBlackBody from the nlte_properties collection. | kaushik94/tardis,kaushik94/tardis,kaushik94/tardis,kaushik94/tardis | tardis/plasma/properties/property_collections.py | tardis/plasma/properties/property_collections.py | from tardis.plasma.properties import *
class PlasmaPropertyCollection(list):
pass
basic_inputs = PlasmaPropertyCollection([TRadiative, Abundance, Density,
TimeExplosion, AtomicData, DilutionFactor, LinkTRadTElectron,
HeliumTreatment])
basic_properties = PlasmaPropertyCollection([BetaRadiation,
Levels,... | from tardis.plasma.properties import *
class PlasmaPropertyCollection(list):
pass
basic_inputs = PlasmaPropertyCollection([TRadiative, Abundance, Density,
TimeExplosion, AtomicData, DilutionFactor, LinkTRadTElectron,
HeliumTreatment])
basic_properties = PlasmaPropertyCollection([BetaRadiation,
Levels,... | bsd-3-clause | Python |
8642314ce091dc1e98811ba7aa12f1e66a4b1fb2 | add create_test_person factory | openstates/openstates.org,openstates/openstates.org,openstates/openstates.org,openstates/openstates.org | testutils/factories.py | testutils/factories.py | import random
from openstates.data.models import Organization, Bill, LegislativeSession, Person, Post
def create_test_bill(
session,
chamber,
*,
sponsors=0,
actions=0,
votes=0,
versions=0,
documents=0,
sources=0,
subjects=None,
identifier=None,
):
chamber = Organization... | import random
from openstates.data.models import Organization, Bill, LegislativeSession
def create_test_bill(
session,
chamber,
*,
sponsors=0,
actions=0,
votes=0,
versions=0,
documents=0,
sources=0,
subjects=None,
identifier=None,
):
chamber = Organization.objects.get(c... | mit | Python |
381990dc85b273129135e815e1701586062bc34a | fix filename for linux | mozman/ezdxf,mozman/ezdxf,mozman/ezdxf,mozman/ezdxf,mozman/ezdxf | integration_tests/test_write_without_handles.py | integration_tests/test_write_without_handles.py | # Copyright (c) 2020, Manfred Moitzi
# License: MIT License
import os
import pytest
import ezdxf
from ezdxf.lldxf.tagger import ascii_tags_loader
from ezdxf.lldxf.loader import load_dxf_structure
BASEDIR = os.path.dirname(__file__)
DATADIR = 'data'
@pytest.fixture(params=["POLI-ALL210_12.DXF"])
def filename(reques... | # Copyright (c) 2020, Manfred Moitzi
# License: MIT License
import os
import pytest
import ezdxf
from ezdxf.lldxf.tagger import ascii_tags_loader
from ezdxf.lldxf.loader import load_dxf_structure
BASEDIR = os.path.dirname(__file__)
DATADIR = 'data'
@pytest.fixture(params=["POLI-ALL210_12.dxf"])
def filename(reques... | mit | Python |
7b3672288a6089b7ce3bc10590988e020bb944e9 | Remove unused import | bnoi/scikit-tracker,bnoi/scikit-tracker,bnoi/scikit-tracker | sktracker/io/tests/test_objectsio.py | sktracker/io/tests/test_objectsio.py | import os
import tempfile
from sktracker import data
from sktracker.io import StackIO
from sktracker.io import ObjectsIO
from sktracker.detection import peak_detector
from sktracker.io import validate_metadata
def test_objectsio():
fname = data.CZT_peaks()
st = StackIO(fname, json_discovery=False)
dat... | import os
import tempfile
from nose import with_setup
from sktracker import data
from sktracker.io import StackIO
from sktracker.io import ObjectsIO
from sktracker.detection import peak_detector
from sktracker.io import validate_metadata
def test_objectsio():
fname = data.CZT_peaks()
st = StackIO(fname, j... | bsd-3-clause | Python |
2574552efdca9322a3579cc814cc0e268688ce6d | add permission checkers | awau/Amethyst | utils/check.py | utils/check.py | import discord
from discord.ext.commands import Context, check
def owner():
"""Check if caller is a bot owner"""
def checker(ctx: Context):
return ctx.author.id in ctx.bot.owners
return check(checker)
def guild():
"""Check if called in a guild"""
def checker(ctx: Context):
ret... | import discord
from discord.ext.commands import check
def owner():
def checker(ctx):
return ctx.message.author.id in ctx.bot.owners
return check(checker)
def guild():
def checker(ctx):
return not ctx.is_dm()
return check(checker)
def roles(*roles: int):
def checker(ctx):
... | mit | Python |
a2f9ba16d6fa80c674b198921f463397f3d98131 | simplify sort_function_weight using cmp() | BackupTheBerlios/pondus | src/pondus/gui/guiutil.py | src/pondus/gui/guiutil.py | #! /usr/bin/env python
# -*- coding: UTF-8 -*-
"""
This file is part of Pondus, a personal weight manager.
Copyright (C) 2007-08 Eike Nicklas <eike@ephys.de>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Fou... | #! /usr/bin/env python
# -*- coding: UTF-8 -*-
"""
This file is part of Pondus, a personal weight manager.
Copyright (C) 2007-08 Eike Nicklas <eike@ephys.de>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Fou... | mit | Python |
833cdb4b6fb2890039c110a1b60d16c44d4d61dd | increase version to 1.4.6 | SCIP-Interfaces/PySCIPOpt,mattmilten/PySCIPOpt,SCIP-Interfaces/PySCIPOpt,mattmilten/PySCIPOpt | src/pyscipopt/__init__.py | src/pyscipopt/__init__.py | __version__ = '1.4.6'
# export user-relevant objects:
from pyscipopt.Multidict import multidict
from pyscipopt.scip import Model
from pyscipopt.scip import Branchrule
from pyscipopt.scip import Conshdlr
from pyscipopt.scip import Eventhdlr
from pyscipopt.scip import Heur
from pyscipopt.scip ... | __version__ = '1.4.5'
# export user-relevant objects:
from pyscipopt.Multidict import multidict
from pyscipopt.scip import Model
from pyscipopt.scip import Branchrule
from pyscipopt.scip import Conshdlr
from pyscipopt.scip import Eventhdlr
from pyscipopt.scip import Heur
from pyscipopt.scip ... | mit | Python |
680a156dd2b1e34e45784482663af7b8ed47c2ab | Make our linter happy. | alephdata/ingestors | ingestors/__init__.py | ingestors/__init__.py | """Provides a set of ingestors based on different file types."""
from .doc import DocumentIngestor # noqa
from .html import HTMLIngestor # noqa
from .image import ImageIngestor # noqa
from .pdf import PDFIngestor # noqa
from .tabular import TabularIngestor # noqa
from .text import TextIngestor # noqa
__version_... | """Provides a set of ingestors based on different file types."""
from .doc import DocumentIngestor # noqa
from .html import HTMLIngestor # noqa
from .image import ImageIngestor # noqa
from .pdf import PDFIngestor # noqa
from .tabular import TabularIngestor # noqa
from .text import TextIngestor # noqa
__version_... | mit | Python |
0425ea0c496bea2779c2b375404534e1fdd05d44 | Update version to 2.10dev | StackStorm/mistral,StackStorm/mistral | version_st2.py | version_st2.py | # Copyright 2016 - StackStorm, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | # Copyright 2016 - StackStorm, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 | Python |
002bd3b2208759db28d9be00e0ad80019e330971 | Add admin users auth to core/person api | desenho-sw-g5/service_control,desenho-sw-g5/service_control | core/views/api_person_views.py | core/views/api_person_views.py | from rest_framework.views import APIView
from rest_framework.views import Response
from rest_framework.views import Request
from rest_framework import status
from rest_framework import authentication, permissions
from django.shortcuts import get_object_or_404
from core.models import Person
from core.serializers impor... | from rest_framework.views import APIView
from rest_framework.views import Response
from rest_framework.views import Request
from rest_framework import status
from django.shortcuts import get_object_or_404
from core.models import Person
from core.serializers import PersonSerializer
class PersonList(APIView):
"""... | mit | Python |
dc5581f8ee34d38cb570812cc203ee9975f083ff | Fix flake8 issues. | michaelaye/vispy,sbtlaarzc/vispy,jdreaver/vispy,inclement/vispy,sh4wn/vispy,RebeccaWPerry/vispy,jay3sh/vispy,QuLogic/vispy,jdreaver/vispy,kkuunnddaannkk/vispy,sh4wn/vispy,srinathv/vispy,sbtlaarzc/vispy,michaelaye/vispy,jdreaver/vispy,julienr/vispy,drufat/vispy,bollu/vispy,Eric89GXL/vispy,jay3sh/vispy,Eric89GXL/vispy,gh... | vispy/geometry/__init__.py | vispy/geometry/__init__.py | # -*- coding: utf-8 -*-
# Copyright (c) 2014, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
This module implements classes and methods for handling geometric data.
"""
from __future__ import division
__all__ = ['MeshData', 'PolygonData', 'Rect', 'Triangulation'... | # -*- coding: utf-8 -*-
# Copyright (c) 2014, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
This module implements classes and methods for handling geometric data.
"""
from __future__ import division
__all__ = ['MeshData', 'PolygonData', 'Rect', 'Triangulation'... | bsd-3-clause | Python |
86d60cdfa4136a1d748120d5b764e64f70af7e5a | bump version | ramusus/django-vkontakte-wall | vkontakte_wall/__init__.py | vkontakte_wall/__init__.py | VERSION = (0, 5, 10)
__version__ = '.'.join(map(str, VERSION)) | VERSION = (0, 5, 9)
__version__ = '.'.join(map(str, VERSION)) | bsd-3-clause | Python |
890a42bdf7f54b5907f7cc39832ea9f07fa18569 | Update list of key changes with version in __init__.py | wf4ever/ro-manager,wf4ever/ro-manager,wf4ever/ro-manager,wf4ever/ro-manager | src/rocommand/__init__.py | src/rocommand/__init__.py | # __init__.py
#__version__ = "0.2.1" # Initial version with installation package
#__version__ = "0.2.2" # Updated README documentation for PyPI page
#__version__ = "0.2.3" # Experimenting with distribution options
#__version__ = "0.2.4" # Added MANIFEST.in so that data files are part of sdist
#_... | # __init__.py
#__version__ = "0.2.1" # Initial version with installation package
#__version__ = "0.2.2" # Updated README documentation for PyPI page
#__version__ = "0.2.3" # Experimenting with distribution options
#__version__ = "0.2.4" # Added MANIFEST.in so that data files are part of sdist
#_... | mit | Python |
60870a3e471637d44da32f3aac74064e4ca60208 | Use `set_defaults` of subparser to launch scripts | DerWeh/pyplot | pyplot.py | pyplot.py | #!/usr/bin/env python
# PYTHON_ARGCOMPLETE_OK
"""Module to bundle plotting scripts
`activate-global-python-argcomplete` must be run to enable auto completion """
import argparse
import argcomplete
import plotter
def parse_arguments():
"""Argument Parser, providing available scripts"""
parser = argparse.Argum... | #!/usr/bin/env python
# PYTHON_ARGCOMPLETE_OK
"""Module to bundle plotting scripts
`activate-global-python-argcomplete` must be run to enable auto completion """
import argparse
import argcomplete
import plotter
def parse_arguments():
"""Argument Parser, providing available scripts"""
parser = argparse.Argum... | mit | Python |
51aae21ce211abc9897b989c233f22507813ecf2 | Add a pondmen column | benjello/openfisca-france-indirect-taxation,antoinearnoud/openfisca-france-indirect-taxation,thomasdouenne/openfisca-france-indirect-taxation,openfisca/openfisca-france-indirect-taxation | openfisca_france_indirect_taxation/model/input_variables.py | openfisca_france_indirect_taxation/model/input_variables.py | # -*- coding: utf-8 -*-
# OpenFisca -- A versatile microsimulation software
# By: OpenFisca Team <contact@openfisca.fr>
#
# Copyright (C) 2011, 2012, 2013, 2014 OpenFisca Team
# https://github.com/openfisca
#
# This file is part of OpenFisca.
#
# OpenFisca is free software; you can redistribute it and/or modify
# it ... | # -*- coding: utf-8 -*-
# OpenFisca -- A versatile microsimulation software
# By: OpenFisca Team <contact@openfisca.fr>
#
# Copyright (C) 2011, 2012, 2013, 2014 OpenFisca Team
# https://github.com/openfisca
#
# This file is part of OpenFisca.
#
# OpenFisca is free software; you can redistribute it and/or modify
# it ... | agpl-3.0 | Python |
f7a6aa0434a13df6806bdedb885756d6179220db | fix course lesson 3 data prep test | OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft | tests/course/tests/lesson_3_data_prepare_test.py | tests/course/tests/lesson_3_data_prepare_test.py | # third party
import pytest
from testbook import testbook
@pytest.fixture(scope="module")
def tb():
with testbook("../courses/L3_DataPreparation.ipynb", execute=True) as tb:
yield tb
def test_data_acquisition(tb):
assert tb.cell_output_text(8) == "(2280, 451)"
def test_quality_check(tb):
asser... | # third party
import pytest
from testbook import testbook
@pytest.fixture(scope="module")
def tb():
with testbook("../courses/L3_DataPreparation.ipynb", execute=True) as tb:
yield tb
def test_data_acquisition(tb):
assert tb.cell_output_text(8) == "(2280, 451)"
def test_quality_check(tb):
asser... | apache-2.0 | Python |
fb5c92741243756516fa50073d34e94ba0b6981e | Generalize projection-matrix-removal script (#3430) | facebookresearch/ParlAI,facebookresearch/ParlAI,facebookresearch/ParlAI,facebookresearch/ParlAI,facebookresearch/ParlAI | projects/anti_scaling/scripts/remove_projection_matrices.py | projects/anti_scaling/scripts/remove_projection_matrices.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import torch
from parlai.utils import pickle
from parlai.utils.io import PathManager
from parlai.utils... | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import shutil
import torch
from parlai.utils import pickle
from parlai.utils.io import PathManager
fro... | mit | Python |
e81e2c30c756f224ce6a861b96c3c51d0ca60993 | Add url validation util | strycore/megascops,strycore/megascops,strycore/megascops,strycore/megascops | video/utils.py | video/utils.py | import os
import uuid
import urllib
from urlparse import urlparse
import subprocess
from django.conf import settings
from video.models import Video
def sanitize_url(url):
""" Make sure an url is valid, prepending the scheme if needed. """
parsed = urlparse(url)
if not parsed.scheme:
url = "http://... | import os
import uuid
import urllib
import subprocess
from django.conf import settings
from video.models import Video
def download_thumbnail(thumbnail_url):
destination_path = os.path.join(settings.MEDIA_ROOT, 'thumbnails')
thumbnail_file = str(uuid.uuid4()) + ".jpg"
urllib.urlretrieve(thumbnail_url, os.p... | agpl-3.0 | Python |
1088c960ab450e70d6295d04d916a63a6f87dee7 | add local feh dist | jobovy/apogee | apogee/util/__init__.py | apogee/util/__init__.py | import numpy
def localfehdist(feh):
#From 2 Gaussian XD fit to Casagrande et al. (2011)
fehdist= 0.8/0.15*numpy.exp(-0.5*(feh-0.016)**2./0.15**2.)\
+0.2/0.22*numpy.exp(-0.5*(feh+0.15)**2./0.22**2.)
return fehdist
| bsd-3-clause | Python | |
c39fd90e9b14e5c7be13be1301c2a68a1fa55158 | create the logs directory if it doesn't exist | StoDevX/cs251-toolkit,StoDevX/cs251-toolkit,StoDevX/cs251-toolkit,StoDevX/cs251-toolkit | cs251tk/lib/save_recordings.py | cs251tk/lib/save_recordings.py | from .format_collected_data import format_collected_data
from .helpers import warn, flatten, group_by
import yaml
from .columnize import asciiify
from .gist import post_gist
import os
def record_recording_to_disk(results, file_identifier):
results = sorted(results, key=lambda file: file['student'])
results = ... | from .format_collected_data import format_collected_data
from .helpers import warn, flatten, group_by
import yaml
from .columnize import asciiify
from .gist import post_gist
def record_recording_to_disk(results, file_identifier):
results = sorted(results, key=lambda file: file['student'])
results = [file['con... | mit | Python |
1ba015fb4f9dd188d2ef32fd55c369f2e79d9547 | Add short season mail list aliases | jluttine/django-sportsteam,jluttine/django-sportsteam,jluttine/django-sportsteam,jluttine/django-sportsteam | tuhlaajapojat_lists.py | tuhlaajapojat_lists.py | import os
import re
import sys
#cmd_folder = '/home/jluttine'
cmd_folder = '/home/jluttine/tuhlaajapojat'
if cmd_folder not in sys.path:
sys.path.insert(0, cmd_folder)
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "sportsteam.settings")
#os.environ['DJANGO_SETTINGS_MODULE'] = 'sportsteam.settings'
fr... | import os
import re
import sys
#cmd_folder = '/home/jluttine'
cmd_folder = '/home/jluttine/tuhlaajapojat'
if cmd_folder not in sys.path:
sys.path.insert(0, cmd_folder)
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "sportsteam.settings")
#os.environ['DJANGO_SETTINGS_MODULE'] = 'sportsteam.settings'
fr... | agpl-3.0 | Python |
32c671fc59243a7a0b8b665369b5c06aaeb207af | Fix include paths in breakpad_client.gyp to make the build work | tomgr/google-breakpad,tomgr/google-breakpad,tomgr/google-breakpad,tomgr/google-breakpad,tomgr/google-breakpad | src/client/windows/breakpad_client.gyp | src/client/windows/breakpad_client.gyp | # Copyright (c) 2010, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and t... | # Copyright (c) 2010, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and t... | bsd-3-clause | Python |
aac598d64fc0fa50cc068fc50173068e5d89b3fd | Update numpy dtypes extension for correct type codes. | hohogpb/segpy,stevejpurves/segpy,abingham/segpy,asbjorn/segpy,kjellkongsvik/segpy,Kramer477/segpy,kwinkunks/segpy | segpy/ext/numpyext.py | segpy/ext/numpyext.py | """Optional interoperability with Numpy."""
import numpy
NUMPY_DTYPES = {'ibm': numpy.dtype('f4'),
'int32': numpy.dtype('i4'),
'int16': numpy.dtype('i2'),
'float32': numpy.dtype('f4'),
'int8': numpy.dtype('i1')}
def make_dtype(data_sample_fo... | """Optional interoperability with Numpy."""
import numpy
NUMPY_DTYPES = {'ibm': numpy.dtype('f4'),
'l': numpy.dtype('i4'),
'h': numpy.dtype('i2'),
'f': numpy.dtype('f4'),
'b': numpy.dtype('i1')}
def make_dtype(data_sample_format):
"""Conver... | agpl-3.0 | Python |
a799c25f8ecbc841129d0e34e84c6f95531668c5 | Fix a misspelled variable | khchine5/django-shop,jrief/django-shop,awesto/django-shop,khchine5/django-shop,jrief/django-shop,jrief/django-shop,divio/django-shop,khchine5/django-shop,awesto/django-shop,nimbis/django-shop,nimbis/django-shop,nimbis/django-shop,divio/django-shop,divio/django-shop,nimbis/django-shop,jrief/django-shop,awesto/django-sho... | shop/models/fields.py | shop/models/fields.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import connection
POSTGRES_FLAG = False
if str(connection.vendor) == 'postgresql':
POSTGRES_FLAG = True
try:
if POSTGRES_FLAG:
from django.contrib.postgres.fields import JSONField
else:
raise ImportError
except... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import connection
POSTGRES_FALG = False
if str(connection.vendor) == 'postgresql':
POSTGRES_FALG = True
try:
if POSTGRES_FALG:
from django.contrib.postgres.fields import JSONField
else:
raise ImportError
except... | bsd-3-clause | Python |
9c4425e5cff3d841f6e1120cbb244d7e322d6a96 | fix admin.py field eroor | pycontw/pycontw2016,pycontw/pycontw2016,pycontw/pycontw2016,pycontw/pycontw2016 | src/proposals/admin.py | src/proposals/admin.py | from django.contrib import admin
from django.contrib.contenttypes.admin import GenericTabularInline
from import_export.admin import ExportMixin
from .models import AdditionalSpeaker, TalkProposal, TutorialProposal
from .resources import TalkProposalResource
class AdditionalSpeakerInline(GenericTabularInline):
m... | from django.contrib import admin
from django.contrib.contenttypes.admin import GenericTabularInline
from import_export.admin import ExportMixin
from .models import AdditionalSpeaker, TalkProposal, TutorialProposal
from .resources import TalkProposalResource
class AdditionalSpeakerInline(GenericTabularInline):
m... | mit | Python |
edeb1e3d9c953f4699ee3e598e3d758c038eda40 | Add PathStats to intermediatePathTypes demo. | visdesignlab/TulipPaths,visdesignlab/TulipPaths | demos/intermediatePathTypes.py | demos/intermediatePathTypes.py | """ Example of finding paths and unique types using PathStats """
from tulip import *
from tulipgui import *
import tulippaths as tp
# Path parameters
graphFile = '../data/514_4hops.tlp'
sourceNodeId = 593
targetNodeId = 514
maxNumHops = 5
graph = tlp.loadGraph(graphFile)
# Find start and end nodes
source = tp.getN... | """ Example of finding paths and printing type details. """
from tulip import *
from tulipgui import *
import tulippaths as tp
# Load the graph.
graph = tlp.loadGraph("../data/test_one.tlp")
# Find start and end nodes
source = tp.getNodeById(176, graph)
target = tp.getNodeById(606, graph)
# Find paths
finder = tp.P... | mit | Python |
f1477afc2ff20a702a53ed82549dca07acd388dc | Update jogovelha.py | Augustosimoes/devops-aula05 | Src/jogovelha.py | Src/jogovelha.py | def inicializar():
tab = [ ]
for i in range (3):
linha = [ ]
for j in range(3):
linha.append("X")
tab.append(linha)
return tab
def main( ):
jogo = inicializar ( )
print (jogo)
if _name_ == "_main_":
main()
| def inicializar():
tab = [ ]
for i in range (3):
linha = [ ]
for j in range(3):
linha.append(".")
tab.append(linha)
return tab
def main( ):
jogo = inicializar ( )
print (jogo)
if _name_ == "_main_":
main()
| apache-2.0 | Python |
9d14f60713726e05dab00a1b1e8eccfc32b17d58 | bump version to 2.2.0 | RaRe-Technologies/smart_open,RaRe-Technologies/smart_open | smart_open/version.py | smart_open/version.py | __version__ = '2.2.0'
| __version__ = '2.1.1'
| mit | Python |
3222e6164906956f698c63e26bddd85cd6a941be | use new fetch methods | gabstopper/smc-python | smc/actions/remove.py | smc/actions/remove.py | import logging
import smc.actions
import smc.api.web as web_api
import smc.api.common as common_api
from smc.elements.element import SMCElement
logger = logging.getLogger(__name__)
def element(name, objtype=None):
""" Remove by element
Args:
* name: name for object to remove
* objtype (optiona... | import logging
import smc.actions
import smc.api.web as web_api
import smc.api.common as common_api
from smc.elements.element import SMCElement
logger = logging.getLogger(__name__)
def element(name, objtype=None):
""" Remove by element
Args:
* name: name for object to remove
* objt... | apache-2.0 | Python |
89973ed75031fb4e697b66d9f7d150e11978bce0 | Update django_dbq/management/commands/queue_depth.py | dabapps/django-db-queue | django_dbq/management/commands/queue_depth.py | django_dbq/management/commands/queue_depth.py | from django.core.management.base import BaseCommand
from django_dbq.models import Job
class Command(BaseCommand):
help = "Print the current depth of the given queue"
def add_arguments(self, parser):
parser.add_argument("queue_name", nargs="?", default="default", type=str)
def handle(self, *args... | from django.core.management.base import BaseCommand
from django_dbq.models import Job
class Command(BaseCommand):
help = "Print the current depth of the given queue"
def add_arguments(self, parser):
parser.add_argument("queue_name", nargs="?", default="default", type=str)
def handle(self, *args... | bsd-2-clause | Python |
f88efe1c63c8f480879cad671b34be854045fb1c | Improve source admin for mutations | IQSS/gentb-site,IQSS/gentb-site,IQSS/gentb-site,IQSS/gentb-site,IQSS/gentb-site,IQSS/gentb-site,IQSS/gentb-site,IQSS/gentb-site | apps/mutations/admin.py | apps/mutations/admin.py | #
# Copyright (C) 2016 Dr. Maha Farhat
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is d... | #
# Copyright (C) 2016 Dr. Maha Farhat
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is d... | agpl-3.0 | Python |
a865dbad699025e9efce4ec08edae9584b2bd178 | add MIT license | tedder/aws-release-notes-rss | scrape.py | scrape.py | #!/usr/bin/python
# MIT license
# (see: http://www.opensource.org/licenses/mit-license.php)
#
# Copyright (c) 2014 Ted Timmons, ted@timmons.me
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software w... | #!/usr/bin/python
import boto
import requests
from lxml import html
import lxml
import PyRSS2Gen
import datetime
import StringIO
import sys
from dateutil.parser import parse
LINK = "https://aws.amazon.com/releasenotes/"
page = requests.get(LINK)
try:
tree = html.fromstring(page.text)
except lxml.etree.XMLSyntaxErro... | mit | Python |
29aa96cdbb02ef686bdb0c722955d1ad875d0099 | Add check that image sizes match | stiphyMT/plantcv,stiphyMT/plantcv,danforthcenter/plantcv,danforthcenter/plantcv,danforthcenter/plantcv,stiphyMT/plantcv | plantcv/plantcv/visualize/overlay_two_imgs.py | plantcv/plantcv/visualize/overlay_two_imgs.py | # Overlay two input images
"""
Created on Tue. September 01 21:00:01 2020
A function
@author: hudanyunsheng
"""
import os
import cv2
import numpy as np
from plantcv.plantcv import fatal_error
from plantcv.plantcv import plot_image
from plantcv.plantcv import print_image
from plantcv.plantcv import params
def overla... | # Overlay two input images
"""
Created on Tue. September 01 21:00:01 2020
A function
@author: hudanyunsheng
"""
import os
import cv2
import numpy as np
from plantcv.plantcv import fatal_error
from plantcv.plantcv import plot_image
from plantcv.plantcv import print_image
from plantcv.plantcv import params
def overla... | mit | Python |
e8badf03203c0a65ac291a0acdd233847dc7df3f | Update alsa_sound_control.py | GraphicalBear/MusiCube,GraphicalBear/MusiCube,GraphicalBear/MusiCube,GraphicalBear/MusiCube | Python/alsa_sound_control.py | Python/alsa_sound_control.py | import time
import serial
import random
from pygame import mixer
mixer.init()
running = True
elapsed_time = 0
next_value = 25
serialPort = serial.Serial(port = '/dev/ttyUSB0', baudrate = 115200)
for x in range(3):
serialPort.readline()
def play_song():
# picker = random.randint(2, 4)
global serialPort
... | import time
import serial
import random
from pygame import mixer
mixer.init()
running = True
elapsed_time = 0
next_value = 25
serialPort = serial.Serial(port = '/dev/ttyUSB0', baudrate = 115200)
for x in range(3):
serialPort.readline()
def play_song():
# picker = random.randint(2, 4)
global serialPort
... | unlicense | Python |
80701d30488cab98c63232723313aef6175e02a8 | Fix broken test. (#705) | adarob/magenta,jesseengel/magenta,adarob/magenta,magenta/magenta,magenta/magenta,jesseengel/magenta | magenta/models/shared/events_rnn_graph_test.py | magenta/models/shared/events_rnn_graph_test.py | # Copyright 2016 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 ag... | # Copyright 2016 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 ag... | apache-2.0 | Python |
2ba28c83de33ebc75f386d127d0c55e17248a94b | Add location to step metadata. | rchristie/mapclientplugins.meshgeneratorstep | mapclientplugins/meshgeneratorstep/__init__.py | mapclientplugins/meshgeneratorstep/__init__.py |
"""
MAP Client Plugin
"""
__version__ = '0.2.0'
__author__ = 'Richard Christie'
__stepname__ = 'Mesh Generator'
__location__ = 'https://github.com/ABI-Software/mapclientplugins.meshgeneratorstep'
# import class that derives itself from the step mountpoint.
from mapclientplugins.meshgeneratorstep import step
# Impor... |
"""
MAP Client Plugin
"""
__version__ = '0.2.0'
__author__ = 'Richard Christie'
__stepname__ = 'Mesh Generator'
__location__ = ''
# import class that derives itself from the step mountpoint.
from mapclientplugins.meshgeneratorstep import step
# Import the resource file when the module is loaded,
# this enables the ... | apache-2.0 | Python |
a2df05a5ce93095e33dafb7a3c2807361ca93a37 | Add *all* errors to __init__.py | bskinn/sphobjinv | src/sphobjinv/__init__.py | src/sphobjinv/__init__.py | r"""``sphobjinv`` *package definition module*.
``sphobjinv`` is a toolkit for manipulation and inspection of
Sphinx |objects.inv| files.
**Author**
Brian Skinn (bskinn@alum.mit.edu)
**File Created**
17 May 2016
**Copyright**
\(c) Brian Skinn 2016-2022
**Source Repository**
https://github.com/bskinn... | r"""``sphobjinv`` *package definition module*.
``sphobjinv`` is a toolkit for manipulation and inspection of
Sphinx |objects.inv| files.
**Author**
Brian Skinn (bskinn@alum.mit.edu)
**File Created**
17 May 2016
**Copyright**
\(c) Brian Skinn 2016-2022
**Source Repository**
https://github.com/bskinn... | mit | Python |
6cefc4f94bd78de84a6e5713e28111834307576d | Create model Member | rocity/dj-instagram,rocity/dj-instagram,rocity/dj-instagram | djinstagram/instaapp/models.py | djinstagram/instaapp/models.py | from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class Follow(models.Model):
follower = models.ForeignKey(User, related_name='+', null=True)
following = models.ForeignKey(User, related_name='+', null=True)
active = models.BooleanField(default=True)
... | from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class Follow(models.Model):
follower = models.ForeignKey(User, related_name='+', null=True)
following = models.ForeignKey(User, related_name='+', null=True)
active = models.BooleanField(default=True)
... | apache-2.0 | Python |
f61e0aaef192b20c445f270671470d3a0d6d4161 | test that random_land actually returns land | MM1nd/worldengine,MM1nd/worldengine,Mindwerks/worldengine,Mindwerks/worldengine | tests/simulation_test.py | tests/simulation_test.py | import unittest
import numpy
from worldengine.simulations.hydrology import WatermapSimulation
from worldengine.model.world import World, Size, GenerationParameters
class TestSimulation(unittest.TestCase):
# The hydrology simulation indirectly calls the global rng.
# We want different implementations of... | import unittest
import numpy
from worldengine.simulations.hydrology import WatermapSimulation
from worldengine.model.world import World, Size, GenerationParameters
class TestSimulation(unittest.TestCase):
# The hydrology simulation indirectly calls the global rng.
# We want different implementations of... | mit | Python |
a3de6cc27266bfb2a71aa910451309ce4b7b6c79 | fix newline replacement | natemara/historian | server.py | server.py | #!/usr/bin/env python3
import os
import json
import argparse
import subprocess
import tornado.ioloop
import tornado.web
import tornado.autoreload
BASE_PATH = os.path.dirname(os.path.realpath(__file__))
def run_process(command):
with subprocess.Popen(command, stdout=subprocess.PIPE) as proc:
return proc.stdout.re... | #!/usr/bin/env python3
import os
import json
import argparse
import subprocess
import tornado.ioloop
import tornado.web
import tornado.autoreload
BASE_PATH = os.path.dirname(os.path.realpath(__file__))
def run_process(command):
with subprocess.Popen(command, stdout=subprocess.PIPE) as proc:
return proc.stdout.re... | mit | Python |
b7fba7c12a9f37665dd8747631fcc9495b55a369 | index and protocol fixes | acmuniandes/Sobrecupo,acmuniandes/Sobrecupo,acmuniandes/Sobrecupo | server.py | server.py | import os
import redis
import logging
import datetime
from flask import Flask , send_from_directory, render_template, url_for, request
r = redis.from_url(os.environ.get("REDIS_URL"))
app = Flask(__name__)
#"Landing page"
@app.route('/')
def webprint():
return render_template('index.html')
#Saves the string <st... | import os
import redis
import logging
import datetime
from flask import Flask , send_from_directory, render_template, url_for, request
r = redis.from_url(os.environ.get("REDIS_URL"))
app = Flask(__name__)
#"Landing page"
@app.route('/')
def webprint():
return render_template('index.html')
#Saves the string <st... | mit | Python |
9664aac88684bfd2b940a8189d95ba7797c6ddd3 | add moveTo method | tarukosu/RoombaRPC,tarukosu/RoombaRPC,tarukosu/RoombaRPC | server.py | server.py | import roomba.create as create
import time
import zerorpc
class RoombaRPC(object):
def __init__(self, port):
self.robot = create.Create(port)
self.robot.toSafeMode()
self.moving = False
self.pause()
def __del__(self):
self.robot.close()
def toSafeMode(self):
... | import roomba.create as create
import time
import zerorpc
class RoombaRPC(object):
def __init__(self, port):
self.robot = create.Create(port)
self.robot.toSafeMode()
self.moving = False
self.pause()
def __del__(self):
self.robot.close()
def toSafeMode(self):
... | mit | Python |
9fa51ff158c6628992285d85d808687116473626 | fix bug | housne/tucao,devharrry/tucao,housne/tucao,devharrry/tucao,devharrry/tucao,housne/tucao | server.py | server.py | #-*- coding:utf-8 -*-
from flask import Flask, jsonify, render_template, make_response, request
import os
from news import News
from conf import *
from fetch import Fetch
import time
import datetime
app = Flask(__name__, static_url_path='/assets')
def jsonResponse(data=None, type=None, extra_data=[]):
response =... | #-*- coding:utf-8 -*-
from flask import Flask, jsonify, render_template, make_response, request
import os
from news import News
from conf import *
from fetch import Fetch
from cache import Cache
import time
import datetime
app = Flask(__name__, static_url_path='/assets')
def jsonResponse(data=None, type=None, extra_... | mit | Python |
fb8c2fb065449a436dd8ffa11b469bb2f22a9ad1 | Add web crawling rule and dataset url regex exp | MaxLikelihood/CODE | spider.py | spider.py | from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.selector import Selector
class DatasetSpider(CrawlSpider):
name = 'dataset'
allowed_domains = ['data.gc.ca/data/en']
start_urls = ['http://data.gc.ca/data/en/dataset?page=1']
... | from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.selector import Selector
class DatasetSpider(CrawlSpider):
name = 'dataset'
allowed_domains = ['data.gc.ca/data/en']
start_urls = ['http://data.gc.ca/data/en/dataset?page=1']
| mit | Python |
477bdb98f8a3e8250de80e1c88b4cab85a82e7ab | Implement bi-directional DiagnosticPort_Formatter | bvanheu/stratasys | stratasys/formatter.py | stratasys/formatter.py | #
# See the LICENSE file
#
import re
import binascii
class Formatter:
def __init__(self):
pass
def from_source(self, data):
raise Exception("this class cannot be used")
def to_destination(self, data):
raise Exception("this class cannot be used")
class DiagnosticPort_Formatter(For... | #
# See the LICENSE file
#
class Formatter:
def __init__(self):
pass
def from_source(self, data):
raise Exception("this class cannot be used")
def to_destination(self, data):
raise Exception("this class cannot be used")
class DiagnosticPort_Formatter(Formatter):
def __init__(... | bsd-3-clause | Python |
7cc4069899979719ba0399ae5e9e597a88ede774 | enhance celery error handling | sergeii/swat4stats.com,sergeii/swat4stats.com,sergeii/swat4stats.com | swat4tracker/celery.py | swat4tracker/celery.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
import os
from django.conf import settings
import celery
import raven
from celery.signals import setup_logging
from raven.contrib.celery import register_signal, register_logger_signal
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'swat... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
import os
from django.conf import settings
import celery
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'swat4tracker.settings')
app = celery.Celery('swat4tracker')
app.config_from_object(settings)
app.autodiscover_tasks(lambda: setti... | mit | Python |
6bc2bf86634f056f064a6bef2cdc00b3750556c1 | remove import utils file | adnedelcu/SyncSettings,mfuentesg/SyncSettings | sync_settings/reloader.py | sync_settings/reloader.py | # -*- coding: utf-8 -*-
# Adapted from @wbond's resource loader.
import sys
import sublime
VERSION = int(sublime.version())
mod_prefix = "sync_settings"
reload_mods = []
if VERSION > 3000:
mod_prefix = "AdvancedNewFile." + mod_prefix
from imp import reload
for mod in sys.modules:
if mod[0:15] ==... | # -*- coding: utf-8 -*-
# Adapted from @wbond's resource loader.
import sys
import sublime
VERSION = int(sublime.version())
mod_prefix = "sync_settings"
reload_mods = []
if VERSION > 3000:
mod_prefix = "AdvancedNewFile." + mod_prefix
from imp import reload
for mod in sys.modules:
if mod[0:15] ==... | mit | Python |
68034e4d428776ac3fb3fcfa4ee8a53b4f5714a6 | Declare readline dependency (#4171) | matthiasdiener/spack,LLNL/spack,TheTimmy/spack,mfherbst/spack,TheTimmy/spack,tmerrick1/spack,LLNL/spack,krafczyk/spack,LLNL/spack,LLNL/spack,TheTimmy/spack,iulian787/spack,krafczyk/spack,mfherbst/spack,lgarren/spack,tmerrick1/spack,lgarren/spack,krafczyk/spack,iulian787/spack,TheTimmy/spack,tmerrick1/spack,skosukhin/sp... | var/spack/repos/builtin/packages/gdbm/package.py | var/spack/repos/builtin/packages/gdbm/package.py | ##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | ##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 | Python |
b18fea6c8314da46b5e7b8fc58f404bb4623e4ef | add new versions (#9477) | iulian787/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack | var/spack/repos/builtin/packages/ncdu/package.py | var/spack/repos/builtin/packages/ncdu/package.py | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 | Python |
8ef81870bb1f282caecc51a2de7c2c0ba9bf204d | create leave ledger entry for encashment | gsnbng/erpnext,gsnbng/erpnext,gsnbng/erpnext,gsnbng/erpnext | erpnext/hr/doctype/leave_encashment/test_leave_encashment.py | erpnext/hr/doctype/leave_encashment/test_leave_encashment.py | # -*- coding: utf-8 -*-
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from frappe.utils import today, add_months
from erpnext.hr.doctype.employee.test_employee import make_employee
from erpnext.hr.doctype.sal... | # -*- coding: utf-8 -*-
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from frappe.utils import today, add_months
from erpnext.hr.doctype.employee.test_employee import make_employee
from erpnext.hr.doctype.sal... | agpl-3.0 | Python |
e010175f9514b778e832fea3144c78c31c6ac965 | remove abandoned todo | buxx/intelligine | intelligine/simulation/object/brain/part/move/AntStar/Host.py | intelligine/simulation/object/brain/part/move/AntStar/Host.py | from intelligine.simulation.object.brain.part.move.AntStar.HostFeeler import HostFeeler
from intelligine.synergy.event.move.direction import get_position_with_direction_decal
from synergine_xyz.cst import POSITION
class Host:
def __init__(self, context, object_id):
self._context = context
self._o... | from intelligine.simulation.object.brain.part.move.AntStar.HostFeeler import HostFeeler
from intelligine.synergy.event.move.direction import get_position_with_direction_decal
from synergine_xyz.cst import POSITION
class Host:
def __init__(self, context, object_id):
self._context = context
self._o... | apache-2.0 | Python |
541a2b49ac80800912a4bd867cbddc56d245fa25 | configure logging (#6873) | cseed/hail,hail-is/hail,hail-is/hail,danking/hail,danking/hail,danking/hail,cseed/hail,hail-is/hail,cseed/hail,danking/hail,hail-is/hail,cseed/hail,hail-is/hail,danking/hail,hail-is/hail,cseed/hail,cseed/hail,hail-is/hail,danking/hail,danking/hail,cseed/hail,danking/hail,hail-is/hail,cseed/hail | batch/batch/__main__.py | batch/batch/__main__.py | from aiohttp import web
from hailtop import gear
from .batch import app
gear.configure_logging()
web.run_app(app, host='0.0.0.0', port=5000)
| from aiohttp import web
from .batch import app
web.run_app(app, host='0.0.0.0', port=5000)
| mit | Python |
a7d15651fcf6ff75c1330a8d568f0d77d521ef8f | update refit auto-test | mick-d/nipype,mick-d/nipype,mick-d/nipype,mick-d/nipype | nipype/interfaces/afni/tests/test_auto_Refit.py | nipype/interfaces/afni/tests/test_auto_Refit.py | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from __future__ import unicode_literals
from ..utils import Refit
def test_Refit_inputs():
input_map = dict(args=dict(argstr='%s',
),
atrcopy=dict(argstr='-atrcopy %s %s',
),
atrfloat=dict(argstr='-atrfloat %s %s',
),
atrint=dict(argstr... | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from __future__ import unicode_literals
from ..utils import Refit
def test_Refit_inputs():
input_map = dict(args=dict(argstr='%s',
),
deoblique=dict(argstr='-deoblique',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_except... | bsd-3-clause | Python |
e25fcef7f137752f80b0740cf1f9536ad9b6c2b0 | Add retrieval of career goal leaders | leaffan/pynhldb | analysis/_goal_leaders.py | analysis/_goal_leaders.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import requests
from lxml import html
SEASON_URL_TEMPLATE = "http://www.hockey-reference.com/leagues/NHL_%d.html"
CAREER_GOAL_LEADERS_URL = "http://www.hockey-reference.com/leaders/goals_career.html"
def retrieve_yearly_leaders():
"""
Retrieves yea... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
from lxml import html
SEASON_URL_TEMPLATE = "http://www.hockey-reference.com/leagues/NHL_%d.html"
CAREER_GOAL_LEADERS_URL = "http://www.hockey-reference.com/leaders/goals_career.html"
season_goal_leaders = set()
for year in range(1918, 2017)[:0]:
... | mit | Python |
fc569f99501f5a7a33c861730132657abfcb642c | Update decompression.py | HugoPouliquen/lzw-tools | utils/decompression.py | utils/decompression.py | from os.path import splitext
from os.path import getsize
from utils.make_list import byteList
def decompress(compressed, path):
"""
Purpose: Decompress file
Description: Read the file to decompress, remove the fist couple of byte.
Then, decompress each byte using the ASCII list. Finally convert it int... | from os.path import splitext
from os.path import getsize
from utils.make_list import byteList
def decompress(compressed, path):
"""
Purpose: Decompress file
Description: Read the file to decompress, remove the fist couple of byte.
Then, decompress each byte using the ASCII list and convert it into
... | mit | Python |
25751d5814e5afa896dcce0823490bdb893b513f | comment out the enabling of local cache. Local cache is disabled by default. | jmakov/ggrc-core,j0gurt/ggrc-core,plamut/ggrc-core,edofic/ggrc-core,vladan-m/ggrc-core,uskudnik/ggrc-core,uskudnik/ggrc-core,plamut/ggrc-core,selahssea/ggrc-core,NejcZupec/ggrc-core,hasanalom/ggrc-core,josthkko/ggrc-core,VinnieJohns/ggrc-core,andrei-karalionak/ggrc-core,NejcZupec/ggrc-core,plamut/ggrc-core,hasanalom/gg... | src/ggrc/cache/factory.py | src/ggrc/cache/factory.py | # cache/factory.py
#
# This module creates the cache based on parameters specified
#
# Copyright (C) 2014 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
#
# Maintained By: dan@reciprocitylabs.com
#
from .localcache import LocalC... | # cache/factory.py
#
# This module creates the cache based on parameters specified
#
# Copyright (C) 2014 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
#
# Maintained By: dan@reciprocitylabs.com
#
from .localcache import LocalC... | apache-2.0 | Python |
f461180a9c1f5d578372baa6cc1e9deac3c27994 | update bmp180 | crazyquark/tentacle_pi,lexruee/tentacle_pi | bmp180/examples/test.py | bmp180/examples/test.py | from tentacle_pi.BMP180 import BMP180
import time
bmp = BMP180(0x77,"/dev/i2c-1")
for x in range(0,100):
print "temperature: %0.1f" % bmp.temperature()
print "pressure: %s" % bmp.pressure()
print "altitude: %0.1f" % bmp.altitude()
print
time.sleep(2)
| from tentacle_pi.BMP180 import BMP180
import time
bmp = BMP180(0x77,"/dev/i2c-1")
for x in range(0,5):
print "temperature: %s" % bmp.temperature()
print "pressure: %s" % bmp.pressure()
print "altitude: %s" % bmp.altitude()
print
time.sleep(2)
| mit | Python |
77eab288ae870f35922a44d0f22e479c62dad1dc | Use correct byte count function | smartfile/client-python | test/test_smartfile.py | test/test_smartfile.py | from __future__ import absolute_import
import os
import unittest
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from smartfile import BasicClient
from smartfile.errors import ResponseError
API_KEY = os.environ.get("API_KEY")
API_PASSWORD = os.environ.get("API_PASSWORD")
if A... | from __future__ import absolute_import
import os
import unittest
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from smartfile import BasicClient
from smartfile.errors import ResponseError
API_KEY = os.environ.get("API_KEY")
API_PASSWORD = os.environ.get("API_PASSWORD")
if A... | mit | Python |
fb4341a100e62fa0ca82ebb81fb489b0fc63a465 | Fix tests for Py3 | ecordell/burninator | tests/burninator_tests.py | tests/burninator_tests.py | from mock import *
from nose.tools import *
from burninator import Burninator
try:
import builtins
patch_string = 'builtins.print'
except ImportError:
import __builtin__
patch_string = '__builtin__.print'
class TestBurninator(object):
def setup(self):
self.burninator = Burninator()
... | from mock import *
from nose.tools import *
from burninator import Burninator
class TestBurninator(object):
def setup(self):
self.burninator = Burninator()
def test_burninate(self):
with patch('__builtin__.print') as mock_print:
self.burninator.burninate()
mock_print... | mit | Python |
910699eac10482a22a9de7151b8de7de0e00f104 | Remove import | xuru/vixDiskLib | vixDiskLib/__init__.py | vixDiskLib/__init__.py |
__version__ = "0.2"
from vixDiskLib import * # IGNORE:F0401 | mit | Python | |
0d7fb483706eca39c44fe3748d93d5d9deea3872 | put pragma no cover on django ext | mathom/Zappa,pjz/Zappa,parroyo/Zappa,scoates/Zappa,longzhi/Zappa,pjz/Zappa,michi88/Zappa,mathom/Zappa,Miserlou/Zappa,longzhi/Zappa,scoates/Zappa,anush0247/Zappa,Miserlou/Zappa,michi88/Zappa,parroyo/Zappa,anush0247/Zappa | zappa/ext/django.py | zappa/ext/django.py | import sys
# add the Lambda root path into the sys.path
sys.path.append('/var/task')
from django.core.handlers.wsgi import WSGIHandler
from django.core.wsgi import get_wsgi_application
import os
def get_django_wsgi(settings_module): # pragma: no cover
os.environ.setdefault("DJANGO_SETTINGS_MODULE", settings_modu... | import sys
# add the Lambda root path into the sys.path
sys.path.append('/var/task')
from django.core.handlers.wsgi import WSGIHandler
from django.core.wsgi import get_wsgi_application
import os
def get_django_wsgi(settings_module):
os.environ.setdefault("DJANGO_SETTINGS_MODULE", settings_module)
import dja... | mit | Python |
3ae67a03018db45f821935d8fa36bb7cd106dcc9 | add user endpoint | Zombusters/zchat-lambdas | zchat/zchat/urls.py | zchat/zchat/urls.py | """zchat URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-base... | """zchat URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-base... | mit | Python |
e38f994d707a6c26c014b57278391d067c071879 | Use an innerjoin to optimize the RSS view | wlonk/warehouse,alex/warehouse,karan/warehouse,alex/warehouse,wlonk/warehouse,karan/warehouse,dstufft/warehouse,dstufft/warehouse,karan/warehouse,pypa/warehouse,karan/warehouse,pypa/warehouse,alex/warehouse,wlonk/warehouse,pypa/warehouse,dstufft/warehouse,pypa/warehouse,alex/warehouse,karan/warehouse,alex/warehouse,dst... | warehouse/rss/views.py | warehouse/rss/views.py | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | apache-2.0 | Python |
6fbc027a8fc25ac69ddca755e1fbac3aebd845cb | reformat code | geometalab/osmaxx,geometalab/drf-utm-zone-info,geometalab/osmaxx,geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/osmaxx-frontend,geometalab/osmaxx-frontend,geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/drf-utm-zone-info | tests/inside_worker_test/burial_ground_sql_test.py | tests/inside_worker_test/burial_ground_sql_test.py | from contextlib import contextmanager, closing
import pytest
import sqlalchemy
from sqlalchemy.sql.schema import Table as DbTable
from tests.conftest import area_polyfile_string
from tests.inside_worker_test.conftest import slow
from tests.inside_worker_test.declarative_schema import osm_models
@slow
def test_osmax... | from contextlib import contextmanager, closing
import pytest
import sqlalchemy
from sqlalchemy.sql.schema import Table as DbTable
from tests.conftest import area_polyfile_string
from tests.inside_worker_test.conftest import slow
from tests.inside_worker_test.declarative_schema import osm_models
@slow
def test_osmax... | mit | Python |
ef2813a0683e15dcedfe747f7dd2e55dc76cc832 | Improve load env config log output | espressif/esp-idf,espressif/esp-idf,espressif/esp-idf,espressif/esp-idf | tools/ci/python_packages/tiny_test_fw/EnvConfig.py | tools/ci/python_packages/tiny_test_fw/EnvConfig.py | # Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:#www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | # Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:#www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | apache-2.0 | Python |
2acfe55b746a72088e5aaad31e6ed264857895c6 | fix expat dependency (#26221) | LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack | var/spack/repos/builtin/packages/exempi/package.py | var/spack/repos/builtin/packages/exempi/package.py | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Exempi(AutotoolsPackage):
"""exempi is a port of Adobe XMP SDK to work on UNIX and to be b... | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Exempi(AutotoolsPackage):
"""exempi is a port of Adobe XMP SDK to work on UNIX and to be b... | lgpl-2.1 | Python |
08f7020e0ab9906962fcef43c369fae7c6f00c0e | add v2.0.6 (#23397) | LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack | var/spack/repos/builtin/packages/opari2/package.py | var/spack/repos/builtin/packages/opari2/package.py | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Opari2(AutotoolsPackage):
"""OPARI2 is a source-to-source instrumentation tool for OpenMP ... | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Opari2(AutotoolsPackage):
"""OPARI2 is a source-to-source instrumentation tool for OpenMP ... | lgpl-2.1 | Python |
2dc4221308bd60254ce937a7501382fbdd07f3b5 | Fix test name so it actually runs | rickerbh/tictactoe_py | tests/game_board_tests.py | tests/game_board_tests.py | from nose.tools import *
from tictactoe.game_board import GameBoard
def game_board_is_empty_on_creation_test():
board = GameBoard()
current_state = board.game_state
assert_equal(["", "", "", "", "", "", "", "", ""], current_state)
def game_board_registers_initial_move_test():
board = GameBoard()
b... | from nose.tools import *
from tictactoe.game_board import GameBoard
def game_board_is_empty_on_creation_test():
board = GameBoard()
current_state = board.game_state
assert_equal(["", "", "", "", "", "", "", "", ""], current_state)
def game_board_registers_initial_move_test():
board = GameBoard()
b... | mit | Python |
a82ecc8b6a544d88e23feee7496ce4ddfa8cae5d | Update version number | PaulMcInnis/JobPy | jobfunnel/__init__.py | jobfunnel/__init__.py | __version__ = '2.1.4'
| __version__ = '2.1.3'
| mit | Python |
7dea728044ab0477670b0690c202ea8270dbbfb4 | Fix java tests | jorgebastida/gordon,jorgebastida/gordon,jorgebastida/gordon | tests/lambdajava/tests.py | tests/lambdajava/tests.py | import os
import unittest
import boto3
from gordon.utils_tests import BaseIntegrationTest, BaseBuildTest
from gordon.utils import valid_cloudformation_name
from gordon import utils
@unittest.skip("Temporarily disabled")
class IntegrationTest(BaseIntegrationTest):
def test_0001_project(self):
self._test... | import os
import unittest
import boto3
from gordon.utils_tests import BaseIntegrationTest, BaseBuildTest
from gordon.utils import valid_cloudformation_name
from gordon import utils
@unittest.skipIf(os.environ.get('TRAVIS') == 'true', "Test not yet supported on travis")
class IntegrationTest(BaseIntegrationTest):
... | bsd-3-clause | Python |
730d786d03119f74b1ddddd0ce1d17d210cb0ac2 | test api: set status codes for create recording | webrecorder/webrecorder,webrecorder/webrecorder,webrecorder/webrecorder,webrecorder/webrecorder | webrecorder/test/api/v1.py | webrecorder/test/api/v1.py | from bottle import get, post, request, response, run
from random import randint
import re
# GET /recordings
@get('/api/v1/recordings')
def recordings_index():
user = request.query.user
collection = request.query.collection
return { "recordings": [{"id": "a-la-recherche", "title": "À la recherche",
"created... | from bottle import get, post, request, run
from random import randint
import re
# GET /recordings
@get('/api/v1/recordings')
def recordings_index():
user = request.query.user
collection = request.query.collection
return { "recordings": [{"id": "a-la-recherche", "title": "À la recherche",
"created_at": "201... | apache-2.0 | Python |
f268e841194b941ac74bee34f59dfa49c5d99c21 | remove raw unicode strings as they aren't supported in py3 | pidydx/artifacts,destijl/artifacts,pidydx/artifacts,destijl/artifacts | tests/source_type_test.py | tests/source_type_test.py | # -*- coding: utf-8 -*-
"""Tests for the source type objects."""
import unittest
from artifacts import errors
from artifacts import source_type
class SourceTypeTest(unittest.TestCase):
"""Class to test the artifact source type."""
class ArtifactSourceTypeTest(unittest.TestCase):
"""Class to test the artifacts... | # -*- coding: utf-8 -*-
"""Tests for the source type objects."""
import unittest
from artifacts import errors
from artifacts import source_type
class SourceTypeTest(unittest.TestCase):
"""Class to test the artifact source type."""
class ArtifactSourceTypeTest(unittest.TestCase):
"""Class to test the artifacts... | apache-2.0 | Python |
5c22244ee834db213052513474898317ce867f4f | Fix duplicate tests | zero323/pyspark-stubs | tests/unit/testpyspark.py | tests/unit/testpyspark.py | from mypy.test.data import DataDrivenTestCase, DataSuite
from mypy.test.testcheck import TypeCheckSuite
TypeCheckSuite.files = [
"context.test",
"ml-classification.test",
"ml-evaluation.test",
"ml-feature.test",
"ml-param.test",
"ml-readable.test",
"resultiterab... | from mypy.test.data import DataDrivenTestCase, DataSuite
from mypy.test.testcheck import TypeCheckSuite
class PySparkCoreSuite(TypeCheckSuite):
TypeCheckSuite.files = [
"context.test",
"ml-classification.test",
"ml-evaluation.test",
"ml-feature.test",
"ml-param.test",
... | apache-2.0 | Python |
561ffb4b5ea32383447ff1af29b849f1435d4337 | update init arguments | mir-group/flare,mir-group/flare | tests/test_OTF_vasp.py | tests/test_OTF_vasp.py | import pytest
import os
import sys
import numpy as np
from flare.otf import OTF
from flare.gp import GaussianProcess
from flare.struc import Structure
from flare.dft_interface.vasp_util import *
# ------------------------------------------------------
# test otf runs
# ----------------------------... | import pytest
import os
import sys
import numpy as np
from flare.otf import OTF
from flare.gp import GaussianProcess
from flare.struc import Structure
from flare.dft_interface.vasp_util import *
# ------------------------------------------------------
# test otf runs
# ----------------------------... | mit | Python |
d915efcd0df748d0872b2b2e905e94e65841ee9c | Switch test to pytest. | okin/nikola,getnikola/nikola,okin/nikola,okin/nikola,getnikola/nikola,getnikola/nikola,getnikola/nikola,okin/nikola | tests/test_commands.py | tests/test_commands.py | # -*- coding: utf-8 -*-
from nikola.plugins.command.version import CommandVersion
def test_version():
"""Test `nikola version`."""
CommandVersion().execute()
| # -*- coding: utf-8 -*-
import unittest
from nikola.plugins.command.version import CommandVersion
class CommandVersionCallTest(unittest.TestCase):
def test_version(self):
"""Test `nikola version`."""
CommandVersion().execute()
| mit | Python |
b3c5707f90590af9ff63a76ba4b8101bd590d147 | Document tests for copy feature | caleb531/youversion-suggest,caleb531/youversion-suggest | tests/test_copy_ref.py | tests/test_copy_ref.py | #!/usr/bin/env python
import nose.tools as nose
import yv_suggest.copy_ref as yvs
import context_managers as ctx
from mock import patch, mock_open, Mock
with open('tests/files/psa.23.html') as html_file:
TEST_REF_HTML = html_file.read()
def before_each():
yvs.urllib2.urlopen = Mock()
yvs.urllib2.urlope... | #!/usr/bin/env python
import nose.tools as nose
import yv_suggest.copy_ref as yvs
import context_managers as ctx
from mock import patch, mock_open, Mock
with open('tests/files/psa.23.html') as html_file:
TEST_REF_HTML = html_file.read()
def before_each():
yvs.urllib2.urlopen = Mock()
yvs.urllib2.urlope... | mit | Python |
d1252fde02f21cbf24e8fbf59d72083c40b2c0a2 | make payload nullable | uwekamper/justeventme | justeventme/models.py | justeventme/models.py | # -*- coding: utf-8 -*-
from django.db import models
from django.db.models.base import ModelBase
from django.contrib.postgres.fields import HStoreField
class ReadModel(models.Model):
"""
The read model is an abstract class for creating read-only models
that present the state of the system to the outside.
... | # -*- coding: utf-8 -*-
from django.db import models
from django.db.models.base import ModelBase
from django.contrib.postgres.fields import HStoreField
class ReadModel(models.Model):
"""
The read model is an abstract class for creating read-only models
that present the state of the system to the outside.
... | mit | Python |
3a2e52a8da5f9f7a8e80e564b04dcf671ce06102 | Remove dummy.mc at the end of all tests | SEMAFORInformatik/femagtools,SEMAFORInformatik/femagtools | tests/test_magncurv.py | tests/test_magncurv.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
import unittest
import tempfile
import femagtools
import os
mcvPars =[dict(
name="TKS_NO_20"
,desc="PowerCore NO 20 ;ThyssenKrupp Steel Eur"
,cversion=0
,ctype=1
,recalc=1
,curve=[{"bi":[0.0,0.09029103,0.17855673,0.26691416,0.35827994],
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
import unittest
import tempfile
import femagtools
import os
mcvPars =[dict(
name="TKS_NO_20"
,desc="PowerCore NO 20 ;ThyssenKrupp Steel Eur"
,cversion=0
,ctype=1
,recalc=1
,curve=[{"bi":[0.0,0.09029103,0.17855673,0.26691416,0.35827994],
... | bsd-2-clause | Python |
aa21bc8b6517b5eadb3b8e92bcd072de2fd1b98b | Remove sqlite3 from testing docs | dbryant4/furtive | tests/test_manifest.py | tests/test_manifest.py | """ Test cases for Manifest object """
import os
import unittest
from furtive.manifest import Manifest
class TestManifest(unittest.TestCase):
def test_manifest_create(self):
""" Ensure a manifest can be generated from a directory """
manifest = Manifest('tests/fixtures/test-data', '.test_manife... | """ Test cases for Manifest object """
import os
import unittest
from furtive.manifest import Manifest
class TestManifest(unittest.TestCase):
def test_manifest_create(self):
""" Ensure a manifest can be generated from a directory """
manifest = Manifest('tests/fixtures/test-data', '.test_manife... | mit | Python |
8fb83238406ae3ce4d0dc3d0bd870db9042de710 | fix tests | ahwillia/tensortools | tests/test_optimize.py | tests/test_optimize.py | """Test optimization routines."""
import pytest
import numpy as np
from scipy import linalg
import itertools
import tensortools as tt
obj_decreased_tol = 1e-3
data_seed = 0
alg_seed = 100
algnames = ['cp_als', 'ncp_hals', 'ncp_bcd']
shapes = [(10, 11, 12), (10, 11, 12, 13), (100, 101, 102)]
ranks = [1, 2, 5]
@pytes... | """Test optimization routines."""
import pytest
import numpy as np
from scipy import linalg
import tensortools as tt
deterministic_tol = 1e-3
def _get_data(rank, order, nonneg):
"""Sets random seed and creates low rank tensor.
Parameters
----------
rank : int
Rank of the synthetic tensor.
... | mit | Python |
37ac1f69fee8be18f165383c211bba24aa79692c | Update aws script to cache stmts on S3 | johnbachman/indra,bgyori/indra,bgyori/indra,sorgerlab/indra,sorgerlab/indra,pvtodorov/indra,johnbachman/belpy,sorgerlab/belpy,johnbachman/belpy,johnbachman/belpy,pvtodorov/indra,sorgerlab/indra,pvtodorov/indra,sorgerlab/belpy,bgyori/indra,pvtodorov/indra,johnbachman/indra,sorgerlab/belpy,johnbachman/indra | indra/tools/reading/run_reach_on_pmids_aws.py | indra/tools/reading/run_reach_on_pmids_aws.py | """
This script is intended to be run on an Amazon ECS container, so information for
the job either needs to be provided in environment variables (e.g., the
REACH version and path) or loaded from S3 (e.g., the list of PMIDs).
"""
from __future__ import absolute_import, print_function, unicode_literals
from builtins imp... | """
This script is intended to be run on an Amazon ECS container, so information for
the job either needs to be provided in environment variables (e.g., the
REACH version and path) or loaded from S3 (e.g., the list of PMIDs).
"""
from __future__ import absolute_import, print_function, unicode_literals
from builtins imp... | bsd-2-clause | Python |
59748f35f21f505b65e6cd62ebea4473526b2067 | increase timeout delay | thornomad/django-hitcount,thornomad/django-hitcount,thornomad/django-hitcount | tests/test_selenium.py | tests/test_selenium.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import unittest
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.core.urlresolvers import reverse
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import unittest
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.core.urlresolvers import reverse
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver... | mit | Python |
13c3fa5522fd9f6cbad42488c74d9fa40ea81404 | bump patch version | jvrsantacruz/tldextract,TeamHG-Memex/tldextract,john-kurkowski/tldextract,jvanasco/tldextract,pombredanne/tldextract | tldextract/__init__.py | tldextract/__init__.py | from .tldextract import extract, TLDExtract
__version__ = "1.3.1"
| from .tldextract import extract, TLDExtract
__version__ = "1.3"
| bsd-3-clause | Python |
7c69dc5bddc7136c274f039223686a92cffd693a | Fix flake8 line length issue | OpenChemistry/tomviz,OpenChemistry/tomviz,OpenChemistry/tomviz,OpenChemistry/tomviz | tomviz/python/setup.py | tomviz/python/setup.py | from setuptools import setup, find_packages
jsonpatch_uri \
= 'jsonpatch@https://github.com/cjh1/python-json-patch/archive/tomviz.zip'
setup(
name='tomviz-pipeline',
version='0.0.1',
description='Tomviz python external pipeline execution infrastructure.',
author='Kitware, Inc.',
author_email='... | from setuptools import setup, find_packages
setup(
name='tomviz-pipeline',
version='0.0.1',
description='Tomviz python external pipeline execution infrastructure.',
author='Kitware, Inc.',
author_email='kitware@kitware.com',
url='https://www.tomviz.org/',
license='BSD 3-Clause',
classif... | bsd-3-clause | Python |
d05992ee44ee6d55243ec5546e741a2d04447aa0 | Revert "a" | Citadel-Station-13/Citadel-Station-13,Poojawa/Citadel-Station-13-portworks,Poojawa/Citadel-Station-13-portworks,Citadel-Station-13/Citadel-Station-13-6th-Port,Poojawa/Citadel-Station-13-portworks,Poojawa/Citadel-Station-13-portworks,Citadel-Station-13/Citadel-Station-13-6th-Port,Citadel-Station-13/Citadel-Station-13,Po... | tools/json_verifier.py | tools/json_verifier.py | import sys
import json
if len(sys.argv) <= 1:
exit(1)
status = 0
for file in sys.argv[1:]:
with open(file, encoding="ISO-8859-1") as f:
try:
json.load(f)
except ValueError as exception:
print("JSON error in {}".format(file))
print(exception)
... | import sys
import json
if len(sys.argv) <= 1:
exit(1)
status = 0
for file in sys.argv[1:]:
with open(file, encoding="ISO-8859-1") as f:
try:
json.load(f)
except ValueError as exception:
print("JSON error in {}".format(file))
print(exception)
sta... | agpl-3.0 | Python |
097f785f712636e17d8599eeccb02f81cfeb5f91 | bump version to 2.0.0 | devx/torment,swarren83/torment,alunduil/torment,kumoru/torment,doublerr/torment | torment/information.py | torment/information.py | # Copyright 2015 Alex Brandt
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | # Copyright 2015 Alex Brandt
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 | Python |
f307070c89ed87944b5ac07aa89eaf8a91c49951 | add correct number of args for add | CyberReboot/vent,cglewis/vent,CyberReboot/vent,cprafullchandra/vent,bpagon13/vent,lilchurro/vent,cprafullchandra/vent,lilchurro/vent,cglewis/vent,CyberReboot/vent,Jeff-Wang93/vent,Jeff-Wang93/vent,lilchurro/vent,Jeff-Wang93/vent,cglewis/vent,bpagon13/vent,bpagon13/vent | tests/test_api_actions.py | tests/test_api_actions.py | from vent.api.actions import Action
def test_add():
""" Test the add function """
instance = Action()
status = instance.add('bad')
assert status[0] == False
status = instance.add('https://github.com/CyberReboot/vent-plugins', branch='experimental')
assert status[0] == True
def test_remove():
... | from vent.api.actions import Action
def test_add():
""" Test the add function """
instance = Action()
status = instance.add()
assert status[0] == False
status = instance.add('https://github.com/CyberReboot/vent-plugins', branch='experimental')
assert status[0] == True
def test_remove():
""... | apache-2.0 | Python |
49a515963c6e09d35c36041450d20b4024c10373 | disable flaky test | scrapinghub/shub | tests/test_deploy_reqs.py | tests/test_deploy_reqs.py | #!/usr/bin/env python
# coding=utf-8
from __future__ import absolute_import
import unittest
import mock
import os
import tempfile
from click.testing import CliRunner
from shub import deploy_reqs
from .utils import mock_conf
class TestDeployReqs(unittest.TestCase):
def setUp(self):
self.runner = CliRu... | #!/usr/bin/env python
# coding=utf-8
from __future__ import absolute_import
import unittest
import mock
import os
import tempfile
from click.testing import CliRunner
from shub import deploy_reqs
from .utils import mock_conf
class TestDeployReqs(unittest.TestCase):
def setUp(self):
self.runner = CliRu... | bsd-3-clause | Python |
2b04e1422ad5e6cceb375a5d3b8398f0c7273f4f | Replace tuple with list | berkmancenter/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud | apps/topics-map/bin/topics_map_worker.py | apps/topics-map/bin/topics_map_worker.py | #!/usr/bin/env python3
"""Topic Mapper job that generates timespan_maps for a timespans or all timespans in a snapshot."""
from mediawords.db import connect_to_db
from mediawords.job import JobBroker
from topics_map.map import generate_and_store_maps
from mediawords.util.log import create_logger
from mediawords.util.... | #!/usr/bin/env python3
"""Topic Mapper job that generates timespan_maps for a timespans or all timespans in a snapshot."""
from mediawords.db import connect_to_db
from mediawords.job import JobBroker
from topics_map.map import generate_and_store_maps
from mediawords.util.log import create_logger
from mediawords.util.... | agpl-3.0 | Python |
28400a6afaf200d9862e4652c5c345086f8c30cb | update version | pavlov99/jsonapi,pavlov99/jsonapi | jsonapi/__init__.py | jsonapi/__init__.py | """ JSON:API realization."""
__version = (0, 6, 4)
__version__ = version = '.'.join(map(str, __version))
__project__ = PROJECT = __name__
| """ JSON:API realization."""
__version = (0, 6, 3)
__version__ = version = '.'.join(map(str, __version))
__project__ = PROJECT = __name__
| mit | Python |
cae6c107c1fd8b7b995795e6cc89c7ef4154a5db | Remove debug line | yeti-platform/yeti,yeti-platform/yeti,yeti-platform/yeti,yeti-platform/yeti | plugins/feeds/public/cybercrime_ponytracker.py | plugins/feeds/public/cybercrime_ponytracker.py | from datetime import datetime, timedelta
import logging
import re
from core.observables import Hash, Url
from core.feed import Feed
from core.errors import ObservableValidationError
class CybercrimePonyTracker(Feed):
default_values = {
"frequency": timedelta(hours=1),
"name": "CybercrimePonyTrac... | from datetime import datetime, timedelta
import logging
import re
from core.observables import Hash, Url
from core.feed import Feed
from core.errors import ObservableValidationError
class CybercrimePonyTracker(Feed):
default_values = {
"frequency": timedelta(hours=1),
"name": "CybercrimePonyTrac... | apache-2.0 | Python |
619be15e0eb86de091088d9935d832265b4e344d | add description of CloudVolume to __init__.py | seung-lab/cloud-volume,seung-lab/cloud-volume,seung-lab/cloud-volume | cloudvolume/__init__.py | cloudvolume/__init__.py | """
A "serverless" Python client for reading and writing arbitrarily large
Neuroglancer Precomputed volumes both locally and on cloud services.
Precomputed volumes consist of chunked numpy arrays, meshes, and
skeletons and can be visualized using Neuroglancer. Typically these
volumes represent one or three channel ... | from .connectionpools import ConnectionPool
from .cloudvolume import CloudVolume
from .lib import Bbox, Vec
from .provenance import DataLayerProvenance
from .skeletonservice import PrecomputedSkeleton, SkeletonEncodeError, SkeletonDecodeError
from .storage import Storage
from .threaded_queue import ThreadedQueue
from .... | bsd-3-clause | Python |
889f9bdae15e315cbca090efb18eae7e512df051 | add printing to testLoadUrdf.py | openhumanoids/director,manuelli/director,patmarion/director,patmarion/director,manuelli/director,openhumanoids/director,mitdrc/director,RobotLocomotion/director,patmarion/director,manuelli/director,patmarion/director,manuelli/director,RobotLocomotion/director,mitdrc/director,RobotLocomotion/director,openhumanoids/direc... | src/python/tests/testLoadUrdf.py | src/python/tests/testLoadUrdf.py | from ddapp.consoleapp import ConsoleApp
from ddapp import visualization as vis
from ddapp import roboturdf
app = ConsoleApp()
view = app.createView()
robotStateModel, robotStateJointController = roboturdf.loadRobotModel('robot state model', view, parent='sensors', color=roboturdf.getRobotGrayColor(), visible=True)
p... | from ddapp.consoleapp import ConsoleApp
from ddapp import visualization as vis
from ddapp import roboturdf
app = ConsoleApp()
view = app.createView()
robotStateModel, robotStateJointController = roboturdf.loadRobotModel('robot state model', view, parent='sensors', color=roboturdf.getRobotGrayColor(), visible=True)
r... | bsd-3-clause | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.