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
a8195c6c14e5e3202b75941ea13e26b4873f2a3a
comment out secret key settings for prod
sunForest/AviPost,sunForest/AviPost
avipost/avipost/settings/prod.py
avipost/avipost/settings/prod.py
from .base import * INSTALLED_APPS += ( 'corsheaders', ) # need to be before django.middleware.common.CommonMiddleware MIDDLEWARE_CLASSES = ( 'corsheaders.middleware.CorsMiddleware', ) + MIDDLEWARE_CLASSES CORS_ORIGIN_ALLOW_ALL = True # TODO: set the database parameters ALLOWED_HOSTS = ["52.16.214.13", "12...
from .base import * INSTALLED_APPS += ( 'corsheaders', ) # need to be before django.middleware.common.CommonMiddleware MIDDLEWARE_CLASSES = ( 'corsheaders.middleware.CorsMiddleware', ) + MIDDLEWARE_CLASSES CORS_ORIGIN_ALLOW_ALL = True # TODO: set the database parameters ALLOWED_HOSTS = ["52.16.214.13", "12...
apache-2.0
Python
5a6b3aab03d339455f40cc4d98932ce60dbada0e
Update availabilityset.py
pathakvaidehi2391/WorkSpace,pathakvaidehi2391/WorkSpace
azurecloudify/availabilityset.py
azurecloudify/availabilityset.py
import json import requests location = '' subscription_id = '' resource_group_name = '' availability_set_name= '' credentials = 'Bearer ' + auth.get_auth_token() headers = {"Content-Type": "application/json", "Authorization": credentials} availability_set_url = 'https://management.azure.com/subscriptions/'+subscript...
import json import requests location = '' subscription_id = '' resource_group_name = '' availability_set_name= '' credentials = '' headers = {"Content-Type": "application/json", "Authorization": credentials} availability_set_url = 'https://management.azure.com/subscriptions/'+subscription_id+'/resourceGroups/'+resou...
apache-2.0
Python
a6fccd7edd4825d57784e4cd9fbb745789b027bb
Support NodeJs 5.x
battlemidget/juju-layer-node
reactive/node.py
reactive/node.py
import os import sys from subprocess import Popen, PIPE from charms.reactive import ( when, set_state, remove_state, main ) from charmhelpers.core import hookenv from charmhelpers.fetch import ( apt_install, apt_purge ) config = hookenv.config() node_version_map = { '0.10': { 'rem...
import os import sys from subprocess import Popen, PIPE from charms.reactive import ( when, set_state, remove_state, main ) from charmhelpers.core import hookenv from charmhelpers.fetch import ( apt_install, apt_purge ) config = hookenv.config() node_version_map = { '0.10': { 'rem...
mit
Python
0c26f41c4a70f799838aa7369a2fef5065695e29
Rename cleaner func.
johnwlockwood/karl_data,johnwlockwood/iter_karld_tools,johnwlockwood/stream_tap,johnwlockwood/stream_tap
example/clean.py
example/clean.py
import argparse from functools import partial from itertools import chain from operator import itemgetter from operator import methodcaller import os from karld.loadump import is_file_csv from karld.run_together import csv_file_to_file from karld.run_together import pool_run_files_to_files from karld.run_together impo...
import argparse from functools import partial from itertools import chain from operator import itemgetter from operator import methodcaller import os from karld.loadump import is_file_csv from karld.run_together import csv_file_to_file from karld.run_together import pool_run_files_to_files from karld.run_together impo...
apache-2.0
Python
b745cba13ebabdf95a92b37bd895fc4c4fb930a9
add special.erf benchmarks
scipy/scipy,aman-iitj/scipy,kleskjr/scipy,pizzathief/scipy,matthew-brett/scipy,zxsted/scipy,perimosocordiae/scipy,perimosocordiae/scipy,andim/scipy,Newman101/scipy,anielsen001/scipy,matthewalbani/scipy,jonycgn/scipy,FRidh/scipy,gef756/scipy,jamestwebber/scipy,larsmans/scipy,ilayn/scipy,larsmans/scipy,aeklant/scipy,nmay...
benchmarks/benchmarks/special.py
benchmarks/benchmarks/special.py
from __future__ import division, absolute_import, print_function import numpy as np try: from scipy.special import ai_zeros, bi_zeros, erf except ImportError: pass from .common import Benchmark class Airy(Benchmark): def time_ai_zeros(self): ai_zeros(100000) def time_bi_zeros(self): ...
from __future__ import division, absolute_import, print_function import numpy as np try: from scipy.special import ai_zeros, bi_zeros except ImportError: pass from .common import Benchmark class Airy(Benchmark): def time_ai_zeros(self): ai_zeros(100000) def time_bi_zeros(self): bi_...
bsd-3-clause
Python
9d2f1a0f1e78f247d179098406855c25b14192db
fix tests
richard-ma/siteonlinechecker,richard-ma/siteonlinechecker
tests/test_loader.py
tests/test_loader.py
import pytest from siteonlinechecker import loader def test_config_loader(): c = loader.Config() c.load() assert c != None
import pytest from siteonlinechecker import config def test_load(): c = config.Config() c.load() assert c != None
mit
Python
9ef992206cd625026970bb48fb9d1fd3ec352261
add comment
matplotlib/basemap,guziy/basemap,matplotlib/basemap,guziy/basemap
examples/garp.py
examples/garp.py
from mpl_toolkits.basemap import Basemap import numpy as np import matplotlib.pyplot as plt # the shortest route from the center of the map # to any other point is a straight line in the azimuthal # equidistant projection. Such lines show the true scale # on the earth's surface. # So, for the specified point, this scr...
from mpl_toolkits.basemap import Basemap import numpy as np import matplotlib.pyplot as plt # the shortest route from the center of the map # to any other point is a straight line in the azimuthal # equidistant projection. Such lines show the true scale # on the earth's surface. # So, for the specified point, this scr...
mit
Python
eecbe4d4eafebbf5d547029943401052f5662769
Update test.py
possoumous/Watchers,possoumous/Watchers,possoumous/Watchers,possoumous/Watchers
examples/test.py
examples/test.py
from seleniumbase import BaseCase print "hello" class MyTestClass(BaseCase): def test_basic(self): self.open('https://stocktwits.com/symbol/CYTR?q=cytr') # Navigate to the web page self.assert_element('a.watchers-top:nth-child(3)') # Assert element on page # Click on link w...
from seleniumbase import BaseCase print "hello" class MyTestClass(BaseCase): def test_basic(self): self.open('https://stocktwits.com/symbol/CYTR?q=cytr') # Navigate to the web page self.assert_element('a.watchers-top:nth-child(3)') # Assert element on page # Click on link w...
mit
Python
076918824316260e4eb556b17e70c2cf7b100a5f
Update tests/test_mpirun.py
OceanPARCELS/parcels,OceanPARCELS/parcels
tests/test_mpirun.py
tests/test_mpirun.py
from os import path, system from netCDF4 import Dataset import numpy as np import pytest import sys try: from mpi4py import MPI except: MPI = None @pytest.mark.skipif(sys.platform.startswith("darwin"), reason="skipping macOS test as problem with file in pytest") @pytest.mark.parametrize('pset_mode', ['soa', '...
from os import path, system from netCDF4 import Dataset import numpy as np import pytest import sys try: from mpi4py import MPI except: MPI = None @pytest.mark.skipif(sys.platform.startswith("darwin"), reason="skipping macOS test as problem with file in pytest") @pytest.mark.parametrize('pset_mode', ['soa', '...
mit
Python
46e983bfb12af3ced7e52acc56e7deffe5f2c966
Update version to 0.13.3
quantumlib/qsim,quantumlib/qsim,quantumlib/qsim,quantumlib/qsim
qsimcirq/_version.py
qsimcirq/_version.py
"""The version number defined here is read automatically in setup.py.""" __version__ = "0.13.3"
"""The version number defined here is read automatically in setup.py.""" __version__ = "0.13.2"
apache-2.0
Python
53ba55615fbd02e83212aecaa0c37d1887adfc73
Fix inner exec syntax error in python 2.7
alexmojaki/birdseye,alexmojaki/birdseye,alexmojaki/birdseye,alexmojaki/birdseye
tests/test_tracer.py
tests/test_tracer.py
import sys import unittest from tests.utils import requires_python_version class TestTreeTrace(unittest.TestCase): maxDiff = None @requires_python_version(3.5) def test_async_forbidden(self): from birdseye.tracer import TreeTracerBase tracer = TreeTracerBase() with self.assertRai...
import unittest import sys from tests.utils import requires_python_version class TestTreeTrace(unittest.TestCase): maxDiff = None @requires_python_version(3.5) def test_async_forbidden(self): def check(body): with self.assertRaises(ValueError): exec(""" from birdseye...
mit
Python
31d1e9a991923dcd748f26b3533f2736f04f6454
Add test for property setter
vovanbo/trafaretrecord,vovanbo/trafaretrecord
tests/test_typing.py
tests/test_typing.py
import typing from trafaretrecord import TrafaretRecord def test_initialization(): class A(TrafaretRecord): a: int b: str c: typing.List[int] tmp = A(a=1, b='1', c=[1, 2, 3]) assert repr(tmp) == "A(a=1, b='1', c=[1, 2, 3])" assert tmp._field_types == {'a': int, 'b': str, 'c':...
import typing from trafaretrecord import TrafaretRecord def test_initialization(): class A(TrafaretRecord): a: int b: str c: typing.List[int] tmp = A(a=1, b='1', c=[1, 2, 3]) assert repr(tmp) == "A(a=1, b='1', c=[1, 2, 3])" assert tmp._field_types == {'a': int, 'b': str, 'c':...
mit
Python
d6c89972d4aaa487291d01e14175d2e66613e46a
Correct version number (#127)
yagebu/fava,aumayr/beancount-web,corani/beancount-web,beancount/fava,yagebu/fava,aumayr/beancount-web,beancount/fava,corani/beancount-web,yagebu/fava,yagebu/fava,beancount/fava,beancount/fava,yagebu/fava,aumayr/beancount-web,beancount/fava,corani/beancount-web,corani/beancount-web,aumayr/beancount-web
fava/__init__.py
fava/__init__.py
# -*- coding: utf-8 -*- """ Fava – A web interface for beancount. Copyright © 2015-2016 Dominik Aumayr <dominik@aumayr.name> Licensed under the MIT License. You may not use this file except in compliance with the License. Unless required by applicable law or agreed to in writing, software dist...
# -*- coding: utf-8 -*- """ Fava – A web interface for beancount. Copyright © 2015-2016 Dominik Aumayr <dominik@aumayr.name> Licensed under the MIT License. You may not use this file except in compliance with the License. Unless required by applicable law or agreed to in writing, software dist...
mit
Python
57ead9af05c95cee2354c55bb73f5fe26be3a256
Handle plugin load errors in a helpful way.
youngpm/rasterio,johanvdw/rasterio,clembou/rasterio,youngpm/rasterio,njwilson23/rasterio,perrygeo/rasterio,johanvdw/rasterio,njwilson23/rasterio,kapadia/rasterio,perrygeo/rasterio,youngpm/rasterio,kapadia/rasterio,brendan-ward/rasterio,njwilson23/rasterio,kapadia/rasterio,brendan-ward/rasterio,johanvdw/rasterio,clembou...
rasterio/rio/main.py
rasterio/rio/main.py
# main: loader of all the command entry points. import sys import traceback from pkg_resources import iter_entry_points from rasterio.rio.cli import cli # Find and load all entry points in the rasterio.rio_commands group. # This includes the standard commands included with Rasterio as well # as commands provided b...
# main: loader of all the command entry points. from pkg_resources import iter_entry_points from rasterio.rio.cli import cli # Find and load all entry points in the rasterio.rio_commands group. # This includes the standard commands included with Rasterio as well # as commands provided by other packages. # # At a mi...
bsd-3-clause
Python
836e9f13f7d6728f285d2bdcf00abcc1beff209f
add OCA as author
jobiols/server-tools,acsone/server-tools,sergiocorato/server-tools,osiell/server-tools,osiell/server-tools,acsone/server-tools,acsone/server-tools,sergiocorato/server-tools,ddico/server-tools,osiell/server-tools,sergiocorato/server-tools,ddico/server-tools,ddico/server-tools,jobiols/server-tools
auth_dynamic_groups/__openerp__.py
auth_dynamic_groups/__openerp__.py
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2013-2015 Therp BV (<http://therp.nl>). # # This program is free software: you can redistribute it and/or modify # it under the term...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2013-2015 Therp BV (<http://therp.nl>). # # This program is free software: you can redistribute it and/or modify # it under the term...
agpl-3.0
Python
645f56eb5db6be167a907f8cba3c00a9aeb0ec2d
add volumes to bareon-api data
gitfred/bareon-fuel-extension
bareon_fuel_extension/extension.py
bareon_fuel_extension/extension.py
# -*- coding: utf-8 -*- # Copyright 2015 Mirantis, 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 requi...
# -*- coding: utf-8 -*- # Copyright 2015 Mirantis, 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 requi...
apache-2.0
Python
d0cbe8039ec788d56f66e1d4f14d73857f7e5bc4
Set version as 2.0.0.
Alignak-monitoring-contrib/alignak-module-nsca,Alignak-monitoring-contrib/alignak-module-nsca
version.py
version.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015-2017: # Frédéric Mohier, frederic.mohier@alignak.net # """ Alignak - Receiver module to collecting and decoding NSCA checks """ # Package name __pkg_name__ = u"alignak_module_nsca" # Module type for PyPI keywords # Used for: # - PyPI keywords _...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015-2017: # Frédéric Mohier, frederic.mohier@alignak.net # """ Alignak - Receiver module to collecting and decoding NSCA checks """ # Package name __pkg_name__ = u"alignak_module_nsca" # Module type for PyPI keywords # Used for: # - PyPI keywords _...
agpl-3.0
Python
8fc1acfb2754dedd0cb66fa87361bd3cee290975
Bump version.
memmett/PyWENO,memmett/PyWENO,memmett/PyWENO
version.py
version.py
version = '0.7.2'
version = '0.7.1'
bsd-3-clause
Python
b4c1c674acc0744a92a093015049bbd8474cffcd
Set version as 1.7.0
Alignak-monitoring-contrib/alignak-module-ws,Alignak-monitoring-contrib/alignak-module-ws
version.py
version.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015-2017: # Frédéric Mohier, frederic.mohier@alignak.net # """ Alignak - Receiver module for the Web services """ # Package name __pkg_name__ = u"alignak_module_ws" # Module type for PyPI keywords # Used for: # - PyPI keywords __module_types__ = u"...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015-2017: # Frédéric Mohier, frederic.mohier@alignak.net # """ Alignak - Receiver module for the Web services """ # Package name __pkg_name__ = u"alignak_module_ws" # Module type for PyPI keywords # Used for: # - PyPI keywords __module_types__ = u"...
agpl-3.0
Python
69a339c792e2545cbd12c126a5b0865e4cf1e7e5
Add test cases for product.
andela-sjames/paystack-python
paystackapi/tests/test_product.py
paystackapi/tests/test_product.py
import httpretty from paystackapi.tests.base_test_case import BaseTestCase from paystackapi.product import Product class TestProduct(BaseTestCase): @httpretty.activate def test_product_create(self): """Method defined to test product creation.""" httpretty.register_uri( httpretty....
import httpretty from paystackapi.tests.base_test_case import BaseTestCase from paystackapi.product import Product # class TestProduct(BaseTestCase): # @httpretty.activate # def test_valid_create(self): # pass
mit
Python
f40b4df190f8af130cb3ec47e1ea24c69c1d0f93
set to dev version
grahamu/pinax-theme-bootstrap,foraliving/foraliving,druss16/danslist,grahamu/pinax-theme-bootstrap,grahamu/pinax-theme-bootstrap,foraliving/foraliving,jacobwegner/pinax-theme-bootstrap,druss16/danslist,foraliving/foraliving,jacobwegner/pinax-theme-bootstrap,jacobwegner/pinax-theme-bootstrap,druss16/danslist
pinax_theme_bootstrap/__init__.py
pinax_theme_bootstrap/__init__.py
__version__ = "2.1.0.dev1"
__version__ = "2.1.0"
mit
Python
356b7a289fcda9e8c8f6cb6d152540f32856a13f
Remove trailing whitespace
evanepio/dotmanca,evanepio/dotmanca,evanepio/dotmanca
gallery/views.py
gallery/views.py
from django.views import generic from .models import Gallery, GalleryImage class IndexView(generic.ListView): model = Gallery template_name = "gallery/index.html" context_object_name = "galleries" class GalleryView(generic.DetailView): model = Gallery template_name = "gallery/gallery.html" cl...
from django.views import generic from .models import Gallery, GalleryImage class IndexView(generic.ListView): model = Gallery template_name = "gallery/index.html" context_object_name = "galleries" class GalleryView(generic.DetailView): model = Gallery template_name = "gallery/gallery.html" cl...
mit
Python
2a84c7a8e0785b0bf3f51b698ca92159f610772d
Fix typo in include directories
Nixsm/cmake-generator
generateCmake.py
generateCmake.py
#!/bin/python import os import argparse if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument("dirname", help="Dirname to create the project") parser.add_argument("path", help="Path to create project") args = parser.parse_args() dir = args.dirname path = args....
#!/bin/python import os import argparse if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument("dirname", help="Dirname to create the project") parser.add_argument("path", help="Path to create project") args = parser.parse_args() dir = args.dirname path = args....
mit
Python
9de4fe978bb80d7ed2f45f30fe1901e5423ea4d5
Rename "item_set" to "itemset" in generaterules.py.
cpearce/armpy,cpearce/armpy
generaterules.py
generaterules.py
from item import ItemSet from index import InvertedIndex from apriori import apriori from itertools import chain, combinations import sys if sys.version_info[0] < 3: raise Exception("Python 3 or a more recent version is required.") # Modified version of itertools powerset recipie; this version outputs all # sub...
from item import ItemSet from index import InvertedIndex from apriori import apriori from itertools import chain, combinations import sys if sys.version_info[0] < 3: raise Exception("Python 3 or a more recent version is required.") # Modified version of itertools powerset recipie; this version outputs all # sub...
apache-2.0
Python
2c5383bc3c9eb4757ce305e073c109c99df9600b
Fix bug in grab.tools.log:print_dict
subeax/grab,kevinlondon/grab,istinspring/grab,giserh/grab,istinspring/grab,alihalabyah/grab,SpaceAppsXploration/grab,subeax/grab,maurobaraldi/grab,codevlabs/grab,DDShadoww/grab,huiyi1990/grab,subeax/grab,shaunstanislaus/grab,shaunstanislaus/grab,alihalabyah/grab,DDShadoww/grab,kevinlondon/grab,lorien/grab,lorien/grab,p...
grab/util/log.py
grab/util/log.py
""" This module contains `print_dict` function that is useful to dump content of dictionary in human acceptable representation. """ def repr_value(val): if isinstance(val, unicode): return val.encode('utf-8') elif isinstance(val, (list, tuple)): return '[%s]' % ', '.join(repr_value(x) for x in v...
def repr_value(val): if isinstance(val, unicode): return val.encode('utf-8') elif isinstance(val, (list, tuple)): return '[%s]' % ', '.join(repr_val(x) for x in val) elif isinstance(val, dict): return '{%s}' % ', '.join('%s: %s' % (repr_val(x), repr_val(y)) for x, y in val.items()) ...
mit
Python
e8785b6ac39df930b9ec492c6a38fb50f3c66fb5
Move the Android API JAR ahead of the third-party dependencies in the Javadoc classpath (#27125)
aam/engine,chinmaygarde/flutter_engine,flutter/engine,chinmaygarde/flutter_engine,devoncarew/engine,chinmaygarde/flutter_engine,flutter/engine,devoncarew/engine,jamesr/flutter_engine,jamesr/flutter_engine,aam/engine,jamesr/sky_engine,jamesr/flutter_engine,jamesr/sky_engine,flutter/engine,jason-simmons/flutter_engine,aa...
tools/gen_javadoc.py
tools/gen_javadoc.py
#!/usr/bin/env python # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import argparse import os import subprocess import sys ANDROID_SRC_ROOT = 'flutter/shell/platform/android' def main(): parser = arg...
#!/usr/bin/env python # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import argparse import os import subprocess import sys ANDROID_SRC_ROOT = 'flutter/shell/platform/android' def main(): parser = arg...
bsd-3-clause
Python
31ddb0a3175cc3be36ea3e71c2da0016d97a406a
change #! to python3
xiph/rav1e,xiph/rav1e
tools/submit_awcy.py
tools/submit_awcy.py
#!/usr/bin/env python3 from __future__ import print_function import requests import argparse import os import subprocess import sys from datetime import datetime #our timestamping function, accurate to milliseconds #(remove [:-3] to display microseconds) def GetTime(): return datetime.now().strftime("%Y-%m-%d %H...
#!/usr/bin/env python from __future__ import print_function import requests import argparse import os import subprocess import sys from datetime import datetime #our timestamping function, accurate to milliseconds #(remove [:-3] to display microseconds) def GetTime(): return datetime.now().strftime("%Y-%m-%d %H:...
bsd-2-clause
Python
71e64dea686a57e358f87c926bf8c22313e99266
Fix spelling test name spelling error
ismailsunni/healthsites,ismailsunni/healthsites,ismailsunni/healthsites,ismailsunni/healthsites
django_project/localities/tests/test_model_AttributeArchive.py
django_project/localities/tests/test_model_AttributeArchive.py
# -*- coding: utf-8 -*- from django.test import TestCase from .model_factories import AttributeF from ..models import AttributeArchive class TestModelAttributeArchive(TestCase): def test_archiving_attribute(self): attribute = AttributeF.create(key='A key') attribute.description = 'a new descrit...
# -*- coding: utf-8 -*- from django.test import TestCase from .model_factories import AttributeF from ..models import AttributeArchive class TestModelAttributeArchive(TestCase): def test_archiving_attrbute(self): attribute = AttributeF.create(key='A key') attribute.description = 'a new descritp...
bsd-2-clause
Python
bb2a5341957f065b9096d3708df842cf01f29b6c
update logmod.py to include pep8 changes to Twiggy
dieseldev/diesel
diesel/logmod.py
diesel/logmod.py
# vim:ts=4:sw=4:expandtab '''A simple logging module that supports various verbosity levels and component-specific subloggers. ''' import sys import time from twiggy import log as olog, add_emitters, levels, outputs, formats, emitters from functools import partial diesel_format = formats.line_format diesel_format.tra...
# vim:ts=4:sw=4:expandtab '''A simple logging module that supports various verbosity levels and component-specific subloggers. ''' import sys import time from twiggy import log as olog, addEmitters, levels, outputs, formats, emitters from functools import partial diesel_format = formats.line_format diesel_format.trac...
bsd-3-clause
Python
79d92fad748a726e03d137a89779372afb597b0a
Bump to version 0.4.3alpha
chop-dbhi/data-models-django,chop-dbhi/data-models-django
dmdj/__init__.py
dmdj/__init__.py
import os serial = os.environ.get('BUILD_NUM') or '0' sha = os.environ.get('GIT_SHA') or '0' if sha: sha = sha[0:8] __version_info__ = { 'major': 0, 'minor': 4, 'micro': 3, 'releaselevel': 'alpha', 'serial': serial, 'sha': sha } def get_version(short=False): assert __version_info__['...
import os serial = os.environ.get('BUILD_NUM') or '0' sha = os.environ.get('GIT_SHA') or '0' if sha: sha = sha[0:8] __version_info__ = { 'major': 0, 'minor': 4, 'micro': 2, 'releaselevel': 'final', 'serial': serial, 'sha': sha } def get_version(short=False): assert __version_info__['...
bsd-2-clause
Python
707e60942a938dba01fe92694995b1e87624d56e
fix for migration error
ResearchSoftwareInstitute/MyHPOM,FescueFungiShare/hydroshare,hydroshare/hydroshare,hydroshare/hydroshare,RENCI/xDCIShare,FescueFungiShare/hydroshare,RENCI/xDCIShare,FescueFungiShare/hydroshare,ResearchSoftwareInstitute/MyHPOM,hydroshare/hydroshare,RENCI/xDCIShare,RENCI/xDCIShare,RENCI/xDCIShare,FescueFungiShare/hydrosh...
hs_app_timeseries/migrations/custom_data_migration_20160718.py
hs_app_timeseries/migrations/custom_data_migration_20160718.py
import logging from django.db import migrations from hs_core.hydroshare.utils import resource_modified def delete_extracted_metadata(apps, schema_editor): # For all existing timeseries resources, delete all resource specific metadata. # This way we can keep the resource GUID and allow the resource owners to...
import logging from django.db import migrations from hs_core.hydroshare.utils import resource_modified def delete_extracted_metadata(apps, schema_editor): # For all existing timeseries resources, delete all resource specific metadata. # This way we can keep the resource GUID and allow the resource owners to...
bsd-3-clause
Python
d9c571c1f29d78ea9ceee3f7c52c14e9661fea55
Update dependency in_gopkg_yaml_v2 to v2 (#1172)
bazelbuild/rules_docker,bazelbuild/rules_docker,bazelbuild/rules_docker,bazelbuild/rules_docker
repositories/go_repositories.bzl
repositories/go_repositories.bzl
# Copyright 2016 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
# Copyright 2016 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
apache-2.0
Python
75c4f14990f7eb7a40d0ccbe310b58ac6018e382
Add admin to hackers
UrLab/incubator,UrLab/incubator,UrLab/incubator,UrLab/incubator
hackers/admin.py
hackers/admin.py
from django.contrib import admin from .models import Hacker, MacAdress @admin.register(Hacker) class HackerAdmin(admin.ModelAdmin): list_display = ('user', 'balance') # list_filter = ('balance',) search_fields = ('user',) @admin.register(MacAdress) class MacAdressAdmin(admin.ModelAdmin): list_displ...
from django.contrib import admin # Register your models here.
agpl-3.0
Python
bf9d41c8f211fdd9e2b1a37162b753d3845a6708
Remove dead code in api/test_types.py (#24516)
rs2/pandas,gfyoung/pandas,TomAugspurger/pandas,dsm054/pandas,rs2/pandas,GuessWhoSamFoo/pandas,pandas-dev/pandas,gfyoung/pandas,MJuddBooth/pandas,pandas-dev/pandas,MJuddBooth/pandas,TomAugspurger/pandas,rs2/pandas,pandas-dev/pandas,jorisvandenbossche/pandas,MJuddBooth/pandas,GuessWhoSamFoo/pandas,datapythonista/pandas,c...
pandas/tests/api/test_types.py
pandas/tests/api/test_types.py
# -*- coding: utf-8 -*- from pandas.api import types from pandas.util import testing as tm from .test_api import Base class TestTypes(Base): allowed = ['is_bool', 'is_bool_dtype', 'is_categorical', 'is_categorical_dtype', 'is_complex', 'is_complex_dtype', 'is_datetime64_any_dtype',...
# -*- coding: utf-8 -*- import pytest from pandas.api import types from pandas.util import testing as tm from .test_api import Base class TestTypes(Base): allowed = ['is_bool', 'is_bool_dtype', 'is_categorical', 'is_categorical_dtype', 'is_complex', 'is_complex_dtype', 'is_datetim...
bsd-3-clause
Python
660652f05793802e31d2602776df05245a41c173
add LOCATION clause to ALTER TABLE statement
1Strategy/security-fairy
partition_cloudtrail_bucket.py
partition_cloudtrail_bucket.py
"""Build_Cloudtrail_Table Create the CloudTrail Logs table for Athena use. See the AWS documentation for Athena here: http://docs.aws.amazon.com/athena/latest/ug/getting-started.html """ import os import sys import json import logging import boto3 from datetime import datetime from botocore.exceptions import Pr...
"""Build_Cloudtrail_Table Create the CloudTrail Logs table for Athena use. See the AWS documentation for Athena here: http://docs.aws.amazon.com/athena/latest/ug/getting-started.html """ import os import sys import json import logging import boto3 from datetime import datetime from botocore.exceptions import Pr...
apache-2.0
Python
e529989a36f2fd1868f6dd91c6d9e561ba777a43
Add importing Astropy FITS
jacobbieker/GCP-perpendicular-least-squares,jacobbieker/GCP-perpendicular-least-squares,jacobbieker/GCP-perpendicular-least-squares
perpendicular-least-squares.py
perpendicular-least-squares.py
__author__ = 'Jacob Bieker' import os, sys import numpy from multiprocessing import Pool from astropy.io import fits def line_solve(): # TODO: Find the Least Squares for a line return 0 def plane_solve(): # TODO: Find the least Squares for a plane return 0 def read_clusters(*args): # TODO: Re...
__author__ = 'Jacob Bieker' import os, sys import numpy from multiprocessing import Pool def line_solve(): # TODO: Find the Least Squares for a line return 0 def plane_solve(): # TODO: Find the least Squares for a plane return 0 def read_clusters(*args): # TODO: Read in the files containing th...
mit
Python
09c4b1ec6ca18e8b5abb1f690fd5ef2638407af0
clear all caches
nim65s/django-PGP-tables,nim65s/django-PGP-tables,nim65s/django-PGP-tables
pgp_tables/management/commands/check_signatures.py
pgp_tables/management/commands/check_signatures.py
from subprocess import call from django.core.cache import cache from django.core.management.base import BaseCommand from pgp_tables.models import Key, KeySigningParty def all_ksps(): return KeySigningParty.objects.values_list('slug', flat=True) class Command(BaseCommand): help = 'Vérifie les signatures ma...
from subprocess import call from django.core.cache import cache from django.core.cache.utils import make_template_fragment_key from django.core.management.base import BaseCommand from pgp_tables.models import Key, KeySigningParty def all_ksps(): return KeySigningParty.objects.values_list('slug', flat=True) cl...
bsd-2-clause
Python
52e66006a79b62f83c27a25d6aa1cc555d52905e
Bump version to 3.1
konradxyz/dev_fileserver,konradxyz/cloudify-manager,cloudify-cosmo/cloudify-manager,codilime/cloudify-manager,geokala/cloudify-manager,cloudify-cosmo/cloudify-manager,geokala/cloudify-manager,isaac-s/cloudify-manager,cloudify-cosmo/cloudify-manager,isaac-s/cloudify-manager,codilime/cloudify-manager,konradxyz/cloudify-m...
plugins/plugin-installer/setup.py
plugins/plugin-installer/setup.py
######## # Copyright (c) 2014 GigaSpaces Technologies Ltd. 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...
######## # Copyright (c) 2014 GigaSpaces Technologies Ltd. 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...
apache-2.0
Python
603d9832d9d005784ef0bcd418d2ebac74fd9b60
Update version.py
pnegahdar/inenv
inenv/version.py
inenv/version.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # This file is part of inenv. # https://github.com/pnegahdar/inenv # Licensed under the MIT license: # http://www.opensource.org/licenses/MIT-license # Copyright (c) 2015, Parham Negahdar <pnegahdar@gmail.com> __version__ = '0.6.4' # NOQA
#!/usr/bin/env python # -*- coding: utf-8 -*- # This file is part of inenv. # https://github.com/pnegahdar/inenv # Licensed under the MIT license: # http://www.opensource.org/licenses/MIT-license # Copyright (c) 2015, Parham Negahdar <pnegahdar@gmail.com> __version__ = '0.6.3' # NOQA
mit
Python
bdfea32e72caa3521a6ecf62e8da1883db93cfea
Update message.py
merc-devel/merc
merc/message.py
merc/message.py
import functools from merc import emitter class MessageTooLongError(Exception): pass class Message(object): MAX_LENGTH = 510 FORCE_TRAILING = False def emit(self, client, prefix): emitted = emitter.emit_message(prefix, self.NAME, self.as_params(client), force_trailin...
import functools from merc import emitter class MessageTooLongError(Exception): pass class Message(object): MAX_LENGTH = 510 FORCE_TRAILING = False def emit(self, client, prefix): emitted = emitter.emit_message(prefix, self.NAME, self.as_params(client), force_trailin...
mit
Python
9fd97e757b7645c7804cf91c6e0a384e02e32074
Fix range to work over 24 hours worth of datapoints
googleinterns/sgonks,googleinterns/sgonks,googleinterns/sgonks,googleinterns/sgonks
project/scripts/data_generator.py
project/scripts/data_generator.py
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
Python
d10a6b02faa115cdb1432dcdedd3d419390bef68
Update RTOutput to use the new buffer api, and actually work almost decently :)
sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia
Sketches/JT/Jam/library/trunk/Kamaelia/Apps/Jam/Audio/RTOutput.py
Sketches/JT/Jam/library/trunk/Kamaelia/Apps/Jam/Audio/RTOutput.py
import Axon import RtAudio import numpy class RTOutput(Axon.Component.component): outputDevice = 0 sampleRate = 44100 bufferSize = 1024 def __init__(self, **argd): super(RTOutput, self).__init__(**argd) self.io = RtAudio.RtAudio() self.io.openStream(self.outputDevice, self.samp...
import Axon import RtAudio class RTOutput(Axon.Component.component): channels = 2 type = 0x2 # INT16 - will add these into binding sampleRate = 44100 bufferSize = 1024 def __init__(self, **argd): super(RTOutput, self).__init__(**argd) self.io = RtAudio.RtAudio() self.io.sho...
apache-2.0
Python
5bca4b0b6550aa9bd3bbe49dba3ba1d885c78305
Bump to 2.0.0 (compatibility with django >= 1.10)
rclsilver/django-lemonldap,rclsilver/django-lemonldap
lemonldap/__init__.py
lemonldap/__init__.py
""" lemonldap - Allow users to be authenticated through LemonLDAP::NG in django applications """ __version__ = "2.0.0" __authors__ = [ "Thomas Betrancourt <thomas@betrancourt.net>", ]
""" lemonldap - Allow users to be authenticated through LemonLDAP::NG in django applications """ __version__ = "1.0.1" __authors__ = [ "Thomas Betrancourt <thomas@betrancourt.net>", ]
apache-2.0
Python
69308460165acadddcdad3c61ba96c6338651e5c
Fix typo in chrome/test/functional/codesign.py
adobe/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,ropik/chromium,gavinp/chromium,ropik/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-...
chrome/test/functional/codesign.py
chrome/test/functional/codesign.py
#!/usr/bin/python # Copyright (c) 2010 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import commands import glob import logging import os import sys import unittest import pyauto_functional # Must import before pyauto i...
#!/usr/bin/python # Copyright (c) 2010 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import commands import glob import logging import os import sys import unittest import pyauto_functional # Must import before pyauto i...
bsd-3-clause
Python
b890f4afdac8f8a6c79e123718f6e6106a3e799e
Fix article endoint typo
NewAcropolis/api,NewAcropolis/api,NewAcropolis/api
app/routes/articles/rest.py
app/routes/articles/rest.py
import os from flask import ( Blueprint, current_app, jsonify, request ) from flask_jwt_extended import jwt_required from app.dao.articles_dao import ( dao_create_article, dao_get_articles, dao_update_article, dao_get_article_by_id ) from app.errors import register_errors from app.rou...
import os from flask import ( Blueprint, current_app, jsonify, request ) from flask_jwt_extended import jwt_required from app.dao.articles_dao import ( dao_create_article, dao_get_articles, dao_update_article, dao_get_article_by_id ) from app.errors import register_errors from app.rou...
mit
Python
e05fea6fe33625db4bf678687df731d20bbf0a83
make migrations run again on new installation where countries are not available
geometalab/osmaxx,geometalab/osmaxx,geometalab/osmaxx,geometalab/drf-utm-zone-info,geometalab/osmaxx-frontend,geometalab/drf-utm-zone-info,geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/osmaxx-frontend,geometalab/osmaxx-frontend
osmaxx/countries/migrations/0002_inital_country_data_import.py
osmaxx/countries/migrations/0002_inital_country_data_import.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): def import_countries(apps, schema_editor): # noqa # not doing anything to let the migrations pass on new installations pass def remove_countries(apps, sche...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations from osmaxx.countries.utils import get_polyfile_name_to_file_mapping from osmaxx.utils.polyfile_helpers import polyfile_to_geos_geometry class Migration(migrations.Migration): def import_countries(apps, schema_edito...
mit
Python
6758c5534751a1ed264a211bbadef0568bf6e778
Refactor status print functions. Don't print path for clowder repo.
JrGoodle/clowder,JrGoodle/clowder,JrGoodle/clowder
clowder/utility/print_utilities.py
clowder/utility/print_utilities.py
"""Print utilities""" import os import emoji from termcolor import colored, cprint from clowder.utility.git_utilities import ( git_current_sha, git_current_branch, git_is_detached, git_is_dirty ) def get_cat_face(): """Return a cat emoji""" return emoji.emojize(':cat:', use_aliases=True) def g...
"""Print utilities""" import os import emoji from termcolor import colored, cprint from clowder.utility.git_utilities import ( git_current_sha, git_current_branch, git_is_detached, git_is_dirty ) def get_cat_face(): """Return a cat emoji""" return emoji.emojize(':cat:', use_aliases=True) def g...
mit
Python
c1f67989cd701f2aa9bf34a8921729df9d9043e3
Bump version number
cread/ecks,cread/ecks
ecks/__init__.py
ecks/__init__.py
""" A simple way to get data out of a remote machine using SNMP without having to deal with a single MIB or OID The goal of Ecks is simple - make it really easy to get get any data from an SNMP service. Ecks is made up of a core class that will collect data via SNMP, and a set of plugins that cont...
""" A simple way to get data out of a remote machine using SNMP without having to deal with a single MIB or OID The goal of Ecks is simple - make it really easy to get get any data from an SNMP service. Ecks is made up of a core class that will collect data via SNMP, and a set of plugins that cont...
apache-2.0
Python
8b3683613295adb90e74353a7c9234772ef45e74
Test all yet untested branches
CruiseDevice/coala,scriptnull/coala,shreyans800755/coala,Nosferatul/coala,NalinG/coala,rresol/coala,coala-analyzer/coala,Uran198/coala,SambitAcharya/coala,Asnelchristian/coala,ayushin78/coala,arush0311/coala,scottbelden/coala,arjunsinghy96/coala,scriptnull/coala,kartikeys98/coala,Tanmay28/coala,karansingh1559/coala,coa...
coalib/tests/filters/FilterTest.py
coalib/tests/filters/FilterTest.py
""" This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT...
""" This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT...
agpl-3.0
Python
6558e8afe84be0e19fde5159dcfaea4ecece1b66
Add additional checks to bo/utils.py
elfi-dev/elfi,lintusj1/elfi,elfi-dev/elfi,HIIT/elfi,lintusj1/elfi
elfi/bo/utils.py
elfi/bo/utils.py
import numpy as np def approx_second_partial_derivative(fun, x0, dim, h, bounds): """ Approximates the second derivative of function 'fun' at 'x0' in dimension 'dim'. If sampling location is near the bounds, uses a symmetric approximation. """ val = fun(x0) d = np.zeros(len(x0))...
import numpy as np def approx_second_partial_derivative(fun, x0, dim, h, bounds): """ Approximates the second derivative of function 'fun' at 'x0' in dimension 'dim'. If sampling location is near the bounds, uses a symmetric approximation. """ val = fun(x0) d = np.zeros(len(x0))...
bsd-3-clause
Python
b168017e3887d3ff3784cdcef7445e1d2793ee31
Implement data coordinator in CPNWH cleanser
jnfrye/local_plants_book
scripts/observations/cleanse/CPNWH_MultiFileParser.py
scripts/observations/cleanse/CPNWH_MultiFileParser.py
"""This is used when you download CSV files from CPNWH in multiple parts """ import pandas as pd import numpy as np import argparse import PyFloraBook.input_output.data_coordinator as dc # Globals WEBSITE = "CPNWH" FILE_PREFIX = "all_species" INPUT_SUFFIX = "raw_data" OUTPUT_SUFFIX = "species" # Parse arguments p...
"""This is used when you download CSV files from CPNWH in multiple parts """ import pandas as pd import numpy as np import argparse # Parse arguments parser = argparse.ArgumentParser( description='Parse CPNWH multiple data files') parser.add_argument( "-r", "--region", type=str, choices=['OR', 'WA'], requir...
mit
Python
3849897af72c9bdd30a89e7fbfc746c951f0e4db
Make minified serialized to use PrimaryKeyRelatedField for memberships, unittest later #243
Sinar/popit_ng,Sinar/popit_ng
popit/serializers/minimized.py
popit/serializers/minimized.py
__author__ = 'sweemeng' from popit.models import Person from popit.models import Organization from popit.models import Post from popit.models import Membership from popit.models import ContactDetail from popit.models import Link from popit.models import Identifier from popit.models import OtherName from hvad.contrib.re...
__author__ = 'sweemeng' from popit.models import Person from popit.models import Organization from popit.models import Post from popit.models import Membership from popit.models import ContactDetail from popit.models import Link from popit.models import Identifier from popit.models import OtherName from hvad.contrib.re...
agpl-3.0
Python
7a6671e01666c711e8114c040b3f1d56c795857f
extend to fuzz emitter (#8414)
skia-dev/oss-fuzz,google/oss-fuzz,google/oss-fuzz,skia-dev/oss-fuzz,google/oss-fuzz,google/oss-fuzz,google/oss-fuzz,skia-dev/oss-fuzz,skia-dev/oss-fuzz,google/oss-fuzz,skia-dev/oss-fuzz,google/oss-fuzz,skia-dev/oss-fuzz,skia-dev/oss-fuzz,skia-dev/oss-fuzz,google/oss-fuzz,skia-dev/oss-fuzz,skia-dev/oss-fuzz,google/oss-f...
projects/pyyaml/fuzz_loader.py
projects/pyyaml/fuzz_loader.py
#!/usr/bin/python3 # Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
#!/usr/bin/python3 # Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
apache-2.0
Python
cb40f64a81e9adfb2a11e74958292966f59420dc
Add tests for ResetPassword view
aptivate/kashana,daniell/kashana,aptivate/alfie,aptivate/alfie,aptivate/alfie,aptivate/kashana,daniell/kashana,aptivate/kashana,daniell/kashana,aptivate/kashana,aptivate/alfie,daniell/kashana
django/website/contacts/tests/test_views_activation.py
django/website/contacts/tests/test_views_activation.py
from django.conf import settings from django.contrib.auth import get_user_model from django.contrib.messages.middleware import MessageMiddleware from django.contrib.sessions.middleware import SessionMiddleware from django.core import mail from django.core.urlresolvers import reverse from django.http.response import Htt...
from contacts.views.activation import ResetPassword from django.conf import settings def test_reset_password_subject_contains_site_name(): assert '{0}: password recovery'.format(settings.SITE_NAME) == ResetPassword().get_subject()
agpl-3.0
Python
e795f3b16d62f5cfb6c306234cf74897b1daf1cb
Fix permission name for creating repositories.
1tush/reviewboard,reviewboard/reviewboard,bkochendorfer/reviewboard,sgallagher/reviewboard,1tush/reviewboard,bkochendorfer/reviewboard,reviewboard/reviewboard,1tush/reviewboard,KnowNo/reviewboard,bkochendorfer/reviewboard,davidt/reviewboard,chipx86/reviewboard,reviewboard/reviewboard,beol/reviewboard,beol/reviewboard,1...
reviewboard/scmtools/managers.py
reviewboard/scmtools/managers.py
from django.db.models import Manager, Q from django.db.models.query import QuerySet _TOOL_CACHE = {} class ToolQuerySet(QuerySet): def get(self, *args, **kwargs): pk = kwargs.get('id__exact', None) if pk is None: return super(ToolQuerySet, self).get(*args, **kwargs) if not ...
from django.db.models import Manager, Q from django.db.models.query import QuerySet _TOOL_CACHE = {} class ToolQuerySet(QuerySet): def get(self, *args, **kwargs): pk = kwargs.get('id__exact', None) if pk is None: return super(ToolQuerySet, self).get(*args, **kwargs) if not ...
mit
Python
f31f4bc525c6586bb2d24b3cb59bc1e6a65d2a29
Make reply_target parse the colours rather than the module itself.
Zarthus/Reconcile,Zarthus/Reconcile
modules/isup.py
modules/isup.py
""" isup.py by Zarthus Licensed under MIT isup - check if a website is up using isup.me and the bot itself """ from core import moduletemplate import requests class Isup(moduletemplate.BotModule): def on_module_load(self): self.register_command("isup", "<website>", "Checks if <website> is up using isu...
""" isup.py by Zarthus Licensed under MIT isup - check if a website is up using isup.me and the bot itself """ from core import moduletemplate from tools import formatter import requests class Isup(moduletemplate.BotModule): def on_module_load(self): self.colformat = formatter.IrcFormatter() ...
mit
Python
9bd13fe3e486589c32a9a0725a32fd1b26fad194
Add scatter_list_index() to Python ScatterManager
cfobel/python___scatter_gather
scatter_gather/scatter_gather.py
scatter_gather/scatter_gather.py
from __future__ import division import numpy as np class ScatterManager(object): def __init__(self, data, empty_value=0): self.data = data self.empty_value = empty_value def empty_index(self, index): return index < 0 def scatter_list_index(self, i): return i def k_sc...
from __future__ import division import numpy as np class ScatterManager(object): def __init__(self, data, empty_value=0): self.data = data self.empty_value = empty_value def empty_index(self, index): return index < 0 def k_scatter(self, scatter_lists): ''' Given a...
lgpl-2.1
Python
afa1c8fb281f4a2f2e5c4118dbdce6d1a3daab4f
Rename Keystone LDAP entries during Kilo upgrade
yanyao/openstack-deployment,yanyao/openstack-deployment,VaneCloud/openstack-ansible,yanyao/openstack-deployment,VaneCloud/openstack-ansible,yanyao/openstack-deployment,VaneCloud/openstack-ansible
scripts/upgrade-utilities/scripts/juno-kilo-ldap-conversion.py
scripts/upgrade-utilities/scripts/juno-kilo-ldap-conversion.py
#!/usr/bin/env python # Copyright 2015, Rackspace US, 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...
#!/usr/bin/env python # Copyright 2015, Rackspace US, 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...
apache-2.0
Python
f2b6dbf7c8ca1b5dda31058d0937213e819747aa
change the index name to match others
dstufft/jutils
crate_project/settings/dev/base.py
crate_project/settings/dev/base.py
from ..base import * DEBUG = True TEMPLATE_DEBUG = True SERVE_MEDIA = DEBUG SITE_ID = 1 MIDDLEWARE_CLASSES += [ "debug_toolbar.middleware.DebugToolbarMiddleware", ] INSTALLED_APPS += [ "debug_toolbar", ] EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend" #CELERY_ALWAYS_EAGER = True # When ...
from ..base import * DEBUG = True TEMPLATE_DEBUG = True SERVE_MEDIA = DEBUG SITE_ID = 1 MIDDLEWARE_CLASSES += [ "debug_toolbar.middleware.DebugToolbarMiddleware", ] INSTALLED_APPS += [ "debug_toolbar", ] EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend" #CELERY_ALWAYS_EAGER = True # When ...
bsd-2-clause
Python
69f70d1974414615011104db3d07948862ae2f68
bump version to 0.2.dev
jakevdp/nfft
nfft/version.py
nfft/version.py
# Version info: don't use any relative imports here, because setup.py # runs this as a standalone script to extract the following information from __future__ import absolute_import, division, print_function from os.path import join as pjoin # Format expected by setup.py and doc/source/conf.py: string of form "X.Y.Z" ...
# Version info: don't use any relative imports here, because setup.py # runs this as a standalone script to extract the following information from __future__ import absolute_import, division, print_function from os.path import join as pjoin # Format expected by setup.py and doc/source/conf.py: string of form "X.Y.Z" ...
mit
Python
e7c3b364e921ca472c43eea4cd77e7f2b749275b
Put rule works
acuros/noopy
noopy/deploy.py
noopy/deploy.py
import os import sys import boto3 from noopy import settings from noopy.cron.rule import BaseEventRule from noopy.deployer.apigateway import ApiGatewayDeployer from noopy.deployer.awslambda import LambdaDeployer from noopy.utils import to_pascal_case def deploy(settings_module, stage='prod'): sys.path.append(os...
import os import sys import boto3 from noopy import settings from noopy.cron.rule import BaseEventRule from noopy.deployer.apigateway import ApiGatewayDeployer from noopy.deployer.awslambda import LambdaDeployer from noopy.utils import to_pascal_case def deploy(settings_module, stage='prod'): sys.path.append(os...
mit
Python
610d995e382d0a51cec68be0b41d0e35ff6f989e
Use common function to detect msvs version for mslib tool.
azatoth/scons,azatoth/scons,azatoth/scons,azatoth/scons,azatoth/scons
src/engine/SCons/Tool/mslib.py
src/engine/SCons/Tool/mslib.py
"""SCons.Tool.mslib Tool-specific initialization for lib (MicroSoft library archiver). There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # __COPYRIGHT__ # # Permission is hereby granted, free of charge, to a...
"""SCons.Tool.mslib Tool-specific initialization for lib (MicroSoft library archiver). There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # __COPYRIGHT__ # # Permission is hereby granted, free of charge, to a...
mit
Python
dae1a1009e065507aa912b6ecff5e777cecaa570
fix type annotations
mozman/ezdxf,mozman/ezdxf,mozman/ezdxf,mozman/ezdxf,mozman/ezdxf
src/ezdxf/entities/oleframe.py
src/ezdxf/entities/oleframe.py
# Copyright (c) 2021, Manfred Moitzi # License: MIT License from typing import TYPE_CHECKING, Optional from ezdxf.lldxf import const from . import factory from .dxfgfx import DXFGraphic from .dxfentity import SubclassProcessor from ezdxf.math import BoundingBox, Vec3 if TYPE_CHECKING: from ezdxf.eztypes import D...
# Copyright (c) 2021, Manfred Moitzi # License: MIT License from typing import TYPE_CHECKING, Optional from ezdxf.lldxf import const from . import factory from .dxfgfx import DXFGraphic from .dxfentity import SubclassProcessor from ezdxf.math import BoundingBox, Vec3 if TYPE_CHECKING: from ezdxf.eztypes import D...
mit
Python
733c2502c950fa14c601a53937665a1cb060779b
Update script_debugger.py.
woodymit/millstone_accidental_source,churchlab/millstone,woodymit/millstone_accidental_source,woodymit/millstone_accidental_source,woodymit/millstone,woodymit/millstone,churchlab/millstone,woodymit/millstone,churchlab/millstone,woodymit/millstone_accidental_source,churchlab/millstone,woodymit/millstone
genome_designer/debug/script_debugger.py
genome_designer/debug/script_debugger.py
""" Convenience module for debugging scripts. """ import os import sys # Make this script runnable from command line. sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../')) os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' from main.models import * from variants import materialized_view_man...
""" Convenience module for debugging scripts. """ # Since this script is intended to be used from the terminal, setup the # environment first so that django and model imports work. from util import setup_django_env setup_django_env() def main(): pass if __name__ == '__main__': main()
mit
Python
ee10f3d178f70381f6acf617864978406bfa83d6
Fix Add another-bug in admin
jonge-democraten/mezzanine-fullcalendar
fullcalendar/admin.py
fullcalendar/admin.py
from django.utils.translation import ugettext_lazy as _ from django.contrib import admin from mezzanine.core.admin import StackedDynamicInlineAdmin, DisplayableAdmin from fullcalendar.models import * class EventCategoryAdmin(admin.ModelAdmin): list_display = ('name',) class OccurrenceInline(StackedDynamicInlineA...
from django.utils.translation import ugettext_lazy as _ from django.contrib import admin from mezzanine.core.admin import StackedDynamicInlineAdmin, DisplayableAdmin from fullcalendar.models import * class EventCategoryAdmin(admin.ModelAdmin): list_display = ('name',) class OccurrenceInline(StackedDynamicInlineA...
mit
Python
910e7a50445e93ee810d2ec01d2a4bd5f4d2e72c
fix invalid guid error
jamesturk/tot,jamesturk/tot,jamesturk/tot,jamesturk/tot,jamesturk/tot
emailer/views.py
emailer/views.py
from django.shortcuts import render, get_object_or_404 from django.http import Http404 from .models import EmailRecord def unsubscribe(request, guid): try: er = get_object_or_404(EmailRecord, unsubscribe_guid=guid) except ValueError: raise Http404('invalid GUID') if request.method == 'GET'...
from django.shortcuts import render, get_object_or_404 from .models import EmailRecord def unsubscribe(request, guid): print(guid) er = get_object_or_404(EmailRecord, unsubscribe_guid=guid) if request.method == 'GET': unsubscribed = (er.user.preferences.email_frequency == 'N') elif request.met...
mit
Python
096564c95371510769a7dec31cd5d90bf2c56955
Update migration script for users whose usernames aren't in emails field
wearpants/osf.io,chrisseto/osf.io,felliott/osf.io,samchrisinger/osf.io,saradbowman/osf.io,jnayak1/osf.io,alexschiller/osf.io,Nesiehr/osf.io,asanfilippo7/osf.io,abought/osf.io,icereval/osf.io,caneruguz/osf.io,RomanZWang/osf.io,abought/osf.io,TomBaxter/osf.io,hmoco/osf.io,Nesiehr/osf.io,brandonPurvis/osf.io,cslzchen/osf....
scripts/migration/migrate_confirmed_user_emails.py
scripts/migration/migrate_confirmed_user_emails.py
"""Ensure that confirmed users' usernames are included in their emails field. """ import logging import sys from modularodm import Q from website import models from website.app import init_app from scripts import utils as scripts_utils logger = logging.getLogger(__name__) def main(): # Set up storage backend...
"""Ensure that users with User.emails == [] have User.username inserted. """ import logging import sys from modularodm import Q from nose.tools import * from website import models from website.app import init_app from scripts import utils as scripts_utils logger = logging.getLogger(__name__) def main(): # S...
apache-2.0
Python
b1acc2cb7d2d595f580c62c99d5b68eee0a02afb
Add timestamp
araines/energymonitor
energymonitor.py
energymonitor.py
import sys, socket, re, time from pyrrd.rrd import DataSource, RRA, RRD from pyrrd.graph import DEF, LINE, GPRINT, Graph RRD_IMAGES_LOCATION = '/www/rrdtool' def get_energy(): tx_sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) tx_sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) tx_sock.setsockop...
import sys, socket, re from pyrrd.rrd import DataSource, RRA, RRD from pyrrd.graph import DEF, LINE, GPRINT, Graph RRD_IMAGES_LOCATION = '/www/rrdtool' def get_energy(): tx_sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) tx_sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) tx_sock.setsockopt(sock...
mit
Python
6193f118f2f6b6126ada3dcaced078438d59527b
Check the version of pt-table-checksum before using it
nrb/rpc-openstack,jacobwagner/rpc-openstack,mattt416/rpc-openstack,cfarquhar/rpc-maas,major/rpc-openstack,claco/rpc-openstack,busterswt/rpc-openstack,galstrom21/rpc-openstack,sigmavirus24/rpc-openstack,claco/rpc-openstack,cfarquhar/rpc-openstack,sigmavirus24/rpc-openstack,cfarquhar/rpc-openstack,cloudnull/rpc-maas,hugh...
galera_consistency.py
galera_consistency.py
import io import optparse import subprocess from maas_common import status_err, status_ok def table_checksum(user, password, host): """Run pt-table-checksum with the user, password, and host specified.""" args = ['/usr/bin/pt-table-checksum', '-u', user, '-p', password] if host: args.extend(['-h'...
import io import optparse import subprocess from maas_common import status_err, status_ok def table_checksum(user, password, host): """Run pt-table-checksum with the user, password, and host specified.""" args = ['/usr/bin/pt-table-checksum', '-u', user, '-p', password] if host: args.extend(['-h'...
apache-2.0
Python
924547e6f55aa01eebaef1715f50c4aa7104fee1
update how we handle kwargs in _function
toddsifleet/retrypy
retry/retry.py
retry/retry.py
import time from functools import partial, wraps def _retry(func, exceptions, check_for_retry, times, wait): previous_exception = None for n in xrange(times): try: return func() except tuple(exceptions) as e: if check_for_retry and not check_for_retry(e, n): ...
import time from functools import partial, wraps def _retry(func, exceptions, check_for_retry, times, wait): previous_exception = None for n in xrange(times): try: return func() except tuple(exceptions) as e: if check_for_retry and not check_for_retry(e, n): ...
mit
Python
a76c448d23c3607dc82eec0e0839f1caf2107071
Fix the wrapping of sheriffs in an extra list.
eunchong/build,eunchong/build,eunchong/build,eunchong/build
scripts/master/build_sheriffs.py
scripts/master/build_sheriffs.py
# Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Retrieve the list of the current build sheriffs.""" import datetime import os import re class BuildSheriffs(object): # File that contains the str...
# Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Retrieve the list of the current build sheriffs.""" import datetime import os import re class BuildSheriffs(object): # File that contains the str...
bsd-3-clause
Python
7d6eaa2dfe5b7c20345ab905b587a73d13bf84a6
Add define_executor for convenience
clchiou/garage,clchiou/garage,clchiou/garage,clchiou/garage
py/g1/threads/g1/threads/parts.py
py/g1/threads/g1/threads/parts.py
from g1.apps import bases from g1.apps import labels from g1.apps import parameters from g1.apps import utils from g1.threads import executors def define_executor(module_path=None, **kwargs): """Define an executor under ``module_path``.""" module_path = module_path or executors.__name__ module_labels = ...
from g1.apps import bases from g1.apps import parameters from g1.threads import executors def make_executor_params( *, max_executors=0, name_prefix='', daemon=None, ): return parameters.Namespace( 'make executor', max_executors=parameters.Parameter(max_executors), name_pref...
mit
Python
17db07ea47835a95b407a363869af5552cc11bba
Disable test assertion temporarily
GoelDeepak/dcos,kensipe/dcos,GoelDeepak/dcos,kensipe/dcos,mesosphere-mergebot/mergebot-test-dcos,dcos/dcos,kensipe/dcos,dcos/dcos,mesosphere-mergebot/dcos,mesosphere-mergebot/dcos,mesosphere-mergebot/mergebot-test-dcos,mesosphere-mergebot/dcos,GoelDeepak/dcos,kensipe/dcos,dcos/dcos,mesosphere-mergebot/mergebot-test-dco...
packages/adminrouter/extra/src/test-harness/tests/test_metrics.py
packages/adminrouter/extra/src/test-harness/tests/test_metrics.py
import urllib.parse import requests class TestMetrics: def test_metrics_html(self, master_ar_process): """ /nginx/status returns metrics in HTML format """ url = master_ar_process.make_url_from_path('/nginx/status') resp = requests.get( url, allo...
import urllib.parse import requests class TestMetrics: def test_metrics_html(self, master_ar_process): """ /nginx/status returns metrics in HTML format """ url = master_ar_process.make_url_from_path('/nginx/status') resp = requests.get( url, allo...
apache-2.0
Python
f6677cf616aace9b9d9ed2b764d3b52ace7d4230
Add kafka.structs docstrings (#2080)
ohmu/kafka-python,ohmu/kafka-python,dpkp/kafka-python,dpkp/kafka-python,DataDog/kafka-python
kafka/structs.py
kafka/structs.py
""" Other useful structs """ from __future__ import absolute_import from collections import namedtuple """A topic and partition tuple Keyword Arguments: topic (str): A topic name partition (int): A partition id """ TopicPartition = namedtuple("TopicPartition", ["topic", "partition"]) """A Kafka broker...
from __future__ import absolute_import from collections import namedtuple # Other useful structs TopicPartition = namedtuple("TopicPartition", ["topic", "partition"]) BrokerMetadata = namedtuple("BrokerMetadata", ["nodeId", "host", "port", "rack"]) PartitionMetadata = namedtuple("PartitionMetadata", ["...
apache-2.0
Python
12d2765d7ccec21205bd6d1c92d07b2af571d572
Bump version to v1.4.2.post3
Yelp/kafka-python,Yelp/kafka-python
kafka/version.py
kafka/version.py
__version__ = '1.4.2.post3'
__version__ = '1.4.2.post2'
apache-2.0
Python
bd6170d3726dc4168409dc716ef8b8bc10deed63
fix for application context
justinwp/croplands,justinwp/croplands
gfsad/utils/fusion.py
gfsad/utils/fusion.py
# coding=utf-8 from flask import current_app from oauth2client.client import SignedJwtAssertionCredentials import httplib2 from googleapiclient.discovery import build from googleapiclient.http import MediaIoBaseUpload FUSION_TABLE_SCOPE = 'https://www.googleapis.com/auth/fusiontables' FUSION_TABLE_TEST = '1y6rdRvEPXW4...
# coding=utf-8 from flask import current_app from oauth2client.client import SignedJwtAssertionCredentials import httplib2 from googleapiclient.discovery import build from googleapiclient.http import MediaIoBaseUpload FUSION_TABLE_SCOPE = 'https://www.googleapis.com/auth/fusiontables' FUSION_TABLE_TEST = '1y6rdRvEPXW4...
mit
Python
4053e98a8d337628760233c40915fde43f22d1e2
Use ForeignKey instead of OneToOneField for event organizer
UrLab/incubator,UrLab/incubator,UrLab/incubator,UrLab/incubator
events/models.py
events/models.py
from django.db import models from django.conf import settings # Create your models here. #Events : # Des users peuvent participer à un event # Les gens peuvnet être "intéressés" # Utiliser https://github.com/thoas/django-sequere ? # API hackeragenda class Event(models.Model): STATUS_CHOICES = ( ...
from django.db import models from django.conf import settings # Create your models here. #Events : # Des users peuvent participer à un event # Les gens peuvnet être "intéressés" # Utiliser https://github.com/thoas/django-sequere ? # API hackeragenda class Event(models.Model): STATUS_CHOICES = ( ...
agpl-3.0
Python
016d0eb7f7656b4a7a2f6828b8058faa23ce86ec
Add python API for sum op.
reyoung/Paddle,tensor-tang/Paddle,pkuyym/Paddle,Canpio/Paddle,Canpio/Paddle,reyoung/Paddle,baidu/Paddle,PaddlePaddle/Paddle,baidu/Paddle,PaddlePaddle/Paddle,Canpio/Paddle,putcn/Paddle,QiJune/Paddle,reyoung/Paddle,PaddlePaddle/Paddle,QiJune/Paddle,luotao1/Paddle,chengduoZH/Paddle,lcy-seso/Paddle,PaddlePaddle/Paddle,jacq...
python/paddle/fluid/layers/ops.py
python/paddle/fluid/layers/ops.py
# Copyright (c) 2018 PaddlePaddle 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 app...
# Copyright (c) 2018 PaddlePaddle 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 app...
apache-2.0
Python
fff4555c89991ca1445baef5ef155bf1f02aebdb
Refactor runTwircBot.py
johnmarcampbell/twircBot
runTwircBot.py
runTwircBot.py
#!/usr/bin/env python3 from src.TwircBot import TwircBot from src.CommandSuite import CommandSuite from src.LogSuite import LogSuite import sys try: bot = TwircBot(sys.argv[1]) except IndexError: bot = TwircBot() bot.add_module(CommandSuite("test")) bot.add_module(LogSuite("logger")) bot.print_config() bot...
#!/usr/bin/env python3 from src.TwircBot import TwircBot from src.CommandSuite import CommandSuite from src.LogSuite import LogSuite import sys try: bot = TwircBot(sys.argv[1]) except IndexError: bot = TwircBot() module = CommandSuite("test") logger = LogSuite("logger") bot.add_module(module) bot.add_module...
mit
Python
d5b79ef5c1d9a7dfdbd85c7bd831733445e0e18d
Remove debug print again
ReactiveX/RxPY,ReactiveX/RxPY
rx/internal/utils.py
rx/internal/utils.py
from rx import AnonymousObservable from rx.disposables import CompositeDisposable from .exceptions import DisposedException def add_ref(xs, r): def subscribe(observer): return CompositeDisposable(r.disposable, xs.subscribe(observer)) return AnonymousObservable(subscribe) def adapt_call(func): ...
from rx import AnonymousObservable from rx.disposables import CompositeDisposable from .exceptions import DisposedException def add_ref(xs, r): def subscribe(observer): return CompositeDisposable(r.disposable, xs.subscribe(observer)) return AnonymousObservable(subscribe) def adapt_call(func): ...
mit
Python
86e81884bfd8c641ca7504d33eeda37710ceba5c
Update imagepalette.pyde
kantel/processingpy,kantel/processingpy,kantel/processingpy
sketches/imagepalette/imagepalette.pyde
sketches/imagepalette/imagepalette.pyde
# Nach einer Idee von Kevin Workman # (https://happycoding.io/examples/p5js/images/image-palette) WIDTH = 800 HEIGHT = 640 palette = ["#264653", "#2a9d8f", "#e9c46a", "#f4a261", "#e76f51"] y = 0 def setup(): global img size(WIDTH, HEIGHT) this.surface.setTitle("Image Palette") img = loadImage("akt.jp...
# Nach einer Idee von Kevin Workman # (https://happycoding.io/examples/p5js/images/image-palette) WIDTH = 800 HEIGHT = 640 palette = ["#264653", "#2a9d8f", "#e9c46a", "#f4a261", "#e76f51"] y = 0 def setup(): global img size(WIDTH, HEIGHT) this.surface.setTitle("Image Palette") img = loadImage("akt.jp...
mit
Python
bd9b9fd8728c128008d0c20366b1ccf7f1d53fe1
remove unneeded import
guziy/basemap,matplotlib/basemap,guziy/basemap,matplotlib/basemap
examples/garp.py
examples/garp.py
from matplotlib.toolkits.basemap import Basemap from pylab import title, show, arange, pi # the shortest route from the center of the map # to any other point is a straight line in the azimuthal # equidistant projection. Such lines show the true scale # on the earth's surface. # So, for the specified point, this scrip...
from matplotlib.toolkits.basemap import Basemap from matplotlib.toolkits.basemap import pyproj from pylab import title, show, arange, pi # the shortest route from the center of the map # to any other point is a straight line in the azimuthal # equidistant projection. Such lines show the true scale # on the earth's sur...
mit
Python
352aeadf68c102b03dc7fcc243e46c3442132c1d
Fix a problem reported by Greg Ward and pointed out by John Machin when doing:
smspillaz/pychecker,smspillaz/pychecker,smspillaz/pychecker
pychecker/test_input/test70.py
pychecker/test_input/test70.py
'test checking constant conditions' # __pychecker__ = '' def func1(x): 'should not produce a warning' if 1: pass while 1: print x break assert x, 'test' return 0 def func2(x): 'should produce a warning' __pychecker__ = 'constant1' if 1: pass while 1...
'test checking constant conditions' # __pychecker__ = '' def func1(x): 'should not produce a warning' if 1: pass while 1: print x break assert x, 'test' return 0 def func2(x): 'should produce a warning' __pychecker__ = 'constant1' if 1: pass while 1...
bsd-3-clause
Python
ae6a8a413c37d21f68ff5d2233462fd7b86afd68
test commit
passy/glashammer-rdrei,passy/glashammer-rdrei
glashammer/version.py
glashammer/version.py
glashammer_version = '0.3.0'
glashammer_version = '0.3.0'
mit
Python
5c239d6dd827b14d0eff7cffe88335b981fcc5bc
Update comment in example script
python-mechanize/mechanize,python-mechanize/mechanize
examples/pypi.py
examples/pypi.py
#!/usr/bin/env python # Search PyPI, the Python Package Index, and retrieve latest mechanize # tarball. # This is just to demonstrate mechanize: You should use EasyInstall to # do this, not this silly script. import sys, os, re import mechanize b = mechanize.Browser() # search PyPI b.open("http://www.python.org/p...
#!/usr/bin/env python # Search PyPI, the Python Package Index, and retrieve latest mechanize # tarball. # This is just illustrative: I assume there's an easier way of doing # this (also note that the download field doesn't in general point # directly to the source, and that many packages (including mine!) # aren't ye...
bsd-3-clause
Python
85a8c0218a304034cc0bc9a3281d2dc084f35d9f
Bump to version 0.35.0
nerevu/riko,nerevu/riko
riko/__init__.py
riko/__init__.py
# -*- coding: utf-8 -*- # vim: sw=4:ts=4:expandtab """ riko ~~~~ Provides functions for analyzing and processing streams of structured data Examples: basic usage:: >>> from itertools import chain >>> from functools import partial >>> from riko.modules import itembuilder, strreplace ...
# -*- coding: utf-8 -*- # vim: sw=4:ts=4:expandtab """ riko ~~~~ Provides functions for analyzing and processing streams of structured data Examples: basic usage:: >>> from itertools import chain >>> from functools import partial >>> from riko.modules import itembuilder, strreplace ...
mit
Python
d32cfda5bac9694b015b3f3323e71dbd7eec150b
use iso format
pennlabs/penn-sdk-python,pennlabs/penn-sdk-python
penn/fitness.py
penn/fitness.py
import requests import datetime from bs4 import BeautifulSoup FITNESS_URL = "https://connect2concepts.com/connect2/?type=bar&key=650471C6-D72E-4A16-B664-5B9C3F62EEAC" class Fitness(object): """Used to interact with the Penn Recreation usage pages. Usage:: >>> from penn import Fitness >>> fi...
import requests from bs4 import BeautifulSoup FITNESS_URL = "https://connect2concepts.com/connect2/?type=bar&key=650471C6-D72E-4A16-B664-5B9C3F62EEAC" class Fitness(object): """Used to interact with the Penn Recreation usage pages. Usage:: >>> from penn import Fitness >>> fit = Fitness() ...
mit
Python
79c6623b2c69a5a19f97b32fb9f0f7e7e2647d7d
use utility functions
AugustH/pandocfilters,jgm/pandocfilters
examples/tikz.py
examples/tikz.py
#!/usr/bin/env python """ Pandoc filter to process raw latex tikz environments into images. Assumes that pdflatex is in the path, and that the standalone package is available. Also assumes that ImageMagick's convert is in the path. Images are put in the tikz-images directory. """ import os import re import shutil im...
#!/usr/bin/env python """ Pandoc filter to process raw latex tikz environments into images. Assumes that pdflatex is in the path, and that the standalone package is available. Also assumes that ImageMagick's convert is in the path. Images are put in the tikz-images directory. """ import hashlib import re import os i...
bsd-3-clause
Python
3ea261b0bff2723e7b50406f770710388a303d84
add bind host option to alerta daemon
skob/alerta,guardian/alerta,skob/alerta,guardian/alerta,skob/alerta,guardian/alerta,guardian/alerta,skob/alerta
alerta/app/shell.py
alerta/app/shell.py
import argparse from alerta.app import app from alerta.app import db from alerta.version import __version__ LOG = app.logger def main(): parser = argparse.ArgumentParser( prog='alertad', description='Alerta server (for development purposes only)' ) parser.add_argument( '-P', ...
import argparse from alerta.app import app from alerta.app import db from alerta.version import __version__ LOG = app.logger def main(): parser = argparse.ArgumentParser( prog='alertad', description='Alerta server (for development purposes only)' ) parser.add_argument( '-P', ...
apache-2.0
Python
a8d361760161845256ffddc99cd70e1abb2fb26d
remove dummy exchange
d9chen/exchange_tracker,d9chen/exchange_tracker
exchange/base.py
exchange/base.py
from abc import ABCMeta from abc import abstractmethod from abc import abstractproperty class AbstractExchange(metaclass=ABCMeta): @abstractproperty def exchange_uri(self): pass @abstractproperty def exchange(self): pass @abstractmethod def get_portfolio_value(self, asset=No...
from abc import ABCMeta from abc import abstractmethod from abc import abstractproperty class AbstractExchange(metaclass=ABCMeta): @abstractproperty def exchange_uri(self): pass @abstractproperty def exchange(self): pass @abstractmethod def get_portfolio_value(self, asset=No...
mit
Python
972f7447fee15f00c45ef30f30d03cddbeb70fc3
add serve static files
VisualDL/VisualDL,VisualDL/VisualDL,VisualDL/VisualDL,VisualDL/VisualDL,VisualDL/VisualDL
bin/visual_dl.py
bin/visual_dl.py
""" entry point of visual_dl """ import json import os from optparse import OptionParser from flask import send_from_directory from flask import Flask from flask import request from visualdl.log import logger app = Flask(__name__, static_url_path="") def option_parser(): """ :return: """ parser =...
""" entry point of visual_dl """ import json from optparse import OptionParser from flask import Flask from flask import request from visualdl.log import logger app = Flask(__name__) def option_parser(): """ :return: """ parser = OptionParser(usage="usage: visual_dl visual_dl.py "\ ...
apache-2.0
Python
b5c742047f3e2567901893fcba37edf17beeb715
Add module types as documented in #3
Heufneutje/PyHeufyBot,Heufneutje/PyHeufyBot
pyheufybot/module_interface.py
pyheufybot/module_interface.py
from pyheufybot.message import IRCMessage from pyheufybot.serverinfo import ServerInfo from pyheufybot.heufybot import HeufyBot from enum import Enum class Module(object): def __init__(self): self.trigger = "" self.moduleType = ModuleType.PASSIVE self.messageTypes = [] self.helpText...
from pyheufybot.message import IRCMessage from pyheufybot.serverinfo import ServerInfo from pyheufybot.heufybot import HeufyBot class Module(object): def __init__(self): self.trigger = "" self.messageTypes = [] self.helpText = "No help available for this module" def excecute(self, mess...
mit
Python
edb098abb1b88a019c40b38371c38413d07cce70
update __init__.py
rstorsauce/alfredo-python-sdk,rstorsauce/alfredo-python-sdk
alfredo/__init__.py
alfredo/__init__.py
import sys import ruamel.yaml as yaml from alfredo import descriptions from alfredo.resource import HttpPropertyResource __version__ = '0.0.1.post9' def represent_unicode(self, data): return self.represent_str(data.encode('utf-8')) if sys.version_info < (3,): yaml.representer.Representer.add_representer(...
import sys import ruamel.yaml as yaml from alfredo import descriptions from alfredo.resource import HttpPropertyResource __version__ = '0.0.1.post9' def represent_unicode(self, data): return self.represent_str(data.encode('utf-8')) if sys.version_info < (3,): yaml.representer.Representer.add_representer(...
lgpl-2.1
Python
b4e10dd198c9e7fa2ddf595dd4607336d4218b15
Make sure the nightly build doesn't produce bogus version numbers
allenai/allennlp,allenai/allennlp,allenai/allennlp,allenai/allennlp
allennlp/version.py
allennlp/version.py
import os _MAJOR = "1" _MINOR = "0" # On master and in a nightly release the patch should be one ahead of the last # released build. _PATCH = "0" # For pre-release and build metadata. In an official release this must be the # empty string. On master we will default to "-unreleased" while in our nightly # builds this w...
import os _MAJOR = "1" _MINOR = "0" # On master and in a nightly release the patch should be one ahead of the last # released build. _PATCH = "0" # For pre-release and build metadata. In an official release this must be the # empty string. On master we will default to "-unreleased" while in our nightly # builds this w...
apache-2.0
Python
69c2921f308ef1bd102ba95152ebdeccf72b8f6e
Update GeoTIFF cleanup to cleanup .zip
consbio/seedsource,consbio/seedsource,consbio/seedsource
source/seedsource/tasks/cleanup_tifs.py
source/seedsource/tasks/cleanup_tifs.py
from django.conf import settings import os import os.path import time import re from celery.task import task @task def cleanup_temp_tif_files(age=7200): temp_dir = settings.DATASET_DOWNLOAD_DIR cutoff = time.time() - age t_files = os.listdir(temp_dir) for t_file in t_files: if re.search('.zip$'...
from django.conf import settings import os import os.path import time import re from celery.task import task @task def cleanup_temp_tif_files(age=7200): temp_dir = settings.DATASET_DOWNLOAD_DIR cutoff = time.time() - age t_files = os.listdir(temp_dir) for t_file in t_files: if re.search('.tif$'...
bsd-3-clause
Python
f32ecefcb084b6b1a6d5a8717636fc9b4c9c1536
add state optional argument
redhat-cip/dci-control-server,redhat-cip/dci-control-server
dci/analytics/access_data_layer.py
dci/analytics/access_data_layer.py
# -*- coding: utf-8 -*- # # Copyright (C) Red Hat, 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 ...
# -*- coding: utf-8 -*- # # Copyright (C) Red Hat, 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
f4a4f31a4aaf99a0288418899d380b07dc6dc278
Update for pre-commit check.
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
salt/utils/compat.py
salt/utils/compat.py
""" Compatibility functions for utils """ import copy import importlib import sys import types import salt.loader def pack_dunder(name): """ Compatibility helper function to make __utils__ available on demand. """ # TODO: Deprecate starting with Beryllium mod = sys.modules[name] if not hasa...
""" Compatibility functions for utils """ import copy import importlib import sys import types import salt.loader def pack_dunder(name): """ Compatibility helper function to make __utils__ available on demand. """ # TODO: Deprecate starting with Beryllium mod = sys.modules[name] if not has...
apache-2.0
Python
84b3e4eb9ea51bc39ed561ae412216decc1bbfcd
Fix bug
igorbpf/TheGist,igorbpf/TheGist,igorbpf/TheGist
blue/__init__.py
blue/__init__.py
from flask import Flask from flask_cors import CORS from celery import Celery import os app = Flask(__name__) app.config.from_object(os.environ['APP_SETTINGS']) # app.config['CELERY_BROKER_URL'] = os.environ['REDIS_URL'] # app.config['CELERY_RESULT_BACKEND'] = os.environ['REDIS_URL'] CORS(app) celery = Celery(ap...
from flask import Flask from flask_cors import CORS from celery import Celery # import os app = Flask(__name__) app.config.from_object(os.environ['APP_SETTINGS']) # app.config['CELERY_BROKER_URL'] = os.environ['REDIS_URL'] # app.config['CELERY_RESULT_BACKEND'] = os.environ['REDIS_URL'] CORS(app) celery = Celery(...
mit
Python
55646644c18fe5e10669743025cc00b8225f9908
Add import of django-annoying patch
philipn/django-south,philipn/django-south,nimnull/django-south,RaD/django-south,RaD/django-south,RaD/django-south,nimnull/django-south
south/introspection_plugins/__init__.py
south/introspection_plugins/__init__.py
# This module contains built-in introspector plugins for various common # Django apps. # These imports trigger the lower-down files import south.introspection_plugins.geodjango import south.introspection_plugins.django_tagging import south.introspection_plugins.django_taggit import south.introspection_plugins.django_o...
# This module contains built-in introspector plugins for various common # Django apps. # These imports trigger the lower-down files import south.introspection_plugins.geodjango import south.introspection_plugins.django_tagging import south.introspection_plugins.django_taggit import south.introspection_plugins.django_o...
apache-2.0
Python
6935d5540942fdc07902fe6223a992fe9f089483
Fix formatting
spacy-io/spaCy,raphael0202/spaCy,Gregory-Howard/spaCy,banglakit/spaCy,explosion/spaCy,raphael0202/spaCy,honnibal/spaCy,raphael0202/spaCy,explosion/spaCy,aikramer2/spaCy,banglakit/spaCy,recognai/spaCy,spacy-io/spaCy,explosion/spaCy,raphael0202/spaCy,Gregory-Howard/spaCy,banglakit/spaCy,recognai/spaCy,banglakit/spaCy,spa...
spacy/tests/regression/test_issue736.py
spacy/tests/regression/test_issue736.py
# coding: utf-8 from __future__ import unicode_literals import pytest @pytest.mark.parametrize('text,number', [("7am", "7"), ("11p.m.", "11")]) def test_issue736(en_tokenizer, text, number): """Test that times like "7am" are tokenized correctly and that numbers are converted to string.""" tokens = en_tokeniz...
# coding: utf-8 """Test that times like "7am" are tokenized correctly and that numbers are converted to string.""" from __future__ import unicode_literals import pytest @pytest.mark.parametrize('text,number', [("7am", "7"), ("11p.m.", "11")]) def test_issue736(en_tokenizer, text, number): tokens = en_tokenizer...
mit
Python