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 |
|---|---|---|---|---|---|---|---|---|
59ae30d6fd2315f0b04eca1ff866b693ee63eb8d | Update date_range function to remove leap day | architecture-building-systems/CEAforArcGIS,architecture-building-systems/CEAforArcGIS | cea/utilities/date.py | cea/utilities/date.py | import pandas as pd
from cea.constants import HOURS_IN_YEAR
from calendar import isleap
def get_date_range_hours_from_year(year):
"""
creates date range in hours for the year excluding leap day
:param year: year of date range
:type year: int
:return: pd.date_range with 8760 values
:rtype: pan... | import pandas as pd
from cea.constants import HOURS_IN_YEAR
def get_dates_from_year(year):
"""
creates date range for the year of the calculation
:param year: year of first row in weather file
:type year: int
:return: pd.date_range with 8760 values
:rtype: pandas.data_range
"""
return... | mit | Python |
052479382f8d97f832bcd5e5f6710f95ba9d6c92 | Bump to version 0.6.0 | reubano/ckanutils,reubano/ckanutils,luiscape/ckanutils,luiscape/ckanutils,reubano/ckanny,reubano/ckanny | ckanutils/__init__.py | ckanutils/__init__.py | # -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
ckanutils
~~~~~~~~~
Miscellaneous CKAN utility scripts
Examples:
literal blocks::
python example_google.py
Attributes:
module_level_variable1 (int): Module level variables may be documented in
"""
__title__ = 'CKAN Utils'
__package_name__ = 'c... | # -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
ckanutils
~~~~~~~~~
Miscellaneous CKAN utility scripts
Examples:
literal blocks::
python example_google.py
Attributes:
module_level_variable1 (int): Module level variables may be documented in
"""
__title__ = 'CKAN Utils'
__package_name__ = 'c... | mit | Python |
7ce002ddb40c6008468690d544afed0b5adfebe3 | change default language, add locale middleware | ioO/billjobs | core/settings.py | core/settings.py | """
Django settings for billjobs project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
i... | """
Django settings for billjobs project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
i... | mit | Python |
552e2cf6b26a7d10d04dd660c09e6c702c238a5a | bump cli version to 1.3.0 | twosigma/waiter,twosigma/waiter,twosigma/waiter,twosigma/waiter | cli/waiter/version.py | cli/waiter/version.py | VERSION = '1.3.0'
| VERSION = '1.2.4-dev'
| apache-2.0 | Python |
b34a864021985baa279514d0bdabe9268ce239b8 | Add convoluted lookup to find click.Command obj | click-contrib/click-man | click_man/__main__.py | click_man/__main__.py | """
click-man - Generate man pages for click application
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module provides a click CLI command to
generate man pages from a click application.
:copyright: (c) 2016 by Timo Furrer.
:license: MIT, see LICENSE for more details.
"""
import os
import click
from pkg_... | """
click-man - Generate man pages for click application
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module provides a click CLI command to
generate man pages from a click application.
:copyright: (c) 2016 by Timo Furrer.
:license: MIT, see LICENSE for more details.
"""
import os
import click
from pkg_... | mit | Python |
13fb490c4616356ce7514ac361dfef912591de1f | fix typo | click-contrib/click-man | click_man/__main__.py | click_man/__main__.py | """
click-man - Generate man pages for click application
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module provides a click CLI command to
generate man pages from a click application.
:copyright: (c) 2016 by Timo Furrer.
:license: MIT, see LICENSE for more details.
"""
import os
import click
from pkg_... | """
click-man - Generate man pages for click application
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module provides a click CLI command to
generate man pages from a click application.
:copyright: (c) 2016 by Timo Furrer.
:license: MIT, see LICENSE for more details.
"""
import os
import click
from pkg_... | mit | Python |
c993c1a7b04c241907f11385f9b41ba0bec6a7c7 | support netcdf to geojson | MBoustani/GISCube,MBoustani/GISCube,MBoustani/GISCube | giscube_app/ajax.py | giscube_app/ajax.py | import os, shutil
import numpy as np
from django.utils import simplejson
from dajaxice.decorators import dajaxice_register
from giscube.config import MEDIA_ROOT, MEDIA_URL
from scripts.extract_shp_table import extract_shp_table
from scripts.netcdf_info import get_nc_data
from scripts.conversion import nc_to_gtif, nc_to... | import os, shutil
import numpy as np
from django.utils import simplejson
from dajaxice.decorators import dajaxice_register
from giscube.config import MEDIA_ROOT, MEDIA_URL
from scripts.extract_shp_table import extract_shp_table
from scripts.netcdf_info import get_nc_data
from scripts.conversion import nc_to_gtif
from n... | apache-2.0 | Python |
f45277004f19193d0c82d4548320a5f438a290b3 | Determine dirs | Rayman/ros-get,Rayman/ros-get | src/ros_get/commands.py | src/ros_get/commands.py | #!/usr/bin/env python
from __future__ import print_function
import logging
import os
from .utils import mkdir_p
from .workspace import ws_file
logger = logging.getLogger(__name__)
installed_dir = os.path.join(ws_file, '.env', 'installed')
target_path = os.path.join(ws_file, 'src')
def install(pkgs, verbose):
p... | #!/usr/bin/env python
from __future__ import print_function
import logging
logger = logging.getLogger(__name__)
def install(pkgs, verbose):
pass
def update(verbose):
pass
def remove(pkgs, verbose):
pass
def upgrade(verbose):
pass
| mit | Python |
365b196e12ee5e53c1f9a837969a8375d93df97f | FIX Add encoding to __init__.py | andsor/gridjug,andsor/gridjug | gridjug/__init__.py | gridjug/__init__.py | # encoding: utf-8
import pkg_resources
__version__ = pkg_resources.get_distribution(__name__).version
| import pkg_resources
__version__ = pkg_resources.get_distribution(__name__).version
| isc | Python |
5dec42feb0a0cedec258047a91d7eda1eb07ef11 | fix namespace urls | CARocha/ciat_plataforma,shiminasai/ciat_plataforma,CARocha/ciat_plataforma,CARocha/ciat_plataforma,ErickMurillo/ciat_plataforma,ErickMurillo/ciat_plataforma,ErickMurillo/ciat_plataforma,shiminasai/ciat_plataforma,shiminasai/ciat_plataforma | guias_cacao/urls.py | guias_cacao/urls.py | from django.conf.urls import *
from .views import *
urlpatterns = patterns('guias_cacao.views',
url(r'^$', 'index_ficha_sombra', name='index-cacao'),
url(r'^sombra/riqueza/$', 'riqueza_sombra', name='riqueza-cacao'),
url(r'^sombra/analisis/$', 'analisis_sombra', name='analisis-cacao'),
url(r'^sombra/co... | from django.conf.urls import *
from .views import *
urlpatterns = patterns('guias_cacao.views',
url(r'^$', 'index_ficha_sombra', name='index-cacao'),
url(r'^sombra/riqueza/$', 'riqueza_sombra', name='riqueza-cacao'),
url(r'^sombra/analisis/$', 'analisis_sombra', name='analisis-cacao'),
url(r'^sombra/co... | mit | Python |
c68245b172ca1b4327f1d6ee94d4c944583641e6 | fix line endings | ahelsing/geni-tools,plantigrade/geni-tools,GENI-NSF/gram,tcmitchell/geni-tools,GENI-NSF/gram,tcmitchell/geni-tools,GENI-NSF/gram,ahelsing/geni-tools,plantigrade/geni-tools | src/sfa/util/sfatime.py | src/sfa/util/sfatime.py | #----------------------------------------------------------------------
# Copyright (c) 2008 Board of Trustees, Princeton University
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (the "Work") to
# deal in the Work without restriction, i... | #----------------------------------------------------------------------
# Copyright (c) 2008 Board of Trustees, Princeton University
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (the "Work") to
# deal in the Work without restricti... | mit | Python |
34fd19ce620e6df3b9edb6fe4f07634ea7c898f6 | Bump version | bogdal/django-gusregon,bogdal/django-gusregon,bogdal/gusregon | gusregon/version.py | gusregon/version.py | __version__ = '1.1.3'
| __version__ = '1.1.2'
| bsd-2-clause | Python |
ca0a99447b9c09f45fcd30caa7b9a0d8ebd66c3c | Add MAX_HP to player object (for hp bars) | verekia/hackarena,verekia/hackarena,verekia/hackarena,verekia/hackarena | hackarena/player.py | hackarena/player.py | # -*- coding: utf-8 -*-
import hackarena.constants
from hackarena.constants import Classes
from hackarena.constants import Spell
from hackarena.game_objects import BaseGameObject
AVAILABLE_SPELLS = {
Classes.TANK: [Spell.TANK_ATTACK, Spell.TANK_AOE],
Classes.MAGE: [Spell.MAGE_DIRECT_DAMAGE, Spell.MAGE_AOE],
... | # -*- coding: utf-8 -*-
import hackarena.constants
from hackarena.constants import Classes
from hackarena.constants import Spell
from hackarena.game_objects import BaseGameObject
AVAILABLE_SPELLS = {
Classes.TANK: [Spell.TANK_ATTACK, Spell.TANK_AOE],
Classes.MAGE: [Spell.MAGE_DIRECT_DAMAGE, Spell.MAGE_AOE],
... | mit | Python |
483454b9f446562cad5caa01d0f324b04f0666eb | Add version in top-level module | samueldg/clippings | clippings/__init__.py | clippings/__init__.py | """Python module to manipulate Kindle clippings files."""
__version__ = '0.1.0'
| mit | Python | |
19dd4495b09a0019fcce2cfb21b083724033dd7f | Switch skeleton API to use flask-restful | Duke-GCB/DukeDSHandoverService,Duke-GCB/DukeDSHandoverService,Duke-GCB/DukeDSHandoverService | handover_service.py | handover_service.py | from flask import Flask
from flask_restful import Resource, Api
app = Flask(__name__)
api = Api(app)
class Handover(Resource):
def get(self):
return [{'handover' : 42}]
class Draft(Resource):
def get(self):
return [{'draft' : 1024}]
api.add_resource(Handover, '/api/v1/handovers')
api.add_res... | from flask import Flask
app = Flask(__name__)
VERSION_PREFIX="/api/v1"
@app.route(VERSION_PREFIX + "/handovers")
def handovers():
return "handovers\n"
@app.route(VERSION_PREFIX + "/drafts")
def drafts():
return "drafts\n"
if __name__ == "__main__":
app.run()
| mit | Python |
60723c02315fb444fab875268e02a195ae54f372 | add imports. | jonhadfield/hostman | hostman/__init__.py | hostman/__init__.py | # -*- coding: utf-8 -*-
from python_hosts import Hosts, HostsEntry
import utils
| # -*- coding: utf-8 -*- | mit | Python |
f13612f377bfc857922364ae397789ff1e98c46d | Add __all__ (#113) | ofek/coincurve,ofek/coincurve | coincurve/__init__.py | coincurve/__init__.py | from coincurve.context import GLOBAL_CONTEXT, Context
from coincurve.keys import PrivateKey, PublicKey
from coincurve.utils import verify_signature
__all__ = [
'GLOBAL_CONTEXT',
'Context',
'PrivateKey',
'PublicKey',
'verify_signature',
]
| from coincurve.context import GLOBAL_CONTEXT, Context
from coincurve.keys import PrivateKey, PublicKey
from coincurve.utils import verify_signature
| apache-2.0 | Python |
0534c1cdeb92503a90ef309dee6edddb45234bf7 | Resolve old Django 1.1 bug in URLs to keep it DRY. | bueda/django-comrade | comrade/users/urls.py | comrade/users/urls.py | from django.conf.urls.defaults import *
from django.core.urlresolvers import reverse
from django.utils.functional import lazy
reverse_lazy = lazy(reverse, unicode)
urlpatterns = patterns('django.contrib.auth.views',
url(r'^login/', 'login', name='login'),
url(r'^logout/', 'logout', {'next_page':'/'}, name='lo... | from django.conf.urls.defaults import *
urlpatterns = patterns('django.contrib.auth.views',
url(r'^login/', 'login', name='login'),
url(r'^logout/', 'logout', {'next_page':'/'}, name='logout'),
url(r'^password/forgot/$', 'password_reset',
# LH #269 - ideally this wouldn't be hard coded
... | mit | Python |
d013b82c7f3a03ea15f101ab48e9a911be26d34c | Bump version to 3.2.2. | FundedByMe/django-imagekit,tawanda/django-imagekit,FundedByMe/django-imagekit,tawanda/django-imagekit | imagekit/pkgmeta.py | imagekit/pkgmeta.py | __title__ = 'django-imagekit'
__author__ = 'Matthew Tretter, Eric Eldredge, Bryan Veloso, Greg Newman, Chris Drackett, Justin Driscoll'
__version__ = '3.2.2'
__license__ = 'BSD'
__all__ = ['__title__', '__author__', '__version__', '__license__']
| __title__ = 'django-imagekit'
__author__ = 'Matthew Tretter, Eric Eldredge, Bryan Veloso, Greg Newman, Chris Drackett, Justin Driscoll'
__version__ = '3.2.1'
__license__ = 'BSD'
__all__ = ['__title__', '__author__', '__version__', '__license__']
| bsd-3-clause | Python |
40edb9cf05f7897f56161ee5f41bf928a8ce51dc | test if search method returns node | amosboldor/data-structures | src/test_linked_list.py | src/test_linked_list.py | """Test LinkedList class."""
import pytest
LIST_DATA = [
['string'],
[123],
[[]],
[{}]
]
@pytest.mark.parametrize("n", LIST_DATA)
def test_initiate_linkedlist(n):
"""Test if attributes in linked list match what is expected."""
from linked_list import Node
example = Node(n)
assert ex... | """Test LinkedList class."""
import pytest
LIST_DATA = [
['string'],
[123],
[[]],
[{}]
]
@pytest.mark.parametrize("n", LIST_DATA)
def test_initiate_linkedlist(n):
"""Test if attributes in linked list match what is expected."""
from linked_list import Node
example = Node(n)
assert ex... | mit | Python |
07ac877ff3d5d0e021bf49e660ad697755deacf1 | Allow piping JSON to charter.py via stdin | tudocomp/tudocomp,tudocomp/tudocomp,tudocomp/tudocomp,tudocomp/tudocomp,tudocomp/tudocomp | etc/charter/charter.py | etc/charter/charter.py | #!/usr/bin/python3
# Python3 host for the charter core.
# This can be used to generate chart SVGs from the command-line.
# Requires the PyExecJS module, NodeJS is recommended.
import argparse
import json
import sys
import execjs
# Parse command line arguments
parser = argparse.ArgumentParser(description="""
Gen... | #!/usr/bin/python3
# Python3 host for the charter core.
# This can be used to generate chart SVGs from the command-line.
# Requires the PyExecJS module, NodeJS is recommended.
import argparse
import json
import execjs
# Parse command line arguments
parser = argparse.ArgumentParser(description="""
Generate a cha... | apache-2.0 | Python |
26a4de0320822b46513fdb1db4bedd088a6a3438 | Use ConfigParser in settings.py to get zotero directory. | hourchallenge/zot | settings.py | settings.py | import argparse
import ConfigParser
import os
import sys
def make_dir_if_not_exists(path):
if not os.path.exists(path): os.makedirs(path)
home_dir = os.path.expanduser('~/.zot/')
make_dir_if_not_exists(home_dir)
config_file_path = os.path.join(home_dir, 'settings')
config = ConfigParser.SafeConfigParser()
if n... | zotero_dir = '/home/ben/Dropbox/Zotero/' | mit | Python |
28a9c378d391c2dbfa351b72fcbe4c4a8d4ca419 | Remove unused variable args | aebm/shuffler | shuffler.py | shuffler.py | #!/usr/bin/env python3
import argparse
import random
import sys
DESCRIPTION = '''Shuffle the arguments received, if called without arguments
the lines read from stdin will be shuffled and printed to
stdout'''
def get_list():
return sys.stdin.readlines()
def print_list(list_):... | #!/usr/bin/env python3
import argparse
import random
import sys
DESCRIPTION = '''Shuffle the arguments received, if called without arguments
the lines read from stdin will be shuffled and printed to
stdout'''
def get_list():
return sys.stdin.readlines()
def print_list(list_):... | apache-2.0 | Python |
42bbe9cedc8fca637648823997a1617a80c0fa8b | Add text processing to info_retrieval2 | amkahn/question-answering,amkahn/question-answering | src/info_retrieval/info_retrieval2.py | src/info_retrieval/info_retrieval2.py | # LING 573 Question Answering System
# Code last updated 4/22/14 by Claire Jaja
# This code implements an InfoRetriever for the question answering system.
# from pymur import *
import sys
import subprocess
# this needs to be commented out when running this code directly
# can be added back in when running from the wr... | # LING 573 Question Answering System
# Code last updated 4/22/14 by Claire Jaja
# This code implements an InfoRetriever for the question answering system.
# from pymur import *
import sys
import subprocess
# this needs to be commented out when running this code directly
# can be added back in when running from the wr... | mit | Python |
5042a5fb61aa41641333fe62a1149412bfbd01a4 | Increment version. | Chris7/django-invoice,Chris7/django-invoice,simonluijk/django-invoice | invoice/__init__.py | invoice/__init__.py | __version__ = '0.3.2'
VERSION = __version__
| __version__ = '0.3.1'
VERSION = __version__
| bsd-3-clause | Python |
b113c0eeefc1c88be8557a4fcb9feaf6bb1dbb01 | Update docstrings:xml | TrondKjeldas/SoCo,simonalpha/SoCo,DPH/SoCo,KennethNielsen/SoCo,petteraas/SoCo,SoCo/SoCo,fxstein/SoCo,lawrenceakka/SoCo,flavio/SoCo,fgend31/SoCo,fgend31/SoCo,meska/SoCo,dsully/SoCo,dajobe/SoCo,fxstein/SoCo,dsully/SoCo,simonalpha/SoCo,TrondKjeldas/SoCo,meska/SoCo,flavio/SoCo,DPH/SoCo,petteraas/SoCo,lawrenceakka/SoCo,SoCo... | soco/xml.py | soco/xml.py | # -*- coding: utf-8 -*-
# pylint: disable=invalid-name
"""This class contains XML related utility functions."""
from __future__ import (
absolute_import, unicode_literals
)
try:
import xml.etree.cElementTree as XML
except ImportError:
import xml.etree.ElementTree as XML
#: Commonly used namespaces, and ... | # -*- coding: utf-8 -*-
# pylint: disable=invalid-name
"""Module that contains XML related utility functions."""
from __future__ import (
absolute_import, unicode_literals
)
try:
import xml.etree.cElementTree as XML
except ImportError:
import xml.etree.ElementTree as XML
NAMESPACES = {
'dc': 'http:/... | mit | Python |
de173c82089ab2d050f48a0fedad65bca2a8e26f | bump version | IRI-Research/django-templatetag-sugar,alex/django-templatetag-sugar | templatetag_sugar/__init__.py | templatetag_sugar/__init__.py | __version__ = "1.0"
| __version__ = "0.1"
| bsd-3-clause | Python |
38f9117750e484d2c33f1b844e9d743d9c3f6918 | Improve fail example writing | lesteve/sphinx-gallery,lesteve/sphinx-gallery,sphinx-gallery/sphinx-gallery,Eric89GXL/sphinx-gallery,Titan-C/sphinx-gallery,Titan-C/sphinx-gallery,Eric89GXL/sphinx-gallery,sphinx-gallery/sphinx-gallery | examples/plot_raise.py | examples/plot_raise.py | # -*- coding: utf-8 -*-
"""
=============================
Examples that fail to execute
=============================
When scripts fail their gallery thumbnail is replaced with the broken
image stamp. Thus allowing easy identification in the gallery display.
You also get the python traceback of the failed code block
... | # -*- coding: utf-8 -*-
"""
=============================
Examples that fail to execute
=============================
When scripts fail their gallery thumbnail is replaced with the broken
image stamp. Thus allowing easy identification in the gallery display.
You also get the python traceback of the failed code block
... | bsd-3-clause | Python |
800b7c0e6859e1afd5e0d28db1f8fac90187e36c | Add ip config. | unrealcv/unrealcv,unrealcv/unrealcv,unrealcv/unrealcv,unrealcv/unrealcv,qiuwch/unrealcv,unrealcv/unrealcv,qiuwch/unrealcv,qiuwch/unrealcv,qiuwch/unrealcv,qiuwch/unrealcv,qiuwch/unrealcv | client/test_ue4cv.py | client/test_ue4cv.py | # A script to test ue4cv client
import ue4cv as U
import argparse
import time
def on_received(data):
message = repr(data)
print message
def on_connected():
client.send('vget /object') # TODO: How to end a message??
# Wait data response
client.send('vget /camera/0/image')
client.send('vget /cam... | # A script to test ue4cv client
import ue4cv as U
import argparse
import time
def on_received(data):
message = repr(data)
print message
def on_connected():
client.send('vget /object') # TODO: How to end a message??
# Wait data response
client.send('vget /camera/0/image')
client.send('vget /cam... | mit | Python |
88db97dc9e881f412d1281d617e9fa552c9f74b2 | remove bug in rewards | lmzintgraf/MultiMAuS | experiments/rewards.py | experiments/rewards.py | import numpy as np
def get_reward(success, fraud, amount):
"""
The rewards are as follows
- unsuccessful: 0
- successful & fraudulent: -amount
- successful & genuine: 0.25*amount + 0.25
:param success: boolean, whether transaction was successful
:param fraud: boolean, whether tra... |
def get_reward(success, fraud, amount):
"""
The rewards are as follows
- unsuccessful: 0
- successful & fraudulent: -amount
- successful & genuine: 0.25*amount + 0.25
:param success: boolean, whether transaction was successful
:param fraud: boolean, whether transaction was fraudu... | mit | Python |
7e6fc407b516aed4dfe9d421eaaeec92ea5bf10b | Revert "Fix smtp vendor test" | linkedin/iris,jrgp/iris-api-opensource,jrgp/iris-api-opensource,dwang159/iris-api,jrgp/iris-api-opensource,dwang159/iris-api,linkedin/iris,linkedin/iris,linkedin/iris,dwang159/iris-api,dwang159/iris-api,jrgp/iris-api-opensource | test/test_iris_vendor_smtp.py | test/test_iris_vendor_smtp.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
def test_smtp_vendor_init():
from iris.vendors.iris_smtp import iris_smtp
smtp_config = {
'smtp_server': 'foo'
}
smtp_vendor = iris_smtp(smtp_config)
assert smtp_vendor.smtp_timeout == 10
assert smtp_vendor.mx_sorted == [(0, 'foo')]
smt... | #!/usr/bin/env python
# -*- coding:utf-8 -*-
def test_smtp_vendor_init():
from iris.vendors.iris_smtp import iris_smtp
smtp_config = {
'smtp_server': 'foo'
}
smtp_vendor = iris_smtp(smtp_config)
assert smtp_vendor.smtp_timeout == 10
assert smtp_vendor.mx_sorted == [(0, 'foo')]
smt... | bsd-2-clause | Python |
723ecd756a3cfc9efcdc575a7f6c1488e4385a5b | Debug printout. | MikeiLL/appension,Rosuav/appension,Rosuav/appension,MikeiLL/appension,MikeiLL/appension,MikeiLL/appension,Rosuav/appension,Rosuav/appension | fore/combine_tracks.py | fore/combine_tracks.py | #!/usr/bin/env python
# encoding: utf=8
"""
audition.py
Functions to combine 'Basic' and 'Overdub' tracks from 'Glitch Recording Studio'.
Created by Mike iLL with mentorship of Rosuav.
track1 = LocalAudioFile('acapella/Mike_iLL_a_capella.mp3')
track2 = LocalAudioFile('instrumentals/dgacousticlikMP3.mp3')
ct.render_... | #!/usr/bin/env python
# encoding: utf=8
"""
audition.py
Functions to combine 'Basic' and 'Overdub' tracks from 'Glitch Recording Studio'.
Created by Mike iLL with mentorship of Rosuav.
track1 = LocalAudioFile('acapella/Mike_iLL_a_capella.mp3')
track2 = LocalAudioFile('instrumentals/dgacousticlikMP3.mp3')
ct.render_... | artistic-2.0 | Python |
c0163a2d756fd0625e5fe9c852643d5e820fd3b7 | update version | clach04/json-rpc,lorehov/json-rpc | jsonrpc/__init__.py | jsonrpc/__init__.py | __version = (0, 2, 2)
__version__ = version = '.'.join(map(str, __version))
__project__ = PROJECT = __name__
| __version = (0, 2, 1)
__version__ = version = '.'.join(map(str, __version))
__project__ = PROJECT = __name__
| mit | Python |
3572171a917138982cf7e329e5293e1345a9e76d | Update "Girls With Slingshots" after feed change | jodal/comics,datagutten/comics,jodal/comics,jodal/comics,datagutten/comics,datagutten/comics,datagutten/comics,jodal/comics | comics/comics/gws.py | comics/comics/gws.py | from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "Girls With Slingshots"
language = "en"
url = "http://www.girlswithslingshots.com/"
start_date = "2004-09-30"
rights = "Danielle Corsetto"
class... | from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "Girls With Slingshots"
language = "en"
url = "http://www.girlswithslingshots.com/"
start_date = "2004-09-30"
rights = "Danielle Corsetto"
class... | agpl-3.0 | Python |
e7bb9d6f6ead60ba5c295eebe6dc51020cb7d297 | Bump to v0.5.12 | emre/kaptan | kaptan/__about__.py | kaptan/__about__.py | __title__ = 'kaptan'
__package_name__ = 'kaptan'
__version__ = '0.5.12'
__description__ = 'Configuration manager'
__email__ = 'mail@emreyilmaz.me'
__url__ = 'https://github.com/emre/kaptan'
__author__ = 'Emre Yilmaz'
__license__ = 'BSD'
__copyright__ = 'Copyright 2013-2019 Emre Yilmaz'
| __title__ = 'kaptan'
__package_name__ = 'kaptan'
__version__ = '0.5.11'
__description__ = 'Configuration manager'
__email__ = 'mail@emreyilmaz.me'
__url__ = 'https://github.com/emre/kaptan'
__author__ = 'Emre Yilmaz'
__license__ = 'BSD'
__copyright__ = 'Copyright 2013-2019 Emre Yilmaz'
| bsd-3-clause | Python |
ec99e4ba78f4d0554f518a1063a8868e745900cf | Update the way the services are reported through the badges | alexanderrichards/LZProduction,alexanderrichards/LZProduction,alexanderrichards/LZProduction,alexanderrichards/LZProduction | src/python/services/HTMLPageServer.py | src/python/services/HTMLPageServer.py | """Certificate authenticated web server."""
import os
from datetime import datetime
import cherrypy
import jinja2
from sqlalchemy_utils import create_db, db_session
from tables import Services
MINS = 60
SERVICE_COLOUR_MAP = {'up': 'brightgreen',
'down': 'red',
'unknown': 'li... | """Certificate authenticated web server."""
import os
from datetime import datetime
import cherrypy
import jinja2
from sqlalchemy_utils import create_db, db_session
from tables import Services
MINS = 60
SERVICE_COLOUR_MAP = {'up': 'brightgreen',
'down': 'red',
'stuck%3F': 'l... | mit | Python |
9fe091573098901b61477c549b6501bc7b883004 | Add mocking for module tests | tobi-wan-kenobi/bumblebee-status,tobi-wan-kenobi/bumblebee-status | tests/modules/test_modules.py | tests/modules/test_modules.py | # pylint: disable=C0103,C0111
import unittest
import importlib
import mock
from bumblebee.engine import all_modules
from bumblebee.config import Config
from tests.util import assertWidgetAttributes, MockEngine
class MockCommunicate(object):
def __init__(self):
self.returncode = 0
def communicate(sel... | # pylint: disable=C0103,C0111
import unittest
import importlib
import mock
from bumblebee.engine import all_modules
from bumblebee.config import Config
from tests.util import assertWidgetAttributes, MockEngine
class MockCommunicate(object):
def __init__(self):
self.returncode = 0
def communicate(sel... | mit | Python |
98d0746ac1cf6a9c2ee773cc7cb49a5bc88c2398 | Install profile application. | cc-archive/commoner,cc-archive/commoner | commoner/settings.py | commoner/settings.py |
import os
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = 'commoner.db'
DATABASE_USER = '' # Not used with sqlite3.
DATABASE_PASSWORD = '' # Not used... |
import os
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = 'commoner.db'
DATABASE_USER = '' # Not used with sqlite3.
DATABASE_PASSWORD = '' # Not used... | agpl-3.0 | Python |
ea9c24f01781f1eb51c0a094aa9942fe451a302e | set interface | nebgnahz/CS268NetworkMeasurement,nebgnahz/CS268NetworkMeasurement,nebgnahz/CS268NetworkMeasurement | king/name-server.py | king/name-server.py | from twisted.internet import reactor
from twisted.names import dns, client, server
class DNSServerFactory(server.DNSServerFactory):
def handleQuery(self, message, protocol, address):
try:
query = message.queries[0]
target = query.name.name
origin = target.split('.')[0]
... | from twisted.internet import reactor
from twisted.names import dns, client, server
class DNSServerFactory(server.DNSServerFactory):
def handleQuery(self, message, protocol, address):
try:
query = message.queries[0]
target = query.name.name
origin = target.split('.')[0]
... | bsd-2-clause | Python |
c75306acb81e3e228ee3d180080921db1abcf367 | Fix style | Cartocite/osmada | diffanalysis/exporters.py | diffanalysis/exporters.py | from django.conf import settings
from osmdata.exporters import CSVExporter
from .models import ActionReport
class AnalyzedCSVExporter(CSVExporter):
""" Enhance CSVExporter adding some fields from diffanalysis module
"""
def get_header_row(self):
return super().get_header_row() + (
'm... | from django.conf import settings
from osmdata.exporters import CSVExporter
from .models import ActionReport
class AnalyzedCSVExporter(CSVExporter):
""" Enhance CSVExporter adding some fields from diffanalysis module
"""
def get_header_row(self):
return super().get_header_row() + (
'm... | agpl-3.0 | Python |
93d6fdbeee38ed5c059609da6e5e49512360c0ce | Remove beta | callowayproject/django-concepts,callowayproject/django-concepts,callowayproject/django-concepts | concepts/__init__.py | concepts/__init__.py | """
django-concepts
"""
__version_info__ = {
'major': 0,
'minor': 7,
'micro': 0,
'releaselevel': 'final',
'serial': 1
}
def get_version(short=False):
assert __version_info__['releaselevel'] in ('alpha', 'beta', 'final')
vers = ["%(major)i.%(minor)i" % __version_info__, ]
if __version_i... | """
django-concepts
"""
__version_info__ = {
'major': 0,
'minor': 7,
'micro': 0,
'releaselevel': 'beta',
'serial': 1
}
def get_version(short=False):
assert __version_info__['releaselevel'] in ('alpha', 'beta', 'final')
vers = ["%(major)i.%(minor)i" % __version_info__, ]
if __version_in... | apache-2.0 | Python |
00a3da330668284f700275c7fc3072c792eff374 | Update VERSION to 0.12.5 final | indirectlylit/kolibri,mrpau/kolibri,indirectlylit/kolibri,learningequality/kolibri,mrpau/kolibri,indirectlylit/kolibri,indirectlylit/kolibri,mrpau/kolibri,learningequality/kolibri,learningequality/kolibri,learningequality/kolibri,mrpau/kolibri | kolibri/__init__.py | kolibri/__init__.py | """
CAUTION! Keep everything here at at minimum. Do not import stuff.
This module is imported in setup.py, so you cannot for instance
import a dependency.
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from .utils import env
from .utils.version ... | """
CAUTION! Keep everything here at at minimum. Do not import stuff.
This module is imported in setup.py, so you cannot for instance
import a dependency.
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from .utils import env
from .utils.version ... | mit | Python |
2e845d52f6e4c07dfae23f28591c856f664cedfb | Bump funfactory for PyPI | mozilla/funfactory,mozilla/funfactory | funfactory/__init__.py | funfactory/__init__.py | __version__ = '2.2.0'
| __version__ = '2.1.1'
| bsd-3-clause | Python |
94ca140b67cb602ee7e146af32bfb63b60df96f4 | update collections.abc import | rwightman/pytorch-image-models,rwightman/pytorch-image-models | timm/models/layers/helpers.py | timm/models/layers/helpers.py | """ Layer/Module Helpers
Hacked together by / Copyright 2020 Ross Wightman
"""
from itertools import repeat
import collections.abc
# From PyTorch internals
def _ntuple(n):
def parse(x):
if isinstance(x, collections.abc.Iterable):
return x
return tuple(repeat(x, n))
return parse
... | """ Layer/Module Helpers
Hacked together by / Copyright 2020 Ross Wightman
"""
from itertools import repeat
from torch._six import container_abcs
# From PyTorch internals
def _ntuple(n):
def parse(x):
if isinstance(x, container_abcs.Iterable):
return x
return tuple(repeat(x, n))
r... | apache-2.0 | Python |
34a66360f99ba3b59e6bced8a4366350b929fa58 | revise send_package_enrollment_batch email | tndatacommons/tndata_backend,izzyalonso/tndata_backend,tndatacommons/tndata_backend,izzyalonso/tndata_backend,izzyalonso/tndata_backend,tndatacommons/tndata_backend,tndatacommons/tndata_backend,izzyalonso/tndata_backend | tndata_backend/goals/email.py | tndata_backend/goals/email.py | from django.conf import settings
from django.template.loader import render_to_string
from utils.email import send_mass_html_mail
def send_package_enrollment_batch(request, enrollments):
"""Send the notification email to those users who have been enrolled.
* request: an HttpRequest instance.
* enrollment... | from django.conf import settings
from django.contrib.auth import get_user_model
from django.core.urlresolvers import reverse
from django.template.loader import render_to_string
from utils.email import send_mass_html_mail
def send_package_enrollment_batch(emails, category, goals, subject=None):
"""Send the notifi... | mit | Python |
e0e62931096340e45f5cc9a519e068f2b0502ebe | add sms.sent metric | davidwilemski/coursegrab | logmonitor.py | logmonitor.py | from tinyfeedback.helper import tail_monitor
def parse_line(data, line):
if 'GET / HTTP/1.1' in line:
data['site.hits'] += 1
elif 'closed classes' in line and 'no need' not in line:
count = line.split()[-3]
data['classes.closed'] = count
elif 'POST /twilio_receive' in line:
... | from tinyfeedback.helper import tail_monitor
def parse_line(data, line):
if 'GET / HTTP/1.1' in line:
data['site.hits'] += 1
elif 'closed classes' in line and 'no need' not in line:
count = line.split()[-3]
data['classes.closed'] = count
elif 'POST /twilio_receive' in line:
... | bsd-2-clause | Python |
e9e4c622ff667e475986e1544ec78b0604b8a511 | Fix typo from bad conflict resolution during merge | girder/girder_worker,girder/girder_worker,girder/girder_worker | girder_worker/tasks.py | girder_worker/tasks.py | import core
from girder_worker.utils import JobStatus
from .app import app
def _cleanup(*args, **kwargs):
core.events.trigger('cleanup')
@app.task(name='girder_worker.run', bind=True, after_return=_cleanup)
def run(task, *pargs, **kwargs):
kwargs['_job_manager'] = task.job_manager \
if hasattr(task,... | import core
from girder_worker.utils import JobStatus
from .app import app
def _cleanup(*args, **kwargs):
core.events.trigger('cleanup')
@app.task(name='girder_worker.run', bind=True, after_return=_cleanup)
def run(tasks, *pargs, **kwargs):
jobInfo = kwargs.pop('jobInfo', {})
retval = 0
kwargs['_jo... | apache-2.0 | Python |
e2fcb951deb575559ac6f9464540dbc232c59b87 | Fix incorrect label in enabled toolchain check. | katre/bazel,aehlig/bazel,aehlig/bazel,akira-baruah/bazel,aehlig/bazel,werkt/bazel,perezd/bazel,ButterflyNetwork/bazel,bazelbuild/bazel,dslomov/bazel-windows,bazelbuild/bazel,safarmer/bazel,dslomov/bazel-windows,ButterflyNetwork/bazel,twitter-forks/bazel,ButterflyNetwork/bazel,cushon/bazel,ButterflyNetwork/bazel,davidzc... | tools/cpp/toolchain_utils.bzl | tools/cpp/toolchain_utils.bzl | # pylint: disable=g-bad-file-header
# 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
... | # pylint: disable=g-bad-file-header
# 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
... | apache-2.0 | Python |
556c179c14b386d73bee63158feaf3c3c375fdda | Use absl flag return values instead of the "magic" `FLAGS.foo`. | tensorflow/docs,tensorflow/docs,tensorflow/docs | tools/templates/build_docs.py | tools/templates/build_docs.py | # Lint as: python3
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | # Lint as: python3
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | apache-2.0 | Python |
251d59cce52d3c8df973c1c76776876e43fcda18 | Fix setting | tosh1ki/NicoCrawler | main_crawl.py | main_crawl.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__doc__ = '''
Crawl comment from nicovideo.jp
Usage:
main_crawl.py [--sqlite <sqlite>] [--csv <csv>]
Options:
--sqlite <sqlite> (optional) path of comment DB [default: comments.sqlite3]
--csv <csv> (optional) path of csv file contains urls of videos ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__doc__ = '''
Crawl comment from nicovideo.jp
Usage:
main_crawl.py [--sqlite <sqlite>] [--csv <csv>]
Options:
--sqlite <sqlite> (optional) path of comment DB [default: comments.sqlite3]
--csv <csv> (optional) path of csv file contains urls of videos ... | mit | Python |
b9600101ae4128db2e6c385b74f81d0a32276283 | Bump version 0.19.2 --> 0.19.3rc1 | lbryio/lbry,lbryio/lbry,lbryio/lbry | lbrynet/__init__.py | lbrynet/__init__.py | import logging
__version__ = "0.19.3rc1"
version = tuple(__version__.split('.'))
logging.getLogger(__name__).addHandler(logging.NullHandler())
| import logging
__version__ = "0.19.2"
version = tuple(__version__.split('.'))
logging.getLogger(__name__).addHandler(logging.NullHandler())
| mit | Python |
de29b7e81fa2e1b1ebe0e47d604a9f76e6619f25 | Update configs. | andrewfu0325/gem5-aladdin,andrewfu0325/gem5-aladdin,haowu4682/gem5,andrewfu0325/gem5-aladdin,haowu4682/gem5,haowu4682/gem5,LingxiaoJIA/gem5,LingxiaoJIA/gem5,LingxiaoJIA/gem5,LingxiaoJIA/gem5,haowu4682/gem5,andrewfu0325/gem5-aladdin,andrewfu0325/gem5-aladdin,LingxiaoJIA/gem5,haowu4682/gem5,haowu4682/gem5,LingxiaoJIA/gem... | configs/test/test.py | configs/test/test.py | # Simple test script
#
# Alpha: "m5 test.py"
# MIPS: "m5 test.py -c hello_mips"
import m5
import os, optparse, sys
m5.AddToPath('../common')
from SEConfig import *
from m5.objects import *
this_dir = os.path.dirname(__file__)
process = LiveProcess()
process.executable = os.path.join(this_dir, options.cmd)
process.cm... | # Simple test script
#
# Alpha: "m5 test.py"
# MIPS: "m5 test.py -c hello_mips"
import m5
import os, optparse, sys
m5.AddToPath('../common')
from SEConfig import *
this_dir = os.path.dirname(__file__)
process = LiveProcess()
process.executable = os.path.join(this_dir, options.cmd)
process.cmd = options.cmd + " " + o... | bsd-3-clause | Python |
57def8ead35f2d337233bde2b54b7dd0ef654b78 | Allow Hashid to be typecast as int | nshafer/django-hashid-field,nshafer/django-hashid-field | hashid_field/hashid.py | hashid_field/hashid.py | from functools import total_ordering
from hashids import Hashids, _is_uint
@total_ordering
class Hashid(object):
def __init__(self, id, salt='', min_length=0, alphabet=Hashids.ALPHABET):
self.hashids = Hashids(salt=salt, min_length=min_length, alphabet=alphabet)
self.id = id
self.hashid =... | from functools import total_ordering
from hashids import Hashids, _is_uint
@total_ordering
class Hashid(object):
def __init__(self, id, salt='', min_length=0, alphabet=Hashids.ALPHABET):
self.hashids = Hashids(salt=salt, min_length=min_length, alphabet=alphabet)
self.id = id
self.hashid =... | mit | Python |
0a4922dba3367a747d7460b5c1b59c49c67f3026 | Add missing parser argument to BeautifulSoup instance | mback2k/python-hcalendar | hcalendar/hcalendar.py | hcalendar/hcalendar.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from .vcalendar import vCalendar
from bs4 import BeautifulSoup
class hCalendar(object):
def __init__(self, markup, valu... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from .vcalendar import vCalendar
from bs4 import BeautifulSoup
class hCalendar(object):
def __init__(self, markup, valu... | mit | Python |
df48fc900da7eb6547da43a8177c94df0154cf3f | Add a rate of change metric for redis queues | calston/tensor,calston/tensor,hobbeswalsh/tensor,calston/tensor,calston/tensor,hobbeswalsh/tensor | tensor/sources/redis.py | tensor/sources/redis.py | import time
from zope.interface import implements
from twisted.internet import defer
from twisted.python import log
from tensor.interfaces import ITensorSource
from tensor.objects import Source
from tensor.utils import fork
from tensor.aggregators import Counter
class Queues(Source):
"""Query llen from redis-cl... | import time
from zope.interface import implements
from twisted.internet import defer
from twisted.python import log
from tensor.interfaces import ITensorSource
from tensor.objects import Source
from tensor.utils import fork
class Queues(Source):
"""Query llen from redis-cli
**Configuration arguments:**
... | mit | Python |
f841bb01889bc331cd47d40f0c8a94aa8c2f412c | Remove now unnecessary re-throw. | Plexxi/st2,emedvedev/st2,StackStorm/st2,nzlosh/st2,peak6/st2,lakshmi-kannan/st2,lakshmi-kannan/st2,peak6/st2,StackStorm/st2,emedvedev/st2,pixelrebel/st2,lakshmi-kannan/st2,tonybaloney/st2,pixelrebel/st2,peak6/st2,tonybaloney/st2,tonybaloney/st2,Plexxi/st2,nzlosh/st2,punalpatel/st2,emedvedev/st2,nzlosh/st2,pixelrebel/st... | st2common/st2common/services/packs.py | st2common/st2common/services/packs.py | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | apache-2.0 | Python |
2c4bb9bfc05f4594caac398b0155c77af35426ba | Set default client id | heutagogy/heutagogy-backend,heutagogy/heutagogy-backend | heutagogy/heutagogy.py | heutagogy/heutagogy.py | from heutagogy import app
import os
from datetime import timedelta
from flask_mail import Mail
from flask_migrate import Migrate
from flask_sqlalchemy import SQLAlchemy
import redis
from rq import Queue
app.config.from_object(__name__)
app.config.update(dict(
GOOGLE_CLIENT_ID=os.getenv(
'GOOGLE_CLIENT_ID',... | from heutagogy import app
import os
from datetime import timedelta
from flask_mail import Mail
from flask_migrate import Migrate
from flask_sqlalchemy import SQLAlchemy
import redis
from rq import Queue
app.config.from_object(__name__)
app.config.update(dict(
GOOGLE_CLIENT_ID=os.getenv('GOOGLE_CLIENT_ID'),
JW... | agpl-3.0 | Python |
6018ce51f9400aaec1d07c1073de07803c7b02f3 | bump rc number | widdowquinn/pyani | pyani/__init__.py | pyani/__init__.py | # python package version
# should match r"^__version__ = '(?P<version>[^']+)'$" for setup.py
__version__ = "0.2.8-rc2"
| # python package version
# should match r"^__version__ = '(?P<version>[^']+)'$" for setup.py
__version__ = "0.2.8-rc1"
| mit | Python |
826dcfd07cd35528c71ad7c7652555c01dbe1d28 | Update sanitizer rules. | us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite | us_ignite/common/sanitizer.py | us_ignite/common/sanitizer.py | import bleach
ALLOWED_TAGS = [
'a',
'abbr',
'acronym',
'b',
'blockquote',
'code',
'em',
'i',
'li',
'ol',
'strong',
'ul',
'p',
'br',
]
ALLOWED_ATTRIBUTES = {
'a': ['href', 'title'],
'abbr': ['title'],
'acronym': ['title'],
}
ALLOWED_STYLES = []
def... | import bleach
ALLOWED_TAGS = [
'a',
'abbr',
'acronym',
'b',
'blockquote',
'code',
'em',
'i',
'li',
'ol',
'strong',
'ul',
'p',
'br'
]
ALLOWED_ATTRIBUTES = {
'a': ['href', 'title'],
'abbr': ['title'],
'acronym': ['title'],
}
ALLOWED_STYLES = []
def ... | bsd-3-clause | Python |
f578c884615b858f3777ba602ae35eaf890b9bf5 | Change SingleEntry to Entry | usingnamespace/usingnamespace | usingnamespace/views/entry.py | usingnamespace/views/entry.py | from pyramid.view import view_config
from pyramid.httpexceptions import HTTPNotFound
from sqlalchemy.orm import undefer
from ..models import (
DBSession,
Entry,
)
from .finalisecontext import FinaliseContext
class Entry(FinaliseContext):
@view_config(context='..traversal.Entry', renderer='permapag... | from pyramid.view import view_config
from pyramid.httpexceptions import HTTPNotFound
from sqlalchemy.orm import undefer
from ..models import (
DBSession,
Entry,
)
from .finalisecontext import FinaliseContext
class Entry(FinaliseContext):
@view_config(context='..traversal.SingleEntry', renderer='pe... | isc | Python |
b42785eb27dd7d48bd8d13726ef0e34511738cdb | Convert between 4D DEC FA and 3D 24 bit representation. | FrancoisRheaultUS/dipy,FrancoisRheaultUS/dipy | dipy/io/utils.py | dipy/io/utils.py | ''' Utility functions for file formats '''
from __future__ import division, print_function, absolute_import
import numpy as np
from nibabel import Nifti1Image
def nifti1_symmat(image_data, *args, **kwargs):
"""Returns a Nifti1Image with a symmetric matrix intent
Parameters:
-----------
image_data : ... | ''' Utility functions for file formats '''
from __future__ import division, print_function, absolute_import
import numpy as np
from nibabel import Nifti1Image
def nifti1_symmat(image_data, *args, **kwargs):
"""Returns a Nifti1Image with a symmetric matrix intent
Parameters:
-----------
image_data : ... | bsd-3-clause | Python |
95e09088fdf48f1c094b7f016f5c8e34b4cf9182 | Return result from request to client. | gotling/PyTach,gotling/PyTach,gotling/PyTach | pytach/web/web.py | pytach/web/web.py | # -*- coding: utf-8 -*-
import os
import re
import bottle
import string
import inspect
from bottle import static_file, template, url
import dispatch
static_path = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) + '/static'
bottle.TEMPLATE_PATH.insert(0, os.path.dirname(os.path.abspath(insp... | # -*- coding: utf-8 -*-
import os
import re
import bottle
import string
import inspect
from bottle import static_file, template, url
import dispatch
static_path = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) + '/static'
bottle.TEMPLATE_PATH.insert(0, os.path.dirname(os.path.abspath(insp... | mit | Python |
f4606dde511a35d644fcb0138b9275825d415355 | fix selection of random row | ChelseaStats/mssngVwlsRnd | python/anagram.py | python/anagram.py | # importing modules
import tweepy
import os
import csv
import time
import random
# secrets
consumer_key = os.getenv('c_key')
consumer_secret = os.getenv('c_secret')
access_token = os.getenv('a_token')
access_token_secret = os.getenv('a_secret')
# authentication
auth = tweepy.OAuthHandler(consumer_key, consumer_secr... | # importing modules
import tweepy
import os
import csv
import time
import random
# secrets
consumer_key = os.getenv('c_key')
consumer_secret = os.getenv('c_secret')
access_token = os.getenv('a_token')
access_token_secret = os.getenv('a_secret')
# authentication
auth = tweepy.OAuthHandler(consumer_key, consumer_secr... | unlicense | Python |
225ff05ae339ea143561d4187ef9dc00679c961a | Add filtering of 200 responses | Fuchida/vamp | src/vamp.py | src/vamp.py | import requests
from lxml import html
# TODO: Detect relative urls on a page
class Vamp(object):
def __init__(self, url):
self.url = url
def scan_page(self):
"""
Given the configured url,
make a request to the site and get page content
Args:
None
... | import requests
from lxml import html
class Vamp(object):
def __init__(self, url):
self.url = url
def scan_page(self):
"""
Given the configured url,
make a request to the site and get page content
Args:
None
Return:
None
... | mit | Python |
8621d8c86f4c3eb818cadda9d826fe6ea8612d4c | bump version | renalreg/radar,renalreg/radar,renalreg/radar,renalreg/radar | radar/__init__.py | radar/__init__.py | __version__ = '2.47.7'
| __version__ = '2.47.6'
| agpl-3.0 | Python |
1734c59948fabcd3dcdb3c0cebc41c022043e28a | bump version | renalreg/radar,renalreg/radar,renalreg/radar,renalreg/radar | radar/__init__.py | radar/__init__.py | __version__ = '2.48.01'
| __version__ = '2.48.00'
| agpl-3.0 | Python |
635c2f9be0c7adc311c8a9e45b6a4731b900f2bd | fix division of cycles | tschul/SuraHeinz | start_up.py | start_up.py | from configuration import *
from bot import Bot
import logging
import time
import random
def run_iteration(b, cfg, iteration):
if cfg.follow_back_step > 0 and iteration % cfg.follow_back_step == 0:
try:
b.follow_back()
except Exception, e:
l.critical(e)
if cfg.retweet_... | from configuration import *
from bot import Bot
import logging
import time
import random
def run_iteration(b, cfg, iteration):
if cfg.follow_back_step > 0 and iteration % cfg.follow_back_step == 0:
try:
b.follow_back()
except Exception, e:
l.critical(e)
if cfg.retweet_... | apache-2.0 | Python |
e6b993a245e455bbf08aadf20514d72cda28e69e | Remove unnecessary include | balanced/PyXB,pabigot/pyxb,jonfoster/pyxb-upstream-mirror,jonfoster/pyxb1,balanced/PyXB,CantemoInternal/pyxb,CantemoInternal/pyxb,jonfoster/pyxb2,jonfoster/pyxb2,jonfoster/pyxb1,jonfoster/pyxb-upstream-mirror,pabigot/pyxb,jonfoster/pyxb2,CantemoInternal/pyxb,jonfoster/pyxb-upstream-mirror,balanced/PyXB | storewxs.py | storewxs.py | import PyWXSB.XMLSchema as xs
import sys
import traceback
from xml.dom import minidom
from xml.dom import Node
files = sys.argv[1:]
if 0 == len(files):
files = [ 'schemas/xml.xsd', 'xml.wxs' ]
xsd_file = files[0]
wxs_file = files[1]
wxs = xs.schema()
try:
wxs.processDocument(minidom.parse(xsd_file))
ns ... | import PyWXSB.XMLSchema as xs
import sys
import traceback
from xml.dom import minidom
from xml.dom import Node
import pickle
files = sys.argv[1:]
if 0 == len(files):
files = [ 'schemas/xml.xsd', 'xml.wxs' ]
xsd_file = files[0]
wxs_file = files[1]
wxs = xs.schema()
try:
wxs.processDocument(minidom.parse(xsd_... | apache-2.0 | Python |
3f4ae1869cd7e40aa9c4c06f54070c4c0dc6f343 | Add string_to_path function to vyconf.pathutils. | vyos-legacy/vyconfd,vyos-legacy/vyconfd | vyconf/pathutils/pathutils.py | vyconf/pathutils/pathutils.py | # vyconf.pathutils.pathutils:
# miscellaneous path handling functions
#
# Copyright (C) 2014 VyOS Development Group <maintainers@vyos.net>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Fr... | # vyconf.pathutils.pathutils:
# miscellaneous path handling functions
#
# Copyright (C) 2014 VyOS Development Group <maintainers@vyos.net>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Fr... | lgpl-2.1 | Python |
9a32f922e6d5ec6e5bd22eccbe3dceaef7bbd7dc | Add special character name test case | sleekbyte/tailor,sleekbyte/tailor,sleekbyte/tailor,sleekbyte/tailor,sleekbyte/tailor | tailor/tests/utils/charformat_test.py | tailor/tests/utils/charformat_test.py | import unittest
from tailor.utils import charformat
class MyTestCase(unittest.TestCase):
def is_upper_camel_case_test_upper_camel_case_name(self):
self.assertTrue(charformat.is_upper_camel_case('HelloWorld'))
def is_upper_camel_case_test_lower_camel_case_name(self):
self.assertFalse(charform... | import unittest
from tailor.utils import charformat
class MyTestCase(unittest.TestCase):
def is_upper_camel_case_test_upper_camel_case_name(self):
self.assertTrue(charformat.is_upper_camel_case('HelloWorld'))
def is_upper_camel_case_test_lower_camel_case_name(self):
self.assertFalse(charform... | mit | Python |
fd48211548c8c2d5daec0994155ddb7e8d226882 | Fix missing username in test | rememberberry/rememberberry-server,rememberberry/rememberberry-server | tests/test_anki_sync.py | tests/test_anki_sync.py | import pytest
import os
import rememberberry
from rememberscript import RememberMachine, FileStorage
from rememberberry.testing import tmp_data_path, assert_replies, get_isolated_story
@pytest.mark.asyncio
@tmp_data_path('/tmp/data/', delete=True)
async def test_anki_account():
storage = FileStorage()
storage[... | import pytest
import os
import rememberberry
from rememberscript import RememberMachine, FileStorage
from rememberberry.testing import tmp_data_path, assert_replies, get_isolated_story
@pytest.mark.asyncio
@tmp_data_path('/tmp/data/', delete=True)
async def test_anki_account():
storage = FileStorage()
m, stora... | agpl-3.0 | Python |
7b8bcc043fdc302223fce3d102816e91c524ffd3 | remove space after bracket | silnrsi/sldr,silnrsi/sldr,silnrsi/sldr,silnrsi/sldr | tests/test_collation.py | tests/test_collation.py | import unittest
import pytest
import re
import icu
import os
import logging, unicodedata
from lxml.etree import RelaxNG, parse, DocumentInvalid
curlybraces = re.compile(r"""\{
([^}]+)
\}""",re.VERBOSE)
def iscldr(ldml):
i = ldml.ldml.find(".//identity/special/sil:identity")
if i is not None and i.get(... | import unittest
import pytest
import re
import icu
import os
import logging, unicodedata
from lxml.etree import RelaxNG, parse, DocumentInvalid
curlybraces = re.compile(r"""\{
([^}]+)
\}""",re.VERBOSE)
def iscldr(ldml):
i = ldml.ldml.find(".//identity/special/sil:identity")
if i is not None and i.get(... | mit | Python |
d39aa677638475d41fbd3d41b507259dab178eb5 | create a check function to return stdout,stderr, and exitstatus | ceph/remoto,alfredodeza/remoto | remoto/process.py | remoto/process.py | from remoto.log import reporting
def _remote_run(channel, cmd):
import subprocess
import sys
process = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
if process.stderr:
while True:
err = process.stderr.readline()
if err == '' and p... | import sys
import execnet
from remoto.log import reporting
def remote_run(channel, cmd):
import subprocess
import sys
process = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
if process.stderr:
while True:
err = process.stderr.readline()
... | mit | Python |
dacada456d624931b007fe757804f340fe507e9b | Sort taxonomy tags before adding to OrderedDict | wikimedia/labs-tools-wikibugs2,wikimedia/labs-tools-wikibugs2 | taxonomy.py | taxonomy.py | from collections import OrderedDict
import phabricator
# work around pywikibot defaults
import os
pwb_path = os.path.join(
os.path.split(__file__)[0],
'.pywikibot'
)
try:
os.mkdir(pwb_path)
except IOError:
pass
os.environ["PYWIKIBOT2_NO_USER_CONFIG"] = "1"
os.environ["PYWIKIBOT2_DIR"] = pwb_path
import... | from collections import OrderedDict
import phabricator
# work around pywikibot defaults
import os
pwb_path = os.path.join(
os.path.split(__file__)[0],
'.pywikibot'
)
try:
os.mkdir(pwb_path)
except IOError:
pass
os.environ["PYWIKIBOT2_NO_USER_CONFIG"] = "1"
os.environ["PYWIKIBOT2_DIR"] = pwb_path
import... | mit | Python |
0cdabf1c807743de8c8c9071fe971fe2a5da0dc1 | Fix url in tests. | koenedaele/skosprovider_oe | tests/test_providers.py | tests/test_providers.py | # -*- coding: utf-8 -*-
import unittest
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
from skosprovider_oe.providers import (
OnroerendErfgoedProvider
)
class OnroerendErfgoedProviderTests(unittest.TestCase):
def setUp(self):
self.typologie = OnroerendErfgoedProvider(
... | # -*- coding: utf-8 -*-
import unittest
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
from skosprovider_oe.providers import (
OnroerendErfgoedProvider
)
class OnroerendErfgoedProviderTests(unittest.TestCase):
def setUp(self):
self.typologie = OnroerendErfgoedProvider(
... | mit | Python |
2c38fea1434f8591957c2707359412151c4b6c43 | Remove print in unit test | clchiou/garage,clchiou/garage,clchiou/garage,clchiou/garage | tests/test_timezones.py | tests/test_timezones.py | import unittest
import datetime
from garage.timezones import TimeZone
class TimeZoneTest(unittest.TestCase):
def test_time_zone(self):
utc = datetime.datetime(2000, 1, 2, 3, 4, 0, 0, TimeZone.UTC)
cst = utc.astimezone(TimeZone.CST)
self.assertEqual(2000, cst.year)
self.assertEqu... | import unittest
import datetime
from garage.timezones import TimeZone
class TimeZoneTest(unittest.TestCase):
def test_time_zone(self):
utc = datetime.datetime(2000, 1, 2, 3, 4, 0, 0, TimeZone.UTC)
cst = utc.astimezone(TimeZone.CST)
print('xxx', utc, cst)
self.assertEqual(2000, c... | mit | Python |
6cad476c9974aa93760b74f5ef0334673cb14a15 | fix extract to not need pos toggle per as_df suggestion | msullivan/advent-of-code,msullivan/advent-of-code,msullivan/advent-of-code | template.py | template.py | #!/usr/bin/env python3
import sys
from collections import defaultdict, Counter, deque
from parse import parse
import re
def extract(s):
return [int(x) for x in re.findall(r'(-?\d+).?', s)]
def vadd(v1, v2):
return tuple(x + y for x, y in zip(v1, v2))
def ichr(i):
return chr(ord('a') + i)
def iord(c):
... | #!/usr/bin/env python3
import sys
from collections import defaultdict, Counter, deque
from parse import parse
import re
def extract(s, pos=False):
p = '' if pos else '-?'
return [int(x) for x in re.findall(fr'{p}\d+', s)]
def vadd(v1, v2):
return tuple(x + y for x, y in zip(v1, v2))
def ichr(i):
re... | mit | Python |
26d69b9962d074dd9aaa1159d77265d05c514279 | Improve efficiency of pooling | spacy-io/thinc,spacy-io/thinc,explosion/thinc,spacy-io/thinc,explosion/thinc,explosion/thinc,explosion/thinc | thinc/neural/pooling.py | thinc/neural/pooling.py | from ..api import layerize
import numpy
from ._classes.model import Model
try:
from cupy import get_array_module
except ImportError:
get_array_module = lambda arr: numpy
def Pooling(*funcs, **kwargs):
ops = kwargs['ops'] if 'ops' in kwargs else funcs[0].ops
F = len(funcs)
def begin_update(X_le... | from ..api import layerize
import numpy
from ._classes.model import Model
try:
from cupy import get_array_module
except ImportError:
get_array_module = lambda arr: numpy
def Pooling(*funcs, **kwargs):
ops = kwargs['ops'] if 'ops' in kwargs else funcs[0].ops
F = len(funcs)
def begin_update(X_le... | mit | Python |
0f89db24f3a0518c06207e106e25448745f95110 | Add all core tests to DDC linux bots | dart-archive/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-lang/sdk,dartino/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk,dartino/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-... | tools/bots/ddc_tests.py | tools/bots/ddc_tests.py | #!/usr/bin/env python
#
# Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
import os
import os.path
import shutil
import sys
import subprocess
import bot
im... | #!/usr/bin/env python
#
# Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
import os
import os.path
import shutil
import sys
import subprocess
import bot
im... | bsd-3-clause | Python |
b1d3a0c79a52ca1987ea08a546213e1135539927 | Set CHROME_BIN on DDC bot | dartino/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dartino/dart-sdk,dartino/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-lang/... | tools/bots/ddc_tests.py | tools/bots/ddc_tests.py | #!/usr/bin/env python
#
# Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
import os
import os.path
import shutil
import sys
import subprocess
import bot
im... | #!/usr/bin/env python
#
# Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
import os
import os.path
import shutil
import sys
import subprocess
import bot
im... | bsd-3-clause | Python |
64451be44826e69d8f5f046e1e78bcead0a1de5a | Add only valid handles | stopstalk/stopstalk-deployment,stopstalk/stopstalk-deployment,stopstalk/stopstalk-deployment,stopstalk/stopstalk-deployment,stopstalk/stopstalk-deployment | private/scripts/extras/uva-populate-username-to-id.py | private/scripts/extras/uva-populate-username-to-id.py | """
Copyright (c) 2015-2016 Raj Patel(raj454raj@gmail.com), StopStalk
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
... | """
Copyright (c) 2015-2016 Raj Patel(raj454raj@gmail.com), StopStalk
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
... | mit | Python |
34b023fd7cce66845d92df905bcb4f227805e081 | update _all_rotations | EderSantana/blocks_contrib,EderSantana/blocks_contrib | datasets/__init__.py | datasets/__init__.py | import numpy as np
import theano
from skimage.transform import rotate
floatX = theano.config.floatX
class Meanizer():
'''Removes the mean of the datastream
'''
def __init__(self, datastream, indexes=[0, ]):
self.means = []
self.indexes = indexes
for b in datastream.get_epoch_itera... | import numpy as np
import theano
from skimage.transform import rotate
floatX = theano.config.floatX
class Meanizer():
'''Removes the mean of the datastream
'''
def __init__(self, datastream, indexes=[0, ]):
self.means = []
self.indexes = indexes
for b in datastream.get_epoch_itera... | mit | Python |
1cd24b422d4a322db554cb29e036b6091b0fd730 | update oriented usans example with renamed parameters | SasView/sasmodels,SasView/sasmodels,SasView/sasmodels,SasView/sasmodels | example/oriented_usans.py | example/oriented_usans.py | from bumps.names import *
from sasmodels.data import load_data
from sasmodels.core import load_model
from sasmodels.bumps_model import Model, Experiment
# Spherical particle data, not ellipsoids
sans, usans = load_data('../../sasview/sasview/test/1d_data/latex_smeared.xml')
usans.qmin, usans.qmax = np.min(usans.x), n... | from bumps.names import *
from sasmodels.data import load_data
from sasmodels.core import load_model
from sasmodels.bumps_model import Model, Experiment
# Spherical particle data, not ellipsoids
sans, usans = load_data('../../sasview/sasview/test/1d_data/latex_smeared.xml')
usans.qmin, usans.qmax = np.min(usans.x), n... | bsd-3-clause | Python |
200a2a72581bca9d9b0cb75f3aac0158de0e500b | Split long line | ECP-CANDLE/Supervisor,ECP-CANDLE/Supervisor,ECP-CANDLE/Supervisor,ECP-CANDLE/Supervisor,ECP-CANDLE/Supervisor,ECP-CANDLE/Supervisor | workflows/async-local/Task.py | workflows/async-local/Task.py |
# TASK
# This should be a user plug-in
from __future__ import print_function
import os
class Task:
def __init__(self, parallelism, number, params):
self.process = None
self.fd = None
self.parallelism = parallelism
self.number = number
self.params = params
def go(self... |
# TASK
# This should be a user plug-in
from __future__ import print_function
import os
class Task:
def __init__(self, parallelism, number, params):
self.process = None
self.fd = None
self.parallelism = parallelism
self.number = number
self.params = params
def go(self... | mit | Python |
8b6a77a5d9710b4ca5b23f53ee2513c53b2172e9 | add back __init_ packages | jld23/saspy,jld23/saspy | saspy/__init__.py | saspy/__init__.py | #
# Copyright SAS Institute
#
# Licensed under the Apache License, Version 2.0 (the License);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | #
# Copyright SAS Institute
#
# Licensed under the Apache License, Version 2.0 (the License);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | apache-2.0 | Python |
d9c68ac88be8c5905ad2fdd91cfd8a431a338ed7 | Update tensorflow7_variable.py | wangwei7175878/tutorials | tensorflowTUT/tensorflow7_variable.py | tensorflowTUT/tensorflow7_variable.py | # View more python learning tutorial on my Youtube and Youku channel!!!
# Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg
# Youku video tutorial: http://i.youku.com/pythontutorial
import tensorflow as tf
state = tf.Variable(0, name='counter')
one = tf.constant(1)
new_value = tf.add(... | import tensorflow as tf
state = tf.Variable(0, name='counter')
one = tf.constant(1)
new_value = tf.add(state, one)
update = tf.assign(state, new_value)
init = tf.initialize_all_variables() # must have
with tf.Session() as sess:
sess.run(init) # run and activate
for _ in range(3):
sess.run(up... | mit | Python |
a96dd36e461ff80177550f8f281680d018c9cf48 | fix bug in send notices to multiple emails | Answeror/torabot,Answeror/torabot,Answeror/torabot | torabot/tasks/notice.py | torabot/tasks/notice.py | from datetime import timedelta
from logbook import Logger
from itertools import groupby
from .engine import make as make_engine
from ..ut.connection import ccontext
from ..ut.guard import timeguard
from .. import db
from ..core.notice import send_notices
log = Logger(__name__)
@timeguard
def notice_all(conf):
e... | from datetime import timedelta
from logbook import Logger
from .engine import make as make_engine
from ..ut.connection import ccontext
from ..ut.guard import timeguard
from .. import db
from ..core.notice import send_notices
log = Logger(__name__)
@timeguard
def notice_all(conf):
engine = make_engine(conf)
... | mit | Python |
53b9105443ee61ae915b12c538db49e6874a1883 | Update test to properly detect make static libs. Review URL: http://codereview.chromium.org/264034 | old8xp/gyp_from_google,old8xp/gyp_from_google,old8xp/gyp_from_google,old8xp/gyp_from_google,old8xp/gyp_from_google | test/dependencies/gyptest-lib-only.py | test/dependencies/gyptest-lib-only.py | #!/usr/bin/env python
"""
Verify that a link time only dependency will get pulled into the set of built
targets, even if no executable uses it.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('lib_only.gyp')
test.build_all('lib_only.gyp')
# Make doesn't put static libs in a common location, like it does ... | #!/usr/bin/env python
"""
Verify that a link time only dependency will get pulled into the set of built
targets, even if no executable uses it.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('lib_only.gyp')
test.build_all('lib_only.gyp')
test.built_lib_must_exist('a')
# TODO(bradnelson/mark):
# On linu... | bsd-3-clause | Python |
72249431bc8c9c7007cb978155d8a926de36dd97 | Update __init__.py | noelnoche/udacity-fsnd-movie-trailer-website,noelnoche/udacity-fsnd-movie-trailer-website,noelnoche/udacity-fsnd-movie-trailer-website | trailersweb/__init__.py | trailersweb/__init__.py | """This file initializes the application and brings together all of the
various components.
"""
def create_app():
"""Factory function that initializes the Flask application context.
Imports Flask and blueprints and sets configuration values.
"""
from flask import Flask
from trailersweb.cache... | """This file initializes the application and brings together all of the
various components.
"""
def create_app():
"""Factory function that initializes the Flask application context.
Imports Flask and blueprints and sets configuration values.
"""
from flask import Flask
from trailersweb.cache... | mit | Python |
f686ecd973725f07d2390949db1f7222c872423a | Update ipc_lista1.6.py | any1m1c/ipc20161 | lista1/ipc_lista1.6.py | lista1/ipc_lista1.6.py | #ipc_lista1.6
#Professor: Jucimar Junior
#Any Mendes Carvalho -
#
#
#
#
#Faça um programa que peça o raio de um círculo, calcule e mostre sua área
raio = 0
area = 0
raio = input("Entre com o valor do raio: ")
area = 3.14 * raio*raio
print "Valor da área do círculo: %d m²" %area
| #ipc_lista1.6
#Professor: Jucimar Junior
#Any Mendes Carvalho -
#
#
#
#
#Faça um programa que peça o raio de um círculo, calcule e mostre sua área
raio = 0
area = 0
raio = input("Entre com o valor do raio: ")
area = 3.14 * raio*raio
print "Valor da área do círculo: %d m²" %area
| apache-2.0 | Python |
a5f3dcc0634b82a8fba04cbec46b4d040507b0ab | Update ipc_lista1.7.py | any1m1c/ipc20161 | lista1/ipc_lista1.7.py | lista1/ipc_lista1.7.py | #ipc_lista1.7
#Professor: Jucimar Junior
#Any Mendes Carvalho
#
#
#
#
#Faça um programa que calcule a área de um quadrado, em seguida mostre o dobro desta área para o #usuário.
altura = input("Digite a altura do quadrado em metros: ")
largura = input("Digite a largura do quadrado em metros: ")
a = altura * largura
p... | #ipc_lista1.7
#Professor: Jucimar Junior
#Any Mendes Carvalho
#
#
#
#
#Faça um programa que calcule a área de um quadrado, em seguida mostre o dobro desta área para o #usuário.
altura = input("Digite a altura do quadrado em metros: ")
largura = input("Digite a largura do quadrado em metros: ")
a = altura * largura
p... | apache-2.0 | Python |
c143bc14be8d486d313056c0d1313e03ac438284 | Use open mode syntax on example file | adsabs/adsabs-pyingest,adsabs/adsabs-pyingest,adsabs/adsabs-pyingest | examples/ex_aps_parser.py | examples/ex_aps_parser.py | from __future__ import print_function
import os
import glob
import pyingest.parsers.aps as aps
import pyingest.parsers.arxiv as arxiv
import pyingest.serializers.classic
import traceback
import json
import xmltodict
from datetime import datetime
import sys
input_list = 'bibc.2.out'
testfile=[]
xmldir = '/proj/ads/full... | from __future__ import print_function
import os
import glob
import pyingest.parsers.aps as aps
import pyingest.parsers.arxiv as arxiv
import pyingest.serializers.classic
import traceback
import json
import xmltodict
from datetime import datetime
input_list = 'bibc.2.out'
testfile=[]
xmldir = '/proj/ads/fulltext/source... | mit | Python |
4ccc510a2c21e9d4d7d8e8d78987f25bbe910989 | return float32 by default | dougalsutherland/py-sdm | sdm/knn_search.py | sdm/knn_search.py | '''
Convenience wrapper around FLANN to do kNN searches.
'''
from .utils import is_integer
import numpy as np
from pyflann import FLANN
def default_min_dist(dim):
return min(1e-2, 1e-100 ** (1.0 / dim))
def pick_flann_algorithm(dim):
return 'linear' if dim > 5 else 'kdtree_single'
def knn_search(K, x, y... | '''
Convenience wrapper around FLANN to do kNN searches.
'''
from .utils import is_integer
import numpy as np
from pyflann import FLANN
def default_min_dist(dim):
return min(1e-2, 1e-100 ** (1.0 / dim))
def pick_flann_algorithm(dim):
return 'linear' if dim > 5 else 'kdtree_single'
def knn_search(K, x, y... | bsd-3-clause | Python |
cc5e89e7dde571b6db2b92dc1ec5676dcb37013f | Sort emails by date | RobFisher/mailshare,RobFisher/mailshare,RobFisher/mailshare | mailshareapp/models.py | mailshareapp/models.py | # License: https://github.com/RobFisher/mailshare/blob/master/LICENSE
from django.db import models
class Contact(models.Model):
name = models.TextField()
address = models.TextField()
def __unicode__(self):
return self.address
class Mail(models.Model):
sender = models.ForeignKey(Contact, relat... | # License: https://github.com/RobFisher/mailshare/blob/master/LICENSE
from django.db import models
class Contact(models.Model):
name = models.TextField()
address = models.TextField()
def __unicode__(self):
return self.address
class Mail(models.Model):
sender = models.ForeignKey(Contact, relat... | bsd-3-clause | Python |
e038c3ddb3e1a6c4a345c6957ac372bb70c36e7c | Allow test jobs. | benjamin-guillet/wmr-frontend,benguillet/wmr-frontend,benguillet/wmr-frontend,benjamin-guillet/wmr-frontend | settings_local.py | settings_local.py | ##
## Set these if the WebMapReduce backend is running on a remote server or on
## a port other than the default.
##
#WMR_HOST = 'localhost'
#WMR_PORT = 50100
##
## Set this if WebMapReduce is deployed at a sub-url of your website. This will
## guarantee that media files are served properly and will fix some redirect... | ##
## Set these if the WebMapReduce backend is running on a remote server or on
## a port other than the default.
##
#WMR_HOST = 'localhost'
#WMR_PORT = 50100
##
## Set this if WebMapReduce is deployed at a sub-url of your website. This will
## guarantee that media files are served properly and will fix some redirect... | apache-2.0 | Python |
56d8c4ef8447564066e47f43859f09aa1c95ef06 | raise TypeError on invalid arguments | ferreum/distanceutils,ferreum/distanceutils | distance/argtaker.py | distance/argtaker.py | """Handling of *args and **kw."""
DO_THROW = object()
class ArgTaker(object):
def __init__(self, *args, **kw):
self.args = args
self.kwargs = kw
self.maxarg = 0
def __call__(self, index, kwname, default=DO_THROW):
maxarg = self.maxarg
if index > maxarg:
... | """Handling of *args and **kw."""
DO_THROW = object()
class ArgTaker(object):
def __init__(self, *args, **kw):
self.args = args
self.kwargs = kw
self.maxarg = 0
def __call__(self, index, kwname, default=DO_THROW):
maxarg = self.maxarg
if index > maxarg:
... | mit | Python |
8e46172837a75e19683c9e3436046f966c20e366 | remove time from logging messages | blaze/distributed,mrocklin/distributed,broxtronix/distributed,dask/distributed,mrocklin/distributed,amosonn/distributed,dask/distributed,dask/distributed,mrocklin/distributed,broxtronix/distributed,broxtronix/distributed,amosonn/distributed,amosonn/distributed,blaze/distributed,dask/distributed | distributed/utils.py | distributed/utils.py | from __future__ import print_function, division, absolute_import
import socket
from tornado import gen
def get_ip():
return [(s.connect(('8.8.8.8', 80)), s.getsockname()[0], s.close())
for s in [socket.socket(socket.AF_INET, socket.SOCK_DGRAM)]][0][1]
from contextlib import contextmanager
@contextmana... | from __future__ import print_function, division, absolute_import
import socket
from tornado import gen
def get_ip():
return [(s.connect(('8.8.8.8', 80)), s.getsockname()[0], s.close())
for s in [socket.socket(socket.AF_INET, socket.SOCK_DGRAM)]][0][1]
from contextlib import contextmanager
@contextmana... | bsd-3-clause | Python |
b5a8b7526d64796671733c1789cf54fb5498014f | Increase version. | seler/djoauth2,Locu/djoauth2,Locu/djoauth2,vden/djoauth2-ng,seler/djoauth2,vden/djoauth2-ng | djoauth2/__init__.py | djoauth2/__init__.py | # coding: utf-8
__version__ = '0.4.0'
| # coding: utf-8
__version__ = '0.3.2'
| mit | Python |
a9fbccf94b12b5306a8243c79468743c2228ae18 | Fix sort order | adamtheturtle/vws-python,adamtheturtle/vws-python | tests/mock_vws/test_target_summary.py | tests/mock_vws/test_target_summary.py | """
Tests for the mock of the target summary endpoint.
"""
from urllib.parse import urljoin
import pytest
import requests
from requests_mock import GET
from tests.utils import VuforiaServerCredentials
from vws._request_utils import authorization_header, rfc_1123_date
@pytest.mark.usefixtures('verify_mock_vuforia')... | """
Tests for the mock of the target summary endpoint.
"""
import pytest
from urllib.parse import urljoin
import requests
from requests_mock import GET
from tests.utils import VuforiaServerCredentials
from vws._request_utils import authorization_header, rfc_1123_date
@pytest.mark.usefixtures('verify_mock_vuforia')... | mit | Python |
6334e30fb6c3b2e512f24cfb5130a028f499df69 | Drop Py2 and six on tests/unit/utils/validate/test_net.py | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | tests/unit/utils/validate/test_net.py | tests/unit/utils/validate/test_net.py | from salt.utils.validate import net
from tests.support.unit import TestCase
class ValidateNetTestCase(TestCase):
"""
TestCase for salt.utils.validate.net module
"""
def test_ipv4_addr(self):
"""
Test IPv4 address validation
"""
true_addrs = [
"127.0.0.1",
... | # -*- coding: utf-8 -*-
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Libs
from salt.utils.validate import net
# Import Salt Testing Libs
from tests.support.unit import TestCase
class ValidateNetTestCase(TestCase):
"""
TestCase for salt.utils.va... | apache-2.0 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.