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 |
|---|---|---|---|---|---|---|---|---|
361be2ee7ee5ca2282b6dd5d7423ec8b7df79cdc | fix dll path | voyagersearch/voyager-py,voyagersearch/voyager-py | extractors/vgextractors/__init__.py | extractors/vgextractors/__init__.py | # -*- coding: utf-8 -*-
# (C) Copyright 2014 Voyager Search
#
# 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 l... | # -*- coding: utf-8 -*-
# (C) Copyright 2014 Voyager Search
#
# 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 l... | apache-2.0 | Python |
1ae90e4a1dda2d600cff7a0b5b0d85f6d0fdfc62 | Update docstring for Travis | skearnes/pylearn2,skearnes/pylearn2,skearnes/pylearn2,skearnes/pylearn2 | pylearn2/train_extensions/tests/test_roc_auc.py | pylearn2/train_extensions/tests/test_roc_auc.py | """
Tests for ROC AUC.
"""
import unittest
from pylearn2.config import yaml_parse
from pylearn2.testing.skip import skip_if_no_sklearn
class TestRocAucChannel(unittest.TestCase):
"""Train a simple model and calculate ROC AUC for monitoring datasets."""
def setUp(self):
skip_if_no_sklearn()
def t... | import unittest
from pylearn2.config import yaml_parse
from pylearn2.testing.skip import skip_if_no_sklearn
class TestRocAucChannel(unittest.TestCase):
"""Train a simple model and calculate ROC AUC for monitoring datasets."""
def setUp(self):
skip_if_no_sklearn()
def test_roc_auc(self):
... | bsd-3-clause | Python |
2f95e0e2dab0bbddf5d7fcde7dbc489bfb95d056 | fix compatibility issue | frankwiles/django-admin-views,frankwiles/django-admin-views | admin_views/templatetags/admin_views.py | admin_views/templatetags/admin_views.py | import sys
from django import template
from django.conf import settings
from django.core.urlresolvers import reverse
from django.contrib.admin import site
from ..admin import AdminViews
register = template.Library()
if sys.version_info < (3,):
import codecs
def u(x):
return codecs.unicode_escape_dec... | import sys
from django import template
from django.conf import settings
from django.core.urlresolvers import reverse
from django.contrib.admin import site
from ..admin import AdminViews
register = template.Library()
if sys.version_info < (3,):
import codecs
def u(x):
return codecs.unicode_escape_dec... | bsd-3-clause | Python |
ba6c83bcf0e053e654b018274d41775c4b4a98ed | implement dumpy me command | marioidival/dumpyme | src/commander.py | src/commander.py | import os
import click
from utils.config import DumpyConfig
from utils.reader import DumpyReader
from tasks.executor import DumpyExecutor
from utils.supported_databases import SUPPORTED
@click.group()
def dumpy():
"""Command Line package to get dumps"""
@dumpy.command()
def init():
"""Create dumpfile to us... | import os
import click
from utils.config import DumpyConfig
from utils.reader import DumpyReader
@click.group()
def dumpy():
"""Command Line package to get dumps"""
@dumpy.command()
def init():
"""Create dumpfile to user"""
if init:
dumpy_conf = DumpyConfig()
we_file = os.path.join(os.pa... | mit | Python |
d70f7e838d9dcd3fce5ece228e94a3028e9e5293 | add Category model | free-free/pyblog,free-free/pyblog,free-free/pyblog,free-free/pyblog | app/models.py | app/models.py | #!/usr/bin/env python3.5
from tools.column import Column
from tools.field import String,Int,Float,Text,Boolean
from tools.model import Model
from tools.database import *
from tools.log import *
import time
class User(Model):
__table__='users'
id=Column(Int(4,unsigned=True),primary_key=True... | #!/usr/bin/env python3.5
from tools.column import Column
from tools.field import String,Int,Float,Text,Boolean
from tools.model import Model
from tools.database import *
from tools.log import *
import time
class User(Model):
__table__='users'
id=Column(Int(4,unsigned=True),primary_key=True... | mit | Python |
91141713b672f56a8c45f0250b7e9216a69237f8 | Increase splinter wait time to 15 seconds | alphagov/backdrop,alphagov/backdrop,alphagov/backdrop | features/support/splinter_client.py | features/support/splinter_client.py | import logging
from pymongo import MongoClient
from splinter import Browser
from features.support.http_test_client import HTTPTestClient
from features.support.support import Api
class SplinterClient(object):
def __init__(self, database_name):
self.database_name = database_name
self._write_api =... | import logging
from pymongo import MongoClient
from splinter import Browser
from features.support.http_test_client import HTTPTestClient
from features.support.support import Api
class SplinterClient(object):
def __init__(self, database_name):
self.database_name = database_name
self._write_api =... | mit | Python |
5a36943988088027e13c1499a90be7a0cf9ee8e2 | Enable colors only for supported | d6e/coala,MattAllmendinger/coala,scottbelden/coala,saurabhiiit/coala,lonewolf07/coala,NiklasMM/coala,meetmangukiya/coala,ayushin78/coala,djkonro/coala,SambitAcharya/coala,rimacone/testing2,coala-analyzer/coala,sils1297/coala,rimacone/testing2,refeed/coala,vinc456/coala,impmihai/coala,Asalle/coala,sudheesh001/coala,coal... | coalib/output/printers/ConsolePrinter.py | coalib/output/printers/ConsolePrinter.py | import platform
from coalib.output.printers.ColoredLogPrinter import ColoredLogPrinter
from coalib.output.printers.LOG_LEVEL import LOG_LEVEL
class ConsolePrinter(ColoredLogPrinter):
"""
A simple printer for the console that supports colors and logs.
Note that pickling will not pickle the output member.... | from coalib.output.printers.ColoredLogPrinter import ColoredLogPrinter
from coalib.output.printers.LOG_LEVEL import LOG_LEVEL
class ConsolePrinter(ColoredLogPrinter):
"""
A simple printer for the console that supports colors and logs.
Note that pickling will not pickle the output member.
"""
def ... | agpl-3.0 | Python |
b45261c3dc66e7089e016ebad1121f72fe7ffb80 | Change initial debug configuration to: reset/halt, load, init break points | platformio/platformio-core,platformio/platformio-core,platformio/platformio | platformio/commands/debug/initcfgs.py | platformio/commands/debug/initcfgs.py | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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 appli... | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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 appli... | apache-2.0 | Python |
508ee1dcb88e6bd8ee4f96a16b79e8643497c9fd | Add negative expressions | bryantrobbins/baseball,bryantrobbins/baseball,bryantrobbins/baseball,bryantrobbins/baseball,bryantrobbins/baseball | api/btr3baseball/ExpressionValidator.py | api/btr3baseball/ExpressionValidator.py | from pyparsing import Literal,CaselessLiteral,Word,Combine,Group,Optional,\
ZeroOrMore,Forward,nums,alphas,ParseException
point = Literal( "." )
fnumber = Combine( Word( "+-"+nums, nums ) + Optional( point + Optional( Word( nums ) ) ) )
quote = Literal("'").suppress()
comma = Literal(",")
ident = Word(alphas)
plus... | from pyparsing import Literal,CaselessLiteral,Word,Combine,Group,Optional,\
ZeroOrMore,Forward,nums,alphas,ParseException
point = Literal( "." )
fnumber = Combine( Word( "+-"+nums, nums ) + Optional( point + Optional( Word( nums ) ) ) )
quote = Literal("'").suppress()
comma = Literal(",")
ident = Word(alphas)
plus... | apache-2.0 | Python |
a8bd3ea91563f087b6aa4b651606f4c38beba913 | Bump pyleus to 0.1.9 | mzbyszynski/pyleus,ecanzonieri/pyleus,Yelp/pyleus,Yelp/pyleus,stallman-cui/pyleus,patricklucas/pyleus,jirafe/pyleus,poros/pyleus,jirafe/pyleus,imcom/pyleus,poros/pyleus,stallman-cui/pyleus,mzbyszynski/pyleus,dapuck/pyleus,patricklucas/pyleus,dapuck/pyleus,imcom/pyleus,ecanzonieri/pyleus,imcom/pyleus | pyleus/__init__.py | pyleus/__init__.py | import os
import sys
__version__ = '0.1.9'
BASE_JAR = "pyleus-base.jar"
BASE_JAR_INSTALL_DIR = "share/pyleus"
BASE_JAR_PATH = os.path.join(sys.prefix, BASE_JAR_INSTALL_DIR, BASE_JAR)
| import os
import sys
__version__ = '0.1.8'
BASE_JAR = "pyleus-base.jar"
BASE_JAR_INSTALL_DIR = "share/pyleus"
BASE_JAR_PATH = os.path.join(sys.prefix, BASE_JAR_INSTALL_DIR, BASE_JAR)
| apache-2.0 | Python |
99beb21b982efae4a9b3c07b23ae8185727f0d3b | tweak code style in autil | civalin/cmdlr,civalin/cmdlr | src/cmdlr/autil.py | src/cmdlr/autil.py | """Analyzer utils."""
import json
import subprocess
from tempfile import NamedTemporaryFile
from shutil import which
from collections import namedtuple
from urllib.parse import urljoin
from bs4 import BeautifulSoup
from .exception import ExternalDependencyNotFound
_JSResult = namedtuple('JSResult', ['eval', 'env']... | """Analyzer utils."""
import shutil
import json
import tempfile
import subprocess
from collections import namedtuple
from urllib.parse import urljoin
from bs4 import BeautifulSoup
from .exception import ExternalDependencyNotFound
_JSResult = namedtuple('JSResult', ['eval', 'env'])
def run_in_nodejs(js):
"""D... | mit | Python |
0ae8662557081a55b04c78912e20aa4fe1c58d0d | change search url to filter male people | kgilbert-cmu/flairlog | flairs.py | flairs.py | import Config
import Dictionary
import praw
def main():
r = praw.Reddit(user_agent = Config.user_agent)
r.login(Config.username, Config.password)
subreddit = r.get_subreddit(Config.subreddit)
collect = {}
for flair in subreddit.get_flair_list(limit = None):
(_, user, text) = flair.values()
cleaned = text
#... | import Config
import Dictionary
import praw
def main():
r = praw.Reddit(user_agent = Config.user_agent)
r.login(Config.username, Config.password)
subreddit = r.get_subreddit(Config.subreddit)
collect = {}
for flair in subreddit.get_flair_list(limit = None):
(_, user, text) = flair.values()
cleaned = text
#... | mit | Python |
035c32a99e6e03b2498db75dc52d9bf6818813c2 | Bump version. | KmolYuan/pyslvs,KmolYuan/pyslvs,KmolYuan/pyslvs,KmolYuan/pyslvs | pyslvs/__init__.py | pyslvs/__init__.py | # -*- coding: utf-8 -*-
"""Kernel of Pyslvs."""
__all__ = [
'__version__',
'Coordinate',
'plap',
'pllp',
'plpp',
'pxy',
'expr_parser',
'expr_solving',
'data_collecting',
'get_vlinks',
'VJoint',
'VPoint',
'VLink',
'SolverSystem',
'norm_path',
'curvature',... | # -*- coding: utf-8 -*-
"""Kernel of Pyslvs."""
__all__ = [
'__version__',
'Coordinate',
'plap',
'pllp',
'plpp',
'pxy',
'expr_parser',
'expr_solving',
'data_collecting',
'get_vlinks',
'VJoint',
'VPoint',
'VLink',
'SolverSystem',
'norm_path',
'curvature',... | agpl-3.0 | Python |
9516115f722fb3f95882553d8077bf1ab4a670ef | FIX web_demo upload was not processing grayscale correctly | wangg12/caffe,longjon/caffe,gnina/gnina,gogartom/caffe-textmaps,wangg12/caffe,tackgeun/caffe,longjon/caffe,wangg12/caffe,tackgeun/caffe,tackgeun/caffe,gogartom/caffe-textmaps,gnina/gnina,tackgeun/caffe,gnina/gnina,CZCV/s-dilation-caffe,gnina/gnina,wangg12/caffe,longjon/caffe,gnina/gnina,gogartom/caffe-textmaps,CZCV/s-d... | examples/web_demo/exifutil.py | examples/web_demo/exifutil.py | """
This script handles the skimage exif problem.
"""
from PIL import Image
import numpy as np
ORIENTATIONS = { # used in apply_orientation
2: (Image.FLIP_LEFT_RIGHT,),
3: (Image.ROTATE_180,),
4: (Image.FLIP_TOP_BOTTOM,),
5: (Image.FLIP_LEFT_RIGHT, Image.ROTATE_90),
6: (Image.ROTATE_270,),
7... | """
This script handles the skimage exif problem.
"""
from PIL import Image
import numpy as np
ORIENTATIONS = { # used in apply_orientation
2: (Image.FLIP_LEFT_RIGHT,),
3: (Image.ROTATE_180,),
4: (Image.FLIP_TOP_BOTTOM,),
5: (Image.FLIP_LEFT_RIGHT, Image.ROTATE_90),
6: (Image.ROTATE_270,),
7... | bsd-2-clause | Python |
ccc289a725ac92c8a5acb3ff101c2bf07234e3f6 | Switch docs to github pages | karimbahgat/Pytess,karimbahgat/Pytess | pytess/__init__.py | pytess/__init__.py | """
# Pytess
Pure Python tessellation of points into polygons, including
Delauney/Thiessin, and Voronoi polygons. Built as a
convenient user interface for Bill Simons/Carson Farmer python port of
Steven Fortune C++ version of a Delauney triangulator.
## Platforms
Tested on Python version 2.x and 3.x.
## Dependen... | """
# Pytess
Pure Python tessellation of points into polygons, including
Delauney/Thiessin, and Voronoi polygons. Built as a
convenient user interface for Bill Simons/Carson Farmer python port of
Steven Fortune C++ version of a Delauney triangulator.
## Platforms
Tested on Python version 2.x and 3.x.
## Dependen... | mit | Python |
4ca9594b5208a9d2774048b0519d9c2abe06b6db | allow multiple trees in conversion to numpy array | rootpy/rootpy,ndawe/rootpy,rootpy/rootpy,ndawe/rootpy,kreczko/rootpy,kreczko/rootpy,ndawe/rootpy,rootpy/rootpy,kreczko/rootpy | rootpy/root2array.py | rootpy/root2array.py | """
This module should handle:
* conversion of TTrees into NumPy arrays
* conversion of TTrees into carrays (http://pypi.python.org/pypi/carray)
"""
from .types import Variable, convert
import numpy as np
def to_numpy_array(*trees, branches=None, use_cache=False, cache_size=1000000):
# if branches is None the... | """
This module should handle:
* conversion of TTrees into NumPy arrays
* conversion of TTrees into carrays (http://pypi.python.org/pypi/carray)
"""
from .types import Variable, convert
import numpy as np
def to_numpy_array(tree, branches=None, use_cache=False, cache_size=1000000):
# if branches is None then ... | bsd-3-clause | Python |
e39409b6376c3d370a3affb166b0bbe8e1769629 | Make an explicit list for Python 3. | eliteraspberries/avena | avena/xcor2.py | avena/xcor2.py | #!/usr/bin/env python
'''Cross-correlation of image arrays'''
from numpy import (
multiply as _multiply,
ones as _ones,
sqrt as _sqrt,
zeros as _zeros,
)
from numpy.fft import (
fftshift as _fftshift,
ifftshift as _ifftshift,
rfft2 as _rfft2,
irfft2 as _irfft2,
)
from . import filter... | #!/usr/bin/env python
'''Cross-correlation of image arrays'''
from numpy import (
multiply as _multiply,
ones as _ones,
sqrt as _sqrt,
zeros as _zeros,
)
from numpy.fft import (
fftshift as _fftshift,
ifftshift as _ifftshift,
rfft2 as _rfft2,
irfft2 as _irfft2,
)
from . import filter... | isc | Python |
e5ac319a926b6cc81280f8e954badb3a8fb374d2 | Update utils.py | pathakvaidehi2391/WorkSpace,pathakvaidehi2391/WorkSpace | azure/utils.py | azure/utils.py | ########
# Copyright (c) 2015 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) 2015 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 |
b62cb22d4186be47924e241a373209d71a9b80ae | use path method from base Storage | masci/django-appengine-toolkit,masci/django-appengine-toolkit,masci/django-appengine-toolkit | appengine_toolkit/storage.py | appengine_toolkit/storage.py | from django.core.files.storage import Storage
from django.core.exceptions import ImproperlyConfigured, SuspiciousOperation
from django.utils import timezone
import os
import mimetypes
import cloudstorage
from google.appengine.ext import blobstore
from google.appengine.api import images
from .settings import appengin... | from django.core.files.storage import Storage
from django.core.exceptions import ImproperlyConfigured
from django.utils import timezone
import os
import mimetypes
import cloudstorage
from google.appengine.ext import blobstore
from google.appengine.api import images
from .settings import appengine_toolkit_settings
... | bsd-3-clause | Python |
ae38c24ecbd20a5fa6bc8cd0e101bb20c436412a | Fix main __init__ py instruction order (#887) | QISKit/qiskit-sdk-py,QISKit/qiskit-sdk-py,QISKit/qiskit-sdk-py | qiskit/__init__.py | qiskit/__init__.py | # -*- coding: utf-8 -*-
# Copyright 2017, IBM.
#
# This source code is licensed under the Apache License, Version 2.0 found in
# the LICENSE.txt file in the root directory of this source tree.
# pylint: disable=wrong-import-order
# pylint: disable=redefined-builtin
"""Main QISKit public functionality."""
import os
... | # -*- coding: utf-8 -*-
# Copyright 2017, IBM.
#
# This source code is licensed under the Apache License, Version 2.0 found in
# the LICENSE.txt file in the root directory of this source tree.
# pylint: disable=wrong-import-order
# pylint: disable=redefined-builtin
"""Main QISKit public functionality."""
import os
... | apache-2.0 | Python |
425adbd5f4dc475f4d3a7ce31f7df9ca1e6e3ba1 | check class format | doc212/theros,doc212/theros,doc212/theros,doc212/theros,doc212/theros | import.py | import.py | #!/usr/bin/env python
"""
A script to import initial data from ProEco into Theros
"""
import logging
import argparse
import sys
import re
parser=argparse.ArgumentParser(description=__doc__, formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument("worksFile", help="the csv file containing the raw w... | #!/usr/bin/env python
"""
A script to import initial data from ProEco into Theros
"""
import logging
import argparse
import sys
parser=argparse.ArgumentParser(description=__doc__, formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument("worksFile", help="the csv file containing the raw works expor... | mit | Python |
cb4c0cb2c35d97e0364a4c010715cdf15d261e4c | Add a method to get username if users have valid cookie | lttviet/udacity-final | basehandler.py | basehandler.py | # -*- conding: utf-8 -*-
import os
import jinja2
import webapp2
import utils
JINJA_ENV = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)),
autoescape=True)
class BaseHandler(webapp2.RequestHandler):
def render(self, template, **kw):
"""Method render t... | # -*- conding: utf-8 -*-
import os
import jinja2
import webapp2
import utils
JINJA_ENV = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)),
autoescape=True)
class BaseHandler(webapp2.RequestHandler):
def render(self, template, **kw):
"""Method render t... | mit | Python |
dd7f7b482bce0a6b9d412458ff24e5b4350cdd50 | fix admin import/export after refactor | batiste/django-page-cms,akaihola/django-page-cms,pombredanne/django-page-cms-1,remik/django-page-cms,batiste/django-page-cms,akaihola/django-page-cms,remik/django-page-cms,pombredanne/django-page-cms-1,akaihola/django-page-cms,remik/django-page-cms,remik/django-page-cms,batiste/django-page-cms,pombredanne/django-page-c... | pages/admin/actions.py | pages/admin/actions.py | from django.utils.translation import ugettext_lazy as _
from django.http import HttpResponse
from django.conf import settings as global_settings
from django.db import transaction
from django.shortcuts import redirect, render_to_response
from django.template import RequestContext
from pages import settings
from pages.h... | from django.utils.translation import ugettext_lazy as _
from django.http import HttpResponse
from django.conf import settings as global_settings
from django.db import transaction
from django.shortcuts import redirect, render_to_response
from django.template import RequestContext
from pages import settings
from pages.h... | bsd-3-clause | Python |
d33d7e5bf29d8c135c68eb5f1206d2f7df6f42ed | Add URL and description to search index of FoiRequest | catcosmo/froide,fin/froide,catcosmo/froide,fin/froide,ryankanno/froide,stefanw/froide,catcosmo/froide,okfse/froide,ryankanno/froide,ryankanno/froide,CodeforHawaii/froide,LilithWittmann/froide,okfse/froide,CodeforHawaii/froide,ryankanno/froide,stefanw/froide,LilithWittmann/froide,okfse/froide,fin/froide,okfse/froide,Cod... | froide/foirequest/search_indexes.py | froide/foirequest/search_indexes.py | from haystack import indexes
from haystack import site
from foirequest.models import FoiRequest
class FoiRequestIndex(indexes.SearchIndex):
text = indexes.EdgeNgramField(document=True, use_template=True)
title = indexes.CharField(model_attr='title')
description = indexes.CharField(model_attr='description... | from haystack import indexes
from haystack import site
from foirequest.models import FoiRequest
class FoiRequestIndex(indexes.SearchIndex):
text = indexes.EdgeNgramField(document=True, use_template=True)
title = indexes.CharField(model_attr='title')
status = indexes.CharField(model_attr='status')
fir... | mit | Python |
3bfe8ec4e10bef79b847d7c5930e0521b817dfb7 | remove SumIfMetric and CountIfMetric from __all__ | juiceinc/recipe | recipe/__init__.py | recipe/__init__.py | # -*- coding: utf-8 -*-
"""
Recipe
~~~~~~~~~~~~~~~~~~~~~
"""
import logging
from flapjack_stack import FlapjackStack
from recipe import default_settings
from recipe.core import Recipe
from recipe.exceptions import BadIngredient, BadRecipe
from recipe.ingredients import (
Dimension, DivideMetric, Filter, Having, I... | # -*- coding: utf-8 -*-
"""
Recipe
~~~~~~~~~~~~~~~~~~~~~
"""
import logging
from flapjack_stack import FlapjackStack
from recipe import default_settings
from recipe.core import Recipe
from recipe.exceptions import BadIngredient, BadRecipe
from recipe.ingredients import (
Dimension, DivideMetric, Filter, Having, I... | mit | Python |
2897320deed93f1d119751244abf80360c31b39c | Update __init__.py. | patrickbird/cachupy | cachupy/__init__.py | cachupy/__init__.py | from cachupy.cache import Cache
| mit | Python | |
b66efd2e15d044cd2fd3c7d305424e1b7260aa3a | Update lists.py | KouKariya/tic-tac-toe-py | ref/lists/lists.py | ref/lists/lists.py | #lists.py
#Written by Jesse Gallarzo
#run in Python3 otherwise change input to raw_input for python2
listOfNames = []
#A for loop that runs five times.
#For every iteration, the name variable gets added to the list until the loop stops.
for num in range(5):
name = input('Enter a name: ')
listOfNames.append(na... | #lists.py
#Written by Jesse Gallarzo
listOfNames = []
#A for loop that runs five times.
#For every iteration, the name variable gets added to the list until the loop stops.
for num in range(5):
name = input('Enter a name: ')
listOfNames.append(name)
print(listOfNames)
#For every value(num) within the list '... | mit | Python |
0d3750128e2c8363d48d68c1ca95fe7b0b7a9086 | add description of how to create custom types | mistermatti/plugz,mistermatti/plugz | plugz/plugintypes/standard_plugin_type.py | plugz/plugintypes/standard_plugin_type.py | from abc import abstractmethod
from plugz import PluginTypeBase
class StandardPluginType(PluginTypeBase):
""" Simple plugin type that requires an activate() method.
Plugins that derive from this type will have to implement
activate() or plugz will refuse to load the plugin.
The plugintype needs to b... | from abc import abstractmethod
from plugz import PluginTypeBase
class StandardPluginType(PluginTypeBase):
""" Simple plugin type that requires an activate() method. """
plugintype = 'StandardPluginType'
def __init__(self, ):
""" """
super(StandardPluginType).__init__(self)
@abstract... | bsd-3-clause | Python |
ffe41990bd0e06c8d2ac2edc640b77fa7229d044 | modify some print out information | imwithye/git-ignore,imwithye/git-ignore | git-ignore/git_ignore.py | git-ignore/git_ignore.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2014 Ciel, http://ciel.im
# Distributed under terms of the MIT license.
import sys
from git_ignore_add import git_ignore_add
from git_ignore_save import git_ignore_save
from git_ignore_list import git_ignore_list
from git_ignore_show import git_ignore_show
from g... | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2014 Ciel, http://ciel.im
# Distributed under terms of the MIT license.
import sys
from git_ignore_add import git_ignore_add
from git_ignore_save import git_ignore_save
from git_ignore_list import git_ignore_list
from git_ignore_show import git_ignore_show
from g... | mit | Python |
4c646128cfcb6d59445890c257447f01ed77a706 | Fix python syntax bug in update email fwd's script | tfiers/arenberg-online,tfiers/arenberg-online,tfiers/arenberg-online | core/management/update_email_forwards.py | core/management/update_email_forwards.py | # Virtual alias file syntax:
# email, space, email, (space, email, space, email,) newline, (repeat)
# Example:
# groep@arenbergorkest.be jef@gmail.com jos@hotmail.com
# jef@arenbergokest.be jef@gmail.com
# Catchall alias email = '@arenbergorkest.be'
from email_aliases import aliases
c = '' # New content of postfi... | # Virtual alias file syntax:
# email, space, email, (space, email, space, email,) newline, (repeat)
# Example:
# groep@arenbergorkest.be jef@gmail.com jos@hotmail.com
# jef@arenbergokest.be jef@gmail.com
# Catchall alias email = '@arenbergorkest.be'
from email_aliases import aliases
c = '' # New content of postfi... | mit | Python |
3ec923f4052bf7b66e5a694a1377124cc85f399c | Remove another unused test | jamesturk/tot,jamesturk/tot,jamesturk/tot,jamesturk/tot,jamesturk/tot | bills/tests.py | bills/tests.py | from django.test import override_settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from preferences.models import Preferences
@override_settings(STATICFILES_STORAGE='django.contrib.staticfiles.stor... | from django.test import override_settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from preferences.models import Preferences
@override_settings(STATICFILES_STORAGE='django.contrib.staticfiles.stor... | mit | Python |
6a5e113cd78a27abb5eb4c249998fde5dfb41a27 | fix visual indentation | CartoDB/carto-python,CartoDB/cartodb-python | carto/exceptions.py | carto/exceptions.py | """
Module for carto-python exceptions definitions
.. module:: carto.exceptions
:platform: Unix, Windows
:synopsis: Module for carto-python exceptions definitions
.. moduleauthor:: Daniel Carrion <daniel@carto.com>
.. moduleauthor:: Alberto Romeu <alrocar@carto.com>
"""
class CartoException(Exception):
... | """
Module for carto-python exceptions definitions
.. module:: carto.exceptions
:platform: Unix, Windows
:synopsis: Module for carto-python exceptions definitions
.. moduleauthor:: Daniel Carrion <daniel@carto.com>
.. moduleauthor:: Alberto Romeu <alrocar@carto.com>
"""
class CartoException(Exception):
... | bsd-3-clause | Python |
48f5f051c9dae382cf535b5067f4df539a5e01a4 | fix buildbucket property parsing | eunchong/build,eunchong/build,eunchong/build,eunchong/build | scripts/master/buildbucket/common.py | scripts/master/buildbucket/common.py | # Copyright 2015 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 datetime
import json
import logging
from twisted.python import log as twistedLog
LOG_PREFIX = '[buildbucket] '
# Buildbot-related constants.
BUILD_... | # Copyright 2015 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 datetime
import json
import logging
from twisted.python import log as twistedLog
LOG_PREFIX = '[buildbucket] '
# Buildbot-related constants.
BUILD_... | bsd-3-clause | Python |
8be03d5a8508c982f6626a5f756bdf267f3dbe6d | Update echo_bot.py | Cretezy/pymessenger2,davidchua/pymessenger,karlinnolabs/pymessenger | examples/echo_bot.py | examples/echo_bot.py | """
This bot listens to port 5002 for incoming connections from Facebook. It takes
in any messages that the bot receives and echos it back.
"""
from flask import Flask, request
from pymessenger.bot import Bot
app = Flask(__name__)
ACCESS_TOKEN = ""
VERIFY_TOKEN = ""
bot = Bot(ACCESS_TOKEN)
@app.route("/", methods=[... | """
This bot listens to port 5002 for incoming connections from Facebook. It takes
in any messages that the bot receives and echos it back.
"""
from flask import Flask, request
from pymessenger.bot import Bot
app = Flask(__name__)
ACCESS_TOKEN = ""
VERIFY_TOKEN = ""
bot = Bot(ACCESS_TOKEN)
@app.route("/", methods=[... | mit | Python |
624b3a9606c27076562ed522c919e480d72b86f9 | Allow passing multiple tokens to write() | edgedb/edgedb,edgedb/edgedb,edgedb/edgedb | edgedb/lang/common/ast/codegen.py | edgedb/lang/common/ast/codegen.py | ##
# Portions Copyright (c) 2008-2010 MagicStack Inc.
# Portions Copyright (c) 2008 Armin Ronacher.
# All rights reserved.
#
# This code is licensed under the PSFL license.
##
import itertools
from .visitor import NodeVisitor
class SourceGenerator(NodeVisitor):
"""This visitor is able to transform a well forme... | ##
# Portions Copyright (c) 2008-2010 MagicStack Inc.
# Portions Copyright (c) 2008 Armin Ronacher.
# All rights reserved.
#
# This code is licensed under the PSFL license.
##
from .visitor import NodeVisitor
class SourceGenerator(NodeVisitor):
"""This visitor is able to transform a well formed syntax tree into ... | apache-2.0 | Python |
f7611e37ef1e0dfaa568515be365d50b3edbd11c | Fix plugin import for astropy 2.x | astropy/ccdproc,mwcraig/ccdproc | ccdproc/conftest.py | ccdproc/conftest.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# this contains imports plugins that configure py.test for astropy tests.
# by importing them here in conftest.py they are discoverable by py.test
# no matter how it is invoked within the source tree.
import os
try:
from astropy.tests.plugins.displa... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# this contains imports plugins that configure py.test for astropy tests.
# by importing them here in conftest.py they are discoverable by py.test
# no matter how it is invoked within the source tree.
import os
try:
from astropy.tests.plugins.displa... | bsd-3-clause | Python |
f5daf719d9d358522feec212be5b538399faf4fd | Add missing Coore Actions (#116) | steve-bate/openhab2-jython | Core/automation/lib/python/core/actions.py | Core/automation/lib/python/core/actions.py | import sys
from core import osgi
__all__ = []
oh1_actions = osgi.find_services("org.openhab.core.scriptengine.action.ActionService", None) or []
oh2_actions = osgi.find_services("org.eclipse.smarthome.model.script.engine.action.ActionService", None) or []
_module = sys.modules[__name__]
for s in oh1_actions + oh2_a... | import sys
from core import osgi
__all__ = []
oh1_actions = osgi.find_services("org.openhab.core.scriptengine.action.ActionService", None) or []
oh2_actions = osgi.find_services("org.eclipse.smarthome.model.script.engine.action.ActionService", None) or []
_module = sys.modules[__name__]
for s in oh1_actions + oh2_a... | epl-1.0 | Python |
f340dfe4bad3685541050cb91a9cdce6808ad9a1 | remove call log | lite3/adbtool | adbtool/cmd.py | adbtool/cmd.py | #!/usr/bin/env python
# encoding=utf-8
import os
import sys
import shlex
import subprocess
import math
# return (output, isOk)
def call(cmd, printOutput=False):
# print("call %s" % cmd)
output = None
isOk = True
if sys.platform == 'win32':
args = cmd
else:
# linux must split argum... | #!/usr/bin/env python
# encoding=utf-8
import os
import sys
import shlex
import subprocess
import math
# return (output, isOk)
def call(cmd, printOutput=False):
print("call %s" % cmd)
output = None
isOk = True
if sys.platform == 'win32':
args = cmd
else:
# linux must split argumen... | mit | Python |
e410bad282d8129ed3099f1fa1edd09d82aaf77c | bump version [ci skip] | cenkalti/kuyruk,cenkalti/kuyruk | kuyruk/__init__.py | kuyruk/__init__.py | from __future__ import absolute_import
import logging
from kuyruk.kuyruk import Kuyruk
from kuyruk.worker import Worker
from kuyruk.task import Task
from kuyruk.config import Config
__version__ = '0.14.7'
try:
# not available in python 2.6
from logging import NullHandler
except ImportError:
class NullHan... | from __future__ import absolute_import
import logging
from kuyruk.kuyruk import Kuyruk
from kuyruk.worker import Worker
from kuyruk.task import Task
from kuyruk.config import Config
__version__ = '0.14.6'
try:
# not available in python 2.6
from logging import NullHandler
except ImportError:
class NullHan... | mit | Python |
ca82a17a51842e4631ba2e1d30cc76feede8e3eb | add def Overview | kaduuuken/achievementsystem,kaduuuken/achievementsystem | achievements/views.py | achievements/views.py | from django.http import HttpResponse
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.views.generic import ListView
from models import Category, Achievement, Trophies
import settings
def Overview(request):
category_list = Category.objects.filter(parent_category... | # Create your views here.
| bsd-2-clause | Python |
e669a86ab18331ec5a5f9d568cf9b3363bae7bb4 | Make dacapo harness time re private. | fhirschmann/penchy,fhirschmann/penchy | penchy/jobs/filters.py | penchy/jobs/filters.py | """
This module provides filters.
"""
import re
from pprint import pprint
from penchy.jobs.elements import Filter, SystemFilter
class Tamiflex(Filter):
pass
class HProf(Filter):
pass
class DacapoHarness(Filter):
"""
Filters output of a DaCapo Harness.
Inputs:
- ``stderr``: List of Path... | """
This module provides filters.
"""
import re
from pprint import pprint
from penchy.jobs.elements import Filter, SystemFilter
class Tamiflex(Filter):
pass
class HProf(Filter):
pass
class DacapoHarness(Filter):
"""
Filters output of a DaCapo Harness.
Inputs:
- ``stderr``: List of Path... | mit | Python |
aa27510776dec590b4acaa8104ae078664c0d96e | Add WrongInputException, signals that filter rcved invalid input. | fhirschmann/penchy,fhirschmann/penchy | penchy/jobs/filters.py | penchy/jobs/filters.py | """
This module provides filters.
"""
import re
from pprint import pprint
from penchy.jobs.elements import Filter, SystemFilter
class WrongInputError(Exception):
"""
Filter received input it was not expecting and cannot process.
"""
pass
class Tamiflex(Filter):
pass
class HProf(Filter):
... | """
This module provides filters.
"""
import re
from pprint import pprint
from penchy.jobs.elements import Filter, SystemFilter
class Tamiflex(Filter):
pass
class HProf(Filter):
pass
class DacapoHarness(Filter):
"""
Filters output of a DaCapo Harness.
Inputs:
- ``stderr``: List of Pat... | mit | Python |
3d283ff2eff893f3dee72cb53199a9a87c5f6e12 | Update SensorClasses.py | purduerov/X9-Core,purduerov/X9-Core,purduerov/X9-Core,purduerov/X9-Core,purduerov/X9-Core,purduerov/X9-Core | sensors/SensorClass/SensorClasses.py | sensors/SensorClass/SensorClasses.py | from Adafruit_BNO055 import BNO055
import logging
import sys
import time
# Create and configure the BNO sensor connection. Make sure only ONE of the
# below 'bno = ...' lines is uncommented:
# Raspberry Pi configuration with serial UART and RST connected to GPIO 18:
# if not bno.begin():
# raise RuntimeError('... | from Adafruit_BNO055 import BNO055
import logging
import sys
import time
# Create and configure the BNO sensor connection. Make sure only ONE of the
# below 'bno = ...' lines is uncommented:
# Raspberry Pi configuration with serial UART and RST connected to GPIO 18:
# BeagleBone Black configuration with default I2... | mit | Python |
64ec4e02fe84a729b6a25bcdbdaf7946c1922b5f | Add manage to admin tasks | RomanZWang/osf.io,mluke93/osf.io,kwierman/osf.io,felliott/osf.io,binoculars/osf.io,chennan47/osf.io,brianjgeiger/osf.io,asanfilippo7/osf.io,mluo613/osf.io,zamattiac/osf.io,emetsger/osf.io,caneruguz/osf.io,mfraezz/osf.io,brianjgeiger/osf.io,RomanZWang/osf.io,abought/osf.io,binoculars/osf.io,HalcyonChimera/osf.io,emetsge... | admin/tasks.py | admin/tasks.py | import os
from invoke import task, run
from website import settings
HERE = os.path.dirname(os.path.abspath(__file__))
@task()
def manage(*args):
"""Take arguments and run python manage
:param args: ex. runserver, migrate
"""
if os.getcwd() != HERE:
os.chdir(HERE)
env = 'DJANGO_SETTINGS_... | import os
from invoke import task, run
from website import settings
HERE = os.path.dirname(os.path.abspath(__file__))
@task()
def assets(dev=False, watch=False):
"""Install and build static assets for admin."""
if os.getcwd() != HERE:
os.chdir(HERE)
npm = 'npm install'
if not dev:
npm... | apache-2.0 | Python |
a80fe93110b5d0accbfa77d7dac7afe2df5a4688 | update module to v.3 l10n_it | dhp-denero/LibrERP,dhp-denero/LibrERP,odoousers2014/LibrERP,iw3hxn/LibrERP,dhp-denero/LibrERP,iw3hxn/LibrERP,dhp-denero/LibrERP,odoousers2014/LibrERP,iw3hxn/LibrERP,dhp-denero/LibrERP,iw3hxn/LibrERP,odoousers2014/LibrERP,odoousers2014/LibrERP,odoousers2014/LibrERP,iw3hxn/LibrERP | l10n_it/__openerp__.py | l10n_it/__openerp__.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010
# OpenERP Italian Community (<http://www.openerp-italia.org>)
# Servabit srl
# Agile Business Group sagl
# Domsense srl
# Albato... | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010
# OpenERP Italian Community (<http://www.openerp-italia.org>)
# Servabit srl
# Agile Business Group sagl
# Domsense srl
# Albato... | agpl-3.0 | Python |
5d948ab54bee6ce858b92190f885cbfe1c2203d6 | print tags in the right order | nearai/program_synthesis,nearai/program_synthesis | program_synthesis/algolisp/tools/timer.py | program_synthesis/algolisp/tools/timer.py | import collections
import time
def _print_tags(order, tags, counts={}):
result = ', '.join([
"%s=%.5f (%d)" % (tag, value, counts.get(tag, 0))
for tag, value in tags.items()
])
print(result)
class Timer(object):
def __init__(self):
self.tag_order = []
self.tags = coll... | import collections
import time
def _print_tags(tags, counts={}):
result = ', '.join([
"%s=%.5f (%d)" % (tag, value, counts.get(tag, 0))
for tag, value in tags.items()
])
print(result)
class Timer(object):
def __init__(self):
self.tags = collections.defaultdict(float)
... | apache-2.0 | Python |
478fa936cd1451405c11fac4ae8f960a4491b5e6 | handle all errors, format exceptions that were not caught | ceph/ceph-installer,ceph/mariner-installer,ceph/ceph-installer,ceph/ceph-installer | ceph_installer/cli/main.py | ceph_installer/cli/main.py | import sys
from tambo import Transport
import ceph_installer
from ceph_installer.cli import log
from ceph_installer.cli import dev, task
from ceph_installer.cli.decorators import catches
class CephInstaller(object):
_help = """
A command line utility to install and configure Ceph using an HTTP API as a REST serv... | import sys
from tambo import Transport
import ceph_installer
from ceph_installer.cli import log
from ceph_installer.cli import dev, task
from ceph_installer.cli.decorators import catches
class CephInstaller(object):
_help = """
A command line utility to install and configure Ceph using an HTTP API as a REST serv... | mit | Python |
381f8f11fb942ad672844c1828a624bd2638d8ae | Add config getter | viniciuschiele/central | configd/interpolation.py | configd/interpolation.py | """
Interpolator implementations.
"""
import re
from . import abc
from .exceptions import InterpolatorError
from .utils.compat import string_types, text_type
__all__ = [
'StrInterpolator',
]
class StrInterpolator(abc.StrInterpolator):
"""
A `abc.StrInterpolator` implementation that resolves a string
... | """
Interpolator implementations.
"""
import re
from . import abc
from .exceptions import InterpolatorError
from .utils.compat import string_types, text_type
__all__ = [
'StrInterpolator',
]
class StrInterpolator(abc.StrInterpolator):
"""
A `abc.StrInterpolator` implementation that resolves a string
... | mit | Python |
d46a5c47c667a3ba17e943687c40678cb639c45b | update GO obo-xml file date | OpenBEL/resource-generator | changelog_config.py | changelog_config.py | # coding: utf-8
'''
changelog_config.py
Configuration for the change-log script. Provides a
mapping for each dataset to its proper parser. Each
dataset is independant, and can be commented/uncommented
as desired by the user.
'''
from collections import OrderedDict
import parsers
changelog_data = OrderedDict()... | # coding: utf-8
'''
changelog_config.py
Configuration for the change-log script. Provides a
mapping for each dataset to its proper parser. Each
dataset is independant, and can be commented/uncommented
as desired by the user.
'''
from collections import OrderedDict
import parsers
changelog_data = OrderedDict()... | apache-2.0 | Python |
77302f755c6c9065d79048c2ff8e3a06cdb35f42 | resolve issue in "link", fix #174 | robinandeer/chanjo | chanjo/load/link.py | chanjo/load/link.py | # -*- coding: utf-8 -*-
from chanjo.store import Gene, Transcript
from .utils import get_or_build_exon, _exon_kwargs
def rows(session, row_data):
"""Handle rows of sambamba output."""
exons = (row(session, data) for data in row_data)
return exons
def row(session, data):
"""Link transcripts and gene... | # -*- coding: utf-8 -*-
from chanjo.store import Gene, Transcript
from .utils import get_or_build_exon
def rows(session, row_data):
"""Handle rows of sambamba output."""
exons = (row(session, data) for data in row_data)
return exons
def row(session, data):
"""Link transcripts and genes."""
# st... | mit | Python |
cb8a840e65beea7cfe55fdd98e5ce6881f9e11b3 | Update inline.py | francis-taylor/Timotty-Master | inline.py | inline.py | # -*- coding: utf-8 -*-
import json
def make_url(self):
keyboard = {}
add = []
for i in self:
add.append(i)
keyboard['inline_keyboard'] = add
return json.dumps(keyboard)
| # -*- coding: utf-8 -*-
import json
def make_url(self):
keyboard = {}
ia = []
for i in self:
ia.append(i)
keyboard['inline_keyboard'] = ia
return json.dumps(keyboard) | mit | Python |
ea99bdc94af28f9f8261c819eb131b465cda686f | add disambiguated data to invpat file | nikken1/patentprocessor,nikken1/patentprocessor,yngcan/patentprocessor,yngcan/patentprocessor,nikken1/patentprocessor,yngcan/patentprocessor,funginstitute/patentprocessor,funginstitute/patentprocessor,funginstitute/patentprocessor | get_invpat.py | get_invpat.py | from lib import alchemy
import pandas as pd
session_generator = alchemy.session_generator
session = session_generator()
#res = session.execute('select rawinventor.name_first, rawinventor.name_last, rawlocation.city, rawlocation.state, \
# rawlocation.country, rawinventor.sequence, patent.id, \
# ... | from lib import alchemy
import pandas as pd
session_generator = alchemy.session_generator
session = session_generator()
#res = session.execute('select rawinventor.name_first, rawinventor.name_last, rawlocation.city, rawlocation.state, \
# rawlocation.country, rawinventor.sequence, patent.id, \
# ... | bsd-2-clause | Python |
cde272222ef3889d6f9e92f9c3be32de0b661dfd | Add DeprecationWarning for tours when fetched | gadventures/gapipy | gapipy/resources/tour/tour.py | gapipy/resources/tour/tour.py | # Python 2 and 3
from __future__ import unicode_literals
import warnings
from ..base import Resource
from .departure import Departure
from .tour_dossier import TourDossier
class Tour(Resource):
_resource_name = 'tours'
_is_parent_resource = True
_as_is_fields = ['id', 'href', 'product_line']
_date_... | # Python 2 and 3
from __future__ import unicode_literals
from ..base import Resource
from .departure import Departure
from .tour_dossier import TourDossier
class Tour(Resource):
_resource_name = 'tours'
_is_parent_resource = True
_as_is_fields = ['id', 'href', 'product_line']
_date_fields = ['depar... | mit | Python |
420e5a12daf45841cce581e5359c5214e3e0895b | switch to generic GLSL attributes | laanwj/hw2view | visualize.py | visualize.py | from __future__ import division, print_function
from OpenGL.GL import *
from OpenGL.GL import shaders
from OpenGL.GLUT import *
from OpenGL.GLU import *
from parse_bg import parse_bg, PRIM_TRIANGLE_STRIP, PRIM_TRIANGLES
import time
window = 0
width, height = 500, 400
gl_types = {
PRIM_TRIANGLES: GL_TRIANGLES,
... | from __future__ import division, print_function
from OpenGL.GL import *
from OpenGL.GL import shaders
from OpenGL.GLUT import *
from OpenGL.GLU import *
from parse_bg import parse_bg, PRIM_TRIANGLE_STRIP, PRIM_TRIANGLES
import time
window = 0
width, height = 500, 400
gl_types = {
PRIM_TRIANGLES: GL_TRIANGLES,
... | mit | Python |
5366c1c61062ee5c83f82a1b4db36b9da56e15b4 | Fix to updateOrgs.py | yangle/HaliteIO,HaliteChallenge/Halite-II,lanyudhy/Halite-II,lanyudhy/Halite-II,HaliteChallenge/Halite,yangle/HaliteIO,yangle/HaliteIO,lanyudhy/Halite-II,yangle/HaliteIO,HaliteChallenge/Halite-II,HaliteChallenge/Halite,yangle/HaliteIO,lanyudhy/Halite-II,HaliteChallenge/Halite,HaliteChallenge/Halite-II,HaliteChallenge/H... | admin/updateOrgs.py | admin/updateOrgs.py | import configparser
import pymysql
import urllib.request
parser = configparser.ConfigParser()
parser.read("../halite.ini")
DB_CONFIG = parser["database"]
db = pymysql.connect(host=DB_CONFIG["hostname"], user=DB_CONFIG['username'], passwd=DB_CONFIG['password'], db=DB_CONFIG['name'], cursorclass=pymysql.cursors.DictC... | import configparser
import pymysql
import urllib.request
parser = configparser.ConfigParser()
parser.read("../halite.ini")
DB_CONFIG = parser["database"]
db = pymysql.connect(host=DB_CONFIG["hostname"], user=DB_CONFIG['username'], passwd=DB_CONFIG['password'], db=DB_CONFIG['name'], cursorclass=pymysql.cursors.DictC... | mit | Python |
3c3e7a68b3fd2f8c600995c4fb65a3ebaf7ef2f5 | Allow auth_strategy to be toggled | kickstandproject/ripcord | ripcord/api/app.py | ripcord/api/app.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# -*- encoding: utf-8 -*-
# Copyright © 2012 New Dream Network, LLC (DreamHost)
# Copyright (C) 2013 PolyBeacon, 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 cop... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# -*- encoding: utf-8 -*-
# Copyright © 2012 New Dream Network, LLC (DreamHost)
# Copyright (C) 2013 PolyBeacon, 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 cop... | apache-2.0 | Python |
acfffbacde7e09c5d0edf2aef7cdb72b9e39a500 | update init file to recognize myconfig | okkhoy/minecraft-rl | rlglue/__init__.py | rlglue/__init__.py | mit | Python | ||
5625fe9b09dad59b4500c7b3f455db8658d1f5a2 | Add 2016nano. | mjs/juju,mjs/juju,mjs/juju,mjs/juju,mjs/juju,mjs/juju,mjs/juju | agent_paths.py | agent_paths.py | #!/usr/bin/env python3
from argparse import ArgumentParser
import json
import os.path
import re
import sys
from simplestreams.generate_simplestreams import json_dump
def main():
parser = ArgumentParser()
parser.add_argument('input')
parser.add_argument('output')
args = parser.parse_args()
paths_h... | #!/usr/bin/env python3
from argparse import ArgumentParser
import json
import os.path
import re
import sys
from simplestreams.generate_simplestreams import json_dump
def main():
parser = ArgumentParser()
parser.add_argument('input')
parser.add_argument('output')
args = parser.parse_args()
paths_h... | agpl-3.0 | Python |
f380b886b5461a21de73175eedd019c2237d457a | Fix payment config page | pferreir/indico,mvidalgarcia/indico,ThiefMaster/indico,mic4ael/indico,DirkHoffmann/indico,mvidalgarcia/indico,pferreir/indico,OmeGak/indico,mvidalgarcia/indico,indico/indico,indico/indico,ThiefMaster/indico,DirkHoffmann/indico,mic4ael/indico,OmeGak/indico,OmeGak/indico,DirkHoffmann/indico,ThiefMaster/indico,mvidalgarci... | indico/modules/payment/views.py | indico/modules/payment/views.py | # This file is part of Indico.
# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | # This file is part of Indico.
# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | mit | Python |
db2ed7a6b2686290e237286b2eeb6ac759cfd204 | fix migration | joehand/DataNews,joehand/DataNews | alembic/env.py | alembic/env.py | from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
from data_news import app
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
config.set_ma... | from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
from data_news import app
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
config.set_ma... | bsd-3-clause | Python |
993d6be40e11121609b7e9592956e1060a0cb6f7 | Fix "ImportError: No module named application" | fert89/prueba-3-heroku-flask,Agreste/MobUrbRoteiro,Agreste/MobUrbRoteiro,san-bil/astan,Agreste/MobUrbRoteiro,albertogg/flask-bootstrap-skel,akhilaryan/clickcounter,fert89/prueba-3-heroku-flask,san-bil/astan,san-bil/astan,san-bil/astan | alembic/env.py | alembic/env.py | from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
import sys
import os.path
sys.path.append(
os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)))
from application import app, db
# this ... | from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
from application import app, db
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Ov... | bsd-3-clause | Python |
4d0ef33c43b0ef3d23f0c7991a86c1c08d486b43 | remove unused import | crateio/crate.web,crateio/crate.web,dstufft/jutils | crate_project/apps/packages/templatetags/package_tags.py | crate_project/apps/packages/templatetags/package_tags.py | from django import template
from django.db.models import F, Sum
from packages.models import Package, Release, ReleaseFile
register = template.Library()
@register.assignment_tag
def package_download_count(package_name=None):
# @@@ Cache this to cut down on queries
count = 0
if package_name is None:
... | import datetime
from django import template
from django.db.models import F, Sum
from packages.models import Package, Release, ReleaseFile
register = template.Library()
@register.assignment_tag
def package_download_count(package_name=None):
# @@@ Cache this to cut down on queries
count = 0
if package_na... | bsd-2-clause | Python |
6bc3454bb647a4fc49f8be85adf64ec7eaac0a47 | Update acceptance.py | pmutale/www.mutale.nl,pmutale/www.mutale.nl,pmutale/www.mutale.nl | settings/labels/mutale/acceptance.py | settings/labels/mutale/acceptance.py | from settings.labels.mutale.base import *
from themes.secrets import read_mailpass
DEBUG = False
ALLOWED_HOSTS = ['mutale.herokuapp.com', '127.0.0.1', 'localhost', 'mutale-dev-a.herokuapp.com',
'mutale-prd.herokuapp.com', 'stick2uganda.mutale.nl']
DATABASES = {
'default':
read_pgpass('dc... | from settings.labels.mutale.base import *
import dj_database_url
from themes import secrets
DEBUG = False
ALLOWED_HOSTS = ['mutale.herokuapp.com',
'127.0.0.1', 'localhost',
'mutale-acc.herokuapp.com',
'mutale-dev.herokuapp.com']
DATABASE_URL = 'postgres://oogcsuzgf... | unlicense | Python |
b4cb77fb0f3215190779c390218ecbd03ae506e8 | Add docstrings | robbie-c/git-lang-guesser | git-lang-guesser/guess_lang.py | git-lang-guesser/guess_lang.py | from collections import Counter
LANGUAGE_KEY = "language"
def count_languages(repos, filter_none=True):
"""
Count the occurances of each language in a list of repositories
:param repos: A list of repositories, which should be dictionaries with a "language" key
:param filter_none: Whether to ignore ... | from collections import Counter
LANGUAGE_KEY = "language"
def count_languages(repos, filter_none=True):
langs = (repo.get(LANGUAGE_KEY, None) for repo in repos)
# filter out None
if filter_none:
langs = filter(lambda x: x is not None, langs)
# a Counter does all the heavy lifting for us
... | mit | Python |
1ff7d8ecc964a99278a5511f45a66b7d55654395 | Fix thanks to Joel for spotting it | bliksemlabs/rrrr | web-uwsgi.py | web-uwsgi.py | import uwsgi
import zmq
import struct
COMMON_HEADERS = [('Content-Type', 'application/json'), ('Access-Control-Allow-Origin', '*'), ('Access-Control-Allow-Headers', 'Requested-With,Content-Type')]
context = zmq.Context()
def light(environ, start_response):
if environ['PATH_INFO'] in ['/favicon.ico']:
sta... | import uwsgi
import zmq
import struct
COMMON_HEADERS = [('Content-Type', 'application/json'), ('Access-Control-Allow-Origin', '*'), ('Access-Control-Allow-Headers', 'Requested-With,Content-Type')]
context = zmq.Context()
def light(environ, start_response):
if environ['PATH_INFO'] in ['/favicon.ico']:
sta... | bsd-2-clause | Python |
bb434f82f0883f2a85992f6b41a042d08ddb6449 | Update __init__.py | anuragpapineni/Hearthbreaker-evolved-agent,anuragpapineni/Hearthbreaker-evolved-agent,jirenz/CS229_Project,slaymaker1907/hearthbreaker,pieiscool/edited-hearthbreaker,noa/hearthbreaker,danielyule/hearthbreaker,kingoflolz/hearthbreaker,anuragpapineni/Hearthbreaker-evolved-agent,pieiscool/edited-hearthbreaker,Ragowit/hear... | hsgame/cards/minions/__init__.py | hsgame/cards/minions/__init__.py | __author__ = 'Daniel'
from hsgame.cards.minions.neutral import (
BloodfenRaptor,
IronbeakOwl,
NoviceEngineer,
StonetuskBoar,
WarGolem,
MogushanWarden,
OasisSnapjaw,
FaerieDragon,
KoboldGeomancer,
ElvenArcher,
IronfurGrizzly,
ArgentSquire,
SilvermoonGuardian,
Twil... | __author__ = 'Daniel'
from hsgame.cards.minions.neutral import (
BloodfenRaptor,
IronbeakOwl,
NoviceEngineer,
StonetuskBoar,
WarGolem,
MogushanWarden,
OasisSnapjaw,
FaerieDragon,
KoboldGeomancer,
ElvenArcher,
IronfurGrizzly,
ArgentSquire,
SilvermoonGuardian,
Twil... | mit | Python |
03ea65721a2a0979c6b42dfcec8737f9f438d6f0 | Bump to version 0.11.0 (#212) | gaopeiliang/aiodocker,gaopeiliang/aiodocker,gaopeiliang/aiodocker,barrachri/aiodocker,barrachri/aiodocker,paultag/aiodocker,barrachri/aiodocker | aiodocker/__init__.py | aiodocker/__init__.py | from .docker import Docker
__version__ = '0.11.0'
__all__ = ("Docker", )
| from .docker import Docker
__version__ = '0.11.0a0'
__all__ = ("Docker", )
| mit | Python |
85269dda0369f1575ffaddee83cd63c5d468e3b2 | remove debug | sk2/autonetkit | autonetkit/plugins/naming.py | autonetkit/plugins/naming.py | def network_hostname(node):
print "%s_%s" % (node.Network, node.label)
return "%s_%s" % (node.Network, node.label)
| def network_hostname(node):
print node.dump()
print "%s_%s" % (node.Network, node.label)
return "%s_%s" % (node.Network, node.label)
| bsd-3-clause | Python |
620d2b04f6632779cb0015558bcab035a3aefecd | support config_local.py | hades/chukchi,hades/chukchi | chukchi/config/__init__.py | chukchi/config/__init__.py | # This file is part of Chukchi, the free web-based RSS aggregator
#
# Copyright (C) 2013 Edward Toroshchin <chukchi-project@hades.name>
#
# Chukchi is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, eith... | # This file is part of Chukchi, the free web-based RSS aggregator
#
# Copyright (C) 2013 Edward Toroshchin <chukchi-project@hades.name>
#
# Chukchi is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, eith... | agpl-3.0 | Python |
0f3ce188fee12c07dbd56aa6a459c04b5ed07778 | update to execute headder | mfasq1Monash/FIT3140 | robotcontroller.py | robotcontroller.py | '''
Author: Michael Asquith, Aaron Gruneklee
Created: 2014.12.12
Last Modified: 2014.12.23
The brain of the robot. Has access to the robot's I/O, interpreter and
instructions
'''
from interpreter import Interpreter
from robotio import RobotIO
from codeblock import CodeBlock
from maze import Maze
class RobotControll... | '''
Author: Michael Asquith, Aaron Gruneklee
Created: 2014.12.12
Last Modified: 2014.12.23
The brain of the robot. Has access to the robot's I/O, interpreter and
instructions
'''
from interpreter import Interpreter
from robotio import RobotIO
from codeblock import CodeBlock
from maze import Maze
class RobotControll... | mit | Python |
dd78f68ed0e6dcecc66f1b87972f73f887edfb3e | Add exception handling | globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service | dbaas/integrations/monitoring/manager.py | dbaas/integrations/monitoring/manager.py | from dbaas_dbmonitor.provider import DBMonitorProvider
from dbaas_zabbix.provider import ZabbixProvider
import logging
LOG = logging.getLogger(__name__)
class MonitoringManager():
@classmethod
def create_monitoring(cls, databaseinfra):
try:
LOG.info("Creating monitoring...")
... | from dbaas_dbmonitor.provider import DBMonitorProvider
from dbaas_zabbix.provider import ZabbixProvider
import logging
LOG = logging.getLogger(__name__)
class MonitoringManager():
@classmethod
def create_monitoring(cls, databaseinfra):
LOG.info("Creating monitoring...")
ZabbixProvider().c... | bsd-3-clause | Python |
32db10f40693d5ace65226c46b0f67d75045e440 | Bump version to 0.2.2 | jreese/aiosqlite | aiosqlite/__init__.py | aiosqlite/__init__.py | # Copyright 2017 John Reese
# Licensed under the MIT license
'''asyncio bridge to sqlite3'''
from sqlite3 import sqlite_version, sqlite_version_info
from .core import connect, Connection, Cursor
__version__ = '0.2.2'
__all__ = [
'__version__',
'sqlite_version',
'sqlite_version_info',
'connect',
... | # Copyright 2017 John Reese
# Licensed under the MIT license
'''asyncio bridge to sqlite3'''
from sqlite3 import sqlite_version, sqlite_version_info
from .core import connect, Connection, Cursor
__version__ = '0.2.0'
__all__ = [
'__version__',
'sqlite_version',
'sqlite_version_info',
'connect',
... | mit | Python |
6be7a88edf0cff942236799907c177775041a349 | Fix flake8 errors | albertyw/albertyw.com,albertyw/albertyw.com,albertyw/albertyw.com,albertyw/albertyw.com,albertyw/albertyw.com | albertyw.com/utils.py | albertyw.com/utils.py | import datetime
import os
import dotenv
from getenv import env
import markdown2
import pytz
root_path = os.path.dirname(os.path.realpath(__file__)) + '/../'
dotenv.read_dotenv(os.path.join(root_path, '.env'))
# See https://github.com/trentm/python-markdown2/wiki/Extras
MARKDOWN_EXTRAS = [
'code-friendly',
'f... | import datetime
import os
import dotenv
from getenv import env
import markdown2
import pytz
root_path = os.path.dirname(os.path.realpath(__file__)) + '/../'
dotenv.read_dotenv(os.path.join(root_path, '.env'))
# See https://github.com/trentm/python-markdown2/wiki/Extras
MARKDOWN_EXTRAS = [
'code-friendly',
'f... | mit | Python |
f4a123f1bdc02df483ff0c199625be9d17b1d32a | fix override of logging methods | Nic30/HWToolkit | hwt/simulator/vcdHdlSimConfig.py | hwt/simulator/vcdHdlSimConfig.py | from datetime import datetime
from pprint import pprint
import sys
from hwt.hdlObjects.types.bits import Bits
from hwt.hdlObjects.types.boolean import Boolean
from hwt.simulator.hdlSimConfig import HdlSimConfig
from hwt.simulator.vcdWritter import VcdWritter
from hwt.hdlObjects.types.enum import Enum
class VcdHdlSim... | from datetime import datetime
from pprint import pprint
import sys
from hwt.hdlObjects.types.bits import Bits
from hwt.hdlObjects.types.boolean import Boolean
from hwt.simulator.hdlSimConfig import HdlSimConfig
from hwt.simulator.vcdWritter import VcdWritter
from hwt.hdlObjects.types.enum import Enum
class VcdHdlSim... | mit | Python |
f929d80c5a4363994968248d87a892b1c2ef61d4 | Use actual sha for static:debug image (and update static:latest) (#1804) | bazelbuild/rules_docker,bazelbuild/rules_docker,bazelbuild/rules_docker,bazelbuild/rules_docker | go/static.bzl | go/static.bzl | # Copyright 2017 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 2017 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 |
f294fe77e30298aa606fe603a8c8851c0120b283 | make integrate work on bulk data | yngcan/patentprocessor,nikken1/patentprocessor,nikken1/patentprocessor,funginstitute/patentprocessor,yngcan/patentprocessor,funginstitute/patentprocessor,nikken1/patentprocessor,funginstitute/patentprocessor,yngcan/patentprocessor | integrate.py | integrate.py | #!/usr/bin/env python
"""
Takes in a CSV file that represents the output of the disambiguation engine:
Patent Number, Firstname, Lastname, Unique_Inventor_ID
Groups by Unique_Inventor_ID and then inserts them into the Inventor table using
lib.alchemy.match
"""
import sys
import lib.alchemy as alchemy
from lib.util.c... | #!/usr/bin/env python
"""
Takes in a CSV file that represents the output of the disambiguation engine:
Patent Number, Firstname, Lastname, Unique_Inventor_ID
Groups by Unique_Inventor_ID and then inserts them into the Inventor table using
lib.alchemy.match
"""
import sys
import lib.alchemy as alchemy
from lib.util.c... | bsd-2-clause | Python |
ec785103f7dcc2df8ee31acb1325c2181f65698c | bump version to 3.1.0 | ndawe/root_numpy,ibab/root_numpy,ibab/root_numpy,ndawe/root_numpy,rootpy/root_numpy,ndawe/root_numpy,ibab/root_numpy,scikit-hep/root_numpy,scikit-hep/root_numpy,ndawe/root_numpy,rootpy/root_numpy,rootpy/root_numpy,scikit-hep/root_numpy,rootpy/root_numpy,scikit-hep/root_numpy,ibab/root_numpy | root_numpy/info.py | root_numpy/info.py | """
_
_ __ ___ ___ | |_ _ __ _ _ _ __ ___ _ __ _ _
| '__/ _ \ / _ \| __| | '_ \| | | | '_ ` _ \| '_ \| | | |
| | | (_) | (_) | |_ | | | | |_| | | | | | | |_) | |_| |
|_| \___/ \___/ \__|___|_| |_|\__,_|_| |_| |_| .__/ \__, | {0}
|_____| |_| ... | """
_
_ __ ___ ___ | |_ _ __ _ _ _ __ ___ _ __ _ _
| '__/ _ \ / _ \| __| | '_ \| | | | '_ ` _ \| '_ \| | | |
| | | (_) | (_) | |_ | | | | |_| | | | | | | |_) | |_| |
|_| \___/ \___/ \__|___|_| |_|\__,_|_| |_| |_| .__/ \__, | {0}
|_____| |_| ... | bsd-3-clause | Python |
ec74d02b09b110df2a4e7be20e9b852a77771c8d | Create form to create Professor | mazulo/simplemooc,mazulo/simplemooc | simplemooc/accounts/forms.py | simplemooc/accounts/forms.py | from django import forms
# from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth import get_user_model
from simplemooc.core.utils import generate_hash_key
from simplemooc.core.mail import send_mail_template
from simplemooc.accounts.models import PasswordReset, Professor
User = get_user_model... | from django import forms
# from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth import get_user_model
from simplemooc.core.utils import generate_hash_key
from simplemooc.core.mail import send_mail_template
from simplemooc.accounts.models import PasswordReset
User = get_user_model()
class ... | mit | Python |
624baee346bbb24d06b25e3f7c07ef8138dda174 | Remove unused imports from vyconf.types.dummy | vyos-legacy/vyconfd,vyos-legacy/vyconfd | libraries/vyconf/types/dummy/dummy.py | libraries/vyconf/types/dummy/dummy.py | # vyconf.types.dummy: dummy type validators for demonstration and testing
#
# 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 Free Software Founda... | # vyconf.types.dummy: dummy type validators for demonstration and testing
#
# 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 Free Software Founda... | lgpl-2.1 | Python |
81e68ca702e4b6ef559bf034033817475a0b4bdc | add StaticApplication to root package | kezabelle/clastic,kezabelle/clastic | clastic/__init__.py | clastic/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
clastic
~~~~~~~
A functional Python web framework that streamlines explicit
development practices while eliminating global state.
:copyright: (c) 2012 by Mahmoud Hashemi
:license: BSD, see LICENSE for more details.
"""
import server
from cor... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
clastic
~~~~~~~
A functional Python web framework that streamlines explicit
development practices while eliminating global state.
:copyright: (c) 2012 by Mahmoud Hashemi
:license: BSD, see LICENSE for more details.
"""
import server
from cor... | bsd-3-clause | Python |
59e31ecf0e23eadfb064baf1e50269795e1ecd45 | test times | tschaume/pymatgen,vorwerkc/pymatgen,czhengsci/pymatgen,fraricci/pymatgen,gVallverdu/pymatgen,vorwerkc/pymatgen,mbkumar/pymatgen,setten/pymatgen,montoyjh/pymatgen,tallakahath/pymatgen,johnson1228/pymatgen,montoyjh/pymatgen,blondegeek/pymatgen,setten/pymatgen,davidwaroquiers/pymatgen,Bismarrck/pymatgen,johnson1228/pymatg... | pymatgen/io/gwwrapper/tests/test_times.py | pymatgen/io/gwwrapper/tests/test_times.py | #!/usr/bin/env python
__author__ = 'setten'
import timeit
import os
def test_write():
"""file write test function"""
l = []
for i in range(100000):
l.append(i)
f = open('test', 'w')
f.write(str(l))
f.close()
def test_read():
f = open('test', mode='r')
line = f.read()
f.... | #!/usr/bin/env python
__author__ = 'setten'
import timeit
import os
def test_write():
"""file write test function"""
l = []
for i in range(100000):
l.append(i)
f = open('test', 'w')
f.write(str(l))
f.close()
def test_read():
f = open('test', mode='r')
line = f.read()
f.... | mit | Python |
6c0949c50ab5b7b2ca6e26a48cb6f53866f82d0a | Update gettlds.py helper script | moreati/python3-openid,necaris/python3-openid,moreati/python3-openid,misli/python3-openid,necaris/python3-openid,moreati/python3-openid,isagalaev/sm-openid,misli/python3-openid,misli/python3-openid | admin/gettlds.py | admin/gettlds.py | #!/usr/bin/env python3
"""
Fetch the current TLD list from the IANA Web site, parse it, and print
an expression suitable for direct insertion into each library's trust
root validation module.
Usage:
python gettlds.py (php|python|ruby)
Then cut-n-paste.
"""
import urllib.request
import sys
LANGS = {
'php': (
... | """
Fetch the current TLD list from the IANA Web site, parse it, and print
an expression suitable for direct insertion into each library's trust
root validation module
Usage:
python gettlds.py (php|python|ruby)
Then cut-n-paste.
"""
import urllib2
import sys
langs = {
'php': (r"'/\.(",
"'", "|", ... | apache-2.0 | Python |
67ce14f2c3650033714461ef95c38a54c6817a2a | add tests | dswah/pyGAM | pygam/tests/test_GAM_params.py | pygam/tests/test_GAM_params.py | # -*- coding: utf-8 -*-
import numpy as np
import pytest
from pygam import *
def test_lam_non_neg_array_like(cake_X_y):
"""
lambda must be a non-negative float or array of floats
"""
X, y = cake_X_y
try:
gam = LinearGAM(lam=-1).fit(X, y)
except ValueError:
assert(True)
... | # -*- coding: utf-8 -*-
import numpy as np
import pytest
from pygam import *
def test_lam_non_neg_array_like(cake_X_y):
"""
lambda must be a non-negative float or array of floats
"""
X, y = cake_X_y
try:
gam = LinearGAM(lam=-1).fit(X, y)
except ValueError:
assert(True)
... | apache-2.0 | Python |
3b0c721afbe8b8d86174378fea4b81fc2dc24aba | Include subsecond ticking times | cropleyb/pentai,cropleyb/pentai,cropleyb/pentai | gui_player.py | gui_player.py |
from kivy.clock import Clock
import time
import audio as a_m
from defines import *
class GuiPlayer(object):
def __init__(self, colour, widget, game):
self.colour = colour
self.player = game.get_player(colour)
self.widget = widget
self.game = game
total_time = game.get_tota... |
from kivy.clock import Clock
import audio as a_m
from defines import *
class GuiPlayer(object):
def __init__(self, colour, widget, game):
self.colour = colour
self.player = game.get_player(colour)
self.widget = widget
self.game = game
total_time = game.get_total_time()
... | mit | Python |
be759ce3ae4843a6b14e6d9883f38c6175ec5691 | Change regex to make it </path> inclusive | JWDebelius/American-Gut,wasade/American-Gut,biocore/American-Gut,EmbrietteH/American-Gut,JWDebelius/American-Gut,mortonjt/American-Gut,EmbrietteH/American-Gut,cuttlefishh/American-Gut,wasade/American-Gut,biocore/American-Gut | americangut/format.py | americangut/format.py | #!/usr/bin/env python
__author__ = "Yoshiki Vazquez Baeza"
__copyright__ = "Copyright 2013, The American Gut Project"
__credits__ = ["Yoshiki Vazquez Baeza", "Adam Robbins-Pianka"]
__license__ = "BSD"
__version__ = "unversioned"
__maintainer__ = "Yoshiki Vazquez Baeza"
__email__ = "yoshiki.vazquezbaeza@colorado.edu"
... | #!/usr/bin/env python
__author__ = "Yoshiki Vazquez Baeza"
__copyright__ = "Copyright 2013, The American Gut Project"
__credits__ = ["Yoshiki Vazquez Baeza"]
__license__ = "BSD"
__version__ = "unversioned"
__maintainer__ = "Yoshiki Vazquez Baeza"
__email__ = "yoshiki.vazquezbaeza@colorado.edu"
from re import compile,... | bsd-3-clause | Python |
6303224fe1d61bf60908d80d9c93ca500dcf652e | add pool info | N0stack/tora,N0stack/tora | src/info/pool.py | src/info/pool.py | # coding: UTF-8
import libvirt
from xml.dom import minidom
from kvmconnect.base import BaseReadOnly
class PoolInfo(BaseReadOnly):
"""
Show Storage Pool's information
"""
def __init__(self):
super().__init__()
# Show storage pool's information
def get_pool_info_all(self):
stora... | # coding: UTF-8
import libvirt
from xml.dom import minidom
from kvmconnect.base import BaseReadOnly
class PoolInfo(BaseReadOnly):
"""
Show Storage Pool's information
"""
def __init__(self):
super().__init__()
# Show storage pool's information
def get_pool_info_all(self):
stora... | mit | Python |
7d3a45afec5a02608e5ec198fcf9d4b0f6cbd437 | Remove CSRF protection from tests | hizardapp/Hizard,hizardapp/Hizard,hizardapp/Hizard | hyrodactil/hyrodactil/settings/test.py | hyrodactil/hyrodactil/settings/test.py | from base import *
########## TEST SETTINGS
TEST_RUNNER = 'discover_runner.DiscoverRunner'
TEST_DISCOVER_TOP_LEVEL = SITE_ROOT
TEST_DISCOVER_ROOT = join(SITE_ROOT, "tests")
# Default is test*.py
TEST_DISCOVER_PATTERN = "*"
MIDDLEWARE_CLASSES = (
# Default Django middleware.
'django.middleware.common.CommonMid... | from base import *
########## TEST SETTINGS
TEST_RUNNER = 'discover_runner.DiscoverRunner'
TEST_DISCOVER_TOP_LEVEL = SITE_ROOT
TEST_DISCOVER_ROOT = join(SITE_ROOT, "tests")
# Default is test*.py
TEST_DISCOVER_PATTERN = "*"
########## IN-MEMORY TEST DATABASE
DATABASES = {
"default": {
"ENGINE": "django.db.... | mit | Python |
84c5d376997f0db55ce1a458c3c1b5d5b0aa8442 | fix bug in webserver | zhemao/lerner,zhemao/lerner | webserver.py | webserver.py | #!/usr/bin/env python
from flask import Flask, request
from gevent import monkey; monkey.patch_socket()
from gevent.wsgi import WSGIServer
import redis
ps = redis.StrictRedis().pubsub()
app = Flask(__name__)
@app.route('/github', methods=['POST'])
def github():
payload = request.form['payload']
owner = payl... | #!/usr/bin/env python
from flask import Flask, request
from gevent import monkey; monkey.patch_socket()
from gevent.wsgi import WSGIServer
import redis
ps = redis.StrictRedis().pubsub()
app = Flask(__name__)
@app.route('/github', methods=['POST'])
def github():
payload = request.POST['payload']
owner = payl... | mit | Python |
e39f2243cd596da8558a7e83364d55a16c332f67 | Fix setting access | dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq | corehq/sql_db/routers.py | corehq/sql_db/routers.py | from django.conf import settings
from .config import PartitionConfig
PROXY_APP = 'sql_proxy_accessors'
FORM_PROCESSOR_APP = 'form_processor'
SQL_ACCESSORS_APP = 'sql_accessors'
ICDS_REPORTS_APP = 'icds_reports'
class PartitionRouter(object):
def db_for_read(self, model, **hints):
return db_for_read_wri... | from django.conf import settings
from .config import PartitionConfig
PROXY_APP = 'sql_proxy_accessors'
FORM_PROCESSOR_APP = 'form_processor'
SQL_ACCESSORS_APP = 'sql_accessors'
ICDS_REPORTS_APP = 'icds_reports'
class PartitionRouter(object):
def db_for_read(self, model, **hints):
return db_for_read_wri... | bsd-3-clause | Python |
4fbb9020bcd280f70f9905886cdf2ec3d581f1ed | Update loggers configuration | ONSdigital/eq-survey-runner,ONSdigital/eq-survey-runner,ONSdigital/eq-survey-runner,ONSdigital/eq-survey-runner | application.py | application.py | #!/usr/bin/env python
import os
from app import create_app
from flask.ext.script import Manager, Server
import watchtower
import logging
application = create_app(
os.getenv('EQ_ENVIRONMENT') or 'development'
)
application.debug = True
manager = Manager(application)
port = int(os.environ.get('PORT', 5000))
manage... | #!/usr/bin/env python
import os
from app import create_app
from flask.ext.script import Manager, Server
import watchtower
import logging
application = create_app(
os.getenv('EQ_ENVIRONMENT') or 'development'
)
application.debug = True
manager = Manager(application)
port = int(os.environ.get('PORT', 5000))
manage... | mit | Python |
d11f95b356ef8f53d063c4196a84b1de38a8ea00 | fix name of info.pool | N0stack/tora,N0stack/tora | src/info/pool.py | src/info/pool.py | # coding: UTF-8
import libvirt
from xml.dom import minidom
from kvmconnect.base import BaseReadOnly
class PoolInfo(BaseReadOnly):
"""
Show Storage Pool's information
"""
def __init__(self):
super().__init__()
# Show storage pool's information
def get_pool_info_all(self):
stora... | # coding: UTF-8
import libvirt
from xml.dom import minidom
from kvmconnect.base import BaseReadOnly
class PoolInfo(BaseReadOnly):
"""
Show Storage Pool's information
"""
def __init__(self):
super().__init__()
# Show storage pool's information
def get_storage_info_all(self):
st... | mit | Python |
abbbc5eb7ea0c49868631af5ce5bb2502bae46ed | Change name of pandas letor converter | jma127/pyltr,jma127/pyltr | pyltr/data/pandas_converter.py | pyltr/data/pandas_converter.py | import pandas as pd
class PandasLetorConverter(object):
'''
Class Converter implements parsing from original letor txt files to
pandas data frame representation.
'''
def __init__(self, path):
'''
Arguments:
path: path to letor txt file
'''
self._path = ... | import pandas as pd
class Pandas_Converter(object):
'''
Class Converter implements parsing from original letor txt files to
pandas data frame representation.
'''
def __init__(self, path):
'''
Arguments:
path: path to letor txt file
'''
self._path = path... | bsd-3-clause | Python |
08aa5214a1b1a5fc6872de76b12cf97f5ceb03c9 | Disable JHU kpoint generationt test. | gmatteo/pymatgen,vorwerkc/pymatgen,gVallverdu/pymatgen,fraricci/pymatgen,gVallverdu/pymatgen,gVallverdu/pymatgen,fraricci/pymatgen,vorwerkc/pymatgen,davidwaroquiers/pymatgen,gmatteo/pymatgen,davidwaroquiers/pymatgen,davidwaroquiers/pymatgen,davidwaroquiers/pymatgen,gVallverdu/pymatgen,vorwerkc/pymatgen,vorwerkc/pymatge... | pymatgen/ext/tests/test_jhu.py | pymatgen/ext/tests/test_jhu.py | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import unittest
import requests
from pymatgen.ext.jhu import get_kpoints
from pymatgen.io.vasp.inputs import Incar
from pymatgen.io.vasp.sets import MPRelaxSet
from pymatgen.util.testing import PymatgenTest
... | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import unittest
import requests
from pymatgen.ext.jhu import get_kpoints
from pymatgen.io.vasp.inputs import Incar
from pymatgen.io.vasp.sets import MPRelaxSet
from pymatgen.util.testing import PymatgenTest
... | mit | Python |
89d9787fc5aa595f6d93d49565313212c2f95b6b | Add simple form to flask upload server | stephenbradshaw/pentesting_stuff,stephenbradshaw/pentesting_stuff,stephenbradshaw/pentesting_stuff,stephenbradshaw/pentesting_stuff | helper_servers/flask_upload.py | helper_servers/flask_upload.py | from flask import Flask, render_template, request, redirect, url_for
from werkzeug.utils import secure_filename
import datetime
import os
def timestamp():
return datetime.datetime.now().strftime('%Y%m%d%H%M%S')
app = Flask(__name__)
app.config['UPLOAD_FOLDER'] = '/uploads'
@app.route('/', methods=['GET'])
def i... | from flask import Flask, render_template, request, redirect, url_for
from werkzeug.utils import secure_filename
import datetime
import os
def timestamp():
return datetime.datetime.now().strftime('%Y%m%d%H%M%S')
app = Flask(__name__)
app.config['UPLOAD_FOLDER'] = '/uploads'
@app.route('/', methods=['GET'])
def i... | bsd-3-clause | Python |
be3f2579907cc21e3320626b29348aaf97cb7986 | Modify error message | thombashi/pytablereader,thombashi/pytablereader,thombashi/pytablereader | pytablereader/csv/formatter.py | pytablereader/csv/formatter.py | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
import dataproperty
from ..data import TableData
from ..error import InvalidDataError
from ..formatter import TableFormatter
class CsvTableFormatter(TableFormatter):
def to_table_data(self... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
import dataproperty
from ..data import TableData
from ..error import InvalidDataError
from ..formatter import TableFormatter
class CsvTableFormatter(TableFormatter):
def to_table_data(self... | mit | Python |
5c3c90c9c26a2dbe6eba9a1ebb49f1a24cbc251f | Remove unused test setting | webkom/holonet,webkom/holonet,webkom/holonet | holonet/settings/test.py | holonet/settings/test.py | MASTER_DOMAINS = [
'test.holonet.no'
]
TEST_RUNNER = "djcelery.contrib.test_runner.CeleryTestSuiteRunner"
SENDER_WHITELIST_ENABLED = False
DOMAIN_WHITELIST_ENABLED = False
SECRET_KEY = 'test'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'HOST': '127.0.0.1',
... | MASTER_DOMAINS = [
'test.holonet.no'
]
TEST_RUNNER = "djcelery.contrib.test_runner.CeleryTestSuiteRunner"
SENDER_WHITELIST_ENABLED = False
DOMAIN_WHITELIST_ENABLED = False
STATICFILES_STORAGE = 'pipeline.storage.PipelineStorage'
SECRET_KEY = 'test'
DATABASES = {
'default': {
'ENGINE': 'django.db.ba... | mit | Python |
ce1a286ee6d02cfd89097adacac4991f1477950d | Revert "test add_physical_volume()" | nschloe/python4gmsh | test/examples/swiss_cheese.py | test/examples/swiss_cheese.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pygmsh as pg
import numpy as np
def generate():
geom = pg.Geometry()
X0 = np.array([
[0.0, 0.0, 0.0],
[0.5, 0.3, 0.1],
[-0.5, 0.3, 0.1],
[0.5, -0.3, 0.1]
])
R = np.array([0.1, 0.2, 0.1, 0.14])
holes... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pygmsh as pg
import numpy as np
def generate():
geom = pg.Geometry()
X0 = np.array([
[0.0, 0.0, 0.0],
[0.5, 0.3, 0.1],
[-0.5, 0.3, 0.1],
[0.5, -0.3, 0.1]
])
R = np.array([0.1, 0.2, 0.1, 0.14])
holes... | bsd-3-clause | Python |
e674fe96a95422167a270eb76f5d3ea14b03122f | Revert show_cv2 example | toinsson/pyrealsense,toinsson/pyrealsense,toinsson/pyrealsense | examples/show_cv2.py | examples/show_cv2.py | import logging
logging.basicConfig(level=logging.INFO)
import time
import numpy as np
import cv2
import pyrealsense as pyrs
from pyrealsense.constants import rs_option
with pyrs.Service() as serv:
with serv.Device() as dev:
dev.apply_ivcam_preset(0)
try: # set custom gain/exposure values to ob... | import logging
logging.basicConfig(level=logging.INFO)
import time
import numpy as np
import cv2
import pyrealsense as pyrs
from pyrealsense.constants import rs_option
color_stream = pyrs.stream.ColorStream(color_format='bgr')
depth_stream = pyrs.stream.DepthStream()
def convert_z16_to_bgr(frame):
hist = np.hi... | apache-2.0 | Python |
6a86f901082dbb069b3364719c800ed6c404ead1 | Update bitbucket link. | jaraco/hgtools | hgtools/managers/subprocess.py | hgtools/managers/subprocess.py | import os
import subprocess
from . import base
from . import cmd
class Subprocess:
env = None
def _invoke(self, *params):
"""
Invoke self.exe as a subprocess
"""
cmd = [self.exe] + list(params)
proc = subprocess.Popen(
cmd,
stdout=subprocess.PI... | import os
import subprocess
from . import base
from . import cmd
class Subprocess:
env = None
def _invoke(self, *params):
"""
Invoke self.exe as a subprocess
"""
cmd = [self.exe] + list(params)
proc = subprocess.Popen(
cmd,
stdout=subprocess.PI... | mit | Python |
e3950a577be91c1ab1c0f9d8ac948f4ed941adb0 | remove the message in HumanAgent about typing pass to pass, since that operation is not supported. | andysalerno/reversi_ai,andysalerno/reversi-ai,andysalerno/reversi_ai | agents/human_agent.py | agents/human_agent.py | from agents.agent import Agent
class HumanAgent(Agent):
"""This agent is controlled by a human, who inputs moves via stdin."""
def __init__(self, reversi, color, **kwargs):
pass
def get_action(self, game_state, legal_moves):
choice = None
while True:
raw_choice = inpu... | from agents.agent import Agent
class HumanAgent(Agent):
"""This agent is controlled by a human, who inputs moves via stdin."""
def __init__(self, reversi, color, **kwargs):
pass
def get_action(self, game_state, legal_moves):
choice = None
while True:
raw_choice = inpu... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.