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 |
|---|---|---|---|---|---|---|---|---|
867f8f4d58ba8faf538c6963bebb6eca4ca9dc0b | Remove unused import `quote` | coala/corobo,coala/corobo | plugins/answer.py | plugins/answer.py | import json
import os
from urllib.parse import urljoin
from errbot import BotPlugin, botcmd
import requests
class Answer(BotPlugin):
@staticmethod
def construct_link(text):
if 'coala/docs/' in text:
text = text.split('coala/docs/')[-1]
return 'https://api.coala.io/en/latest/'... | import json
import os
from urllib.parse import quote, urljoin
from errbot import BotPlugin, botcmd
import requests
class Answer(BotPlugin):
@staticmethod
def construct_link(text):
if 'coala/docs/' in text:
text = text.split('coala/docs/')[-1]
return 'https://api.coala.io/en/l... | mit | Python |
df39b1dd13ab1b26e96f669a8e2cc2c3bc4a861a | fix session commit order | molguin92/MoulinetteBackend,molguin92/MoulinetteBackend | homework_from_json.py | homework_from_json.py | import json
import sys
from moulinette import hwserializer
from moulinette.homework.models import *
def main():
with open(sys.argv[1], 'r') as infile:
hw = json.loads(infile.read())
dbhw = Homework(hw['name'], hw['description'])
db.session.add(dbhw)
db.session.commit()
f... | import json
import sys
from moulinette import hwserializer
from moulinette.homework.models import *
def main():
with open(sys.argv[1], 'r') as infile:
hw = json.loads(infile.read())
dbhw = Homework(hw['name'], hw['description'])
for item in hw['items']:
dbitem = dbhw.add_item... | bsd-3-clause | Python |
9cf85542171533e18f0824fb657f10ed116d5da9 | Update proxy example list | mdmintz/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase | seleniumbase/config/proxy_list.py | seleniumbase/config/proxy_list.py | """
Proxy Server "Phone Book".
Simplify running browser tests through a proxy server
by adding your frequently-used proxies here.
Now you can do something like this on the command line:
"pytest SOME_TEST.py --proxy=proxy1"
Format of PROXY_LIST server entries:
* "ip_address:port" OR "username:password@ip_address:po... | """
Proxy Server "Phone Book".
Simplify running browser tests through a proxy server
by adding your frequently-used proxies here.
Now you can do something like this on the command line:
"pytest SOME_TEST.py --proxy=proxy1"
Format of PROXY_LIST server entries:
* "ip_address:port" OR "username:password@ip_address:po... | mit | Python |
00acfe234e963afad230d442bf318f305c201730 | Update model test | spacy-io/sense2vec,spacy-io/sense2vec,spacy-io/sense2vec | sense2vec/tests/test_sense2vec.py | sense2vec/tests/test_sense2vec.py | # coding: utf8
from __future__ import unicode_literals
import pytest
from os import path
from .. import load
data_path = path.join(path.dirname(__file__), '..', '..', 'data')
@pytest.mark.models
@pytest.mark.parametrize('model', ['reddit_vectors-1.1.0'])
def test_sample(model):
s2v = load(path.join(data_path,... | # coding: utf8
from __future__ import unicode_literals
import pytest
import sense2vec
@pytest.mark.models
def test_sample():
s2v = sense2vec.load('reddit_vectors')
freq, query_vector = s2v[u"beekeepers|NOUN"]
assert freq is not None
assert s2v.most_similar(query_vector, 3)[0] == \
[u'beekeep... | mit | Python |
de30c8a36585d5ee8ea90578f5918f0eb3dfb4c0 | Return figure | Mause/statistical_atlas_of_au | saau/sections/landcover/hay.py | saau/sections/landcover/hay.py | import logging
import cartopy.crs as ccrs
from .data import LandcoverImageProvider, load_data
from ..aus_map import get_map
ALUM = ['3.3.3 Hay & silage']
class HayImageProvider(LandcoverImageProvider):
def build_image(self, output_filename):
data = load_data(self.data_dir)
data = filter(
... | import logging
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
from .data import LandcoverImageProvider, load_data
from ..aus_map import get_map
ALUM = ['3.3.3 Hay & silage']
class HayImageProvider(LandcoverImageProvider):
def build_image(self, output_filename):
data = load_data(self.data_di... | mit | Python |
7a76bbaa878dc4103437153d869b7ac1f46b21d5 | print results | Censys/censys-python | censys/export.py | censys/export.py | import unittest
import time
from censys import *
class CensysExport(CensysAPIBase):
def new_job(self, query, format="json", flatten=False, compress=False):
assert format in ("json", "csv")
assert flatten in (True, False)
assert compress in (True, False)
data = {
"query"... | import unittest
import time
from censys import *
class CensysExport(CensysAPIBase):
def new_job(self, query, format="json", flatten=False, compress=False):
assert format in ("json", "csv")
assert flatten in (True, False)
assert compress in (True, False)
data = {
"query"... | apache-2.0 | Python |
4fa967ea843c2b1db0147a2b4d303266e5563f73 | Increment version [ci skip] | spacy-io/spaCy,explosion/spaCy,honnibal/spaCy,explosion/spaCy,spacy-io/spaCy,spacy-io/spaCy,spacy-io/spaCy,spacy-io/spaCy,explosion/spaCy,honnibal/spaCy,explosion/spaCy,explosion/spaCy,explosion/spaCy,honnibal/spaCy,honnibal/spaCy,spacy-io/spaCy | spacy/about.py | spacy/about.py | # fmt: off
__title__ = "spacy-nightly"
__version__ = "3.0.0a39"
__download_url__ = "https://github.com/explosion/spacy-models/releases/download"
__compatibility__ = "https://raw.githubusercontent.com/explosion/spacy-models/master/compatibility.json"
__projects__ = "https://github.com/explosion/projects"
__projects_bran... | # fmt: off
__title__ = "spacy-nightly"
__version__ = "3.0.0a38"
__download_url__ = "https://github.com/explosion/spacy-models/releases/download"
__compatibility__ = "https://raw.githubusercontent.com/explosion/spacy-models/master/compatibility.json"
__projects__ = "https://github.com/explosion/projects"
__projects_bran... | mit | Python |
10611bf56ad14934a611b8ead9e2177c91b58d9e | Increment version [ci skip] | honnibal/spaCy,explosion/spaCy,spacy-io/spaCy,explosion/spaCy,spacy-io/spaCy,spacy-io/spaCy,explosion/spaCy,explosion/spaCy,honnibal/spaCy,explosion/spaCy,spacy-io/spaCy,honnibal/spaCy,explosion/spaCy,honnibal/spaCy,spacy-io/spaCy,spacy-io/spaCy | spacy/about.py | spacy/about.py | # fmt: off
__title__ = "spacy-nightly"
__version__ = "3.0.0rc0"
__download_url__ = "https://github.com/explosion/spacy-models/releases/download"
__compatibility__ = "https://raw.githubusercontent.com/explosion/spacy-models/master/compatibility.json"
__projects__ = "https://github.com/explosion/projects"
__projects_bran... | # fmt: off
__title__ = "spacy-nightly"
__version__ = "3.0.0a41"
__download_url__ = "https://github.com/explosion/spacy-models/releases/download"
__compatibility__ = "https://raw.githubusercontent.com/explosion/spacy-models/master/compatibility.json"
__projects__ = "https://github.com/explosion/projects"
__projects_bran... | mit | Python |
eaf2ff1527a0bc1bd3d4824d673f37858d2eabaa | bump version | muckrack/python-goose,grangier/python-goose,goose3/goose,vetal4444/python-goose,github4ry/python-goose,blmlove409/python-goose,zzz686970/python-goose,blmlove409/python-goose,cursesun/python-goose,heianxing/python-goose,raven47git/python-goose,robmcdan/python-goose,ii0/python-goose,ii0/python-goose,grangier/python-goose... | goose/version.py | goose/version.py | # -*- coding: utf-8 -*-
"""\
This is a python port of "Goose" orignialy licensed to Gravity.com
under one or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.
Python port was written by Xavier Grangier for Recrutae
Gravity.co... | # -*- coding: utf-8 -*-
"""\
This is a python port of "Goose" orignialy licensed to Gravity.com
under one or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.
Python port was written by Xavier Grangier for Recrutae
Gravity.co... | apache-2.0 | Python |
1afa686eafbaa4392e81cad881db55e1fafb112f | Add detection support for bottle. | armet/python-armet | src/armet/connectors/bottle/__init__.py | src/armet/connectors/bottle/__init__.py | # -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals, division
def is_available(*capacities):
"""
Detects if the environment is available for use in
the (optionally) specified capacities.
"""
try:
# Attempted import
import bottle # flake8: noqa
... | mit | Python | |
572f94f7a810b6e02cbde6e548b2cf6020db8f14 | use ast.literal_eval again but with also SyntaxError in except block | Aula13/poloniex | poloniex/utils.py | poloniex/utils.py | import ast as _ast
import collections as _collections
class AutoCastDict(_collections.Mapping):
"""Dictionary that automatically cast strings."""
def __init__(self, *args, **kwargs):
self.__dict = dict(*args, **kwargs)
def __getitem__(self, key):
value = self.__dict[key]
try: re... | import json as _json
import collections as _collections
class AutoCastDict(_collections.Mapping):
"""Dictionary that automatically cast strings."""
def __init__(self, *args, **kwargs):
self.__dict = dict(*args, **kwargs)
def __getitem__(self, key):
value = self.__dict[key]
try: ... | mit | Python |
9e7c2b034e80ee0bb59858e0425cd22fb4ba26f9 | add boston data | adezfouli/savigp,adezfouli/savigp,adezfouli/savigp,adezfouli/savigp | GP/data_source.py | GP/data_source.py | from GPy.util import datasets
__author__ = 'AT'
import GPy
import numpy as np
class DataSource:
def __init__(self):
pass
@staticmethod
def normal_generate_samples(n_samples, var):
num_samples = n_samples
noise = var
num_in = 1
X = np.random.uniform(low=-1.0, hig... | __author__ = 'AT'
import GPy
import numpy as np
class DataSource:
def __init__(self):
pass
@staticmethod
def normal_generate_samples(n_samples, var):
num_samples = n_samples
noise = var
num_in = 1
X = np.random.uniform(low=-1.0, high=1.0, size=(num_samples, num_i... | apache-2.0 | Python |
720630ca37b3dda0ede4ff1e19f190a96819253f | Change submission name | davidgasquez/kaggle-airbnb | scripts/generate_submission.py | scripts/generate_submission.py | #!/usr/bin/env python
import pandas as pd
from sklearn.preprocessing import LabelEncoder
from xgboost.sklearn import XGBClassifier
from utils.io import generate_submission
def main():
path = '../data/processed/'
train_users = pd.read_csv(path + 'ohe_count_processed_train_users.csv')
test_users = pd.read_... | #!/usr/bin/env python
import pandas as pd
from sklearn.preprocessing import LabelEncoder
from xgboost.sklearn import XGBClassifier
from utils.io import generate_submission
def main():
path = '../data/processed/'
train_users = pd.read_csv(path + 'ohe_count_processed_train_users.csv')
test_users = pd.read_... | mit | Python |
6f03b991fb3cb8e7d59f9f2de982a14c36389eac | Fix %pudb magic for IPython 1.0 | amigrave/pudb,albfan/pudb,amigrave/pudb,albfan/pudb | pudb/ipython.py | pudb/ipython.py | import os
try:
from IPython import ipapi
ip = ipapi.get()
_ipython_version = (0, 10)
except ImportError:
try:
from IPython.core.magic import register_line_magic
_ipython_version = (1, 0)
except ImportError:
# Note, keep this run last, or else it will raise a deprecation
... | import os
try:
from IPython import ipapi
except ImportError:
from IPython.frontend.terminal.interactiveshell import \
TerminalInteractiveShell
ip = TerminalInteractiveShell.instance()
_ipython_version = (0, 11)
else:
ip = ipapi.get()
_ipython_version = (0, 10)
# This conforms to IP... | mit | Python |
34c1b0e292e29317c5e1081b2461d80172bfd2aa | Update get_refseq_summaries.py | intermine/intermine-scripts,intermine/intermine-scripts,intermine/intermine-scripts,intermine/intermine-scripts,intermine/intermine-scripts | bio/get_refseq_summaries.py | bio/get_refseq_summaries.py | #!/usr/bin/python
import sys
import urllib2
from xml.sax import make_parser, handler
import time
class SummaryHandler(handler.ContentHandler):
def __init__(self, output):
self.counter = 0
self.content = ''
self.in_summary = False
self.gene_id = None
def startElement(self, name, attrs):
sel... | #!/usr/bin/python
import sys
import urllib2
from xml.sax import make_parser, handler
import time
class SummaryHandler(handler.ContentHandler):
def __init__(self, output):
self.counter = 0
self.content = ''
self.in_summary = False
self.gene_id = None
def startElement(self, name, attrs):
self.content = ''... | lgpl-2.1 | Python |
51c84a5fbfb0b974326faeba005900fd4b7e87de | Generalize NAFF to handle several trajectories at once; | lnls-fac/pyaccel | pyaccel/naff.py | pyaccel/naff.py | """ Pyaccel tracking module
This module concentrates all tracking routines of the accelerator.
Most of them take a structure called 'positions' as an argument which
should store the initial coordinates of the particle, or the bunch of particles
to be tracked. Most of these routines generate tracked particle positions ... | """ Pyaccel tracking module
This module concentrates all tracking routines of the accelerator.
Most of them take a structure called 'positions' as an argument which
should store the initial coordinates of the particle, or the bunch of particles
to be tracked. Most of these routines generate tracked particle positions ... | mit | Python |
928da883a2c3d880a989e939e59e13309ed463cd | Switch the things | samanehsan/learn-git,samanehsan/learn-git,samanehsan/spark_github,samanehsan/spark_github | web.py | web.py | """
Heroku/Python Quickstart:
https://blog.heroku.com/archives/2011/9/28/python_and_django
"""
import os
import random
import requests
import tweepy
from flask import Flask, render_template
import settings
app = Flask(__name__)
@app.route('/')
def home_page():
instagram_pics = get_instagram_images()
twitte... | """
Heroku/Python Quickstart:
https://blog.heroku.com/archives/2011/9/28/python_and_django
"""
import os
import random
import requests
import tweepy
from flask import Flask, render_template
import settings
app = Flask(__name__)
@app.route('/')
def home_page():
instagram_pics = get_instagram_images()
twitte... | apache-2.0 | Python |
f7e15913bde2747be8c9c60780de7787a2e31ddd | Remove blank line. | mperignon/bmi-delta,mperignon/bmi-STM,mperignon/bmi-STM,mperignon/bmi-delta | bmi/grid_structured_quad.py | bmi/grid_structured_quad.py | #! /usr/bin/env python
class BmiGridStructuredQuad(object):
"""Methods that describe a structured grid of quadrilaterals.
.. figure:: _static/grid_structured_quad.png
:scale: 10%
:align: center
:alt: An example of a structured quad grid.
"""
def get_grid_shape(self, grid_id):... | #! /usr/bin/env python
class BmiGridStructuredQuad(object):
"""Methods that describe a structured grid of quadrilaterals.
.. figure:: _static/grid_structured_quad.png
:scale: 10%
:align: center
:alt: An example of a structured quad grid.
"""
def get_grid_shape(self, grid_id):... | mit | Python |
b130d51bce8cf01b73fdf4970f7a8752e25ed25a | Define web API | philipbl/SpeakerCast,philipbl/talk_feed | web.py | web.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import urllib.parse
from datetime import datetime
from flask import Flask, request, json
from jinja2 import Environment, FileSystemLoader, Template
import database
import rsser
app = Flask(__name__)
@app.route('/speakers')
def speakers():
speakers = [{'na... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import urllib.parse
from datetime import datetime
from flask import Flask, request, json
from jinja2 import Environment, FileSystemLoader, Template
import database
import rsser
app = Flask(__name__)
# Access database to get list of speakers
@app.route('/')
de... | bsd-3-clause | Python |
6dbc2736798bc12a12afcd49532a1b5ff321b492 | fix util import in random | kengz/Unity-Lab,kengz/Unity-Lab | slm_lab/agent/algorithm/random.py | slm_lab/agent/algorithm/random.py | # The random agent algorithm
# For basic dev purpose
from slm_lab.agent.algorithm.base import Algorithm
from slm_lab.lib import logger, util
from slm_lab.lib.decorator import lab_api
import numpy as np
logger = logger.get_logger(__name__)
class Random(Algorithm):
'''
Example Random agent that works in both d... | # The random agent algorithm
# For basic dev purpose
from slm_lab.agent.algorithm.base import Algorithm
from slm_lab.lib import logger
from slm_lab.lib.decorator import lab_api
import numpy as np
logger = logger.get_logger(__name__)
class Random(Algorithm):
'''
Example Random agent that works in both discret... | mit | Python |
f0a7dcb3486dcee9f5d9fa75382fd9cf0d30ffcd | fix file endings for gk | cltk/cltk_api | api.py | api.py | """Main API file for backend CLTK webapp."""
import os
from flask import Flask, request
from flask_restful import Resource, Api
app = Flask(__name__)
api = Api(app)
# example
class HelloWorld(Resource):
def get(self):
return {'hello': 'world'}
# example
todos = {}
class TodoSimple(Resource):
def ge... | """Main API file for backend CLTK webapp."""
import os
from flask import Flask, request
from flask_restful import Resource, Api
app = Flask(__name__)
api = Api(app)
# example
class HelloWorld(Resource):
def get(self):
return {'hello': 'world'}
# example
todos = {}
class TodoSimple(Resource):
def ge... | mit | Python |
cd5cac82505931c13885d4faf07db3576e19f470 | Add home function into views | djangogirlstaipei/eshop,djangogirlstaipei/eshop,djangogirlstaipei/eshop,djangogirlstaipei/eshop | bookshop/books/views.py | bookshop/books/views.py | from django.shortcuts import render
from .models import Book
def home(request):
book_list = Book.objects.all()
return render(request, 'home.html', {
'book_list': book_list,
}) | from django.shortcuts import render
# Create your views here.
| mit | Python |
c72c4304d7c317aa3f3b2b1dae8fc755dc744c8a | fix nameerror on WindowException. Have to do late binding, because pyglet.window imports pyglet.event, so WindowException isn't there at module creation time | regular/pyglet-avbin-optimizations,regular/pyglet-avbin-optimizations,regular/pyglet-avbin-optimizations,regular/pyglet-avbin-optimizations | pyglet/event.py | pyglet/event.py | #!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import inspect
EVENT_HANDLED = None
EVENT_UNHANDLED = 1
class EventHandler(object):
def __init__(self):
self._event_stack = [{}]
@classmethod
def register_event_type(cls, name):
if not hasattr(cls, ... | #!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import inspect
EVENT_HANDLED = None
EVENT_UNHANDLED = 1
class EventHandler(object):
def __init__(self):
self._event_stack = [{}]
@classmethod
def register_event_type(cls, name):
if not hasattr(cls, ... | bsd-3-clause | Python |
1744c10a6a0bb0c36a4cbd37db04cd58264515ea | Fix typo | karllark/dust_extinction | dust_extinction/tests/test_ma14.py | dust_extinction/tests/test_ma14.py | import numpy as np
import pytest
import astropy.units as u
from ..parameter_averages import MA14
from .helpers import _invalid_x_range
x_bad = [-1.0, 0.1, 12.0, 100.]
@pytest.mark.parametrize("x_invalid", x_bad)
def test_invalid_wavenumbers(x_invalid):
_invalid_x_range(x_invalid, MA14(), 'MA14')
@pytest.mar... | import numpy as np
import pytest
import astropy.units as u
from ..parameter_averages import MA14
from .helpers import _invalid_x_range
x_bad = [-1.0, 0.1, 12.0, 100.]
@pytest.mark.parametrize("x_invalid", x_bad)
def test_invalid_wavenumbers(x_invalid):
_invalid_x_range(x_invalid, MA14(), 'MA14')
@pytest.mar... | bsd-3-clause | Python |
53ce9b806813ec253aaf6750c595d026fb84a434 | fix typo | TheAlgorithms/Python | dynamic_programming/coin_change.py | dynamic_programming/coin_change.py | """
You have m types of coins available in infinite quantities
where the value of each coins is given in the array S=[S0,... Sm-1]
Can you determine number of ways of making change for n units using
the given types of coins?
https://www.hackerrank.com/challenges/coin-change/problem
"""
def dp_count(S, m, n):
table ... | """
You have m types of coins available in infinite quantities
where the value of each coins is given in the array S=[S0,... Sm-1]
Can you determine number of ways of making change for n units using
the given types of coints?
https://www.hackerrank.com/challenges/coin-change/problem
"""
def dp_count(S, m, n):
table... | mit | Python |
0433623b8e15559fe304e6406e58b1cd2639493f | Create a test to expose the bug | datphan/teracy-tutorial | apps/polls/tests.py | apps/polls/tests.py | import datetime
from django.utils import timezone
from django.test import TestCase
from apps.polls.models import Poll
class PollMethodTests(TestCase):
def test_was_published_recently_with_future_poll(self):
"""
was_published_recently() should return False for polls whose
pub_date is in t... | """
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 a... | bsd-3-clause | Python |
8959c65681f66ba9debf125204ed43c9a83e9b54 | Update zwave.py | jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi | apps/zwave/zwave.py | apps/zwave/zwave.py | # -*- coding: utf-8 -*-
# Author : Jeonghoonkang, github.com/jeonghoonkang
# using ozcp daemon for contorl and monitoring
# ozwc
| # -*- coding: utf-8 -*-
# Author : Jeonghoonkang, github.com/jeonghoonkang
# using ozcp daemon for contorl and monitoring
| bsd-2-clause | Python |
da952803636a0701331008a025b6789de89ce152 | Store more data about a mod in the registry | AWSW-Modding/AWSW-Modtools | modloader/modclass.py | modloader/modclass.py | import modinfo
import sys
class Mod():
"""The Mod class
This is supposed to act like a superclass for mods.
Execution order is as follows:
mod_load -> mod_complete
"""
def mod_info(self):
"""Get the mod info
Returns:
A tuple with the name, version, and author
... | import modinfo
class Mod():
"""The Mod class
This is supposed to act like a superclass for mods.
Execution order is as follows:
mod_load -> mod_complete
"""
def mod_info(self):
"""Get the mod info
Returns:
A tuple with the name, version, and author
"""
... | mit | Python |
d917e1dca327dac275094375cb9fcd286916e989 | add pypiwin32 dependence with xlwings | ajul/zerosum,ajul/zerosum | python/setup.py | python/setup.py | import setuptools
import codecs
import os
here = os.path.abspath(os.path.dirname(__file__))
# Get the long description from the README file
with codecs.open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setuptools.setup(
name = 'zerosum',
version = '0.0.0',
desc... | import setuptools
import codecs
import os
here = os.path.abspath(os.path.dirname(__file__))
# Get the long description from the README file
with codecs.open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setuptools.setup(
name = 'zerosum',
version = '0.0.0',
desc... | bsd-3-clause | Python |
fdd2ad75512bbbcd63c8fda1f197ec7212a8e556 | Fix for 1.6 urls | Sponsorcraft/django-ckeditor,Sponsorcraft/django-ckeditor,Sponsorcraft/django-ckeditor | ckeditor/urls.py | ckeditor/urls.py | from django.conf.urls import patterns, url
urlpatterns = patterns(
'',
url(r'^upload/', 'ckeditor.views.upload', name='ckeditor_upload'),
url(r'^browse/', 'ckeditor.views.browse', name='ckeditor_browse'),
)
| from django.conf.urls.defaults import patterns, url
urlpatterns = patterns(
'',
url(r'^upload/', 'ckeditor.views.upload', name='ckeditor_upload'),
url(r'^browse/', 'ckeditor.views.browse', name='ckeditor_browse'),
)
| bsd-3-clause | Python |
1c5e24aecb1295c779cfcb7afa8d70819708c9d8 | bump to version 1.2 | unibg-seclab/aesmix,unibg-seclab/aesmix | python/setup.py | python/setup.py | from setuptools import setup
with open('README.rst') as README:
long_description = README.read()
long_description = long_description[long_description.index('Description'):]
setup(name='aesmix',
version='1.2',
description='Mix&Slice',
long_description=long_description,
url='http://githu... | from setuptools import setup
with open('README.rst') as README:
long_description = README.read()
long_description = long_description[long_description.index('Description'):]
setup(name='aesmix',
version='1.1',
description='Mix&Slice',
long_description=long_description,
url='http://githu... | mit | Python |
02a2b8d2fbdd2da4a82734e1831b47a22b2f7cad | Change a changelog comment. | ste616/cabb-schedule-api | python/setup.py | python/setup.py | from setuptools import setup
# This is the cabb_scheduler Python library.
# Jamie Stevens 2017
# ATCA Senior Systems Scientist
# Jamie.Stevens@csiro.au
setup(name='cabb_scheduler',
version='1.1',
description='CABB Scheduling Python Library',
url='https://github.com/ste616/cabb-schedule-api',
a... | from setuptools import setup
# This is the cabb_scheduler Python library.
# Jamie Stevens 2017
# ATCA Senior Systems Scientist
# Jamie.Stevens@csiro.au
setup(name='cabb_scheduler',
version='1.1',
description='CABB Scheduling Python Library',
url='https://github.com/ste616/cabb-schedule-api',
a... | mit | Python |
ef8416753b828e885f578ecee590f24f8e16e152 | bump version to 0.6.1 | RyanTech/tchannel,sasa233/tchannel,hustxiaoc/tchannel,vanloswang/tchannel,i/tchannel,bunnyblue/tchannel,savaki/tchannel,bunnyblue/tchannel,benfleis/tchannel,benfleis/tchannel,RyanTech/tchannel,benfleis/tchannel,savaki/tchannel,i/tchannel,Zirpon/tchannel,chenwenbin928/tchannel,Zirpon/tchannel,i/tchannel,sasa233/tchannel... | python/setup.py | python/setup.py | from setuptools import find_packages, setup
setup(
name='tchannel',
version='0.6.1',
author='Abhinav Gupta, Aiden Scandella, Bryce Lampe, Grayson Koonce, Junchao Wu',
author_email='dev@uber.com',
description='Network multiplexing and framing protocol for RPC',
license='MIT',
url='https://... | from setuptools import find_packages, setup
setup(
name='tchannel',
version='0.6.0',
author='Abhinav Gupta, Aiden Scandella, Bryce Lampe, Grayson Koonce, Junchao Wu',
author_email='dev@uber.com',
description='Network multiplexing and framing protocol for RPC',
license='MIT',
url='https://... | mit | Python |
c7d32eb798127741e11fc33894f098a3c907c60e | Set default values for the configuration tempPath is set according to OS temp folder | jachym/PyWPS,ldesousa/PyWPS,bird-house/PyWPS,tomkralidis/pywps,ricardogsilva/PyWPS,jonas-eberle/pywps,SiggyF/pywps-4,geopython/pywps | pywps/config.py | pywps/config.py | import os
import ConfigParser
import tempfile
config = None
def get_config_value(section, option):
"""Get desired value from configuration files
:param section: section in configuration files
:type section: string
:param option: option in the section
:type option: string
:returns: value fou... | import os
import ConfigParser
config = None
def get_config_value(*args):
"""Get desired value from configuration files
:param section: section in configuration files
:type section: string
:param key: key in the section
:type key: string
:returns: value found in the configuration file
""... | mit | Python |
24dfa9fbfe4850e281b41c36a8588613fe37c0fd | Fix TypeError for qless-core default config values | seomoz/qless-py,seomoz/qless-py | qless/config.py | qless/config.py | '''All our configuration operations'''
import simplejson as json
class Config(object):
'''A class that allows us to change and manipulate qless config'''
def __init__(self, client):
self._client = client
def __getattr__(self, attr):
if attr == 'all':
return json.loads(self._c... | '''All our configuration operations'''
import simplejson as json
class Config(object):
'''A class that allows us to change and manipulate qless config'''
def __init__(self, client):
self._client = client
def __getattr__(self, attr):
if attr == 'all':
return json.loads(self._c... | mit | Python |
96e93a1c8803fd93cdd7764a7ed7e62f14bb67e2 | Bump version | raviqqe/tensorflow-qnd,raviqqe/tensorflow-qnd | qnd/__init__.py | qnd/__init__.py | """Quick and Dirty TensorFlow command framework"""
from .flag import *
from .infer import def_infer
from .train_and_evaluate import def_train_and_evaluate
from .evaluate import def_evaluate
__all__ = ["FLAGS", "add_flag", "add_required_flag", "FlagAdder",
"def_train_and_evaluate", "def_evaluate", "def_infe... | """Quick and Dirty TensorFlow command framework"""
from .flag import *
from .infer import def_infer
from .train_and_evaluate import def_train_and_evaluate
from .evaluate import def_evaluate
__all__ = ["FLAGS", "add_flag", "add_required_flag", "FlagAdder",
"def_train_and_evaluate", "def_evaluate", "def_infe... | unlicense | Python |
8bbb76c08b4f311da873975c5b11fd26f95c004c | remove debug print | jsanc623/ServerStatusEmitter | lib/transport.py | lib/transport.py | import requests
import logging
class Transport():
def __init__(self, payload, config):
logging.basicConfig(filename="/var/log/sse.log", filemode='a',
format='%(asctime)s,%(msecs)d %(name)s %(levelname)s %(message)s',
datefmt='%H:%M:%S', level=l... | import requests
import logging
class Transport():
def __init__(self, payload, config):
logging.basicConfig(filename="/var/log/sse.log", filemode='a',
format='%(asctime)s,%(msecs)d %(name)s %(levelname)s %(message)s',
datefmt='%H:%M:%S', level=l... | unlicense | Python |
8e7ba142a9c6eb56d1dd5a03bf3ee35e303df28f | Bump version to 1.9.1 | nyaruka/smartmin,nyaruka/smartmin,nyaruka/smartmin | smartmin/__init__.py | smartmin/__init__.py | from __future__ import unicode_literals
__version__ = '1.9.1'
def class_from_string(class_name):
"""
Used to load a class object dynamically by name
"""
parts = class_name.split('.')
module = ".".join(parts[:-1])
m = __import__(module)
for comp in parts[1:]:
m = getattr(m, comp)
... | from __future__ import unicode_literals
__version__ = '1.9.0'
def class_from_string(class_name):
"""
Used to load a class object dynamically by name
"""
parts = class_name.split('.')
module = ".".join(parts[:-1])
m = __import__(module)
for comp in parts[1:]:
m = getattr(m, comp)
... | bsd-3-clause | Python |
c16de8cae181c3d2deab4855497efcacfdf62f86 | Add import | 9and3r/mopidy-ttsgpio | mopidy_ttsgpio/tts.py | mopidy_ttsgpio/tts.py | import os
from threading import Thread
import time
import subprocess
music_level = 30
class TTS():
def __init__(self):
self.t = Thread(target=self.speak_text_thread)
self.t.start()
def speak_text(self, text):
s='(SayText "{0}")\n'.format(text)
self.p.stdin.write(s)
def speak_text_thread(self):
self.p ... | import os
from threading import Thread
import time
music_level = 30
class TTS():
def __init__(self):
self.t = Thread(target=self.speak_text_thread)
self.t.start()
def speak_text(self, text):
s='(SayText "{0}")\n'.format(text)
self.p.stdin.write(s)
def speak_text_thread(self):
self.p = subprocess.Popen... | apache-2.0 | Python |
5816df8ad466e9ecc8158162b3cf21d1fbf8fa6e | Include PR link in slack notifications | SylverStudios/carson | carson/slack/actions.py | carson/slack/actions.py | import requests
from .. import app
class NotifyAction(object):
URL = "https://hooks.slack.com/services/{key}"
PR_URL = "https://github.com/{r}/pull/{pr}"
PASS_MESSAGE = "All tests passed on PR #{pr}"
FAIL_MESSAGE = "One or more tests failed on PR #{pr}"
MERGING_MESSAGE = "Merging PR #{pr}"
d... | import requests
from .. import app
class NotifyAction(object):
URL = "https://hooks.slack.com/services/{key}"
PASS_MESSAGE = "All tests passed on PR #{pr}"
FAIL_MESSAGE = "One or more tests failed on PR #{pr}"
MERGING_MESSAGE = "Merging PR #{pr}"
def __init__(self, appointment, message=None):
... | mit | Python |
e7b92e5541b25693f629a8e82a079dee73e932da | Update win_batch_md2ipynb.py | mli/gluon-tutorials-zh,mli/gluon-tutorials-zh,mli/gluon-tutorials-zh,mli/gluon-tutorials-zh,d2l-ai/d2l-zh,d2l-ai/d2l-zh,d2l-ai/d2l-zh | build/win_batch_md2ipynb.py | build/win_batch_md2ipynb.py | from distutils.dir_util import copy_tree
import glob
import nbformat
import notedown
import os
from subprocess import check_output
import sys
import time
# To access data/imgs/gluonbook in upper level.
os.chdir('build')
def mkdir_if_not_exist(path):
if not os.path.exists(os.path.join(*path)):
... | import glob
import nbformat
import notedown
import os
from subprocess import check_output
import sys
import time
def mkdir_if_not_exist(path):
if not os.path.exists(os.path.join(*path)):
os.makedirs(os.path.join(*path))
# timeout for each notebook, in sec
timeout = 20 * 60
# the files wi... | apache-2.0 | Python |
33e8793cb2e6ca140a9d33e6533d7304b9d5cb26 | Handle non-commands | JokerQyou/bot | app.py | app.py | # coding: utf-8
import json
import flask
from flask import request
import redis
import telegram
import config
from utils import *
import botcommands
__name__ = 'eth0_bot'
__author__ = 'Joker_Qyou'
app = flask.Flask(__name__)
app.debug = True
bot = telegram.Bot(token=config.TOKEN)
bot.setWebhook('%s/%s' % (config.S... | # coding: utf-8
import json
import flask
from flask import request
import redis
import telegram
import config
from utils import *
import botcommands
__name__ = 'eth0_bot'
__author__ = 'Joker_Qyou'
app = flask.Flask(__name__)
app.debug = True
bot = telegram.Bot(token=config.TOKEN)
bot.setWebhook('%s/%s' % (config.S... | bsd-2-clause | Python |
1d4b33ed2955817e8103a90133fd6edf456b1148 | Apply suggested fixes from flake8 | carolynvs/github-release-proxy,carolynvs/github-release-proxy | app.py | app.py | from flask import Flask, redirect
from flask.ext.cache import Cache
import logging
import os
import requests
app = Flask(__name__)
cache = Cache(app, config={'CACHE_TYPE': 'simple'})
cache_timeout = os.getenv('CACHE_TIMEOUT') or 60
@app.route('/<owner>/<repo>/<version>/<path:path>')
@cache.cached(timeout=cache_timeo... | from flask import Flask, redirect
from flask.ext.cache import Cache
import logging
import os
import requests
app = Flask(__name__)
cache = Cache(app, config={'CACHE_TYPE': 'simple'})
cache_timeout = os.getenv('CACHE_TIMEOUT') or 60
@app.route('/<owner>/<repo>/<version>/<path:path>')
@cache.cached(timeout=cache_timeou... | apache-2.0 | Python |
51fc121768f45e4bbc424a5c8cbd1ace88f1fe03 | Allow blank song titles and artists. | alykhank/Tunezout,alykhank/Tunezout | app.py | app.py | #!/usr/bin/env python
import os
from flask import Flask, render_template, request, redirect, url_for, jsonify
from models import app, db, Song, Genre
@app.route('/')
def index():
genreFilter = request.args.get('genre', 0, type=int)
genre = Genre.query.filter(Genre.id == genreFilter).first()
return index(genre)
def... | #!/usr/bin/env python
import os
from flask import Flask, render_template, request, redirect, url_for, jsonify
from models import app, db, Song, Genre
@app.route('/')
def index():
genreFilter = request.args.get('genre', 0, type=int)
genre = Genre.query.filter(Genre.id == genreFilter).first()
return index(genre)
def... | mit | Python |
1565ea8753681ad58e87b066edf48398af1f198d | fix incorrect import | dotastro/hack-list-submission-app,dotastro/hack-list-submission-app | app.py | app.py | import os
from hack_submission.webapp import app
port = int(os.environ.get('PORT', 5000))
debug = bool(os.environ.get('DEBUG', False))
host = os.environ.get('HOST', None)
app.run(host=host, debug=debug, port=port)
| import os
from dotastro_hack_submission.webapp import app
port = int(os.environ.get('PORT', 5000))
debug = bool(os.environ.get('DEBUG', False))
host = os.environ.get('HOST', None)
app.run(host=host, debug=debug, port=port)
| mit | Python |
1e136e5e7323a534d3a021c6ad22f20cef2ecec0 | Refactor basic response. | Malguzt/pingpong_manager,Malguzt/pingpong_manager | app.py | app.py | import os
import json
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
endpoints = {
'endpoints' : {
'/keywords' : ['GET'],
'/sentence/<sentence>' : ['GET']
}
}
return json.dumps(endpoints)
@app.route('/keywords/', methods=['GET'])... | import os
import json
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
endpoints = {
'endpoints' : {
'/keywords' : ['GET'],
'/sentence/<sentence>' : ['GET']
}
}
return json.dumps(endpoints)
@app.route('/keywords/', methods=['GET'])... | mit | Python |
5f40f2e6d37c3d25c1d2e9f37e2551a6fc0bc292 | Add simple decoration | Nslaver/GeoPQRGen | app.py | app.py | from PIL import Image
from PIL import ImageFont
from PIL import ImageDraw
from PIL import ImageChops
import curses
import qrcode
def printProgressBar (iteration, total, prefix = '', suffix = '', decimals = 1, length = 100, fill = '█'):
percent = ("{0:." + str(decimals) + "f}").format(100 * (iteration / float(tot... | from PIL import Image
from PIL import ImageFont
from PIL import ImageDraw
from PIL import ImageChops
import curses
import qrcode
def printProgressBar (iteration, total, prefix = '', suffix = '', decimals = 1, length = 100, fill = '█'):
percent = ("{0:." + str(decimals) + "f}").format(100 * (iteration / float(tot... | mit | Python |
51a410a83dcfd271712c3e31dce5befc80f81b87 | Change app to factory | fnielsen/cvrminer,fnielsen/cvrminer,fnielsen/cvrminer | app.py | app.py | """Entrypoint to start app."""
from cvrminer.app import create_app
app = create_app()
if __name__ == '__main__':
app.run(debug=True)
| """Entrypoint to start app."""
from cvrminer.app import app
if __name__ == '__main__':
app.run(debug=True)
| apache-2.0 | Python |
0ea1af126d0ed382a595119730b5fe7561b5c50a | Reduce safety timeouts | MycroftAI/mycroft-core,MycroftAI/mycroft-core,forslund/mycroft-core,forslund/mycroft-core | test/integrationtests/voight_kampff/features/environment.py | test/integrationtests/voight_kampff/features/environment.py | # Copyright 2020 Mycroft AI Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | # Copyright 2020 Mycroft AI Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | apache-2.0 | Python |
17655f4b099ac840712dd95ad989f7b41301b83c | Fix import errors from implicit-relative imports. | AlejandroFrias/case-conversion | case_conversion/__init__.py | case_conversion/__init__.py | from __future__ import absolute_import
from .case_conversion import (
camelcase, pascalcase, snakecase, dashcase, kebabcase, spinalcase,
constcase, dotcase, separate_words, slashcase, backslashcase)
| from case_conversion import (
camelcase, pascalcase, snakecase, dashcase, kebabcase, spinalcase,
constcase, dotcase, separate_words, slashcase, backslashcase)
| mit | Python |
8b97705cb19c26f0c3f80a053069a8e219025bc6 | create release 0.3.0 | atria-soft/esignal,atria-soft/esignal | lutin_esignal.py | lutin_esignal.py | #!/usr/bin/python
import lutin.module as module
import lutin.tools as tools
import lutin.debug as debug
import os
import lutin.multiprocess as lutinMultiprocess
def get_type():
return "LIBRARY"
def get_desc():
return "esignal is signal management for all class"
def get_licence():
return "APACHE-2"
def get_compa... | #!/usr/bin/python
import lutin.module as module
import lutin.tools as tools
import lutin.debug as debug
import os
import lutin.multiprocess as lutinMultiprocess
def get_type():
return "LIBRARY"
def get_desc():
return "esignal is signal management for all class"
def get_licence():
return "APACHE-2"
def get_compa... | apache-2.0 | Python |
73c73ce83e039ac8bd5cd42900413ae93a721c10 | add find paths | shadow3x3x3/renew-skyline-path-query | skyline_path/strcture/graph.py | skyline_path/strcture/graph.py | class Graph:
"""
Record Basic Graph Data.
"""
def __init__(self):
self.nodes = ()
self.neighbors = {}
def init_from_edges(self, edges):
"""
Initialize form edges.
When edges read, add nodes automatic from edges.
"""
self.edges = tuple(edges)
... | class Graph:
"""
Record Basic Graph Data.
"""
def __init__(self):
self.nodes = ()
self.neighbors = {}
def init_from_edges(self, edges):
"""
Initialize form edges.
When edges read, add nodes automatic from edges.
"""
self.edges = tuple(edges)
... | mit | Python |
60a827daffb47bec26fc297a4e005f006fe7b993 | add 1.60.0 (#11936) | LLNL/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,iulian787/spack,iulian787/spack | var/spack/repos/builtin/packages/r-rbgl/package.py | var/spack/repos/builtin/packages/r-rbgl/package.py | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RRbgl(RPackage):
"""A fairly extensive and comprehensive interface to the graph
algori... | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RRbgl(RPackage):
"""A fairly extensive and comprehensive interface to the graph
algori... | lgpl-2.1 | Python |
e0b1ad708ff98c3438994f59ea73ebdeaa6a2ee0 | Fix typo | ZeitOnline/zeit.connector | src/zeit/connector/resource.py | src/zeit/connector/resource.py | import persistent.mapping
import zeit.connector.interfaces
import zope.interface
class WebDAVProperties(persistent.mapping.PersistentMapping):
zope.interface.implements(zeit.connector.interfaces.IWebDAVProperties)
def __repr__(self):
return object.__repr__(self)
class ReadOnlyWebDAVProperties(WebD... | import persistent.mapping
import zeit.connector.interfaces
import zope.interface
class WebDAVProperties(persistent.mapping.PersistentMapping):
zope.interface.implements(zeit.connector.interfaces.IWebDAVProperties)
def __repr__(self):
return object.__repr__(self)
class ReadOnlyWebDAVProperties(WebD... | bsd-3-clause | Python |
6bac705b9122c85cc7eb150855f78ac3ee591b1a | Support multi-dimension channels | ktnyt/chainer,sinhrks/chainer,ttakamura/chainer,cupy/cupy,anaruse/chainer,keisuke-umezawa/chainer,minhpqn/chainer,muupan/chainer,ttakamura/chainer,wkentaro/chainer,okuta/chainer,jnishi/chainer,kiyukuta/chainer,ikasumi/chainer,okuta/chainer,ktnyt/chainer,kikusu/chainer,hvy/chainer,cupy/cupy,truongdq/chainer,delta2323/ch... | chainer/functions/linear.py | chainer/functions/linear.py | import math
import numpy
from pycuda import gpuarray
from pycuda.elementwise import ElementwiseKernel
from pytools import memoize
import scikits.cuda.linalg as culinalg
import scikits.cuda.misc as cumisc
from chainer import Function
@memoize
def _add_bias_kernel():
return ElementwiseKernel('float* y, float* b, int... | import math
import numpy
from pycuda import gpuarray
from pycuda.elementwise import ElementwiseKernel
from pytools import memoize
import scikits.cuda.linalg as culinalg
import scikits.cuda.misc as cumisc
from chainer import Function
@memoize
def _add_bias_kernel():
return ElementwiseKernel('float* y, float* b, int... | mit | Python |
2945ae3bb8dd85bd96546cef4ff1e297774d7190 | Add forward/reverse mapping of checkerstati | fausecteam/ctf-gameserver,fausecteam/ctf-gameserver,fausecteam/ctf-gameserver,fausecteam/ctf-gameserver,fausecteam/ctf-gameserver | checker/checker/__init__.py | checker/checker/__init__.py | #!/usr/bin/python3
from checker.local import LocalChecker as BaseChecker
#from checker.contest import ContestChecker as BaseChecker
OK = 0
TIMEOUT = 1
NOTWORKING = 2
NOTFOUND = 3
_mapping = ["OK", "TIMEOUT", "NOTWORKING", "NOTFOUND"]
def string_to_result(strresult):
return _mapping.index(strresult)
def result_... | #!/usr/bin/python3
from checker.local import LocalChecker as BaseChecker
#from checker.contest import ContestChecker as BaseChecker
OK = 0
TIMEOUT = 1
NOTWORKING = 2
NOTFOUND = 3
| isc | Python |
1a837e84a129e99f7734fe0ffdc6ff3a239ecc4a | Remove 2.3 and 2.4 from CI pipeline | cf-platform-eng/tile-generator,cf-platform-eng/tile-generator,cf-platform-eng/tile-generator,cf-platform-eng/tile-generator | ci/generate_pipeline_yml.py | ci/generate_pipeline_yml.py | #!/usr/bin/env python
import os
from jinja2 import Template
clusters = ['2_5', '2_6', '2_7']
# Commenting out this as we only have one example and it breaks
tiles = [] # [d for d in os.listdir('../examples') if os.path.isdir(os.path.join('../examples', d))]
with open('pipeline.yml.jinja2', 'r') as f:
t = Template(... | #!/usr/bin/env python
import os
from jinja2 import Template
clusters = ['2_3', '2_4', '2_5', '2_6']
# Commenting out this as we only have one example and it breaks
tiles = [] # [d for d in os.listdir('../examples') if os.path.isdir(os.path.join('../examples', d))]
with open('pipeline.yml.jinja2', 'r') as f:
t = Te... | apache-2.0 | Python |
790f86ce203d8c1049b0a3ea65e7afe166a282c6 | order of things | obestwalter/mau-mau | mau_mau/stats.py | mau_mau/stats.py | import logging
from statistics import mean
from timeit import timeit
from mau_mau import rules, play
log = logging.getLogger(__name__)
def mean_turns(players=3, reps=1000):
games = _simulate_games(players, reps)
log.info("mean turns played: %s", mean([g.turns for g in games]))
def winner_distribution(play... | import logging
from statistics import mean
from timeit import timeit
from mau_mau import rules, play
log = logging.getLogger(__name__)
def mean_turns(players=3, reps=1000):
games = _simulate_games(players, reps)
log.info("mean turns played: %s", mean([g.turns for g in games]))
def winner_distribution(play... | mit | Python |
be7919b16379c4ba704aa9cb157feef68fcf4d15 | fix sph to cart | abonaca/gary,abonaca/gary,abonaca/gary | streamteam/coordinates/util.py | streamteam/coordinates/util.py | # coding: utf-8
""" General utilities. """
from __future__ import division, print_function
__author__ = "adrn <adrn@astro.columbia.edu>"
# Standard library
import os, sys
# Third-party
import numpy as np
__all__ = ["cartesian_to_spherical", "spherical_to_cartesian"]
def cartesian_to_spherical(x, v):
"""
... | # coding: utf-8
""" General utilities. """
from __future__ import division, print_function
__author__ = "adrn <adrn@astro.columbia.edu>"
# Standard library
import os, sys
# Third-party
import numpy as np
__all__ = ["cartesian_to_spherical", "spherical_to_cartesian"]
def cartesian_to_spherical(x, v):
"""
... | mit | Python |
d33b596d612570ea85e812cd72a91d79541ad282 | Set default claimed and deleted values when adding venues | NYCPython/wheretomeetup | meetups/logic.py | meetups/logic.py | from urllib import urlencode
from . import meetup
from .models import *
ORGANIZER_ROLES = set(['Organizer', 'Co-Organizer'])
def sync_user(member_id, maximum_staleness=3600):
"""Synchronize a user between the Meetup API and MongoDB. Typically called
after a user login. In addition to creating or updating th... | from urllib import urlencode
from . import meetup
from .models import *
ORGANIZER_ROLES = set(['Organizer', 'Co-Organizer'])
def sync_user(member_id, maximum_staleness=3600):
"""Synchronize a user between the Meetup API and MongoDB. Typically called
after a user login. In addition to creating or updating th... | bsd-3-clause | Python |
1f24740b360ceb7060620646c69ef6c9ae0751b3 | Bump version number | prophile/circle-asset | circle_asset/version.py | circle_asset/version.py | VERSION = '0.0.5'
SHORT_DESCRIPTION = 'Get the latest assets from CircleCI'
| VERSION = '0.0.4'
SHORT_DESCRIPTION = 'Get the latest assets from CircleCI'
| mit | Python |
f3646df8d7340581131e8d0e6f293cba793b5b47 | add loss, training | hughperkins/pub-prototyping,hughperkins/pub-prototyping,hughperkins/pub-prototyping,hughperkins/pub-prototyping,hughperkins/pub-prototyping,hughperkins/pub-prototyping,hughperkins/pub-prototyping | py/pytorch/net.py | py/pytorch/net.py | import torch
from torch import autograd, nn, optim
import torch.nn.functional as F
batch_size = 5
input_size = 4
hidden_size = 4
num_classes = 4
learning_rate = 0.001
torch.manual_seed(123)
input = autograd.Variable(torch.rand(batch_size, input_size) - 0.5)
target = autograd.Variable((torch.rand(batch_size) * num_cla... | import torch
from torch import autograd, nn
import torch.nn.functional as F
batch_size = 5
input_size = 3
hidden_size = 4
num_classes = 2
torch.manual_seed(123)
input = autograd.Variable(torch.rand(batch_size, input_size))
print('input', input)
class Model(nn.Module):
def __init__(self, input_size, hidden_size,... | apache-2.0 | Python |
b13cbe114a203158bdd46e77d3a6b3ae491a9a9a | Add helper methods to session model | PyconUK/2016.pyconuk.org,PyconUK/2016.pyconuk.org,PyconUK/2016.pyconuk.org | pyconuk/models.py | pyconuk/models.py | from django.db import models
from django_amber.models import ModelWithContent, ModelWithoutContent
class Page(ModelWithContent):
title = models.CharField(max_length=255)
callout_big_1 = models.CharField(max_length=255)
callout_big_2 = models.CharField(max_length=255)
callout_small = models.CharField(m... | from django.db import models
from django_amber.models import ModelWithContent, ModelWithoutContent
class Page(ModelWithContent):
title = models.CharField(max_length=255)
callout_big_1 = models.CharField(max_length=255)
callout_big_2 = models.CharField(max_length=255)
callout_small = models.CharField(m... | mit | Python |
5d4f0251e09a9ed77d42510b8b9bfcf8c8e70021 | Add I Think No Feature | iGene/igene_bot,aver803bath5/igene_bot | bot.py | bot.py | # -*- coding: utf-8 -*-
from telegram.ext import Updater
from telegram.ext import (Updater, CommandHandler, MessageHandler, Filters, RegexHandler,
ConversationHandler)
from bs4 import BeautifulSoup
from ConfigParser import RawConfigParser
import logging
import re
import requests
logging.basi... | # -*- coding: utf-8 -*-
from telegram.ext import Updater
from telegram.ext import (Updater, CommandHandler, MessageHandler, Filters, RegexHandler,
ConversationHandler)
from bs4 import BeautifulSoup
from ConfigParser import RawConfigParser
import logging
import re
import requests
logging.basi... | mit | Python |
09397436a61ac4d0614d96def5e3fadea90fbb95 | Bump version | wmayner/pyemd,wmayner/pyemd | pyemd/__init__.py | pyemd/__init__.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
PyEMD
=====
PyEMD is a Python wrapper for Ofir Pele and Michael Werman's implementation of
the Earth Mover's Distance (http://www.seas.upenn.edu/~ofirpele/FastEMD/code/)
that integrates it with NumPy.
>>> from pyemd import emd
>>> import numpy as np
>>> ... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
PyEMD
=====
PyEMD is a Python wrapper for Ofir Pele and Michael Werman's implementation of
the Earth Mover's Distance (http://www.seas.upenn.edu/~ofirpele/FastEMD/code/)
that integrates it with NumPy.
>>> from pyemd import emd
>>> import numpy as np
>>> ... | mit | Python |
9b280a52a8b06ac3af4dd511811119590795a836 | Fix to use latest ZIRC version | wolfy1339/Python-IRC-Bot | bot.py | bot.py | import zirc
import ssl
import socket
import utils
import commands
import logging
import config
logging.basicConfig(format=config.logFormat,
datefmt=config.timestampFormat,
level=config.logLevel)
class Bot(zirc.Client):
def __init__(self):
self.connection = zirc.So... | import zirc
import ssl
import socket
import utils
import commands
import logging
import config
logging.basicConfig(format=config.logFormat,
datefmt=config.timestampFormat,
level=config.logLevel)
class Bot(zirc.Client):
def __init__(self):
self.connection = zirc.So... | mit | Python |
beda766f0e34104cf877e2be4b43e581c72273fb | Remove unused global variable | diath/pyfsw,diath/pyfsw,diath/pyfsw | pyfsw/__init__.py | pyfsw/__init__.py | from flask import Flask, render_template, redirect, url_for, jsonify, request, current_app, g, session
from flask.ext.sqlalchemy import SQLAlchemy
from flask_debugtoolbar import DebugToolbarExtension
from pyfsw.config import *
from datetime import date, datetime
from functools import wraps
app = Flask(__name__)
app.... | from flask import Flask, render_template, redirect, url_for, jsonify, request, current_app, g, session
from flask.ext.sqlalchemy import SQLAlchemy
from flask_debugtoolbar import DebugToolbarExtension
from pyfsw.config import *
from datetime import date, datetime
from functools import wraps
app = Flask(__name__)
app.... | mit | Python |
be90a6cf60983467866ce74ff1458384a9f6c439 | Bump version to 1.2.1 | tempbottle/pykka,jodal/pykka | pykka/__init__.py | pykka/__init__.py | from pykka.actor import Actor, ActorRef
from pykka.exceptions import ActorDeadError, Timeout
from pykka.future import Future, get_all
from pykka.proxy import ActorProxy
from pykka.registry import ActorRegistry
from pykka.threading import ThreadingActor, ThreadingFuture
__all__ = [
'Actor',
'ActorDeadError',
... | from pykka.actor import Actor, ActorRef
from pykka.exceptions import ActorDeadError, Timeout
from pykka.future import Future, get_all
from pykka.proxy import ActorProxy
from pykka.registry import ActorRegistry
from pykka.threading import ThreadingActor, ThreadingFuture
__all__ = [
'Actor',
'ActorDeadError',
... | apache-2.0 | Python |
bf84fe6462eed5522627ad50bc728713f2ab1cdb | Add KeyExtractor to exports. | taschini/reg,morepath/reg | reg/__init__.py | reg/__init__.py | # flake8: noqa
from .implicit import implicit
from .registry import Registry, CachingKeyLookup, Lookup
from .dispatch import dispatch
from .mapply import mapply
from .arginfo import arginfo
from .argextract import KeyExtractor
from .sentinel import Sentinel, NOT_FOUND
from .error import RegistrationError, KeyExtractorE... | # flake8: noqa
from .implicit import implicit
from .registry import Registry, CachingKeyLookup, Lookup
from .dispatch import dispatch
from .mapply import mapply
from .arginfo import arginfo
from .sentinel import Sentinel, NOT_FOUND
from .error import RegistrationError, KeyExtractorError, NoImplicitLookupError
from .pre... | bsd-3-clause | Python |
74c9ac5994ad2f950fffb46dca6b54857cc685fa | Fix missing closing dialog | wouanagaine/SC4Mapper-2013,wouanagaine/SC4Mapper-2013,wouanagaine/SC4Mapper-2013 | QuestionDialog.py | QuestionDialog.py | """ taken from http://wiki.wxpython.org/index.cgi/GenericMessageDialog """
""" Dialog to ask a model question, with coder-specified list of buttons.
"""
import wx
class curry(object):
"""Taken from the Python Cookbook, this class provides an easy way to
tie up a function with some default parameters and call it l... | """ taken from http://wiki.wxpython.org/index.cgi/GenericMessageDialog """
""" Dialog to ask a model question, with coder-specified list of buttons.
"""
import wx
class curry(object):
"""Taken from the Python Cookbook, this class provides an easy way to
tie up a function with some default parameters and call it l... | bsd-2-clause | Python |
aeec3fe649ac25ec5abb66be86b44b5877f5b578 | Change Time | Multipixelone/RaspberryPiHydroponics,Multipixelone/RaspberryPiHydroponics | Full.py | Full.py | #!/usr/bin/env python
# Made by Multipixelone
# Automatic Ebb and Flow Hydroponics control
from time import sleep
import RPi.GPIO as GPIO
import schedule
import atexit
import threading
GPIO.setmode(GPIO.BCM)
GPIO.setup(17, GPIO.OUT)
GPIO.setup(22, GPIO.OUT)
GPIO.output(17, 0)
GPIO.output(22, 0)
print("Welcome to Raspbe... | #!/usr/bin/env python
# Made by Multipixelone
# Automatic Ebb and Flow Hydroponics control
from time import sleep
import RPi.GPIO as GPIO
import schedule
import atexit
import threading
GPIO.setmode(GPIO.BCM)
GPIO.setup(17, GPIO.OUT)
GPIO.setup(22, GPIO.OUT)
GPIO.output(17, 0)
GPIO.output(22, 0)
print("Welcome to Raspbe... | mit | Python |
60317dda9795391dd6468b573f5e1038ae1fe384 | Optimize DB access: use of prefetch_related() | dvalcarce/filmyou-web,dvalcarce/filmyou-web,dvalcarce/filmyou-web | src/apps/utils/db.py | src/apps/utils/db.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
def retrieve_in_order_from_db(model, ids, prefetch=True):
"""
Retrieve entities of the given model from the RDBMS in order given their ids.
:param model: model of the entities
:param ids: ids of the entities
:param prefetch: prefetch ... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
def retrieve_in_order_from_db(model, ids):
"""
Retrieve entities of the given model from the RDBMS in order given their ids.
:param model: model of the entities
:param ids: ids of the entities
:return: a list of entities
"""
#... | apache-2.0 | Python |
9e755c903446f7772b2e62358854eecc1ec132a6 | Add docstrings | lubomir/libtrie,lubomir/libtrie,lubomir/libtrie | Trie.py | Trie.py | #! /usr/bin/env python
# vim: set encoding=utf-8
"""
This module provides access to libtrie shared object. It should be faster than
spawning a process and communicating with it.
"""
from ctypes import cdll, c_char_p, c_void_p, create_string_buffer
libtrie = cdll.LoadLibrary("./libtrie.so")
libtrie.trie_load.argtypes... | #! /usr/bin/env python
# vim: set encoding=utf-8
from ctypes import cdll, c_char_p, c_void_p, create_string_buffer
libtrie = cdll.LoadLibrary("./libtrie.so")
libtrie.trie_load.argtypes = [c_char_p]
libtrie.trie_load.restype = c_void_p
libtrie.trie_lookup.argtypes = [c_void_p, c_char_p, c_char_p]
libtrie.trie_lookup.r... | bsd-3-clause | Python |
b76b3cbe0d86bd5037ccfd21086ab50803606ec2 | Add a codebase generator to the Github web hoook handler, to map the URL to the repo name for use as the codebase. | madisongh/autobuilder | autobuilder/webhooks.py | autobuilder/webhooks.py | from buildbot.status.web.hooks.github import GitHubEventHandler
from twisted.python import log
import abconfig
def codebasemap(payload):
return abconfig.get_project_for_url(payload['repository']['url'])
class AutobuilderGithubEventHandler(GitHubEventHandler):
def __init__(self, secret, strict codebase=None):... | from buildbot.status.web.hooks.github import GitHubEventHandler
from twisted.python import log
import abconfig
class AutobuilderGithubEventHandler(GitHubEventHandler):
def handle_push(self, payload):
# This field is unused:
user = None
# user = payload['pusher']['name']
repo = payl... | mit | Python |
406c16aa0e7ebfdee20bb32483d86b76c8887899 | Fix missing import os | mindbender-studio/core,getavalon/core,getavalon/core,mindbender-studio/core | avalon/fusion/workio.py | avalon/fusion/workio.py | """Host API required Work Files tool"""
import sys
import os
def file_extensions():
return [".comp"]
def has_unsaved_changes():
from avalon.fusion.pipeline import get_current_comp
comp = get_current_comp()
return comp.GetAttrs()["COMPB_Modified"]
def save(filepath):
from avalon.fusion.pipelin... | """Host API required Work Files tool"""
import sys
def file_extensions():
return [".comp"]
def has_unsaved_changes():
from avalon.fusion.pipeline import get_current_comp
comp = get_current_comp()
return comp.GetAttrs()["COMPB_Modified"]
def save(filepath):
from avalon.fusion.pipeline import g... | mit | Python |
e915d4660f5b716a8f3cb11910cbb91b10952458 | Handle non-image uploads | aaronkurtz/bricky,aaronkurtz/bricky | brickit.py | brickit.py | from datetime import datetime
import io
import os
import legofy
from PIL import Image
from flask import Flask, render_template, request, redirect, send_file
BRICK_PATH = os.path.join(os.path.dirname(legofy.__file__), "assets", "bricks", "1x1.png")
BRICK_IMAGE = Image.open(BRICK_PATH)
app = Flask(__name__)
@app.rou... | from datetime import datetime
import io
import os
import legofy
from PIL import Image
from flask import Flask, render_template, request, redirect, send_file
BRICK_PATH = os.path.join(os.path.dirname(legofy.__file__), "assets", "bricks", "1x1.png")
BRICK_IMAGE = Image.open(BRICK_PATH)
app = Flask(__name__)
@app.rou... | mit | Python |
184e59b0db9be1ae893e95a9565e44611213b35d | add fields to JobsDetails models | maxamillion/autocloud,kushaldas/autocloud,kushaldas/autocloud,maxamillion/autocloud,maxamillion/autocloud,kushaldas/autocloud,kushaldas/autocloud,maxamillion/autocloud | autocloud/models.py | autocloud/models.py | # -*- coding: utf-8 -*-
import os
import sys
from sqlalchemy import Column, ForeignKey, Integer, String
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy import create_engine
import autocloud
Base = declarative_base()
class JobDetails(Base):
__table... | # -*- coding: utf-8 -*-
import os
import sys
from sqlalchemy import Column, ForeignKey, Integer, String
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy import create_engine
import autocloud
Base = declarative_base()
class JobDetails(Base):
__table... | agpl-3.0 | Python |
9ad7b102cee20ced8f10cb1d35f6cc442b1c3d20 | Set exit code from main() | jayvdb/coala,SanketDG/coala,coala/coala,SanketDG/coala,jayvdb/coala,jayvdb/coala,coala-analyzer/coala,coala/coala,coala/coala,coala-analyzer/coala,SanketDG/coala,coala-analyzer/coala | coalib/coala_delete_orig.py | coalib/coala_delete_orig.py | import logging
import os
from coalib.output.Logging import configure_logging
from coalib.parsing import Globbing
from coalib.settings.ConfigurationGathering import get_config_directory
from coalib.settings.Section import Section
from coalib.parsing.Globbing import glob_escape
def main(log_printer=None, section: Sect... | import logging
import os
from coalib.output.Logging import configure_logging
from coalib.parsing import Globbing
from coalib.settings.ConfigurationGathering import get_config_directory
from coalib.settings.Section import Section
from coalib.parsing.Globbing import glob_escape
def main(log_printer=None, section: Sect... | agpl-3.0 | Python |
f453221201376e01ada4cd29d3f4f189a44174ab | revert compat to include python2/python3 types workaround | hirokihamasaki/irma,quarkslab/irma,hirokihamasaki/irma,hirokihamasaki/irma,hirokihamasaki/irma,hirokihamasaki/irma,quarkslab/irma,quarkslab/irma,quarkslab/irma | common/compat.py | common/compat.py | """ Helpers for python 2 and python 3 compatibility
This file should be imported in all modules
"""
import sys
import time
if sys.version_info >= (3,):
str = str
unicode = str
bytes = bytes
basestring = (str, bytes)
else:
str = str
unicode = unicode
bytes = str
basestring = basestrin... | """ Helpers for python 2 and python 3 compatibility
This file should be imported in all modules
"""
import time
def timestamp():
""" On some systems, time.time() returns a float
instead of an int. This function always returns an int
:rtype: int
:return: the current timestamp
"""
return int(... | apache-2.0 | Python |
4edd91830a2ab12aae77352a7aa83b34d9bea494 | bump version | renalreg/radar,renalreg/radar,renalreg/radar,renalreg/radar | radar/__init__.py | radar/__init__.py | __version__ = '2.48.20'
| __version__ = '2.48.19'
| agpl-3.0 | Python |
fa1a383aa194f028e9aa6eb4ff474281dd7c5bfe | Revert to try cleanest solution | jketo/arcusysdevday2015,jketo/arcusysdevday2015,jketo/arcusysdevday2015,jketo/arcusysdevday2015,jketo/arcusysdevday2015,jketo/arcusysdevday2015,jketo/arcusysdevday2015,jketo/arcusysdevday2015,jketo/arcusysdevday2015,jketo/arcusysdevday2015 | team2/python/rasacalculator.py | team2/python/rasacalculator.py | #!/usr/bin/env python
import argparse
def calculate_file_rasa(file_path):
row_count = 0
multiplier = 1
rasa = 0
for line in open(file_path):
row_count += 1
for char in line:
if char == '{':
multiplier += 1
if char == ';':
rasa +=... | import sys;s='%s: lines %d, RaSa: %d'
def u(z):
r=I=0;b=1
for m in open(z):
r+=1
for k in m:
if '{'==k:b+=1
if ';'==k:I+=b
if '}'==k:b-=1
return(r,I)
c=D=0
for z in sys.argv[1:]:
r,I=u(z);c+=r;D+=I;print s%(z,r,I)
print s%('total',c,D) | mit | Python |
f7d34c0611654a1ef2f7e2db830335d4312d28ff | bump version | renalreg/radar,renalreg/radar,renalreg/radar,renalreg/radar | radar/__init__.py | radar/__init__.py | __version__ = '2.46.43'
| __version__ = '2.46.42'
| agpl-3.0 | Python |
c03241320138fe7b545b43514e93615473270b0d | Remove unneeded import from testing. | lampwins/netbox,digitalocean/netbox,lampwins/netbox,digitalocean/netbox,lampwins/netbox,digitalocean/netbox,lampwins/netbox,digitalocean/netbox | netbox/dcim/fields.py | netbox/dcim/fields.py | from django.core.exceptions import ValidationError
from django.core.validators import MinValueValidator, MaxValueValidator
from django.db import models
from netaddr import AddrFormatError, EUI, mac_unix_expanded
class ASNField(models.BigIntegerField):
description = "32-bit ASN field"
default_validators = [
... | from django.core.exceptions import ValidationError
from django.core.validators import MinValueValidator, MaxValueValidator
from django.db import models
from netaddr import AddrFormatError, EUI, mac_unix_expanded
import pprint
class ASNField(models.BigIntegerField):
description = "32-bit ASN field"
default_val... | apache-2.0 | Python |
3b1fd6d101a2f370cce6094f41f728d5333ec759 | add v numbers | inovasolutions/django-knowledge,7wonders/django-knowledge,RDXT/django-knowledge,legrostdg/django-knowledge,zapier/django-knowledge,CantemoInternal/django-knowledge,7wonders/django-knowledge,legrostdg/django-knowledge,CantemoInternal/django-knowledge,zapier/django-knowledge,7wonders/django-knowledge,CantemoInternal/djan... | knowledge/__init__.py | knowledge/__init__.py | VERSION = (0, 0, 9)
| VERSION = (0, 0, 8)
| isc | Python |
ac3558e4096629ebbe32c75930975edf4c693769 | add bh test for no significant p-values | reychil/project-alpha-1,berkeley-stat159/project-alpha | code/utils/tests/test_bh.py | code/utils/tests/test_bh.py | """ Tests for bh_procedure in benjamini_hochberg module
Run at the project directory with:
nosetests code/utils/tests/test_bh.py
"""
# Loading modules.
import numpy as np
import itertools
import scipy.ndimage
from scipy.ndimage.filters import gaussian_filter
import matplotlib.pyplot as plt
import nibabel as nib
i... | """ Tests for bh_procedure in benjamini_hochberg module
Run at the project directory with:
nosetests code/utils/tests/test_bh.py
"""
# Loading modules.
import numpy as np
import itertools
import scipy.ndimage
from scipy.ndimage.filters import gaussian_filter
import matplotlib.pyplot as plt
import nibabel as nib
i... | bsd-3-clause | Python |
4a8b1a7633279e3276fceb3e12eca852dc583764 | Add is_active() method to the Baro class | pabletos/Hubot-Warframe,pabletos/Hubot-Warframe | baro.py | baro.py | from datetime import datetime
import utils
class Baro:
"""This class contains info about the Void Trader and is initialized with
data in JSON format
"""
def __init__(self, data):
self.config = data['Config']
self.start = datetime.fromtimestamp(data['Activation'... | from datetime import datetime
import utils
class Baro:
"""This class contains info about the Void Trader and is initialized with
data in JSON format
"""
def __init__(self, data):
self.config = data['Config']
self.start = datetime.fromtimestamp(data['Activation'... | mit | Python |
66901adf7738f4684147f701006db1214eb8f50f | Add option to show menu for next day. | kdungs/R1D2 | cli.py | cli.py | #!/usr/bin/env python
import argparse
import requests
import sys
from datetime import date
URL = 'https://r1d2.herokuapp.com'
DAYS = ('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday')
def get_json(url):
return requests.get(url).json()
def get_menu(json):
return json['menu']
def format_item(name, p... | #!/usr/bin/env python
import argparse
import requests
import sys
URL = 'https://r1d2.herokuapp.com'
def get_json(url):
return requests.get(url).json()
def get_menu(json):
return json['menu']
def format_item(name, price):
return '{} (CHF {:.2f})'.format(name, price)
def print_menu(menu, day=None):
... | mit | Python |
703640002ee7a24ae568a1a7b9af36b69b1cf29c | Fix error in roseisrose crawler | jodal/comics,klette/comics,datagutten/comics,datagutten/comics,datagutten/comics,klette/comics,datagutten/comics,klette/comics,jodal/comics,jodal/comics,jodal/comics | comics/comics/roseisrose.py | comics/comics/roseisrose.py | from comics.aggregator.crawler import GoComicsComCrawlerBase
from comics.meta.base import MetaBase
class Meta(MetaBase):
name = 'Rose Is Rose'
language = 'en'
url = 'http://www.gocomics.com/roseisrose/'
start_date = '1984-10-02'
rights = 'Pat Brady'
class Crawler(GoComicsComCrawlerBase):
histo... | from comics.aggregator.crawler import GoComicsComCrawlerBase
from comics.meta.base import MetaBase
class Meta(MetaBase):
name = 'Rose Is Rose'
language = 'en'
url = 'http://www.gocomics.com/roseisrose/'
start_date = '1984-10-02'
rights = 'Pat Brady'
class Crawler(GoComicsComCrawlerBase):
histo... | agpl-3.0 | Python |
535cc008576dfa833b12c1e01bd8d6fa22769373 | Bump to version 0.41.0 | reubano/tabutils,reubano/tabutils,reubano/meza,reubano/tabutils,reubano/meza,reubano/meza | meza/__init__.py | meza/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
meza
~~~~
Provides methods for reading and processing data from tabular formatted files
Attributes:
CURRENCIES [tuple(unicode)]: Currency symbols to remove from decimal
strings.
ENCODING (str): Default file encoding.
DEF... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
meza
~~~~
Provides methods for reading and processing data from tabular formatted files
Attributes:
CURRENCIES [tuple(unicode)]: Currency symbols to remove from decimal
strings.
ENCODING (str): Default file encoding.
DEF... | mit | Python |
99b14d629b9d376023af2b13b8ea604538bb015b | Add my homework for the fibonacci sequence. | bigfatpanda-training/pandas-practical-python-primer,bigfatpanda-training/pandas-practical-python-primer | training/level-1-the-zen-of-python/bfp-reference/fibonacci.py | training/level-1-the-zen-of-python/bfp-reference/fibonacci.py | """
Each new term in the Fibonacci sequence is generated by adding the previous
two terms. By starting with 1 and 2, the first 10 terms will be:
1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
By considering the terms in the Fibonacci sequence whose values do not
exceed four million, find the sum of the even-valued terms.
"""... | """
Each new term in the Fibonacci sequence is generated by adding the previous
two terms. By starting with 1 and 2, the first 10 terms will be:
1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
By considering the terms in the Fibonacci sequence whose values do not
exceed four million, find the sum of the even-valued terms.
"""... | artistic-2.0 | Python |
0702c3b8e29e1ef011c79d41c0c0617ddf8e7696 | remove comment lines that have leading whitespace | dialt0ne/cloudformation-helpers | mkcfnuserdata.py | mkcfnuserdata.py | #!/usr/bin/env python
#
# mkcfnuserdata.py
#
# ATonns Wed May 1 16:51:58 EDT 2013
#
# Copyright 2013 Corsis
# http://www.corsis.com/
#
# 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... | #!/usr/bin/env python
#
# mkcfnuserdata.py
#
# ATonns Wed May 1 16:51:58 EDT 2013
#
# Copyright 2013 Corsis
# http://www.corsis.com/
#
# 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... | apache-2.0 | Python |
7c4fa85f4fd061bf7ebbf784a77a9b080af42b7b | fix rpython | fijal/quill | nolang/frameobject.py | nolang/frameobject.py |
from nolang.objects.root import W_Root
class Frame(W_Root):
def __init__(self, bytecode, f_back):
self.bytecode = bytecode
self.f_back = f_back
if bytecode.module is not None: # for tests
self.globals_w = bytecode.module.functions
self.locals_w = [None] * len(bytecode.v... |
class Frame(object):
def __init__(self, bytecode, f_back):
self.bytecode = bytecode
self.f_back = f_back
if bytecode.module is not None: # for tests
self.globals_w = bytecode.module.functions
self.locals_w = [None] * len(bytecode.varnames)
self.stack_w = [None] *... | mit | Python |
3e8921b2edcf8a675b6ed496cf5e282c76cc2070 | Update retrieve() for FoodMenu data | alykhank/FoodMenu,alykhank/FoodMenu,alykhank/FoodMenu | retrieveData.py | retrieveData.py | #!/usr/bin/env python
import json, os, requests
from models import db, FoodMenu, FoodServices
key = os.environ.get('UWOPENDATA_APIKEY')
def getData(service):
payload = {'key': key, 'service': service}
r = requests.get('http://api.uwaterloo.ca/public/v1/', params=payload)
return r
def retrieve():
payload = {'key'... | #!/usr/bin/env python
import json, os, requests
from models import db, FoodMenu, FoodServices
key = os.environ.get('UWOPENDATA_APIKEY')
def getData(service):
payload = {'key': key, 'service': service}
r = requests.get('http://api.uwaterloo.ca/public/v1/', params=payload)
return r
foodMenu = getData('FoodMenu').te... | mit | Python |
908dfc7434adebdec408fd6c322c2fc13764fb9d | Fix pylint | abaldwin88/roamer | roamer/entry.py | roamer/entry.py | """
Represents a single entry from the operating system. Either a file or a directory.
"""
import os
import sys
import hashlib
class Entry(object):
"""
argh
"""
def __init__(self, name, directory, digest=None):
self.directory = directory
self.name = name
self.set_path()
... | """
Represents a single entry from the operating system. Either a file or a directory.
"""
import os
import sys
import hashlib
class Entry(object):
"""
argh
"""
def __init__(self, name, directory, digest=None):
self.directory = directory
self.name = name
self.set_path()
... | mit | Python |
17c47a92cc244cd369213d3d063f2a40e17b3e45 | Bump version | MaximeLM/superlachaise_api,MaximeLM/superlachaise_api | conf.py | conf.py | # -*- coding: utf-8 -*-
"""
conf.py
superlachaise_api
Created by Maxime Le Moine on 19/06/2015.
Copyright (c) 2015 Maxime Le Moine.
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:ww... | # -*- coding: utf-8 -*-
"""
conf.py
superlachaise_api
Created by Maxime Le Moine on 19/06/2015.
Copyright (c) 2015 Maxime Le Moine.
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:ww... | apache-2.0 | Python |
0586bb514247fa380f7caa472fd4225c7ad233bf | Update monitor.py | unitedstack/rock,unitedstack/rock | rock/monitor.py | rock/monitor.py | # Copyright 2011 OpenStack Foundation.
# 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 req... | # Copyright 2011 OpenStack Foundation.
# 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 req... | apache-2.0 | Python |
9dd8f57ed999754aca52638f3fd56da14085f91d | fix print statement | djfkahn/MemberHubDirectoryTools | roster_tools.py | roster_tools.py | #!/usr/bin/env python
"""This program inputs a MemberHub directory dump, and analyzes it.
"""
import family
def ReadRoster():
roster = [] # empty list
student_count = 0
file_name = raw_input('Enter name of roster comma-separated text file: ')
print file_name
try:
open_file = open(... | #!/usr/bin/env python
"""This program inputs a MemberHub directory dump, and analyzes it.
"""
import family
def ReadRoster():
roster = [] # empty list
student_count = 0
file_name = raw_input('Enter name of roster comma-separated text file: ')
print file_name
try:
open_file = open(... | apache-2.0 | Python |
510252c73654c25f47c8eebfe6c5ff2da742a432 | add fix.py | purpleidea/scintillator | fix.py | fix.py | #!/usr/bin/python
import sys
from settings import * #my settings
# (works)
# cat S355Cnov29th2006.dat | python testio.py > iamIO.txt
# for i in `ls *.dat`; do cat $i | python ../../newest/fix.py > $i.txt; done
def int2bin(n, count=8):
"""returns the binary of integer n, using count number of digits"""
return... | #!/usr/bin/python
import sys
from settings import * #my settings
# (works)
# cat S355Cnov29th2006.dat | python testio.py > iamIO.txt
# for i in `ls *.dat`; do cat $i | python ../../newest/fix.py > $i.txt; done
def int2bin(n, count=8):
"""returns the binary of integer n, using count number of digits"""
return... | agpl-3.0 | Python |
a7efc3acfa31eb1ddfe943e68b5736e639b52261 | remove ThreadingMixIn | caktus/rapidsms-twilio | rtwilio/http.py | rtwilio/http.py | import select
from django import http
from django.core.handlers.wsgi import WSGIHandler, STATUS_CODE_TEXT
from django.core.servers.basehttp import WSGIServer, WSGIRequestHandler
from rapidsms.log.mixin import LoggerMixin
class TwilioHandler(WSGIHandler, LoggerMixin):
""" WSGIHandler without Django middleware an... | import select
import SocketServer
from django import http
from django.core.handlers.wsgi import WSGIHandler, STATUS_CODE_TEXT
from django.core.servers.basehttp import WSGIServer, WSGIRequestHandler
from rapidsms.log.mixin import LoggerMixin
class TwilioHandler(WSGIHandler, LoggerMixin):
""" WSGIHandler without ... | bsd-3-clause | Python |
0ab1e90865f8db8b6c22321c5a9335036745955e | fix user signal error | duoduo369/django-scaffold,duoduo369/django-scaffold | myauth/models.py | myauth/models.py | # -*- coding: utf-8 -*-
from django.conf import settings
from django.contrib.auth.models import User
from django.db import models
from django.db.models.signals import post_save, pre_save
from django.dispatch import receiver
from django.utils.translation import ugettext as _
class UserProfile(models.Model):
'''
... | # -*- coding: utf-8 -*-
from django.conf import settings
from django.contrib.auth.models import User
from django.db import models
from django.db.models.signals import post_save, pre_save
from django.dispatch import receiver
from django.utils.translation import ugettext as _
class UserProfile(models.Model):
'''
... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.